remove warnings for the BGE

- variables that shadow vers declared earlier
- Py_Fatal print an error to the stderr
- gcc was complaining about the order of initialized vars (for classes)
- const return values for ints and bools didnt do anything.
- braces for ambiguous if  statements
This commit is contained in:
Campbell Barton
2009-02-25 03:26:02 +00:00
parent 56e9c87309
commit 2eb85c01f3
32 changed files with 104 additions and 99 deletions

View File

@@ -563,10 +563,12 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
// get some preferences // get some preferences
SYS_SystemHandle syshandle = SYS_GetSystem(); SYS_SystemHandle syshandle = SYS_GetSystem();
/*
bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0); bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0);
bool usefixed = (SYS_GetCommandLineInt(syshandle, "fixedtime", 0) != 0); bool usefixed = (SYS_GetCommandLineInt(syshandle, "fixedtime", 0) != 0);
bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0); bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
*/
bool game2ipo = true;//(SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0); bool game2ipo = true;//(SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0);
bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0); bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0);
bool usemat = false; bool usemat = false;

View File

@@ -1997,18 +1997,18 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
MT_Vector3 x(ori.getColumn(0)); MT_Vector3 x(ori.getColumn(0));
MT_Vector3 y(ori.getColumn(1)); MT_Vector3 y(ori.getColumn(1));
MT_Vector3 z(ori.getColumn(2)); MT_Vector3 z(ori.getColumn(2));
MT_Vector3 scale(x.length(), y.length(), z.length()); MT_Vector3 parscale(x.length(), y.length(), z.length());
if (!MT_fuzzyZero(scale[0])) if (!MT_fuzzyZero(parscale[0]))
x /= scale[0]; x /= parscale[0];
if (!MT_fuzzyZero(scale[1])) if (!MT_fuzzyZero(parscale[1]))
y /= scale[1]; y /= parscale[1];
if (!MT_fuzzyZero(scale[2])) if (!MT_fuzzyZero(parscale[2]))
z /= scale[2]; z /= parscale[2];
ori.setColumn(0, x); ori.setColumn(0, x);
ori.setColumn(1, y); ori.setColumn(1, y);
ori.setColumn(2, z); ori.setColumn(2, z);
parentinversenode->SetLocalOrientation(ori); parentinversenode->SetLocalOrientation(ori);
parentinversenode->SetLocalScale(scale); parentinversenode->SetLocalScale(parscale);
parentinversenode->AddChild(gameobj->GetSGNode()); parentinversenode->AddChild(gameobj->GetSGNode());
} }
@@ -2194,18 +2194,18 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
MT_Vector3 x(ori.getColumn(0)); MT_Vector3 x(ori.getColumn(0));
MT_Vector3 y(ori.getColumn(1)); MT_Vector3 y(ori.getColumn(1));
MT_Vector3 z(ori.getColumn(2)); MT_Vector3 z(ori.getColumn(2));
MT_Vector3 scale(x.length(), y.length(), z.length()); MT_Vector3 localscale(x.length(), y.length(), z.length());
if (!MT_fuzzyZero(scale[0])) if (!MT_fuzzyZero(localscale[0]))
x /= scale[0]; x /= localscale[0];
if (!MT_fuzzyZero(scale[1])) if (!MT_fuzzyZero(localscale[1]))
y /= scale[1]; y /= localscale[1];
if (!MT_fuzzyZero(scale[2])) if (!MT_fuzzyZero(localscale[2]))
z /= scale[2]; z /= localscale[2];
ori.setColumn(0, x); ori.setColumn(0, x);
ori.setColumn(1, y); ori.setColumn(1, y);
ori.setColumn(2, z); ori.setColumn(2, z);
parentinversenode->SetLocalOrientation(ori); parentinversenode->SetLocalOrientation(ori);
parentinversenode->SetLocalScale(scale); parentinversenode->SetLocalScale(localscale);
parentinversenode->AddChild(gameobj->GetSGNode()); parentinversenode->AddChild(gameobj->GetSGNode());
} }

View File

@@ -311,67 +311,67 @@ void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_Blend
} }
{ {
KX_ObColorIpoSGController* ipocontr=NULL; KX_ObColorIpoSGController* ipocontr_obcol=NULL;
ipo = ipoList->GetScalarInterpolator(OB_COL_R); ipo = ipoList->GetScalarInterpolator(OB_COL_R);
if (ipo) if (ipo)
{ {
if (!ipocontr) if (!ipocontr_obcol)
{ {
ipocontr = new KX_ObColorIpoSGController(); ipocontr_obcol = new KX_ObColorIpoSGController();
gameobj->GetSGNode()->AddSGController(ipocontr); gameobj->GetSGNode()->AddSGController(ipocontr_obcol);
ipocontr->SetObject(gameobj->GetSGNode()); ipocontr_obcol->SetObject(gameobj->GetSGNode());
} }
KX_IInterpolator *interpolator = KX_IInterpolator *interpolator =
new KX_ScalarInterpolator( new KX_ScalarInterpolator(
&ipocontr->m_rgba[0], &ipocontr_obcol->m_rgba[0],
ipo); ipo);
ipocontr->AddInterpolator(interpolator); ipocontr_obcol->AddInterpolator(interpolator);
} }
ipo = ipoList->GetScalarInterpolator(OB_COL_G); ipo = ipoList->GetScalarInterpolator(OB_COL_G);
if (ipo) if (ipo)
{ {
if (!ipocontr) if (!ipocontr_obcol)
{ {
ipocontr = new KX_ObColorIpoSGController(); ipocontr_obcol = new KX_ObColorIpoSGController();
gameobj->GetSGNode()->AddSGController(ipocontr); gameobj->GetSGNode()->AddSGController(ipocontr_obcol);
ipocontr->SetObject(gameobj->GetSGNode()); ipocontr_obcol->SetObject(gameobj->GetSGNode());
} }
KX_IInterpolator *interpolator = KX_IInterpolator *interpolator =
new KX_ScalarInterpolator( new KX_ScalarInterpolator(
&ipocontr->m_rgba[1], &ipocontr_obcol->m_rgba[1],
ipo); ipo);
ipocontr->AddInterpolator(interpolator); ipocontr_obcol->AddInterpolator(interpolator);
} }
ipo = ipoList->GetScalarInterpolator(OB_COL_B); ipo = ipoList->GetScalarInterpolator(OB_COL_B);
if (ipo) if (ipo)
{ {
if (!ipocontr) if (!ipocontr_obcol)
{ {
ipocontr = new KX_ObColorIpoSGController(); ipocontr_obcol = new KX_ObColorIpoSGController();
gameobj->GetSGNode()->AddSGController(ipocontr); gameobj->GetSGNode()->AddSGController(ipocontr_obcol);
ipocontr->SetObject(gameobj->GetSGNode()); ipocontr_obcol->SetObject(gameobj->GetSGNode());
} }
KX_IInterpolator *interpolator = KX_IInterpolator *interpolator =
new KX_ScalarInterpolator( new KX_ScalarInterpolator(
&ipocontr->m_rgba[2], &ipocontr_obcol->m_rgba[2],
ipo); ipo);
ipocontr->AddInterpolator(interpolator); ipocontr_obcol->AddInterpolator(interpolator);
} }
ipo = ipoList->GetScalarInterpolator(OB_COL_A); ipo = ipoList->GetScalarInterpolator(OB_COL_A);
if (ipo) if (ipo)
{ {
if (!ipocontr) if (!ipocontr_obcol)
{ {
ipocontr = new KX_ObColorIpoSGController(); ipocontr_obcol = new KX_ObColorIpoSGController();
gameobj->GetSGNode()->AddSGController(ipocontr); gameobj->GetSGNode()->AddSGController(ipocontr_obcol);
ipocontr->SetObject(gameobj->GetSGNode()); ipocontr_obcol->SetObject(gameobj->GetSGNode());
} }
KX_IInterpolator *interpolator = KX_IInterpolator *interpolator =
new KX_ScalarInterpolator( new KX_ScalarInterpolator(
&ipocontr->m_rgba[3], &ipocontr_obcol->m_rgba[3],
ipo); ipo);
ipocontr->AddInterpolator(interpolator); ipocontr_obcol->AddInterpolator(interpolator);
} }
} }

View File

@@ -274,7 +274,7 @@ void CParser::NextSym()
} else if (((ch >= 'a') && (ch <= 'z')) } else if (((ch >= 'a') && (ch <= 'z'))
|| ((ch >= 'A') && (ch <= 'Z'))) || ((ch >= 'A') && (ch <= 'Z')))
{ // reserved word? { // reserved word?
int start;
start = chcount; start = chcount;
CharRep(); CharRep();
GrabString(start); GrabString(start);

View File

@@ -147,7 +147,7 @@ PyObject *PyObjectPlus::_getattr_self(const PyAttributeDef attrlist[], void *sel
if (attrdef->m_length > 1) if (attrdef->m_length > 1)
{ {
PyObject* resultlist = PyList_New(attrdef->m_length); PyObject* resultlist = PyList_New(attrdef->m_length);
for (int i=0; i<attrdef->m_length; i++) for (unsigned int i=0; i<attrdef->m_length; i++)
{ {
switch (attrdef->m_type) { switch (attrdef->m_type) {
case KX_PYATTRIBUTE_TYPE_BOOL: case KX_PYATTRIBUTE_TYPE_BOOL:

View File

@@ -73,7 +73,7 @@ typedef int Py_ssize_t;
#endif #endif
static inline void Py_Fatal(const char *M) { static inline void Py_Fatal(const char *M) {
//cout << M << endl; fprintf(stderr, "%s\n", M);
exit(-1); exit(-1);
}; };

View File

@@ -42,14 +42,14 @@ SCA_Joystick::SCA_Joystick(short int index)
m_axis21(0), m_axis21(0),
m_prec(3200), m_prec(3200),
m_buttonnum(-2), m_buttonnum(-2),
m_axismax(-1),
m_hatdir(-2), m_hatdir(-2),
m_buttonmax(-1),
m_hatmax(-1),
m_isinit(0), m_isinit(0),
m_istrig_axis(0), m_istrig_axis(0),
m_istrig_button(0), m_istrig_button(0),
m_istrig_hat(0), m_istrig_hat(0)
m_axismax(-1),
m_buttonmax(-1),
m_hatmax(-1)
{ {
#ifndef DISABLE_SDL #ifndef DISABLE_SDL
m_private = new PrivateData(); m_private = new PrivateData();

View File

@@ -53,10 +53,10 @@ SCA_DelaySensor::SCA_DelaySensor(class SCA_EventManager* eventmgr,
int duration, int duration,
bool repeat, bool repeat,
PyTypeObject* T) PyTypeObject* T)
: SCA_ISensor(gameobj,eventmgr, T), : SCA_ISensor(gameobj,eventmgr, T),
m_repeat(repeat),
m_delay(delay), m_delay(delay),
m_duration(duration), m_duration(duration)
m_repeat(repeat)
{ {
Init(); Init();
} }

View File

@@ -36,8 +36,8 @@ using namespace std;
SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj,
PyTypeObject* T) : PyTypeObject* T) :
m_links(0), SCA_ILogicBrick(gameobj,T),
SCA_ILogicBrick(gameobj,T) m_links(0)
{ {
// nothing to do // nothing to do
} }

View File

@@ -36,9 +36,9 @@ class SCA_IActuator : public SCA_ILogicBrick
{ {
friend class SCA_LogicManager; friend class SCA_LogicManager;
protected: protected:
std::vector<CValue*> m_events;
int m_links; // number of active links to controllers int m_links; // number of active links to controllers
// when 0, the actuator is automatically stopped // when 0, the actuator is automatically stopped
std::vector<CValue*> m_events;
void RemoveAllEvents(); void RemoveAllEvents();
public: public:

View File

@@ -38,8 +38,8 @@
SCA_IController::SCA_IController(SCA_IObject* gameobj, SCA_IController::SCA_IController(SCA_IObject* gameobj,
PyTypeObject* T) PyTypeObject* T)
: :
m_statemask(0), SCA_ILogicBrick(gameobj,T),
SCA_ILogicBrick(gameobj,T) m_statemask(0)
{ {
} }

View File

@@ -40,7 +40,7 @@
MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0);
SCA_IObject::SCA_IObject(PyTypeObject* T): m_initState(0), m_state(0), CValue(T) SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0)
{ {
m_suspended = false; m_suspended = false;
} }

View File

@@ -158,8 +158,8 @@ bool SCA_MouseSensor::Evaluate(CValue* event)
case KX_MOUSESENSORMODE_WHEELUP: case KX_MOUSESENSORMODE_WHEELUP:
case KX_MOUSESENSORMODE_WHEELDOWN: case KX_MOUSESENSORMODE_WHEELDOWN:
{ {
const SCA_InputEvent& event = mousedev->GetEventValue(m_hotkey); const SCA_InputEvent& mevent = mousedev->GetEventValue(m_hotkey);
switch (event.m_status){ switch (mevent.m_status){
case SCA_InputEvent::KX_JUSTACTIVATED: case SCA_InputEvent::KX_JUSTACTIVATED:
m_val = 1; m_val = 1;
result = true; result = true;

View File

@@ -18,7 +18,7 @@
#define spit(x) std::cout << x << std::endl; #define spit(x) std::cout << x << std::endl;
#define SORT_UNIFORMS 1 #define SORT_UNIFORMS 1
#define UNIFORM_MAX_LEN sizeof(float)*16 #define UNIFORM_MAX_LEN (int)sizeof(float)*16
#define MAX_LOG_LEN 262144 // bounds #define MAX_LOG_LEN 262144 // bounds
BL_Uniform::BL_Uniform(int data_size) BL_Uniform::BL_Uniform(int data_size)
@@ -108,7 +108,7 @@ void BL_Uniform::SetData(int location, int type,bool transpose)
#endif #endif
} }
const bool BL_Shader::Ok()const bool BL_Shader::Ok()const
{ {
return (mShader !=0 && mOk && mUse); return (mShader !=0 && mOk && mUse);
} }

View File

@@ -166,7 +166,7 @@ public:
//const BL_Sampler* GetSampler(int i); //const BL_Sampler* GetSampler(int i);
void SetSampler(int loc, int unit); void SetSampler(int loc, int unit);
const bool Ok()const; bool Ok()const;
unsigned int GetProg(); unsigned int GetProg();
void SetProg(bool enable); void SetProg(bool enable);
int GetAttribute(){return mAttr;}; int GetAttribute(){return mAttr;};

View File

@@ -384,10 +384,10 @@ SG_Controller* KX_BulletPhysicsController::GetReplica(class SG_Node* destnode)
childit!= destnode->GetSGChildren().end(); childit!= destnode->GetSGChildren().end();
++childit ++childit
) { ) {
KX_GameObject *clientgameobj = static_cast<KX_GameObject*>( (*childit)->GetSGClientObject()); KX_GameObject *clientgameobj_child = static_cast<KX_GameObject*>( (*childit)->GetSGClientObject());
if (clientgameobj) if (clientgameobj_child)
{ {
parentKxCtrl = (KX_BulletPhysicsController*)clientgameobj->GetPhysicsController(); parentKxCtrl = (KX_BulletPhysicsController*)clientgameobj_child->GetPhysicsController();
parentctrl = parentKxCtrl; parentctrl = parentKxCtrl;
ccdParent = parentKxCtrl; ccdParent = parentKxCtrl;
} }

View File

@@ -56,9 +56,9 @@ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj,
int option, int option,
char *property, char *property,
PyTypeObject* T) : PyTypeObject* T) :
SCA_IActuator(gameobj, T),
m_refDirection(refDir), m_refDirection(refDir),
m_currentTime(0), m_currentTime(0)
SCA_IActuator(gameobj, T)
{ {
m_posDampTime = posDampTime; m_posDampTime = posDampTime;
m_rotDampTime = rotDampTime; m_rotDampTime = rotDampTime;

View File

@@ -132,7 +132,7 @@ bool KX_GameActuator::Update()
{ {
char mashal_path[512]; char mashal_path[512];
char *marshal_buffer = NULL; char *marshal_buffer = NULL;
int marshal_length; unsigned int marshal_length;
FILE *fp = NULL; FILE *fp = NULL;
pathGamePythonConfig(mashal_path); pathGamePythonConfig(mashal_path);

View File

@@ -1462,11 +1462,9 @@ PyObject* KX_GameObject::PySetState(PyObject* self, PyObject* value)
PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args) PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args)
{ {
// only can get the velocity if we have a physics object connected to us... // only can get the velocity if we have a physics object connected to us...
MT_Vector3 velocity(0.0,0.0,0.0);
MT_Point3 point(0.0,0.0,0.0); MT_Point3 point(0.0,0.0,0.0);
PyObject* pypos = NULL; PyObject* pypos = NULL;
if (PyArg_ParseTuple(args, "|O:getVelocity", &pypos)) if (PyArg_ParseTuple(args, "|O:getVelocity", &pypos))
{ {
if (pypos) if (pypos)
@@ -1478,10 +1476,11 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args)
if (m_pPhysicsController1) if (m_pPhysicsController1)
{ {
velocity = m_pPhysicsController1->GetVelocity(point); return PyObjectFrom(m_pPhysicsController1->GetVelocity(point));
}
else {
return PyObjectFrom(MT_Vector3(0.0,0.0,0.0));
} }
return PyObjectFrom(velocity);
} }
@@ -2045,8 +2044,8 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
if (callback.m_hitMesh) if (callback.m_hitMesh)
{ {
// if this field is set, then we can trust that m_hitPolygon is a valid polygon // if this field is set, then we can trust that m_hitPolygon is a valid polygon
RAS_Polygon* poly = callback.m_hitMesh->GetPolygon(callback.m_hitPolygon); RAS_Polygon* polygon = callback.m_hitMesh->GetPolygon(callback.m_hitPolygon);
KX_PolyProxy* polyproxy = new KX_PolyProxy(callback.m_hitMesh, poly); KX_PolyProxy* polyproxy = new KX_PolyProxy(callback.m_hitMesh, polygon);
PyTuple_SET_ITEM(returnValue, 3, polyproxy); PyTuple_SET_ITEM(returnValue, 3, polyproxy);
} }
else else

View File

@@ -58,8 +58,8 @@ KX_IpoSGController::KX_IpoSGController()
m_ipo_add(false), m_ipo_add(false),
m_ipo_local(false), m_ipo_local(false),
m_modified(true), m_modified(true),
m_ipo_start_initialized(false),
m_ipotime(1.0), m_ipotime(1.0),
m_ipo_start_initialized(false),
m_ipo_start_euler(0.0,0.0,0.0), m_ipo_start_euler(0.0,0.0,0.0),
m_ipo_euler_initialized(false) m_ipo_euler_initialized(false)
{ {

View File

@@ -713,7 +713,7 @@ void KX_KetsjiEngine::Render()
if (!BeginFrame()) if (!BeginFrame())
return; return;
KX_SceneList::iterator sceneit;
for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++)
// for each scene, call the proceed functions // for each scene, call the proceed functions
{ {

View File

@@ -240,7 +240,7 @@ bool KX_NearSensor::BroadPhaseFilterCollision(void*obj1,void*obj2)
bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData * coll_data) bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData * coll_data)
{ {
// KX_TouchEventManager* toucheventmgr = static_cast<KX_TouchEventManager*>(m_eventmgr); // KX_TouchEventManager* toucheventmgr = static_cast<KX_TouchEventManager*>(m_eventmgr);
KX_GameObject* parent = static_cast<KX_GameObject*>(GetParent()); // KX_GameObject* parent = static_cast<KX_GameObject*>(GetParent());
// need the mapping from PHY_IPhysicsController to gameobjects now // need the mapping from PHY_IPhysicsController to gameobjects now

View File

@@ -65,12 +65,12 @@ KX_ObjectActuator(
m_current_linear_factor(0.0), m_current_linear_factor(0.0),
m_current_angular_factor(0.0), m_current_angular_factor(0.0),
m_damping(damping), m_damping(damping),
m_previous_error(0.0,0.0,0.0),
m_error_accumulator(0.0,0.0,0.0),
m_bitLocalFlag (flag), m_bitLocalFlag (flag),
m_active_combined_velocity (false), m_active_combined_velocity (false),
m_linear_damping_active(false), m_linear_damping_active(false),
m_angular_damping_active(false), m_angular_damping_active(false)
m_error_accumulator(0.0,0.0,0.0),
m_previous_error(0.0,0.0,0.0)
{ {
if (m_bitLocalFlag.ServoControl) if (m_bitLocalFlag.ServoControl)
{ {

View File

@@ -146,8 +146,8 @@ PyObject* KX_PolyProxy::_getattr(const char *attr)
} }
KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon) KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon)
: m_mesh((RAS_MeshObject*)mesh), : m_polygon(polygon),
m_polygon(polygon) m_mesh((RAS_MeshObject*)mesh)
{ {
} }

View File

@@ -196,7 +196,7 @@ static PyObject* gPyGetSpectrum(PyObject*)
} }
#if 0 // unused
static PyObject* gPyStartDSP(PyObject*, PyObject* args) static PyObject* gPyStartDSP(PyObject*, PyObject* args)
{ {
SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
@@ -213,7 +213,7 @@ static PyObject* gPyStartDSP(PyObject*, PyObject* args)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
#endif
static PyObject* gPyStopDSP(PyObject*, PyObject* args) static PyObject* gPyStopDSP(PyObject*, PyObject* args)
@@ -257,7 +257,7 @@ static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args)
PHY_GetActiveEnvironment()->setFixedTimeStep(true,ticrate); PHY_GetActiveEnvironment()->setFixedTimeStep(true,ticrate);
Py_RETURN_NONE; Py_RETURN_NONE;
} }
#if 0 // unused
static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args) static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args)
{ {
int debugMode; int debugMode;
@@ -267,7 +267,7 @@ static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args)
PHY_GetActiveEnvironment()->setDebugMode(debugMode); PHY_GetActiveEnvironment()->setDebugMode(debugMode);
Py_RETURN_NONE; Py_RETURN_NONE;
} }
#endif
static PyObject* gPyGetPhysicsTicRate(PyObject*) static PyObject* gPyGetPhysicsTicRate(PyObject*)

View File

@@ -444,7 +444,7 @@ PyObject* KX_SoundActuator::PySetLooping(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PyGetLooping(PyObject* self, PyObject* args, PyObject* kwds) PyObject* KX_SoundActuator::PyGetLooping(PyObject* self, PyObject* args, PyObject* kwds)
{ {
int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : SND_LOOP_OFF; int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF;
PyObject* result = PyInt_FromLong(looping); PyObject* result = PyInt_FromLong(looping);
return result; return result;

View File

@@ -317,8 +317,8 @@ static void DrawAabb(btIDebugDraw* debugDrawer,const btVector3& from,const btVec
CcdPhysicsEnvironment::CcdPhysicsEnvironment(btDispatcher* dispatcher,btOverlappingPairCache* pairCache) CcdPhysicsEnvironment::CcdPhysicsEnvironment(btDispatcher* dispatcher,btOverlappingPairCache* pairCache)
:m_scalingPropagated(false), :m_numIterations(10),
m_numIterations(10), m_scalingPropagated(false),
m_numTimeSubSteps(1), m_numTimeSubSteps(1),
m_ccdMode(0), m_ccdMode(0),
m_solverType(-1), m_solverType(-1),
@@ -326,8 +326,8 @@ m_profileTimings(0),
m_enableSatCollisionDetection(false), m_enableSatCollisionDetection(false),
m_solver(NULL), m_solver(NULL),
m_ownPairCache(NULL), m_ownPairCache(NULL),
m_ownDispatcher(NULL), m_filterCallback(NULL),
m_filterCallback(NULL) m_ownDispatcher(NULL)
{ {
for (int i=0;i<PHY_NUM_RESPONSE;i++) for (int i=0;i<PHY_NUM_RESPONSE;i++)

View File

@@ -143,7 +143,7 @@ const STR_String& RAS_IPolyMaterial::GetTextureName() const
return m_texturename; return m_texturename;
} }
const unsigned int RAS_IPolyMaterial::GetFlag() const unsigned int RAS_IPolyMaterial::GetFlag() const
{ {
return m_flag; return m_flag;
} }

View File

@@ -138,7 +138,7 @@ public:
const STR_String& GetMaterialName() const; const STR_String& GetMaterialName() const;
dword GetMaterialNameHash() const; dword GetMaterialNameHash() const;
const STR_String& GetTextureName() const; const STR_String& GetTextureName() const;
const unsigned int GetFlag() const; unsigned int GetFlag() const;
virtual bool UsesLighting(RAS_IRasterizer *rasty) const; virtual bool UsesLighting(RAS_IRasterizer *rasty) const;
virtual bool UsesObjectColor() const; virtual bool UsesObjectColor() const;

View File

@@ -110,7 +110,7 @@ public:
return (unsigned char *) &m_rgba; return (unsigned char *) &m_rgba;
} }
const unsigned int getOrigIndex() const { unsigned int getOrigIndex() const {
return m_origindex; return m_origindex;
} }

View File

@@ -69,7 +69,7 @@ FilterBase * FilterBase::findFirst (void)
{ {
// find first filter in chain // find first filter in chain
FilterBase * frst; FilterBase * frst;
for (frst = this; frst->m_previous != NULL; frst = frst->m_previous->m_filter); for (frst = this; frst->m_previous != NULL; frst = frst->m_previous->m_filter) {};
// set first filter // set first filter
return frst; return frst;
} }

View File

@@ -189,9 +189,10 @@ protected:
int d = m_buffU[offset] - 128; int d = m_buffU[offset] - 128;
int e = m_buffV[offset] - 128; int e = m_buffV[offset] - 128;
// if horizontal interpolation is needed // if horizontal interpolation is needed
if ((x & 1) == 1) if ((x & 1) == 1) {
// if vertical interpolation is needed too // if vertical interpolation is needed too
if ((y & 1) == 1) if ((y & 1) == 1)
{
// if this pixel is on the edge // if this pixel is on the edge
if (isEdge(x, y, size)) if (isEdge(x, y, size))
{ {
@@ -206,7 +207,8 @@ protected:
e = interpolVH(m_buffV + offset) - 128; e = interpolVH(m_buffV + offset) - 128;
} }
// otherwise use horizontal interpolation only // otherwise use horizontal interpolation only
else }
else {
// if this pixel is on the edge // if this pixel is on the edge
if (isEdge(x, y, size)) if (isEdge(x, y, size))
{ {
@@ -221,6 +223,8 @@ protected:
e = interpolH(m_buffV + offset) - 128; e = interpolH(m_buffV + offset) - 128;
} }
// otherwise if only vertical interpolation is needed // otherwise if only vertical interpolation is needed
}
}
else if ((y & 1) == 1) else if ((y & 1) == 1)
// if this pixel is on the edge // if this pixel is on the edge
if (isEdge(x, y, size)) if (isEdge(x, y, size))