Skip to content

Commit

Permalink
DRAGONAGE: Register objects with ObjectManager
Browse files Browse the repository at this point in the history
  • Loading branch information
vkremianskii authored and DrMcCoy committed Aug 28, 2018
1 parent 23292fd commit e808e47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engines/dragonage/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ using namespace ::Aurora::GFF4FieldNamesEnum;

Area::Area(Campaign &campaign, const Common::UString &resRef,
const Common::UString &env, const Common::UString &rim) :
Object(kObjectTypeArea), _campaign(&campaign), _resRef(resRef), _activeObject(0), _highlightAll(0) {
Object(kObjectTypeArea), _campaign(&campaign), _resRef(resRef), _environmentID(0xFFFFFFFF), _activeObject(0), _highlightAll(0) {

try {

Expand Down Expand Up @@ -119,7 +119,7 @@ void Area::loadEnvironment(const Common::UString &resRef) {

const GFF4Struct &arlTop = arl.getTopLevel();

_id = (uint32) ((int32) arlTop.getSint(kGFF4EnvAreaID, -1));
_environmentID = (uint32) ((int32) arlTop.getSint(kGFF4EnvAreaID, -1));

_environmentName = arlTop.getString(kGFF4EnvAreaName);
_skyDome = arlTop.getString(kGFF4EnvAreaSkydomeModel);
Expand Down
1 change: 1 addition & 0 deletions src/engines/dragonage/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Area : public DragonAge::Object, public Events::Notifyable {

Common::UString _resRef;

uint32 _environmentID;
Common::UString _environmentName;
Common::UString _skyDome;

Expand Down
7 changes: 7 additions & 0 deletions src/engines/dragonage/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@

#include "src/common/util.h"
#include "src/common/error.h"
#include "src/common/uuid.h"

#include "src/aurora/gff3file.h"
#include "src/aurora/gff4file.h"

#include "src/aurora/nwscript/objectman.h"

#include "src/engines/dragonage/object.h"

namespace Engines {
Expand All @@ -47,6 +50,9 @@ using ::Aurora::GFF4List;
using namespace ::Aurora::GFF4FieldNamesEnum;

Object::Object(ObjectType type) : _type(type), _static(true), _usable(false) {
_id = Common::generateIDNumber();
ObjectMan.registerObject(this);

_position[0] = 0.0f;
_position[1] = 0.0f;
_position[2] = 0.0f;
Expand All @@ -58,6 +64,7 @@ Object::Object(ObjectType type) : _type(type), _static(true), _usable(false) {
}

Object::~Object() {
ObjectMan.unregisterObject(this);
}

ObjectType Object::getType() const {
Expand Down

0 comments on commit e808e47

Please sign in to comment.