Revision: 16217
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16217
Author:   campbellbarton
Date:     2008-08-22 01:41:08 +0200 (Fri, 22 Aug 2008)

Log Message:
-----------
partial merge because of conflicts 
svn merge -16186:16194 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/apricot/source/blender/blenkernel/BKE_blender.h
    branches/apricot/source/blender/include/BIF_resources.h
    branches/apricot/source/blender/makesdna/DNA_userdef_types.h
    branches/apricot/source/blender/src/drawipo.c
    branches/apricot/source/blender/src/resources.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/blender/src/usiblender.c
    branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.h
    branches/apricot/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Modified: branches/apricot/source/blender/blenkernel/BKE_blender.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_blender.h    2008-08-21 
22:57:25 UTC (rev 16216)
+++ branches/apricot/source/blender/blenkernel/BKE_blender.h    2008-08-21 
23:41:08 UTC (rev 16217)
@@ -41,7 +41,7 @@
 struct MemFile;
 
 #define BLENDER_VERSION                        247
-#define BLENDER_SUBVERSION             0
+#define BLENDER_SUBVERSION             1
 
 #define BLENDER_MINVERSION             245
 #define BLENDER_MINSUBVERSION  15

Modified: branches/apricot/source/blender/include/BIF_resources.h
===================================================================
--- branches/apricot/source/blender/include/BIF_resources.h     2008-08-21 
22:57:25 UTC (rev 16216)
+++ branches/apricot/source/blender/include/BIF_resources.h     2008-08-21 
23:41:08 UTC (rev 16217)
@@ -524,6 +524,10 @@
        
        TH_EDGE_SHARP,
        TH_EDITMESH_ACTIVE,
+
+       TH_HANDLE_VERTEX,
+       TH_HANDLE_VERTEX_SELECT,
+       TH_HANDLE_VERTEX_SIZE,
 };
 /* XXX WARNING: previous is saved in file, so do not change order! */
 

Modified: branches/apricot/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_userdef_types.h        
2008-08-21 22:57:25 UTC (rev 16216)
+++ branches/apricot/source/blender/makesdna/DNA_userdef_types.h        
2008-08-21 23:41:08 UTC (rev 16217)
@@ -101,6 +101,11 @@
        char movie[4], image[4], scene[4], audio[4];            // for sequence 
editor
        char effect[4], plugin[4], transition[4], meta[4];
        char editmesh_active[4]; 
+
+       char handle_vertex[4];
+       char handle_vertex_select[4];
+       char handle_vertex_size;
+       char hpad[7];
 } ThemeSpace;
 
 

Modified: branches/apricot/source/blender/src/drawipo.c
===================================================================
--- branches/apricot/source/blender/src/drawipo.c       2008-08-21 22:57:25 UTC 
(rev 16216)
+++ branches/apricot/source/blender/src/drawipo.c       2008-08-21 23:41:08 UTC 
(rev 16217)
@@ -1212,16 +1212,9 @@
                                        /*}*/
                                } else { /* normal non bit curves */
                                        if(ei->flag & IPO_EDIT) {
-                                               if(ei->icu->ipo==IPO_BEZ) {
-                                                       /* Draw the editmode 
hendels for a bezier curve */
-                                                       if( (bezt->f1 & SELECT) 
== sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
-                                                               
bglVertex3fv(bezt->vec[0]);
-                                                       
-                                                       if( (bezt->f3 & SELECT) 
== sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
-                                                               
bglVertex3fv(bezt->vec[2]);
-                                                       
-                                               }
-                                               
+                                               /* Only the vertex of the line, 
the
+                                                * handler are draw below.
+                                                */
                                                if( (bezt->f2 & SELECT) == sel) 
/* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
                                                        
bglVertex3fv(bezt->vec[1]);
                                                
@@ -1237,6 +1230,45 @@
                                bezt++;
                        }
                        bglEnd();
+
+                       if (ei->flag & IPO_EDIT) {
+                               /* Now draw the two vertex of the handler,
+                                * need split it because we can't call 
glPointSize
+                                * in the middle of a glBegin/glEnd also the
+                                * bug comment before.
+                                */
+                               a= ei->icu->totvert;
+                               bezt= ei->icu->bezt;
+
+                               
glPointSize(BIF_GetThemeValuef(TH_HANDLE_VERTEX_SIZE));
+
+                               if(sel) BIF_ThemeColor(TH_HANDLE_VERTEX_SELECT);
+                               else BIF_ThemeColor(TH_HANDLE_VERTEX);
+
+                               bglBegin(GL_POINTS);
+
+                               while(a--) {
+                                       if (ei->disptype!=IPO_DISPBITS) {
+                                               if(ei->flag & IPO_EDIT) {
+                                                       
if(ei->icu->ipo==IPO_BEZ) {
+                                                               /* Draw the 
editmode hendels for a bezier curve */
+                                                               if( (bezt->f1 & 
SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
+                                                                       
bglVertex3fv(bezt->vec[0]);
+                                                       
+                                                               if( (bezt->f3 & 
SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
+                                                                       
bglVertex3fv(bezt->vec[2]);
+                                                       }
+                                               }
+                                       }
+                                       bezt++;
+                               }
+                               bglEnd();
+
+                               /* The color are always reset (see the while)
+                                * but the point size not so we reset now.
+                                */
+                               glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
+                       }
                }
        }
        

Modified: branches/apricot/source/blender/src/resources.c
===================================================================
--- branches/apricot/source/blender/src/resources.c     2008-08-21 22:57:25 UTC 
(rev 16216)
+++ branches/apricot/source/blender/src/resources.c     2008-08-21 23:41:08 UTC 
(rev 16217)
@@ -313,7 +313,15 @@
                                cp= ts->transition; break;
                        case TH_SEQ_META:
                                cp= ts->meta; break;
-                               
+                       case TH_HANDLE_VERTEX:
+                               cp= ts->handle_vertex;
+                               break;
+                       case TH_HANDLE_VERTEX_SELECT:
+                               cp= ts->handle_vertex_select;
+                               break;
+                       case TH_HANDLE_VERTEX_SIZE:
+                               cp= &ts->handle_vertex_size;
+                               break;
                        }
 
                }
@@ -493,6 +501,10 @@
        SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255); 
        btheme->tipo.vertex_size= 3;
 
+       SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255);
+       SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255);
+       btheme->tipo.handle_vertex_size= 3;
+
        /* space file */
        /* to have something initialized */
        btheme->tfile= btheme->tv3d;
@@ -684,7 +696,10 @@
                        str += sprintf(str, "Vertex %%x%d|", TH_VERTEX);
                        str += sprintf(str, "Vertex Selected %%x%d|", 
TH_VERTEX_SELECT);
                        str += sprintf(str, "Vertex Size %%x%d|", 
TH_VERTEX_SIZE);
-                       str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
+                       str += sprintf(str, "Current Frame %%x%d|", TH_CFRAME);
+                       str += sprintf(str, "Handle Vertex %%x%d|", 
TH_HANDLE_VERTEX);
+                       str += sprintf(str, "Handle Vertex Selected %%x%d|", 
TH_HANDLE_VERTEX_SELECT);
+                       str += sprintf(str, "Handle Vertex Size %%x%d", 
TH_HANDLE_VERTEX_SIZE);
                        break;
                case SPACE_FILE:
                        str += sprintf(str, "Selected file %%x%d", TH_HILITE);

Modified: branches/apricot/source/blender/src/space.c
===================================================================
--- branches/apricot/source/blender/src/space.c 2008-08-21 22:57:25 UTC (rev 
16216)
+++ branches/apricot/source/blender/src/space.c 2008-08-21 23:41:08 UTC (rev 
16217)
@@ -3501,6 +3501,9 @@
                uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, 
NULL);
                                                                        
        }
+       else if(th_curcol==TH_HANDLE_VERTEX_SIZE) {
+               uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Handle size ", 
465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
+       }
        else {
                uiBlockBeginAlign(block);
                if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, 
TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) {

Modified: branches/apricot/source/blender/src/usiblender.c
===================================================================
--- branches/apricot/source/blender/src/usiblender.c    2008-08-21 22:57:25 UTC 
(rev 16216)
+++ branches/apricot/source/blender/src/usiblender.c    2008-08-21 23:41:08 UTC 
(rev 16217)
@@ -478,7 +478,15 @@
        if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && 
G.main->subversionfile < 16)) {
                U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
        }
-       
+       if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && 
G.main->subversionfile < 1)) {
+               bTheme *btheme;
+               for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+                       SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 
255);
+                       SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 
0x70, 255);
+                       btheme->tipo.handle_vertex_size= 3;
+               }
+       }
+
        /* GL Texture Garbage Collection (variable abused above!) */
        if (U.textimeout == 0) {
                U.texcollectrate = 60;

Modified: 
branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
===================================================================
--- branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp     
2008-08-21 22:57:25 UTC (rev 16216)
+++ branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp     
2008-08-21 23:41:08 UTC (rev 16217)
@@ -98,8 +98,8 @@
 #include "GHOST_IEventConsumer.h"
 #include "GHOST_IWindow.h"
 #include "GHOST_Rect.h"
+#include "marshal.h"
 
-
 static void frameTimerProc(GHOST_ITimerTask* task, GHOST_TUns64 time);
 
 static GHOST_ISystem* fSystem = 0;
@@ -127,7 +127,9 @@
          m_networkdevice(0), 
          m_audiodevice(0),
          m_blendermat(0),
-         m_blenderglslmat(0)
+         m_blenderglslmat(0),
+         m_pyGlobalDictString(0),
+         m_pyGlobalDictString_Length(0)
 {
        fSystem = system;
 }
@@ -655,14 +657,23 @@
                PyObject* dictionaryobject = 
initGamePlayerPythonScripting("Ketsji", psl_Lowest);
                m_ketsjiengine->SetPythonDictionary(dictionaryobject);
                initRasterizer(m_rasterizer, m_canvas);
-               PyDict_SetItemString(dictionaryobject, "GameLogic", 
initGameLogic(m_ketsjiengine, startscene)); // Same as importing the module
+               PyObject *gameLogic = initGameLogic(m_ketsjiengine, startscene);
+               PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); 
// Same as importing the module
                initGameKeys();
                initPythonConstraintBinding();
                initMathutils();
 
-
-
-
+               /* Restore the dict */
+               if (m_pyGlobalDictString) {
+                       PyObject* pyGlobalDict = 
PyMarshal_ReadObjectFromString(m_pyGlobalDictString, 
m_pyGlobalDictString_Length);
+                       if (pyGlobalDict) {
+                               
PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); 
// Same as importing the module.
+                       } else {
+                               PyErr_Clear();
+                               printf("Error could not marshall string\n");
+                       }
+               }
+               
                m_sceneconverter->ConvertScene(
                        startscenename,
                        startscene,
@@ -698,6 +709,32 @@
 
 void GPG_Application::stopEngine()
 {
+       // get the python dict and convert to a string for future use
+       {
+               SetPyGlobalDictMarshal(NULL, 0);
+               
+               PyObject* gameLogic = PyImport_ImportModule("GameLogic");
+               if (gameLogic) {
+                       PyObject* pyGlobalDict = 
PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as 
importing the module
+                       if (pyGlobalDict) {
+                               PyObject* pyGlobalDictMarshal = 
PyMarshal_WriteObjectToString(  pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as 
of Py2.5
+                               if (pyGlobalDictMarshal) {
+                                       m_pyGlobalDictString_Length = 
PyString_Size(pyGlobalDictMarshal);
+                                       PyObject_Print(pyGlobalDictMarshal, 
stderr, 0);
+                                       m_pyGlobalDictString = static_cast<char 
*> (malloc(m_pyGlobalDictString_Length));
+                                       memcpy(m_pyGlobalDictString, 
PyString_AsString(pyGlobalDictMarshal), m_pyGlobalDictString_Length);
+                               } else {
+                                       printf("Error, GameLogic.globalDict 
could not be marshal'd\n");
+                               }
+                       } else {
+                               printf("Error, GameLogic.globalDict was 
removed\n");
+                       }
+               } else {
+                       printf("Error, GameLogic failed to import 
GameLogic.globalDict will be lost\n");
+               }
+       }       
+       
+       
        // when exiting the mainloop
        exitGamePythonScripting();
        m_ketsjiengine->StopEngine();


@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to