SLUDGE: Reduce header dependency

This commit is contained in:
Eugene Sandulenko 2021-05-08 13:19:43 +02:00
parent 9759e9d131
commit 8880eceaa7
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
6 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,6 @@
*/
#include "common/debug.h"
#include "common/config-manager.h"
#include "sludge/fileset.h"
#include "sludge/moreio.h"
@ -221,7 +220,7 @@ void ResourceManager::finishAccess() {
}
void ResourceManager::dumpFile(int num, const char *pattern) {
if (!ConfMan.getBool("dump_scripts"))
if (!g_sludge->_dumpScripts)
return;
Common::DumpFile dumpFile;

View File

@ -20,8 +20,6 @@
*
*/
#include "common/config-manager.h"
#include "sludge/fileset.h"
#include "sludge/floor.h"
#include "sludge/graphics.h"
@ -255,7 +253,7 @@ bool FloorManager::setFloor(int fileNum) {
}
void FloorManager::dumpFloor(int fileNum) {
if (!ConfMan.getBool("dump_scripts"))
if (!g_sludge->_dumpScripts)
return;
Common::DumpFile dumpFile;

View File

@ -20,7 +20,6 @@
*
*/
#include "common/config-manager.h"
#include "common/debug.h"
#include "image/png.h"
@ -54,7 +53,7 @@ bool ImgLoader::loadImage(int num, const char *fname, Common::SeekableReadStream
g_sludge->_resMan->dumpFile(num, Common::String::format("%s%%04d.png", fname).c_str());
}
if (!ConfMan.getBool("dump_scripts"))
if (!g_sludge->_dumpScripts)
return true;
if (dumpPng || (fname && num == -1)) {

View File

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/error.h"
#include "common/random.h"
@ -66,6 +67,8 @@ SludgeEngine::SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc)
DebugMan.enableDebugChannel("Data Load");
DebugMan.enableDebugChannel("Built-in");
_dumpScripts = ConfMan.getBool("dump_scripts");
// init graphics
_origFormat = new Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
_pixelFormat = new Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);

View File

@ -97,6 +97,8 @@ public:
FatalMsgManager *_fatalMan;
StatusBarManager *_statusBar;
bool _dumpScripts;
SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc);
~SludgeEngine() override;

View File

@ -20,7 +20,6 @@
*
*/
#include "common/config-manager.h"
#include "image/png.h"
#include "sludge/fileset.h"
@ -172,7 +171,7 @@ bool GraphicsManager::setZBuffer(int num) {
g_sludge->_resMan->finishAccess();
setResourceForFatal(-1);
if (!ConfMan.getBool("dump_scripts"))
if (!g_sludge->_dumpScripts)
return true;
// Debug code to output light map image