projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20070321-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
system.c
diff --git
a/src/libgame/system.c
b/src/libgame/system.c
index c0448a8e0d14e1d64c8deb694ca4b3e2f685fba5..1c8bb658403a92a378ea274718c9f5e8108532af 100644
(file)
--- a/
src/libgame/system.c
+++ b/
src/libgame/system.c
@@
-1,7
+1,7
@@
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1994-200
2
Artsoft Entertainment *
+* (c) 1994-200
6
Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
@@
-245,7
+245,10
@@
void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
if (background_bitmap_tile == NULL) /* empty background requested */
return;
if (background_bitmap_tile == NULL) /* empty background requested */
return;
- if (mask == REDRAW_FIELD)
+ if (mask == REDRAW_ALL)
+ DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
+ 0, 0, video.width, video.height);
+ else if (mask == REDRAW_FIELD)
DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
gfx.real_sx, gfx.real_sy,
gfx.full_sxsize, gfx.full_sysize);
DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
gfx.real_sx, gfx.real_sy,
gfx.full_sxsize, gfx.full_sysize);
@@
-257,13
+260,20
@@
void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
}
}
}
}
+void SetWindowBackgroundBitmap(Bitmap *background_bitmap_tile)
+{
+ SetBackgroundBitmap(background_bitmap_tile, REDRAW_ALL);
+}
+
void SetMainBackgroundBitmap(Bitmap *background_bitmap_tile)
{
void SetMainBackgroundBitmap(Bitmap *background_bitmap_tile)
{
+ SetBackgroundBitmap(NULL, REDRAW_ALL); /* !!! FIX THIS !!! */
SetBackgroundBitmap(background_bitmap_tile, REDRAW_FIELD);
}
void SetDoorBackgroundBitmap(Bitmap *background_bitmap_tile)
{
SetBackgroundBitmap(background_bitmap_tile, REDRAW_FIELD);
}
void SetDoorBackgroundBitmap(Bitmap *background_bitmap_tile)
{
+ SetBackgroundBitmap(NULL, REDRAW_ALL); /* !!! FIX THIS !!! */
SetBackgroundBitmap(background_bitmap_tile, REDRAW_DOOR_1);
}
SetBackgroundBitmap(background_bitmap_tile, REDRAW_DOOR_1);
}
@@
-321,22
+331,24
@@
void CloseVideoDisplay(void)
#endif
}
#endif
}
-void InitVideoBuffer(DrawBuffer **backbuffer, DrawWindow **window,
- int width, int height, int depth, boolean fullscreen)
+void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
{
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
{
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
+
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
video.fullscreen_modes = NULL;
video.fullscreen_mode_current = NULL;
#if defined(TARGET_SDL)
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
video.fullscreen_modes = NULL;
video.fullscreen_mode_current = NULL;
#if defined(TARGET_SDL)
- SDLInitVideoBuffer(
backbuffer,
window, fullscreen);
+ SDLInitVideoBuffer(
&backbuffer, &
window, fullscreen);
#else
#else
- X11InitVideoBuffer(
backbuffer,
window);
+ X11InitVideoBuffer(
&backbuffer, &
window);
#endif
#endif
+
+ drawto = backbuffer;
}
Bitmap *CreateBitmapStruct(void)
}
Bitmap *CreateBitmapStruct(void)
@@
-423,13
+435,16
@@
inline static boolean CheckDrawingArea(int x, int y, int width, int height,
if (draw_mask & REDRAW_ALL)
return TRUE;
if (draw_mask & REDRAW_ALL)
return TRUE;
- if ((draw_mask & REDRAW_FIELD) && x < gfx.real_sx + gfx.full_sxsize)
+ if ((draw_mask & REDRAW_FIELD) &&
+ x >= gfx.real_sx && x < gfx.real_sx + gfx.full_sxsize)
return TRUE;
return TRUE;
- if ((draw_mask & REDRAW_DOOR_1) && x >= gfx.dx && y < gfx.dy + gfx.dysize)
+ if ((draw_mask & REDRAW_DOOR_1) &&
+ x >= gfx.dx && y < gfx.dy + gfx.dysize)
return TRUE;
return TRUE;
- if ((draw_mask & REDRAW_DOOR_2) && x >= gfx.dx && y >= gfx.vy)
+ if ((draw_mask & REDRAW_DOOR_2) &&
+ x >= gfx.dx && y >= gfx.vy)
return TRUE;
return FALSE;
return TRUE;
return FALSE;
@@
-458,14
+473,15
@@
void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap,
}
void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
}
void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
- int fade_mode, int fade_delay, int post_delay)
+ int fade_mode, int fade_delay, int post_delay,
+ void (*draw_border_function)(void))
{
#if defined(TARGET_SDL)
SDLFadeRectangle(bitmap_cross, x, y, width, height,
{
#if defined(TARGET_SDL)
SDLFadeRectangle(bitmap_cross, x, y, width, height,
- fade_mode, fade_delay, post_delay);
+ fade_mode, fade_delay, post_delay
, draw_border_function
);
#else
X11FadeRectangle(bitmap_cross, x, y, width, height,
#else
X11FadeRectangle(bitmap_cross, x, y, width, height,
- fade_mode, fade_delay, post_delay);
+ fade_mode, fade_delay, post_delay
, draw_border_function
);
#endif
}
#endif
}
@@
-970,8
+986,9
@@
void ScaleBitmap(Bitmap *old_bitmap, int zoom_factor)
/* ------------------------------------------------------------------------- */
#if !defined(PLATFORM_MSDOS)
/* ------------------------------------------------------------------------- */
#if !defined(PLATFORM_MSDOS)
-/* XPM */
-static const char *cursor_image_playfield[] =
+#define USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER 0
+/* XPM image definitions */
+static const char *cursor_image_none[] =
{
/* width height num_colors chars_per_pixel */
" 16 16 3 1",
{
/* width height num_colors chars_per_pixel */
" 16 16 3 1",
@@
-981,10
+998,6
@@
static const char *cursor_image_playfield[] =
". c #ffffff",
" c None",
". c #ffffff",
" c None",
-#if 1
- /* some people complained about a "white dot" on the screen and thought it
- was a graphical error... OK, let's just remove the whole pointer :-) */
-
/* pixels */
" ",
" ",
/* pixels */
" ",
" ",
@@
-1005,8
+1018,17
@@
static const char *cursor_image_playfield[] =
/* hot spot */
"0,0"
/* hot spot */
"0,0"
+};
+#if USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER
+static const char *cursor_image_dot[] =
+{
+ /* width height num_colors chars_per_pixel */
+ " 16 16 3 1",
-#else
+ /* colors */
+ "X c #000000",
+ ". c #ffffff",
+ " c None",
/* pixels */
" X ",
/* pixels */
" X ",
@@
-1028,8
+1050,13
@@
static const char *cursor_image_playfield[] =
/* hot spot */
"1,1"
/* hot spot */
"1,1"
-#endif
};
};
+static const char **cursor_image_playfield = cursor_image_dot;
+#else
+/* some people complained about a "white dot" on the screen and thought it
+ was a graphical error... OK, let's just remove the whole pointer :-) */
+static const char **cursor_image_playfield = cursor_image_none;
+#endif
#if defined(TARGET_SDL)
static const int cursor_bit_order = BIT_ORDER_MSB;
#if defined(TARGET_SDL)
static const int cursor_bit_order = BIT_ORDER_MSB;
@@
-1088,15
+1115,24
@@
static struct MouseCursorInfo *get_cursor_from_image(const char **image)
void SetMouseCursor(int mode)
{
#if !defined(PLATFORM_MSDOS)
void SetMouseCursor(int mode)
{
#if !defined(PLATFORM_MSDOS)
+ static struct MouseCursorInfo *cursor_none = NULL;
static struct MouseCursorInfo *cursor_playfield = NULL;
static struct MouseCursorInfo *cursor_playfield = NULL;
+ struct MouseCursorInfo *cursor_new;
+
+ if (cursor_none == NULL)
+ cursor_none = get_cursor_from_image(cursor_image_none);
if (cursor_playfield == NULL)
cursor_playfield = get_cursor_from_image(cursor_image_playfield);
if (cursor_playfield == NULL)
cursor_playfield = get_cursor_from_image(cursor_image_playfield);
+ cursor_new = (mode == CURSOR_DEFAULT ? NULL :
+ mode == CURSOR_NONE ? cursor_none :
+ mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL);
+
#if defined(TARGET_SDL)
#if defined(TARGET_SDL)
- SDLSetMouseCursor(
mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL
);
+ SDLSetMouseCursor(
cursor_new
);
#elif defined(TARGET_X11_NATIVE)
#elif defined(TARGET_X11_NATIVE)
- X11SetMouseCursor(
mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL
);
+ X11SetMouseCursor(
cursor_new
);
#endif
#endif
}
#endif
#endif
}