rnd-20030107-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 7 Jan 2003 01:41:48 +0000 (02:41 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:39:32 +0000 (10:39 +0200)
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/editor.c
src/init.c
src/libgame/system.c
src/libgame/text.c
src/main.h
src/screens.c
src/tools.c
src/tools.h

index 43d45e484c27bad89df3caea2833eabfc520b558..fbfeae931c70948b1ad7ffd7365057102b4a3bf5 100644 (file)
@@ -2595,6 +2595,13 @@ struct ConfigInfo image_config[] =
 
   { "background.default",                      UNDEFINED_FILENAME      },
   { "background.door",                         UNDEFINED_FILENAME      },
+  { "background.main",                         UNDEFINED_FILENAME      },
+  { "background.level_series",                 UNDEFINED_FILENAME      },
+  { "background.hall_of_fame",                 UNDEFINED_FILENAME      },
+  { "background.editor_settings_level",                UNDEFINED_FILENAME      },
+  { "background.editor_settings_element",      UNDEFINED_FILENAME      },
+  { "background.info",                         UNDEFINED_FILENAME      },
+  { "background.setup",                                UNDEFINED_FILENAME      },
 
   { "info.font_em_1",                          "RocksFontEM.pcx"       },
   { "info.font_em_1.xpos",                     "0"                     },
index 526687044a044fcbe11c2f21e4cc6aee3e75a7d0..e439c05e6daba884c86e7f1c6b52c7289e6535be 100644 (file)
 #define IMG_FONT_EM                            742
 #define IMG_BACKGROUND_DEFAULT                 743
 #define IMG_BACKGROUND_DOOR                    744
-#define IMG_INFO_FONT_EM_1                     745
-#define IMG_INFO_FONT_EM_2                     746
-#define IMG_INFO_FONT_EM_3                     747
-#define IMG_INFO_FONT_EM_4                     748
-#define IMG_INFO_FONT_EM_5                     749
+#define IMG_BACKGROUND_MAIN                    745
+#define IMG_BACKGROUND_LEVEL_SERIES            746
+#define IMG_BACKGROUND_HALL_OF_FAME            747
+#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL   748
+#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT 749
+#define IMG_BACKGROUND_INFO                    750
+#define IMG_BACKGROUND_SETUP                   751
+#define IMG_INFO_FONT_EM_1                     752
+#define IMG_INFO_FONT_EM_2                     753
+#define IMG_INFO_FONT_EM_3                     754
+#define IMG_INFO_FONT_EM_4                     755
+#define IMG_INFO_FONT_EM_5                     756
 
-#define NUM_IMAGE_FILES                                750
+#define NUM_IMAGE_FILES                                757
 
 #endif /* CONF_GFX_H */
index 1aa23861e6c2274672e578b84a823894cec347f9..d8042ce77ea7c3df6fd7e16dc4fce378627291dc 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-01-06 03:26]"
+#define COMPILE_DATE_STRING "[2003-01-07 02:39]"
index cd81ccbd5946670048632a1beba2ae4f3206a22c..3682bbd09774435d13555bcb0c98ad30d75571d9 100644 (file)
@@ -2650,7 +2650,7 @@ static void PickDrawingElement(int button, int element)
 
 static void DrawDrawingWindow()
 {
-  SetMainBackgroundBitmap(NULL);
+  SetMainBackgroundImage(IMG_NONE);
   ClearWindow();
   UnmapLevelEditorWindowGadgets();
 
@@ -2710,7 +2710,7 @@ static void DrawLevelInfoWindow()
   int font_color = FC_GREEN;
   int i, x, y;
 
-  SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+  SetMainBackgroundImage(IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL);
   ClearWindow();
   UnmapLevelEditorWindowGadgets();
 
@@ -2943,7 +2943,7 @@ static void DrawPropertiesWindow()
     { -1, NULL, NULL }
   };
 
-  SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+  SetMainBackgroundImage(IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT);
   ClearWindow();
   UnmapLevelEditorWindowGadgets();
 
index a10e8e6bf80ad5b0f277531c85fddf3ae54e2bad..f497ec242599e9ff0e34c6605405b944da15dd74 100644 (file)
@@ -220,10 +220,8 @@ static void ReinitializeGraphics()
               new_graphic_info[IMG_FONT_SMALL].bitmap,
               new_graphic_info[IMG_FONT_EM].bitmap);
 
-  SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
-  SetDoorBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DOOR].bitmap ?
-                         new_graphic_info[IMG_BACKGROUND_DOOR].bitmap :
-                         new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+  SetMainBackgroundImage(IMG_BACKGROUND_DEFAULT);
+  SetDoorBackgroundImage(IMG_BACKGROUND_DOOR);
 
   InitGadgets();
   InitToons();
index ff7d8e545dd9f6c0c422eea8036cbe5247c1e453..3c4613fbe76f704cb3fce24ca92ec2763e7651ff 100644 (file)
@@ -510,8 +510,7 @@ inline void ClearRectangleOnBackground(Bitmap *bitmap, int x, int y,
                                       int width, int height)
 {
   if (DrawingOnBackground(x, y))
-    BlitBitmap(gfx.background_bitmap, bitmap,
-              x - gfx.real_sx, y - gfx.real_sy, width, height, x, y);
+    BlitBitmap(gfx.background_bitmap, bitmap, x, y, width, height, x, y);
   else
     ClearRectangle(bitmap, x, y, width, height);
 }
index 5328f18b28200c8eee5e50adcff86aea78e74da1..48974eb74bb67ef34865e4cd0bccd71bee8ef379 100644 (file)
@@ -292,9 +292,8 @@ void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text,
       else if (mask_mode == FONT_MASKED)
       {
        /* clear font character background */
-       BlitBitmap(gfx.background_bitmap, bitmap,
-                  dest_x - gfx.real_sx, dest_y - gfx.real_sy,
-                  font_width, font_height, dest_x, dest_y);
+       ClearRectangleOnBackground(bitmap, dest_x, dest_y,
+                                  font_width, font_height);
 
 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
        /* use special font tile clipmasks, if available */
index 513faf157b8f9a220b7f4ce4a39929c03f0d94e9..ca6c12f2d0e4e843c6d4f47f27aa22be92e2117e 100644 (file)
@@ -30,6 +30,7 @@
 #include "conf_gfx.h"
 #include "conf_snd.h"
 
+#define IMG_NONE               (-1)
 #define IMG_EMPTY              IMG_EMPTY_SPACE
 #define IMG_SP_EMPTY           IMG_SP_EMPTY_SPACE
 #define IMG_CHAR_START         IMG_CHAR_SPACE
index 6b827227a475f18092487526206245d940529f86..e86a4f128675112125760c02c142ca8c6d8ca0ce 100644 (file)
@@ -201,7 +201,7 @@ void DrawMainMenu()
   GetPlayerConfig();
   LoadLevel(level_nr);
 
-  SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+  SetMainBackgroundImage(IMG_BACKGROUND_MAIN);
   ClearWindow();
 
   DrawHeadline();
@@ -1008,6 +1008,7 @@ void DrawHelpScreenElText(int start)
   int xstart = SX + 56, ystart = SY + 65 + 2 * 32, ystep = TILEY + 4;
   int ybottom = SYSIZE - 20;
 
+  SetMainBackgroundImage(IMG_BACKGROUND_INFO);
   ClearWindow();
   DrawHeadline();
 
@@ -1131,6 +1132,7 @@ void DrawHelpScreen()
     helpscreen_step[i] = helpscreen_frame[i] = 0;
   helpscreen_musicpos = 0;
   helpscreen_state = 0;
+
   DrawHelpScreenElText(0);
   DrawHelpScreenElAction(0);
 
@@ -1262,6 +1264,7 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
   CloseDoor(DOOR_CLOSE_2);
 
   ClearWindow();
+
   HandleChooseTree(0,0, 0,0, MB_MENU_INITIALIZE, ti_ptr);
   MapChooseTreeGadgets(*ti_ptr);
 
@@ -1576,6 +1579,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
 
 void DrawChooseLevel()
 {
+  SetMainBackgroundImage(IMG_BACKGROUND_LEVEL_SERIES);
+
   DrawChooseTree(&leveldir_current);
 }
 
@@ -1603,7 +1608,9 @@ static void drawHallOfFameList(int first_entry, int highlight_position)
 {
   int i;
 
+  SetMainBackgroundImage(IMG_BACKGROUND_HALL_OF_FAME);
   ClearWindow();
+
   DrawText(SX + 80, SY + 8, "Hall Of Fame", FS_BIG, FC_YELLOW);
   DrawTextFCentered(46, FC_RED, "HighScores of Level %d", level_nr);
 
@@ -2008,6 +2015,7 @@ static void DrawSetupScreen_Generic()
 
   UnmapAllGadgets();
   CloseDoor(DOOR_CLOSE_2);
+
   ClearWindow();
 
   if (setup_mode == SETUP_MODE_MAIN)
@@ -2184,6 +2192,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button)
 void DrawSetupScreen_Input()
 {
   ClearWindow();
+
   DrawText(SX+16, SY+16, "Setup Input", FS_BIG, FC_YELLOW);
 
   initCursor(0, IMG_BALL_BLUE);
@@ -2753,6 +2762,8 @@ void DrawSetupScreen()
 {
   DeactivateJoystick();
 
+  SetMainBackgroundImage(IMG_BACKGROUND_SETUP);
+
   if (setup_mode == SETUP_MODE_INPUT)
     DrawSetupScreen_Input();
   else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
index 2f3ce540b2998eec2afea3d59f8c38cb023cb204..16cb3984075fd88b48bec40c43a3f39ead5e8d48 100644 (file)
@@ -362,13 +362,25 @@ void FadeToFront()
   BackToFront();
 }
 
+void SetMainBackgroundImage(int graphic)
+{
+  SetMainBackgroundBitmap(graphic == IMG_NONE ? NULL :
+                         new_graphic_info[graphic].bitmap ?
+                         new_graphic_info[graphic].bitmap :
+                         new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+}
+
+void SetDoorBackgroundImage(int graphic)
+{
+  SetDoorBackgroundBitmap(graphic == IMG_NONE ? NULL :
+                         new_graphic_info[graphic].bitmap ?
+                         new_graphic_info[graphic].bitmap :
+                         new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
+}
+
 void DrawBackground(int dest_x, int dest_y, int width, int height)
 {
-  if (DrawingOnBackground(dest_x, dest_y) && game_status != PLAYING)
-    BlitBitmap(gfx.background_bitmap, backbuffer, dest_x, dest_y,
-              width, height, dest_x, dest_y);
-  else
-    ClearRectangle(backbuffer, dest_x, dest_y, width, height);
+  ClearRectangleOnBackground(backbuffer, dest_x, dest_y, width, height);
 
   redraw_mask |= REDRAW_FIELD;
 }
@@ -1754,6 +1766,7 @@ void DrawLevel()
 {
   int x,y;
 
+  SetDrawBackgroundMask(REDRAW_NONE);
   ClearWindow();
 
   for(x=BX1; x<=BX2; x++)
index b6931dae8504f7664b35352139c9af3a1a948749..7b328f2147bc5ca2d304759b3e23e725b56cabd2 100644 (file)
@@ -63,6 +63,8 @@ void RedrawPlayfield(boolean, int, int, int, int);
 void BackToFront();
 void FadeToFront();
 void ClearWindow();
+void SetMainBackgroundImage(int);
+void SetDoorBackgroundImage(int);
 void DrawBackground(int, int, int, int);
 
 void MarkTileDirty(int, int);