Permalink
Browse files

MUTATIONOFJB: Fix some code formatting issues.

  • Loading branch information...
LubomirR authored and sev- committed Mar 9, 2018
1 parent d3e281e commit 5854d310eee2c4a6fc4d189009631d4042ce0df8
@@ -110,7 +110,7 @@ class ChangeSceneCommandParser : public ChangeCommandParser {

class ChangeDoorCommand : public ChangeCommand {
public:
ChangeDoorCommand(uint8 sceneId, uint8 doorId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue& val)
ChangeDoorCommand(uint8 sceneId, uint8 doorId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue &val)
: ChangeCommand(sceneId, doorId, reg, op, val)
{}
virtual ExecuteResult execute(GameData &gameData) override;
@@ -119,7 +119,7 @@ class ChangeDoorCommand : public ChangeCommand {

class ChangeObjectCommand : public ChangeCommand {
public:
ChangeObjectCommand(uint8 sceneId, uint8 objectId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue& val)
ChangeObjectCommand(uint8 sceneId, uint8 objectId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue &val)
: ChangeCommand(sceneId, objectId, reg, op, val)
{}
virtual ExecuteResult execute(GameData &gameData) override;
@@ -128,7 +128,7 @@ class ChangeObjectCommand : public ChangeCommand {

class ChangeStaticCommand : public ChangeCommand {
public:
ChangeStaticCommand(uint8 sceneId, uint8 staticId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue& val)
ChangeStaticCommand(uint8 sceneId, uint8 staticId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue &val)
: ChangeCommand(sceneId, staticId, reg, op, val)
{}
virtual ExecuteResult execute(GameData &gameData) override;
@@ -137,7 +137,7 @@ class ChangeStaticCommand : public ChangeCommand {

class ChangeSceneCommand : public ChangeCommand {
public:
ChangeSceneCommand(uint8 sceneId, uint8 staticId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue& val)
ChangeSceneCommand(uint8 sceneId, uint8 staticId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue &val)
: ChangeCommand(sceneId, staticId, reg, op, val)
{}
virtual ExecuteResult execute(GameData &gameData) override;
@@ -28,7 +28,7 @@

namespace MutationOfJB {

bool EndBlockCommandParser::parse(const Common::String &line, ScriptParseContext &parseCtx, Command *& command) {
bool EndBlockCommandParser::parse(const Common::String &line, ScriptParseContext &parseCtx, Command *&command) {
if (line.empty()) {
return false;
}
@@ -94,12 +94,12 @@ IfCommand::IfCommand(uint8 sceneId, uint8 objectId, uint16 value, bool negative)
{}

Command::ExecuteResult IfCommand::execute(GameData &gameData) {
Scene* const scene = gameData.getScene(_sceneId);
Scene *const scene = gameData.getScene(_sceneId);
if (!scene) {
return Finished;
}

Object* const object = scene->getObject(_objectId);
Object *const object = scene->getObject(_objectId);
if (!object) {
return Finished;
}
@@ -25,7 +25,7 @@

namespace MutationOfJB {

void SeqCommandParser::transition(ScriptParseContext &, Command * oldCommand, Command * newCommand, CommandParser *) {
void SeqCommandParser::transition(ScriptParseContext &, Command *oldCommand, Command *newCommand, CommandParser *) {
if (!oldCommand || !newCommand) {
warning(_("Unexpected empty command in transition"));
return;
@@ -28,8 +28,7 @@

namespace MutationOfJB {

class SeqCommandParser : public CommandParser
{
class SeqCommandParser : public CommandParser {
public:
virtual void transition(ScriptParseContext &parseCtx, Command *oldCommand, Command *newCommand, CommandParser *newCommandParser) override;
};
@@ -27,8 +27,7 @@

namespace MutationOfJB {

static bool readString(Common::ReadStream &stream, char *str)
{
static bool readString(Common::ReadStream &stream, char *str) {
char buf[MAX_STR_LENGTH];
memset(str, 0, MAX_STR_LENGTH + 1);

@@ -172,8 +171,7 @@ Static *Scene::getStatic(uint8 staticId) {

GameData::GameData() : _currentScene(0) {}

Scene *GameData::getScene(uint8 sceneId)
{
Scene *GameData::getScene(uint8 sceneId) {
if (sceneId == 0 || sceneId > ARRAYSIZE(_scenes)) {
warning(_("Scene %d does not exist"), sceneId);
return nullptr;
@@ -144,8 +144,7 @@ struct Scene {
bool loadFromStream(Common::ReadStream &stream);
};

struct GameData
{
struct GameData {
public:
GameData();
Scene *getScene(uint8 sceneId);
@@ -60,7 +60,6 @@ void Inventory::rotateItemsRight(uint n) {
}

n %= _items.size();

reverseItems(0, _items.size() - 1);
reverseItems(0, n - 1);
reverseItems(n, _items.size() - 1);
@@ -47,8 +47,7 @@ MutationOfJBEngine::MutationOfJBEngine(OSystem *syst)
_room(nullptr),
_screen(nullptr),
_globalScript(nullptr),
_localScript(nullptr)
{
_localScript(nullptr) {
debug("MutationOfJBEngine::MutationOfJBEngine");
}

@@ -72,8 +71,7 @@ bool MutationOfJBEngine::loadGameData(bool partB) {
return true;
}

void MutationOfJBEngine::setupCursor()
{
void MutationOfJBEngine::setupCursor() {
const uint8 white[] = {0xFF, 0xFF, 0xFF};
const uint8 cursor[] = {0xFF};

@@ -120,7 +118,7 @@ Common::Error MutationOfJBEngine::run() {
}
case Common::EVENT_LBUTTONDOWN:
{
const Scene* const scene = _gameData->getScene(_gameData->_currentScene);
const Scene *const scene = _gameData->getScene(_gameData->_currentScene);
if (scene) {
for (int i = 0; i < MIN(ARRAYSIZE(scene->_doors), (int) scene->_noDoors); ++i) {
const Door &door = scene->_doors[i];
@@ -98,7 +98,7 @@ void Room::loadPalette(EncryptedFile &file) {
void Room::loadBackground(EncryptedFile &file, uint32 size) {
_screen->clear();

uint8 * const pixels = static_cast<uint8 *>(_screen->getPixels());
uint8 *const pixels = static_cast<uint8 *>(_screen->getPixels());
uint8 *ptr = pixels;
uint32 readBytes = 0;
uint32 lines = 0;
@@ -37,8 +37,8 @@

namespace MutationOfJB {

static CommandParser** getParsers() {
static CommandParser* parsers[] = {
static CommandParser **getParsers() {
static CommandParser *parsers[] = {
new IfCommandParser,
new EndBlockCommandParser,
new ChangeDoorCommandParser,
@@ -34,7 +34,7 @@ namespace MutationOfJB {

class Command;
class ConditionalCommand;
typedef Common::Array<Command*> Commands;
typedef Common::Array<Command *> Commands;


struct ActionInfo {
@@ -26,10 +26,12 @@
#include "engines/engine.h"

namespace MutationOfJB {
void reportFileMissingError(const char *fileName) {
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), fileName);
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
}

void reportFileMissingError(const char *fileName) {
Common::String errorMessage = Common::String::format(_("Unable to locate the '%s' engine data file."), fileName);
GUIErrorMessage(errorMessage);
warning("%s", errorMessage.c_str());
}

}

@@ -24,7 +24,9 @@
#define MUTATIONOFJB_UTIL_H

namespace MutationOfJB {
void reportFileMissingError(const char *fileName);

void reportFileMissingError(const char *fileName);

}

#endif

0 comments on commit 5854d31

Please sign in to comment.