HOPKINS: Get rid of more useless global variables

This commit is contained in:
Filippos Karapetis 2013-01-08 13:30:33 +02:00
parent fddc6497bf
commit 7462978be5
5 changed files with 2 additions and 33 deletions

View File

@ -115,7 +115,6 @@ Globals::Globals() {
// Initialise fields
_language = LANG_EN;
_internetFl = true;
PUBEXIT = false;
_speed = 1;
@ -162,7 +161,6 @@ Globals::Globals() {
_actionDirection = 0;
SegmentEnCours = 0;
STOP_BUG = 0;
MAX_COMPTE = 0;
Credit_bx = -1;
Credit_bx1 = -1;
@ -194,9 +192,7 @@ Globals::Globals() {
_forestSprite = NULL;
COUCOU = NULL;
chemin = NULL;
cache_souris = NULL;
BufLig = NULL;
Bufferdecor = NULL;
ADR_FICHIER_OBJ = NULL;
police = NULL;
PERSO = NULL;
@ -244,8 +240,6 @@ Globals::~Globals() {
freeMemory(_inventoryObject);
freeMemory(_forestSprite);
freeMemory(COUCOU);
freeMemory(cache_souris);
freeMemory(Bufferdecor);
freeMemory(ADR_FICHIER_OBJ);
freeMemory(PERSO);
@ -276,11 +270,6 @@ void Globals::setConfig() {
warning("Unknown language in internal language mapping");
break;
}
if (_vm->getIsDemo())
_internetFl = true;
else
_internetFl = false;
// End of CHECKME
switch (_language) {
@ -316,7 +305,6 @@ void Globals::clearAll() {
INIT_VBOB();
ADR_FICHIER_OBJ = g_PTRNUL;
NUM_FICHIER_OBJ = 0;
Bufferdecor = g_PTRNUL;
_vm->_eventsManager._objectBuf = g_PTRNUL;
_vm->_dialogsManager._inventWin1 = g_PTRNUL;
_vm->_dialogsManager._inventBuf2 = g_PTRNUL;
@ -372,7 +360,6 @@ void Globals::clearAll() {
_forestSprite = g_PTRNUL;
_forestFl = false;
cache_souris = allocMemory(2500);
GESTE = g_PTRNUL;
GESTE_FLAG = 0;
}

View File

@ -329,7 +329,6 @@ public:
int _inventory[36];
SortItem _sortedDisplay[51];
Language _language;
bool _internetFl;
bool PUBEXIT;
int PERSO_TYPE;
uint _speed;
@ -363,9 +362,7 @@ public:
bool _forestFl;
byte *COUCOU;
int16 *chemin;
byte *cache_souris;
int16 *BufLig;
byte *Bufferdecor;
byte *ADR_FICHIER_OBJ;
byte *PERSO;
int _objectWidth, _objectHeight;
@ -407,7 +404,6 @@ public:
int couleur_40;
int STOP_BUG;
int MAX_COMPTE;
int force_to_data_0;
int oldzone_46;

View File

@ -462,11 +462,6 @@ bool HopkinsEngine::runLinuxDemo() {
_eventsManager.delay(1500);
_graphicsManager.fadeOutLong();
if (!_globals._internetFl) {
_graphicsManager.FADE_LINUX = 2;
_animationManager.playAnim("MP.ANM", 10, 16, 200);
}
_graphicsManager.loadImage("H2");
_graphicsManager.fadeInLong();
_eventsManager.delay(500);
@ -2505,14 +2500,6 @@ void HopkinsEngine::loadCredits() {
_globals.Credit_lignes = idxLines;
} while (!loopCond);
/* Useless
v5 = 0;
if (_globals.Credit_lignes > 0) {
do
++v5;
while (v5 < _globals.Credit_lignes);
}
*/
_globals.freeMemory(bufPtr);
}

View File

@ -5010,7 +5010,6 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
_vm->_dialogsManager._inventFl = false;
_vm->_eventsManager._gameKey = KEY_NONE;
_verb = 4;
_vm->_globals.MAX_COMPTE = 6;
_vm->_graphicsManager._scrollOffset = 0;
_vm->_dialogsManager._removeInventFl = false;
_vm->_globals.PLAN_FLAG = false;

View File

@ -2270,7 +2270,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 600:
if (!_vm->_globals._internetFl) {
if (!_vm->getIsDemo()) {
_vm->_graphicsManager.FADE_LINUX = 2;
_vm->_graphicsManager._fadeDefaultSpeed = 1;
_vm->_animationManager.playAnim("BOMBE1A.ANM", 100, 18, 100);
@ -2353,7 +2353,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 607:
if (!_vm->_globals._internetFl) {
if (!_vm->getIsDemo()) {
memcpy(_vm->_graphicsManager._oldPalette, _vm->_graphicsManager._palette, 769);
_vm->_animationManager.playAnim2("PLAN.ANM", 50, 10, 800);
}