Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fmatthew5876 committed Mar 27, 2019
1 parent 6e0ff24 commit d76cbf6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/async_handler.cpp
Expand Up @@ -213,6 +213,7 @@ const std::string& FileRequestAsync::GetPath() const {
}

FileRequestBinding FileRequestAsync::Bind(void(*func)(FileRequestResult*)) {
Output::Debug("BIND FUNC PTR");
FileRequestBinding pending = CreatePending();

listeners.push_back(std::make_pair(FileRequestBindingWeak(pending), func));
Expand All @@ -221,6 +222,7 @@ FileRequestBinding FileRequestAsync::Bind(void(*func)(FileRequestResult*)) {
}

FileRequestBinding FileRequestAsync::Bind(std::function<void(FileRequestResult*)> func) {
Output::Debug("BIND FUNC OBJ");
FileRequestBinding pending = CreatePending();

listeners.push_back(std::make_pair(FileRequestBindingWeak(pending), func));
Expand All @@ -229,6 +231,7 @@ FileRequestBinding FileRequestAsync::Bind(std::function<void(FileRequestResult*)
}

void FileRequestAsync::CallListeners(bool success) {
Output::Debug("CALL LISTENERS");
FileRequestResult result;
result.directory = directory;
result.file = file;
Expand Down
3 changes: 3 additions & 0 deletions src/game_interpreter.cpp
Expand Up @@ -1795,6 +1795,7 @@ bool Game_Interpreter::CommandStoreEventID(RPG::EventCommand const& com) { // co
}

bool Game_Interpreter::CommandEraseScreen(RPG::EventCommand const& com) { // code 11010
Output::Debug("ERASE SCREEN");
if (Game_Temp::transition_processing || Game_Message::visible)
return false;

Expand Down Expand Up @@ -1874,6 +1875,7 @@ bool Game_Interpreter::CommandEraseScreen(RPG::EventCommand const& com) { // cod
}

bool Game_Interpreter::CommandShowScreen(RPG::EventCommand const& com) { // code 11020
Output::Debug("SHOW SCREEN");
if (Game_Temp::transition_processing || Game_Message::visible)
return false;

Expand Down Expand Up @@ -2139,6 +2141,7 @@ namespace PicPointerPatch {
}

bool Game_Interpreter::CommandShowPicture(RPG::EventCommand const& com) { // code 11110
Output::Debug("COMMAND SHOW PIC");
if (Game_Temp::battle_running) {
Output::Warning("ShowPicture: Not supported in battle");
return true;
Expand Down
1 change: 1 addition & 0 deletions src/game_interpreter_map.cpp
Expand Up @@ -568,6 +568,7 @@ bool Game_Interpreter_Map::CommandEnterHeroName(RPG::EventCommand const& com) {
}

bool Game_Interpreter_Map::CommandTeleport(RPG::EventCommand const& com) { // Code 10810
Output::Debug("COMMAND TELEPORT");
// TODO: if in battle return true
if (Game_Message::visible) {
return false;
Expand Down
3 changes: 3 additions & 0 deletions src/game_map.cpp
Expand Up @@ -984,6 +984,9 @@ int Game_Map::CheckEvent(int x, int y) {
}

void Game_Map::Update(bool is_preupdate) {
if (GetInterpreter().IsRunning()) {
Output::Debug("MAP UPD %d %d", GetMapId(), is_preupdate);
}
if (GetNeedRefresh() != Refresh_None) Refresh();
Parallax::Update();
if (animation) {
Expand Down
7 changes: 7 additions & 0 deletions src/scene_map.cpp
Expand Up @@ -40,6 +40,7 @@
#include "input.h"
#include "screen.h"
#include "scene_load.h"
#include "output.h"

Scene_Map::Scene_Map(bool from_save) :
from_save(from_save) {
Expand Down Expand Up @@ -117,6 +118,7 @@ void Scene_Map::DrawBackground() {
}

void Scene_Map::PreUpdate() {
Output::Debug("PRE UPDATE");
Game_Map::Update(true);
spriteset->Update();
}
Expand Down Expand Up @@ -216,6 +218,7 @@ void Scene_Map::UpdateSceneCalling() {
}

void Scene_Map::StartPendingTeleport() {
Output::Debug("START PENDING TELE");
const auto& tt = Main_Data::game_player->GetTeleportTarget();

FileRequestAsync* request = Game_Map::RequestMap(tt.GetMapId());
Expand All @@ -227,14 +230,17 @@ void Scene_Map::StartPendingTeleport() {
}

if (IsAsyncPending()) {
Output::Debug("GO ASYNC FINISH");
async_continuation = [&]() { FinishPendingTeleport(); };
return;
}

Output::Debug("GO IMMEDIATE FINISH");
FinishPendingTeleport();
}

void Scene_Map::FinishPendingTeleport() {
Output::Debug("FINISH PENDING TELE");
Main_Data::game_player->PerformTeleport();
Game_Map::PlayBgm();

Expand All @@ -248,6 +254,7 @@ void Scene_Map::FinishPendingTeleport() {

// Event forced the screen to erased, so we're done here.
if (Game_Temp::transition_erase) {
Output::Debug("FORCE ERASE SKIP");
UpdateSceneCalling();
return;
}
Expand Down

0 comments on commit d76cbf6

Please sign in to comment.