KYRA: Some formatting fixes.

This commit is contained in:
Johannes Schickel 2012-03-05 20:02:05 +01:00
parent 865c54c125
commit 9671b44df8
7 changed files with 31 additions and 28 deletions

View File

@ -40,7 +40,8 @@ void KyraRpgEngine::removeInputTop() {
}
void KyraRpgEngine::gui_drawBox(int x, int y, int w, int h, int frameColor1, int frameColor2, int fillColor) {
w--; h--;
w--;
h--;
if (fillColor != -1)
screen()->fillRect(x + 1, y + 1, x + w - 1, y + h - 1, fillColor);
@ -128,6 +129,6 @@ bool KyraRpgEngine::clickedShape(int shapeIndex) {
return false;
}
} // End of namespace Kyra
} // End of namespace Kyra
#endif // defined(ENABLE_EOB) || defined(ENABLE_LOL)

View File

@ -217,11 +217,11 @@ void KyraRpgEngine::drawDialogueButtons() {
if (gameFlags().use16ColorMode) {
gui_drawBox(x, ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1, 74, 10, 0xee, 0xcc, -1);
screen()->printText(_dialogueButtonString[i], (x + 37 - (screen()->getTextWidth(_dialogueButtonString[i])) / 2) & ~3,
((_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2) & ~7, _dialogueHighlightedButton == i ? 0xc1 : 0xe1, 0);
((_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2) & ~7, _dialogueHighlightedButton == i ? 0xc1 : 0xe1, 0);
} else {
gui_drawBox(x, (_dialogueButtonYoffs + _dialogueButtonPosY[i]), _dialogueButtonWidth, guiSettings()->buttons.height, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
screen()->printText(_dialogueButtonString[i], x + (_dialogueButtonWidth >> 1) - (screen()->getTextWidth(_dialogueButtonString[i])) / 2,
(_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2, _dialogueHighlightedButton == i ? _dialogueButtonLabelColor1 : _dialogueButtonLabelColor2, 0);
(_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2, _dialogueHighlightedButton == i ? _dialogueButtonLabelColor1 : _dialogueButtonLabelColor2, 0);
}
}
screen()->setFont(of);
@ -255,11 +255,11 @@ uint16 KyraRpgEngine::processDialogue() {
}
if (snd_updateCharacterSpeech() != 2) {
res = 1;
if (!shouldQuit()) {
removeInputTop();
gui_notifyButtonListChanged();
}
res = 1;
if (!shouldQuit()) {
removeInputTop();
gui_notifyButtonListChanged();
}
}
} else {
int e = checkInput(0, false, 0) & 0xFF;
@ -362,6 +362,6 @@ void KyraRpgEngine::updateEnvironmentalSfx(int soundId) {
snd_processEnvironmentalSoundEffect(soundId, _currentBlock);
}
} // End of namespace Kyra
} // End of namespace Kyra
#endif // ENABLE_EOB || ENABLE_LOL

View File

@ -119,7 +119,7 @@ struct GameFlags {
bool useAltShapeHeader : 1; // alternative shape header (uses 2 bytes more, those are unused though)
bool isTalkie : 1;
bool isOldFloppy : 1;
bool useHiRes : 1;
bool useHiRes : 1;
bool use16ColorMode : 1;
bool useDigSound : 1;
bool useInstallerPackage : 1;

View File

@ -122,6 +122,6 @@ void KyraRpgEngine::releaseFlyingObjectTempData(LevelTempData *tmp) {
delete[] p;
}
} // End of namespace Kyra
} // End of namespace Kyra
#endif // ENABLE_EOB || ENABLE_LOL

View File

@ -133,7 +133,7 @@ void KyraRpgEngine::generateBlockDrawingBuffer() {
_sceneDrawVarLeft = _dscBlockMap[_currentDirection + 8];
/*******************************************
* _visibleBlocks map *
* _visibleBlocks map *
* *
* | | | | | | *
* 00 | 01 | 02 | 03 | 04 | 05 | 06 *
@ -337,7 +337,7 @@ bool KyraRpgEngine::checkSceneUpdateNeed(int block) {
}
}
if (_currentBlock == block){
if (_currentBlock == block) {
_sceneUpdateRequired = true;
return true;
}
@ -626,7 +626,7 @@ void KyraRpgEngine::completeDoorOperations() {
do {
_levelBlockProperties[b].walls[_openDoorState[i].wall] += _openDoorState[i].state;
_levelBlockProperties[b].walls[_openDoorState[i].wall ^ 2] += _openDoorState[i].state;
} while (!(_wllWallFlags[_levelBlockProperties[b].walls[_openDoorState[i].wall]] & 0x30));
} while (!(_wllWallFlags[_levelBlockProperties[b].walls[_openDoorState[i].wall]] & 0x30));
_openDoorState[i].block = 0;
}

View File

@ -147,7 +147,7 @@ void Screen_EoB::setMouseCursor(int x, int y, const byte *shape, const uint8 *ov
uint8 *cursor = new uint8[mouseW * _pageScaleFactor[6] * mouseH * _pageScaleFactor[6]];
// We use memset and copyBlockToPage instead of fillRect to make sure that the
// color key 0xFF doesn't get converted into EGA color
memset (cursor, colorKey, mouseW * _pageScaleFactor[6] * mouseH * _pageScaleFactor[6]);
memset(cursor, colorKey, mouseW * _pageScaleFactor[6] * mouseH * _pageScaleFactor[6]);
copyBlockToPage(6, 0, 0, mouseW, mouseH, cursor);
drawShape(6, shape, 0, 0, 0, 2, ovl);
CursorMan.showMouse(false);

View File

@ -46,7 +46,7 @@ TextDisplayer_rpg::TextDisplayer_rpg(KyraRpgEngine *engine, Screen *scr) : _vm(e
_textDimData = new TextDimData[_screen->screenDimTableCount()];
for (int i = 0; i < _screen->screenDimTableCount(); i++){
for (int i = 0; i < _screen->screenDimTableCount(); i++) {
const ScreenDim *d = _screen->getScreenDim(i);
_textDimData[i].color1 = d->unk8;
_textDimData[i].color2 = d->unkA;
@ -189,7 +189,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
break;
case 11:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
@ -204,27 +204,27 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
break;
case 18:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
case 23:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
case 24:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
case 26:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
case 28:
_sjisLineBreakFlag=_sjisLineBreakFlag;
_sjisLineBreakFlag = _sjisLineBreakFlag;
// TODO (UNUSED)
break;
@ -286,14 +286,16 @@ void TextDisplayer_rpg::readNextPara() {
// All necessary conversions take place somewhere else. This code actually causes issues if the character conversions
// don't take place before calling displayText(). So we disable it for now. If some (not yet supported) localized
// versions depend on this code we'll have to look at this again.
/* if ((_vm->game() != GI_LOL) && (d & 0x80)) {
#if 0
if ((_vm->game() != GI_LOL) && (d & 0x80)) {
d &= 0x7f;
c = d & 7;
d = (d & 0x78) >> 3;
uint8 l = d;
c = _table1[(l << 3) + c];
d = _table2[l];
}*/
}
#endif
_ctrl[1] = d;
_ctrl[2] = c;
@ -465,8 +467,8 @@ void TextDisplayer_rpg::printLine(char *str) {
}
void TextDisplayer_rpg::printDialogueText(int stringId, const char *pageBreakString) {
const char * str = (const char *)(_screen->getCPagePtr(5) + READ_LE_UINT16(&_screen->getCPagePtr(5)[(stringId - 1) << 1]));
assert (strlen(str) < kEoBTextBufferSize);
const char *str = (const char *)(_screen->getCPagePtr(5) + READ_LE_UINT16(&_screen->getCPagePtr(5)[(stringId - 1) << 1]));
assert(strlen(str) < kEoBTextBufferSize);
Common::strlcpy(_dialogueBuffer, str, kEoBTextBufferSize);
displayText(_dialogueBuffer);
@ -481,7 +483,7 @@ void TextDisplayer_rpg::printDialogueText(int stringId, const char *pageBreakStr
}
void TextDisplayer_rpg::printDialogueText(const char *str, bool wait) {
assert (strlen(str) < kEoBTextBufferSize);
assert(strlen(str) < kEoBTextBufferSize);
Common::strlcpy(_dialogueBuffer, str, kEoBTextBufferSize);
strcpy(_dialogueBuffer, str);