BGE patch [#21019]: Python function for Scene suspend/resume.
authorBenoit Bolsee <benoit.bolsee@online.be>
Sun, 28 Mar 2010 20:50:20 +0000 (20:50 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sun, 28 Mar 2010 20:50:20 +0000 (20:50 +0000)
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/PyDoc/GameTypes.py

index c4b1aaeacf47468ff67c9ccdf4773476ca1811ed..5bcaa3ee01e7a4c9e5c3d78018aa7b765b060b4a 100644 (file)
@@ -1887,6 +1887,8 @@ PyMethodDef KX_Scene::Methods[] = {
        KX_PYMETHODTABLE(KX_Scene, end),
        KX_PYMETHODTABLE(KX_Scene, restart),
        KX_PYMETHODTABLE(KX_Scene, replace),
+       KX_PYMETHODTABLE(KX_Scene, suspend),
+       KX_PYMETHODTABLE(KX_Scene, resume),
        
        /* dict style access */
        KX_PYMETHODTABLE(KX_Scene, get),
@@ -2193,6 +2195,24 @@ KX_PYMETHODDEF_DOC(KX_Scene, replace,
        Py_RETURN_NONE;
 }
 
+KX_PYMETHODDEF_DOC(KX_Scene, suspend,
+                                       "suspend()\n"
+                                       "Suspends this scene.\n")
+{
+       Suspend();
+       
+       Py_RETURN_NONE;
+}
+
+KX_PYMETHODDEF_DOC(KX_Scene, resume,
+                                       "resume()\n"
+                                       "Resumes this scene.\n")
+{
+       Resume();
+       
+       Py_RETURN_NONE;
+}
+
 /* Matches python dict.get(key, [default]) */
 KX_PYMETHODDEF_DOC(KX_Scene, get, "")
 {
index 5b5629778372d08fb9f392a25fbfc7b0870b8b4d..407f3f1cf1aabe2b2fb49a2eb7459b997d001016 100644 (file)
@@ -547,6 +547,8 @@ public:
        KX_PYMETHOD_DOC(KX_Scene, end);
        KX_PYMETHOD_DOC(KX_Scene, restart);
        KX_PYMETHOD_DOC(KX_Scene, replace);
+       KX_PYMETHOD_DOC(KX_Scene, suspend);
+       KX_PYMETHOD_DOC(KX_Scene, resume);
        KX_PYMETHOD_DOC(KX_Scene, get);
 
        /* attributes */
index 7ecae9443241b82f2db4e119165f4ece38be95ae..ffd6a7eeee3dd42a5cc8c5a93f2835c694ffb09c 100644 (file)
@@ -3896,6 +3896,16 @@ class KX_Scene(PyObjectPlus):
                @param scene: The name of the scene to replace this scene with.
                @type scene: string
                """
+               
+       def suspend():
+               """
+               Suspends this scene.
+               """
+               
+       def resume():
+               """
+               Resume this scene.
+               """
        
        def get(key, default=None):
                """