1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Use C++11 member initializers in RWGame

This commit is contained in:
darkf 2016-08-02 04:45:05 -07:00
parent 6d6d772653
commit 03f050fc04
2 changed files with 16 additions and 22 deletions

View File

@ -34,17 +34,11 @@ const std::string kWindowTitle = "RWGame";
#define MOUSE_SENSITIVITY_SCALE 2.5f
DebugDraw* debug;
DebugDraw* debug = nullptr;
StdOutReciever logPrinter;
RWGame::RWGame(int argc, char* argv[])
: config("openrw.ini")
, state(nullptr), world(nullptr), renderer(nullptr), script(nullptr),
window(nullptr), work(nullptr),
debugScript(false), inFocus(true),
showDebugStats(false), showDebugPaths(false), showDebugPhysics(false),
accum(0.f), timescale(1.f)
{
if (!config.isValid())
{

View File

@ -20,31 +20,31 @@ class HttpServer;
class RWGame
{
Logger log;
GameConfig config;
GameState* state;
GameData* data;
GameWorld* world;
GameConfig config {"openrw.ini"};
GameState* state = nullptr;
GameData* data = nullptr;
GameWorld* world = nullptr;
// must be allocated after Logger setup.
GameRenderer* renderer;
ScriptMachine* script;
GameWindow *window;
GameRenderer* renderer = nullptr;
ScriptMachine* script = nullptr;
GameWindow *window = nullptr;
// Background worker
WorkContext *work;
bool debugScript;
WorkContext *work = nullptr;
bool debugScript = false;
HttpServer* httpserver = nullptr;
std::thread* httpserver_thread = nullptr;
std::chrono::steady_clock clock;
std::chrono::steady_clock::time_point last_clock_time;
bool inFocus;
bool inFocus = true;
ViewCamera lastCam, nextCam;
bool showDebugStats;
bool showDebugPaths;
bool showDebugPhysics;
bool showDebugStats = false;
bool showDebugPaths = false;
bool showDebugPhysics = false;
int lastDraws; /// Number of draws issued for the last frame.
float accum;
float timescale;
float accum = 0.f;
float timescale = 1.f;
public:
RWGame(int argc, char* argv[]);