SAGA2: Kill graphics/audio init in towerfta.cpp

This commit is contained in:
a/ 2021-05-24 17:14:14 +09:00 committed by Eugene Sandulenko
parent 354713cb36
commit 18a51673a2
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
5 changed files with 8 additions and 100 deletions

View File

@ -29,6 +29,14 @@
namespace Saga2 {
void initAudio() {
warning("STUB: initAudio()");
}
void cleanupAudio() {
warning("STUB: cleanupAudio()");
}
void *audioAlloc(size_t s, char desc[])
{
warning("STUB: audioAlloc()");

View File

@ -219,50 +219,6 @@ static ATTENUATOR(volumeFromDist) {
Module code
* ===================================================================== */
//-----------------------------------------------------------------------
// init - this allocates timers, but no audio
bool initAudio(void) {
// read audio INI file settings
#if DEBUG
debugStatuses = GetPrivateProfileInt("Debug", "Status", 0, iniFile);
debugResource = GetPrivateProfileInt("Debug", "Resource", 0, iniFile);
randomAudioTesting = GetPrivateProfileInt("Debug", "AudioStress", 0, iniFile);
debugAudioThemes = GetPrivateProfileInt("Debug", "AudioThemes", 0, iniFile);
#endif
voiceRes = NULL;
musicRes = NULL;
soundRes = NULL;
loopRes = NULL;
longRes = NULL;
//allocate primary audio interface
audio = new audioInterface;
if (audio == NULL) return FALSE;
// check for missing drivers
#ifndef REQUIRE_AUDIO
if (audio->dig == NULL && !retryConfigError(cpNoDIGAudioCheck, "Digital sound driver not loaded"))
return FALSE;
if (audio->mid == NULL && !retryConfigError(cpNoMDIAudioCheck, "MIDI music driver not loaded"))
return FALSE;
#else
#ifndef _WIN32
REQUIRE(audio->dig, cpNoDIGAudio);
REQUIRE(audio->mid, cpNoMDIAudio);
//if ( audio->dig==NULL )
// return FALSE;
//if ( audio->mid==NULL )
// return FALSE;
#endif
#endif
return TRUE;
}
//-----------------------------------------------------------------------
// after system initialization - startup code
@ -381,34 +337,6 @@ void startAudio(void) {
audio->disable(volSound);
}
//-----------------------------------------------------------------------
// cleanup
void cleanupAudio(void) {
if (audio) {
audio->cleanupAudioInterface();
delete audio;
audio = NULL;
killIt(clickData[1]);
killIt(clickData[2]);
killIt(voiceDec);
killIt(musicDec);
killIt(soundDec);
killIt(longSoundDec);
killIt(loopDec);
killIt(memDec);
killIt(musicRes);
killIt(soundRes);
killIt(longRes);
killIt(loopRes);
killIt(voiceRes);
}
}
//-----------------------------------------------------------------------
// audio event loop

View File

@ -70,8 +70,6 @@ TowerLayer tower[fullyInitialized] = {
{ videoInitialized, &initVideoPlayer, &termVideoPlayer, cpInternal },
{ introInitialized, &initPlayIntro, &termPlayOutro, cpInternal },
{ timerInitialized, &initSystemTimer, &termSystemTimer, cpDTimerInitFail },
{ audioInitialized, &initAudio, &termAudio, cpDSoundInitFail },
{ SVGAInitialized, &initGraphics, &termGraphics, cpInternal },
{ resourcesInitialized, &initResourceFiles, &termResourceFiles, cpResFileMissing },
{ serversInitialized, &initResourceServers, &termResourceServers, cpInternal },
{ pathFinderInitialized, &initPathFinders, &termPathFinders, cpInternal },
@ -232,24 +230,6 @@ TERMINATOR(termSystemTimer) {
}
// ------------------------------------------------------------------------
extern INITIALIZER(initAudio);
TERMINATOR(termAudio) {
cleanupAudio();
}
// ------------------------------------------------------------------------
extern INITIALIZER(initGraphics);
TERMINATOR(termGraphics) {
cleanupGraphics();
}
// ------------------------------------------------------------------------
INITIALIZER(initResourceFiles) {

View File

@ -58,12 +58,6 @@ TERMINATOR(termPlayOutro);
INITIALIZER(initSystemTimer);
TERMINATOR(termSystemTimer);
INITIALIZER(initAudio);
TERMINATOR(termAudio);
INITIALIZER(initGraphics);
TERMINATOR(termGraphics);
INITIALIZER(initResourceFiles);
TERMINATOR(termResourceFiles);

View File

@ -40,9 +40,7 @@ enum initializationStates {
graphicsSystemInitialized,
procResEnabled,
memoryInitialized,
audioInitialized,
videoInitialized,
SVGAInitialized,
resourcesInitialized,
serversInitialized,
pathFinderInitialized,