[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22222] branches/soundsystem: Merge to revision 22221 of 2.5 branch.
Jörg Müller
nexyon at gmail.com
Wed Aug 5 11:45:53 CEST 2009
Revision: 22222
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22222
Author: nexyon
Date: 2009-08-05 11:45:52 +0200 (Wed, 05 Aug 2009)
Log Message:
-----------
Merge to revision 22221 of 2.5 branch.
Revision Links:
--------------
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22221
Modified Paths:
--------------
branches/soundsystem/intern/ghost/intern/GHOST_EventManager.cpp
branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.cpp
branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.h
branches/soundsystem/intern/ghost/intern/GHOST_WindowManager.cpp
branches/soundsystem/intern/ghost/intern/GHOST_WindowX11.cpp
branches/soundsystem/source/blender/blenkernel/intern/anim_sys.c
branches/soundsystem/source/blender/blenloader/intern/readfile.c
branches/soundsystem/source/blender/makesrna/intern/rna_object.c
branches/soundsystem/source/blender/windowmanager/intern/wm_init_exit.c
branches/soundsystem/source/blender/windowmanager/intern/wm_window.c
branches/soundsystem/source/blender/windowmanager/wm_window.h
Modified: branches/soundsystem/intern/ghost/intern/GHOST_EventManager.cpp
===================================================================
--- branches/soundsystem/intern/ghost/intern/GHOST_EventManager.cpp 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/intern/ghost/intern/GHOST_EventManager.cpp 2009-08-05 09:45:52 UTC (rev 22222)
@@ -51,6 +51,15 @@
GHOST_EventManager::~GHOST_EventManager()
{
disposeEvents();
+
+ TConsumerVector::iterator iter= m_consumers.begin();
+ while (iter != m_consumers.end())
+ {
+ GHOST_IEventConsumer* consumer = *iter;
+ delete consumer;
+ m_consumers.erase(iter);
+ iter = m_consumers.begin();
+ }
}
Modified: branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.cpp 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.cpp 2009-08-05 09:45:52 UTC (rev 22222)
@@ -148,6 +148,13 @@
}
+GHOST_SystemX11::
+~GHOST_SystemX11()
+{
+ XCloseDisplay(m_display);
+}
+
+
GHOST_TSuccess
GHOST_SystemX11::
init(
Modified: branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.h
===================================================================
--- branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.h 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/intern/ghost/intern/GHOST_SystemX11.h 2009-08-05 09:45:52 UTC (rev 22222)
@@ -59,6 +59,12 @@
GHOST_SystemX11(
);
+ /**
+ * Destructor.
+ */
+ virtual ~GHOST_SystemX11();
+
+
GHOST_TSuccess
init(
);
Modified: branches/soundsystem/intern/ghost/intern/GHOST_WindowManager.cpp
===================================================================
--- branches/soundsystem/intern/ghost/intern/GHOST_WindowManager.cpp 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/intern/ghost/intern/GHOST_WindowManager.cpp 2009-08-05 09:45:52 UTC (rev 22222)
@@ -54,6 +54,7 @@
GHOST_WindowManager::~GHOST_WindowManager()
{
+ /* m_windows is freed by GHOST_System::disposeWindow */
}
Modified: branches/soundsystem/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- branches/soundsystem/intern/ghost/intern/GHOST_WindowX11.cpp 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/intern/ghost/intern/GHOST_WindowX11.cpp 2009-08-05 09:45:52 UTC (rev 22222)
@@ -1325,13 +1325,12 @@
int fg_color,
int bg_color
){
+ Colormap colormap= DefaultColormap(m_display, DefaultScreen(m_display));
Pixmap bitmap_pix, mask_pix;
XColor fg, bg;
- if(XAllocNamedColor(m_display, DefaultColormap(m_display, DefaultScreen(m_display)),
- "White", &fg, &fg) == 0) return GHOST_kFailure;
- if(XAllocNamedColor(m_display, DefaultColormap(m_display, DefaultScreen(m_display)),
- "Black", &bg, &bg) == 0) return GHOST_kFailure;
+ if(XAllocNamedColor(m_display, colormap, "White", &fg, &fg) == 0) return GHOST_kFailure;
+ if(XAllocNamedColor(m_display, colormap, "Black", &bg, &bg) == 0) return GHOST_kFailure;
if (m_custom_cursor) {
XFreeCursor(m_display, m_custom_cursor);
@@ -1347,6 +1346,9 @@
XFreePixmap(m_display, bitmap_pix);
XFreePixmap(m_display, mask_pix);
+ XFreeColors(m_display, colormap, &fg.pixel, 1, 0L);
+ XFreeColors(m_display, colormap, &bg.pixel, 1, 0L);
+
return GHOST_kSuccess;
}
Modified: branches/soundsystem/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/soundsystem/source/blender/blenkernel/intern/anim_sys.c 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/source/blender/blenkernel/intern/anim_sys.c 2009-08-05 09:45:52 UTC (rev 22222)
@@ -1202,6 +1202,7 @@
NlaTrack *nlt;
short track_index=0;
+ short has_strips = 0;
ListBase estrips= {NULL, NULL};
ListBase echannels= {NULL, NULL};
@@ -1223,6 +1224,12 @@
if (nlt->flag & NLATRACK_MUTED)
continue;
+ /* if this track has strips (but maybe they won't be suitable), set has_strips
+ * - used for mainly for still allowing normal action evaluation...
+ */
+ if (nlt->strips.first)
+ has_strips= 1;
+
/* otherwise, get strip to evaluate for this channel */
nes= nlastrips_ctime_get_strip(&estrips, &nlt->strips, track_index, ctime);
if (nes) nes->track= nlt;
@@ -1232,23 +1239,33 @@
* - only do this if we're not exclusively evaluating the 'solo' NLA-track
*/
if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) {
- /* make dummy NLA strip, and add that to the stack */
- memset(&dummy_strip, 0, sizeof(NlaStrip));
- dummy_trackslist.first= dummy_trackslist.last= &dummy_strip;
-
- dummy_strip.act= adt->action;
- dummy_strip.remap= adt->remap;
-
- calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1);
- dummy_strip.start = dummy_strip.actstart;
- dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
-
- dummy_strip.blendmode= adt->act_blendmode;
- dummy_strip.extendmode= adt->act_extendmode;
- dummy_strip.influence= adt->act_influence;
-
- /* add this to our list of evaluation strips */
- nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, -1, ctime);
+ /* if there are strips, evaluate action as per NLA rules */
+ if (has_strips) {
+ /* make dummy NLA strip, and add that to the stack */
+ memset(&dummy_strip, 0, sizeof(NlaStrip));
+ dummy_trackslist.first= dummy_trackslist.last= &dummy_strip;
+
+ dummy_strip.act= adt->action;
+ dummy_strip.remap= adt->remap;
+
+ // FIXME: what happens when we want to included F-Modifier access?
+ calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1);
+ dummy_strip.start = dummy_strip.actstart;
+ dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
+
+ dummy_strip.blendmode= adt->act_blendmode;
+ dummy_strip.extendmode= adt->act_extendmode;
+ dummy_strip.influence= adt->act_influence;
+
+ /* add this to our list of evaluation strips */
+ nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, -1, ctime);
+ }
+ else {
+ /* special case - evaluate as if there isn't any NLA data */
+ // TODO: this is really just a stop-gap measure...
+ animsys_evaluate_action(ptr, adt->action, adt->remap, ctime);
+ return;
+ }
}
/* only continue if there are strips to evaluate */
Modified: branches/soundsystem/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soundsystem/source/blender/blenloader/intern/readfile.c 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/source/blender/blenloader/intern/readfile.c 2009-08-05 09:45:52 UTC (rev 22222)
@@ -10626,7 +10626,7 @@
}
}
- if(idcode==ID_OB) { /* loose object: give a base */
+ if(idcode==ID_OB && scene) { /* loose object: give a base */
base= MEM_callocN( sizeof(Base), "app_nam_part");
BLI_addtail(&scene->base, base);
@@ -10766,7 +10766,8 @@
if(fd) fd->reports= NULL;
/* do we need to do this? */
- DAG_scene_sort(scene);
+ if(scene)
+ DAG_scene_sort(scene);
*bh= (BlendHandle*)fd;
}
Modified: branches/soundsystem/source/blender/makesrna/intern/rna_object.c
===================================================================
--- branches/soundsystem/source/blender/makesrna/intern/rna_object.c 2009-08-05 07:59:49 UTC (rev 22221)
+++ branches/soundsystem/source/blender/makesrna/intern/rna_object.c 2009-08-05 09:45:52 UTC (rev 22222)
@@ -57,6 +57,7 @@
#include "DNA_key_types.h"
#include "BKE_armature.h"
+#include "BKE_bullet.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
@@ -479,6 +480,86 @@
strcpy(str, "");
}
+/* why does this have to be so complicated?, can't all this crap be
+ * moved to in BGE conversion function? - Campbell *
+ *
+ * logic from check_body_type()
+ * */
+static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+
+ /* determine the body_type setting based on flags */
+ if (!(ob->gameflag & OB_COLLISION)) {
+ if (ob->gameflag & OB_OCCLUDER) {
+ ob->body_type = OB_BODY_TYPE_OCCLUDER;
+ } else {
+ ob->body_type = OB_BODY_TYPE_NO_COLLISION;
+ }
+ } else if (ob->gameflag & OB_SENSOR) {
+ ob->body_type = OB_BODY_TYPE_SENSOR;
+ } else if (!(ob->gameflag & OB_DYNAMIC)) {
+ ob->body_type = OB_BODY_TYPE_STATIC;
+ } else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) {
+ ob->body_type = OB_BODY_TYPE_DYNAMIC;
+ } else if (ob->gameflag & OB_RIGID_BODY) {
+ ob->body_type = OB_BODY_TYPE_RIGID;
+ } else {
+ ob->body_type = OB_BODY_TYPE_SOFT;
+ /* create the structure here because we display soft body buttons in the main panel */
+ if (!ob->bsoft)
+ ob->bsoft = bsbNew();
+ }
+
+ return ob->body_type;
+}
+
+static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ ob->body_type= value;
+
+ switch (ob->body_type) {
+ case OB_BODY_TYPE_SENSOR:
+ ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST;
+ ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE);
+ break;
+ case OB_BODY_TYPE_OCCLUDER:
+ ob->gameflag |= OB_OCCLUDER;
+ ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_DYNAMIC);
+ break;
+ case OB_BODY_TYPE_NO_COLLISION:
+ ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC);
+ break;
+ case OB_BODY_TYPE_STATIC:
+ ob->gameflag |= OB_COLLISION;
+ ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ case OB_BODY_TYPE_DYNAMIC:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR;
+ ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ case OB_BODY_TYPE_RIGID:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR;
+ ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ default:
+ case OB_BODY_TYPE_SOFT:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR;
+ ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR);
+
+ /* assume triangle mesh, if no bounds chosen for soft body */
+ if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_POLYH))
+ {
+ ob->boundtype=OB_BOUND_POLYH;
+ }
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list