projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved forced restart of global animations when restarting game
[rocksndiamonds.git]
/
src
/
libgame
/
sdl.c
diff --git
a/src/libgame/sdl.c
b/src/libgame/sdl.c
index baa53340c4502380357bc45e8540f1efe11eb782..71d9fbbe7274d71555b4c7ef90552b78a8e78124 100644
(file)
--- a/
src/libgame/sdl.c
+++ b/
src/libgame/sdl.c
@@
-65,10
+65,17
@@
static void FinalizeScreen(int draw_target)
// copy tile selection cursor to render target buffer, if defined (above all)
if (gfx.draw_tile_cursor_function != NULL)
gfx.draw_tile_cursor_function(draw_target);
// copy tile selection cursor to render target buffer, if defined (above all)
if (gfx.draw_tile_cursor_function != NULL)
gfx.draw_tile_cursor_function(draw_target);
+
+ // copy global animations to render target buffer, if defined (mouse pointer)
+ if (gfx.draw_global_anim_function != NULL)
+ gfx.draw_global_anim_function(draw_target, DRAW_GLOBAL_ANIM_STAGE_3);
}
static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
{
}
static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
{
+ if (program.headless)
+ return;
+
static DelayCounter update_screen_delay = { 50 }; // (milliseconds)
SDL_Surface *screen = backbuffer->surface;
static DelayCounter update_screen_delay = { 50 }; // (milliseconds)
SDL_Surface *screen = backbuffer->surface;
@@
-1451,14
+1458,14
@@
static void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
case 1:
{
// Assuming 8-bpp
case 1:
{
// Assuming 8-bpp
- *((Uint8 *)surface->pixels + y
*
surface->pitch + x) = color;
+ *((Uint8 *)surface->pixels + y
*
surface->pitch + x) = color;
}
break;
case 2:
{
// Probably 15-bpp or 16-bpp
}
break;
case 2:
{
// Probably 15-bpp or 16-bpp
- *((Uint16 *)surface->pixels + y
*surface->pitch/
2 + x) = color;
+ *((Uint16 *)surface->pixels + y
* surface->pitch /
2 + x) = color;
}
break;
}
break;
@@
-1469,20
+1476,20
@@
static void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
int shift;
// Gack - slow, but endian correct
int shift;
// Gack - slow, but endian correct
- pix = (Uint8 *)surface->pixels + y * surface->pitch + x
*
3;
+ pix = (Uint8 *)surface->pixels + y * surface->pitch + x
*
3;
shift = surface->format->Rshift;
shift = surface->format->Rshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Gshift;
shift = surface->format->Gshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Bshift;
shift = surface->format->Bshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
}
break;
case 4:
{
// Probably 32-bpp
}
break;
case 4:
{
// Probably 32-bpp
- *((Uint32 *)surface->pixels + y
*surface->pitch/
4 + x) = color;
+ *((Uint32 *)surface->pixels + y
* surface->pitch /
4 + x) = color;
}
break;
}
}
break;
}
@@
-1498,12
+1505,12
@@
static void _PutPixelRGB(SDL_Surface *surface, Sint16 x, Sint16 y,
static void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
static void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
- *((Uint8 *)surface->pixels + y
*
surface->pitch + x) = color;
+ *((Uint8 *)surface->pixels + y
*
surface->pitch + x) = color;
}
static void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
}
static void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
- *((Uint16 *)surface->pixels + y
*surface->pitch/
2 + x) = color;
+ *((Uint16 *)surface->pixels + y
* surface->pitch /
2 + x) = color;
}
static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
}
static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
@@
-1512,38
+1519,38
@@
static void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
int shift;
// Gack - slow, but endian correct
int shift;
// Gack - slow, but endian correct
- pix = (Uint8 *)surface->pixels + y * surface->pitch + x
*
3;
+ pix = (Uint8 *)surface->pixels + y * surface->pitch + x
*
3;
shift = surface->format->Rshift;
shift = surface->format->Rshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Gshift;
shift = surface->format->Gshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Bshift;
shift = surface->format->Bshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
}
static void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
}
static void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color)
{
- *((Uint32 *)surface->pixels + y
*surface->pitch/
4 + x) = color;
+ *((Uint32 *)surface->pixels + y
* surface->pitch /
4 + x) = color;
}
}
-static void _PutPixelX(SDL_Surface *dest,
Sint16 x,Sint16 y,
Uint32 color)
+static void _PutPixelX(SDL_Surface *dest,
Sint16 x, Sint16 y,
Uint32 color)
{
switch (dest->format->BytesPerPixel)
{
case 1:
{
switch (dest->format->BytesPerPixel)
{
case 1:
- *((Uint8 *)dest->pixels + y
*
dest->pitch + x) = color;
+ *((Uint8 *)dest->pixels + y
*
dest->pitch + x) = color;
break;
case 2:
break;
case 2:
- *((Uint16 *)dest->pixels + y
*dest->pitch/
2 + x) = color;
+ *((Uint16 *)dest->pixels + y
* dest->pitch /
2 + x) = color;
break;
case 3:
break;
case 3:
- _PutPixel24(dest,
x,y,
color);
+ _PutPixel24(dest,
x, y,
color);
break;
case 4:
break;
case 4:
- *((Uint32 *)dest->pixels + y
*dest->pitch/
4 + x) = color;
+ *((Uint32 *)dest->pixels + y
* dest->pitch /
4 + x) = color;
break;
}
}
break;
}
}
@@
-1581,19
+1588,19
@@
static Sint32 sge_CalcYPitch(SDL_Surface *dest, Sint16 y)
switch (dest->format->BytesPerPixel)
{
case 1:
switch (dest->format->BytesPerPixel)
{
case 1:
- return y
*
dest->pitch;
+ return y
*
dest->pitch;
break;
case 2:
break;
case 2:
- return y
*dest->pitch/
2;
+ return y
* dest->pitch /
2;
break;
case 3:
break;
case 3:
- return y
*
dest->pitch;
+ return y
*
dest->pitch;
break;
case 4:
break;
case 4:
- return y
*dest->pitch/
4;
+ return y
* dest->pitch /
4;
break;
}
}
break;
}
}
@@
-1629,13
+1636,13
@@
static void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch,
int shift;
// Gack - slow, but endian correct
int shift;
// Gack - slow, but endian correct
- pix = (Uint8 *)surface->pixels + ypitch + x
*
3;
+ pix = (Uint8 *)surface->pixels + ypitch + x
*
3;
shift = surface->format->Rshift;
shift = surface->format->Rshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Gshift;
shift = surface->format->Gshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
shift = surface->format->Bshift;
shift = surface->format->Bshift;
- *(pix
+shift/
8) = color>>shift;
+ *(pix
+ shift /
8) = color>>shift;
}
break;
}
break;