X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.c;h=427a74ebe0c8d17c98fe8a34a90fdee245363252;hb=3d07b68a314ce189f207e42d95f786979662410d;hp=7c51c2b6810683cee41230f8c2dc72f1691a2835;hpb=41cfe645942062496cd063eb46e17d677a76c645;p=rocksndiamonds.git diff --git a/src/main.c b/src/main.c index 7c51c2b6..427a74eb 100644 --- a/src/main.c +++ b/src/main.c @@ -11,37 +11,53 @@ * main.c * ***********************************************************/ +#include "libgame/libgame.h" + #include "main.h" #include "init.h" #include "game.h" #include "events.h" -#include "sound.h" #include "joystick.h" -#include "misc.h" -#ifdef MSDOS +#if 0 +#if defined(PLATFORM_MSDOS) #include #endif +#endif -Display *display; -Visual *visual; -int screen; -DrawWindow window; -GC gc, clip_gc[NUM_BITMAPS], tile_clip_gc; +#if 0 +DrawWindow window = None; +DrawBuffer backbuffer; +GC gc; +#endif + +#if 0 +GC clip_gc[NUM_BITMAPS]; +#endif +GC tile_clip_gc; Bitmap pix[NUM_BITMAPS]; -Bitmap pix_masked[NUM_BITMAPS], tile_masked[NUM_TILES]; -Pixmap clipmask[NUM_BITMAPS], tile_clipmask[NUM_TILES]; +#if 0 +Bitmap pix_masked[NUM_BITMAPS]; -#ifdef USE_XPM_LIBRARY -XpmAttributes xpm_att[NUM_PICTURES]; +Bitmap tile_masked[NUM_TILES]; + +Pixmap clipmask[NUM_BITMAPS]; #endif +Pixmap tile_clipmask[NUM_TILES]; -DrawBuffer drawto, drawto_field, backbuffer, fieldbuffer; +#if 0 +DrawBuffer drawto; +#endif + +DrawBuffer drawto_field, fieldbuffer; +#if 0 Colormap cmap; +#endif + +#if 0 +char *sound_device_name = AUDIO_DEVICE; +#endif -int sound_pipe[2]; -int sound_device; -char *sound_device_name = SOUND_DEVICE; int joystick_device = 0; char *joystick_device_name[MAX_PLAYERS] = { @@ -51,23 +67,35 @@ char *joystick_device_name[MAX_PLAYERS] = DEV_JOYSTICK_3 }; +#if 0 char *program_name = NULL; +#endif int game_status = MAINMENU; boolean level_editor_test_game = FALSE; boolean network_playing = FALSE; + +#if 0 int button_status = MB_NOT_PRESSED; boolean motion_status = FALSE; +#endif + int key_joystick_mapping = 0; int global_joystick_status = JOYSTICK_STATUS; int joystick_status = JOYSTICK_STATUS; -int sound_status = SOUND_STATUS; -boolean sound_loops_allowed = FALSE; + +#if 0 +boolean fullscreen_available = FULLSCREEN_STATUS; +boolean fullscreen_enabled = FALSE; +#endif boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; int redraw_x1 = 0, redraw_y1 = 0; + +#if 0 int redraw_mask; int redraw_tiles; +#endif short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; @@ -99,19 +127,38 @@ int SBX_Left, SBX_Right; int SBY_Upper, SBY_Lower; int ZX,ZY, ExitX,ExitY; int AllPlayersGone; -int FrameCounter, TimeFrames, TimePlayed, TimeLeft; + +#if 0 +int FrameCounter; +#endif + +int TimeFrames, TimePlayed, TimeLeft; boolean network_player_action_received = FALSE; +#if 0 struct LevelDirInfo *leveldir_first = NULL, *leveldir_current = NULL; +#endif struct LevelInfo level; struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL; struct HiScore highscore[MAX_SCORE_ENTRIES]; -struct SoundInfo Sound[NUM_SOUNDS]; +#if 0 +struct SampleInfo Sound[NUM_SOUNDS]; +#endif struct TapeInfo tape; + +#if 0 struct OptionInfo options; +#endif + struct SetupInfo setup; struct GameInfo game; + +#if 0 +struct VideoSystemInfo video; +struct AudioSystemInfo audio; +#endif + struct GlobalInfo global; /* data needed for playing sounds */ @@ -563,14 +610,17 @@ char *element_info[] = "-------------------------------", */ }; +int num_element_info = sizeof(element_info)/sizeof(char *); +#if 0 + /* +-----------------------------------------------------------------------+ */ /* | SDL TEST STUFF | */ /* +-----------------------------------------------------------------------+ */ -#ifdef USE_SDL_LIBRARY +#if defined(TARGET_SDL) SDL_Surface *sdl_screen, *sdl_image_tmp, *sdl_image, *sdl_image_masked; SDL_Surface *sdl_image2_tmp, *sdl_image2, *sdl_image2_masked; @@ -934,29 +984,39 @@ void TEST_SDL_JOYSTICK() SDL_QuitSubSystem(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK); } -#endif /* USE_SDL_LIBRARY */ +#endif /* TARGET_SDL */ /* +-----------------------------------------------------------------------+ */ /* | SDL TEST STUFF | */ /* +-----------------------------------------------------------------------+ */ +#endif + int main(int argc, char *argv[]) { +#if 0 program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]); +#endif -#ifdef MSDOS + InitCommandName(argv[0]); + InitExitFunction(CloseAllAndExit); + InitPlatformDependantStuff(); + +#if 0 +#if defined(PLATFORM_MSDOS) _fmode = O_BINARY; #endif +#endif #if 1 GetOptions(argv); - OpenAll(argc,argv); + OpenAll(); #endif #if 0 -#ifdef USE_SDL_LIBRARY +#ifdef TARGET_SDL /* TEST_SDL_BLIT_RECT((WIN_XSIZE - TILEX)/2, (WIN_YSIZE - TILEY)/2); TEST_SDL_EVENT_LOOP();