diff options
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 23 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.h | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonSeq.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonSeq.h | 4 |
7 files changed, 39 insertions, 9 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 3b777031831..14a307794db 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -200,7 +200,26 @@ float KX_Camera::GetScale() const return m_camdata.m_scale; } +/* +* Gets the horizontal size of the sensor - for camera matching. +*/ +float KX_Camera::GetSensorWidth() const +{ + return m_camdata.m_sensor_x; +} +/* +* Gets the vertical size of the sensor - for camera matching. +*/ +float KX_Camera::GetSensorHeight() const +{ + return m_camdata.m_sensor_y; +} +/** Gets the mode FOV is calculating from sensor dimensions */ +short KX_Camera::GetSensorFit() const +{ + return m_camdata.m_sensor_fit; +} float KX_Camera::GetCameraNear() const { @@ -883,7 +902,9 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, _PyUnicode_AsString(value)); + PyErr_Format(PyExc_ValueError, + "%s, requested name \"%s\" did not match any KX_Camera in this scene", + error_prefix, _PyUnicode_AsString(value)); return false; } } diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 4c8cf21a7bf..236e914b9e5 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -199,6 +199,12 @@ public: float GetLens() const; /** Gets the ortho scale. */ float GetScale() const; + /** Gets the horizontal size of the sensor - for camera matching */ + float GetSensorWidth() const; + /** Gets the vertical size of the sensor - for camera matching */ + float GetSensorHeight() const; + /** Gets the mode FOV is calculating from sensor dimensions */ + short GetSensorFit() const; /** Gets the near clip distance. */ float GetCameraNear() const; /** Gets the far clip distance. */ diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 5de6adc5af4..a9be588e6b2 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1251,6 +1251,7 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) cam->GetScale(), nearfrust, farfrust, + cam->GetSensorFit(), frustum ); if (!cam->GetViewport()) { @@ -1268,6 +1269,9 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) area, viewport, cam->GetLens(), + cam->GetSensorWidth(), + cam->GetSensorHeight(), + cam->GetSensorFit(), nearfrust, farfrust, frustum diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 40f157ef0a4..5a02da07e43 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -387,8 +387,7 @@ public: void SetUseOverrideFrameColor(bool overrideFrameColor); /** - * Enables/disables the use of the framing bar color of the Blender file's scenes. - * @param useSceneFrameColor The new setting. + * Check if the frame color is being overridden. */ bool GetUseOverrideFrameColor(void) const; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 25145e87b78..02e6ebea71b 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -705,7 +705,7 @@ static PyObject *gLibNew(PyObject*, PyObject* args) KX_Scene *kx_scene= gp_KetsjiScene; char *path; char *group; - char *name; + const char *name; PyObject *names; int idcode; @@ -815,7 +815,7 @@ static struct PyMethodDef game_methods[] = { {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (const char *)"Gets the estimated average frame rate"}, {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (const char *)"Gets a list of blend files in the same directory as the current blend file"}, {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Prints GL Extension Info"}, - {"PrintMemInfo", (PyCFunction)pyPrintStats, METH_NOARGS, (const char *)"Print engine stastics"}, + {"PrintMemInfo", (PyCFunction)pyPrintStats, METH_NOARGS, (const char *)"Print engine statistics"}, /* library functions */ {"LibLoad", (PyCFunction)gLibLoad, METH_VARARGS|METH_KEYWORDS, (const char *)""}, diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 7d7dc39ba32..430dcdbd153 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -189,7 +189,7 @@ static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) return NULL; } -static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, char *key) +static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, const char *key) { PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); @@ -277,7 +277,7 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) return KX_PythonSeq_getIndex(self, PyLong_AsSsize_t( key )); } else if ( PyUnicode_Check(key) ) { - char *name = _PyUnicode_AsString(key); + const char *name = _PyUnicode_AsString(key); PyObjectPlus *ret = KX_PythonSeq_subscript__internal(self, name); if(ret) { diff --git a/source/gameengine/Ketsji/KX_PythonSeq.h b/source/gameengine/Ketsji/KX_PythonSeq.h index 6e9cf9a36aa..1c2d2869be0 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.h +++ b/source/gameengine/Ketsji/KX_PythonSeq.h @@ -51,8 +51,8 @@ enum KX_PYGENSEQ_TYPE { /* The Main PyType Object defined in Main.c */ extern PyTypeObject KX_PythonSeq_Type; -#define BPy_KX_PythonSeq_Check(v) \ - ((v)->ob_type == &KX_PythonSeq_Type) +#define BPy_KX_PythonSeq_Check(obj) \ + (Py_TYPE(obj) == &KX_PythonSeq_Type) typedef struct { PyObject_VAR_HEAD |