X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=00e9c7295edde77c0f1f3fd117c39a29bb69c72a;hb=89401883eeb279c7101b1c635477a9bccc123d21;hp=7d85f6171925be6137208f50461354d0dd751626;hpb=97d0f78c43d16fbf73ea0438148a4da781c75600;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index 7d85f617..00e9c729 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; @@ -97,6 +98,16 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir, program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr; } +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; + + free(global_scores_dir); +} + void SetWindowTitle() { program.window_title = program.window_title_function(); @@ -270,6 +281,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; @@ -363,6 +389,9 @@ void LimitScreenUpdates(boolean enable) void InitVideoDisplay(void) { SDLInitVideoDisplay(); +#if defined(TARGET_SDL2) + SDLSetDisplaySize(); +#endif } void CloseVideoDisplay(void) @@ -378,6 +407,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; @@ -1401,16 +1435,6 @@ void SetAudioMode(boolean enabled) /* event functions */ /* ========================================================================= */ -void InitEventFilter(EventFilter filter_function) -{ - /* set event filter to filter out certain events */ -#if defined(TARGET_SDL2) - SDL_SetEventFilter(filter_function, NULL); -#else - SDL_SetEventFilter(filter_function); -#endif -} - boolean PendingEvent(void) { return (SDL_PollEvent(NULL) ? TRUE : FALSE);