Skip to content

Commit

Permalink
HOPKINS: Janitorial - Remove trailing space and double semi columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Dec 14, 2012
1 parent fb5d173 commit 9502531
Show file tree
Hide file tree
Showing 22 changed files with 1,170 additions and 1,152 deletions.
118 changes: 59 additions & 59 deletions engines/hopkins/anim.cpp
Expand Up @@ -48,8 +48,8 @@ AnimationManager::AnimationManager() {
*/
void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3) {
bool breakFlag;
bool hasScreenCopy;
byte *screenCopy = NULL;
bool hasScreenCopy;
byte *screenCopy = NULL;
byte *screenP = NULL;
int frameNumber;
byte *ptr = NULL;
Expand Down Expand Up @@ -193,7 +193,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
nbytes = f.readUint32LE();
f.skip(14);
f.read(screenP, nbytes);

memcpy(screenCopy, screenP, 0x4B000u);

breakFlag = false;
Expand All @@ -204,7 +204,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
breakFlag = true;
if (strncmp((char *)ptr, "IMAGE=", 6))
breakFlag = true;

if (!breakFlag) {
f.read(screenP, READ_LE_UINT32(ptr + 8));
if (*screenP != kByteStop)
Expand All @@ -219,7 +219,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
_vm->_graphicsManager.FADE_OUTW_LINUX(screenCopy);
screenCopy = _vm->_globals.freeMemory(screenCopy);
}

_vm->_graphicsManager.FADE_LINUX = 0;
f.close();
ptr = _vm->_globals.freeMemory(ptr);
Expand All @@ -230,15 +230,15 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
* Play Animation, type 2
*/
void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4) {
int v5;
int v8;
byte *ptr;
int v11;
byte *v12;
byte *v13;
int v15;
size_t nbytes;
byte buf[6];
int v5;
int v8;
byte *ptr;
int v11;
byte *v12;
byte *v13;
int v15;
size_t nbytes;
byte buf[6];
Common::File f;

if (_vm->shouldQuit())
Expand Down Expand Up @@ -268,15 +268,15 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
f.read(_vm->_graphicsManager.Palette, 0x320u);
f.read(&buf, 4);
nbytes = f.readUint32LE();
f.readUint32LE();
f.readUint32LE();
f.readUint16LE();
f.readUint16LE();
f.readUint16LE();
f.readUint16LE();
f.readUint16LE();

f.read(v12, nbytes);

_vm->_graphicsManager.Cls_Pal();
v11 = _vm->_graphicsManager.SCROLL;
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH);
Expand Down Expand Up @@ -392,7 +392,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
_vm->_soundManager.playAnim_SOUND(v15);
memset(&buf, 0, 6u);
memset(v13, 0, 0x13u);

if (f.read(v13, 0x10) != 0x10)
v5 = -1;

Expand Down Expand Up @@ -554,9 +554,9 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
f.close();

if (_vm->_graphicsManager.FADE_LINUX == 2 && !v8) {
byte *ptra;
byte *ptra;
ptra = _vm->_globals.allocMemory(0x4B000u);

f.seek(0);
f.read(&buf, 6);
f.read(_vm->_graphicsManager.Palette, 0x320u);
Expand Down Expand Up @@ -669,11 +669,11 @@ void AnimationManager::loadAnim(const Common::String &animName) {

Common::String filename = animName + ".ANI";
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);

Common::File f;
if (!f.open(_vm->_globals.NFICHIER))
error("Failed to open %s", _vm->_globals.NFICHIER.c_str());

int filesize = f.size();
int nbytes = filesize - 115;
f.read(header, 10);
Expand All @@ -694,7 +694,7 @@ void AnimationManager::loadAnim(const Common::String &animName) {
for (int idx = 1; idx <= 6; ++idx) {
if (files[idx - 1][0]) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, files[idx - 1]);

if (!f.exists(_vm->_globals.NFICHIER))
error("File not found");
if (loadSpriteBank(idx, files[idx - 1]))
Expand Down Expand Up @@ -736,9 +736,9 @@ void AnimationManager::clearAnim() {
*/
int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
byte *v3;
byte *v4;
byte *v4;
byte *v13;
byte *ptr;
byte *ptr;
byte *v19;
int result = 0;
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);
Expand All @@ -755,14 +755,14 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
_vm->_globals.Bank[idx].fileHeader = 1;
if (*(v3 + 1) == 'O' && *(v3 + 2) == 'R')
_vm->_globals.Bank[idx].fileHeader = 2;

if (_vm->_globals.Bank[idx].fileHeader) {
_vm->_globals.Bank[idx].data = v3;

bool loopCond = false;
int v8 = 0;
int width;
int height;
int width;
int height;
do {
ptr = v4;
width = _vm->_objectsManager.getWidth(v4, v8);
Expand All @@ -775,24 +775,24 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
if (v8 > 249)
loopCond = true;
} while (!loopCond);

if (v8 <= 249) {
_vm->_globals.Bank[idx].field1A = v8;

Common::String ofsFilename = _vm->_globals.Bank[idx].filename1;
char ch;
do {
ch = ofsFilename.lastChar();
ofsFilename.deleteLastChar();
} while (ch != '.');
ofsFilename += ".OFS";

_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, ofsFilename);
Common::File f;
if (f.exists(_vm->_globals.NFICHIER)) {
v19 = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER);
v13 = v19;

if (_vm->_globals.Bank[idx].field1A > 0) {
for (int objIdx = 0; objIdx < _vm->_globals.Bank[idx].field1A; ++objIdx) {
int x1 = (int16)READ_LE_UINT16(v13);
Expand All @@ -806,10 +806,10 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
_vm->_objectsManager.set_offsetxy(_vm->_globals.Bank[idx].data, objIdx, x2, y2, 1);
}
}

_vm->_globals.freeMemory(v19);
}

result = 0;
} else {
_vm->_globals.freeMemory(ptr);
Expand All @@ -825,28 +825,28 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
return result;
}

/**
/**
* Search Animation
*/
void AnimationManager::searchAnim(const byte *data, int animIndex, int count) {
int v3;
const byte *v5;
int v6;
int v7;
const byte *v5;
int v6;
int v7;
int v8;
byte *v9;
byte *v9;
int v10;
int v11;
int v12;
int v13;
int v15;
int v16;
int v17;
int v19;
int v13;
int v15;
int v16;
int v17;
int v19;
int v20;
int v21;
int v21;
int v22;
const byte *v23;
const byte *v23;
int v;

v21 = 0;
Expand Down Expand Up @@ -925,13 +925,13 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int count) {
* Play sequence
*/
void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) {
bool readError;
int v7;
byte *ptr = NULL;
byte *v9;
byte *v10;
bool readError;
int v7;
byte *ptr = NULL;
byte *v9;
byte *v10;
int soundNumber;
size_t nbytes;
size_t nbytes;
Common::File f;

if (_vm->shouldQuit())
Expand Down Expand Up @@ -1106,13 +1106,13 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
* Play Sequence type 2
*/
void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) {
bool v4;
int v7;
byte *ptr = NULL;
byte *v10;
byte *v11 = NULL;
int v13;
size_t nbytes;
bool v4;
int v7;
byte *ptr = NULL;
byte *v10;
byte *v11 = NULL;
int v13;
size_t nbytes;
Common::File f;

v7 = 0;
Expand Down Expand Up @@ -1258,7 +1258,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
LABEL_54:
if (_vm->_graphicsManager.FADE_LINUX == 2 && !v7) {
byte *ptra = _vm->_globals.allocMemory(0x4B000u);

f.seek(0);
f.skip(6);
f.read(_vm->_graphicsManager.Palette, 0x320u);
Expand Down

0 comments on commit 9502531

Please sign in to comment.