Skip to content

Commit

Permalink
BLADERUNNER: JANITORIAL: Code formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniou79 committed Jun 28, 2019
1 parent bd75898 commit a81e3ad
Show file tree
Hide file tree
Showing 42 changed files with 70 additions and 70 deletions.
8 changes: 4 additions & 4 deletions engines/bladerunner/bladerunner.cpp
Expand Up @@ -344,12 +344,12 @@ Common::Error BladeRunnerEngine::run() {
// when loading from ScummVM main menu, we should emulate
// the Kia pause/resume in order to get a valid "current" time when the game
// is actually loaded (assuming delays can be introduced by a popup warning dialogue)
if(!_time->isLocked()) {
if (!_time->isLocked()) {
_time->pause();
}
loadGameState(ConfMan.getInt("save_slot"));
ConfMan.set("save_slot", "-1");
if(_time->isLocked()) {
if (_time->isLocked()) {
_time->resume();
}
} else if (hasSavegames) {
Expand Down Expand Up @@ -1925,7 +1925,7 @@ void BladeRunnerEngine::playerDied() {
bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, Graphics::Surface &thumbnail) {
if ( !_gameIsAutoSaving
&& ( !playerHasControl() || _sceneScript->isInsideScript() || _aiScripts->isInsideScript())
){
) {
return false;
}

Expand Down Expand Up @@ -2037,7 +2037,7 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) {

if ((_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && !_cutContent)
|| (!_gameFlags->query(kFlagGamePlayedInRestoredContentMode) && _cutContent)
){
) {
Common::String warningMsg;
if (!_cutContent) {
warningMsg = _("WARNING: This game was saved in Restored Cut Content mode, but you are playing in Original Content mode. The mode will be adjusted to Restored Cut Content for this session until you completely Quit the game.");
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/chapters.cpp
Expand Up @@ -43,7 +43,7 @@ bool Chapters::enterChapter(int chapter) {
for (int chi = 1; chi < 4; ++chi) {
if (!_vm->isArchiveOpen(Common::String::format("%d.TLK", chi))
&& !_vm->openArchive(Common::String::format("%d.TLK", chi))
){
) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/combat.cpp
Expand Up @@ -61,7 +61,7 @@ void Combat::reset() {
}

void Combat::activate() {
if(_enabled) {
if (_enabled) {
_vm->_playerActor->combatModeOn(-1, true, -1, -1, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, _vm->_combat->_ammoDamage[_vm->_settings->getAmmoType()], 0, false);
_active = true;
}
Expand Down
18 changes: 9 additions & 9 deletions engines/bladerunner/debugger.cpp
Expand Up @@ -140,7 +140,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
}

Debugger::~Debugger() {
if(!_specificDrawnObjectsList.empty()) {
if (!_specificDrawnObjectsList.empty()) {
_specificDrawnObjectsList.clear();
}
}
Expand Down Expand Up @@ -379,7 +379,7 @@ bool Debugger::cmdDraw(int argc, const char **argv) {
debugPrintf("Drawing Z buffer = %s\n", _viewZBuffer? "true" : "false");
} else if (arg == "reset") {

if(!_specificDrawnObjectsList.empty()) {
if (!_specificDrawnObjectsList.empty()) {
_specificDrawnObjectsList.clear();
}

Expand Down Expand Up @@ -1203,7 +1203,7 @@ bool Debugger::cmdOverlay(int argc, const char **argv) {
if ( (overlaysList[itemIter].resourceId == chapterIdOverlaysAvailableInt)
|| ( modeMixOverlaysAvailableFlg && overlaysList[itemIter].resourceId == 6)
) {
if (strcmp(overlaysList[itemIter].name, overlayName.c_str()) == 0){
if (strcmp(overlaysList[itemIter].name, overlayName.c_str()) == 0) {
break;
}
}
Expand All @@ -1218,7 +1218,7 @@ bool Debugger::cmdOverlay(int argc, const char **argv) {
// Attempt to load the overlay in an empty slot
// even if it's not already loaded for the scene (in _vm->_overlays->_videos)
int overlayVideoIdx = _vm->_overlays->play(overlayName, overlayAnimationId, loopForever, startNowFlag, 0);
if( overlayVideoIdx == -1 ) {
if ( overlayVideoIdx == -1 ) {
debugPrintf("Could not load the overlay animation: %s in this scene. Try reseting overlays first to free up slots!\n", overlayName.c_str());
} else {
debugPrintf("Loading overlay animation: %s...\n", overlayName.c_str());
Expand Down Expand Up @@ -1464,7 +1464,7 @@ bool Debugger::cmdObject(int argc, const char **argv) {
Vector3 positionBottomRight(atof(argv[3]), atof(argv[4]), atof(argv[5]));
Vector3 positionTopLeft(atof(argv[6]), atof(argv[7]), atof(argv[8]));
_vm->_scene->_set->_objects[objectId].bbox.setXYZ(positionBottomRight.x, positionBottomRight.y, positionBottomRight.z, positionTopLeft.x, positionTopLeft.y, positionTopLeft.z);
if (!_vm->_sceneIsLoading && _vm->_sceneObjects->remove(objectId + kSceneObjectOffsetObjects)){
if (!_vm->_sceneIsLoading && _vm->_sceneObjects->remove(objectId + kSceneObjectOffsetObjects)) {
_vm->_sceneObjects->addObject(objectId + kSceneObjectOffsetObjects,
_vm->_scene->_set->_objects[objectId].bbox,
_vm->_scene->_set->_objects[objectId].isClickable,
Expand Down Expand Up @@ -1676,7 +1676,7 @@ bool Debugger::cmdRegion(int argc, const char **argv) {
debugPrintf("A region id has to be an integer within [0, 9]\n");
return true;
}
if (modeName == "add" && ((regionTypeName == "reg" && argc == 8) || (regionTypeName == "exit" && argc == 9)) ){
if (modeName == "add" && ((regionTypeName == "reg" && argc == 8) || (regionTypeName == "exit" && argc == 9)) ) {
// add region mode
if (!regions->_regions[regionID].present) {
int type = 0;
Expand Down Expand Up @@ -2061,7 +2061,7 @@ bool Debugger::cmdList(int argc, const char **argv) {
int count = 0;
for (int i = 0; i < _vm->_waypoints->_count; i++) {
Waypoints::Waypoint *waypoint = &_vm->_waypoints->_waypoints[i];
if(waypoint->setId != _vm->_scene->getSetId()) {
if (waypoint->setId != _vm->_scene->getSetId()) {
continue;
}
char waypointText[40];
Expand Down Expand Up @@ -2358,7 +2358,7 @@ void Debugger::drawWaypoints() {
//draw world waypoints
for (int i = 0; i < _vm->_waypoints->_count; i++) {
Waypoints::Waypoint *waypoint = &_vm->_waypoints->_waypoints[i];
if(waypoint->setId != _vm->_scene->getSetId()) {
if (waypoint->setId != _vm->_scene->getSetId()) {
continue;
}
if (_viewWaypointsNormalToggle
Expand Down Expand Up @@ -2506,7 +2506,7 @@ int Debugger::findInDbgDrawList(DebuggerDrawnObjectType drObjType, int drObjId,
&& (drObjId == -1 || drObjId == _specificDrawnObjectsList[i].objId)
&& (drObjSetId == -1 || _specificDrawnObjectsList[i].setId == -1 || drObjSetId == _specificDrawnObjectsList[i].setId)
&& (drObjSceneId == -1 || _specificDrawnObjectsList[i].sceneId == -1 || drObjSceneId == _specificDrawnObjectsList[i].sceneId)
){
) {
// TODO for actors, 3d objects, items and waypoints it's probably preferable to ignore the sceneId (?)
return i;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/dialogue_menu.cpp
Expand Up @@ -343,7 +343,7 @@ void DialogueMenu::draw(Graphics::Surface &s) {

if (_items[i].colorIntensity < targetColorIntensity) {
_items[i].colorIntensity += 4;
if(_items[i].colorIntensity > targetColorIntensity) {
if (_items[i].colorIntensity > targetColorIntensity) {
_items[i].colorIntensity = targetColorIntensity;
}
} else if (_items[i].colorIntensity > targetColorIntensity) {
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/light.cpp
Expand Up @@ -115,7 +115,7 @@ void Light::readVqa(Common::ReadStream *stream, int frameCount, int frame, int a

int size = stream->readUint32LE();

if(_animationData != nullptr) {
if (_animationData != nullptr) {
delete[] _animationData;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/mouse.cpp
Expand Up @@ -242,7 +242,7 @@ void Mouse::draw(Graphics::Surface &surface, int x, int y) {

if (!_randomCountdownX)
setMouseJitterDown();
} else if (_randomCountdownY > 0){
} else if (_randomCountdownY > 0) {
_randomCountdownY--;
x += _randomX;
y += _randomY;
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/obstacles.cpp
Expand Up @@ -727,7 +727,7 @@ bool Obstacles::findFarthestAvailablePathVertex(Vector2 *path, int pathSize, Vec
}

// neighboring vertices are always available
if (foundVertexNeighbor){
if (foundVertexNeighbor) {
farthestPathIndex = pathVertexIdx;
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions engines/bladerunner/screen_effects.cpp
Expand Up @@ -37,7 +37,7 @@ ScreenEffects::~ScreenEffects() {
delete[] _data;
#if BLADERUNNER_ORIGINAL_BUGS
#else
if(!_skipEntries.empty()) {
if (!_skipEntries.empty()) {
_skipEntries.clear();
}
#endif // BLADERUNNER_ORIGINAL_BUGS
Expand Down Expand Up @@ -65,7 +65,7 @@ void ScreenEffects::toggleEntry(int effectId, bool skip) {
}
}
_skipEntries.insert_at(newSlot, effectId);
} else if (!skip && foundAt >= 0 ){
} else if (!skip && foundAt >= 0 ) {
_skipEntries.remove_at(foundAt);
}
} else if (effectId == -1 && !skip) {
Expand Down Expand Up @@ -155,7 +155,7 @@ void ScreenEffects::readVqa(Common::SeekableReadStream *stream) {
// if (entry.width < (width >> 1) + xx) {
// if (entry.width + entry.x > xx) {
// if (entry.height < (height >> 1) + yy) {
// if(entry.height + entry.y > yy) {
// if (entry.height + entry.y > yy) {
// return true;
// }
// }
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/generic_walker_a.cpp
Expand Up @@ -219,7 +219,7 @@ bool AIScriptGenericWalkerA::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
break;
case kGenericWalkerAStatesWalk:
switch (Global_Variable_Query(kVariableGenericWalkerAModel)){
switch (Global_Variable_Query(kVariableGenericWalkerAModel)) {
case 0:
*animation = 424;
break;
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/generic_walker_b.cpp
Expand Up @@ -205,7 +205,7 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
break;
case kGenericWalkerBStatesWalk:
switch (Global_Variable_Query(kVariableGenericWalkerBModel)){
switch (Global_Variable_Query(kVariableGenericWalkerBModel)) {
case 0:
*animation = 424;
break;
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/generic_walker_c.cpp
Expand Up @@ -206,7 +206,7 @@ bool AIScriptGenericWalkerC::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
break;
case kGenericWalkerCStatesWalk:
switch (Global_Variable_Query(kVariableGenericWalkerCModel)){
switch (Global_Variable_Query(kVariableGenericWalkerCModel)) {
case 0:
*animation = 424;
break;
Expand Down
4 changes: 2 additions & 2 deletions engines/bladerunner/script/ai/gordo.cpp
Expand Up @@ -500,7 +500,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;

case kGoalGordoNR02NextAct:
switch(Global_Variable_Query(kVariableGordosJoke)) {
switch (Global_Variable_Query(kVariableGordosJoke)) {
case 0:
Global_Variable_Increment(kVariableGordosJoke, 1);
Actor_Set_Goal_Number(kActorGordo, kGoalGordoNR02TellJoke1);
Expand Down Expand Up @@ -1634,7 +1634,7 @@ void AIScriptGordo::talkToMcCoyInCity() {
Game_Flag_Set(kFlagGordoTalk2);
AI_Movement_Track_Unpause(kActorGordo);
} else {
switch(Random_Query(1, 4)) {
switch (Random_Query(1, 4)) {
case 1:
Actor_Says(kActorMcCoy, 6460, 13);
break;
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/lucy.cpp
Expand Up @@ -113,7 +113,7 @@ bool AIScriptLucy::Update() {
void AIScriptLucy::TimerExpired(int timer) {
if (timer == kActorTimerAIScriptCustomTask0) { // rephrased this to be more expandable (if required)
AI_Countdown_Timer_Reset(kActorLucy, kActorTimerAIScriptCustomTask0);
if(Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03) {
if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03) {
if (Player_Query_Current_Scene() == kSceneHF03) {
AI_Countdown_Timer_Start(kActorLucy, kActorTimerAIScriptCustomTask0, 20);
} else {
Expand Down
6 changes: 3 additions & 3 deletions engines/bladerunner/script/ai/rachael.cpp
Expand Up @@ -87,7 +87,7 @@ void AIScriptRachael::ClickedByPlayer() {
// the structure is simplified (maintaining the same logic flow)
if ((Player_Query_Agenda() == kPlayerAgendaSurly || Player_Query_Agenda() == kPlayerAgendaErratic)
|| (Player_Query_Agenda() != kPlayerAgendaPolite && Actor_Query_Friendliness_To_Other(kActorSteele, kActorMcCoy) > Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy))
){
) {
dialogue_agenda2();
} else {
dialogue_agenda1();
Expand Down Expand Up @@ -155,7 +155,7 @@ bool AIScriptRachael::GoalChanged(int currentGoalNumber, int newGoalNumber) {
// the structure is simplified (maintaining the same logic flow)
if ((Player_Query_Agenda() == kPlayerAgendaSurly || Player_Query_Agenda() == kPlayerAgendaErratic)
|| (Player_Query_Agenda() != kPlayerAgendaPolite && Actor_Query_Friendliness_To_Other(kActorSteele, kActorMcCoy) > Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy))
){
) {
dialogue_agenda2();
} else {
dialogue_agenda1();
Expand Down Expand Up @@ -392,7 +392,7 @@ void AIScriptRachael::dialogue_start() {
if (_vm->_cutContent) {
Actor_Face_Actor(kActorRachael, kActorMcCoy, true);
Loop_Actor_Walk_To_Actor(kActorRachael, kActorMcCoy, 84, false, false);
if(_vm->_cutContent) {
if (_vm->_cutContent) {
Actor_Says(kActorMcCoy, 2735, 14); // MetAtYourUnclesOffice
}
Actor_Says(kActorRachael, 0, 15); // RememberYouMisterMcCoy
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/zuben.cpp
Expand Up @@ -490,7 +490,7 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Append_With_Facing(kActorZuben, 470, 3, 506);
AI_Movement_Track_Append(kActorZuben, 471, 5);
AI_Movement_Track_Append(kActorZuben, 472, 0);
} else if (rnd2 == 3){
} else if (rnd2 == 3) {
AI_Movement_Track_Flush(kActorZuben);
AI_Movement_Track_Append(kActorZuben, 468, 0);
AI_Movement_Track_Append(kActorZuben, 469, 3);
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai_script.cpp
Expand Up @@ -192,7 +192,7 @@ void AIScripts::clickedByPlayer(int actor) {
}


if(_vm->_actors[actor]->inCombat()) {
if (_vm->_actors[actor]->inCombat()) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/bladerunner/script/scene/ct01.cpp
Expand Up @@ -73,7 +73,7 @@ void SceneScriptCT01::InitializeScene() {
if ( Global_Variable_Query(kVariableChapter) < 4
&& Actor_Query_Which_Set_In(kActorGordo) != kSetCT01_CT12
&& Random_Query(1, 2) == 1
){
) {
// enhancement: don't always play
Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kCT01LoopInshot, false);
}
Expand Down Expand Up @@ -512,7 +512,7 @@ void SceneScriptCT01::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -330.0f, -6.5f, 221.0f, 0, false, false, false);
if (_vm->_cutContent) {
// unpause generic walkers here, less chance to collide with McCOy while he enters the scene
if( Game_Flag_Query(kFlagArrivedFromSpinner1)
if (Game_Flag_Query(kFlagArrivedFromSpinner1)
&& Global_Variable_Query(kVariableGenericWalkerConfig) < 0
) {
Global_Variable_Set(kVariableGenericWalkerConfig, 2);
Expand Down
4 changes: 2 additions & 2 deletions engines/bladerunner/script/scene/ma06.cpp
Expand Up @@ -115,7 +115,7 @@ void SceneScriptMA06::PlayerWalkedIn() {
//
if ((Game_Flag_Query(kFlagMA07toMA06) || Game_Flag_Query(kFlagMA01toMA06))
&& Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsInsideMcCoysElevatorAct3
){
) {
normalElevatorBusiness = false;
// Act 3 Deleted scene (can happen within the elevator or outside the building)
// Skip floor panel selection - force go to MCCOY 88F
Expand Down Expand Up @@ -154,7 +154,7 @@ void SceneScriptMA06::PlayerWalkedIn() {
Sound_Play(kSfxELDOORO2, 100, 50, 50, 50);
} else if (Game_Flag_Query(kFlagMA02toMA06)
&& Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsInsideMcCoysElevatorAct4
){
) {
normalElevatorBusiness = false;
// Act 4 deleted scene case with Rachael
//
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/ma07.cpp
Expand Up @@ -54,7 +54,7 @@ void SceneScriptMA07::InitializeScene() {

void SceneScriptMA07::SceneLoaded() {
Obstacle_Object("BARRICADE", true);
if(_vm->_cutContent) {
if (_vm->_cutContent) {
if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelShouldBeOutsideMcCoysAct3) {
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelIsOutsideMcCoysBuildingAct3);
}
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/nr02.cpp
Expand Up @@ -118,7 +118,7 @@ bool SceneScriptNR02::ClickedOnItem(int itemId, bool a2) {
if (itemId == kItemGordosLighterReplicant
|| itemId == kItemGordosLighterHuman
) {
if(!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 109.38f, -24.0f, 420.5f, 0, true, false, false)) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 109.38f, -24.0f, 420.5f, 0, true, false, false)) {
Actor_Face_Heading(kActorMcCoy, 423, false);
if (itemId == kItemGordosLighterReplicant) {
Item_Remove_From_World(kItemGordosLighterReplicant);
Expand Down
6 changes: 3 additions & 3 deletions engines/bladerunner/script/scene/nr03.cpp
Expand Up @@ -230,7 +230,7 @@ bool SceneScriptNR03::ClickedOn2DRegion(int region) {
if (region == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 79.2f, -70.19f, -984.0f, 12, true, false, false)) {
Actor_Face_Actor(kActorMcCoy, kActorHysteriaPatron1, true);
switch(Random_Query(0, 4)) {
switch (Random_Query(0, 4)) {
case 0:
Actor_Says(kActorMcCoy, 1055, kAnimationModeTalk);
break;
Expand All @@ -248,8 +248,8 @@ bool SceneScriptNR03::ClickedOn2DRegion(int region) {
break;
#else
case 4:
if(_vm->_cutContent) {
switch(Random_Query(1, 10)) {
if (_vm->_cutContent) {
switch (Random_Query(1, 10)) {
case 1:
// fall through
case 2:
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/nr05.cpp
Expand Up @@ -323,7 +323,7 @@ void SceneScriptNR05::talkToEarlyQ() {
int answer = Dialogue_Menu_Query_Input();
Dialogue_Menu_Disappear();

switch(answer){
switch (answer) {
case 890: // JEWELRY
Actor_Says(kActorMcCoy, 3505, kAnimationModeTalk);
Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1);
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/rc01.cpp
Expand Up @@ -726,7 +726,7 @@ void SceneScriptRC01::PlayerWalkedOut() {
if (!Game_Flag_Query(kFlagRC01toRC02)
&& !Game_Flag_Query(kFlagRC01toRC03)
) {
if(Global_Variable_Query(kVariableChapter) == 1) {
if (Global_Variable_Query(kVariableChapter) == 1) {
if (_vm->_cutContent) {
Outtake_Play(kOuttakeAscent, true, -1);
}
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/ug04.cpp
Expand Up @@ -85,7 +85,7 @@ void SceneScriptUG04::SceneLoaded() {
#else
if ((Global_Variable_Query(kVariableChapter) == 3)
|| (Global_Variable_Query(kVariableChapter) > 3 && Random_Query(1, 4) == 1)
){
) {
// Enhancement: don't always play the overground train after chapter 3
// Bug fix: don't remove control from player. There is no chance to glitch into the scenery
// while the video is playing and rats may attack!
Expand Down

0 comments on commit a81e3ad

Please sign in to comment.