aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-10-04 17:40:24 +0200
committerStrangerke2013-10-04 17:40:24 +0200
commit89559e07a3b337a27798aedb1ef64f257fdfe649 (patch)
treeb5e6f6905c85868cf779ef531a3fbf21621d9c58 /engines
parent493c02ae224c0ce2f2d095e380c279ff1311a558 (diff)
downloadscummvm-rg350-89559e07a3b337a27798aedb1ef64f257fdfe649.tar.gz
scummvm-rg350-89559e07a3b337a27798aedb1ef64f257fdfe649.tar.bz2
scummvm-rg350-89559e07a3b337a27798aedb1ef64f257fdfe649.zip
AVALANCHE: Remove file variable from AvalancheEngine
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/avalanche.h4
-rw-r--r--engines/avalanche/avalot.cpp8
-rw-r--r--engines/avalanche/graphics.cpp3
-rw-r--r--engines/avalanche/graphics.h2
4 files changed, 9 insertions, 8 deletions
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 4cb78f7e25..1ef5d5014e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -317,9 +317,7 @@ private:
Common::String _roomnName; // Name of actual room
int8 _scoreToDisplay[3];
- Common::File file;
- Common::String readAlsoStringFromFile();
-
+ Common::String readAlsoStringFromFile(Common::File &file);
void runAvalot();
void init();
void setup();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 03a177402b..5b28629660 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -302,7 +302,7 @@ void AvalancheEngine::setup() {
_dialogs->reset();
dusk();
- _graphics->loadDigits(file);
+ _graphics->loadDigits();
_parser->_inputTextPos = 0;
_parser->_quote = true;
@@ -413,7 +413,7 @@ void AvalancheEngine::callVerb(VerbCode id) {
* Check is it's possible to give something to Spludwick
* @remarks Originally called 'nextstring'
*/
-Common::String AvalancheEngine::readAlsoStringFromFile() {
+Common::String AvalancheEngine::readAlsoStringFromFile(Common::File &file) {
Common::String str;
byte length = file.readByte();
for (int i = 0; i < length; i++)
@@ -448,6 +448,7 @@ void AvalancheEngine::loadAlso(byte num) {
}
Common::String filename;
filename = Common::String::format("also%d.avd", num);
+ Common::File file;
if (!file.open(filename))
error("AVALANCHE: File not found: %s", filename.c_str());
@@ -458,7 +459,7 @@ void AvalancheEngine::loadAlso(byte num) {
for (int i = 0; i <= alsoNum; i++) {
for (int j = 0; j < 2; j++) {
_also[i][j] = new Common::String;
- *_also[i][j] = readAlsoStringFromFile();
+ *_also[i][j] = readAlsoStringFromFile(file);
}
tmpStr = Common::String::format("\x9D%s\x9D", _also[i][0]->c_str());
*_also[i][0] = tmpStr;
@@ -541,6 +542,7 @@ void AvalancheEngine::loadRoom(byte num) {
_graphics->fleshColors();
Common::String filename = Common::String::format("place%d.avd", num);
+ Common::File file;
if (!file.open(filename))
error("AVALANCHE: File not found: %s", filename.c_str());
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 5e17dcda3e..b3eeed5056 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -90,10 +90,11 @@ void GraphicManager::init() {
* Load the scoring digits & rwlites
* @remarks Originally called 'load_digits'
*/
-void GraphicManager::loadDigits(Common::File &file) {
+void GraphicManager::loadDigits() {
const byte digitsize = 134;
const byte rwlitesize = 126;
+ Common::File file;
if (!file.open("digit.avd"))
error("AVALANCHE: File not found: digit.avd");
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 9930e282f5..876bcea6db 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -63,7 +63,7 @@ public:
GraphicManager(AvalancheEngine *vm);
~GraphicManager();
void init();
- void loadDigits(Common::File &file);
+ void loadDigits();
void loadMouse(byte which);
void fleshColors();