KINGDOM: Implement DrawIcon, make a check in GL1 more coherent (style wise)

This commit is contained in:
Strangerke 2017-07-04 02:08:21 +02:00 committed by Eugene Sandulenko
parent c42d08c49a
commit 557c610138
2 changed files with 17 additions and 2 deletions

View File

@ -105,7 +105,7 @@ void KingdomGame::GPLogic1() {
if (!_Wizard) {
_StatPlay = 50;
_LoopFlag = true;
return;
break;
}
}
DrawLocation();

View File

@ -1474,7 +1474,22 @@ void KingdomGame::SwitchMtoA() {
}
void KingdomGame::DrawIcon(int x, int y, int index) {
debug("STUB: DrawIcon");
const byte *data = _kingartEntries[index].data;
int width = _kingartEntries[index].Width;
int height = _kingartEntries[index].Height;
::Graphics::Surface *screen = g_system->lockScreen();
for (uint curX = 0; curX < width; curX++) {
for (uint curY = 0; curY < height; curY++) {
const byte *src = data + (curY * width) + curX;
byte *dst = (byte *)screen->getBasePtr(curX + x, curY + y);
if (*src != 0xFF)
*dst = *src;
}
}
g_system->unlockScreen();
g_system->updateScreen();
}
int KingdomGame::GetAKey() {