Skip to content

Commit

Permalink
HOPKINS: More renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Dec 19, 2012
1 parent c1aafc9 commit 076546d
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 244 deletions.
12 changes: 6 additions & 6 deletions engines/hopkins/anim.cpp
Expand Up @@ -236,11 +236,11 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint

_vm->_fileManager.constructLinuxFilename("TEMP.SCR");

if (_vm->_graphicsManager.nbrligne == SCREEN_WIDTH)
if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH)
_vm->_saveLoadManager.SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 0x4B000u);
else if (_vm->_graphicsManager.nbrligne == 1280)
else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2))
_vm->_saveLoadManager.SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 0x96000u);
if (!_vm->_graphicsManager.nbrligne)
if (!_vm->_graphicsManager._lineNbr)
_vm->_graphicsManager.ofscroll = 0;

v12 = _vm->_graphicsManager._vesaScreen;
Expand Down Expand Up @@ -827,11 +827,11 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
_vm->_eventsManager.VBL();

_vm->_fileManager.constructLinuxFilename("TEMP.SCR");
if (_vm->_graphicsManager.nbrligne == SCREEN_WIDTH)
if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH)
_vm->_saveLoadManager.SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 0x4B000u);
else if (_vm->_graphicsManager.nbrligne == (SCREEN_WIDTH * 2))
else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2))
_vm->_saveLoadManager.SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 0x96000u);
if (!_vm->_graphicsManager.nbrligne)
if (!_vm->_graphicsManager._lineNbr)
_vm->_graphicsManager.ofscroll = 0;
}
v9 = _vm->_graphicsManager._vesaScreen;
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/computer.cpp
Expand Up @@ -76,7 +76,7 @@ void ComputerManager::setTextMode() {
_vm->_graphicsManager.unlockScreen();
//SET_MODE(SCREEN_WIDTH, SCREEN_HEIGHT);

_vm->_graphicsManager.nbrligne = SCREEN_WIDTH;
_vm->_graphicsManager._lineNbr = SCREEN_WIDTH;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "STFONT.SPR");
_vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police);
_vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER);
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/dialogs.cpp
Expand Up @@ -361,7 +361,7 @@ void DialogsManager::showInventory() {
if (v6 && v4 <= 29) {
byte *v7 = _vm->_objectsManager.CAPTURE_OBJET(v6, 0);
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager._vesaBuffer, v7, v19 + v16 + 6,
v15 + 120, _vm->_globals.OBJL, _vm->_globals.OBJH);
v15 + 120, _vm->_globals._objectWidth, _vm->_globals._objectHeight);
_vm->_globals.freeMemory(v7);
}
v16 += 54;
Expand Down
30 changes: 15 additions & 15 deletions engines/hopkins/events.cpp
Expand Up @@ -341,8 +341,8 @@ void EventsManager::VBL() {
v14 = _mouseSizeX;
v13 = _mouseSizeY;
if (_mouseCursorId == 23) {
v14 = _vm->_globals.OBJL;
v13 = _vm->_globals.OBJH;
v14 = _vm->_globals._objectWidth;
v13 = _vm->_globals._objectHeight;
goto LABEL_35;
}
if (_breakoutFl) {
Expand Down Expand Up @@ -473,14 +473,14 @@ void EventsManager::updateCursor() {
Common::Rect clipBounds(_vm->_graphicsManager.min_x, _vm->_graphicsManager.min_y,
_vm->_graphicsManager.max_x, _vm->_graphicsManager.max_y);
_vm->_graphicsManager.min_x = _vm->_graphicsManager.min_y = 0;
_vm->_graphicsManager.max_x = _vm->_globals.OBJL;
_vm->_graphicsManager.max_y = _vm->_globals.OBJH;
int pitch = _vm->_graphicsManager.nbrligne2;
_vm->_graphicsManager.nbrligne2 = _vm->_globals.OBJL;
_vm->_graphicsManager.max_x = _vm->_globals._objectWidth;
_vm->_graphicsManager.max_y = _vm->_globals._objectHeight;
int pitch = _vm->_graphicsManager._lineNbr2;
_vm->_graphicsManager._lineNbr2 = _vm->_globals._objectWidth;

// Create the temporary cursor surface
byte *cursorSurface = new byte[_vm->_globals.OBJH * _vm->_globals.OBJL];
Common::fill(cursorSurface, cursorSurface + _vm->_globals.OBJH * _vm->_globals.OBJL, 0);
byte *cursorSurface = new byte[_vm->_globals._objectHeight * _vm->_globals._objectWidth];
Common::fill(cursorSurface, cursorSurface + _vm->_globals._objectHeight * _vm->_globals._objectWidth, 0);

if (_mouseCursorId != 23) {
// Draw standard cursor
Expand All @@ -495,31 +495,31 @@ void EventsManager::updateCursor() {
_vm->_graphicsManager.min_y = clipBounds.top;
_vm->_graphicsManager.max_x = clipBounds.right;
_vm->_graphicsManager.max_y = clipBounds.bottom;
_vm->_graphicsManager.nbrligne2 = pitch;
_vm->_graphicsManager._lineNbr2 = pitch;

// Convert the cursor to the pixel format. At the moment, it's hardcoded
// to expect the game to be in 16-bit mode
uint16 *cursorPixels = new uint16[_vm->_globals.OBJH * _vm->_globals.OBJL];
uint16 *cursorPixels = new uint16[_vm->_globals._objectHeight * _vm->_globals._objectWidth];
const byte *srcP = cursorSurface;
uint16 *destP = cursorPixels;

for (int yp = 0; yp < _vm->_globals.OBJH; ++yp) {
for (int yp = 0; yp < _vm->_globals._objectHeight; ++yp) {
const byte *lineSrcP = srcP;
uint16 *lineDestP = destP;

for (int xp = 0; xp < _vm->_globals.OBJL; ++xp)
for (int xp = 0; xp < _vm->_globals._objectWidth; ++xp)
*lineDestP++ = *(uint16 *)&_vm->_graphicsManager.PAL_PIXELS[*lineSrcP++ * 2];

srcP += _vm->_globals.OBJL;
destP += _vm->_globals.OBJL;
srcP += _vm->_globals._objectWidth;
destP += _vm->_globals._objectWidth;
}

// Calculate the X offset within the pointer image to the actual cursor data
int xOffset = !_mouseLinuxFl ? 10 : 20;

// Set the ScummVM cursor from the surface
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();
CursorMan.replaceCursor(cursorPixels, _vm->_globals.OBJL, _vm->_globals.OBJH,
CursorMan.replaceCursor(cursorPixels, _vm->_globals._objectWidth, _vm->_globals._objectHeight,
xOffset, 0, *((uint16 *)cursorPixels), true, &pixelFormat);

// Delete the cursor surface
Expand Down
10 changes: 5 additions & 5 deletions engines/hopkins/files.cpp
Expand Up @@ -251,8 +251,8 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
if (name == filename) {
// Found entry for file, so get it's details from the catalogue entry
const byte *pData = ptr + offsetVal;
_vm->_globals.CAT_POSI = READ_LE_UINT32(pData + 15);
_vm->_globals.CAT_TAILLE = READ_LE_UINT32(pData + 19);
_vm->_globals._catalogPos = READ_LE_UINT32(pData + 15);
_vm->_globals._catalogSize = READ_LE_UINT32(pData + 19);
matchFlag = true;
}

Expand All @@ -271,13 +271,13 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
if (!f.open(_vm->_globals.NFICHIER))
error("CHARGE_FICHIER");

f.seek(_vm->_globals.CAT_POSI);
f.seek(_vm->_globals._catalogPos);

byte *catData = _vm->_globals.allocMemory(_vm->_globals.CAT_TAILLE);
byte *catData = _vm->_globals.allocMemory(_vm->_globals._catalogSize);
if (catData == g_PTRNUL)
error("CHARGE_FICHIER");

readStream(f, catData, _vm->_globals.CAT_TAILLE);
readStream(f, catData, _vm->_globals._catalogSize);
f.close();
result = catData;
} else {
Expand Down
6 changes: 3 additions & 3 deletions engines/hopkins/globals.cpp
Expand Up @@ -138,10 +138,10 @@ Globals::Globals() {
largeur_boite = 0;
hauteur_boite = 0;
FORET = false;
OBJL = OBJH = 0;
_objectWidth = _objectHeight = 0;
HELICO = 0;
CAT_POSI = 0;
CAT_TAILLE = 0;
_catalogPos = 0;
_catalogSize = 0;
_newObjectFl = false;
iRegul = 0;
SORTIE = 0;
Expand Down
7 changes: 3 additions & 4 deletions engines/hopkins/globals.h
Expand Up @@ -400,12 +400,11 @@ class Globals {
byte *Bufferdecor;
byte *ADR_FICHIER_OBJ;
byte *PERSO;
int OBJL, OBJH;
int _objectWidth, _objectHeight;
bool _newObjectFl;
int HELICO;
uint32 CAT_POSI;
uint32 CAT_TAILLE;
bool CAT_FLAG;
uint32 _catalogPos;
uint32 _catalogSize;
int iRegul;
bool BPP_NOAFF;
int SORTIE;
Expand Down

0 comments on commit 076546d

Please sign in to comment.