From adc4405cc2806d2e18e5ec9bc8018dc91983dd0e Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Wed, 17 Apr 2002 09:11:23 +0000 Subject: [PATCH] MacOS X fixes. --- AUTHORS | 5 ++++- ChangeLog | 4 ++++ globals.h | 47 ++++++++++++++++++++++++++++++++--------------- main.c | 18 +++++++++++++----- modify/pack.c | 4 ++-- 5 files changed, 55 insertions(+), 23 deletions(-) diff --git a/AUTHORS b/AUTHORS index e1c4812..659e088 100644 --- a/AUTHORS +++ b/AUTHORS @@ -33,4 +33,7 @@ G Made the website http://jumpbump.mine.nu/ and hosts it. Promotion. Florian Schulze - Cleaned up code. Added scaling graphics mode (800x512). Fixed sound. \ No newline at end of file + Cleaned up code. Added scaling graphics mode (800x512). Fixed sound. + +Ben Hines + MacOS X fixes. diff --git a/ChangeLog b/ChangeLog index 5229e15..ed77f6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +- 1.2 + - MacOS X fixes + - some endian fixes + 24 Feb 2002 - 1.1 - fixed timing problems - fixed crash when temporary music can't be written diff --git a/globals.h b/globals.h index 85212d4..ebb33ae 100644 --- a/globals.h +++ b/globals.h @@ -144,6 +144,16 @@ extern int bytes_per_pixel; #define BAN_ICE 3 #define BAN_SPRING 4 +#ifndef DATA_PATH +#ifdef __APPLE__ +#define DATA_PATH "data/jumpbump.dat" +#elif _WIN32 +#define DATA_PATH "data/jumpbump.dat" +#elif +#define DATA_PATH "/usr/share/jumpnbump/jumpbump.dat" +#endif +#endif + typedef struct { int num_images; int *width; @@ -154,7 +164,7 @@ typedef struct { void **orig_data; } gob_t; -struct { +typedef struct { int joy_enabled, mouse_enabled; int no_sound, no_gore, fireworks; char error_str[256]; @@ -169,9 +179,9 @@ struct { } pobs[NUM_POBS]; } page_info[2]; void *pob_backbuf[2]; -} main_info; +} main_info_t; -struct { +typedef struct { int action_left,action_up,action_right; int enabled, dead_flag; int bumps; @@ -180,18 +190,18 @@ struct { int x_add, y_add; int direction, jump_ready, jump_abort, in_water; int anim, frame, frame_tick, image; -} player[4]; +} player_t; -struct { +typedef struct { int num_frames; int restart_frame; struct { int image; int ticks; } frame[4]; -} player_anims[7]; +} player_anim_t; -struct { +typedef struct { int used, type; int x, y; int x_add, y_add; @@ -199,9 +209,9 @@ struct { int anim; int frame, ticks; int image; -} objects[NUM_OBJECTS]; +} object_t; -struct { +typedef struct { int x, y; int raw_x, raw_y; int but1, but2; @@ -209,16 +219,23 @@ struct { int x1, x2, x3; int y1, y2, y3; } calib_data; -} joy; +} joy_t; -struct { +typedef struct { int but1, but2, but3; -} mouse; +} mouse_t; + +extern main_info_t main_info; +extern player_t player[4]; +extern player_anim_t player_anims[7]; +extern object_t objects[NUM_OBJECTS]; +extern joy_t joy; +extern mouse_t mouse; -char datfile_name[2048]; +extern char datfile_name[2048]; -char *background_pic; -char *mask_pic; +extern char *background_pic; +extern char *mask_pic; extern gob_t rabbit_gobs; extern gob_t font_gobs; diff --git a/main.c b/main.c index 3dc783f..d26a285 100644 --- a/main.c +++ b/main.c @@ -38,6 +38,18 @@ gob_t font_gobs = { 0 }; gob_t object_gobs = { 0 }; gob_t number_gobs = { 0 }; +main_info_t main_info; +player_t player[4]; +player_anim_t player_anims[7]; +object_t objects[NUM_OBJECTS]; +joy_t joy; +mouse_t mouse; + +char datfile_name[2048]; + +char *background_pic; +char *mask_pic; + unsigned int ban_map[17][22] = { {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, @@ -1834,11 +1846,7 @@ int init_program(int argc, char *argv[], char *pal) memset(&main_info, 0, sizeof(main_info)); -#ifdef _WIN32 - strcpy(datfile_name, "data/jumpbump.dat"); -#else - strcpy(datfile_name, "/usr/share/jumpnbump/jumpbump.dat"); -#endif + strcpy(datfile_name, DATA_PATH); force2 = force3 = 0; diff --git a/modify/pack.c b/modify/pack.c index 0aade39..6f60e9f 100644 --- a/modify/pack.c +++ b/modify/pack.c @@ -33,7 +33,7 @@ #include #include #include -#ifndef _WIN32 +#ifdef LINUX #include #endif #ifndef _MSC_VER @@ -61,7 +61,7 @@ int main(int argc, char **argv) char *outfile = NULL; int offset = 0; -#ifndef _WIN32 +#ifdef LINUX while ((c = getopt(argc, argv, "o:")) != EOF) { switch (c) { case 'o': -- 2.39.2