[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15385] trunk/blender/intern:

2008-06-29 Thread Brecht Van Lommel
Revision: 15385
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15385
Author:   blendix
Date: 2008-06-29 22:53:17 +0200 (Sun, 29 Jun 2008)

Log Message:
---

Fix for bug #8680: GameLogic.getRandomFloat() returns very small
values on 64 bit, instead of range 0..1. Also a warning fix.

Modified Paths:
--
trunk/blender/intern/iksolver/intern/IK_QTask.h
trunk/blender/intern/moto/include/MT_random.h
trunk/blender/intern/moto/intern/MT_random.cpp

Modified: trunk/blender/intern/iksolver/intern/IK_QTask.h
===
--- trunk/blender/intern/iksolver/intern/IK_QTask.h 2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/iksolver/intern/IK_QTask.h 2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -74,7 +74,7 @@
 
virtual bool PositionTask() const { return false; }
 
-   virtual void Scale(float scale) {}
+   virtual void Scale(float) {}
 
 protected:
int m_id;

Modified: trunk/blender/intern/moto/include/MT_random.h
===
--- trunk/blender/intern/moto/include/MT_random.h   2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/moto/include/MT_random.h   2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -31,10 +31,10 @@
 
 #include limits.h
 
-#define MT_RAND_MAX ULONG_MAX
+#define MT_RAND_MAX UINT_MAX
 
-extern void  MT_srand(unsigned long);
-extern unsigned long MT_rand();
+extern void  MT_srand(unsigned int);
+extern unsigned int  MT_rand();
 
 #endif
 

Modified: trunk/blender/intern/moto/intern/MT_random.cpp
===
--- trunk/blender/intern/moto/intern/MT_random.cpp  2008-06-29 15:11:35 UTC 
(rev 15384)
+++ trunk/blender/intern/moto/intern/MT_random.cpp  2008-06-29 20:53:17 UTC 
(rev 15385)
@@ -76,11 +76,11 @@
 #define TEMPERING_SHIFT_T(y)  (y  15)
 #define TEMPERING_SHIFT_L(y)  (y  18)
 
-static unsigned long mt[N]; /* the array for the state vector  */
+static unsigned int mt[N]; /* the array for the state vector  */
 static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */
 
 /* initializing the array with a NONZERO seed */
-void MT_srand(unsigned long seed)
+void MT_srand(unsigned int seed)
 {
 /* setting initial seeds to mt[N] using */
 /* the generator Line 25 of Table 1 in  */
@@ -91,12 +91,12 @@
 mt[mti] = (69069 * mt[mti-1])  0x;
 }
 
-unsigned long MT_rand()
+unsigned int MT_rand()
 {
-static unsigned long mag01[2] = { 0x0, MATRIX_A };
+static unsigned int mag01[2] = { 0x0, MATRIX_A };
 /* mag01[x] = x * MATRIX_A  for x=0,1 */
 
-unsigned long y;
+unsigned int y;
 
 if (mti = N) { /* generate N words at one time */
 int kk;


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15387] trunk/blender/source:

2008-06-29 Thread Brecht Van Lommel
Revision: 15387
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15387
Author:   blendix
Date: 2008-06-29 23:51:27 +0200 (Sun, 29 Jun 2008)

Log Message:
---

Fix for bug #7753: after game engine drawing with vertex arrays,
nurbs/curves/text dissappears.

This also removes the vertex arrays option and enables it always
for OpenGL version = 1.1 - there's no need to have an option to
make things render faster disabled by default, also it should work
stable now.

Modified Paths:
--
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/src/drawview.c
trunk/blender/source/blender/src/space.c
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2008-06-29 
21:06:18 UTC (rev 15386)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2008-06-29 
21:51:27 UTC (rev 15387)
@@ -310,7 +310,7 @@
 #defineUSER_DUP_ACT(1  10)
 
 /* gameflags */
-#define USER_VERTEX_ARRAYS 1
+#define USER_DEPRECATED_FLAG   1
 #define USER_DISABLE_SOUND 2
 #define USER_DISABLE_MIPMAP4
 

Modified: trunk/blender/source/blender/src/drawview.c
===
--- trunk/blender/source/blender/src/drawview.c 2008-06-29 21:06:18 UTC (rev 
15386)
+++ trunk/blender/source/blender/src/drawview.c 2008-06-29 21:51:27 UTC (rev 
15387)
@@ -246,7 +246,8 @@
glDisable(GL_COLOR_MATERIAL);
 }
 
-/* also called when render 'ogl' */
+/* also called when render 'ogl'
+   keep synced with Myinit_gl_stuff in the game engine! */
 void init_gl_stuff(void)   
 {
float mat_ambient[] = { 0.0, 0.0, 0.0, 0.0 };

Modified: trunk/blender/source/blender/src/space.c
===
--- trunk/blender/source/blender/src/space.c2008-06-29 21:06:18 UTC (rev 
15386)
+++ trunk/blender/source/blender/src/space.c2008-06-29 21:51:27 UTC (rev 
15387)
@@ -378,9 +378,6 @@

if ( (syshandle = SYS_GetSystem()) ) {
/* User defined settings */
-   a= (U.gameflags  USER_VERTEX_ARRAYS);
-   SYS_WriteCommandLineInt(syshandle, vertexarrays, a);
-
a= (U.gameflags  USER_DISABLE_SOUND);
SYS_WriteCommandLineInt(syshandle, noaudio, a);
 
@@ -4255,15 +4252,11 @@
uiDefButS(block, MENU, B_GLRESLIMITCHANGED, GL Texture Clamp 
Off%x0|%l|GL Texture Clamp 8192%x8192|GL Texture Clamp 4096%x4096|GL Texture 
Clamp 2048%x2048|GL Texture Clamp 1024%x1024|GL Texture Clamp 512%x512|GL 
Texture Clamp 256%x256|GL Texture Clamp 128%x128,

(xpos+edgsp+(5*mpref)+(5*midsp)),y4,mpref,buth, 
(U.glreslimit), 0, 0, 0, 0, Limit the texture size to save graphics memory);

-   uiDefButBitI(block, TOG, USER_VERTEX_ARRAYS, 0, Vertex Arrays,
-   (xpos+edgsp+(5*mpref)+(5*midsp)),y3,mpref,buth,
-   (U.gameflags), 0, 0, 0, 0, Toggles between vertex 
arrays on (less reliable) and off (more reliable));
-
uiDefButI(block, NUM, 0, Time Out ,
-   (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth, 
+   (xpos+edgsp+(5*mpref)+(5*midsp)), y3, mpref, buth, 
U.textimeout, 0.0, 3600.0, 30, 2, Time since last 
access of a GL texture in seconds after which it is freed. (Set to 0 to keep 
textures allocated));
uiDefButI(block, NUM, 0, Collect Rate ,
-   (xpos+edgsp+(5*mpref)+(5*midsp)), y1, mpref, buth, 
+   (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth, 
U.texcollectrate, 1.0, 3600.0, 30, 2, Number of 
seconds between each run of the GL texture garbage collector.);
 
/* *** */

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 
2008-06-29 21:06:18 UTC (rev 15386)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 
2008-06-29 21:51:27 UTC (rev 15387)
@@ -165,20 +165,14 @@
RAS_IRenderTools* rendertools = new 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15388] trunk/blender/source: BGE python api addition, GameObject get/setState and Controller.getState()

2008-06-29 Thread Campbell Barton
Revision: 15388
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15388
Author:   campbellbarton
Date: 2008-06-29 23:52:23 +0200 (Sun, 29 Jun 2008)

Log Message:
---
BGE python api addition, GameObject get/setState and Controller.getState()
Also added a note in the tooltip for action priority when using more then 1 
action at a time.

Modified Paths:
--
trunk/blender/source/blender/src/buttons_logic.c
trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp
trunk/blender/source/gameengine/GameLogic/SCA_PythonController.h
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
trunk/blender/source/gameengine/PyDoc/SCA_PythonController.py

Modified: trunk/blender/source/blender/src/buttons_logic.c
===
--- trunk/blender/source/blender/src/buttons_logic.c2008-06-29 21:51:27 UTC 
(rev 15387)
+++ trunk/blender/source/blender/src/buttons_logic.c2008-06-29 21:52:23 UTC 
(rev 15388)
@@ -1703,7 +1703,7 @@
}

uiDefButI(block, NUM, 0, Blendin: , xco+30, yco-64, 
(width-60)/2, 19, aa-blendin, 0.0, MAXFRAMEF, 0.0, 0.0, Number of frames of 
motion blending);
-   uiDefButS(block, NUM, 0, Priority: , 
xco+30+(width-60)/2, yco-64, (width-60)/2, 19, aa-priority, 0.0, 100.0, 0.0, 
0.0, Execution priority - lower numbers will override actions with higher 
numbers);
+   uiDefButS(block, NUM, 0, Priority: , 
xco+30+(width-60)/2, yco-64, (width-60)/2, 19, aa-priority, 0.0, 100.0, 0.0, 
0.0, Execution priority - lower numbers will override actions with higher 
numbers, With 2 or more actions at once, the overriding clannels must be lower 
in the stack);

uiDefBut(block, TEX, 0, FrameProp: ,xco+30, yco-84, 
width-60, 19, aa-frameProp, 0.0, 31.0, 0, 0, Assign this property this 
actions current frame number);  
 

Modified: trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp
===
--- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp  
2008-06-29 21:51:27 UTC (rev 15387)
+++ trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp  
2008-06-29 21:52:23 UTC (rev 15388)
@@ -232,6 +232,7 @@
METH_VARARGS, SCA_PythonController::GetSensor_doc},
{getScript, (PyCFunction) SCA_PythonController::sPyGetScript, 
METH_VARARGS},
{setScript, (PyCFunction) SCA_PythonController::sPySetScript, 
METH_VARARGS},
+   {getState, (PyCFunction) SCA_PythonController::sPyGetState, 
METH_VARARGS},
{NULL,NULL} //Sentinel
 };
 
@@ -442,4 +443,12 @@
Py_Return;
 }
 
+/* 1. getScript */
+PyObject* SCA_PythonController::PyGetState(PyObject* self, 
+   
   PyObject* args, 
+   
   PyObject* kwds)
+{
+   return PyInt_FromLong(m_statemask);
+}
+
 /* eof */

Modified: trunk/blender/source/gameengine/GameLogic/SCA_PythonController.h
===
--- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.h
2008-06-29 21:51:27 UTC (rev 15387)
+++ trunk/blender/source/gameengine/GameLogic/SCA_PythonController.h
2008-06-29 21:52:23 UTC (rev 15388)
@@ -81,6 +81,7 @@
KX_PYMETHOD_DOC(SCA_PythonController,GetActuators);
KX_PYMETHOD(SCA_PythonController,SetScript);
KX_PYMETHOD(SCA_PythonController,GetScript);
+   KX_PYMETHOD(SCA_PythonController,GetState);

 
 };

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-06-29 
21:51:27 UTC (rev 15387)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-06-29 
21:52:23 UTC (rev 15388)
@@ -804,6 +804,8 @@
 PyMethodDef KX_GameObject::Methods[] = {
{setVisible,(PyCFunction) KX_GameObject::sPySetVisible, 
METH_VARARGS},  
{getVisible,(PyCFunction) KX_GameObject::sPyGetVisible, 
METH_VARARGS},  
+   {setState,(PyCFunction) KX_GameObject::sPySetState, METH_VARARGS},
+   {getState,(PyCFunction) KX_GameObject::sPyGetState, METH_VARARGS},
{alignAxisToVect,(PyCFunction) KX_GameObject::sPyAlignAxisToVect, 
METH_VARARGS},
{setPosition, (PyCFunction) KX_GameObject::sPySetPosition, 
METH_VARARGS},
{getPosition, (PyCFunction) KX_GameObject::sPyGetPosition, 
METH_VARARGS},
@@ -1117,7 +1119,40 @@
return PyInt_FromLong(m_bVisible);  
 }
 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15389] branches/apricot: svn merge -r15360:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

2008-06-29 Thread Campbell Barton
Revision: 15389
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15389
Author:   campbellbarton
Date: 2008-06-30 00:08:23 +0200 (Mon, 30 Jun 2008)

Log Message:
---
svn  merge  -r15360:HEAD 
https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--
branches/apricot/intern/iksolver/intern/IK_QTask.h
branches/apricot/intern/moto/include/MT_random.h
branches/apricot/intern/moto/intern/MT_random.cpp
branches/apricot/source/blender/blenkernel/intern/image.c
branches/apricot/source/blender/blenkernel/intern/ipo.c
branches/apricot/source/blender/blenkernel/intern/text.c
branches/apricot/source/blender/imbuf/intern/IMB_anim.h
branches/apricot/source/blender/imbuf/intern/anim.c
branches/apricot/source/blender/makesdna/DNA_actuator_types.h
branches/apricot/source/blender/makesdna/DNA_userdef_types.h
branches/apricot/source/blender/nodes/intern/CMP_nodes/CMP_math.c
branches/apricot/source/blender/src/buttons_logic.c
branches/apricot/source/blender/src/drawaction.c
branches/apricot/source/blender/src/drawview.c
branches/apricot/source/blender/src/editaction.c
branches/apricot/source/blender/src/editfont.c
branches/apricot/source/blender/src/poseobject.c
branches/apricot/source/blender/src/space.c
branches/apricot/source/blender/src/view.c
branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
branches/apricot/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
branches/apricot/source/gameengine/GameLogic/SCA_2DFilterActuator.h
branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp
branches/apricot/source/gameengine/GameLogic/SCA_PythonController.h
branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.h
branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
branches/apricot/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
branches/apricot/source/gameengine/PyDoc/KX_GameObject.py
branches/apricot/source/gameengine/PyDoc/SCA_PythonController.py
branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.h
branches/apricot/source/gameengine/Rasterizer/RAS_IRenderTools.h

branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp

Modified: branches/apricot/intern/iksolver/intern/IK_QTask.h
===
--- branches/apricot/intern/iksolver/intern/IK_QTask.h  2008-06-29 21:52:23 UTC 
(rev 15388)
+++ branches/apricot/intern/iksolver/intern/IK_QTask.h  2008-06-29 22:08:23 UTC 
(rev 15389)
@@ -74,7 +74,7 @@
 
virtual bool PositionTask() const { return false; }
 
-   virtual void Scale(float scale) {}
+   virtual void Scale(float) {}
 
 protected:
int m_id;

Modified: branches/apricot/intern/moto/include/MT_random.h
===
--- branches/apricot/intern/moto/include/MT_random.h2008-06-29 21:52:23 UTC 
(rev 15388)
+++ branches/apricot/intern/moto/include/MT_random.h2008-06-29 22:08:23 UTC 
(rev 15389)
@@ -31,10 +31,10 @@
 
 #include limits.h
 
-#define MT_RAND_MAX ULONG_MAX
+#define MT_RAND_MAX UINT_MAX
 
-extern void  MT_srand(unsigned long);
-extern unsigned long MT_rand();
+extern void  MT_srand(unsigned int);
+extern unsigned int  MT_rand();
 
 #endif
 

Modified: branches/apricot/intern/moto/intern/MT_random.cpp
===
--- branches/apricot/intern/moto/intern/MT_random.cpp   2008-06-29 21:52:23 UTC 
(rev 15388)
+++ branches/apricot/intern/moto/intern/MT_random.cpp   2008-06-29 22:08:23 UTC 
(rev 15389)
@@ -76,11 +76,11 @@
 #define TEMPERING_SHIFT_T(y)  (y  15)
 #define TEMPERING_SHIFT_L(y)  (y  18)
 
-static unsigned long mt[N]; /* the array for the state vector  */
+static unsigned int mt[N]; /* the array for the state vector  */
 static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */
 
 /* initializing the array with a NONZERO seed */
-void MT_srand(unsigned long seed)
+void MT_srand(unsigned int seed)
 {
 /* setting initial seeds to mt[N] using */
 /* the generator Line 25 of Table 1 in  */
@@ -91,12 +91,12 @@
 mt[mti] = (69069 * mt[mti-1])