Skip to content

Commit

Permalink
KOTOR2: Add back modules and areas with doors and placeables
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Mar 21, 2014
1 parent 7e60727 commit c9fdb72
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engines/kotor2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ noinst_LTLIBRARIES = libkotor2.la

noinst_HEADERS = \
kotor2.h \
model.h \
area.h \
module.h \
$(EMPTY)

libkotor2_la_SOURCES = \
kotor2.cpp \
model.cpp \
area.cpp \
module.cpp \
$(EMPTY)
44 changes: 44 additions & 0 deletions src/engines/kotor2/area.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/area.cpp
* KotOR2 area.
*/

#include "engines/kotor2/area.h"

namespace Engines {

namespace KotOR2 {

Area::Area() {
}

Area::~Area() {
}

} // End of namespace KotOR2

} // End of namespace Engines
49 changes: 49 additions & 0 deletions src/engines/kotor2/area.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/area.h
* KotOR2 area.
*/

#ifndef ENGINES_KOTOR2_AREA_H
#define ENGINES_KOTOR2_AREA_H

#include "engines/kotor/area.h"

namespace Engines {

namespace KotOR2 {

class Area : public Engines::KotOR::Area {
public:
Area();
~Area();
};

} // End of namespace KotOR2

} // End of namespace Engines

#endif // ENGINES_KOTOR2_AREA_H
4 changes: 4 additions & 0 deletions src/engines/kotor2/kotor2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#include "graphics/cursorman.h"

#include "graphics/aurora/sceneman.h"

#include "sound/sound.h"

#include "events/events.h"
Expand Down Expand Up @@ -207,6 +209,8 @@ void KotOR2Engine::initResources() {

status("Loading main talk table");
TalkMan.addMainTable("dialog");

SceneMan.registerModelType(Graphics::Aurora::kModelTypeKotOR2);
}

void KotOR2Engine::initCursorsRemap() {
Expand Down
55 changes: 55 additions & 0 deletions src/engines/kotor2/model.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/model.cpp
* Utility functions for Star Wars: Knights of the Old Republic II - The Sith Lords models.
*/

#include "common/maths.h"

#include "graphics/aurora/sceneman.h"
#include "graphics/aurora/model_kotor.h"

#include "engines/kotor2/model.h"

namespace Engines {

namespace KotOR2 {

Graphics::Aurora::Model_KotOR *createWorldModel(const Common::UString &model, const Common::UString &texture) {
Graphics::Aurora::Model_KotOR *modelInstance = (Graphics::Aurora::Model_KotOR *) SceneMan.createModel(model, texture);

modelInstance->setBaseOrientation(Common::deg2rad(-90.0), 1.0, 0.0, 0.0);

return modelInstance;
}

void destroyModel(Graphics::Aurora::Model_KotOR *model) {
SceneMan.destroy(model);
}

} // End of namespace KotOR2

} // End of namespace Engines
51 changes: 51 additions & 0 deletions src/engines/kotor2/model.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/model.h
* Utility functions for Star Wars: Knights of the Old Republic II - The Sith Lords models.
*/

#ifndef ENGINES_KOTOR2_MODEL_H
#define ENGINES_KOTOR2_MODEL_H

namespace Graphics {
namespace Aurora {
class Model_KotOR;
}
}

namespace Engines {

namespace KotOR2 {

Graphics::Aurora::Model_KotOR *createWorldModel(const Common::UString &model, const Common::UString &texture = "");

void destroyModel(Graphics::Aurora::Model_KotOR *model);

} // End of namespace KotOR2

} // End of namespace Engines

#endif // ENGINES_KOTOR2_MODEL_H
49 changes: 49 additions & 0 deletions src/engines/kotor2/module.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/module.cpp
* The context needed to run a KotOR2 module.
*/

#include "engines/kotor2/module.h"
#include "engines/kotor2/area.h"

namespace Engines {

namespace KotOR2 {

Module::Module() : Engines::KotOR::Module() {
}

Module::~Module() {
}

::Engines::KotOR::Area *Module::createArea() const {
return new ::Engines::KotOR2::Area;
}

} // End of namespace KotOR2

} // End of namespace Engines
56 changes: 56 additions & 0 deletions src/engines/kotor2/module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey, Eclipse and Lycium engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/

/** @file engines/kotor2/module.h
* The context needed to run a KotOR2 module.
*/

#ifndef ENGINES_KOTOR2_MODULE_H
#define ENGINES_KOTOR2_MODULE_H

#include "engines/kotor/module.h"

namespace Engines {

namespace KotOR {
class Area;
}

namespace KotOR2 {

class Module : public Engines::KotOR::Module {
public:
Module();
~Module();

protected:
::Engines::KotOR::Area *createArea() const;
};

} // End of namespace KotOR2

} // End of namespace Engines

#endif // ENGINES_KOTOR2_MODULE_H

0 comments on commit c9fdb72

Please sign in to comment.