diff options
author | Joseph Eagar <joeedh@gmail.com> | 2011-05-09 03:43:18 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2011-05-09 03:43:18 +0400 |
commit | 6ef77cf95accc3cb914e7efd964118ce6e9521cf (patch) | |
tree | 1d8dbf95355038c93f79f9053a0bf1d55b561ec3 /source/gameengine | |
parent | 3462ddf17f38eb61fc3bb2751d55de15a47455c3 (diff) | |
parent | 770119d16f7dbee99a60d19540818892c970c4e2 (diff) |
=bmesh= merge from trunk at r36529
Diffstat (limited to 'source/gameengine')
89 files changed, 397 insertions, 165 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index b94d15d2fbf..571cc9087b3 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -64,7 +64,7 @@ #include "NG_LoopBackNetworkDeviceInterface.h" -#include "SYS_System.h" +#include "BL_System.h" #include "GPU_extensions.h" #include "Value.h" diff --git a/source/gameengine/BlenderRoutines/BL_System.cpp b/source/gameengine/BlenderRoutines/BL_System.cpp new file mode 100644 index 00000000000..30b8beef156 --- /dev/null +++ b/source/gameengine/BlenderRoutines/BL_System.cpp @@ -0,0 +1,104 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * 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 2 + * 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 Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * Interface to the commandline arguments + */ + +/** \file gameengine/BlenderRoutines/BL_System.cpp + * \ingroup blroutines + */ + +#include "CTR_Map.h" +#include "STR_HashedString.h" +#include "BL_System.h" + +struct SingletonSystem { + CTR_Map<STR_HashedString,int> int_params; + CTR_Map<STR_HashedString,float> float_params; + CTR_Map<STR_HashedString,STR_String> string_params; +}; + +static SingletonSystem *_system_instance = NULL; + +SYS_SystemHandle SYS_GetSystem() +{ + if(!_system_instance) + _system_instance = new SingletonSystem(); + + return (SYS_SystemHandle)_system_instance; +} + +void SYS_DeleteSystem(SYS_SystemHandle sys) +{ + if(_system_instance) { + delete _system_instance; + _system_instance = NULL; + } +} + +int SYS_GetCommandLineInt(SYS_SystemHandle sys, const char *paramname, int defaultvalue) +{ + int *result = ((SingletonSystem *)sys)->int_params[paramname]; + if(result) + return *result; + + return defaultvalue; +} + +float SYS_GetCommandLineFloat(SYS_SystemHandle sys, const char *paramname, float defaultvalue) +{ + float *result = ((SingletonSystem *)sys)->float_params[paramname]; + if(result) + return *result; + + return defaultvalue; +} + +const char *SYS_GetCommandLineString(SYS_SystemHandle sys, const char *paramname, const char *defaultvalue) +{ + STR_String *result = ((SingletonSystem *)sys)->string_params[paramname]; + if(result) + return *result; + + return defaultvalue; +} + +void SYS_WriteCommandLineInt(SYS_SystemHandle sys, const char *paramname, int value) +{ + ((SingletonSystem *)sys)->int_params.insert(paramname, value); +} + +void SYS_WriteCommandLineFloat(SYS_SystemHandle sys, const char *paramname, float value) +{ + ((SingletonSystem *)sys)->float_params.insert(paramname, value); +} + +void SYS_WriteCommandLineString(SYS_SystemHandle sys, const char *paramname, const char *value) +{ + ((SingletonSystem *)sys)->string_params.insert(paramname, value); +} + diff --git a/source/gameengine/BlenderRoutines/BL_System.h b/source/gameengine/BlenderRoutines/BL_System.h new file mode 100644 index 00000000000..d743ef5532a --- /dev/null +++ b/source/gameengine/BlenderRoutines/BL_System.h @@ -0,0 +1,72 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * 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 2 + * 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 Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * System specific information / access. + * Interface to the commandline arguments + */ + +/** \file gameengine/BlenderRoutines/BL_System.h + * \ingroup blroutines + */ + +#ifndef BL_SYSTEM_H +#define BL_SYSTEM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Game Engine command line parameters */ + +typedef void* SYS_SystemHandle; + +extern SYS_SystemHandle SYS_GetSystem(void); +extern void SYS_DeleteSystem(SYS_SystemHandle sys); + +extern int SYS_GetCommandLineInt(SYS_SystemHandle sys, const char *paramname, int defaultvalue); +extern float SYS_GetCommandLineFloat(SYS_SystemHandle sys, const char *paramname, float defaultvalue); +extern const char *SYS_GetCommandLineString(SYS_SystemHandle sys, const char *paramname, const char *defaultvalue); + +extern void SYS_WriteCommandLineInt(SYS_SystemHandle sys, const char *paramname, int value); +extern void SYS_WriteCommandLineFloat(SYS_SystemHandle sys, const char *paramname, float value); +extern void SYS_WriteCommandLineString(SYS_SystemHandle sys, const char *paramname, const char *value); + +/* Start game engine */ + +struct bContext; +struct ARegion; +struct rcti; + +extern void StartKetsjiShell(struct bContext *C, struct ARegion *ar, + struct rcti *cam_frame, int always_use_expand_framing); + +#ifdef __cplusplus +} +#endif + +#endif /* BL_SYSTEM_H */ + diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index f5103034316..6a17017f261 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -1,8 +1,8 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string + ../../../intern/container ../../../intern/guardedalloc ../../../intern/audaspace/intern ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer @@ -34,6 +34,7 @@ set(INC set(SRC BL_KetsjiEmbedStart.cpp + BL_System.cpp KX_BlenderCanvas.cpp KX_BlenderGL.cpp KX_BlenderInputDevice.cpp @@ -42,6 +43,7 @@ set(SRC KX_BlenderRenderTools.cpp KX_BlenderSystem.cpp + BL_System.h KX_BlenderCanvas.h KX_BlenderGL.h KX_BlenderInputDevice.h diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index ff70ad3bf7b..8f59ec0bf04 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -4,10 +4,10 @@ Import ('env') sources = env.Glob('*.cpp') defs = [ 'GLEW_STATIC' ] -incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc' +incs = '. #intern/string #intern/guardedalloc' incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer' incs += ' #source/gameengine/Converter #source/blender/imbuf' -incs += ' #intern/ghost/include' +incs += ' #intern/ghost/include #intern/container' incs += ' #intern/audaspace/intern' incs += ' #intern/moto/include #source/gameengine/Ketsji #source/blender/blenlib' incs += ' #source/blender/blenkernel #source/blender' diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index c6e661f1549..ff4ca785a96 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -34,7 +34,7 @@ #ifndef BL_ACTIONACTUATOR #define BL_ACTIONACTUATOR -#include "GEN_HashedPtr.h" +#include "CTR_HashedPtr.h" #include "SCA_IActuator.h" #include "DNA_actuator_types.h" #include "MT_Point3.h" diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp index efd1a73a448..a56fab31a26 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.cpp +++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp @@ -115,7 +115,7 @@ bool BL_ArmatureActuator::UnlinkObject(SCA_IObject* clientobj) return res; } -void BL_ArmatureActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void BL_ArmatureActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_gametarget]; if (h_obj) { diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index 4615fb06714..70aa526d4d3 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -67,7 +67,7 @@ public: }; virtual void ProcessReplica(); virtual bool UnlinkObject(SCA_IObject* clientobj); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool Update(double curtime, bool frame); virtual void ReParent(SCA_IObject* parent); diff --git a/source/gameengine/Converter/BL_ArmatureChannel.h b/source/gameengine/Converter/BL_ArmatureChannel.h index 0c2c27a7fab..0a66d0038a2 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.h +++ b/source/gameengine/Converter/BL_ArmatureChannel.h @@ -35,8 +35,8 @@ #define __BL_ARMATURECHANNEL #include "DNA_action_types.h" -#include "GEN_HashedPtr.h" -#include "GEN_Map.h" +#include "CTR_HashedPtr.h" +#include "CTR_Map.h" #include "PyObjectPlus.h" class SCA_IObject; diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp index c07fe6b3b41..3f1a111517c 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp +++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp @@ -147,7 +147,7 @@ void BL_ArmatureConstraint::ReParent(BL_ArmatureObject* armature) } } -void BL_ArmatureConstraint::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void BL_ArmatureConstraint::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_target]; if (h_obj) { diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index 1dd685b8cba..8e6ba1bc2d3 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -35,8 +35,8 @@ #define __BL_ARMATURECONSTRAINT #include "DNA_constraint_types.h" -#include "GEN_HashedPtr.h" -#include "GEN_Map.h" +#include "CTR_HashedPtr.h" +#include "CTR_Map.h" #include "PyObjectPlus.h" class SCA_IObject; @@ -80,7 +80,7 @@ public: BL_ArmatureConstraint* GetReplica() const; void ReParent(BL_ArmatureObject* armature); - void Relink(GEN_Map<GEN_HashedPtr, void*> *map); + void Relink(CTR_Map<CTR_HashedPtr, void*> *map); bool UnlinkObject(SCA_IObject* clientobj); void UpdateTarget(); diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 952af4db8bb..c6c20a96482 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -45,8 +45,8 @@ #include "BKE_armature.h" #include "BKE_constraint.h" -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" #include "MEM_guardedalloc.h" #include "DNA_action_types.h" #include "DNA_armature_types.h" @@ -439,7 +439,7 @@ void BL_ArmatureObject::ReParentLogic() KX_GameObject::ReParentLogic(); } -void BL_ArmatureObject::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void BL_ArmatureObject::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { SG_DList::iterator<BL_ArmatureConstraint> cit(m_controlledConstraints); for (cit.begin(); !cit.end(); ++cit) { diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 8490bfadac2..2c3ca7404b3 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -60,7 +60,7 @@ public: short GetActivePriority(); virtual void ProcessReplica(); virtual void ReParentLogic(); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool UnlinkObject(SCA_IObject* clientobj); class BL_ActionActuator * GetActiveAction(); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index c781159787f..259c7d71bd7 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -156,7 +156,7 @@ extern "C" { #include "KX_ScalarInterpolator.h" #include "KX_IpoConvert.h" -#include "SYS_System.h" +#include "BL_System.h" #include "SG_Node.h" #include "SG_BBox.h" diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.h b/source/gameengine/Converter/BL_BlenderDataConversion.h index cea9f7f2a8b..0e8ea17fc38 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.h +++ b/source/gameengine/Converter/BL_BlenderDataConversion.h @@ -34,7 +34,7 @@ #ifndef __BLENDER_CONVERT #define __BLENDER_CONVERT -#include "GEN_HashedPtr.h" +#include "CTR_HashedPtr.h" #include "STR_String.h" #include "KX_Python.h" #include "KX_PhysicsEngineEnums.h" diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index 6bcdaff10e3..615bb84ac2b 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -60,7 +60,7 @@ public: { return m_blendobj; } - virtual void Relink(GEN_Map<GEN_HashedPtr, void*>*map) + virtual void Relink(CTR_Map<CTR_HashedPtr, void*>*map) { if (m_pDeformer) m_pDeformer->Relink (map); diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 2a54ea7d9ae..63db9167273 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -46,7 +46,7 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "BLI_math.h" @@ -101,7 +101,7 @@ void BL_MeshDeformer::ProcessReplica() m_lastDeformUpdate = -1; } -void BL_MeshDeformer::Relink(GEN_Map<class GEN_HashedPtr, void*>*map) +void BL_MeshDeformer::Relink(CTR_Map<class CTR_HashedPtr, void*>*map) { void **h_obj = (*map)[m_gameobj]; diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index b62958c7fd1..90466e930fb 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -51,7 +51,7 @@ class BL_MeshDeformer : public RAS_Deformer public: void VerifyStorage(); void RecalcNormals(); - virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map); + virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map); BL_MeshDeformer(BL_DeformableGameObject *gameobj, struct Object* obj, class RAS_MeshObject *meshobj ): diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 95f362a2879..e504fa7e49d 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -38,7 +38,7 @@ #include "MEM_guardedalloc.h" #include "BL_ModifierDeformer.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "RAS_IPolygonMaterial.h" #include "RAS_MeshObject.h" diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 229c59a34a4..7a4523d4554 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -34,7 +34,7 @@ #ifndef BL_SHAPEACTIONACTUATOR #define BL_SHAPEACTIONACTUATOR -#include "GEN_HashedPtr.h" +#include "CTR_HashedPtr.h" #include "SCA_IActuator.h" #include "BL_ActionActuator.h" #include "MT_Point3.h" diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index 40e7c6e1bde..8d8f149bb6c 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -38,7 +38,7 @@ #include "MEM_guardedalloc.h" #include "BL_ShapeDeformer.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "RAS_IPolygonMaterial.h" #include "RAS_MeshObject.h" diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 4916ce53fc5..34f9cb56c27 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -37,7 +37,7 @@ #endif //WIN32 #include "BL_SkinDeformer.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "RAS_IPolygonMaterial.h" #include "RAS_MeshObject.h" @@ -108,7 +108,7 @@ BL_SkinDeformer::~BL_SkinDeformer() m_armobj->Release(); } -void BL_SkinDeformer::Relink(GEN_Map<class GEN_HashedPtr, void*>*map) +void BL_SkinDeformer::Relink(CTR_Map<class CTR_HashedPtr, void*>*map) { if (m_armobj) { void **h_obj = (*map)[m_armobj]; diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 69b8783ce22..e53e21e946f 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -38,7 +38,7 @@ #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning #endif //WIN32 -#include "GEN_HashedPtr.h" +#include "CTR_HashedPtr.h" #include "BL_MeshDeformer.h" #include "BL_ArmatureObject.h" @@ -54,7 +54,7 @@ class BL_SkinDeformer : public BL_MeshDeformer { public: // void SetArmatureController (BL_ArmatureController *cont); - virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map); + virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map); void SetArmature (class BL_ArmatureObject *armobj); BL_SkinDeformer(BL_DeformableGameObject *gameobj, diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 147c8b791ee..bdd0769e0a3 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -26,9 +26,9 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string ../../../intern/guardedalloc + ../../../intern/container ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer ../../../intern/audaspace/intern ../../../source/gameengine/Converter diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index a0d58ece396..684ed0b06f9 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -50,7 +50,7 @@ #include "KX_PolygonMaterial.h" -#include "SYS_System.h" +#include "BL_System.h" #include "DummyPhysicsEnvironment.h" @@ -1126,7 +1126,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie) /* incase the mesh might be refered to later */ { - GEN_Map<STR_HashedString,void*> &mapStringToMeshes = scene->GetLogicManager()->GetMeshMap(); + CTR_Map<STR_HashedString,void*> &mapStringToMeshes = scene->GetLogicManager()->GetMeshMap(); for(int i=0; i<mapStringToMeshes.size(); i++) { @@ -1143,7 +1143,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie) /* Now unregister actions */ { - GEN_Map<STR_HashedString,void*> &mapStringToActions = scene->GetLogicManager()->GetActionMap(); + CTR_Map<STR_HashedString,void*> &mapStringToActions = scene->GetLogicManager()->GetActionMap(); for(int i=0; i<mapStringToActions.size(); i++) { diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 741b3ea8757..2340e44d288 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -35,7 +35,7 @@ #define __KX_BLENDERSCENECONVERTER_H #include "KX_HashedPtr.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include <stdio.h> #include "KX_ISceneConverter.h" @@ -61,12 +61,12 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter // Should also have a list of collision shapes. // For the time being this is held in KX_Scene::m_shapes - GEN_Map<CHashedPtr,KX_GameObject*> m_map_blender_to_gameobject; /* cleared after conversion */ - GEN_Map<CHashedPtr,RAS_MeshObject*> m_map_mesh_to_gamemesh; /* cleared after conversion */ - GEN_Map<CHashedPtr,SCA_IActuator*> m_map_blender_to_gameactuator; /* cleared after conversion */ - GEN_Map<CHashedPtr,SCA_IController*>m_map_blender_to_gamecontroller; /* cleared after conversion */ + CTR_Map<CHashedPtr,KX_GameObject*> m_map_blender_to_gameobject; /* cleared after conversion */ + CTR_Map<CHashedPtr,RAS_MeshObject*> m_map_mesh_to_gamemesh; /* cleared after conversion */ + CTR_Map<CHashedPtr,SCA_IActuator*> m_map_blender_to_gameactuator; /* cleared after conversion */ + CTR_Map<CHashedPtr,SCA_IController*>m_map_blender_to_gamecontroller; /* cleared after conversion */ - GEN_Map<CHashedPtr,BL_InterpolatorList*> m_map_blender_to_gameAdtList; + CTR_Map<CHashedPtr,BL_InterpolatorList*> m_map_blender_to_gameAdtList; Main* m_maggie; vector<struct Main*> m_DynamicMaggie; diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp index d3d17bbe433..02c259d793b 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp @@ -41,8 +41,8 @@ #include "KX_ConvertPhysicsObject.h" #include "KX_SoftBodyDeformer.h" #include "RAS_MeshObject.h" -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" #ifdef USE_BULLET @@ -53,7 +53,7 @@ #include "KX_BulletPhysicsController.h" #include "btBulletDynamicsCommon.h" -void KX_SoftBodyDeformer::Relink(GEN_Map<class GEN_HashedPtr, void*>*map) +void KX_SoftBodyDeformer::Relink(CTR_Map<class CTR_HashedPtr, void*>*map) { void **h_obj = (*map)[m_gameobj]; diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.h b/source/gameengine/Converter/KX_SoftBodyDeformer.h index aa4ff9d5e54..67eb9d7b285 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.h +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.h @@ -60,7 +60,7 @@ public: { //printf("~KX_SoftBodyDeformer\n"); }; - virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map); + virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map); virtual bool Apply(class RAS_IPolyMaterial *polymat); virtual bool Update(void) { diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 9d88018d805..9cfc3410748 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.cpp') defs = [] -incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc' +incs = '. #intern/string #intern/guardedalloc #intern/container' incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer' incs += ' #intern/audaspace/intern #source/gameengine/Converter' incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf' diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index c593c690614..8cda0e2dc77 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -26,7 +26,6 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string ../../../intern/guardedalloc ../../../intern/moto/include diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index b1e34aa358b..4dc165a7696 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs ='. #source/kernel/gen_system #intern/guardedalloc #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' +incs ='. #intern/guardedalloc #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' defs = [] diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index 793b8e7eed8..2acf07584b1 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -26,8 +26,8 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string + ../../../intern/container ../../../source/gameengine/Expressions ../../../source/gameengine/SceneGraph ../../../intern/moto/include diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 2d0cb16b63c..596118855d2 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -78,7 +78,7 @@ void SCA_ILogicBrick::ReParent(SCA_IObject* parent) m_gameobj = parent; } -void SCA_ILogicBrick::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void SCA_ILogicBrick::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { // nothing to do } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index e74cd601b6b..4de0562339e 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -37,8 +37,8 @@ #include "Value.h" #include "SCA_IObject.h" #include "BoolValue.h" -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" class NG_NetworkScene; class SCA_IScene; @@ -70,7 +70,7 @@ public: SCA_IObject* GetParent() { return m_gameobj; } virtual void ReParent(SCA_IObject* parent); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual void Delete() { Release(); } // act as a BoolValue (with value IsPositiveTrigger) diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 44dc12a8fd4..c4735d1c146 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -38,12 +38,12 @@ #endif #include <vector> -//#include "GEN_Map.h" +//#include "CTR_Map.h" #include <set> #include <map> #include <list> -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "Value.h" #include "SG_QList.h" @@ -85,12 +85,12 @@ class SCA_LogicManager // need to find better way for this // also known as FactoryManager... - GEN_Map<STR_HashedString,CValue*> m_mapStringToGameObjects; - GEN_Map<STR_HashedString,void*> m_mapStringToMeshes; - GEN_Map<STR_HashedString,void*> m_mapStringToActions; + CTR_Map<STR_HashedString,CValue*> m_mapStringToGameObjects; + CTR_Map<STR_HashedString,void*> m_mapStringToMeshes; + CTR_Map<STR_HashedString,void*> m_mapStringToActions; - GEN_Map<STR_HashedString,void*> m_map_gamemeshname_to_blendobj; - GEN_Map<CHashedPtr,void*> m_map_blendobj_to_gameobj; + CTR_Map<STR_HashedString,void*> m_map_gamemeshname_to_blendobj; + CTR_Map<CHashedPtr,void*> m_map_blendobj_to_gameobj; public: SCA_LogicManager(); virtual ~SCA_LogicManager(); @@ -129,8 +129,8 @@ public: // for the scripting... needs a FactoryManager later (if we would have time... ;) void RegisterMeshName(const STR_String& meshname,void* mesh); void UnregisterMeshName(const STR_String& meshname,void* mesh); - GEN_Map<STR_HashedString,void*>& GetMeshMap() { return m_mapStringToMeshes; }; - GEN_Map<STR_HashedString,void*>& GetActionMap() { return m_mapStringToActions; }; + CTR_Map<STR_HashedString,void*>& GetMeshMap() { return m_mapStringToMeshes; }; + CTR_Map<STR_HashedString,void*>& GetActionMap() { return m_mapStringToActions; }; void RegisterActionName(const STR_String& actname,void* action); diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 008e109384c..a4af1c35652 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -213,7 +213,7 @@ bool SCA_PropertyActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void SCA_PropertyActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_sourceObj]; if (h_obj) { diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index 1ca7b1c4e1e..35660710679 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -77,7 +77,7 @@ public: virtual void ProcessReplica(); virtual bool UnlinkObject(SCA_IObject* clientobj); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool Update(); diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index a8d3ee65f4c..d6323882267 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') + env.Glob('Joystick/*.cpp') -incs = '. #/source/kernel/gen_system #/intern/string' +incs = '. #/intern/string #intern/container' incs += ' #/source/gameengine/Expressions #/intern/moto/include' incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph' diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt index 604dd9296a1..afbc49ea38d 100644 --- a/source/gameengine/GamePlayer/common/CMakeLists.txt +++ b/source/gameengine/GamePlayer/common/CMakeLists.txt @@ -29,11 +29,11 @@ set(INC ../../../../intern/string ../../../../intern/ghost ../../../../intern/guardedalloc + ../../../../intern/container ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../../source/kernel/gen_system - ../../../../source/kernel/gen_messaging ../../../../source/gameengine/Converter + ../../../../source/gameengine/BlenderRoutines ../../../../source/blender/imbuf ../../../../source/gameengine/Ketsji ../../../../source/blender/blenlib diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index 48ebfcaadf2..fc007d8d295 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -50,7 +50,7 @@ // include files needed by "KX_BlenderSceneConverter.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "SCA_IActuator.h" #include "RAS_MeshObject.h" diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index f7a423f4588..d5e1f081d21 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -19,10 +19,10 @@ incs = ['.', '#intern/ghost', '#intern/guardedalloc', '#intern/moto/include', + '#intern/container', '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer', - '#source/kernel/gen_system', - '#source/kernel/gen_messaging', '#source/gameengine/Converter', + '#source/gameengine/BlenderRoutines', '#source/blender/imbuf', '#source/gameengine/Ketsji', '#source/blender/blenlib', diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index a88de69b272..edf0839f747 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -29,10 +29,10 @@ set(INC ../../../../intern/string ../../../../intern/ghost ../../../../intern/guardedalloc + ../../../../intern/container ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../../source/kernel/gen_system - ../../../../source/kernel/gen_messaging + ../../../../source/gameengine/BlenderRoutines ../../../../source/gameengine/Converter ../../../../source/blender/imbuf ../../../../source/gameengine/Ketsji diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index e00a890a1fb..6487d0298c7 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -69,11 +69,11 @@ extern "C" **********************************/ -#include "SYS_System.h" +#include "BL_System.h" #include "KX_KetsjiEngine.h" // include files needed by "KX_BlenderSceneConverter.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "SCA_IActuator.h" #include "RAS_MeshObject.h" #include "RAS_OpenGLRasterizer.h" @@ -233,7 +233,8 @@ static HWND findGhostWindowHWND(GHOST_IWindow* window) bool GPG_Application::startScreenSaverPreview( HWND parentWindow, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success = false; @@ -245,7 +246,7 @@ bool GPG_Application::startScreenSaverPreview( STR_String title = ""; m_mainWindow = fSystem->createWindow(title, 0, 0, windowWidth, windowHeight, GHOST_kWindowStateMinimized, - GHOST_kDrawingContextTypeOpenGL, stereoVisual); + GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples); if (!m_mainWindow) { printf("error: could not create main window\n"); exit(-1); @@ -287,9 +288,10 @@ bool GPG_Application::startScreenSaverFullScreen( int height, int bpp,int frequency, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { - bool ret = startFullScreen(width, height, bpp, frequency, stereoVisual, stereoMode); + bool ret = startFullScreen(width, height, bpp, frequency, stereoVisual, stereoMode, samples); if (ret) { HWND ghost_hwnd = findGhostWindowHWND(m_mainWindow); @@ -311,13 +313,14 @@ bool GPG_Application::startWindow(STR_String& title, int windowWidth, int windowHeight, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success; // Create the main window //STR_String title ("Blender Player - GHOST"); m_mainWindow = fSystem->createWindow(title, windowLeft, windowTop, windowWidth, windowHeight, GHOST_kWindowStateNormal, - GHOST_kDrawingContextTypeOpenGL, stereoVisual); + GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples); if (!m_mainWindow) { printf("error: could not create main window\n"); exit(-1); @@ -339,10 +342,13 @@ bool GPG_Application::startWindow(STR_String& title, bool GPG_Application::startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parentWindow, const bool stereoVisual, - const int stereoMode) { - - m_mainWindow = fSystem->createWindow(title, 0, 0, 0, 0, GHOST_kWindowStateNormal, - GHOST_kDrawingContextTypeOpenGL, stereoVisual, parentWindow); + const int stereoMode, + const GHOST_TUns16 samples) { + GHOST_TWindowState state = GHOST_kWindowStateNormal; + if (parentWindow != 0) + state = GHOST_kWindowStateEmbedded; + m_mainWindow = fSystem->createWindow(title, 0, 0, 0, 0, state, + GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples, parentWindow); if (!m_mainWindow) { printf("error: could not create main window\n"); @@ -363,7 +369,8 @@ bool GPG_Application::startFullScreen( int height, int bpp,int frequency, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success; // Create the main window diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 850b34d5b69..c0638517657 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -63,12 +63,12 @@ public: bool SetGameEngineData(struct Main* maggie, struct Scene* scene, int argc, char** argv); bool startWindow(STR_String& title, int windowLeft, int windowTop, int windowWidth, int windowHeight, - const bool stereoVisual, const int stereoMode); - bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode); - bool startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parent_window, const bool stereoVisual, const int stereoMode); + const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); + bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); + bool startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parent_window, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); #ifdef WIN32 - bool startScreenSaverFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode); - bool startScreenSaverPreview(HWND parentWindow, const bool stereoVisual, const int stereoMode); + bool startScreenSaverFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); + bool startScreenSaverPreview(HWND parentWindow, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); #endif virtual bool processEvent(GHOST_IEvent* event); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 968d6caeb1c..a4f1391b1b0 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -47,7 +47,6 @@ //#include <Carbon/Carbon.h> //#include <CFBundle.h> #endif // __APPLE__ -#include "GEN_messaging.h" #include "KX_KetsjiEngine.h" #include "KX_PythonInit.h" @@ -92,7 +91,7 @@ extern char datatoc_bfont_ttf[]; * End Blender include block **********************************/ -#include "SYS_System.h" +#include "BL_System.h" #include "GPG_Application.h" #include "GHOST_ISystem.h" @@ -199,7 +198,7 @@ void usage(const char* program, bool isBlenderPlayer) } printf("usage: %s [-w [w h l t]] [-f [fw fh fb ff]] %s[-g gamengineoptions] " - "[-s stereomode] %s\n", program, consoleoption, filename); + "[-s stereomode] [-m aasamples] %s\n", program, consoleoption, filename); printf(" -h: Prints this command summary\n\n"); printf(" -w: display in a window\n"); printf(" --Optional parameters--\n"); @@ -235,9 +234,8 @@ void usage(const char* program, bool isBlenderPlayer) printf(" cubemap (Cube Map)\n"); printf(" sphericalpanoramic (Spherical Panoramic)\n"); printf(" depending on the type of dome you are using\n\n"); -#ifndef _WIN32 + printf(" -m: maximum anti-aliasing (eg. 2,4,8,16)\n\n"); printf(" -i: parent windows ID \n\n"); -#endif #ifdef _WIN32 printf(" -c: keep console window open\n\n"); #endif @@ -257,6 +255,7 @@ void usage(const char* program, bool isBlenderPlayer) printf("\n"); printf("example: %s -w 320 200 10 10 -g noaudio%s%s\n", program, pathname, filename); printf("example: %s -g show_framerate = 0 %s%s\n", program, pathname, filename); + printf("example: %s -i 232421 -m 16 %s%s\n\n", program, pathname, filename); } static void get_filename(int argc, char **argv, char *filename) @@ -367,6 +366,7 @@ int main(int argc, char** argv) GHOST_TEmbedderWindowID parentWindow = 0; bool isBlenderPlayer = false; int validArguments=0; + GHOST_TUns16 aasamples = 0; #ifdef __linux__ #ifdef __alpha__ @@ -402,8 +402,6 @@ int main(int argc, char** argv) initglobals(); - GEN_init_messaging_system(); - IMB_init(); // Setup builtin font for BLF (mostly copied from creator.c, wm_init_exit.c and interface_style.c) @@ -553,7 +551,6 @@ int main(int argc, char** argv) usage(argv[0], isBlenderPlayer); return 0; break; -#ifndef _WIN32 case 'i': i++; if ( (i + 1) <= validArguments ) @@ -562,12 +559,15 @@ int main(int argc, char** argv) error = true; printf("error: too few options for parent window argument.\n"); } - #if defined(DEBUG) printf("XWindows ID = %d\n", parentWindow); #endif // defined(DEBUG) - -#endif // _WIN32 + break; + case 'm': + i++; + if ((i+1) <= validArguments ) + aasamples = atoi(argv[i++]); + break; case 'c': i++; closeConsole = false; @@ -857,13 +857,13 @@ int main(int argc, char** argv) if (scr_saver_mode == SCREEN_SAVER_MODE_SAVER) { app.startScreenSaverFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency, - stereoWindow, stereomode); + stereoWindow, stereomode, aasamples); } else #endif { app.startFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency, - stereoWindow, stereomode); + stereoWindow, stereomode, aasamples); } } else @@ -903,16 +903,16 @@ int main(int argc, char** argv) #ifdef WIN32 if (scr_saver_mode == SCREEN_SAVER_MODE_PREVIEW) { - app.startScreenSaverPreview(scr_saver_hwnd, stereoWindow, stereomode); + app.startScreenSaverPreview(scr_saver_hwnd, stereoWindow, stereomode, aasamples); } else #endif { if (parentWindow != 0) - app.startEmbeddedWindow(title, parentWindow, stereoWindow, stereomode); + app.startEmbeddedWindow(title, parentWindow, stereoWindow, stereomode, aasamples); else app.startWindow(title, windowLeft, windowTop, windowWidth, windowHeight, - stereoWindow, stereomode); + stereoWindow, stereomode, aasamples); } } } diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 7c8f1c6f4f0..65bd55f95d7 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -13,9 +13,9 @@ incs = ['.', '#intern/ghost', '#intern/guardedalloc', '#intern/moto/include', + '#intern/container', '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer', - '#source/kernel/gen_system', - '#source/kernel/gen_messaging', + '#source/gameengine/BlenderRoutines', '#source/gameengine/Converter', '#source/blender/imbuf', '#source/gameengine/Ketsji', diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index d5ea39f5b35..0bfe1fd0266 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -26,11 +26,12 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string ../../../intern/guardedalloc + ../../../intern/container ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer ../../../source/gameengine/Converter + ../../../source/gameengine/BlenderRoutines ../../../source/blender/imbuf ../../../intern/moto/include ../../../source/gameengine/Ketsji diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index 5f251c832ee..17a5929420d 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -26,8 +26,8 @@ set(INC . - ../../../../source/kernel/gen_system ../../../../intern/string + ../../../../intern/container ../../../../intern/moto/include ../../../../source/gameengine/Ketsji ../../../../source/gameengine/GameLogic diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index 8ad1949bbc4..ac657e106b8 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -3,7 +3,8 @@ Import ('env') sources = env.Glob('*.cpp') -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Ketsji' +incs = '. #intern/string #intern/moto/include' +incs += ' #source/gameengine/Ketsji #intern/container' incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions' incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 17dfe9474a8..d68cb453fe8 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -101,7 +101,7 @@ bool KX_CameraActuator::UnlinkObject(SCA_IObject* clientobj) } -void KX_CameraActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_CameraActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_ob]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 135a9cad9d8..d59fcff9370 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -116,7 +116,7 @@ private : virtual bool UnlinkObject(SCA_IObject* clientobj); /** Methods inherited from SCA_ILogicBrick */ - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); #ifdef WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index b7cc98bd539..7bd8c445849 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -42,13 +42,13 @@ #include "BL_DeformableGameObject.h" #include "RAS_MeshObject.h" #include "KX_Scene.h" -#include "SYS_System.h" +#include "BL_System.h" #include "PHY_Pro.h" //todo cleanup #include "KX_ClientObjectInfo.h" -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" #include "KX_PhysicsEngineEnums.h" #include "PHY_Pro.h" diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 85d09d9f5d5..47d83c16659 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -156,7 +156,7 @@ KX_GameObject::~KX_GameObject() } #ifdef WITH_PYTHON if (m_attr_dict) { - PyDict_Clear(m_attr_dict); /* incase of circular refs or other weired cases */ + PyDict_Clear(m_attr_dict); /* incase of circular refs or other weird cases */ /* Py_CLEAR: Py_DECREF's and NULL's */ Py_CLEAR(m_attr_dict); } @@ -1224,7 +1224,7 @@ CListValue* KX_GameObject::GetChildrenRecursive() /* --------------------------------------------------------------------- * Some stuff taken from the header * --------------------------------------------------------------------- */ -void KX_GameObject::Relink(GEN_Map<GEN_HashedPtr, void*> *map_parameter) +void KX_GameObject::Relink(CTR_Map<CTR_HashedPtr, void*> *map_parameter) { // we will relink the sensors and actuators that use object references // if the object is part of the replicated hierarchy, use the new diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index b54fb6b068e..50fbebe1341 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -47,8 +47,8 @@ #include "SG_Node.h" #include "MT_Transform.h" #include "MT_CmMatrix4x4.h" -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" #include "KX_Scene.h" #include "KX_KetsjiEngine.h" /* for m_anim_framerate */ #include "KX_IPhysicsController.h" /* for suspend/resume */ @@ -142,7 +142,7 @@ public: virtual void /* This function should be virtual - derived classed override it */ Relink( - GEN_Map<GEN_HashedPtr, void*> *map + CTR_Map<CTR_HashedPtr, void*> *map ); /** diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 8c3e25cf3e2..7289ffc6e29 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -299,7 +299,7 @@ bool KX_ObjectActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void KX_ObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_ObjectActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_reference]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index e45ce899bfc..0737535b84c 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -144,7 +144,7 @@ public: CValue* GetReplica(); void ProcessReplica(); bool UnlinkObject(SCA_IObject* clientobj); - void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); void SetForceLoc(const double force[3]) { /*m_force=force;*/ } void UpdateFuzzyFlags() diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 6ff1c05b994..a73f4c38627 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -99,7 +99,7 @@ bool KX_ParentActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void KX_ParentActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_ParentActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_ob]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 8723f83920e..a850cc72eb9 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -76,7 +76,7 @@ class KX_ParentActuator : public SCA_IActuator virtual CValue* GetReplica(); virtual void ProcessReplica(); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool UnlinkObject(SCA_IObject* clientobj); #ifdef WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index ba698d79fdd..a3738995db3 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1758,6 +1758,7 @@ static struct _inittab bge_internal_modules[]= { /** * Python is not initialised. + * see bpy_interface.c's BPY_python_start() which shares the same functionality in blender. */ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv) { @@ -1779,6 +1780,9 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur /* must run before python initializes */ PyImport_ExtendInittab(bge_internal_modules); + /* find local python installation */ + PyC_SetHomePath(BLI_get_folder(BLENDER_PYTHON, NULL)); + Py_Initialize(); if(argv && first_time) { /* browser plugins dont currently set this */ diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 521c0038f27..62a51fb4efc 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -151,7 +151,7 @@ bool KX_SCA_AddObjectActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void KX_SCA_AddObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_SCA_AddObjectActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_OriginalObject]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 11f210ad7b5..a8304667b66 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -108,7 +108,7 @@ public: UnlinkObject(SCA_IObject* clientobj); virtual void - Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool Update(); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 4a379f46440..28dc660037c 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -67,7 +67,7 @@ #include "SCA_IController.h" #include "SCA_IActuator.h" #include "SG_Node.h" -#include "SYS_System.h" +#include "BL_System.h" #include "SG_Controller.h" #include "SG_IObject.h" #include "SG_Tree.h" @@ -1514,7 +1514,7 @@ void KX_Scene::LogicUpdateFrame(double curtime, bool frame) void KX_Scene::LogicEndFrame() { m_logicmgr->EndFrame(); - int numobj = m_euthanasyobjects->GetCount(); + int numobj; KX_GameObject* obj; diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index af6a31e786c..367bf0b82da 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -41,8 +41,8 @@ #include <set> #include <list> -#include "GEN_Map.h" -#include "GEN_HashedPtr.h" +#include "CTR_Map.h" +#include "CTR_HashedPtr.h" #include "SG_IObject.h" #include "SCA_IScene.h" #include "MT_Transform.h" @@ -61,7 +61,7 @@ struct SM_MaterialProps; struct SM_ShapeProps; struct Scene; -class GEN_HashedPtr; +class CTR_HashedPtr; class CListValue; class CValue; class SCA_LogicManager; @@ -207,7 +207,7 @@ protected: * used in AddReplicaObject to map game objects to their * replicas so pointers can be updated. */ - GEN_Map <GEN_HashedPtr, void*> m_map_gameobject_to_replica; + CTR_Map <CTR_HashedPtr, void*> m_map_gameobject_to_replica; /** * Another temporary variable outstaying its welcome diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 8312a14ebfb..f572f8eb36d 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -97,7 +97,7 @@ bool KX_SceneActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void KX_SceneActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_SceneActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_camera]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 563255d1560..288f4acc280 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -85,7 +85,7 @@ class KX_SceneActuator : public SCA_IActuator virtual CValue* GetReplica(); virtual void ProcessReplica(); virtual bool UnlinkObject(SCA_IObject* clientobj); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool Update(); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 5530fa286cf..edcba969811 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -219,7 +219,7 @@ bool KX_TrackToActuator::UnlinkObject(SCA_IObject* clientobj) return false; } -void KX_TrackToActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) +void KX_TrackToActuator::Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map) { void **h_obj = (*obj_map)[m_object]; if (h_obj) { diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 33780bf53e4..c5e96bd7454 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -67,7 +67,7 @@ class KX_TrackToActuator : public SCA_IActuator virtual void ProcessReplica(); virtual bool UnlinkObject(SCA_IObject* clientobj); - virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); + virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); virtual bool Update(double curtime, bool frame); #ifdef WITH_PYTHON diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 980d42d5d1f..5fd77aa51d6 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -8,7 +8,7 @@ defs = [ 'GLEW_STATIC' ] incs = '. #source/blender/python/generic' # Only for Mathutils! and bpy_internal_import.h, be very careful -incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc' +incs += ' #intern/string #intern/guardedalloc #intern/container' incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer' incs += ' #intern/audaspace/intern #source/gameengine/Converter' incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf #intern/moto/include' diff --git a/source/gameengine/Network/CMakeLists.txt b/source/gameengine/Network/CMakeLists.txt index 6a2b5fe841e..7f4c7c357da 100644 --- a/source/gameengine/Network/CMakeLists.txt +++ b/source/gameengine/Network/CMakeLists.txt @@ -26,8 +26,8 @@ set(INC . - ../../../source/kernel/gen_system ../../../intern/string + ../../../intern/container ../../../intern/moto/include ) diff --git a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt index 4cf43a1fc93..d7b88304474 100644 --- a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt +++ b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt @@ -26,8 +26,8 @@ set(INC . - ../../../../source/kernel/gen_system ../../../../intern/string + ../../../../intern/container ../../../../source/gameengine/Network ) diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript index af76065cc94..7ca0a64f774 100644 --- a/source/gameengine/Network/LoopBackNetwork/SConscript +++ b/source/gameengine/Network/LoopBackNetwork/SConscript @@ -3,6 +3,6 @@ Import ('env') sources = 'NG_LoopBackNetworkDeviceInterface.cpp' -incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network' +incs = '. #intern/string #intern/container #source/gameengine/Network' env.BlenderLib ( 'ge_logic_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core','player'], priority=[400,135] ) diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h index d390eabc465..ebe50d36b46 100644 --- a/source/gameengine/Network/NG_NetworkScene.h +++ b/source/gameengine/Network/NG_NetworkScene.h @@ -34,7 +34,7 @@ #ifndef __NG_NETWORKSCENE_H #define __NG_NETWORKSCENE_H -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include <vector> @@ -52,10 +52,10 @@ class NG_NetworkDeviceInterface; class NG_NetworkScene { class NG_NetworkDeviceInterface *m_networkdevice; - GEN_Map<STR_HashedString, class NG_NetworkObject *> m_networkObjects; + CTR_Map<STR_HashedString, class NG_NetworkObject *> m_networkObjects; - // GEN_Maps used as a 'Bloom' filter - typedef GEN_Map<STR_HashedString, std::vector<class NG_NetworkMessage*>* > TMessageMap; + // CTR_Maps used as a 'Bloom' filter + typedef CTR_Map<STR_HashedString, std::vector<class NG_NetworkMessage*>* > TMessageMap; TMessageMap m_messagesByDestinationName; TMessageMap m_messagesBySenderName; TMessageMap m_messagesBySubject; diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript index 1b63592d0a4..bbf714383b7 100644 --- a/source/gameengine/Network/SConscript +++ b/source/gameengine/Network/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_NetworkScene.cpp' -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include' +incs = '. #intern/string #intern/moto/include #intern/container' defs = [] diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index cc469c3772a..a984d0436f0 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -33,7 +33,7 @@ set(INC ../../../../extern/bullet2/src ../../../../intern/moto/include ../../../../intern/guardedalloc - ../../../kernel/gen_system + ../../../../intern/container ../../../../intern/string ../../Rasterizer ../../Ketsji diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 00ecc64c41e..97dc65c5850 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -252,8 +252,40 @@ struct CcdConstructionInfo m_inertiaFactor(1.f), m_do_anisotropic(false), m_anisotropicFriction(1.f,1.f,1.f), - m_contactProcessingThreshold(1e10) + m_contactProcessingThreshold(1e10f), + m_soft_linStiff(1.f), + m_soft_angStiff(1.f), + m_soft_volume(1.f), + m_soft_viterations(0), + m_soft_piterations(1), + m_soft_diterations(0), + m_soft_citerations(4), + m_do_fh(false), + m_do_rot_fh(false), + m_fh_spring(0.f), + m_fh_damping(0.f), + m_fh_distance(1.f), + m_fh_normal(false), + m_soft_kVCF(1.f), + m_soft_kDG(0.f), + m_soft_kLF(0.f), + m_soft_kDP(0.f), + m_soft_kPR(0.f), + m_soft_kVC(0.f), + m_soft_kDF(0.2f), + m_soft_kMT(0), + m_soft_kCHR(1.0f), + m_soft_kKHR(0.1f), + m_soft_kSHR(1.0f), + m_soft_kAHR(0.7f), + m_soft_kSRHR_CL(0.1f), + m_soft_kSKHR_CL(1.f), + m_soft_kSSHR_CL(0.5f), + m_soft_kSR_SPLT_CL(0.5f), + m_soft_kSK_SPLT_CL(0.5f), + m_soft_kSS_SPLT_CL(0.5f) { + } btVector3 m_localInertiaTensor; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index c87157ee993..416cef71067 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -592,6 +592,9 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep,float float subStep = timeStep / float(m_numTimeSubSteps); i = m_dynamicsWorld->stepSimulation(interval,25,subStep);//perform always a full simulation step +//uncomment next line to see where Bullet spend its time (printf in console) +//CProfileManager::dumpAll(); + processFhSprings(curTime,i*subStep); for (it=m_controllers.begin(); it!=m_controllers.end(); it++) @@ -2759,7 +2762,8 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float coneradius,float coneheight) { CcdConstructionInfo cinfo; - memset(&cinfo, 0, sizeof(cinfo)); /* avoid uninitialized values */ +//don't memset cinfo: this is C++ and values should be set in the constructor! + // we don't need a CcdShapeConstructionInfo for this shape: // it is simple enough for the standard copy constructor (see CcdPhysicsController::GetReplica) cinfo.m_collisionShape = new btConeShape(coneradius,coneheight); diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index f8f0f8afaea..ba4db001533 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -4,7 +4,6 @@ Import ('env') sources = 'CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp CcdGraphicController.cpp' incs = '. ../common' -incs += ' #source/kernel/gen_system' incs += ' #intern/string' incs += ' #intern/moto/include' incs += ' #extern/glew/include' @@ -17,6 +16,7 @@ incs += ' #source/blender/makesdna' incs += ' #source/blender/blenkernel' incs += ' #source/blender/blenlib' incs += ' #intern/guardedalloc' +incs += ' #intern/container' incs += ' ' + env['BF_BULLET_INC'] diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 7e2fda177d7..2bfb3f8f328 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -26,11 +26,11 @@ set(INC . - ../../../source/kernel/gen_system ../../../source/blender/makesdna ../../../source/gameengine/SceneGraph ../../../source/gameengine/Ketsji ../../../intern/string + ../../../intern/container ../../../intern/moto/include ../../../intern/guardedalloc ../Expressions diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 8c9f5e9786b..6316b119588 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -36,7 +36,7 @@ #pragma warning (disable:4786) #endif -#include "GEN_Map.h" +#include "CTR_Map.h" #include "RAS_MaterialBucket.h" #include "STR_HashedString.h" #include "RAS_MeshObject.h" diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 297782bd4fe..8a9f21d5db7 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -36,7 +36,7 @@ #include "MT_Transform.h" #include "RAS_MaterialBucket.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include <vector> diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 8678830f6a2..c7a32b38e04 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -39,7 +39,7 @@ #endif //WIN32 #include <stdlib.h> -#include "GEN_Map.h" +#include "CTR_Map.h" #ifdef WITH_CXX_GUARDEDALLOC #include "MEM_guardedalloc.h" @@ -53,7 +53,7 @@ class RAS_Deformer public: RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {}; virtual ~RAS_Deformer(){}; - virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map)=0; + virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; virtual bool Update(void)=0; virtual bool UpdateBuckets(void)=0; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index c46a36768ee..51c430dd57b 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -35,7 +35,7 @@ #define __RAS_MATERIALBUCKET #include "RAS_TexVert.h" -#include "GEN_Map.h" +#include "CTR_Map.h" #include "STR_HashedString.h" #include "SG_QList.h" @@ -193,7 +193,7 @@ class RAS_MeshMaterial public: RAS_MeshSlot *m_baseslot; class RAS_MaterialBucket *m_bucket; - GEN_Map<GEN_HashedPtr,RAS_MeshSlot*> m_slots; + CTR_Map<CTR_HashedPtr,RAS_MeshSlot*> m_slots; #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 0b35b212e1d..555a290ba6f 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -47,7 +47,7 @@ #include "RAS_MaterialBucket.h" #include "MT_Transform.h" -#include "GEN_HashedPtr.h" +#include "CTR_HashedPtr.h" struct Mesh; class RAS_Deformer; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index 7c1dd8a2de8..99068aa1bb8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -25,12 +25,13 @@ # ***** END GPL LICENSE BLOCK ***** set(INC - ../../../../source/kernel/gen_system ../../../../intern/string + ../../../../intern/container ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer ../../../../source/gameengine/Ketsji ../../../../source/gameengine/SceneGraph + ../../../../source/gameengine/BlenderRoutines ../../../../source/blender/gpu ../../../../source/blender/makesdna ../../../../source/blender/blenkernel diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 4eeb6796c14..55f36dcd772 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -303,6 +303,8 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time) glShadeModel(GL_SMOOTH); + glEnable(GL_MULTISAMPLE_ARB); + m_2DCanvas->BeginFrame(); return true; @@ -387,6 +389,9 @@ void RAS_OpenGLRasterizer::EndFrame() FlushDebugLines(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + + glDisable(GL_MULTISAMPLE_ARB); + m_2DCanvas->EndFrame(); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 890d1efb850..5f3af7360ff 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -5,10 +5,10 @@ sources = env.Glob('*.cpp') defs = [ 'GLEW_STATIC' ] -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines ' -incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] +incs = '. #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines ' +incs += ' #intern/container #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' -incs += ' #intern/guardedalloc #source/blender/blenlib' +incs += ' #intern/guardedalloc #source/blender/blenlib #source/gameengine/BlenderRoutines' if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index 4eda01a04b6..2db42f8285f 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs = '. #intern/guardedalloc #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' +incs = '. #intern/guardedalloc #intern/string #intern/moto/include #intern/container #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' defs = [ 'GLEW_STATIC' ] diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index aae57fce679..fb10b619f17 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -41,7 +41,7 @@ set(INC ../../../source/blender/python ../../../source/blender/python/generic ../../../source/blender/gpu - ../../../source/kernel/gen_system + ../../../intern/container ../../../intern/string ../../../intern/moto/include ../../../intern/guardedalloc diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index 2cd143d2deb..5091082e87a 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -11,8 +11,8 @@ incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer' incs += ' #source/gameengine/BlenderRoutines' incs += ' #source/blender/editors/include #source/blender/blenlib #source/blender/blenkernel' incs += ' #source/blender/makesdna #source/blender/imbuf #source/blender/python #source/blender/python/generic' -incs += ' #source/blender/gpu #source/kernel/gen_system #intern/string #intern/moto/include' -incs += ' #intern/guardedalloc #extern/glew/include' +incs += ' #source/blender/gpu #intern/string #intern/moto/include' +incs += ' #intern/guardedalloc #intern/container #extern/glew/include' defs = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw'): |