projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed variable
[rocksndiamonds.git]
/
src
/
libgame
/
system.c
diff --git
a/src/libgame/system.c
b/src/libgame/system.c
index 6f063d1c01b0d79df41f2989b8d4dec35bae12a0..6c2e968417e2b82f7ba74544d3d6634d931417d2 100644
(file)
--- a/
src/libgame/system.c
+++ b/
src/libgame/system.c
@@
-421,6
+421,11
@@
void LimitScreenUpdates(boolean enable)
SDLLimitScreenUpdates(enable);
}
SDLLimitScreenUpdates(enable);
}
+void InitVideoDefaults(void)
+{
+ video.default_depth = 32;
+}
+
void InitVideoDisplay(void)
{
if (program.headless)
void InitVideoDisplay(void)
{
if (program.headless)
@@
-466,7
+471,7
@@
void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
SDLInitVideoBuffer(fullscreen);
SDLInitVideoBuffer(fullscreen);
- video.initialized =
TRUE
;
+ video.initialized =
!program.headless
;
drawto = backbuffer;
}
drawto = backbuffer;
}
@@
-914,6
+919,9
@@
void DrawLine(Bitmap *bitmap, int from_x, int from_y,
{
int x, y;
{
int x, y;
+ if (program.headless)
+ return;
+
for (x = 0; x < line_width; x++)
{
for (y = 0; y < line_width; y++)
for (x = 0; x < line_width; x++)
{
for (y = 0; y < line_width; y++)
@@
-949,6
+957,9
@@
void DrawLines(Bitmap *bitmap, struct XY *points, int num_points, Pixel pixel)
Pixel GetPixel(Bitmap *bitmap, int x, int y)
{
Pixel GetPixel(Bitmap *bitmap, int x, int y)
{
+ if (program.headless)
+ return BLACK_PIXEL;
+
if (x < 0 || x >= bitmap->width ||
y < 0 || y >= bitmap->height)
return BLACK_PIXEL;
if (x < 0 || x >= bitmap->width ||
y < 0 || y >= bitmap->height)
return BLACK_PIXEL;
@@
-959,6
+970,9
@@
Pixel GetPixel(Bitmap *bitmap, int x, int y)
Pixel GetPixelFromRGB(Bitmap *bitmap, unsigned int color_r,
unsigned int color_g, unsigned int color_b)
{
Pixel GetPixelFromRGB(Bitmap *bitmap, unsigned int color_r,
unsigned int color_g, unsigned int color_b)
{
+ if (program.headless)
+ return BLACK_PIXEL;
+
return SDL_MapRGB(bitmap->surface->format, color_r, color_g, color_b);
}
return SDL_MapRGB(bitmap->surface->format, color_r, color_g, color_b);
}