rnd-20001201-1-src
[rocksndiamonds.git] / src / main.c
index 33b276bb0f74832aef7e19dba45b011f82ed9942..8bf9e7757d705e3ebbebdc74edc8e9d144bb721c 100644 (file)
 *  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 defined(PLATFORM_MSDOS)
 #include <fcntl.h>
 #endif
 
-Display        *display;
-Visual        *visual;
-int            screen;
+#if 0
 DrawWindow     window = None;
-GC             gc, clip_gc[NUM_BITMAPS], tile_clip_gc;
+GC             gc;
+#endif
+
+GC             clip_gc[NUM_BITMAPS], tile_clip_gc;
 Bitmap         pix[NUM_BITMAPS];
 Bitmap         pix_masked[NUM_BITMAPS], tile_masked[NUM_TILES];
 Pixmap         clipmask[NUM_BITMAPS], tile_clipmask[NUM_TILES];
 
 DrawBuffer     drawto, drawto_field, backbuffer, 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] =
 {
@@ -57,10 +61,11 @@ boolean             motion_status = FALSE;
 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;
@@ -97,7 +102,12 @@ 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;
 
@@ -105,11 +115,21 @@ struct LevelDirInfo    *leveldir_first = NULL, *leveldir_current = NULL;
 struct LevelInfo       level;
 struct PlayerInfo      stored_player[MAX_PLAYERS], *local_player = NULL;
 struct HiScore         highscore[MAX_SCORE_ENTRIES];
-struct SoundInfo       Sound[NUM_SOUNDS];
+struct SampleInfo      Sound[NUM_SOUNDS];
 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 */
@@ -569,7 +589,7 @@ int num_element_info = sizeof(element_info)/sizeof(char *);
 /* | SDL TEST STUFF                                                        | */
 /* +-----------------------------------------------------------------------+ */
 
-#ifdef USE_SDL_JOYSTICK
+#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;
@@ -933,7 +953,7 @@ void TEST_SDL_JOYSTICK()
   SDL_QuitSubSystem(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK);
 }
 
-#endif /* USE_SDL_JOYSTICK */
+#endif /* TARGET_SDL */
 
 /* +-----------------------------------------------------------------------+ */
 /* | SDL TEST STUFF                                                        | */
@@ -945,7 +965,7 @@ int main(int argc, char *argv[])
 {
   program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]);
 
-#ifdef MSDOS
+#if defined(PLATFORM_MSDOS)
   _fmode = O_BINARY;
 #endif
 
@@ -955,7 +975,7 @@ int main(int argc, char *argv[])
 #endif
 
 #if 0
-#ifdef USE_SDL_JOYSTICK
+#ifdef TARGET_SDL
   /*
   TEST_SDL_BLIT_RECT((WIN_XSIZE - TILEX)/2, (WIN_YSIZE - TILEY)/2);
   TEST_SDL_EVENT_LOOP();