ASYLUM: minor fixes (mostly formatting)

This commit is contained in:
alxpnv 2021-04-21 13:02:12 +03:00 committed by Eugene Sandulenko
parent 380950a300
commit a6140c4944
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
8 changed files with 25 additions and 23 deletions

View File

@ -331,7 +331,7 @@ void AsylumEngine::playIntro() {
do {
// Poll events (this ensures we don't freeze the screen)
Common::Event ev;
while(_eventMan->pollEvent(ev)) {
while (_eventMan->pollEvent(ev)) {
switch (ev.type) {
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_KEYDOWN:

View File

@ -211,7 +211,7 @@ void Connector::turn(bool updpos) {
if (_nextConnector) {
if (_isConnected) {
if(!(_nextConnectorPosition & _state))
if (!(_nextConnectorPosition & _state))
disconnect(_nextConnector);
} else if (_nextConnectorPosition & _state && _nextConnector->isReadyForConnection()) {
connect(_nextConnector);

View File

@ -187,7 +187,7 @@ bool PuzzleWheel::update(const AsylumEvent &) {
// Blinking red light
getScreen()->draw(getWorld()->graphicResourceIds[12], (uint32)_frameIndexes[11], puzzleWheelPoints[12]);
_frameIndexes[11] = (_frameIndexes[11] + 1 ) % (int32)GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[12]);
_frameIndexes[11] = (_frameIndexes[11] + 1) % (int32)GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[12]);
// Clock
if (_showTurnedClock)

View File

@ -924,7 +924,7 @@ bool Encounter::drawPortraits() {
}
// Portrait 1
if (_portrait1.transTableNum == 3 )
if (_portrait1.transTableNum == 3)
getScreen()->draw(_portrait1.resourceId,
_portrait1.frameIndex,
_point + Common::Point(5, 5));

View File

@ -1395,7 +1395,9 @@ IMPLEMENT_OPCODE(PlaySpeechScene2)
cmd->param7 = 1;
return;
}
} if (!cmd->param7) {
}
if (!cmd->param7) {
_vm->clearGameFlag(kGameFlag219);
cmd->param7 = 1;
return;
@ -1639,7 +1641,7 @@ IMPLEMENT_OPCODE(JumpObjectFrame)
cmd->param2 = object->getFrameCount() - 1;
if (cmd->param3) {
if(object->getFrameIndex() == (uint32)cmd->param2)
if (object->getFrameIndex() == (uint32)cmd->param2)
return;
} else if (cmd->param4) {
if (object->getFrameIndex() < (uint32)cmd->param2)

View File

@ -306,9 +306,9 @@ void Screen::setupPalette(byte *buffer, int start, int count) {
palette += start;
for (int32 i = 0; i < count; i++) {
palette[0] = (byte )(buffer[0] * 4);
palette[1] = (byte )(buffer[1] * 4);
palette[2] = (byte )(buffer[2] * 4);
palette[0] = (byte)(buffer[0] * 4);
palette[1] = (byte)(buffer[1] * 4);
palette[2] = (byte)(buffer[2] * 4);
buffer += 3;
palette += 3;
@ -713,7 +713,7 @@ void Screen::clearGraphicsInQueue() {
void Screen::graphicsSelectionSort() {
uint32 maxIdx;
for (uint32 i = 0; i < _queueItems.size(); i++) {
for (uint32 i = 0; i < _queueItems.size() - 1; i++) {
maxIdx = i;
for (uint32 j = i + 1; j < _queueItems.size(); j++)
@ -1215,7 +1215,7 @@ void Screen::copyToBackBufferWithTransparency(byte *buffer, int32 pitch, int16 x
for (int32 curX = left; curX < right; curX++) {
uint32 offset = (uint32)((mirrored ? right - (curX + 1) : curX) + curY * pitch);
if (buffer[offset] != 0 )
if (buffer[offset] != 0)
dest[x + curX + (y + curY) * 640] = buffer[offset];
}
}

View File

@ -1127,7 +1127,7 @@ void Menu::updateViewMovies() {
if (index >= ARRAYSIZE(_movieList))
break;
if (_movieList[index] != -1 ) {
if (_movieList[index] != -1) {
sprintf((char *)&text, "%d. %s ", index + 1, getText()->get(MAKE_RESOURCE(kResourcePackText, 1359 + _movieList[index])));
sprintf((char *)&text2, getText()->get(MAKE_RESOURCE(kResourcePackText, 1356)), moviesCd[_movieList[index]]);
strcat((char *)&text, (char *)&text2);
@ -1152,7 +1152,7 @@ void Menu::updateViewMovies() {
if (index >= ARRAYSIZE(_movieList))
break;
if (_movieList[index] != -1 ) {
if (_movieList[index] != -1) {
sprintf((char *)&text, "%d. %s ", index + 1, getText()->get(MAKE_RESOURCE(kResourcePackText, 1359 + _movieList[index])));
sprintf((char *)&text2, getText()->get(MAKE_RESOURCE(kResourcePackText, 1356)), moviesCd[_movieList[index]]);
strcat((char *)&text, (char *)&text2);

View File

@ -664,23 +664,23 @@ bool Scene::updateScreen() {
bool Scene::updateScene() {
#ifdef DEBUG_SCENE_TIMES
#define MESURE_TICKS(func) { \
#define MEASURE_TICKS(func) { \
int32 startTick =_vm->getTick(); \
func(); \
debugC(kDebugLevelScene, "[Scene] " #func " - Time: %d", _vm->getTick() - startTick); \
}
#else
#define MESURE_TICKS(func) func();
#define MEASURE_TICKS(func) func();
#endif
// Update each part of the scene
if (getSharedData()->getMatteBarHeight() != 170 || getSharedData()->getMattePlaySound()) {
MESURE_TICKS(updateMouse);
MESURE_TICKS(updateActors);
MESURE_TICKS(updateObjects);
MESURE_TICKS(updateAmbientSounds);
MESURE_TICKS(updateMusic);
MESURE_TICKS(updateAdjustScreen);
MEASURE_TICKS(updateMouse);
MEASURE_TICKS(updateActors);
MEASURE_TICKS(updateObjects);
MEASURE_TICKS(updateAmbientSounds);
MEASURE_TICKS(updateMusic);
MEASURE_TICKS(updateAdjustScreen);
}
return getScript()->process();
@ -801,7 +801,7 @@ void Scene::updateMouse() {
newDirection = kDirectionE;
}
}
} else if ( player->getDirection() == kDirectionS) {
} else if (player->getDirection() == kDirectionS) {
if ((mouse.x - actorRect.right) > 10)
newDirection = kDirectionSE;
} else if ((player->getDirection() != kDirectionE || (mouse.y - actorRect.bottom) > 10)) {
@ -1343,7 +1343,7 @@ int32 Scene::hitTestActionArea() {
int32 targetIdx = findActionArea(kActionAreaType2, Common::Point(_ws->xLeft + pt.x, _ws->yTop + pt.y));
if ( targetIdx == -1 || !(_ws->actions[targetIdx]->actionType & (kActionTypeFind | kActionTypeTalk | kActionTypeGrab | kActionType16)))
if (targetIdx == -1 || !(_ws->actions[targetIdx]->actionType & (kActionTypeFind | kActionTypeTalk | kActionTypeGrab | kActionType16)))
return -1;
return targetIdx;