Skip to content

Commit

Permalink
HOPKINS: Get rid of the NO_VISU global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Jan 8, 2013
1 parent 7462978 commit 2b1b668
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 31 deletions.
1 change: 0 additions & 1 deletion engines/hopkins/globals.cpp
Expand Up @@ -203,7 +203,6 @@ Globals::Globals() {
GESTE_FLAG = 0;
_disableInventFl = false;
NOMARCHE = false;
NO_VISU = false;
_optionDialogFl = false;
_cacheFl = false;
NOPARLE = false;
Expand Down
1 change: 0 additions & 1 deletion engines/hopkins/globals.h
Expand Up @@ -381,7 +381,6 @@ class Globals {
bool _disableInventFl;
bool NOMARCHE;
int NBBLOC;
bool NO_VISU;
byte *OPTION_SPR;
bool _optionDialogFl;
int _menuDisplayType;
Expand Down
8 changes: 4 additions & 4 deletions engines/hopkins/graphics.cpp
Expand Up @@ -1177,7 +1177,7 @@ void GraphicsManager::displayVesaSegment() {
unlockScreen();
}

void GraphicsManager::AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx) {
void GraphicsManager::AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx, bool addSegment) {
int height, width;

width = _vm->_objectsManager.getWidth(objectData, idx);
Expand All @@ -1189,7 +1189,7 @@ void GraphicsManager::AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, i
Sprite_Vesa(_vesaBuffer, objectData, xp + 300, yp + 300, idx);
Sprite_Vesa(_vesaScreen, objectData, xp + 300, yp + 300, idx);
}
if (!_vm->_globals.NO_VISU)
if (addSegment)
addVesaSegment(xp, yp, xp + width, yp + height);
}

Expand Down Expand Up @@ -1625,7 +1625,7 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
/**
* Fast Display
*/
void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex) {
void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment) {
int width = _vm->_objectsManager.getWidth(spriteData, spriteIndex);
int height = _vm->_objectsManager.getHeight(spriteData, spriteIndex);

Expand All @@ -1636,7 +1636,7 @@ void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int sp
Sprite_Vesa(_vesaBuffer, spriteData, xp + 300, yp + 300, spriteIndex);
Sprite_Vesa(_vesaScreen, spriteData, xp + 300, yp + 300, spriteIndex);
}
if (!_vm->_globals.NO_VISU)
if (addSegment)
addVesaSegment(xp, yp, xp + width, yp + height);
}

Expand Down
4 changes: 2 additions & 2 deletions engines/hopkins/graphics.h
Expand Up @@ -152,14 +152,14 @@ class GraphicsManager {
void RESET_SEGMENT_VESA();
void addVesaSegment(int x1, int y1, int x2, int y2);
void displayVesaSegment();
void AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx);
void AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx, bool addSegment = true);
void CopyAsm(const byte *surface);
void copy16bFromSurfaceScaleX2(const byte *surface);
void Restore_Mem(byte *destSurface, const byte *src, int xp, int yp, int width, int height);
int zoomIn(int v, int percentage);
int zoomOut(int v, int percentage);
void Affiche_Perfect(byte *surface, const byte *srcData, int xp300, int yp300, int frameIndex, int zoom1, int zoom2, int modeFlag);
void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex);
void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment = true);
void SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY);
void Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned int width, int height, byte *destSurface, int destX, int destY);
void displayFont(byte *surface, const byte *spriteData, int xp, int yp, int characterIndex, int colour);
Expand Down
30 changes: 7 additions & 23 deletions engines/hopkins/script.cpp
Expand Up @@ -1759,7 +1759,6 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;

case 203:
_vm->_globals.NO_VISU = true;
_vm->_objectsManager.removeSprite(0);
_vm->_objectsManager.setBobAnimation(4);
do {
Expand All @@ -1768,10 +1767,9 @@ int ScriptManager::handleOpcode(byte *dataP) {

_vm->_eventsManager.VBL();
if (_vm->_objectsManager.BOBPOSI(4) == 18)
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 18, 334, 0);
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 18, 334, 0, false);
} while (_vm->_objectsManager.BOBPOSI(4) != 26);
_vm->_objectsManager.stopBobAnimation(4);
_vm->_globals.NO_VISU = false;
_vm->_objectsManager.SPRITE_ON(0);
break;

Expand Down Expand Up @@ -1865,7 +1863,6 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(1) != 9);
_vm->_objectsManager.stopBobAnimation(1);
_vm->_globals.NO_VISU = true;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
_vm->_globals.NOT_VERIF = true;
int v39 = _vm->_objectsManager.getSpriteY(0);
Expand Down Expand Up @@ -1918,7 +1915,6 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager.removeSprite(0);
_vm->_globals.CACHE_OFF();
_vm->_animationManager.NO_SEQ = true;
_vm->_globals.NO_VISU = false;
_vm->_soundManager.SPECIAL_SOUND = 211;
_vm->_animationManager.playSequence("SECRET2.SEQ", 1, 12, 100);
_vm->_soundManager.SPECIAL_SOUND = 0;
Expand Down Expand Up @@ -2285,23 +2281,17 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;

case 601:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(2, 0, 16, 4);
break;

case 602:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(4, 0, 16, 4);
break;

case 603:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(3, 0, 16, 4);
_vm->_soundManager.SPECIAL_SOUND = 199;
_vm->_graphicsManager.FADE_LINUX = 2;
Expand All @@ -2313,9 +2303,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;

case 604:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(1, 0, 16, 4);
_vm->_soundManager.SPECIAL_SOUND = 199;
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
Expand All @@ -2326,9 +2314,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;

case 605:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(5, 0, 16, 4);
_vm->_graphicsManager.fadeOutShort();
_vm->_soundManager.SPECIAL_SOUND = 199;
Expand All @@ -2341,9 +2327,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;

case 606:
_vm->_globals.NO_VISU = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 163, 7, false);
_vm->_objectsManager.OPTI_ONE(6, 0, 16, 4);
if ((_vm->getPlatform() != Common::kPlatformWindows) || !_vm->getIsDemo()) {
_vm->_animationManager.playAnim("BOMBE3A.ANM", 50, 14, 500);
Expand Down

0 comments on commit 2b1b668

Please sign in to comment.