X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=ee5e87ce996fa47a1405a1f44e2f370441913393;hp=5a55f1c248919f05f8e8c23c7cb3f277e10ba479;hb=e6bde4abb3952d4689917ce66d6bde79cd8df7fc;hpb=da14f69fd95c7bd5a0d70cdf4935af06f1f20a04 diff --git a/src/libgame/system.c b/src/libgame/system.c index 5a55f1c2..ee5e87ce 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -34,6 +34,7 @@ int FrameCounter; /* exported variables */ /* ========================================================================= */ +struct ProgramInfo program; struct VideoSystemInfo video; struct AudioSystemInfo audio; struct OptionInfo options; @@ -43,30 +44,53 @@ struct OptionInfo options; /* video functions */ /* ========================================================================= */ -inline void InitBufferedDisplay(DrawBuffer *backbuffer, DrawWindow *window) +inline static int GetRealDepth(int depth) { - video.fullscreen_available = FULLSCREEN_STATUS; - video.fullscreen_enabled = FALSE; + return (depth == DEFAULT_DEPTH ? video.default_depth : depth); +} + +inline void InitProgramInfo(char *command_name, char *program_title, + char *window_title, char *icon_title, + char *x11_icon_filename, + char *x11_iconmask_filename) +{ + program.command_name = command_name; + program.program_title = program_title; + program.window_title = window_title; + program.icon_title = icon_title; + program.x11_icon_filename = x11_icon_filename; + program.x11_iconmask_filename = x11_iconmask_filename; +} +inline void InitVideoDisplay(void) +{ #ifdef TARGET_SDL - SDLInitBufferedDisplay(backbuffer, window); + SDLInitVideoDisplay(); #else - X11InitBufferedDisplay(backbuffer, window); + X11InitVideoDisplay(); #endif } -inline int GetDisplayDepth(void) +inline void InitVideoBuffer(DrawBuffer *backbuffer, DrawWindow *window, + int width, int height, int depth, + boolean fullscreen) { + video.width = width; + video.height = height; + video.depth = GetRealDepth(depth); + video.fullscreen_available = FULLSCREEN_STATUS; + video.fullscreen_enabled = FALSE; + #ifdef TARGET_SDL - return SDL_GetVideoSurface()->format->BitsPerPixel; + SDLInitVideoBuffer(backbuffer, window, fullscreen); #else - return XDefaultDepth(display, screen); + X11InitVideoBuffer(backbuffer, window); #endif } inline Bitmap CreateBitmap(int width, int height, int depth) { - int real_depth = (depth == DEFAULT_DEPTH ? GetDisplayDepth() : depth); + int real_depth = GetRealDepth(depth); #ifdef TARGET_SDL SDL_Surface *surface_tmp, *surface_native;