Skip to content

Commit

Permalink
UPBGE: Remove usage of using namespace std.
Browse files Browse the repository at this point in the history
All namespace should be used with absolute name externally to avoid
conflicts.
  • Loading branch information
panzergame committed Nov 6, 2016
1 parent e91928c commit 996ab30
Show file tree
Hide file tree
Showing 39 changed files with 101 additions and 139 deletions.
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_ActionActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void BL_ActionActuator::SetLocalTime(float curtime)
m_localtime = m_startframe + dt;

// Handle wrap around
if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe))
if (m_localtime < std::min(m_startframe, m_endframe) || m_localtime > std::max(m_startframe, m_endframe))
{
switch (m_playtype) {
case ACT_ACTION_PLAY:
Expand Down
20 changes: 10 additions & 10 deletions source/gameengine/Converter/BL_BlenderDataConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ static KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist)
static void bl_ConvertBlenderObject_Single(
KX_BlenderSceneConverter *converter,
Object *blenderobject,
vector<parentChildLink> &vec_parent_child,
std::vector<parentChildLink> &vec_parent_child,
CListValue* logicbrick_conversionlist,
CListValue* objectlist, CListValue* inactivelist, CListValue* sumolist,
KX_Scene* kxscene, KX_GameObject* gameobj,
Expand Down Expand Up @@ -1352,9 +1352,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
RAS_FrameSettings::RAS_FrameType frame_type;
int aspect_width;
int aspect_height;
set<Group*> grouplist; // list of groups to be converted
set<Object*> allblobj; // all objects converted
set<Object*> groupobj; // objects from groups (never in active layer)
std::set<Group*> grouplist; // list of groups to be converted
std::set<Object*> allblobj; // all objects converted
std::set<Object*> groupobj; // objects from groups (never in active layer)

/* We have to ensure that group definitions are only converted once
* push all converted group members to this set.
Expand Down Expand Up @@ -1414,7 +1414,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
// list of all object converted, active and inactive
CListValue* sumolist = new CListValue();

vector<parentChildLink> vec_parent_child;
std::vector<parentChildLink> vec_parent_child;

CListValue* objectlist = kxscene->GetObjectList();
CListValue* inactivelist = kxscene->GetInactiveList();
Expand Down Expand Up @@ -1478,12 +1478,12 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
{
// now convert the group referenced by dupli group object
// keep track of all groups already converted
set<Group*> allgrouplist = grouplist;
set<Group*> tempglist;
std::set<Group*> allgrouplist = grouplist;
std::set<Group*> tempglist;
// recurse
while (!grouplist.empty())
{
set<Group*>::iterator git;
std::set<Group*>::iterator git;
tempglist.clear();
tempglist.swap(grouplist);
for (git=tempglist.begin(); git!=tempglist.end(); git++)
Expand Down Expand Up @@ -1540,7 +1540,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}

// Set up armatures
set<Object*>::iterator oit;
std::set<Object*>::iterator oit;
for (oit=allblobj.begin(); oit!=allblobj.end(); oit++)
{
Object* blenderobj = *oit;
Expand All @@ -1561,7 +1561,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,

// create hierarchy information
int i;
vector<parentChildLink>::iterator pcit;
std::vector<parentChildLink>::iterator pcit;

for (pcit = vec_parent_child.begin();!(pcit==vec_parent_child.end());++pcit)
{
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_DeformableGameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool BL_DeformableGameObject::SetActiveAction(short priority, double curtime)
}
}

bool BL_DeformableGameObject::GetShape(vector<float> &shape)
bool BL_DeformableGameObject::GetShape(std::vector<float> &shape)
{
shape.clear();
BL_ShapeDeformer* shape_deformer = dynamic_cast<BL_ShapeDeformer*>(m_pDeformer);
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_DeformableGameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BL_DeformableGameObject : public KX_GameObject
virtual ~BL_DeformableGameObject();
bool SetActiveAction(short priority, double curtime);

bool GetShape(vector<float> &shape);
bool GetShape(std::vector<float> &shape);

virtual void SetDeformer(class RAS_Deformer* deformer);
virtual class RAS_Deformer* GetDeformer()
Expand Down
24 changes: 12 additions & 12 deletions source/gameengine/Converter/KX_BlenderSceneConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String &name)
if ((sce = (Scene *)BLI_findstring(&m_maggie->scene, name.ReadPtr(), offsetof(ID, name) + 2)))
return sce;

for (vector<Main *>::iterator it=m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++) {
for (std::vector<Main *>::iterator it=m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++) {
Main *main = *it;

if ((sce= (Scene *)BLI_findstring(&main->scene, name.ReadPtr(), offsetof(ID, name) + 2)))
Expand Down Expand Up @@ -434,14 +434,14 @@ PyObject *KX_BlenderSceneConverter::GetPyNamespace()
}
#endif

vector<Main *> &KX_BlenderSceneConverter::GetMainDynamic()
std::vector<Main *> &KX_BlenderSceneConverter::GetMainDynamic()
{
return m_DynamicMaggie;
}

Main *KX_BlenderSceneConverter::GetMainDynamicPath(const char *path)
{
for (vector<Main *>::iterator it = m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++)
for (std::vector<Main *>::iterator it = m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++)
if (BLI_path_cmp((*it)->name, path) == 0)
return *it;

Expand All @@ -450,15 +450,15 @@ Main *KX_BlenderSceneConverter::GetMainDynamicPath(const char *path)

void KX_BlenderSceneConverter::MergeAsyncLoads()
{
vector<KX_Scene *> *merge_scenes;
std::vector<KX_Scene *> *merge_scenes;

vector<KX_LibLoadStatus *>::iterator mit;
vector<KX_Scene *>::iterator sit;
std::vector<KX_LibLoadStatus *>::iterator mit;
std::vector<KX_Scene *>::iterator sit;

m_threadinfo->m_mutex.Lock();

for (mit = m_mergequeue.begin(); mit != m_mergequeue.end(); ++mit) {
merge_scenes = (vector<KX_Scene *> *)(*mit)->GetData();
merge_scenes = (std::vector<KX_Scene *> *)(*mit)->GetData();

for (sit=merge_scenes->begin(); sit!=merge_scenes->end(); ++sit) {
(*mit)->GetMergeScene()->MergeScene(*sit);
Expand Down Expand Up @@ -497,8 +497,8 @@ static void async_convert(TaskPool *pool, void *ptr, int UNUSED(threadid))
{
KX_Scene *new_scene = NULL;
KX_LibLoadStatus *status = (KX_LibLoadStatus *)ptr;
vector<Scene *> *scenes = (vector<Scene *> *)status->GetData();
vector<KX_Scene *> *merge_scenes = new vector<KX_Scene *>(); // Deleted in MergeAsyncLoads
std::vector<Scene *> *scenes = (std::vector<Scene *> *)status->GetData();
std::vector<KX_Scene *> *merge_scenes = new std::vector<KX_Scene *>(); // Deleted in MergeAsyncLoads

for (unsigned int i = 0; i < scenes->size(); ++i) {
new_scene = status->GetEngine()->CreateScene((*scenes)[i], true);
Expand Down Expand Up @@ -637,7 +637,7 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl
/* Merge all new linked in scene into the existing one */
ID *scene;
// scenes gets deleted by the thread when it's done using it (look in async_convert())
vector<Scene *> *scenes = (options & LIB_LOAD_ASYNC) ? new vector<Scene *>() : NULL;
std::vector<Scene *> *scenes = (options & LIB_LOAD_ASYNC) ? new std::vector<Scene *>() : NULL;

for (scene = (ID *)main_newlib->scene.first; scene; scene = (ID *)scene->next ) {
if (options & LIB_LOAD_VERBOSE)
Expand Down Expand Up @@ -711,7 +711,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie)
}

/* tag all false except the one we remove */
for (vector<Main *>::iterator it = m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++) {
for (std::vector<Main *>::iterator it = m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++) {
Main *main = *it;
if (main != maggie) {
BKE_main_id_tag_all(main, LIB_TAG_DOIT, false);
Expand Down Expand Up @@ -949,7 +949,7 @@ RAS_MeshObject *KX_BlenderSceneConverter::ConvertMeshSpecial(KX_Scene *kx_scene,

if (me == NULL) {
// The mesh wasn't in the current main, try any dynamic (i.e., LibLoaded) ones
vector<Main *>::iterator it;
std::vector<Main *>::iterator it;

for (it = GetMainDynamic().begin(); it != GetMainDynamic().end(); it++) {
me = static_cast<ID *>(BLI_findstring(&(*it)->mesh, name, offsetof(ID, name) + 2));
Expand Down
12 changes: 5 additions & 7 deletions source/gameengine/Converter/KX_BlenderSceneConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

#include <map>

using namespace std;

class KX_WorldInfo;
class SCA_IActuator;
class SCA_IController;
Expand All @@ -60,21 +58,21 @@ struct bAction;
struct bActuator;
struct bController;

typedef map<KX_Scene*, map<Material*, RAS_IPolyMaterial*> > PolyMaterialCache;
typedef std::map<KX_Scene*, std::map<Material*, RAS_IPolyMaterial*> > PolyMaterialCache;

class KX_BlenderSceneConverter : public KX_ISceneConverter
{
std::map<KX_Scene *, std::vector<RAS_IPolyMaterial *> > m_polymaterials;
std::map<KX_Scene *, std::vector<RAS_MeshObject *> > m_meshobjects;

vector<class KX_LibLoadStatus*> m_mergequeue;
std::vector<class KX_LibLoadStatus*> m_mergequeue;
ThreadInfo *m_threadinfo;

// Cached material conversions
PolyMaterialCache m_polymat_cache;

// Saved KX_LibLoadStatus objects
map<char *, class KX_LibLoadStatus*> m_status_map;
std::map<char *, class KX_LibLoadStatus*> m_status_map;

// Should also have a list of collision shapes.
// For the time being this is held in KX_Scene::m_shapes
Expand All @@ -87,7 +85,7 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter
std::map<bAction *, BL_InterpolatorList *> m_map_blender_to_gameAdtList;

Main* m_maggie;
vector<struct Main*> m_DynamicMaggie;
std::vector<struct Main*> m_DynamicMaggie;

STR_String m_newfilename;
class KX_KetsjiEngine* m_ketsjiEngine;
Expand Down Expand Up @@ -143,7 +141,7 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter

// struct Main* GetMain() { return m_maggie; }
struct Main* GetMainDynamicPath(const char *path);
vector<struct Main*> &GetMainDynamic();
std::vector<struct Main*> &GetMainDynamic();

class KX_LibLoadStatus *LinkBlendFileMemory(void *data, int length, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options);
class KX_LibLoadStatus *LinkBlendFilePath(const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options);
Expand Down
4 changes: 1 addition & 3 deletions source/gameengine/Expressions/EXP_Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <map> // array functionality for the propertylist
#include "STR_String.h" // STR_String class

using namespace std;

#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
Expand Down Expand Up @@ -292,7 +290,7 @@ Py_Header
const STR_String& GetPropertyText(const STR_String & inName); // Get text description of property with name <inName>, returns an empty string if there is no property named <inName>
float GetPropertyNumber(const STR_String& inName,float defnumber);
virtual bool RemoveProperty(const char *inName); // Remove the property named <inName>, returns true if the property was succesfully removed, false if property was not found or could not be removed
virtual vector<STR_String> GetPropertyNames();
virtual std::vector<STR_String> GetPropertyNames();
virtual void ClearProperties(); // Clear all properties

virtual void SetPropertiesModified(bool inModified); // Set all properties' modified flag to <inModified>
Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/Expressions/intern/Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ bool CValue::RemoveProperty(const char *inName)
//
// Get Property Names
//
vector<STR_String> CValue::GetPropertyNames()
std::vector<STR_String> CValue::GetPropertyNames()
{
vector<STR_String> result;
std::vector<STR_String> result;
if (!m_pNamedPropertyArray) return result;
result.reserve(m_pNamedPropertyArray->size());

Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/GameLogic/SCA_2DFilterActuator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SCA_2DFilterActuator : public SCA_IActuator
Py_Header

private:
vector<STR_String> m_propNames;
std::vector<STR_String> m_propNames;
int m_type;
short m_disableMotionBlur;
float m_float_arg;
Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/GameLogic/SCA_ANDController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void SCA_ANDController::Trigger(SCA_LogicManager* logicmgr)

bool sensorresult = true;

for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin();
for (std::vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin();
!(is==m_linkedsensors.end());is++)
{
SCA_ISensor* sensor = *is;
Expand All @@ -72,7 +72,7 @@ void SCA_ANDController::Trigger(SCA_LogicManager* logicmgr)
}
}

for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
for (std::vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
!(i==m_linkedactuators.end());i++)
{
SCA_IActuator* actua = *i;
Expand Down
6 changes: 0 additions & 6 deletions source/gameengine/GameLogic/SCA_ActuatorEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,13 @@

#include "SCA_EventManager.h"

#include <vector>

using namespace std;

class SCA_ActuatorEventManager : public SCA_EventManager
{
public:
SCA_ActuatorEventManager(class SCA_LogicManager* logicmgr);
virtual ~SCA_ActuatorEventManager();
virtual void NextFrame();
virtual void UpdateFrame();
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}


#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_ActuatorEventManager")
Expand Down
3 changes: 0 additions & 3 deletions source/gameengine/GameLogic/SCA_BasicEventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@

#include "SCA_BasicEventManager.h"
#include "SCA_LogicManager.h"
#include <vector>
#include "SCA_ISensor.h"

using namespace std;

SCA_BasicEventManager::SCA_BasicEventManager(class SCA_LogicManager* logicmgr)
: SCA_EventManager(logicmgr, BASIC_EVENTMGR)
{
Expand Down
4 changes: 0 additions & 4 deletions source/gameengine/GameLogic/SCA_BasicEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#define __SCA_BASICEVENTMANAGER_H__

#include "SCA_EventManager.h"
#include <vector>

using namespace std;

class SCA_BasicEventManager : public SCA_EventManager
{
Expand All @@ -48,7 +45,6 @@ class SCA_BasicEventManager : public SCA_EventManager

virtual void NextFrame();


#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_BasicEventManager")
#endif
Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/GameLogic/SCA_ExpressionController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void SCA_ExpressionController::Trigger(SCA_LogicManager* logicmgr)
}
}

for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
for (std::vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
!(i==m_linkedactuators.end());i++)
{
SCA_IActuator* actua = *i;
Expand All @@ -132,7 +132,7 @@ CValue* SCA_ExpressionController::FindIdentifier(const STR_String& identifiernam

CValue* identifierval = NULL;

for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin();
for (std::vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin();
!(is==m_linkedsensors.end());is++)
{
SCA_ISensor* sensor = *is;
Expand Down
2 changes: 0 additions & 2 deletions source/gameengine/GameLogic/SCA_IActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include "SCA_IActuator.h"
#include "CM_Message.h"

using namespace std;

SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, KX_ACTUATOR_TYPE type) :
SCA_ILogicBrick(gameobj),
m_type(type),
Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/GameLogic/SCA_IScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void SCA_IScene::AddDebugProperty(class CValue* debugprop,
void SCA_IScene::RemoveDebugProperty(class CValue *gameobj,
const STR_String &name)
{
vector<SCA_DebugProp*>::iterator it = m_debugList.begin();
std::vector<SCA_DebugProp*>::iterator it = m_debugList.begin();
while (it != m_debugList.end()) {
STR_String debugname = (*it)->m_name;
CValue *debugobj = (*it)->m_obj;
Expand All @@ -130,7 +130,7 @@ void SCA_IScene::RemoveDebugProperty(class CValue *gameobj,

void SCA_IScene::RemoveObjectDebugProperties(class CValue* gameobj)
{
vector<SCA_DebugProp*>::iterator it = m_debugList.begin();
std::vector<SCA_DebugProp*>::iterator it = m_debugList.begin();
while (it != m_debugList.end()) {
CValue* debugobj = (*it)->m_obj;

Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/GameLogic/SCA_ISensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void SCA_ISensor::UnregisterToManager()

void SCA_ISensor::ActivateControllers(class SCA_LogicManager* logicmgr)
{
for (vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin();
for (std::vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin();
c!=m_linkedcontrollers.end();++c)
{
SCA_IController* contr = *c;
Expand Down Expand Up @@ -302,7 +302,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr)
{
// This level sensor is connected to at least one controller that was just made
// active but it did not generate an event yet, do it now to those controllers only
for (vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin();
for (std::vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin();
c!=m_linkedcontrollers.end();++c)
{
SCA_IController* contr = *c;
Expand Down
Loading

0 comments on commit 996ab30

Please sign in to comment.