[Scummvm-git-logs] scummvm master -> b9107e27ee793a0770130944c79e85e9617c991f

AndywinXp noreply at scummvm.org
Sat Sep 23 11:21:33 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b9107e27ee SWORD1: Implement pause button and on-screen debug text


Commit: b9107e27ee793a0770130944c79e85e9617c991f
    https://github.com/scummvm/scummvm/commit/b9107e27ee793a0770130944c79e85e9617c991f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-09-23T13:21:27+02:00

Commit Message:
SWORD1: Implement pause button and on-screen debug text

You can now pause the game via the 'P' key! Also, using CTRL-T
when ScummVM is in debug mode, toggles some on-screen debug
information which was also available in the original DOS version by
launching the game as "sword rev text". Implementing all of this also
meant that I had to finally implement the FPS counter.

I frankly don't know if the PSX version was supposed to have this, but
it appears to work right out of the box...

Changed paths:
    engines/sword1/control.cpp
    engines/sword1/control.h
    engines/sword1/logic.cpp
    engines/sword1/logic.h
    engines/sword1/screen.cpp
    engines/sword1/screen.h
    engines/sword1/sword1.cpp
    engines/sword1/sword1.h
    engines/sword1/text.cpp
    engines/sword1/text.h


diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index bd33a6e8612..40220ae508e 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -3170,6 +3170,10 @@ bool Control::loadCustomStrings(const char *filename) {
 	return false;
 }
 
+const uint8 *Control::getPauseString() {
+	return _lStrings[STR_PAUSED];
+}
+
 const uint8 Control::_languageStrings[8 * 20][43] = {
 	// BS1_ENGLISH:
 	"PAUSED",
diff --git a/engines/sword1/control.h b/engines/sword1/control.h
index 3cc8c75e0e0..3bd4b26b5ed 100644
--- a/engines/sword1/control.h
+++ b/engines/sword1/control.h
@@ -126,6 +126,7 @@ public:
 	bool restoreGame();
 	void checkForOldSaveGames();
 	bool isPanelShown();
+	const uint8 *getPauseString();
 
 	void setSaveDescription(int slot, const char *desc) {
 		Common::strcpy_s((char *)_fileDescriptions[slot], sizeof(_fileDescriptions[slot]), desc);
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index ca359af5646..dbbaf2e3608 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -88,7 +88,7 @@ void Logic::initialize() {
 	_eventMan = new EventManager();
 
 	delete _textMan;
-	_textMan = new Text(_objMan, _resMan,
+	_textMan = new Text(_vm, this, _objMan, _resMan, _screen,
 	                    (SwordEngine::_systemVars.language == BS1_CZECH) ? true : false);
 	_screen->useTextManager(_textMan);
 	_textRunning = _speechRunning = false;
@@ -1136,6 +1136,8 @@ int Logic::fnISpeak(Object *cpt, int32 id, int32 cdt, int32 textNo, int32 spr, i
 	}
 	cpt->o_logic = LOGIC_speech;
 
+	SwordEngine::_systemVars.textNumber = textNo;
+
 	// first setup the talk animation
 	if (cdt && (!spr)) { // if 'cdt' is non-zero but 'spr' is zero - 'cdt' is an anim table tag
 		AnimSet *animTab = (AnimSet *)((uint8 *)_resMan->openFetchRes(cdt) + sizeof(Header));
@@ -1823,6 +1825,10 @@ void Logic::startPositions(uint32 pos) {
 	SwordEngine::_systemVars.wantFade = true;
 }
 
+bool Logic::canShowDebugTextNumber() {
+	return _speechRunning || _textRunning;
+}
+
 const uint32 Logic::_scriptVarInit[NON_ZERO_SCRIPT_VARS][2] = {
 	{  42,  448}, {  43,  378}, {  51,    1}, {  92,    1}, { 147,   71}, { 201,   1},
 	{ 209,    1}, { 215,    1}, { 242,    2}, { 244,    1}, { 246,    3}, { 247,   1},
diff --git a/engines/sword1/logic.h b/engines/sword1/logic.h
index 0bb3ead688f..69f54b2caf3 100644
--- a/engines/sword1/logic.h
+++ b/engines/sword1/logic.h
@@ -63,6 +63,7 @@ public:
 	void updateScreenParams();
 	void runMouseScript(Object *cpt, int32 scriptId);
 	void startPositions(uint32 pos);
+	bool canShowDebugTextNumber();
 
 	static uint32 _scriptVars[NUM_SCRIPT_VARS];
 // public for mouse (menu looking)
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index f3b15c7ca7a..f993cd3c685 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -562,6 +562,8 @@ void Screen::draw() {
 		processImage(_foreList[cnt]);
 
 	_backLength = _sortLength = _foreLength = 0;
+
+	_textMan->showDebugInfo();
 }
 
 void Screen::initFadePaletteServer() {
diff --git a/engines/sword1/screen.h b/engines/sword1/screen.h
index 19a27fc58cc..b4be20bc822 100644
--- a/engines/sword1/screen.h
+++ b/engines/sword1/screen.h
@@ -71,6 +71,7 @@ class Text; // Text objects use sprites that are created internally at run-time
 			// the buffer belongs to Text, so we need a reference here.
 
 class Screen {
+	friend class Text;
 public:
 	Screen(OSystem *system, ResMan *pResMan, ObjectMan *pObjMan);
 	~Screen();
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 4edc687ac05..66def168fa7 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -152,10 +152,15 @@ Common::Error SwordEngine::init() {
 	}
 
 	_systemVars.showText = ConfMan.getBool("subtitles");
-
+	_systemVars.textNumber = 0;
 	_systemVars.playSpeech = true;
 	_mouseState = 0;
 
+	_systemVars.gamePaused = false;
+	_systemVars.displayDebugText = false;
+	_systemVars.framesPerSecondCounter = 0;
+	_systemVars.gameCycle = 0;
+
 	// Some Mac versions use big endian for the speech files but not all of them.
 	if (_systemVars.platform == Common::kPlatformMacintosh)
 		_sound->checkSpeechFileEndianness();
@@ -253,6 +258,30 @@ void SwordEngine::flagsToBool(bool *dest, uint8 flags) {
 }
 
 void SwordEngine::checkKeys() {
+
+	if (_systemVars.gamePaused) {
+		// TODO: Audio
+		//PauseSpeech();
+		//PauseMusic();
+		//PauseFx();
+		_mixer->pauseAll(true);
+
+		while (_keyPressed.keycode != Common::KEYCODE_p && !Engine::shouldQuit()) {
+			pollInput(0);
+			// TODO: Audio
+			// UpdateSampleStreaming();
+		}
+
+		// TODO: Audio
+		//UnpauseSpeech();
+		//UnpauseMusic();
+		//UnpauseFx();
+		_mixer->pauseAll(false);
+
+		_systemVars.gamePaused = false;
+		_keyPressed.reset();
+	}
+
 	switch (_keyPressed.keycode) {
 	case Common::KEYCODE_F5:
 	case Common::KEYCODE_ESCAPE:
@@ -261,6 +290,14 @@ void SwordEngine::checkKeys() {
 			_systemVars.snrStatus = SNR_MAINPANEL;
 		}
 
+		break;
+	case Common::KEYCODE_q:
+		if (_keyPressed.hasFlags(Common::KBD_CTRL))
+			Engine::quitGame();
+
+		break;
+	case Common::KEYCODE_p:
+		_systemVars.gamePaused = true;
 		break;
 	default:
 		break;
@@ -269,6 +306,10 @@ void SwordEngine::checkKeys() {
 	// Debug keys!
 	if (!_systemVars.isDemo && _systemVars.debugMode) {
 		switch (_keyPressed.keycode) {
+		case Common::KEYCODE_t: // CTRL-T: Toggles debug text
+			if (_keyPressed.hasFlags(Common::KBD_CTRL))
+				_systemVars.displayDebugText = !_systemVars.displayDebugText;
+			break;
 		case Common::KEYCODE_1: // Slow mode
 			{
 				if (_systemVars.slowMode) {
@@ -305,6 +346,10 @@ void SwordEngine::checkKeys() {
 	}
 }
 
+const uint8 *SwordEngine::getPauseString() {
+	return _control->getPauseString();
+}
+
 static const char *const errorMsgs[] = {
 	"The file \"%s\" is missing and the game doesn't work without it.\n"
 	"Please copy it from CD %d and try starting the game again.\n"
@@ -782,6 +827,7 @@ void SwordEngine::askForCd() {
 
 uint8 SwordEngine::mainLoop() {
 	_keyPressed.reset();
+	_systemVars.gameCycle = 1;
 
 	do {
 		if (shouldQuit())
@@ -803,6 +849,8 @@ uint8 SwordEngine::mainLoop() {
 
 			_systemVars.saveGameFlag = SGF_DONE;
 
+			_systemVars.gameCycle++;
+
 			_logic->engine();
 			_logic->updateScreenParams(); // sets scrolling
 
@@ -815,6 +863,8 @@ uint8 SwordEngine::mainLoop() {
 					scrollFrameShown = _screen->showScrollFrame();
 					pollInput((_targetFrameTime / 2) - (_system->getMillis() - frameTime));
 				}
+
+				_mainLoopFrameCount++;
 			}
 
 			_sound->engine();
@@ -822,10 +872,20 @@ uint8 SwordEngine::mainLoop() {
 			newTime = _system->getMillis();
 			if (((int32)(newTime - frameTime) < _targetFrameTime) || (!scrollFrameShown))
 				_screen->updateScreen();
+			_mainLoopFrameCount++;
 			pollInput((_targetFrameTime) - (_system->getMillis() - frameTime));
 
 			_vblCount = 0; // Reset the vBlank counter for the other timers...
 
+			// Calculation for the frames per second counter for the debug text
+			if (_ticker > 5000)
+				_ticker = 0;
+			if (_ticker > 1000) {
+				_systemVars.framesPerSecondCounter = _mainLoopFrameCount;
+				_mainLoopFrameCount = 0;
+				_ticker -= 1000;
+			}
+
 			_mouse->engine(_mouseCoord.x, _mouseCoord.y, _mouseState);
 
 			checkKeys();
@@ -959,6 +1019,7 @@ void SwordEngine::startFadePaletteUp(int speed) {
 static void vblCallback(void *refCon) {
 	SwordEngine *vm = (SwordEngine *)refCon;
 
+	vm->_ticker += 10;
 	vm->_inTimer++;
 
 	if (vm->_inTimer == 0) {
@@ -987,6 +1048,7 @@ static void vblCallback(void *refCon) {
 
 void SwordEngine::installTimerRoutines() {
 	debug(2, "SwordEngine::installTimerRoutines(): Installing timers...");
+	_ticker = 0;
 	getTimerManager()->installTimerProc(&vblCallback, 1000000 / TIMER_RATE, this, "AILTimer");
 }
 
diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h
index 40017f8a72f..a05238788b8 100644
--- a/engines/sword1/sword1.h
+++ b/engines/sword1/sword1.h
@@ -70,6 +70,7 @@ struct SystemVars {
 	bool             wantFade;           // when true => fade during scene change, else cut.
 	bool             playSpeech;
 	bool             showText;
+	int32            textNumber;
 	uint8            language;
 	bool             isDemo;
 	bool             isSpanishDemo;
@@ -80,6 +81,10 @@ struct SystemVars {
 	bool             slowMode;
 	bool             fastMode;
 	bool             parallaxOn;
+	bool             gamePaused;
+	bool             displayDebugText;
+	uint32           framesPerSecondCounter;
+	uint32           gameCycle;
 };
 
 class SwordEngine : public Engine {
@@ -100,6 +105,8 @@ public:
 	int _vblCount = 0; // How many vblCallback calls have been made?
 	int _rate = DEFAULT_FRAME_TIME / 10;
 	int _targetFrameTime = DEFAULT_FRAME_TIME;
+	uint32 _mainLoopFrameCount = 0;
+	uint32 _ticker = 0; // For the frame time shown within the debug text
 
 	bool mouseIsActive();
 
@@ -115,6 +122,8 @@ public:
 	void startFadePaletteUp(int speed);
 	void waitForFade();
 
+	const uint8 *getPauseString();
+
 protected:
 	// Engine APIs
 	Common::Error init();
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index b7a02c068a4..7bea6e4bce2 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -24,6 +24,7 @@
 #include "common/str.h"
 #include "common/unicode-bidi.h"
 
+#include "sword1/logic.h"
 #include "sword1/text.h"
 #include "sword1/resman.h"
 #include "sword1/objectman.h"
@@ -35,13 +36,17 @@
 namespace Sword1 {
 
 #define OVERLAP 3
+#define DEBUG_OVERLAP 2
 #define SPACE ' '
 #define MAX_LINES       30
 
 
-Text::Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) {
+Text::Text(SwordEngine *vm, Logic *pLogic, ObjectMan *pObjMan, ResMan *pResMan, Screen *pScreen, bool czechVersion) {
+	_vm = vm;
+	_logic = pLogic;
 	_objMan = pObjMan;
 	_resMan = pResMan;
+	_screen = pScreen;
 	_textCount = 0;
 	_fontId = (czechVersion) ? CZECH_GAME_FONT : GAME_FONT;
 	_font = (uint8 *)_resMan->openFetchRes(_fontId);
@@ -222,4 +227,185 @@ void Text::releaseText(uint32 id, bool updateCount) {
 	}
 }
 
+void Text::printDebugLine(uint8 *ascii, uint8 *resourceAddress, uint8 first, int x, int y) {
+	FrameHeader *head;
+	int chr;
+
+	do {
+		chr = (int)*(ascii);
+		chr -= first;
+
+		head = (FrameHeader *)_resMan->fetchFrame(resourceAddress, chr);
+
+		uint8 *sprData = (uint8 *)head + sizeof(FrameHeader);
+
+		// The original drawSprite routine also clipped the sprite, so
+		// let's do that as well in order to produce an accurate result...
+		uint16 newCoordsX = x;
+		uint16 newCoordsY = y;
+		uint16 newWidth = _resMan->getUint16(head->width);
+		uint16 newHeight = SwordEngine::isPsx() ?
+			_resMan->getUint16(head->height) / 2 : _resMan->getUint16(head->height);
+		uint16 incr;
+		_screen->spriteClipAndSet(&newCoordsX, &newCoordsY, &newWidth, &newHeight, &incr);
+		_screen->drawSprite(sprData + incr, newCoordsX, newCoordsY, newWidth, newHeight, newWidth);
+
+		x += _resMan->getUint16(head->width);
+
+		// The very first executable version didn't use any overlap (verified on UK disasm)
+		if (SwordEngine::_systemVars.realLanguage != Common::EN_ANY)
+			x -= DEBUG_OVERLAP;
+
+		ascii++;
+	} while (*ascii);
+}
+
+void Text::showDebugInfo() {
+
+	Object *playerCompact = _objMan->fetchObject(PLAYER);
+
+	// Screen coordinates for game cycle string
+	int32 gameCycleX = Logic::_scriptVars[SCROLL_OFFSET_X] + 130;
+	int32 gameCycleY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for mouse coordinates string
+	int32 mouseCoordsX = Logic::_scriptVars[SCROLL_OFFSET_X] + 220;
+	int32 mouseCoordsY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for special item string
+	int32 specialItemX = Logic::_scriptVars[SCROLL_OFFSET_X] + 350;
+	int32 specialItemY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for player coordinates string
+	int32 playerCoordsX = Logic::_scriptVars[SCROLL_OFFSET_X] + 475;
+	int32 playerCoordsY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for Paris flag string
+	int32 parisFlagX = Logic::_scriptVars[SCROLL_OFFSET_X] + 590;
+	int32 parisFlagY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for player's script level string
+	int32 scriptLevelX = Logic::_scriptVars[SCROLL_OFFSET_X] + 660;
+	int32 scriptLevelY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for the talk flag string
+	int32 talkFlagX = Logic::_scriptVars[SCROLL_OFFSET_X] + 720;
+	int32 talkFlagY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 125;
+
+	// Screen coordinates for FPS counter string
+	int32 fpsX = Logic::_scriptVars[SCROLL_OFFSET_X] + 130;
+	int32 fpsY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 145;
+
+	// Screen coordinates for game speed string
+	int32 gameSpeedX = Logic::_scriptVars[SCROLL_OFFSET_X] + 220;
+	int32 gameSpeedY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 145;
+
+	// Screen coordinates for screen number string
+	int32 screenX = Logic::_scriptVars[SCROLL_OFFSET_X] + 350;
+	int32 screenY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 145;
+
+	// Screen coordinates for current CD string
+	int32 currentCDX = Logic::_scriptVars[SCROLL_OFFSET_X] + 475;
+	int32 currentCDY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 145;
+
+	// Screen coordinates for the end sequence phase string
+	int32 endSceneX = Logic::_scriptVars[SCROLL_OFFSET_X] + 590;
+	int32 endSceneY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 145;
+
+	// Screen coordinates for the current text line number string
+	int32 textNoX = Logic::_scriptVars[SCROLL_OFFSET_X] + 130;
+	int32 textNoY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 165;
+
+	// Screen coordinates for debug flags string
+	int32 debugFlagsX = Logic::_scriptVars[SCROLL_OFFSET_X] + 130;
+	int32 debugFlagsY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 185;
+
+	// Screen coordinates for the paused message string
+	int32 pausedX = Logic::_scriptVars[SCROLL_OFFSET_X] + 400;
+	int32 pausedY = Logic::_scriptVars[SCROLL_OFFSET_Y] + 315;
+
+	uint8 buf[255];
+
+	if (SwordEngine::_systemVars.gamePaused) {
+		Common::sprintf_s(buf, "%s", _vm->getPauseString());
+		printDebugLine(buf, _font, ' ', pausedX, pausedY);
+	}
+
+	if ((SwordEngine::_systemVars.displayDebugText) && (!SwordEngine::_systemVars.isDemo)) {
+		// Game cycle
+		Common::sprintf_s(buf, "%d", SwordEngine::_systemVars.gameCycle);
+		printDebugLine(buf, _font, ' ', gameCycleX, gameCycleY);
+
+		// Mouse coordinates
+		Common::sprintf_s(buf, "m %d,%d", Logic::_scriptVars[MOUSE_X], Logic::_scriptVars[MOUSE_Y]);
+		printDebugLine(buf, _font, ' ', mouseCoordsX, mouseCoordsY);
+
+		// Special item
+		Common::sprintf_s(buf, "id %d", Logic::_scriptVars[SPECIAL_ITEM]);
+		printDebugLine(buf, _font, ' ', specialItemX, specialItemY);
+
+		// Player coordinates
+		Common::sprintf_s(buf, "G %d,%d", playerCompact->o_xcoord, playerCompact->o_ycoord);
+		printDebugLine(buf, _font, ' ', playerCoordsX, playerCoordsY);
+
+		// Paris flag
+		Common::sprintf_s(buf, "pf %d", Logic::_scriptVars[PARIS_FLAG]);
+		printDebugLine(buf, _font, ' ', parisFlagX, parisFlagY);
+
+		// Player script level
+		Common::sprintf_s(buf, "lv %d", playerCompact->o_tree.o_script_level);
+		printDebugLine(buf, _font, ' ', scriptLevelX, scriptLevelY);
+
+		// Talk flag
+		Common::sprintf_s(buf, "tf %d", Logic::_scriptVars[TALK_FLAG]);
+		printDebugLine(buf, _font, ' ', talkFlagX, talkFlagY);
+
+		// Frames per second
+		Common::sprintf_s(buf, "%u fps", SwordEngine::_systemVars.framesPerSecondCounter);
+		printDebugLine(buf, _font, ' ', fpsX, fpsY);
+
+		// Debug game speed (based on pressing keys '1' & '4')
+		if (SwordEngine::_systemVars.slowMode) {
+			Common::sprintf_s(buf, "(slow)");
+		} else if (SwordEngine::_systemVars.fastMode) {
+			Common::sprintf_s(buf, "(fast)");
+		} else {
+			Common::sprintf_s(buf, "(norm)");
+		}
+
+		printDebugLine(buf, _font, ' ', gameSpeedX, gameSpeedY);
+
+		// Screen number
+		Common::sprintf_s(buf, "screen %d", Logic::_scriptVars[SCREEN]);
+		printDebugLine(buf, _font, ' ', screenX, screenY);
+
+		// CD in use
+		Common::sprintf_s(buf, "CD-%d", SwordEngine::_systemVars.currentCD);
+		printDebugLine(buf, _font, ' ', currentCDX, currentCDY);
+
+		// End sequence scene number
+		if (Logic::_scriptVars[END_SCENE]) {
+			Common::sprintf_s(buf, "scene %d", Logic::_scriptVars[END_SCENE]);
+			printDebugLine(buf, _font, ' ', endSceneX, endSceneY);
+		}
+
+		// Debug flags
+		if ((Logic::_scriptVars[DEBUG_FLAG_1] > 0) || (Logic::_scriptVars[DEBUG_FLAG_2] > 0) || (Logic::_scriptVars[DEBUG_FLAG_3] > 0)) {
+			Common::sprintf_s(buf, "debug flags: %d, %d, %d",
+				Logic::_scriptVars[DEBUG_FLAG_1],
+				Logic::_scriptVars[DEBUG_FLAG_2],
+				Logic::_scriptVars[DEBUG_FLAG_3]);
+			printDebugLine(buf, _font, ' ', debugFlagsX, debugFlagsY);
+		}
+	}
+
+	if (SwordEngine::_systemVars.displayDebugText) {
+		// Text line number
+		if (_logic->canShowDebugTextNumber()) {
+			Common::sprintf_s(buf, "TEXT %d", SwordEngine::_systemVars.textNumber);
+			printDebugLine(buf, _font, ' ', textNoX, textNoY);
+		}
+	}
+}
+
 } // End of namespace Sword1
diff --git a/engines/sword1/text.h b/engines/sword1/text.h
index 8711d9df991..96a4aaa3f48 100644
--- a/engines/sword1/text.h
+++ b/engines/sword1/text.h
@@ -36,6 +36,9 @@ namespace Sword1 {
 
 class ObjectMan;
 class ResMan;
+class Screen;
+class Logic;
+class SwordEngine;
 
 struct LineInfo {
 	uint16 width;  // width of line in pixels
@@ -44,22 +47,28 @@ struct LineInfo {
 
 class Text {
 public:
-	Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion);
+	Text(SwordEngine *vm, Logic *pLogic, ObjectMan *pObjMan, ResMan *pResMan, Screen *pScreen, bool czechVersion);
 	~Text();
 	FrameHeader *giveSpriteData(uint32 textTarget);
 	uint32 lowTextManager(uint8 *text, int32 width, uint8 pen);
 	void makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen);
 	void releaseText(uint32 id, bool updateCount = true);
+	void showDebugInfo();
 
 private:
 	uint16 analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *info);
 	uint16 charWidth(uint8 ch);
 	uint16 copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen);
+	void printDebugLine(uint8 *ascii, uint8 *resourceAddress, uint8 first, int x, int y);
+
 	uint8 *_font;
 	uint8 _textCount;
 	uint16 _charHeight, _joinWidth;
+	SwordEngine *_vm;
+	Logic *_logic;
 	ObjectMan *_objMan;
 	ResMan *_resMan;
+	Screen *_screen;
 	FrameHeader *_textBlocks[MAX_TEXT_OBS];
 	uint32 _fontId;
 };




More information about the Scummvm-git-logs mailing list