X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=b5de8c9e6959ee11848072c3ec9599f0e52a9850;hp=222b6f609a19d9d1fb899891b064e6f0dfa14f8e;hb=b10d40ccb1a79ec0053848080edf3bcab12b9b67;hpb=a1fabab3e5db1baab46a95a318b27fdf33d470cc diff --git a/src/libgame/system.c b/src/libgame/system.c index 222b6f60..b5de8c9e 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -33,6 +33,7 @@ struct OptionInfo options; struct VideoSystemInfo video; struct AudioSystemInfo audio; struct GfxInfo gfx; +struct OverlayInfo overlay; struct ArtworkInfo artwork; struct JoystickInfo joystick; struct SetupInfo setup; @@ -95,6 +96,33 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir, program.log_filename[LOG_ERR_ID] = getLogFilename(LOG_ERR_BASENAME); program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout; program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr; + + program.headless = FALSE; +} + +void InitScoresInfo() +{ + char *global_scores_dir = getPath2(getCommonDataDir(), SCORES_DIRECTORY); + + program.global_scores = directoryExists(global_scores_dir); + program.many_scores_per_name = !program.global_scores; + + if (options.debug) + { + if (program.global_scores) + { + Error(ERR_DEBUG, "Using global, multi-user scores directory '%s'.", + global_scores_dir); + Error(ERR_DEBUG, "Remove to enable single-user scores directory."); + Error(ERR_DEBUG, "(This enables multipe score entries per user.)"); + } + else + { + Error(ERR_DEBUG, "Using private, single-user scores directory."); + } + } + + free(global_scores_dir); } void SetWindowTitle() @@ -270,6 +298,21 @@ void InitGfxOtherSettings() gfx.cursor_mode = CURSOR_DEFAULT; } +void InitOverlayInfo() +{ + overlay.active = FALSE; +} + +void SetOverlayActive(boolean active) +{ + overlay.active = active; +} + +boolean GetOverlayActive() +{ + return overlay.active; +} + void SetDrawDeactivationMask(int draw_deactivation_mask) { gfx.draw_deactivation_mask = draw_deactivation_mask; @@ -362,7 +405,13 @@ void LimitScreenUpdates(boolean enable) void InitVideoDisplay(void) { + if (program.headless) + return; + SDLInitVideoDisplay(); +#if defined(TARGET_SDL2) + SDLSetDisplaySize(); +#endif } void CloseVideoDisplay(void) @@ -378,6 +427,11 @@ void InitVideoBuffer(int width, int height, int depth, boolean fullscreen) video.height = height; video.depth = GetRealDepth(depth); + video.screen_width = width; + video.screen_height = height; + video.screen_xoffset = 0; + video.screen_yoffset = 0; + video.fullscreen_available = FULLSCREEN_STATUS; video.fullscreen_enabled = FALSE; @@ -587,6 +641,9 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, int dst_x_unclipped = dst_x; int dst_y_unclipped = dst_y; + if (program.headless) + return; + if (src_bitmap == NULL || dst_bitmap == NULL) return;