rnd-20001128-1-src
[rocksndiamonds.git] / src / main.c
index 7c51c2b6810683cee41230f8c2dc72f1691a2835..49fde3e9941378ca31fcbe7c6535d5edf1bfb3f8 100644 (file)
 #include "joystick.h"
 #include "misc.h"
 
-#ifdef MSDOS
+#if defined(PLATFORM_MSDOS)
 #include <fcntl.h>
 #endif
 
 Display        *display;
 Visual        *visual;
 int            screen;
-DrawWindow     window;
+DrawWindow     window = None;
 GC             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];
 
-#ifdef USE_XPM_LIBRARY
-XpmAttributes  xpm_att[NUM_PICTURES];
-#endif
-
 DrawBuffer     drawto, drawto_field, backbuffer, fieldbuffer;
 Colormap       cmap;
 
-int            sound_pipe[2];
-int            sound_device;
 char          *sound_device_name = SOUND_DEVICE;
+
 int            joystick_device = 0;
 char          *joystick_device_name[MAX_PLAYERS] =
 {
@@ -61,8 +56,8 @@ 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;
+boolean                fullscreen_available = FULLSCREEN_STATUS;
+boolean                fullscreen_enabled = FALSE;
 
 boolean                redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
 int            redraw_x1 = 0, redraw_y1 = 0;
@@ -107,11 +102,12 @@ 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;
 struct OptionInfo      options;
 struct SetupInfo       setup;
 struct GameInfo                game;
+struct SystemInfo      sysinfo;
 struct GlobalInfo      global;
 
 /* data needed for playing sounds */
@@ -563,6 +559,7 @@ char *element_info[] =
   "-------------------------------",
   */
 };
+int num_element_info = sizeof(element_info)/sizeof(char *);
 
 
 
@@ -570,7 +567,7 @@ char *element_info[] =
 /* | 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,7 +931,7 @@ void TEST_SDL_JOYSTICK()
   SDL_QuitSubSystem(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK);
 }
 
-#endif /* USE_SDL_LIBRARY */
+#endif /* TARGET_SDL */
 
 /* +-----------------------------------------------------------------------+ */
 /* | SDL TEST STUFF                                                        | */
@@ -946,7 +943,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
 
@@ -956,7 +953,7 @@ int main(int argc, char *argv[])
 #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();