Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ set(GAMEENGINE_SRC
# Include/Common/BitFlagsIO.h
# Include/Common/BorderColors.h
# Include/Common/BuildAssistant.h
# Include/Common/CDManager.h
# Include/Common/ClientUpdateModule.h
# Include/Common/CommandLine.h
Include/Common/crc.h
Expand Down Expand Up @@ -144,7 +143,6 @@ set(GAMEENGINE_SRC
# Include/GameClient/Anim2D.h
# Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
# Include/GameClient/CDCheck.h
Include/GameClient/ChallengeGenerals.h
# Include/GameClient/ClientInstance.h
Include/GameClient/ClientRandomValue.h
Expand Down Expand Up @@ -643,7 +641,6 @@ set(GAMEENGINE_SRC
Source/Common/System/ArchiveFileSystem.cpp
Source/Common/System/AsciiString.cpp
# Source/Common/System/BuildAssistant.cpp
# Source/Common/System/CDManager.cpp
# Source/Common/System/CriticalSection.cpp
# Source/Common/System/DataChunk.cpp
Source/Common/System/Debug.cpp
Expand Down
3 changes: 0 additions & 3 deletions Core/GameEngine/Include/Common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ class FileSystem : public SubsystemInterface

Bool createDirectory(AsciiString directory); ///< create a directory of the given name.

Bool areMusicFilesOnCD();
void loadMusicFilesFromCD();
void unloadMusicFilesFromCD();

Comment thread
githubawn marked this conversation as resolved.
Outdated
static AsciiString normalizePath(const AsciiString& path); ///< normalizes a file path. The path can refer to a directory. File path must be absolute, but does not need to exist. Returns an empty string on failure.
static Bool isPathInDirectory(const AsciiString& testPath, const AsciiString& basePath); ///< determines if a file path is within a base path. Both paths must be absolute, but do not need to exist.
Expand Down
2 changes: 0 additions & 2 deletions Core/GameEngine/Include/Common/GameAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ class AudioManager : public SubsystemInterface
virtual void closeAnySamplesUsingFile( const void *fileToClose ) = 0;

virtual Bool isMusicAlreadyLoaded(void) const;
virtual Bool isMusicPlayingFromCD(void) const { return m_musicPlayingFromCD; }

Bool getDisallowSpeech( void ) const { return m_disallowSpeech; }
void setDisallowSpeech( Bool disallowSpeech ) { m_disallowSpeech = disallowSpeech; }
Expand Down Expand Up @@ -381,7 +380,6 @@ class AudioManager : public SubsystemInterface
Bool m_volumeHasChanged : 1;
Bool m_hardwareAccel : 1;
Bool m_surroundSpeakers : 1;
Bool m_musicPlayingFromCD : 1;

// Next 8
Comment thread
githubawn marked this conversation as resolved.
Outdated
Bool m_disallowSpeech : 1;
Expand Down
31 changes: 1 addition & 30 deletions Core/GameEngine/Source/Common/Audio/GameAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ AudioManager::AudioManager() :
m_music(nullptr),
m_sound(nullptr),
m_surroundSpeakers(FALSE),
m_hardwareAccel(FALSE),
m_musicPlayingFromCD(FALSE)
m_hardwareAccel(FALSE)
{
static_assert(ARRAY_SIZE(AudioManager::MuteAudioReasonNames) == MuteAudioReason_Count, "Incorrect array size");

Expand Down Expand Up @@ -231,34 +230,6 @@ void AudioManager::init()
// do the miscellaneous sound files last so that we find the AudioEventRTS associated with the events.
ini.loadFileDirectory( "Data\\INI\\MiscAudio", INI_LOAD_OVERWRITE, nullptr);

// determine if one of the music tracks exists. Since their now BIGd, one implies all.
// If they don't exist, then attempt to load them from the CD.
if (!TheGlobalData->m_headless && !isMusicAlreadyLoaded())
{
m_musicPlayingFromCD = TRUE;
while (TRUE)
{
// @todo Unload any files from CD first. - jkmcd

TheFileSystem->loadMusicFilesFromCD();
if (isMusicAlreadyLoaded())
{
break;
}
// We loop infinitely on the splash screen if we don't allow breaking out of this loop.
//#if !defined( RTS_DEBUG )
else
{
// Display the warning.

if (OSDisplayWarningBox("GUI:InsertCDPrompt", "GUI:InsertCDMessage", OSDBT_OK | OSDBT_CANCEL, OSDOF_SYSTEMMODAL | OSDOF_EXCLAMATIONICON) == OSDBT_CANCEL) {
//TheGameEngine->setQuitting(TRUE); // Can't do this to WorldBuilder
break;
}
}
//#endif
}
}

Comment thread
githubawn marked this conversation as resolved.
Outdated
m_music = NEW MusicManager;
m_sound = NEW SoundManager;
Expand Down
79 changes: 0 additions & 79 deletions Core/GameEngine/Source/Common/System/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "Common/FileSystem.h"

#include "Common/ArchiveFileSystem.h"
#include "Common/CDManager.h"
#include "Common/GameAudio.h"
#include "Common/LocalFileSystem.h"
#include "Common/PerfTimer.h"
Expand Down Expand Up @@ -330,84 +329,6 @@ Bool FileSystem::createDirectory(AsciiString directory)
return FALSE;
}

//============================================================================
// FileSystem::areMusicFilesOnCD
//============================================================================
Bool FileSystem::areMusicFilesOnCD()
{
#if 1
return TRUE;
#else
if (!TheCDManager) {
DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - No CD Manager; returning false"));
return FALSE;
}

AsciiString cdRoot;
Int dc = TheCDManager->driveCount();
for (Int i = 0; i < dc; ++i) {
DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking drive %d", i));
CDDriveInterface *cdi = TheCDManager->getDrive(i);
if (!cdi) {
continue;
}

cdRoot = cdi->getPath();
if (!cdRoot.endsWith("\\"))
cdRoot.concat("\\");
#if RTS_GENERALS
cdRoot.concat("gensec.big");
#elif RTS_ZEROHOUR
cdRoot.concat("genseczh.big");
#endif
DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking for %s", cdRoot.str()));
File *musicBig = TheLocalFileSystem->openFile(cdRoot.str());
if (musicBig)
{
DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - found it!"));
musicBig->close();
return TRUE;
}
}
return FALSE;
#endif
}
//============================================================================
// FileSystem::loadMusicFilesFromCD
//============================================================================
void FileSystem::loadMusicFilesFromCD()
{
if (!TheCDManager) {
return;
}

AsciiString cdRoot;
Int dc = TheCDManager->driveCount();
for (Int i = 0; i < dc; ++i) {
CDDriveInterface *cdi = TheCDManager->getDrive(i);
if (!cdi) {
continue;
}

cdRoot = cdi->getPath();
if (TheArchiveFileSystem->loadBigFilesFromDirectory(cdRoot, MUSIC_BIG)) {
break;
}
}
}

//============================================================================
// FileSystem::unloadMusicFilesFromCD
//============================================================================
void FileSystem::unloadMusicFilesFromCD()
{
if (!(TheAudio && TheAudio->isMusicPlayingFromCD())) {
return;
}

TheArchiveFileSystem->closeArchiveFile( MUSIC_BIG );
}

//============================================================================
// FileSystem::normalizePath
//============================================================================
Expand Down
3 changes: 0 additions & 3 deletions Generals/Code/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ set(GAMEENGINE_SRC
Include/Common/BitFlags.h
Include/Common/BitFlagsIO.h
Include/Common/BuildAssistant.h
Include/Common/CDManager.h
Include/Common/ClientUpdateModule.h
Include/Common/CommandLine.h
# Include/Common/crc.h
Expand Down Expand Up @@ -134,7 +133,6 @@ set(GAMEENGINE_SRC
Include/GameClient/AnimateWindowManager.h
# Include/GameClient/ChallengeGenerals.h
Include/GameClient/CampaignManager.h
Include/GameClient/CDCheck.h
Include/GameClient/ClientInstance.h
# Include/GameClient/ClientRandomValue.h
Include/GameClient/Color.h
Expand Down Expand Up @@ -592,7 +590,6 @@ set(GAMEENGINE_SRC
# Source/Common/System/ArchiveFileSystem.cpp
# Source/Common/System/AsciiString.cpp
Source/Common/System/BuildAssistant.cpp
Source/Common/System/CDManager.cpp
Source/Common/System/CriticalSection.cpp
Source/Common/System/DataChunk.cpp
# Source/Common/System/Debug.cpp
Expand Down
185 changes: 0 additions & 185 deletions Generals/Code/GameEngine/Include/Common/CDManager.h

This file was deleted.

Loading
Loading