mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a3b3fe8a5 |
@@ -48,6 +48,12 @@ The following settings were moved into [`<DAT>/config/game.cfg`](files/ce.dat/co
|
||||
| `Misc` | `ViewXPos` | `start` | `worldmap_view_x` |
|
||||
| `Misc` | `ViewYPos` | `start` | `worldmap_view_y` |
|
||||
| `Misc` | `StartGDialogFix` | `dialog` | `start_gdialog_fix` |
|
||||
| `Sound` | `MainMenuMusic` | `sound` | `main_menu_music` |
|
||||
| `Sound` | `WorldMapMusic` | `sound` | `worldmap_music` |
|
||||
| `Sound` | `WorldMapCarMusic` | `sound` | `worldmap_car_music` |
|
||||
| `Sound` | `EndGameMovieMusic0` | `sound` | `endgame_movie_music0` |
|
||||
| `Sound` | `EndGameMovieMusic1` | `sound` | `endgame_movie_music1` |
|
||||
| `Sound` | `MapLoadingSound` | `sound` | `map_loading_sound` |
|
||||
|
||||
## Opcodes / Metarules
|
||||
|
||||
|
||||
@@ -65,6 +65,18 @@ offset_y=0
|
||||
credits_offset_x=0
|
||||
credits_offset_y=0
|
||||
|
||||
[sound]
|
||||
; Background music played on the main menu.
|
||||
main_menu_music=07desert
|
||||
; Background music played while viewing the world map on foot or in the car.
|
||||
worldmap_music=03wrldmp
|
||||
worldmap_car_music=20car
|
||||
; Music played before and during the end-game credits/movie sequence.
|
||||
endgame_movie_music0=maybe
|
||||
endgame_movie_music1=10labone
|
||||
; Music file played as looping ambience while maps are loading.
|
||||
map_loading_sound=wind2
|
||||
|
||||
[movies]
|
||||
; Number of days after game start when each Hakunin dream sequence becomes available.
|
||||
artimer1=90
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace fallout {
|
||||
#define CONTENT_CONFIG_ITEMS_SECTION "items"
|
||||
#define CONTENT_CONFIG_DIALOG_SECTION "dialog"
|
||||
#define CONTENT_CONFIG_MAIN_MENU_SECTION "main_menu"
|
||||
#define CONTENT_CONFIG_SOUND_SECTION "sound"
|
||||
#define CONTENT_CONFIG_MOVIES_SECTION "movies"
|
||||
#define CONTENT_CONFIG_COMBAT_SECTION "combat"
|
||||
#define CONTENT_CONFIG_EXPLOSIONS_SECTION "explosions"
|
||||
|
||||
+11
-2
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "art.h"
|
||||
#include "color.h"
|
||||
#include "content_config.h"
|
||||
#include "credits.h"
|
||||
#include "cycle.h"
|
||||
#include "db.h"
|
||||
@@ -78,6 +79,7 @@ static void _endgame_voiceover_callback();
|
||||
static int endgameEndingSubtitlesLoad(const char* filePath);
|
||||
static void endgameEndingRefreshSubtitles();
|
||||
static void endgameEndingSubtitlesFree();
|
||||
static const char* endgameGetSoundConfig(const char* key, const char* defaultValue);
|
||||
static void _endgame_movie_callback();
|
||||
static void _endgame_movie_bk_process();
|
||||
static int endgameEndingInit();
|
||||
@@ -239,7 +241,7 @@ void endgamePlayMovie()
|
||||
_endgame_maybe_done = 0;
|
||||
tickersAdd(_endgame_movie_bk_process);
|
||||
backgroundSoundSetEndCallback(_endgame_movie_callback);
|
||||
backgroundSoundLoad("akiss", GSOUND_LIMIT_AFTER, GSOUND_STREAM, GSOUND_NO_LOOP);
|
||||
backgroundSoundLoad(endgameGetSoundConfig("endgame_movie_music0", "maybe"), GSOUND_LIMIT_AFTER, GSOUND_STREAM, GSOUND_NO_LOOP);
|
||||
inputPauseForTocks(3000);
|
||||
|
||||
// NOTE: Result is ignored. I guess there was some kind of switch for male
|
||||
@@ -872,6 +874,13 @@ static void endgameEndingSubtitlesFree()
|
||||
gEndgameEndingSubtitlesLength = 0;
|
||||
}
|
||||
|
||||
static const char* endgameGetSoundConfig(const char* key, const char* defaultValue)
|
||||
{
|
||||
char* value = nullptr;
|
||||
configGetString(&gContentConfig, CONTENT_CONFIG_SOUND_SECTION, key, &value, nullptr);
|
||||
return value != nullptr && value[0] != '\0' ? value : defaultValue;
|
||||
}
|
||||
|
||||
// 0x440728 endgame_movie_callback
|
||||
static void _endgame_movie_callback()
|
||||
{
|
||||
@@ -882,7 +891,7 @@ static void _endgame_movie_callback()
|
||||
static void _endgame_movie_bk_process()
|
||||
{
|
||||
if (_endgame_maybe_done) {
|
||||
backgroundSoundLoad("10labone", GSOUND_LIMIT_BEFORE, GSOUND_STREAM, GSOUND_LOOP);
|
||||
backgroundSoundLoad(endgameGetSoundConfig("endgame_movie_music1", "10labone"), GSOUND_LIMIT_BEFORE, GSOUND_STREAM, GSOUND_LOOP);
|
||||
backgroundSoundSetEndCallback(nullptr);
|
||||
tickersRemove(_endgame_movie_bk_process);
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ namespace {
|
||||
|
||||
constexpr char kSfallMisc[] = "Misc";
|
||||
constexpr char kSfallInterface[] = "Interface";
|
||||
constexpr char kSfallSound[] = "Sound";
|
||||
|
||||
struct SfallMigrationEntry {
|
||||
const char* sfallSection;
|
||||
@@ -199,6 +200,13 @@ namespace {
|
||||
{ kSfallMisc, "MainMenuOffsetY", CONTENT_CONFIG_MAIN_MENU_SECTION, "offset_y", "0" },
|
||||
{ kSfallMisc, "MainMenuCreditsOffsetX", CONTENT_CONFIG_MAIN_MENU_SECTION, "credits_offset_x", "0" },
|
||||
{ kSfallMisc, "MainMenuCreditsOffsetY", CONTENT_CONFIG_MAIN_MENU_SECTION, "credits_offset_y", "0" },
|
||||
// [sound]
|
||||
{ kSfallSound, "MainMenuMusic", CONTENT_CONFIG_SOUND_SECTION, "main_menu_music", "07desert" },
|
||||
{ kSfallSound, "WorldMapMusic", CONTENT_CONFIG_SOUND_SECTION, "worldmap_music", "03wrldmp" },
|
||||
{ kSfallSound, "WorldMapCarMusic", CONTENT_CONFIG_SOUND_SECTION, "worldmap_car_music", "20car" },
|
||||
{ kSfallSound, "EndGameMovieMusic0", CONTENT_CONFIG_SOUND_SECTION, "endgame_movie_music0", "maybe" },
|
||||
{ kSfallSound, "EndGameMovieMusic1", CONTENT_CONFIG_SOUND_SECTION, "endgame_movie_music1", "10labone" },
|
||||
{ kSfallSound, "MapLoadingSound", CONTENT_CONFIG_SOUND_SECTION, "map_loading_sound", "wind2" },
|
||||
// [movies]
|
||||
{ kSfallMisc, "MovieTimer_artimer1", CONTENT_CONFIG_MOVIES_SECTION, "artimer1", "90" },
|
||||
{ kSfallMisc, "MovieTimer_artimer2", CONTENT_CONFIG_MOVIES_SECTION, "artimer2", "180" },
|
||||
|
||||
+9
-1
@@ -56,6 +56,7 @@ static int main_loadgame_new();
|
||||
static void main_unload_new();
|
||||
static void mainParseCommandLineArguments(int argc, char** argv);
|
||||
static bool mainTryParseDevLoadGameSlot(const char* value, int* slotPtr);
|
||||
static const char* mainGetSoundConfig(const char* key, const char* defaultValue);
|
||||
static void mainLoop();
|
||||
static void showDeath();
|
||||
static void _main_death_voiceover_callback();
|
||||
@@ -105,7 +106,7 @@ int falloutMain(int argc, char** argv)
|
||||
bool done = false;
|
||||
while (!done) {
|
||||
keyboardReset();
|
||||
_gsound_background_play_level_music("07desert", GSOUND_LIMIT_BEFORE);
|
||||
_gsound_background_play_level_music(mainGetSoundConfig("main_menu_music", "07desert"), GSOUND_LIMIT_BEFORE);
|
||||
mainMenuWindowUnhide(true);
|
||||
|
||||
mouseShowCursor();
|
||||
@@ -277,6 +278,13 @@ static void mainParseCommandLineArguments(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
static const char* mainGetSoundConfig(const char* key, const char* defaultValue)
|
||||
{
|
||||
char* value = nullptr;
|
||||
configGetString(&gContentConfig, CONTENT_CONFIG_SOUND_SECTION, key, &value, nullptr);
|
||||
return value != nullptr && value[0] != '\0' ? value : defaultValue;
|
||||
}
|
||||
|
||||
static bool mainTryParseDevLoadGameSlot(const char* value, int* slotPtr)
|
||||
{
|
||||
if (value == nullptr || slotPtr == nullptr) {
|
||||
|
||||
+13
-1
@@ -12,6 +12,7 @@
|
||||
#include "character_editor.h"
|
||||
#include "color.h"
|
||||
#include "combat.h"
|
||||
#include "content_config.h"
|
||||
#include "critter.h"
|
||||
#include "cycle.h"
|
||||
#include "debug.h"
|
||||
@@ -64,6 +65,7 @@ static int mapGlobalVariablesLoad(File* stream);
|
||||
static int mapLocalVariablesInit(int count);
|
||||
static void mapLocalVariablesFree();
|
||||
static int mapLocalVariablesLoad(File* stream);
|
||||
static const char* mapGetSoundConfig(const char* key, const char* defaultValue);
|
||||
static void _map_place_dude_and_mouse();
|
||||
static void square_init();
|
||||
static void _square_reset();
|
||||
@@ -789,6 +791,13 @@ void mapNewMap()
|
||||
tileWindowRefresh();
|
||||
}
|
||||
|
||||
static const char* mapGetSoundConfig(const char* key, const char* defaultValue)
|
||||
{
|
||||
char* value = nullptr;
|
||||
configGetString(&gContentConfig, CONTENT_CONFIG_SOUND_SECTION, key, &value, nullptr);
|
||||
return value != nullptr && value[0] != '\0' ? value : defaultValue;
|
||||
}
|
||||
|
||||
// 0x482A68 map_load
|
||||
int mapLoadByName(char* fileName)
|
||||
{
|
||||
@@ -862,7 +871,10 @@ static int mapLoad(File* stream)
|
||||
if (backgoundSoundIsPlaying()) {
|
||||
// Use the sfall sound path so the map-loading ambience does not depend
|
||||
// on the native background music loader.
|
||||
mapLoadSoundId = scriptSoundPlay("sound\\music\\WIND2.ACM", SCRIPT_SOUND_MODE_LOOP);
|
||||
const char* mapLoadingSound = mapGetSoundConfig("map_loading_sound", "wind2");
|
||||
char mapLoadingSoundPath[COMPAT_MAX_PATH];
|
||||
snprintf(mapLoadingSoundPath, sizeof(mapLoadingSoundPath), "sound\\music\\%s.ACM", mapLoadingSound);
|
||||
mapLoadSoundId = scriptSoundPlay(mapLoadingSoundPath, SCRIPT_SOUND_MODE_LOOP);
|
||||
}
|
||||
}
|
||||
isoDisable();
|
||||
|
||||
+10
-1
@@ -4738,7 +4738,16 @@ static int wmInterfaceInit()
|
||||
|
||||
_map_save_in_game(true);
|
||||
|
||||
const char* backgroundSoundFileName = wmGenData.isInCar ? "20car" : "23world";
|
||||
char* configuredBackgroundSoundFileName = nullptr;
|
||||
const char* backgroundSoundFileName = wmGenData.isInCar ? "20car" : "03wrldmp";
|
||||
configGetString(&gContentConfig,
|
||||
CONTENT_CONFIG_SOUND_SECTION,
|
||||
wmGenData.isInCar ? "worldmap_car_music" : "worldmap_music",
|
||||
&configuredBackgroundSoundFileName,
|
||||
nullptr);
|
||||
if (configuredBackgroundSoundFileName != nullptr && configuredBackgroundSoundFileName[0] != '\0') {
|
||||
backgroundSoundFileName = configuredBackgroundSoundFileName;
|
||||
}
|
||||
_gsound_background_play_level_music(backgroundSoundFileName, GSOUND_LIMIT_AFTER);
|
||||
|
||||
// CE: Hide entire interface, not just indicator bar, and disable tile
|
||||
|
||||
Reference in New Issue
Block a user