Permalink
Browse files

Melee attack

- ozDynamics always builds, OZ_DYNAMICS enables ODE & stuff
- matrix
  * melee attack
- Zombies! mission (stub)
  • Loading branch information...
1 parent 3fb4f93 commit 53d836f62a2d7d8e67578e5d23abb910e7473369 @ducakar committed Jan 24, 2013
View
2 CMakeLists.txt
@@ -10,7 +10,7 @@ set( OZ_VERSION 0.3.81 )
option( OZ_TRACK_ALLOCS "Track memory allocations to detect new/delete mismatches and memory leaks." OFF )
option( OZ_SIMD_MATH "Use SIMD implementation of linear algebra classes." OFF )
-option( OZ_DYNAMICS "Build ozDynamics library." OFF )
+option( OZ_DYNAMICS "Build complete ozDynamics library with ODE support." OFF )
option( OZ_LUAJIT "Use use LuaJIT 2.0 instead of official Lua." OFF )
option( OZ_SDL2 "Use SDL 2.0 instead of SDL 1.2." OFF )
View
9 README.md
@@ -52,7 +52,7 @@ MinGW32 is searched in `/usr/i486-mingw32` by default. You may change that in
You may also want to set several options when configuring CMake build system:
-#### ozCore ####
+#### ozCore Library ####
- `OZ_TRACK_ALLOCS`: Enable tracking of allocated memory chunks in liboz. Stack trace for every
memory allocation performed via new operator is saved for later diagnostics. It detects new/delete
@@ -65,10 +65,11 @@ You may also want to set several options when configuring CMake build system:
vector components in OpenZone code.
`OFF` by default.
-#### ozDynamics ####
+#### ozDynamics Library ####
-- `OZ_DYNAMICS`: Build OpenZone Dynamics Library. Requires ODE (Open Dynamics Engine) compiled in
- single precision.
+- `OZ_DYNAMICS`: Build complete OpenZone Dynamics Library. Requires ODE (Open Dynamics Engine)
+ compiled in single precision. If turned off, ozDynamics is built only partially. OpenZone does not
+ need ozDynamics library to run, only a few headers are required to build OpenZone.
`OFF` by default.
#### OpenZone Engine ####
View
2 data/oz_main/class/firstAid.json
@@ -14,7 +14,7 @@
"mass": 10,
"lift": 1.2,
- "onUse": "healUser100_disposable",
+ "onUse": "healUser_disposable",
"fragPool": "metal",
"nFrags": 2,
View
2 data/oz_main/class/knight.json
@@ -25,6 +25,7 @@
"cvicek"
],
"weaponItem": 0,
+ "onMelee": "meleeAttack",
"fragPool": "gibs",
"nFrags": 5,
@@ -40,6 +41,7 @@
"land": "oz/land",
"splash": "free/splash1",
"jump": "aard/jump",
+ "melee": "aard/tak",
"flip": "ppm/deathb",
"death": "ppm/deathb",
"step": "openarena/boot4",
View
49 data/oz_main/class/zombie.json
@@ -0,0 +1,49 @@
+{
+ "base": "Bot",
+
+ "dim": [ 0.45, 0.45, 1.05 ],
+ "crouchDimZ": 0.8,
+
+ "life": 150,
+
+ "mass": 100,
+ "lift": 1.3,
+
+ "camZ": 0.79,
+ "crouchCamZ": 0.69,
+
+ "nameList": "wesnoth.ogre-male",
+
+ "mindFunc": "predator",
+
+ "nItems": 4,
+ "defaultItems":
+ [
+ "cvicek",
+ "cvicek"
+ ],
+
+ "onMelee": "meleeAttack",
+
+ "fragPool": "gibs",
+ "nFrags": 5,
+
+ "imagoType": "MD2",
+ "imagoModel": "ogro",
+
+ "audioType": "Bot",
+ "audioSounds":
+ {
+ "damage": "aard/pain6",
+ "hit": "oz/land",
+ "land": "oz/land",
+ "splash": "free/splash1",
+ "jump": "aard/jump",
+ "melee": "aard/tak",
+ "flip": "aard/grunt1",
+ "death": "aard/die1",
+ "step": "openarena/boot4",
+ "waterStep": "openarena/splash1",
+ "swim": "openarena/watr_in"
+ }
+}
View
19 data/oz_main/lua/matrix/generic.lua
@@ -25,7 +25,7 @@
* Generic handlers.
]]--
-function healUser100( l )
+function healUser( l )
ozBindUser()
if ozBotHasState( OZ_BOT_MECHANICAL_BIT ) then
@@ -35,7 +35,7 @@ function healUser100( l )
end
end
-function healUser100_disposable( l )
+function healUser_disposable( l )
ozBindUser()
if ozBotHasState( OZ_BOT_MECHANICAL_BIT ) then
@@ -48,6 +48,21 @@ function healUser100_disposable( l )
end
end
+function meleeAttack( l )
+ ozBindUser()
+
+ local pX, pY, pZ = ozObjGetPos()
+ local vX, vY, vZ = ozBotGetDir()
+
+ ozOrbisBindOverlaps( OZ_OBJECTS_BIT, pX + 0.6*vX, pY + 0.6*vY, pZ + 0.6*vZ, 0.4, 0.4, 0.4 );
+
+ while ozBindNextObj() do
+ if not ( ozObjIsSelf() or ozObjIsUser() ) then
+ ozObjDamage( 100.0 + 50.0 * math.random() )
+ end
+ end
+end
+
function spawnSmallExplosion( l )
ozOrbisAddObj( OZ_FORCE, "smallExplosion", ozObjGetPos() );
end
View
4 data/oz_missions/mission/02_zombies/description.json
@@ -0,0 +1,4 @@
+{
+ "title": "Zombies!",
+ "description": "Defend your village against zombies."
+}
View
85 data/oz_missions/mission/02_zombies/main.lua
@@ -0,0 +1,85 @@
+--[[
+ * OpenZone - simple cross-platform FPS/RTS game engine.
+ * Copyright (C) 2002-2012 Davorin Učakar
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Davorin Učakar
+ * <davorin.ucakar@gmail.com>
+]]--
+
+--[[
+ * mission/test.lua
+ *
+ * Test world.
+]]--
+
+function onUpdate()
+ ozUIShowBuild( true )
+end
+
+function onCreate()
+ ozTerraLoad( "terra" )
+
+ ozCaelumLoad( "earth" )
+ ozCaelumSetHeading( math.pi / 8 )
+ ozCaelumSetPeriod( 3600 )
+ ozCaelumSetTime( 450 )
+
+ oz_me = ozOrbisAddObj( OZ_FORCE, "beast", -1005.96, 603.80, 51.10, true )
+ ozBotSetH( 20 )
+ ozBotSetName( ozProfileGetName() )
+ ozBotSetMind( "" )
+
+ ozOrbisAddStr( OZ_FORCE, "beastBunker", -1014.0, 620.0, 52.0, OZ_NORTH )
+ ozOrbisAddStr( OZ_FORCE, "beastBunker", -1029.0, 610.0, 51.5, OZ_WEST )
+ ozOrbisAddStr( OZ_FORCE, "beastBunker", -1010.0, 595.0, 53.0, OZ_SOUTH )
+
+ ozOrbisAddObj( OZ_FORCE, "smallCrate", -1022.30, 596.59, 51.54 )
+ ozOrbisAddObj( OZ_FORCE, "smallCrate", -1021.96, 597.80, 51.45 )
+ ozOrbisAddObj( OZ_FORCE, "smallCrate", -1023.41, 596.91, 50.29 )
+ ozOrbisAddObj( OZ_FORCE, "bigCrate", -1022.48, 596.59, 50.63 )
+ ozOrbisAddObj( OZ_FORCE, "bigCrate", -1023.38, 597.93, 50.52 )
+ ozOrbisAddObj( OZ_FORCE, "metalCrate", -1021.95, 597.90, 50.54 )
+ ozObjAddItem( "musicPlayer" )
+ ozObjAddItem( "musicPlayer" )
+ ozObjAddItem( "beast$plasmagun" )
+ ozObjAddItem( "beast$plasmagun" )
+ ozObjAddItem( "nvGoggles" )
+ ozObjAddItem( "galileo" )
+ ozObjAddItem( "firstAid" )
+ ozObjAddItem( "firstAid" )
+ ozObjAddItem( "firstAid" )
+ ozObjAddItem( "firstAid" )
+ ozObjAddItem( "bomb" )
+ ozObjAddItem( "bomb" )
+
+ ozFloraSeed()
+
+ local bounds = { -1100, -900, 500, 700 }
+
+ for i = 1, 100 do
+ local x = -1050 + 100 * math.random()
+ local y = 550 + 100 * math.random()
+ local z = ozTerraHeight( x, y )
+
+ if z > 0 then
+ ozOrbisAddObj( OZ_TRY, "zombie", x, y, z + 1.10 )
+ end
+ end
+
+ ozCameraAddSwitchableUnit( oz_me )
+ ozCameraSwitchTo( oz_me )
+-- ozCameraAllowReincarnation( false )
+end
View
9 doc/Doxyfile
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.2
+# Doxyfile 1.8.3.1
#---------------------------------------------------------------------------
# Project related configuration options
@@ -127,6 +127,7 @@ INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -191,10 +192,16 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
+MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
+EXTERNAL_SEARCH = NO
+SEARCHENGINE_URL =
+SEARCHDATA_FILE = searchdata.xml
+EXTERNAL_SEARCH_ID =
+EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
View
9 doc/Doxyfile.liboz
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.2
+# Doxyfile 1.8.3.1
#---------------------------------------------------------------------------
# Project related configuration options
@@ -125,6 +125,7 @@ INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -189,10 +190,16 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
+MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
+EXTERNAL_SEARCH = NO
+SEARCHENGINE_URL =
+SEARCHDATA_FILE = searchdata.xml
+EXTERNAL_SEARCH_ID =
+EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
View
3 etc/PKGBUILD
@@ -31,8 +31,7 @@ function build()
function package_liboz()
{
-# pkgdesc='OpenZone Core and Dynamics Libraries'
- pkgdesc='OpenZone Core Library'
+ pkgdesc='OpenZone Core and Dynamics Libraries'
license=('ZLIB')
depends=('libpulse' 'physfs')
View
19 etc/openzone.spec
@@ -31,8 +31,7 @@ and front-end that renders it and enables the player to manipulate with the
simulated world.
%package -n liboz
-# Summary: OpenZone Core and Dynamics Libraries
-Summary: OpenZone Core Library
+Summary: OpenZone Core and Dynamics Libraries
Group: System Environment/Libraries
License: zlib
@@ -42,19 +41,17 @@ utilities, string class, memory manager with memory leak tracing, crash
handlers, I/O buffers and classes for filesystem access with PhysicsFS support,
log writer, JSON file manipulation class, math functions and linear algebra
classes.
-# OpenZone Dynamics Library is a rigid body physics engine used in OpenZone
-# engine.
+OpenZone Dynamics Library is a rigid body physics engine used in OpenZone
+engine.
%package -n liboz-devel
-# Summary: Headers for OpenZone Core and Dynamics Libraries
-Summary: Headers for OpenZone Library
+Summary: Headers for OpenZone Core and Dynamics Libraries
Group: Development/Libraries
License: zlib
Requires: liboz = %{version}
%description -n liboz-devel
-# This package contains header files for OpenZone Core and Dynamics Libraries.
-This package contains header files for OpenZone Core Library.
+This package contains header files for OpenZone Core and Dynamics Libraries.
%package data
Summary: OpenZone game data
@@ -104,15 +101,15 @@ install -m644 share/openzone/*.zip "$RPM_BUILD_ROOT"%{_datadir}/openzone
%files -n liboz
%defattr(-, root, root, -)
%{_libdir}/libozCore.so*
-# %{_libdir}/libozDynamics.so*
+%{_libdir}/libozDynamics.so*
%doc src/ozCore/COPYING
%files -n liboz-devel
%defattr(-, root, root, -)
%{_libdir}/pkgconfig/ozCore.pc
-# %{_libdir}/pkgconfig/ozDynamics.pc
+%{_libdir}/pkgconfig/ozDynamics.pc
%{_includedir}/ozCore
-# %{_includedir}/ozDynamics
+%{_includedir}/ozDynamics
%doc src/ozCore/COPYING
%files data
View
10 src/builder/Class.cc
@@ -368,13 +368,15 @@ void Class::fillBot( const char* className )
const JSON& soundsConfig = config["audioSounds"];
audioSounds[Bot::EVENT_JUMP] = soundsConfig["jump"].get( "" );
+ audioSounds[Bot::EVENT_MELEE] = soundsConfig["melee"].get( "" );
audioSounds[Bot::EVENT_FLIP] = soundsConfig["flip"].get( "" );
audioSounds[Bot::EVENT_DEATH] = soundsConfig["death"].get( "" );
audioSounds[Bot::EVENT_STEP] = soundsConfig["step"].get( "" );
audioSounds[Bot::EVENT_WATERSTEP] = soundsConfig["waterStep"].get( "" );
audioSounds[Bot::EVENT_SWIM] = soundsConfig["swim"].get( "" );
context.usedSounds.include( audioSounds[Bot::EVENT_JUMP] );
+ context.usedSounds.include( audioSounds[Bot::EVENT_MELEE] );
context.usedSounds.include( audioSounds[Bot::EVENT_FLIP] );
context.usedSounds.include( audioSounds[Bot::EVENT_DEATH] );
context.usedSounds.include( audioSounds[Bot::EVENT_STEP] );
@@ -447,6 +449,12 @@ void Class::fillBot( const char* className )
throwMomentum = config["throwMomentum"].get( 6.0f );
weaponItem = config["weaponItem"].get( -1 );
+ meleeInterval = config["meleeInterval"].get( 0.5f );
+ onMelee = config["onMelee"].get( "" );
+
+ if( !String::isEmpty( onMelee ) ) {
+ flags |= Object::LUA_BIT;
+ }
nameList = config["nameList"].get( "" );
@@ -711,6 +719,8 @@ void Class::writeBot( BufferStream* os )
os->writeFloat( throwMomentum );
os->writeInt( weaponItem );
+ os->writeFloat( meleeInterval );
+ os->writeString( onMelee );
os->writeString( nameList );
View
2 src/builder/Class.hh
@@ -141,6 +141,8 @@ class Class
float throwMomentum;
int weaponItem;
+ float meleeInterval;
+ String onMelee;
String nameList;
View
4 src/builder/UI.cc
@@ -54,7 +54,7 @@ const char* const UI::ICON_NAMES[] = {
void UI::buildCursors()
{
- if( File( File::VIRTUAL, "ui/cur" ).type() == File::DIRECTORY ) {
+ if( File( File::VIRTUAL, "ui/cur" ).type() != File::DIRECTORY ) {
return;
}
@@ -109,7 +109,7 @@ void UI::buildCursors()
void UI::buildIcons()
{
- if( File( File::VIRTUAL, "ui/icon" ).type() == File::DIRECTORY ) {
+ if( File( File::VIRTUAL, "ui/icon" ).type() != File::DIRECTORY ) {
return;
}
View
30 src/client/MD2.cc
@@ -95,6 +95,11 @@ MD2::AnimType MD2::AnimState::extractAnim()
return bot->state & Bot::CROUCHING_BIT ? ANIM_CROUCH_ATTACK : ANIM_ATTACK;
}
+ else if( prevAttack || bot->meleeTime != 0.0f ) {
+ prevAttack = bot->meleeTime != 0.0f;
+
+ return bot->state & Bot::CROUCHING_BIT ? ANIM_CROUCH_ATTACK : ANIM_ATTACK;
+ }
else if( bot->state & Bot::CROUCHING_BIT ) {
return ANIM_CROUCH_STAND;
}
@@ -168,19 +173,24 @@ void MD2::AnimState::advance()
frameFreq = float( nFrames ) * stepInc / Timer::TICK_TIME;
}
- else if( ( inferredType == ANIM_ATTACK || inferredType == ANIM_CROUCH_ATTACK ) &&
- bot->weapon >= 0 )
- {
- const Weapon* weapon = static_cast<const Weapon*>( orbis.objects[bot->weapon] );
+ else if( ( inferredType == ANIM_ATTACK || inferredType == ANIM_CROUCH_ATTACK ) ) {
+ float shotInterval;
+ if( bot->weapon < 0 || orbis.objects[bot->weapon] == nullptr ) {
+ const BotClass* clazz = static_cast<const BotClass*>( bot->clazz );
- if( weapon != nullptr ) {
- const WeaponClass* clazz = static_cast<const WeaponClass*>( weapon->clazz );
+ shotInterval = clazz->meleeInterval;
+ }
+ else {
+ const Weapon* weapon = static_cast<const Weapon*>( orbis.objects[bot->weapon] );
+ const WeaponClass* clazz = static_cast<const WeaponClass*>( weapon->clazz );
+
+ shotInterval = clazz->shotInterval;
+ }
- if( clazz->shotInterval >= MIN_SHOT_INTERVAL_SYNC ) {
- int nFrames = lastFrame - firstFrame + 1;
+ if( shotInterval >= MIN_SHOT_INTERVAL_SYNC ) {
+ int nFrames = lastFrame - firstFrame + 1;
- frameFreq = float( nFrames ) / clazz->shotInterval;
- }
+ frameFreq = float( nFrames ) / shotInterval;
}
}
View
2 src/client/MD2Imago.cc
@@ -79,7 +79,7 @@ void MD2Imago::draw( const Imago* parent )
md2->scheduleAnim( &anim );
- // HACK Enable when no buggy models are used (no mismatched death animation for weapons).
+ // FIXME Enable when no buggy models are used (no mismatched death animation for weapons).
// if( parent == nullptr && bot->weapon >= 0 && orbis.objects[bot->weapon] != nullptr ) {
// context.drawImago( orbis.objects[bot->weapon], this, Mesh::SOLID_BIT );
// }
View
6 src/common/CMakeLists.txt
@@ -19,9 +19,3 @@ if( OZ_LUAJIT )
else()
target_link_libraries( common ${LUA_LIBRARIES} )
endif()
-
-if( OZ_DYNAMICS )
- target_link_libraries( common ozDynamics )
-else()
- target_link_libraries( common ozCore )
-endif()
View
21 src/matrix/Bot.cc
@@ -26,6 +26,7 @@
#include <common/Timer.hh>
#include <matrix/Liber.hh>
+#include <matrix/Lua.hh>
#include <matrix/NamePool.hh>
#include <matrix/Physics.hh>
#include <matrix/Synapse.hh>
@@ -468,8 +469,9 @@ void Bot::onUpdate()
hard_assert( 0.0f <= h && h < Math::TAU );
hard_assert( 0.0f <= v && v <= Math::TAU / 2.0f );
- life = min( life + clazz->regeneration, clazz->life );
- stamina = min( stamina + clazz->staminaGain, clazz->stamina );
+ life = min( life + clazz->regeneration, clazz->life );
+ stamina = min( stamina + clazz->staminaGain, clazz->stamina );
+ meleeTime = max( meleeTime - Timer::TICK_TIME, 0.0f );
if( parent >= 0 ) {
Object* vehicle = orbis.objects[parent];
@@ -833,6 +835,13 @@ void Bot::onUpdate()
state |= ATTACKING_BIT;
weaponObj->trigger( this );
}
+ else if( !clazz->onMelee.isEmpty() && meleeTime == 0.0f ) {
+ state |= ATTACKING_BIT;
+ meleeTime = clazz->meleeInterval;
+
+ addEvent( EVENT_MELEE, 1.0f );
+ lua.objectCall( clazz->onMelee, this, this );
+ }
}
else if( !( state & CROUCHING_BIT ) ) {
if( actions & ACTION_GESTURE_MASK ) {
@@ -1146,9 +1155,12 @@ Bot::Bot( const BotClass* clazz_, int index, const Point& p_, Heading heading )
stamina = clazz_->stamina;
step = 0.0f;
stairRate = 0.0f;
+
cargo = -1;
weapon = -1;
grabHandle = 0.0f;
+ meleeTime = 0.0f;
+
camZ = clazz_->camZ;
name = namePool.genName( clazz_->nameList );
@@ -1172,9 +1184,12 @@ Bot::Bot( const BotClass* clazz_, InputStream* istream ) :
stamina = istream->readFloat();
step = istream->readFloat();
stairRate = istream->readFloat();
+
cargo = istream->readInt();
weapon = istream->readInt();
grabHandle = istream->readFloat();
+ meleeTime = istream->readFloat();
+
camZ = state & Bot::CROUCHING_BIT ? clazz_->crouchCamZ : clazz_->camZ;
name = istream->readString();
@@ -1203,9 +1218,11 @@ void Bot::write( BufferStream* ostream ) const
ostream->writeFloat( stamina );
ostream->writeFloat( step );
ostream->writeFloat( stairRate );
+
ostream->writeInt( cargo );
ostream->writeInt( weapon );
ostream->writeFloat( grabHandle );
+ ostream->writeFloat( meleeTime );
ostream->writeString( name );
ostream->writeString( mindFunc );
View
12 src/matrix/Bot.hh
@@ -41,13 +41,14 @@ class Bot : public Dynamic
*/
static const int EVENT_JUMP = 9;
- static const int EVENT_FLIP = 10;
- static const int EVENT_DEATH = 11;
+ static const int EVENT_MELEE = 10;
+ static const int EVENT_FLIP = 11;
+ static const int EVENT_DEATH = 12;
// Step and swim events are not in use but merely reserve sound slots.
- static const int EVENT_STEP = 12;
- static const int EVENT_WATERSTEP = 13;
- static const int EVENT_SWIM = 14;
+ static const int EVENT_STEP = 13;
+ static const int EVENT_WATERSTEP = 14;
+ static const int EVENT_SWIM = 15;
/*
* ACTIONS
@@ -170,6 +171,7 @@ class Bot : public Dynamic
int cargo;
int weapon;
float grabHandle;
+ float meleeTime;
float camZ;
View
2 src/matrix/BotClass.cc
@@ -85,6 +85,8 @@ void BotClass::init( InputStream* is, const char* name )
throwMomentum = is->readFloat();
weaponItem = is->readInt();
+ meleeInterval = is->readFloat();
+ onMelee = is->readString();
const char* sNameList = is->readString();
nameList = String::isEmpty( sNameList ) ? -1 : liber.nameListIndex( sNameList );
View
2 src/matrix/BotClass.hh
@@ -78,6 +78,8 @@ class BotClass : public DynamicClass
float throwMomentum;
int weaponItem;
+ float meleeInterval;
+ String onMelee;
int nameList;
View
8 src/ozDynamics/CMakeLists.txt
@@ -1,10 +1,6 @@
configure_file( config.hh.in config.hh @ONLY )
configure_file( ozDynamics.pc.in ozDynamics.pc @ONLY )
-if( NOT OZ_DYNAMICS )
- return()
-endif()
-
add_library( ozDynamics
${CMAKE_CURRENT_BINARY_DIR}/config.hh
#BEGIN SOURCES
@@ -36,8 +32,8 @@ add_library( ozDynamics
set_target_properties( ozDynamics PROPERTIES VERSION ${OZ_VERSION} SOVERSION 0 )
-# Hack.
-if( ODE_LIBRARIES )
+# HACK.
+if( OZ_DYNAMICS )
target_link_libraries( ozDynamics ${ODE_LIBRARIES} ozCore )
else()
target_link_libraries( ozDynamics ozCore )
View
4 src/ozDynamics/ozDynamics.hh
@@ -36,8 +36,6 @@
#include "collision/AABB.hh"
#include "collision/Bounds.hh"
-#ifdef OZ_DYNAMICS
-
/*
* Shapes.
*/
@@ -59,5 +57,3 @@
*/
#include "physics/DBody.hh"
#include "physics/Physics.hh"
-
-#endif
View
4 src/ozDynamics/physics/Physics.cc
@@ -28,6 +28,8 @@
#include "DBody.hh"
+#ifdef OZ_DYNAMICS
+
// If ODE is not compiled with single precision, bad things are going to happen.
#define dSINGLE
#include <ode/ode.h>
@@ -159,3 +161,5 @@ void Physics::destroy()
}
}
+
+#endif
View
2 src/tests/CMakeLists.txt
@@ -5,8 +5,8 @@ endif()
add_executable( foreach foreach.cc )
target_link_libraries( foreach ozCore )
+include_directories( SYSTEM /usr/include/mono-2.0 )
# add_executable( mono mono.cc )
-# include_directories( SYSTEM /usr/include/mono-2.0 )
# target_link_libraries( mono -lmono-2.0 ozCore )
add_executable( quicksort quicksort.cc )
View
2 src/tests/mono.cc
@@ -49,7 +49,7 @@ int main( int argc, char** argv )
monoDomain = mono_jit_init( "openzone" );
monoAssembly = mono_domain_assembly_open( monoDomain, "MonoTest.exe" );
- // Reinstall signal handlers Mono overwritten.
+ // Reinstall signal handlers Mono has overwritten.
System::threadInit();
hard_assert( monoAssembly != nullptr );
View
13 src/tools/CMakeLists.txt
@@ -2,7 +2,7 @@ if( ANDROID )
add_library( openzone SHARED openzone.cc )
use_pch( openzone pch )
- target_link_libraries( openzone client modules nirvana matrix common )
+ target_link_libraries( openzone client modules nirvana matrix common ozCore )
set( jniLibPath ${CMAKE_BINARY_DIR}/../Android/libs/${PLATFORM_PROC_PREFIX}/libopenzone.so )
add_custom_command( OUTPUT ${jniLibPath} DEPENDS openzone
@@ -13,20 +13,25 @@ elseif( NACL )
add_executable( openzone openzone.cc )
use_pch( openzone pch )
- target_link_libraries( openzone client modules nirvana matrix common )
+ target_link_libraries( openzone client modules nirvana matrix common ozCore )
set_target_properties( openzone PROPERTIES OUTPUT_NAME openzone${PLATFORM_EXE_SUFFIX} )
else()
add_executable( openzone openzone.cc )
use_pch( openzone pch )
- target_link_libraries( openzone client modules nirvana matrix common )
+ # HACK
+ if( OZ_DYNAMICS )
+ target_link_libraries( openzone client modules nirvana matrix common ozDynamics )
+ else()
+ target_link_libraries( openzone client modules nirvana matrix common ozCore )
+ endif()
install( TARGETS openzone RUNTIME DESTINATION bin${OZ_BINARY_SUBDIR} )
add_executable( ozBuild ozBuild.cc )
use_pch( ozBuild pch )
- target_link_libraries( ozBuild builder client modules nirvana matrix common )
+ target_link_libraries( ozBuild builder client modules nirvana matrix common ozCore )
install( TARGETS ozBuild RUNTIME DESTINATION bin${OZ_BINARY_SUBDIR} )

0 comments on commit 53d836f

Please sign in to comment.