projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed showing special toolbox buttons for empty space elements in editor
[rocksndiamonds.git]
/
src
/
libgame
/
sdl.c
diff --git
a/src/libgame/sdl.c
b/src/libgame/sdl.c
index baa53340c4502380357bc45e8540f1efe11eb782..2d2551a22444c5e1ae83b237a034b01d84c30027 100644
(file)
--- a/
src/libgame/sdl.c
+++ b/
src/libgame/sdl.c
@@
-69,6
+69,9
@@
static void FinalizeScreen(int draw_target)
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
+1454,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
+1472,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
+1501,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
+1515,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
+1584,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
+1632,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;