[Scummvm-git-logs] scummvm master -> f95e798080101d65628b7161a799be0a427f33ec
dreammaster
noreply at scummvm.org
Thu Jul 30 02:46:00 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
f95e798080 MADS: Cleanup of config_file
Commit: f95e798080101d65628b7161a799be0a427f33ec
https://github.com/scummvm/scummvm/commit/f95e798080101d65628b7161a799be0a427f33ec
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-30T12:44:46+10:00
Commit Message:
MADS: Cleanup of config_file
Removing sound card fields that aren't used anymore, and changing
flag fields from int to bool for better clarity.
Changed paths:
engines/mads/core/config.cpp
engines/mads/core/config.h
engines/mads/dragonsphere/menus.cpp
engines/mads/mads.cpp
engines/mads/nebular/rooms/room318.cpp
engines/mads/phantom/menus.cpp
diff --git a/engines/mads/core/config.cpp b/engines/mads/core/config.cpp
index ccde54e6006..8f86ad1c1e1 100644
--- a/engines/mads/core/config.cpp
+++ b/engines/mads/core/config.cpp
@@ -30,6 +30,24 @@ namespace MADS {
ConfigFile config_file;
+void init_config() {
+ // Initial setup for config_file. Probably not all necessary, since read_config_file sets up defaults anyway,
+ // but it doesn't hurt to have the config_file in a good state on startup
+ memset(&config_file, 0, sizeof(ConfigFile));
+ config_file.music_flag = config_file.sound_flag = true;
+ config_file.speech_flag = true;
+ config_file.interface_hotspots = 1;
+
+ config_file.inventory_mode = INVENTORY_SPINNING;
+ config_file.animated_interface = INTERFACE_ANIMATED;
+ config_file.naughtiness = NAUGHTY;
+ config_file.quotes_enabled = false;
+ config_file.high_memory_mode = MEMORY_ALL;
+ config_file.screen_fade = SCREEN_FADE_SMOOTH;
+ config_file.panning_speed = PANNING_SMOOTH;
+ config_file.mouse_cursor_fix = MOUSE_MICROSOFT;
+}
+
void read_config_file() {
ConfMan.registerDefault("music_mute", false);
ConfMan.registerDefault("sfx_mute", false);
@@ -53,7 +71,7 @@ void read_config_file() {
config_file.quotes_enabled = ConfMan.getBool("quotes_enabled");
config_file.screen_fade = ConfMan.getBool("screen_fade");
- config_file.panning_speed = ConfMan.getBool("panning_speed");
+ config_file.panning_speed = ConfMan.getInt("panning_speed");
config_file.show_speech_boxes = ConfMan.getBool("show_speech_boxes");
config_file.original_save_load = ConfMan.getBool("original_menus");
@@ -73,7 +91,7 @@ void write_config_file() {
ConfMan.setBool("quotes_enabled", config_file.quotes_enabled);
ConfMan.setBool("screen_fade", config_file.screen_fade);
- ConfMan.setBool("panning_speed", config_file.panning_speed);
+ ConfMan.setInt("panning_speed", config_file.panning_speed);
ConfMan.setBool("show_speech_boxes", config_file.show_speech_boxes);
if (g_engine->getGameID() == GType_RexNebular)
@@ -90,10 +108,8 @@ void global_load_config_parameters() {
kernel_panning_speed = config_file.panning_speed;
kernel_screen_fade = config_file.screen_fade;
- if (config_file.cd_version_installed) {
+ if (config_file.cd_version_installed)
env_search_cd = true;
- env_cd_drive = (char)config_file.cd_drive;
- }
}
void global_unload_config_parameters() {
diff --git a/engines/mads/core/config.h b/engines/mads/core/config.h
index b4741c30461..c03da9ffc63 100644
--- a/engines/mads/core/config.h
+++ b/engines/mads/core/config.h
@@ -71,47 +71,29 @@ enum Difficulty {
#define MOUSE_NOT_MICROSOFT 1
struct ConfigFile {
- int sound_card_type = 0; /* Sound card configuration */
- int sound_card_address = 0x220;
-
- int speech_card_type = 0; /* Speech card configuration */
- int speech_card_address = 0x220;
- int speech_card_irq = 7;
- int speech_card_drq = 1;
-
- int music_flag = 1; /* Music on/off */
- int sound_flag = 1; /* Sound on/off */
- int interface_hotspots = 1; /* Easy / Standard */
-
- int inventory_mode = INVENTORY_SPINNING; /* Spinning / Still */
- int animated_interface = INTERFACE_ANIMATED; /* On / Off */
- int naughtiness = NAUGHTY; /* NAUGHTY / NICE */
- int quotes_enabled = 1; /* Quotes option enabled */
-
- int high_memory_mode = MEMORY_ALL; /* High memory mode */
-
- int screen_fade = SCREEN_FADE_SMOOTH; /* Screen fade */
-
- int speech_flag = 1; /* Speech on/off */
-
- int panning_speed = PANNING_SMOOTH; /* Panning speed flag */
-
- int mouse_cursor_fix = MOUSE_MICROSOFT; /* Mouse halfway problem */
-
- int cd_version_installed = 0; /* CD version installed */
- int cd_drive = 'D'; /* CD drive letter */
-
- int speech_version_installed = 0; /* Version with speech installed */
-
- int show_speech_boxes = 1; /* Show text during speech */
-
- int sound_card_irq = 7;
- int misc2 = 0;
- int misc3 = 0;
- int misc4 = 0;
- int misc5 = 0;
-
- bool original_save_load = false; /* Use original save/load menus */
+ bool music_flag; /* Music on/off */
+ bool sound_flag; /* Sound on/off */
+ int interface_hotspots; /* Easy / Standard */
+
+ int inventory_mode; /* Spinning / Still */
+ int animated_interface; /* On / Off */
+ int naughtiness; /* NAUGHTY / NICE */
+ bool quotes_enabled; /* Quotes option enabled */
+
+ bool high_memory_mode; /* High memory mode */
+ int screen_fade; /* Screen fade */
+ bool speech_flag; /* Speech on/off */
+ int panning_speed; /* Panning speed flag */
+ int mouse_cursor_fix; /* Mouse halfway problem */
+ bool cd_version_installed; /* CD version installed */
+ bool speech_version_installed; /* Version with speech installed */
+ bool show_speech_boxes; /* Show text during speech */
+ bool original_save_load; /* Original vs ScummVM dialogs */
+
+ int misc2;
+ int misc3;
+ int misc4;
+ int misc5;
};
extern ConfigFile config_file;
@@ -119,10 +101,9 @@ extern ConfigFile config_file;
#define music_off (!config_file.music_flag)
#define sound_off (!config_file.sound_flag)
+extern void init_config();
extern void read_config_file();
extern void write_config_file();
-//extern void global_load_config_parameters();
-//extern void global_unload_config_parameters();
} // namespace MADS
diff --git a/engines/mads/dragonsphere/menus.cpp b/engines/mads/dragonsphere/menus.cpp
index 6d5ef6d5d35..28432afd969 100644
--- a/engines/mads/dragonsphere/menus.cpp
+++ b/engines/mads/dragonsphere/menus.cpp
@@ -272,8 +272,8 @@ static void global_menu_save_restore(int save) {
static void global_menu_options() {
int initial_1, initial_2, initial_3;
int initial_4, initial_5, initial_6;
- int former_music;
- int former_sound;
+ bool former_music;
+ bool former_sound;
PopupItem *music_item;
PopupItem *sound_item;
PopupItem *interface_item;
@@ -489,7 +489,7 @@ static void global_menu_difficulty() {
static void global_menu_cdrom() {
int initial_1, initial_2;
- int former_speech;
+ bool former_speech;
PopupItem *speech_item;
PopupItem *text_item;
PopupItem *done_button, *cancel_button;
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index a87156c3235..c12bafba926 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -99,6 +99,7 @@ void MADSEngine::initGlobals() {
init_anim();
init_attr();
init_camera();
+ init_config();
init_conv();
init_cursor();
init_cycle();
diff --git a/engines/mads/nebular/rooms/room318.cpp b/engines/mads/nebular/rooms/room318.cpp
index 349bea12608..6f3ac3c6abf 100644
--- a/engines/mads/nebular/rooms/room318.cpp
+++ b/engines/mads/nebular/rooms/room318.cpp
@@ -45,7 +45,7 @@ struct Scratch {
bool _internWalkingFl;
bool _internVisibleFl;
bool _explosionFl;
- int32 _lastFrameCounter = 0;
+ int32 _lastFrameCounter;
Dialog _dialog1;
};
diff --git a/engines/mads/phantom/menus.cpp b/engines/mads/phantom/menus.cpp
index 1c65cb313b7..cccd96b8d6f 100644
--- a/engines/mads/phantom/menus.cpp
+++ b/engines/mads/phantom/menus.cpp
@@ -343,8 +343,8 @@ static void global_menu_save_restore(int save) {
static void global_menu_options() {
int initial_1, initial_2, initial_3;
int initial_4, initial_5, initial_6;
- int former_music;
- int former_sound;
+ bool former_music;
+ bool former_sound;
PopupItem *music_item;
PopupItem *sound_item;
PopupItem *interface_item;
More information about the Scummvm-git-logs
mailing list