kobodl/prefs.h
Ville Lindholm 8d57d63da2
Phase 9 cleanup: rip out SDL 1.2 video knobs no SDL 3 path uses
After the SDL 3 renderer migration, the engine has exactly one back
buffer (a CPU-side ARGB8888 SDL_Surface) and one presentation path
(upload to streaming SDL_Texture, RenderPresent). All the SDL 1.2
hardware-surface / page-flipping / depth / driver knobs were dead.

Removed from gfxengine_t:
- _doublebuf, doublebuffer() setter+getter
- _pages, pages() setter
- _shadow, shadow() setter+getter
- _depth + the depth argument processing in mode()
- _driver, driver() setter, gfx_drivers_t enum, GFX_DRIVER_SDL2D
- xflags + the extraflags parameter to open()
- broken_rgba8 (the OpenGL RGBA→RGBA4 workaround field)
- MAX_PAGES + backpage/frontpage + the per-page dirtyrects[]/
  dirtytable[]/dirtywtable[] arrays. Collapsed to 1-D dirtytable.
- __invalidate(int page, ...) → __invalidate(rect, window).
- The per-page invalidate() switch on _pages.
- vsync() now hot-applies via SDL_SetRenderVSync (no hide/show cycle).
- mode() keeps the int-bits arg for API compat but ignores it.

Removed from prefs_t:
- videodriver, depth, doublebuf, shadow, pages, broken_rgba8.
  Their config-file keys are now read as obsolete fields (silently
  consumed, never re-written) so existing config files load cleanly
  without breaking on unknown keys.

Removed from the options menu:
- Display Depth, Display Buffering Mode, Software Shadow Buffer,
  Display Buffer Pages, Broken RGBA8.

Removed from the escape-hammering safe-video-mode reset path the
fields that no longer exist (doublebuf, pages, shadow, depth,
videodriver).

dashboard.cpp: dropped the doublebuffer()-guarded second pass of the
loading-animation nibble draw; SDL 3's single back buffer doesn't
need it.

Build clean, binary still runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-28 22:12:40 +03:00

139 lines
4.2 KiB
C++

/*(GPL)
------------------------------------------------------------
Kobo Deluxe - An enhanced SDL port of XKobo
------------------------------------------------------------
* Copyright (C) 2001-2003, 2007 David Olofson
* Copyright (C) 2005 Erik Auerswald
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _KOBO_PREFS_H_
#define _KOBO_PREFS_H_
#include "aconfig.h"
#include "cfgparse.h"
class prefs_t : public config_parser_t
{
public:
//System options
int logfile; //Log messages to log.txt/html
int logformat; //0: text, 1: ANSI, 2: HTML
int logverbosity;
//Input options
int use_joystick;
int joystick_no; //which joystick to use
int use_mouse;
int mousemode;
int broken_numdia;
int dia_emphasis;
int always_fire;
int mousecapture;
//Game options
int filter; //Use motion filtering
int timefilter; //Delta time filter
int scrollradar; //Radar display mode
int countdown; //"Get Ready" countdown
int starfield; //None/Old/parallax
int stars; //Number of parallax stars
int overheatloud; //Overheat warning loudness
int cannonloud; //Cannon loudness
//Sound: System
int use_sound; //Enable sound
int use_music; //Enable "real" music
int cached_sounds; //Use prerendered waveforms
int use_oss; //Use OSS audio driver
int samplerate;
int latency; //Audio latency in ms
int mixquality; //Mixer quality control
int volume; //Digital master volume
//Sound: Mixer
int intro_vol; //Intro music volume
int sfx_vol; //Sound effects volume
int music_vol; //In-game music volume
//Sound: Master Effects
int reverb; //Master reverb level
int vol_boost; //Master volume boost
//Video settings
int fullscreen; //Use fullscreen mode
int width; //Screen/window width
int height; //Screen/window height
int aspect; //Pixel aspect ratio * 1000
int max_fps; //Maximum fps
int max_fps_strict; //Strictly regulated fps limiter
int videomode; //Selected entry from the vidmodes table
int vsync; //Vertical (retrace) sync
//Graphics settings
int scalemode; //Scaling filter mode
int use_dither;
int dither_type;
int alpha; //Alpha blending
int brightness; //Graphics brightness
int contrast; //Graphics contrast
//File paths
cfg_string_t dir; //Path to kobo-deluxe/
cfg_string_t gfxdir; //Path to gfx/
cfg_string_t sfxdir; //Path to sfx/
cfg_string_t scoredir; //Path to scores/
//Obsolete stuff (compatibility)
int o_size; //Screen scale
int o_wait_msec; //ms per control system frame
cfg_string_t o_bgm_indexfile; //Ext playlist path
int o_threshold; //Limiter threshold
int o_release; //Limiter release rate
int o_internalres; //Internal resolution for OpenGL
// SDL 1.2 video settings, read for back-compat but unused under SDL 3
int o_videodriver;
int o_depth;
int o_doublebuf;
int o_shadow;
int o_pages;
int o_broken_rgba8;
//"Hidden" stuff ("to remember until next startup")
int last_profile; //Last used player profile
int number_of_joysticks; //no of connected joysticks
void init();
void postload();
/* "Commands" - never written to config files */
int cmd_showcfg;
int cmd_hiscores;
int cmd_override;
int cmd_debug;
int cmd_fps;
int cmd_noframe;
int cmd_midi;
int cmd_cheat; //Unlimited lives; select any starting stage
int cmd_indicator; //Enable collision testing mode
int cmd_pushmove; //Stop when not holding any direction down
int cmd_noparachute; //Disable SDL parachute
int cmd_pollaudio; //Use polling based audio instead of thread
int cmd_autoshot; //Take ingame screenshots
int cmd_help; //Show help and exit
int cmd_options_man; //Output OPTIONS doc in Un*x man source format
};
#endif //_KOBO_PREFS_H_