Skip to content

Commit c0a075b

Browse files
authored
Fixed Linux build issues; good luck Windows!
1 parent 0fd6dfb commit c0a075b

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ bool doBattle(player* player, bool isBoss)
15141514
if ((playerTurn && player->HP > 0) || (!playerTurn && enemyHP > 0 && !run))
15151515
{
15161516
bool dispDamage = false;
1517-
drawTextBox(textBoxText, player, (SDL_Color){0, 0, 0}, (SDL_Rect){.y = 9 * TILE_SIZE, .w = SCREEN_WIDTH, .h = (HEIGHT_IN_TILES - 9) * TILE_SIZE}, true);
1517+
drawTextBox(textBoxText, player, (SDL_Color){0, 0, 0}, (SDL_Rect){.y = 9 * TILE_SIZE, .w = SCREEN_WIDTH, .h = (HEIGHT_IN_TILES - 9) * TILE_SIZE}, false);
15181518
if (((attackCode != ATTACK_CODE_BLOCK && attackCode != ATTACK_CODE_RUN) && playerTurn) || !playerTurn)
15191519
{
15201520
drawText("DAMAGE:", TILE_SIZE / 4, 10 * TILE_SIZE + 2 * TILE_SIZE / 8 , SCREEN_WIDTH, TILE_SIZE, (SDL_Color){0, 0, 0}, false);

outerSDL.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828
#define ARRAY_OF_MAP_IDS {playerSprite->worldNum, 1.1, 1.2, 1.21, 1.22, 1.31, 1.32, 1.33, 2.1, 2.11, 2.12, 2.21, 2.22, 2.23, 2.33, 3.1, 3.2, 3.22, 3.3, 3.31, 3.32, 4.1, 4.11, 4.12, 4.21, 4.22, 4.31, 4.32, 5.1, 5.11, 5.12, 5.2, 5.21, 5.22, 5.32, 6.1, 6.11, 6.2, 6.21, 6.22, 6.31, 6.32, 7.1, 7.11, 7.12, 7.13, 7.2, 7.21, 7.22, 7.23, 7.24, 8.1, 8.11, 8.2, 8.21, 8.22, 8.32, 8.33}
2929
#define SIZE_OF_MAP_ARRAY 58
3030

31+
SDL_Window* mainWindow;
32+
SDL_Surface* mainScreen;
33+
SDL_Texture* tilesetTexture;
34+
SDL_Renderer* mainRenderer;
35+
bool textBoxOn;
36+
TTF_Font* mainFont;
37+
//TTF_Font* smallFont;
38+
int tilemap[HEIGHT_IN_TILES][WIDTH_IN_TILES];
39+
40+
int CUSTOM_SCANCODES[SIZE_OF_SCANCODE_ARRAY];
41+
3142
int init()
3243
{
3344
int done = 0;

outerSDL.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
*/
1515
#define SDL_MAIN_HANDLED 1
1616

17-
#include "SDL/SDL.h" //This is included because it's an SDL2 program... duh
18-
#include "SDL/SDL_image.h" //This is included so we can use PNGs.
19-
#include "SDL/SDL_ttf.h" //This is included for text stuff
17+
#include <SDL2/SDL.h> //This is included because it's an SDL2 program... duh
18+
#include <SDL2/SDL_image.h> //This is included so we can use PNGs.
19+
#include <SDL2/SDL_ttf.h> //This is included for text stuff
2020
#include <stdio.h> //This is included because it's fundamental always. Even if it ain't needed
2121
#include <string.h> //This is included for strncat and other string functions
2222
#include <stdlib.h> //This is included for calloc, rand(), and a lot of other stuff
@@ -156,7 +156,7 @@ bool checkCollision(); //checks if player has collided with a solid tile
156156
SDL_Keycode waitForKey(); //waits for a player to press any key, returns the key that was pressed
157157
void savePlayerData(player* player, char* filePath); //saves sprite data to a file
158158
void saveConfig(char* filePath); //saves config data to the file
159-
void changeKey(int keyIndex, int newKey, bool isKeyCode); //changes the key read from CUSTOM_SCANCODES[keyIndex] to newKey. Converts from keycode, if last arg evals to true.
159+
void changeKey(int keyIndex, int newKey, bool isKeyCode); //changes the key read from CUSTOM_SCANCODES[keyIndex] to newKey. Converts from keycode, if last arg evals to true.
160160
void closeSDL(); //closes out SDL and necessary game systems
161161

162162
char* toString(int value, char * result); //turns inputted int into a string
@@ -172,16 +172,16 @@ int writeLine(char* filePath, char* stuff); //appends a line to a file
172172
char* readLine(char* filePath, int lineNum, char** output); //reads a certain line from a file
173173

174174

175-
SDL_Window* mainWindow;
176-
SDL_Surface* mainScreen;
177-
SDL_Texture* tilesetTexture;
178-
SDL_Renderer* mainRenderer;
179-
bool textBoxOn;
180-
TTF_Font* mainFont;
175+
extern SDL_Window* mainWindow;
176+
extern SDL_Surface* mainScreen;
177+
extern SDL_Texture* tilesetTexture;
178+
extern SDL_Renderer* mainRenderer;
179+
extern bool textBoxOn;
180+
extern TTF_Font* mainFont;
181181
//TTF_Font* smallFont;
182-
int tilemap[HEIGHT_IN_TILES][WIDTH_IN_TILES];
182+
extern int tilemap[HEIGHT_IN_TILES][WIDTH_IN_TILES];
183183

184-
int CUSTOM_SCANCODES[SIZE_OF_SCANCODE_ARRAY];
184+
extern int CUSTOM_SCANCODES[SIZE_OF_SCANCODE_ARRAY];
185185
#define SC_UP CUSTOM_SCANCODES[0]
186186
#define SC_DOWN CUSTOM_SCANCODES[1]
187187
#define SC_LEFT CUSTOM_SCANCODES[2]

version.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define VERSION_H
33

44
//Date Version Types
5-
#define DATE "25"
6-
#define MONTH "10"
5+
#define DATE "30"
6+
#define MONTH "11"
77
#define YEAR "2017"
8-
#define UBUNTU_VERSION_STYLE "17.10"
8+
#define UBUNTU_VERSION_STYLE "17.11"
99

1010
//Software Status
1111
#define STATUS ""
@@ -14,14 +14,14 @@
1414
//Standard Version Type
1515
#define MAJOR 1
1616
#define MINOR 1
17-
#define BUILD 0
17+
#define BUILD 2
1818
#define REVISION 0
1919

2020
//Miscellaneous Version Types
2121
#define BUILDS_COUNT 434
22-
#define RC_FILEVERSION 1,1,0,0
23-
#define RC_FILEVERSION_STRING "1, 1, 0, 0\0"
24-
#define FULLVERSION_STRING "1.1.0.0"
22+
#define RC_FILEVERSION 1,1,2,0
23+
#define RC_FILEVERSION_STRING "1, 1, 2, 0\0"
24+
#define FULLVERSION_STRING "1.1.2.0"
2525

2626
//These values are to keep track of your versioning state, don't modify them.
2727
#define BUILD_HISTORY 0

0 commit comments

Comments
 (0)