Skip to content

Commit

Permalink
WAGE: Initialize class variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 18, 2016
1 parent 4d85aa1 commit ab9e2fd
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions engines/wage/design.cpp
Expand Up @@ -70,6 +70,7 @@ Design::Design(Common::SeekableReadStream *data) {
data->read(_data, _len);

_surface = NULL;
_bounds = NULL;
}

Design::~Design() {
Expand Down
12 changes: 12 additions & 0 deletions engines/wage/entities.cpp
Expand Up @@ -200,6 +200,18 @@ const char *Scene::getFontName() {
return "Unknown";
}

Obj::Obj() : _currentOwner(NULL), _currentScene(NULL) {
_index = 0;
_namePlural = false;
_value = 0;
_attackType = 0;
_numberOfUses = 0;
_returnToRandomScene = false;
_type = 0;
_accuracy = 0;
_damage = 0;
}

Obj::Obj(Common::String name, Common::SeekableReadStream *data) {
_name = name;
_classType = OBJ;
Expand Down
2 changes: 1 addition & 1 deletion engines/wage/entities.h
Expand Up @@ -228,7 +228,7 @@ class Chr : public Designed {

class Obj : public Designed {
public:
Obj() : _currentOwner(NULL), _currentScene(NULL) {}
Obj();
Obj(Common::String name, Common::SeekableReadStream *data);
~Obj();

Expand Down
2 changes: 2 additions & 0 deletions engines/wage/menu.cpp
Expand Up @@ -130,6 +130,8 @@ Menu::Menu(Gui *gui) : _gui(gui) {
_items.push_back(_commands);
regenCommandsMenu();

_weapons = NULL;

if (!_gui->_engine->_world->_weaponMenuDisabled) {
_weapons = new MenuItem(_gui->_engine->_world->_weaponsMenuName.c_str());
_items.push_back(_weapons);
Expand Down
9 changes: 9 additions & 0 deletions engines/wage/script.cpp
Expand Up @@ -75,6 +75,15 @@ Common::String Script::Operand::toString() {
}

Script::Script(Common::SeekableReadStream *data) : _data(data) {
_engine = NULL;
_world = NULL;

_loopCount = 0;
_inputText = NULL;
_inputClick = NULL;

_handled = false;

convertToText();
}

Expand Down
10 changes: 10 additions & 0 deletions engines/wage/wage.cpp
Expand Up @@ -71,10 +71,20 @@ WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(sy
_running = NULL;
_lastScene = NULL;

_loopCount = 0;
_turn = 0;

_commandWasQuick = false;

_shouldQuit = false;

_gui = NULL;
_world = NULL;
_console = NULL;
_offer = NULL;

_resManager = NULL;

debug("WageEngine::WageEngine()");
}

Expand Down
2 changes: 2 additions & 0 deletions engines/wage/world.cpp
Expand Up @@ -67,6 +67,8 @@ World::World(WageEngine *engine) {
_saveBeforeCloseMessage = nullptr;
_revertMessage = nullptr;

_weaponMenuDisabled = true;

_engine = engine;
}

Expand Down

0 comments on commit ab9e2fd

Please sign in to comment.