Skip to content

Commit

Permalink
KOTOR: Start adding back creatures
Browse files Browse the repository at this point in the history
Only bodies, no heads, for segmented models at the
moment, though.
  • Loading branch information
DrMcCoy committed Jan 19, 2014
1 parent 125b074 commit 695a9c6
Show file tree
Hide file tree
Showing 6 changed files with 745 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engines/kotor/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ noinst_HEADERS = \
situated.h \
door.h \
placeable.h \
creature.h \
$(EMPTY)

libkotor_la_SOURCES = \
Expand All @@ -23,4 +24,5 @@ libkotor_la_SOURCES = \
situated.cpp \
door.cpp \
placeable.cpp \
creature.cpp \
$(EMPTY)
12 changes: 12 additions & 0 deletions src/engines/kotor/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "engines/kotor/area.h"
#include "engines/kotor/placeable.h"
#include "engines/kotor/door.h"
#include "engines/kotor/creature.h"

namespace Engines {

Expand Down Expand Up @@ -233,6 +234,9 @@ void Area::loadGIT(const Aurora::GFFStruct &git) {

if (git.hasField("Door List"))
loadDoors(git.getList("Door List"));

if (git.hasField("Creature List"))
loadCreatures(git.getList("Creature List"));
}

void Area::loadProperties(const Aurora::GFFStruct &props) {
Expand Down Expand Up @@ -305,6 +309,14 @@ void Area::loadDoors(const Aurora::GFFList &list) {
}
}

void Area::loadCreatures(const Aurora::GFFList &list) {
for (Aurora::GFFList::const_iterator c = list.begin(); c != list.end(); ++c) {
Creature *creature = new Creature(**c);

loadObject(*creature);
}
}

void Area::loadRoomModels() {
const Aurora::LYTFile::RoomArray &rooms = _lyt.getRooms();
_rooms.reserve(rooms.size());
Expand Down
1 change: 1 addition & 0 deletions src/engines/kotor/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Area {
void loadObject(Engines::KotOR::Object &object);
void loadPlaceables(const Aurora::GFFList &list);
void loadDoors (const Aurora::GFFList &list);
void loadCreatures (const Aurora::GFFList &list);

void stopSound();
void stopAmbientMusic();
Expand Down

0 comments on commit 695a9c6

Please sign in to comment.