[Bf-blender-cvs] [c89637b] master: BGE: use tuple for returning display size

Campbell Barton noreply at git.blender.org
Tue Apr 7 22:29:10 CEST 2015


Commit: c89637be306b0c6bc23c40e9f764ac53159e1214
Author: Campbell Barton
Date:   Wed Apr 8 06:28:05 2015 +1000
Branches: master
https://developer.blender.org/rBc89637be306b0c6bc23c40e9f764ac53159e1214

BGE: use tuple for returning display size

===================================================================

M	source/gameengine/Ketsji/KX_PythonInit.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 420e0be..f7048f1 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -51,6 +51,8 @@
 #  include <Python.h>
 
 extern "C" {
+	#  include "BLI_utildefines.h"
+	#  include "python_utildefines.h"
 	#  include "bpy_internal_import.h"  /* from the blender python api, but we want to import text too! */
 	#  include "py_capi_utils.h"
 	#  include "mathutils.h" // 'mathutils' module copied here so the blenderlayer can use.
@@ -1405,16 +1407,17 @@ static PyObject *gPyClearDebugList(PyObject *)
 
 static PyObject *gPyGetDisplayDimensions(PyObject *)
 {
-	PyObject *list = PyList_New(0);
-	int width;
-	int height;
+	PyObject *result;
+	int width, height;
 
 	gp_Canvas->GetDisplayDimensions(width, height);
 
-	PyList_Append(list, PyLong_FromLong(width));
-	PyList_Append(list, PyLong_FromLong(height));
+	result = PyTuple_New(2);
+	PyTuple_SET_ITEMS(result,
+	        PyLong_FromLong(width),
+	        PyLong_FromLong(height));
 
-	return list;
+	return result;
 }
 
 PyDoc_STRVAR(Rasterizer_module_documentation,




More information about the Bf-blender-cvs mailing list