summaryrefslogtreecommitdiffstats
path: root/src/app/app.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-06-16 21:39:21 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2013-06-16 21:54:36 +0200
commit7874aca10ce6da823f88e8aabe4a0ea6431cc480 (patch)
tree6ab2e5e4dd0dcb4263701ca44a1edf08b0f101f7 /src/app/app.h
parent7cf88118885699a23daa4768285d512fc06d5a2a (diff)
downloadcolobot-7874aca10ce6da823f88e8aabe4a0ea6431cc480.tar.gz
colobot-7874aca10ce6da823f88e8aabe4a0ea6431cc480.tar.bz2
colobot-7874aca10ce6da823f88e8aabe4a0ea6431cc480.zip
Enhanced logging, option to auto-start mission
* added logging of application events * changed debug mode flag to independent debug modes * added option to auto-start mission (load a mission immediately after startup) * removed "enum value out of range" prints * some refactoring
Diffstat (limited to 'src/app/app.h')
-rw-r--r--src/app/app.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/app/app.h b/src/app/app.h
index 6c53cf9..269fa9b 100644
--- a/src/app/app.h
+++ b/src/app/app.h
@@ -143,6 +143,15 @@ enum PerformanceCounter
PCNT_MAX
};
+enum DebugMode
+{
+ DEBUG_SYS_EVENTS = 1 << 0,
+ DEBUG_APP_EVENTS = 1 << 1,
+ DEBUG_EVENTS = DEBUG_SYS_EVENTS | DEBUG_APP_EVENTS,
+ DEBUG_MODELS = 1 << 2,
+ DEBUG_ALL = DEBUG_SYS_EVENTS | DEBUG_APP_EVENTS | DEBUG_MODELS
+};
+
struct ApplicationPrivate;
/**
@@ -312,10 +321,11 @@ public:
//! Moves (warps) the mouse cursor to the specified position (in interface coords)
void MoveMouse(Math::Point pos);
- //! Management of debug mode (prints more info in logger)
+ //! Management of debug modes (printing more info in logger)
//@{
- void SetDebugMode(bool mode);
- bool GetDebugMode() const;
+ void SetDebugModeActive(DebugMode mode, bool active);
+ bool IsDebugModeActive(DebugMode mode) const;
+ static bool ParseDebugModes(const std::string& str, int& debugModes);
//@}
//! Returns the full path to data directory
@@ -351,6 +361,8 @@ public:
float GetPerformanceCounterData(PerformanceCounter counter) const;
//@}
+ bool GetProtoMode() const;
+
protected:
//! Creates the window's SDL_Surface
bool CreateVideoSurface();
@@ -361,8 +373,8 @@ protected:
Event CreateVirtualEvent(const Event& sourceEvent);
//! Prepares a simulation update event
TEST_VIRTUAL Event CreateUpdateEvent();
- //! Handles some incoming events
- bool ProcessEvent(const Event& event);
+ //! Logs debug data for event
+ void LogEvent(const Event& event);
//! Renders the image in window
void Render();
@@ -406,8 +418,8 @@ protected:
int m_exitCode;
//! Whether application window is active
bool m_active;
- //! Whether debug mode is enabled
- bool m_debugMode;
+ //! Bit array of active debug modes
+ long m_debugModes;
//! Message to be displayed as error to the user
std::string m_errorMessage;
@@ -474,6 +486,12 @@ protected:
//! Path to directory with user texture pack
std::string m_texPackPath;
+ //@{
+ //! Scene to run on startup
+ std::string m_runSceneName;
+ int m_runSceneRank;
+ //@}
+
const char* m_standardDataDirs[DIR_MAX];
//! Application language
@@ -481,5 +499,8 @@ protected:
//! Low cpu mode
bool m_lowCPU;
+
+ //! Show prototype levels
+ bool m_protoMode;
};