aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/pink.cpp
diff options
context:
space:
mode:
authorwhiterandrek2018-05-22 11:58:02 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commite98c14c3d7d790f6ba77ab4d4925b608c55e2e22 (patch)
tree00b613617132ce06f622054786f63ed8396db9ae /engines/pink/pink.cpp
parentd7f09d4c3cbfca7472856ca5a3e14a8e55255451 (diff)
downloadscummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.tar.gz
scummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.tar.bz2
scummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.zip
PINK: fix formatting
Diffstat (limited to 'engines/pink/pink.cpp')
-rw-r--r--engines/pink/pink.cpp69
1 files changed, 32 insertions, 37 deletions
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 74b38cf6e2..0e5952bbd4 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -38,8 +38,8 @@ namespace Pink {
Pink::PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
: Engine(system), _console(nullptr), _rnd("pink"),
- _desc(*desc), _bro(nullptr), _module(nullptr), _director(_system)
-{
+ _desc(*desc), _bro(nullptr), _module(nullptr),
+ _director(_system) {
debug("PinkEngine constructed");
DebugMan.addDebugChannel(kPinkDebugGeneral, "general", "General issues");
@@ -72,14 +72,13 @@ Common::Error PinkEngine::init() {
const Common::String orbName = _desc.filesDescriptions[0].fileName;
const Common::String broName = _desc.filesDescriptions[1].fileName;
- if (strcmp(_desc.gameId, kPeril) == 0){
+ if (strcmp(_desc.gameId, kPeril) == 0)
_bro = new BroFile();
- }
- else debug("This game doesn't need to use bro");
+ else
+ debug("This game doesn't need to use bro");
- if (!_orb.open(orbName) || (_bro && !_bro->open(broName, _orb.getTimestamp()))){
+ if (!_orb.open(orbName) || (_bro && !_bro->open(broName, _orb.getTimestamp())))
return Common::kNoGameDataFoundError;
- }
if (!loadCursors())
return Common::kNoGameDataFoundError;
@@ -99,34 +98,33 @@ Common::Error Pink::PinkEngine::run() {
if (error.getCode() != Common::kNoError)
return error;
- while(!shouldQuit()){
+ while (!shouldQuit()) {
Common::Event event;
- while(_eventMan->pollEvent(event)){
- switch (event.type){
- case Common::EVENT_QUIT:
- case Common::EVENT_RTL:
- return Common::kNoError;
- case Common::EVENT_MOUSEMOVE:
- _actor->onMouseMove(event.mouse);
- break;
- case Common::EVENT_LBUTTONDOWN:
- _actor->onLeftButtonClick(event.mouse);
- break;
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == Common::KEYCODE_d)
- _director.showBounds = !_director.showBounds;
- else _actor->onKeyboardButtonClick(event.kbd.keycode);
- break;
-
- // don't know why it is used in original
- case Common::EVENT_LBUTTONUP:
- case Common::EVENT_RBUTTONDOWN:
- default:
- break;
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ case Common::EVENT_RTL:
+ return Common::kNoError;
+ case Common::EVENT_MOUSEMOVE:
+ _actor->onMouseMove(event.mouse);
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ _actor->onLeftButtonClick(event.mouse);
+ break;
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == Common::KEYCODE_d)
+ _director.showBounds = !_director.showBounds;
+ else
+ _actor->onKeyboardButtonClick(event.kbd.keycode);
+ break;
+ // don't know why it is used in original
+ case Common::EVENT_LBUTTONUP:
+ case Common::EVENT_RBUTTONDOWN:
+ default:
+ break;
}
}
-
_actor->update();
_director.update();
_director.draw();
@@ -145,7 +143,7 @@ void PinkEngine::load(Archive &archive) {
void PinkEngine::initModule(const Common::String &moduleName, bool isLoadingFromSave, const Common::String &pageName) {
if (_module) {
for (uint i = 0; i < _modules.size(); ++i) {
- if (_module == _modules[i]){
+ if (_module == _modules[i]) {
_modules[i] = new ModuleProxy(_module->getName());
delete _module;
@@ -170,12 +168,10 @@ void PinkEngine::changeScene(GamePage *page) {
setCursor(kLoadingCursor);
if (!_nextModule.empty() && _nextModule.compareTo(_module->getName())) {
initModule(_nextModule, kLoadingNewGame, _nextPage);
- }
- else {
+ } else {
assert(!_nextPage.empty());
_module->changePage(_nextPage);
}
-
}
void PinkEngine::setNextExecutors(const Common::String &nextModule, const Common::String &nextPage) {
@@ -222,8 +218,7 @@ bool PinkEngine::loadCursors() {
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusClickableThirdCursorID));
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusNotClickableCursorID));
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusHoldingItemCursorID));
- }
- else {
+ } else {
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilClickableThirdCursorID));
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilNotClickableCursorID));
_cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilHoldingItemCursorID));