Skip to content

Commit

Permalink
LILLIPUT: Remove double implementation of getMapPtr
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and sev- committed Mar 28, 2018
1 parent 566954c commit b870535
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
19 changes: 7 additions & 12 deletions engines/lilliput/script.cpp
Expand Up @@ -929,12 +929,6 @@ byte LilliputScript::OC_sub173F0() {
return 0;
}

byte* LilliputScript::sub17399(int val) {
int x = (val >> 8);
int y = (val & 0xFF);
return &_vm->_bufferIsoMap[(y * 320 + x) << 2];
}

byte LilliputScript::OC_sub1740A() {
debugC(1, kDebugScript, "OC_sub1740A()");

Expand All @@ -944,7 +938,7 @@ byte LilliputScript::OC_sub1740A() {
return 0;
}

byte *isoMapBuf = sub17399(var);
byte *isoMapBuf = getMapPtr(var);
int var2 = isoMapBuf[3];

int var3 = _currScript->readUint16LE();
Expand Down Expand Up @@ -1252,11 +1246,12 @@ byte LilliputScript::OC_sub17782() {
return 0;
}

byte *LilliputScript::getMapPtr(int var1) {
debugC(1, kDebugScript, "getMapPtr(%d)", var1);

int index = (((var1 & 0xFF) << 6) + (var1 >> 8)) << 2;
return &_vm->_bufferIsoMap[index];
byte *LilliputScript::getMapPtr(int val) {
debugC(1, kDebugScript, "getMapPtr(%d)", val);

int x = (val >> 8);
int y = (val & 0xFF);
return &_vm->_bufferIsoMap[(y * 320 + x) << 2];
}

byte LilliputScript::OC_sub1779E() {
Expand Down
3 changes: 1 addition & 2 deletions engines/lilliput/script.h
Expand Up @@ -106,8 +106,7 @@ class LilliputScript {
void sub18A56(byte *buf);
void sub18B3C(int var);
void sub18BE6(byte var1, int var2, int var4);
byte* sub17399(int val);
byte *getMapPtr(int var1);
byte *getMapPtr(int val);

int getValue1();
int getValue2();
Expand Down

0 comments on commit b870535

Please sign in to comment.