Merged changes in the trunk up to revision 39896.

This commit is contained in:
Tamito Kajiyama 2011-09-03 21:30:40 +00:00
commit fce8733975
127 changed files with 2060 additions and 1749 deletions

@ -948,7 +948,7 @@ elseif(APPLE)
# we use precompiled libraries for py 3.2 and up by default # we use precompiled libraries for py 3.2 and up by default
# normally cached but not since we include them with blender # normally cached but not since we include them with blender
set(PYTHON_VERSION 3.2) set(PYTHON_VERSION 3.2)
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
set(PYTHON_LIBRARY python${PYTHON_VERSION}) set(PYTHON_LIBRARY python${PYTHON_VERSION})

@ -1539,7 +1539,7 @@ Game Types (bge.types)
Return the value matching key, or the default value if its not found. Return the value matching key, or the default value if its not found.
:return: The key value or a default. :return: The key value or a default.
.. method:: playAction(name, start_frame, end_frame, layer=0, priority=0 blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0) .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
Plays an action. Plays an action.
@ -1556,7 +1556,7 @@ Game Types (bge.types)
:arg blendin: the amount of blending between this animation and the previous one on this layer :arg blendin: the amount of blending between this animation and the previous one on this layer
:type blendin: float :type blendin: float
:arg play_mode: the play mode :arg play_mode: the play mode
:type play_mode: KX_ACTION_PLAY, KX_ACTION_LOOP, or KX_ACTION_PING_PONG :type play_mode: KX_ACTION_MODE_PLAY, KX_ACTION_MODE_LOOP, or KX_ACTION_MODE_PING_PONG
:arg layer_weight: how much of the previous layer to use for blending (0 = add) :arg layer_weight: how much of the previous layer to use for blending (0 = add)
:type layer_weight: float :type layer_weight: float
:arg ipo_flags: flags for the old IPO behaviors (force, etc) :arg ipo_flags: flags for the old IPO behaviors (force, etc)

@ -0,0 +1,57 @@
###############
Tips and Tricks
###############
Some of these are just python features that scripters may not have thaught to use with blender.
****************
Use The Terminal
****************
For Linux and OSX users this means starting the terminal first, then running blender from within it. on Windows the terminal can be enabled from the help menu.
********************
Run External Scripts
********************
******************
Don't Use Blender!
******************
******************
Use External Tools
******************
**************
Bundled Python
**************
Blender from blender.org includes a compleate python installation on all platforms, this has the disadvantage that any extensions you have installed in you're systems python wont be found by blender.
There are 2 ways around this:
* remove blender python subdirectory, blender will then look for the systems python and use that instead **python version must match the one that blender comes with**.
* copy the extensions into blender's python subdirectry so blender can access them, you could also copy the entire python installation into blenders subdirectory, replacing the one blender comes with. This works as long as the python versions match and the paths are created in the same location relative locations. Doing this has the advantage that you can redistribute this bundle to others with blender and/or the game player, including any extensions you rely on.
********
Advanced
********
===================
Blender as a module
===================
============================
Python Safety (Build Option)
============================
=================
CTypes in Blender
=================

@ -70,7 +70,7 @@ GHOST_TSuccess GHOST_ISystemPaths::create()
# ifdef GHOST_COCOA # ifdef GHOST_COCOA
m_systemPaths = new GHOST_SystemPathsCocoa (); m_systemPaths = new GHOST_SystemPathsCocoa ();
# else # else
m_systemPaths = new GHOST_SystemPathsarbon (); m_systemPaths = new GHOST_SystemPathsCarbon ();
# endif # endif
# else # else
m_systemPaths = new GHOST_SystemPathsX11 (); m_systemPaths = new GHOST_SystemPathsX11 ();

@ -48,7 +48,9 @@
#include "GHOST_EventButton.h" #include "GHOST_EventButton.h"
#include "GHOST_EventCursor.h" #include "GHOST_EventCursor.h"
#include "GHOST_EventWheel.h" #include "GHOST_EventWheel.h"
#ifdef WITH_INPUT_NDOF
#include "GHOST_EventNDOF.h" #include "GHOST_EventNDOF.h"
#endif
#include "GHOST_TimerManager.h" #include "GHOST_TimerManager.h"
#include "GHOST_TimerTask.h" #include "GHOST_TimerTask.h"
@ -1101,7 +1103,9 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
GHOST_SystemCarbon* sys = (GHOST_SystemCarbon*) userData; GHOST_SystemCarbon* sys = (GHOST_SystemCarbon*) userData;
OSStatus err = eventNotHandledErr; OSStatus err = eventNotHandledErr;
GHOST_IWindow* window; GHOST_IWindow* window;
#ifdef WITH_INPUT_NDOF
GHOST_TEventNDOFData data; GHOST_TEventNDOFData data;
#endif
UInt32 kind; UInt32 kind;
switch (::GetEventClass(event)) switch (::GetEventClass(event))
@ -1122,6 +1126,7 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
err = sys->handleKeyEvent(event); err = sys->handleKeyEvent(event);
break; break;
case kEventClassBlender : case kEventClassBlender :
#ifdef WITH_INPUT_NDOF
window = sys->m_windowManager->getActiveWindow(); window = sys->m_windowManager->getActiveWindow();
sys->m_ndofManager->GHOST_NDOFGetDatas(data); sys->m_ndofManager->GHOST_NDOFGetDatas(data);
kind = ::GetEventKind(event); kind = ::GetEventKind(event);
@ -1137,6 +1142,7 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
// printf("button\n"); // printf("button\n");
break; break;
} }
#endif
err = noErr; err = noErr;
break; break;
default : default :

@ -88,7 +88,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED #define _UINTPTR_T_DEFINED
#endif #endif
#elif defined(__linux__) || defined(__NetBSD__) #elif defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */ /* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h> #include <stdint.h>

@ -319,7 +319,7 @@ void IK_QSegment::RemoveChild(IK_QSegment *child)
else { else {
IK_QSegment *seg = m_child; IK_QSegment *seg = m_child;
while (seg->m_sibling != child); while (seg->m_sibling != child)
seg = seg->m_sibling; seg = seg->m_sibling;
if (child == seg->m_sibling) if (child == seg->m_sibling)

@ -89,7 +89,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED #define _UINTPTR_T_DEFINED
#endif #endif
#elif defined(__linux__) || defined(__NetBSD__) #elif defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */ /* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h> #include <stdint.h>

@ -185,9 +185,13 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink") layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
if poselib: if poselib:
# list of poses in pose library
row = layout.row() row = layout.row()
row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5) row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
# column of operators for active pose
# - goes beside list
col = row.column(align=True) col = row.column(align=True)
col.active = (poselib.library is None) col.active = (poselib.library is None)
@ -202,8 +206,12 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
if pose_marker_active is not None: if pose_marker_active is not None:
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = pose_marker_active.name col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = pose_marker_active.name
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
layout.operator("poselib.action_sanitise") col.operator("poselib.action_sanitise", icon='HELP', text="") # XXX: put in menu?
# properties for active marker
if pose_marker_active is not None:
layout.prop(pose_marker_active, "name")
# TODO: this panel will soon be depreceated too # TODO: this panel will soon be depreceated too

@ -1487,8 +1487,8 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
sdis = clmd->coll_parms->distance_repel + epsilon2 + FLT_EPSILON; sdis = clmd->coll_parms->distance_repel + epsilon2 + FLT_EPSILON;
/*apply a repulsion force, to help the solver along. /* apply a repulsion force, to help the solver along.
this is kindof crude, it only tests one vert of the triangle*/ * this is kindof crude, it only tests one vert of the triangle */
if (isect_ray_plane_v3(cloth->verts[collpair->ap1].tx, n2, collmd->current_xnew[collpair->bp1].co, if (isect_ray_plane_v3(cloth->verts[collpair->ap1].tx, n2, collmd->current_xnew[collpair->bp1].co,
collmd->current_xnew[collpair->bp2].co, collmd->current_xnew[collpair->bp2].co,
collmd->current_xnew[collpair->bp3].co, &l, 0)) collmd->current_xnew[collpair->bp3].co, &l, 0))

@ -808,41 +808,65 @@ static void layerDefault_mcol(void *data, int count)
static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 0: CD_MVERT */
{sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 1: CD_MSTICKY */
{sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL, {sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL,
NULL}, NULL},
/* 2: CD_MDEFORMVERT */
{sizeof(MDeformVert), "MDeformVert", 1, NULL, layerCopy_mdeformvert, {sizeof(MDeformVert), "MDeformVert", 1, NULL, layerCopy_mdeformvert,
layerFree_mdeformvert, layerInterp_mdeformvert, NULL, NULL}, layerFree_mdeformvert, layerInterp_mdeformvert, NULL, NULL},
/* 3: CD_MEDGE */
{sizeof(MEdge), "MEdge", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MEdge), "MEdge", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 4: CD_MFACE */
{sizeof(MFace), "MFace", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MFace), "MFace", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 5: CD_MTFACE */
{sizeof(MTFace), "MTFace", 1, "UVTex", layerCopy_tface, NULL, {sizeof(MTFace), "MTFace", 1, "UVTex", layerCopy_tface, NULL,
layerInterp_tface, layerSwap_tface, layerDefault_tface}, layerInterp_tface, layerSwap_tface, layerDefault_tface},
/* 6: CD_MCOL */
/* 4 MCol structs per face */ /* 4 MCol structs per face */
{sizeof(MCol)*4, "MCol", 4, "Col", NULL, NULL, layerInterp_mcol, {sizeof(MCol)*4, "MCol", 4, "Col", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 7: CD_ORIGINDEX */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 8: CD_NORMAL */
/* 3 floats per normal vector */ /* 3 floats per normal vector */
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 9: CD_FLAGS */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 10: CD_PROP_FLT */
{sizeof(MFloatProperty), "MFloatProperty",1,"Float",NULL,NULL,NULL,NULL}, {sizeof(MFloatProperty), "MFloatProperty",1,"Float",NULL,NULL,NULL,NULL},
/* 11: CD_PROP_INT */
{sizeof(MIntProperty), "MIntProperty",1,"Int",NULL,NULL,NULL,NULL}, {sizeof(MIntProperty), "MIntProperty",1,"Int",NULL,NULL,NULL,NULL},
/* 12: CD_PROP_STR */
{sizeof(MStringProperty), "MStringProperty",1,"String",NULL,NULL,NULL,NULL}, {sizeof(MStringProperty), "MStringProperty",1,"String",NULL,NULL,NULL,NULL},
/* 13: CD_ORIGSPACE */
{sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVTex", layerCopy_origspace_face, NULL, {sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVTex", layerCopy_origspace_face, NULL,
layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face}, layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face},
/* 14: CD_ORCO */
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 15: CD_MTEXPOLY */
{sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL}, {sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL},
/* 16: CD_MLOOPUV */
{sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL}, {sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL},
/* 17: CD_MLOOPCOL */
{sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol}, {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol},
/* 18: CD_TANGENT */
{sizeof(float)*4*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(float)*4*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 19: CD_MDISPS */
{sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps, {sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps,
layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL, layerRead_mdisps, layerWrite_mdisps, layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL, layerRead_mdisps, layerWrite_mdisps,
layerFilesize_mdisps, layerValidate_mdisps}, layerFilesize_mdisps, layerValidate_mdisps},
/* 20: CD_WEIGHT_MCOL */
{sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol, {sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
{sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol, /* 21: CD_ID_MCOL */
{sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
{sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol, /* 22: CD_TEXTURE_MCOL */
{sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 23: CD_CLOTH_ORCO */
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL} {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}
}; };

@ -166,7 +166,7 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
} }
if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) { if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) {
PRINT(" edge %u: is a duplicate of, %u\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2))); PRINT(" edge %u: is a duplicate of, %d\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2)));
remove= do_fixes; remove= do_fixes;
} }

@ -359,6 +359,9 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker)
#endif #endif
{ {
strip->end = 10.0f; strip->end = 10.0f;
/* quiet compiler warnings */
(void)scene;
(void)speaker;
} }
/* general settings */ /* general settings */

@ -39,8 +39,10 @@
#include "BKE_sequencer.h" #include "BKE_sequencer.h"
#include "BKE_scene.h" #include "BKE_scene.h"
#ifdef WITH_AUDASPACE
// evil global ;-) // evil global ;-)
static int sound_cfra; static int sound_cfra;
#endif
struct bSound* sound_new_file(struct Main *bmain, const char *filename) struct bSound* sound_new_file(struct Main *bmain, const char *filename)
{ {
@ -760,5 +762,17 @@ void sound_seek_scene(struct bContext *UNUSED(C)) {}
float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; } float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
void sound_read_waveform(struct bSound* sound) { (void)sound; }
void sound_init_main(struct Main *bmain) { (void)bmain; }
void sound_set_cfra(int cfra) { (void)cfra; }
void sound_update_sequencer(struct Main* main, struct bSound* sound) { (void)main; (void)sound; }
void sound_update_scene(struct Scene* scene) { (void)scene; }
void sound_update_scene_sound(void* handle, struct bSound* sound) { (void)handle; (void)sound; }
void sound_update_scene_listener(struct Scene *scene) { (void)scene; }
void sound_update_fps(struct Scene *scene) { (void)scene; }
void sound_set_scene_sound_volume(void* handle, float volume, char animated) { (void)handle; (void)volume; (void)animated; }
void sound_set_scene_sound_pan(void* handle, float pan, char animated) { (void)handle; (void)pan; (void)animated; }
void sound_set_scene_volume(struct Scene *scene, float volume) { (void)scene; (void)volume; }
void sound_set_scene_sound_pitch(void* handle, float pitch, char animated) { (void)handle; (void)pitch; (void)animated; }
#endif // WITH_AUDASPACE #endif // WITH_AUDASPACE

@ -1968,7 +1968,7 @@ void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const fl
void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2]) void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
{ {
const double signed_area= (st0[0]*st1[1] - st0[1]*st1[0]) + (st1[0]*st2[1] - st1[1]*st2[0]) + const double signed_area= (st0[0]*st1[1] - st0[1]*st1[0]) + (st1[0]*st2[1] - st1[1]*st2[0]) +
(st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]); (st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]);
/* X is 2D cross product (determinant) /* X is 2D cross product (determinant)
A= (p0-p) X (p0-p3)*/ A= (p0-p) X (p0-p3)*/

@ -83,7 +83,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED #define _UINTPTR_T_DEFINED
#endif #endif
#elif defined(__linux__) || defined(__NetBSD__) #elif defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */ /* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h> #include <stdint.h>

@ -328,9 +328,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename, bool
//scale = RNA_struct_find_property(&unit_settings, "scale_length"); //scale = RNA_struct_find_property(&unit_settings, "scale_length");
std::string unitname = "meter"; std::string unitname = "meter";
float linearmeasure = 1.0f; float linearmeasure = RNA_float_get(&unit_settings, "scale_length");
linearmeasure = RNA_float_get(&unit_settings, "scale_length");
switch(RNA_property_enum_get(&unit_settings, system)) { switch(RNA_property_enum_get(&unit_settings, system)) {
case USER_UNIT_NONE: case USER_UNIT_NONE:
@ -368,8 +366,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename, bool
asset.setUnit(unitname, linearmeasure); asset.setUnit(unitname, linearmeasure);
asset.setUpAxisType(COLLADASW::Asset::Z_UP); asset.setUpAxisType(COLLADASW::Asset::Z_UP);
// TODO: need an Author field in userpref if(U.author[0] != '\0') {
if(strlen(U.author) > 0) {
asset.getContributor().mAuthor = U.author; asset.getContributor().mAuthor = U.author;
} }
else { else {

@ -90,32 +90,28 @@ std::string ExtraTags::asString( std::string tag, bool *ok)
void ExtraTags::setData(std::string tag, short *data) void ExtraTags::setData(std::string tag, short *data)
{ {
bool ok = false; bool ok = false;
int tmp = 0; int tmp = asInt(tag, &ok);
tmp = asInt(tag, &ok);
if(ok) if(ok)
*data = (short)tmp; *data = (short)tmp;
} }
void ExtraTags::setData(std::string tag, int *data) void ExtraTags::setData(std::string tag, int *data)
{ {
bool ok = false; bool ok = false;
int tmp = 0; int tmp = asInt(tag, &ok);
tmp = asInt(tag, &ok);
if(ok) if(ok)
*data = tmp; *data = tmp;
} }
void ExtraTags::setData(std::string tag, float *data) void ExtraTags::setData(std::string tag, float *data)
{ {
bool ok = false; bool ok = false;
float tmp = 0.0f; float tmp = asFloat(tag, &ok);
tmp = asFloat(tag, &ok);
if(ok) if(ok)
*data = tmp; *data = tmp;
} }
void ExtraTags::setData(std::string tag, char *data) void ExtraTags::setData(std::string tag, char *data)
{ {
bool ok = false; bool ok = false;
int tmp = 0; int tmp = asInt(tag, &ok);
tmp = asInt(tag, &ok);
if(ok) if(ok)
*data = (char)tmp; *data = (char)tmp;
} }

@ -1191,29 +1191,34 @@ static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDo
/* determine what animation data from AnimData block should get displayed */ /* determine what animation data from AnimData block should get displayed */
static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *id, int filter_mode) static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *id, int filter_mode)
{ {
IdAdtTemplate *iat = (IdAdtTemplate*)id;
AnimData *adt = BKE_animdata_from_id(id); AnimData *adt = BKE_animdata_from_id(id);
size_t items = 0; size_t items = 0;
/* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed /* image object datablocks have no anim-data so check for NULL */
* in a few places in he rest of the code still - notably for the few cases where special mode-based if(adt) {
* different types of data expanders are required. IdAdtTemplate *iat = (IdAdtTemplate*)id;
*/
ANIMDATA_FILTER_CASES(iat, /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed
{ /* AnimData */ * in a few places in he rest of the code still - notably for the few cases where special mode-based
/* specifically filter animdata block */ * different types of data expanders are required.
ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id); */
}, ANIMDATA_FILTER_CASES(iat,
{ /* NLA */ { /* AnimData */
items += animfilter_nla(ac, anim_data, ads, adt, filter_mode, id); /* specifically filter animdata block */
}, ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id);
{ /* Drivers */ },
items += animfilter_fcurves(anim_data, ads, adt->drivers.first, NULL, filter_mode, id); { /* NLA */
}, items += animfilter_nla(ac, anim_data, ads, adt, filter_mode, id);
{ /* Keyframes */ },
items += animfilter_action(ac, anim_data, ads, adt->action, filter_mode, id); { /* Drivers */
}); items += animfilter_fcurves(anim_data, ads, adt->drivers.first, NULL, filter_mode, id);
},
{ /* Keyframes */
items += animfilter_action(ac, anim_data, ads, adt->action, filter_mode, id);
}
);
}
return items; return items;
} }

@ -530,6 +530,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
{ {
bConstraint *con= NULL; bConstraint *con= NULL;
short searchtype= VISUALKEY_NONE; short searchtype= VISUALKEY_NONE;
short has_parent = FALSE;
char *identifier= NULL; char *identifier= NULL;
/* validate data */ /* validate data */
@ -548,6 +549,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
con= ob->constraints.first; con= ob->constraints.first;
identifier= (char *)RNA_property_identifier(prop); identifier= (char *)RNA_property_identifier(prop);
has_parent= (ob->parent != NULL);
} }
else if (ptr->type == &RNA_PoseBone) { else if (ptr->type == &RNA_PoseBone) {
/* Pose Channel */ /* Pose Channel */
@ -555,10 +557,11 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
con= pchan->constraints.first; con= pchan->constraints.first;
identifier= (char *)RNA_property_identifier(prop); identifier= (char *)RNA_property_identifier(prop);
has_parent= (pchan->parent != NULL);
} }
/* check if any data to search using */ /* check if any data to search using */
if (ELEM(NULL, con, identifier)) if (ELEM(NULL, con, identifier) && (has_parent == FALSE))
return 0; return 0;
/* location or rotation identifiers only... */ /* location or rotation identifiers only... */
@ -573,7 +576,12 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
/* only search if a searchtype and initial constraint are available */ /* only search if a searchtype and initial constraint are available */
if (searchtype && con) { if (searchtype) {
/* parent is always matching */
if (has_parent)
return 1;
/* constraints */
for (; con; con= con->next) { for (; con; con= con->next) {
/* only consider constraint if it is not disabled, and has influence */ /* only consider constraint if it is not disabled, and has influence */
if (con->flag & CONSTRAINT_DISABLE) continue; if (con->flag & CONSTRAINT_DISABLE) continue;
@ -645,39 +653,34 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_
if (ptr->type == &RNA_Object) { if (ptr->type == &RNA_Object) {
Object *ob= (Object *)ptr->data; Object *ob= (Object *)ptr->data;
/* parented objects are not supported, as the effects of the parent /* only Location or Rotation keyframes are supported now */
* are included in the matrix, which kindof beats the point if (strstr(identifier, "location")) {
*/ return ob->obmat[3][array_index];
if (ob->parent == NULL) { }
/* only Location or Rotation keyframes are supported now */ else if (strstr(identifier, "rotation_euler")) {
if (strstr(identifier, "location")) { float eul[3];
return ob->obmat[3][array_index];
} mat4_to_eulO(eul, ob->rotmode, ob->obmat);
else if (strstr(identifier, "rotation_euler")) { return eul[array_index];
float eul[3]; }
else if (strstr(identifier, "rotation_quaternion")) {
mat4_to_eulO(eul, ob->rotmode, ob->obmat); float trimat[3][3], quat[4];
return eul[array_index];
} copy_m3_m4(trimat, ob->obmat);
else if (strstr(identifier, "rotation_quaternion")) { mat3_to_quat_is_ok(quat, trimat);
float trimat[3][3], quat[4];
return quat[array_index];
copy_m3_m4(trimat, ob->obmat); }
mat3_to_quat_is_ok(quat, trimat); else if (strstr(identifier, "rotation_axis_angle")) {
float axis[3], angle;
return quat[array_index];
} mat4_to_axis_angle(axis, &angle, ob->obmat);
else if (strstr(identifier, "rotation_axis_angle")) {
float axis[3], angle; /* w = 0, x,y,z = 1,2,3 */
if (array_index == 0)
mat4_to_axis_angle(axis, &angle, ob->obmat); return angle;
else
/* w = 0, x,y,z = 1,2,3 */ return axis[array_index - 1];
if (array_index == 0)
return angle;
else
return axis[array_index - 1];
}
} }
} }
else if (ptr->type == &RNA_PoseBone) { else if (ptr->type == &RNA_PoseBone) {

@ -770,7 +770,11 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol)
glColor4f(0.f, 0.f, 0.f, 0.3f); glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(15); uiSetRoundBox(15);
uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
/* need scissor test, histogram can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
glColor4f(1.f, 1.f, 1.f, 0.08f); glColor4f(1.f, 1.f, 1.f, 0.08f);
/* draw grid lines here */ /* draw grid lines here */
for (i=1; i<4; i++) { for (i=1; i<4; i++) {
@ -778,10 +782,6 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol)
fdrawline(rect.xmin+(i/4.f)*w, rect.ymin, rect.xmin+(i/4.f)*w, rect.ymax); fdrawline(rect.xmin+(i/4.f)*w, rect.ymin, rect.xmin+(i/4.f)*w, rect.ymax);
} }
/* need scissor test, histogram can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
if (hist->mode == HISTO_MODE_LUMA) if (hist->mode == HISTO_MODE_LUMA)
histogram_draw_one(1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin, w, h, hist->data_luma, res); histogram_draw_one(1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin, w, h, hist->data_luma, res);
else { else {

@ -1099,7 +1099,7 @@ void load_editMesh(Scene *scene, Object *obedit)
int j; int j;
for (ob=G.main->object.first; ob; ob=ob->id.next) { for (ob=G.main->object.first; ob; ob=ob->id.next) {
if (ob->parent==ob && ELEM(ob->partype, PARVERT1,PARVERT3)) { if (ob->parent==obedit && ELEM(ob->partype, PARVERT1,PARVERT3)) {
/* duplicate code from below, make it function later...? */ /* duplicate code from below, make it function later...? */
if (!vertMap) { if (!vertMap) {

@ -159,7 +159,7 @@ typedef struct {
static void multiresbake_get_normal(const MResolvePixelData *data, float norm[], const int face_num, const int vert_index) static void multiresbake_get_normal(const MResolvePixelData *data, float norm[], const int face_num, const int vert_index)
{ {
unsigned int indices[]= {data->mface[face_num].v1, data->mface[face_num].v2, unsigned int indices[]= {data->mface[face_num].v1, data->mface[face_num].v2,
data->mface[face_num].v3, data->mface[face_num].v4}; data->mface[face_num].v3, data->mface[face_num].v4};
const int smoothnormal= (data->mface[face_num].flag & ME_SMOOTH); const int smoothnormal= (data->mface[face_num].flag & ME_SMOOTH);
if(!smoothnormal) { /* flat */ if(!smoothnormal) { /* flat */

@ -1411,6 +1411,8 @@ static int forcefield_toggle_exec(bContext *C, wmOperator *UNUSED(op))
else else
ob->pd->forcefield = 0; ob->pd->forcefield = 0;
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }

@ -64,6 +64,7 @@
#include "ED_curve.h" #include "ED_curve.h"
#include "ED_mesh.h" #include "ED_mesh.h"
#include "ED_lattice.h"
#include "ED_screen.h" #include "ED_screen.h"
#include "WM_types.h" #include "WM_types.h"
@ -292,7 +293,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
return totvert; return totvert;
} }
static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r) static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
{ {
*indexar= NULL; *indexar= NULL;
*tot= 0; *tot= 0;
@ -302,7 +303,12 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
case OB_MESH: case OB_MESH:
{ {
Mesh *me= obedit->data; Mesh *me= obedit->data;
EditMesh *em = BKE_mesh_get_editmesh(me); EditMesh *em;
load_editMesh(scene, obedit);
make_editMesh(scene, obedit);
em = BKE_mesh_get_editmesh(me);
/* check selected vertices first */ /* check selected vertices first */
if( return_editmesh_indexar(em, tot, indexar, cent_r)) { if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
@ -316,10 +322,17 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
} }
case OB_CURVE: case OB_CURVE:
case OB_SURF: case OB_SURF:
load_editNurb(obedit);
make_editNurb(obedit);
return return_editcurve_indexar(obedit, tot, indexar, cent_r); return return_editcurve_indexar(obedit, tot, indexar, cent_r);
case OB_LATTICE: case OB_LATTICE:
{ {
Lattice *lt= obedit->data; Lattice *lt= obedit->data;
load_editLatt(obedit);
make_editLatt(obedit);
return return_editlattice_indexar(lt->editlatt->latt, tot, indexar, cent_r); return return_editlattice_indexar(lt->editlatt->latt, tot, indexar, cent_r);
} }
default: default:
@ -427,7 +440,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o
int tot, ok, *indexar; int tot, ok, *indexar;
char name[32]; char name[32];
ok = object_hook_index_array(obedit, &tot, &indexar, name, cent); ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent);
if (!ok) return; // XXX error("Requires selected vertices or active Vertex Group"); if (!ok) return; // XXX error("Requires selected vertices or active Vertex Group");
@ -760,7 +773,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
/* assign functionality */ /* assign functionality */
if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) { if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) {
BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group"); BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

@ -91,6 +91,8 @@
#include "ED_armature.h" #include "ED_armature.h"
#include "ED_curve.h" #include "ED_curve.h"
#include "ED_lattice.h"
#include "ED_mesh.h"
#include "ED_keyframing.h" #include "ED_keyframing.h"
#include "ED_object.h" #include "ED_object.h"
#include "ED_screen.h" #include "ED_screen.h"
@ -122,7 +124,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
if(obedit->type==OB_MESH) { if(obedit->type==OB_MESH) {
Mesh *me= obedit->data; Mesh *me= obedit->data;
EditMesh *em = BKE_mesh_get_editmesh(me); EditMesh *em;
load_editMesh(scene, obedit);
make_editMesh(scene, obedit);
em = BKE_mesh_get_editmesh(me);
eve= em->verts.first; eve= em->verts.first;
while(eve) { while(eve) {
@ -140,7 +147,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
BKE_mesh_end_editmesh(me, em); BKE_mesh_end_editmesh(me, em);
} }
else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) { else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb;
load_editNurb(obedit);
make_editNurb(obedit);
editnurb= curve_get_editcurve(obedit);
cu= obedit->data; cu= obedit->data;
@ -180,8 +192,13 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
} }
} }
else if(obedit->type==OB_LATTICE) { else if(obedit->type==OB_LATTICE) {
Lattice *lt= obedit->data; Lattice *lt;
load_editLatt(obedit);
make_editLatt(obedit);
lt= obedit->data;
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw; a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
bp= lt->editlatt->latt->def; bp= lt->editlatt->latt->def;
while(a--) { while(a--) {

@ -221,6 +221,7 @@ void SOUND_OT_open_mono(wmOperatorType *ot)
static int mixdown_exec(bContext *C, wmOperator *op) static int mixdown_exec(bContext *C, wmOperator *op)
{ {
#ifdef WITH_AUDASPACE
char path[FILE_MAX]; char path[FILE_MAX];
char filename[FILE_MAX]; char filename[FILE_MAX];
Scene *scene; Scene *scene;
@ -254,7 +255,10 @@ static int mixdown_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, result); BKE_report(op->reports, RPT_ERROR, result);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
#else // WITH_AUDASPACE
(void)C;
(void)op;
#endif // WITH_AUDASPACE
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }
@ -278,6 +282,7 @@ static int mixdown_draw_check_prop(PropertyRNA *prop)
); );
} }
#ifdef WITH_AUDASPACE
static void mixdown_draw(bContext *C, wmOperator *op) static void mixdown_draw(bContext *C, wmOperator *op)
{ {
static EnumPropertyItem pcm_format_items[] = { static EnumPropertyItem pcm_format_items[] = {
@ -429,9 +434,11 @@ static void mixdown_draw(bContext *C, wmOperator *op)
/* main draw call */ /* main draw call */
uiDefAutoButsRNA(layout, &ptr, mixdown_draw_check_prop, '\0'); uiDefAutoButsRNA(layout, &ptr, mixdown_draw_check_prop, '\0');
} }
#endif // WITH_AUDASPACE
void SOUND_OT_mixdown(wmOperatorType *ot) void SOUND_OT_mixdown(wmOperatorType *ot)
{ {
#ifdef WITH_AUDASPACE
static EnumPropertyItem format_items[] = { static EnumPropertyItem format_items[] = {
{AUD_FORMAT_U8, "U8", 0, "U8", "8 bit unsigned"}, {AUD_FORMAT_U8, "U8", 0, "U8", "8 bit unsigned"},
{AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"}, {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"},
@ -469,6 +476,8 @@ void SOUND_OT_mixdown(wmOperatorType *ot)
{AUD_CODEC_VORBIS, "VORBIS", 0, "Vorbis", "Xiph.Org Vorbis Codec"}, {AUD_CODEC_VORBIS, "VORBIS", 0, "Vorbis", "Xiph.Org Vorbis Codec"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
#endif // WITH_AUDASPACE
/* identifiers */ /* identifiers */
ot->name= "Mixdown"; ot->name= "Mixdown";
ot->description= "Mixes the scene's audio to a sound file"; ot->description= "Mixes the scene's audio to a sound file";
@ -477,18 +486,22 @@ void SOUND_OT_mixdown(wmOperatorType *ot)
/* api callbacks */ /* api callbacks */
ot->exec= mixdown_exec; ot->exec= mixdown_exec;
ot->invoke= mixdown_invoke; ot->invoke= mixdown_invoke;
ot->ui= mixdown_draw;
#ifdef WITH_AUDASPACE
ot->ui= mixdown_draw;
#endif
/* flags */ /* flags */
ot->flag= OPTYPE_REGISTER; ot->flag= OPTYPE_REGISTER;
/* properties */ /* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
#ifdef WITH_AUDASPACE
RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy. Important for animation data. The lower the value, the more accurate.", 1, 16777216); RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy. Important for animation data. The lower the value, the more accurate.", 1, 16777216);
RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format"); RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format");
RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec"); RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec");
RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format"); RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format");
RNA_def_int(ot->srna, "bitrate", 192, 32, 512, "Bitrate", "Bitrate in kbit/s", 32, 512); RNA_def_int(ot->srna, "bitrate", 192, 32, 512, "Bitrate", "Bitrate in kbit/s", 32, 512);
#endif // WITH_AUDASPACE
} }
/* ******************************************************* */ /* ******************************************************* */

@ -1385,7 +1385,7 @@ static void node_texture_set_butfunc(bNodeType *ntype)
default: default:
ntype->uifunc= NULL; ntype->uifunc= NULL;
} }
if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc; if (ntype->uifuncbut == NULL) ntype->uifuncbut = ntype->uifunc;
} }
/* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */ /* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */

@ -236,7 +236,7 @@ static int group_select_flag(Group *gr)
return 0; return 0;
} }
static void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag) void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
{ {
Scene *scene = (Scene *)poin; Scene *scene = (Scene *)poin;
GroupObject *gob; GroupObject *gob;

@ -218,6 +218,34 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
/* Rename --------------------------------------------------- */ /* Rename --------------------------------------------------- */
void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports)
{
/* can't rename rna datablocks entries */
if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))
;
else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP))
BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
else if(tselem->id->lib) {
// XXX error_libdata();
}
else if(te->idcode == ID_LI && te->parent) {
BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
}
else {
tselem->flag |= TSE_TEXTBUT;
ED_region_tag_redraw(ar);
}
}
void item_rename_cb(bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
{
ARegion *ar= CTX_wm_region(C);
ReportList *reports= CTX_wm_reports(C); // XXX
do_item_rename(ar, te, tselem, reports) ;
}
static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, TreeElement *te, const float mval[2]) static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, TreeElement *te, const float mval[2])
{ {
ReportList *reports= CTX_wm_reports(C); // XXX ReportList *reports= CTX_wm_reports(C); // XXX
@ -228,23 +256,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T
/* name and first icon */ /* name and first icon */
if(mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) { if(mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
/* can't rename rna datablocks entries */ do_item_rename(ar, te, tselem, reports) ;
if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))
;
else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP))
BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
else if(tselem->id->lib) {
// XXX error_libdata();
}
else if(te->idcode == ID_LI && te->parent) {
BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
}
else {
tselem->flag |= TSE_TEXTBUT;
ED_region_tag_redraw(ar);
}
} }
return 1; return 1;
} }
@ -377,6 +389,12 @@ void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, Tre
} }
} }
void group_toggle_visibility_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
{
Group *group= (Group *)tselem->id;
restrictbutton_gr_restrict_flag(scene, group, OB_RESTRICT_VIEW);
}
static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op)) static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op))
{ {
SpaceOops *soops= CTX_wm_space_outliner(C); SpaceOops *soops= CTX_wm_space_outliner(C);
@ -417,6 +435,12 @@ void object_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
} }
} }
void group_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
{
Group *group= (Group *)tselem->id;
restrictbutton_gr_restrict_flag(scene, group, OB_RESTRICT_SELECT);
}
static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op)) static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op))
{ {
SpaceOops *soops= CTX_wm_space_outliner(C); SpaceOops *soops= CTX_wm_space_outliner(C);
@ -457,6 +481,12 @@ void object_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
} }
} }
void group_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
{
Group *group= (Group *)tselem->id;
restrictbutton_gr_restrict_flag(scene, group, OB_RESTRICT_RENDER);
}
static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op)) static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op))
{ {
SpaceOops *soops= CTX_wm_space_outliner(C); SpaceOops *soops= CTX_wm_space_outliner(C);

@ -129,6 +129,7 @@ typedef struct TreeElement {
/* outliner_tree.c ----------------------------------------------- */ /* outliner_tree.c ----------------------------------------------- */
void outliner_free_tree(ListBase *lb); void outliner_free_tree(ListBase *lb);
void outliner_cleanup_tree(struct SpaceOops *soops);
TreeElement *outliner_find_tse(struct SpaceOops *soops, TreeStoreElem *tse); TreeElement *outliner_find_tse(struct SpaceOops *soops, TreeStoreElem *tse);
TreeElement *outliner_find_id(struct SpaceOops *soops, ListBase *lb, struct ID *id); TreeElement *outliner_find_id(struct SpaceOops *soops, ListBase *lb, struct ID *id);
@ -139,6 +140,7 @@ void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct Space
/* outliner_draw.c ---------------------------------------------- */ /* outliner_draw.c ---------------------------------------------- */
void draw_outliner(const struct bContext *C); void draw_outliner(const struct bContext *C);
void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag);
/* outliner_select.c -------------------------------------------- */ /* outliner_select.c -------------------------------------------- */
int tree_element_type_active(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set); int tree_element_type_active(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set);
@ -158,6 +160,13 @@ void object_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeEl
void object_toggle_selectability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); void object_toggle_selectability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
void object_toggle_renderability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); void object_toggle_renderability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
void group_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
void group_toggle_selectability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
void group_toggle_renderability_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
void item_rename_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
/* ...................................................... */ /* ...................................................... */
void OUTLINER_OT_item_activate(struct wmOperatorType *ot); void OUTLINER_OT_item_activate(struct wmOperatorType *ot);

@ -287,6 +287,8 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
if(base==NULL) if(base==NULL)
base= object_in_scene((Object *)tselem->id, scene); base= object_in_scene((Object *)tselem->id, scene);
if(base) { if(base) {
SpaceOops *soops= CTX_wm_space_outliner(C);
// check also library later // check also library later
if(scene->obedit==base->object) if(scene->obedit==base->object)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO); ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
@ -294,6 +296,13 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
ED_base_object_free_and_unlink(CTX_data_main(C), scene, base); ED_base_object_free_and_unlink(CTX_data_main(C), scene, base);
te->directdata= NULL; te->directdata= NULL;
tselem->id= NULL; tselem->id= NULL;
/* XXX: tree management normally happens from draw_outliner(), but when
you're clicking to fast on Delete object from context menu in
outliner several mouse events can be handled in one cycle without
handling notifiers/redraw which leads to deleting the same object twice.
cleanup tree here to prevent such cases. */
outliner_cleanup_tree(soops);
} }
} }
@ -510,6 +519,7 @@ static EnumPropertyItem prop_object_op_types[] = {
{6, "TOGVIS", 0, "Toggle Visible", ""}, {6, "TOGVIS", 0, "Toggle Visible", ""},
{7, "TOGSEL", 0, "Toggle Selectable", ""}, {7, "TOGSEL", 0, "Toggle Selectable", ""},
{8, "TOGREN", 0, "Toggle Renderable", ""}, {8, "TOGREN", 0, "Toggle Renderable", ""},
{9, "RENAME", 0, "Rename", ""},
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
@ -567,6 +577,10 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
str= "Toggle Renderability"; str= "Toggle Renderability";
WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, scene); WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, scene);
} }
else if(event==9) {
outliner_do_object_operation(C, scene, soops, &soops->tree, item_rename_cb);
str= "Rename Object";
}
ED_undo_push(C, str); ED_undo_push(C, str);
@ -600,6 +614,7 @@ static EnumPropertyItem prop_group_op_types[] = {
{4, "TOGVIS", 0, "Toggle Visible", ""}, {4, "TOGVIS", 0, "Toggle Visible", ""},
{5, "TOGSEL", 0, "Toggle Selectable", ""}, {5, "TOGSEL", 0, "Toggle Selectable", ""},
{6, "TOGREN", 0, "Toggle Renderable", ""}, {6, "TOGREN", 0, "Toggle Renderable", ""},
{7, "RENAME", 0, "Rename", ""},
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
@ -608,6 +623,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
SpaceOops *soops= CTX_wm_space_outliner(C); SpaceOops *soops= CTX_wm_space_outliner(C);
int event; int event;
const char *str= NULL;
/* check for invalid states */ /* check for invalid states */
if (soops == NULL) if (soops == NULL)
@ -617,18 +633,35 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
if(event==1) { if(event==1) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, unlink_group_cb); outliner_do_libdata_operation(C, scene, soops, &soops->tree, unlink_group_cb);
ED_undo_push(C, "Unlink group"); str= "Unlink group";
} }
else if(event==2) { else if(event==2) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, id_local_cb); outliner_do_libdata_operation(C, scene, soops, &soops->tree, id_local_cb);
ED_undo_push(C, "Localized Data"); str= "Localized Data";
} }
else if(event==3) { else if(event==3) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb); outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb);
ED_undo_push(C, "Link Group Objects to Scene"); str= "Link Group Objects to Scene";
}
else if(event==4) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_visibility_cb);
str= "Toggle Visibility";
}
else if(event==5) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_selectability_cb);
str= "Toggle Selectability";
}
else if(event==6) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_renderability_cb);
str= "Toggle Renderability";
}
else if(event==7) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, item_rename_cb);
str= "Rename";
} }
ED_undo_push(C, str);
WM_event_add_notifier(C, NC_GROUP, NULL); WM_event_add_notifier(C, NC_GROUP, NULL);
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
@ -662,7 +695,8 @@ typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_SINGLE, OUTLINER_IDOP_SINGLE,
OUTLINER_IDOP_FAKE_ADD, OUTLINER_IDOP_FAKE_ADD,
OUTLINER_IDOP_FAKE_CLEAR OUTLINER_IDOP_FAKE_CLEAR,
OUTLINER_IDOP_RENAME
} eOutlinerIdOpTypes; } eOutlinerIdOpTypes;
// TODO: implement support for changing the ID-block used // TODO: implement support for changing the ID-block used
@ -672,6 +706,7 @@ static EnumPropertyItem prop_id_op_types[] = {
{OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""}, {OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""},
{OUTLINER_IDOP_FAKE_ADD, "ADD_FAKE", 0, "Add Fake User", "Ensure datablock gets saved even if it isn't in use (e.g. for motion and material libraries)"}, {OUTLINER_IDOP_FAKE_ADD, "ADD_FAKE", 0, "Add Fake User", "Ensure datablock gets saved even if it isn't in use (e.g. for motion and material libraries)"},
{OUTLINER_IDOP_FAKE_CLEAR, "CLEAR_FAKE", 0, "Clear Fake User", ""}, {OUTLINER_IDOP_FAKE_CLEAR, "CLEAR_FAKE", 0, "Clear Fake User", ""},
{OUTLINER_IDOP_RENAME, "RENAME", 0, "Rename", ""},
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
@ -765,6 +800,14 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Clear Fake User"); ED_undo_push(C, "Clear Fake User");
} }
break; break;
case OUTLINER_IDOP_RENAME:
/* rename */
outliner_do_libdata_operation(C, scene, soops, &soops->tree, item_rename_cb);
WM_event_add_notifier(C, NC_ID|NA_EDITED, NULL);
ED_undo_push(C, "Rename");
break;
default: default:
// invalid - unhandled // invalid - unhandled

@ -222,6 +222,12 @@ void outliner_free_tree(ListBase *lb)
} }
} }
void outliner_cleanup_tree(SpaceOops *soops)
{
outliner_free_tree(&soops->tree);
outliner_storage_cleanup(soops);
}
/* Find ith item from the treestore */ /* Find ith item from the treestore */
static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index) static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index)
{ {

@ -154,6 +154,11 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn)
case NA_REMOVED: case NA_REMOVED:
ED_area_tag_redraw(sa); ED_area_tag_redraw(sa);
break; break;
case NA_SELECTED:
if(st->text && st->text == wmn->reference)
text_scroll_to_cursor(st, sa);
break;
} }
break; break;

@ -1821,12 +1821,10 @@ void text_update_character_width(SpaceText *st)
/* Moves the view to the cursor location, /* Moves the view to the cursor location,
also used to make sure the view isnt outside the file */ also used to make sure the view isnt outside the file */
void text_update_cursor_moved(bContext *C) void text_scroll_to_cursor(SpaceText *st, ScrArea *sa)
{ {
ScrArea *sa= CTX_wm_area(C);
SpaceText *st= CTX_wm_space_text(C);
Text *text; Text *text;
ARegion *ar; ARegion *ar= NULL;
int i, x, winx= 0; int i, x, winx= 0;
if(ELEM3(NULL, st, st->text, st->text->curl)) return; if(ELEM3(NULL, st, st->text, st->text->curl)) return;
@ -1834,8 +1832,10 @@ void text_update_cursor_moved(bContext *C)
text= st->text; text= st->text;
for(ar=sa->regionbase.first; ar; ar= ar->next) for(ar=sa->regionbase.first; ar; ar= ar->next)
if(ar->regiontype==RGN_TYPE_WINDOW) if(ar->regiontype==RGN_TYPE_WINDOW) {
winx= ar->winx; winx= ar->winx;
break;
}
winx -= TXT_SCROLL_WIDTH; winx -= TXT_SCROLL_WIDTH;
@ -1844,7 +1844,7 @@ void text_update_cursor_moved(bContext *C)
i= txt_get_span(text->lines.first, text->sell); i= txt_get_span(text->lines.first, text->sell);
if(st->wordwrap) { if(st->wordwrap) {
int offl, offc; int offl, offc;
wrap_offset(st, CTX_wm_region(C), text->sell, text->selc, &offl, &offc); wrap_offset(st, ar, text->sell, text->selc, &offl, &offc);
i+= offl; i+= offl;
} }
@ -1865,3 +1865,10 @@ void text_update_cursor_moved(bContext *C)
if(st->left <0) st->left= 0; if(st->left <0) st->left= 0;
} }
void text_update_cursor_moved(bContext *C)
{
ScrArea *sa= CTX_wm_area(C);
SpaceText *st= CTX_wm_space_text(C);
text_scroll_to_cursor(st, sa);
}

@ -55,6 +55,7 @@ int text_font_width(struct SpaceText *st, const char *str);
void text_update_line_edited(struct TextLine *line); void text_update_line_edited(struct TextLine *line);
void text_update_edited(struct Text *text); void text_update_edited(struct Text *text);
void text_update_character_width(struct SpaceText *st); void text_update_character_width(struct SpaceText *st);
void text_scroll_to_cursor(struct SpaceText *st, struct ScrArea *sa);
void text_update_cursor_moved(struct bContext *C); void text_update_cursor_moved(struct bContext *C);
/* TXT_OFFSET used to be 35 when the scrollbar was on the left... */ /* TXT_OFFSET used to be 35 when the scrollbar was on the left... */

@ -625,8 +625,8 @@ void ED_view3d_win_to_3d(ARegion *ar, const float depth_pt[3], const float mval[
} }
} }
else { else {
const float dx= (2.0f * mval[0] / (float)ar->winx) - 1.0f; const float dx= (2.0f * mval[0] / (float)ar->winx) - 1.0f;
const float dy= (2.0f * mval[1] / (float)ar->winy) - 1.0f; const float dy= (2.0f * mval[1] / (float)ar->winy) - 1.0f;
line_sta[0]= (rv3d->persinv[0][0] * dx) + (rv3d->persinv[1][0] * dy) + rv3d->viewinv[3][0]; line_sta[0]= (rv3d->persinv[0][0] * dx) + (rv3d->persinv[1][0] * dy) + rv3d->viewinv[3][0];
line_sta[1]= (rv3d->persinv[0][1] * dx) + (rv3d->persinv[1][1] * dy) + rv3d->viewinv[3][1]; line_sta[1]= (rv3d->persinv[0][1] * dx) + (rv3d->persinv[1][1] * dy) + rv3d->viewinv[3][1];
line_sta[2]= (rv3d->persinv[0][2] * dx) + (rv3d->persinv[1][2] * dy) + rv3d->viewinv[3][2]; line_sta[2]= (rv3d->persinv[0][2] * dx) + (rv3d->persinv[1][2] * dy) + rv3d->viewinv[3][2];

@ -922,7 +922,7 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
static void ffmpeg_decode_video_frame_scan( static void ffmpeg_decode_video_frame_scan(
struct anim * anim, int64_t pts_to_search) struct anim * anim, int64_t pts_to_search)
{ {
/* there seem to exist *very* silly GOP lengths out in the wild... */ /* there seem to exist *very* silly GOP lengths out in the wild... */
int count = 1000; int count = 1000;
av_log(anim->pFormatCtx, av_log(anim->pFormatCtx,

@ -30,8 +30,8 @@
#include <time.h> #include <time.h>
typedef struct indexer_dv_bitstream { typedef struct indexer_dv_bitstream {
unsigned char* buffer; unsigned char* buffer;
int bit_pos; int bit_pos;
} indexer_dv_bitstream; } indexer_dv_bitstream;
static indexer_dv_bitstream bitstream_new(unsigned char* buffer_) static indexer_dv_bitstream bitstream_new(unsigned char* buffer_)
@ -57,41 +57,41 @@ static unsigned long bitstream_get_bits(indexer_dv_bitstream * This, int num)
} }
static int parse_num(indexer_dv_bitstream * b, int numbits) { static int parse_num(indexer_dv_bitstream * b, int numbits) {
return bitstream_get_bits(b, numbits); return bitstream_get_bits(b, numbits);
} }
static int parse_bcd(indexer_dv_bitstream * b, int n) static int parse_bcd(indexer_dv_bitstream * b, int n)
{ {
char s[256]; char s[256];
char * p = s + (n+3)/4; char * p = s + (n+3)/4;
*p-- = 0; *p-- = 0;
while (n > 4) { while (n > 4) {
char a; char a;
int v = bitstream_get_bits(b, 4); int v = bitstream_get_bits(b, 4);
n -= 4; n -= 4;
a = '0' + v; a = '0' + v;
if (a > '9') { if (a > '9') {
bitstream_get_bits(b, n); bitstream_get_bits(b, n);
return -1; return -1;
} }
*p-- = a; *p-- = a;
} }
if (n) { if (n) {
char a; char a;
int v = bitstream_get_bits(b, n); int v = bitstream_get_bits(b, n);
a = '0' + v; a = '0' + v;
if (a > '9') { if (a > '9') {
return -1; return -1;
} }
*p-- = a; *p-- = a;
} }
return atol(s); return atol(s);
} }
typedef struct indexer_dv_context typedef struct indexer_dv_context
@ -125,124 +125,124 @@ typedef struct indexer_dv_context
static void parse_packet(indexer_dv_context * This, unsigned char * p) static void parse_packet(indexer_dv_context * This, unsigned char * p)
{ {
indexer_dv_bitstream b; indexer_dv_bitstream b;
int type = p[0]; int type = p[0];
b = bitstream_new(p + 1); b = bitstream_new(p + 1);
switch (type) { switch (type) {
case 0x62: // Record date case 0x62: // Record date
parse_num(&b, 8); parse_num(&b, 8);
This->rec_curr_day = parse_bcd(&b, 6); This->rec_curr_day = parse_bcd(&b, 6);
parse_num(&b, 2); parse_num(&b, 2);
This->rec_curr_month = parse_bcd(&b, 5); This->rec_curr_month = parse_bcd(&b, 5);
parse_num(&b, 3); parse_num(&b, 3);
This->rec_curr_year = parse_bcd(&b, 8); This->rec_curr_year = parse_bcd(&b, 8);
if (This->rec_curr_year < 25) { if (This->rec_curr_year < 25) {
This->rec_curr_year += 2000; This->rec_curr_year += 2000;
} else { } else {
This->rec_curr_year += 1900; This->rec_curr_year += 1900;
} }
This->got_record_date = 1; This->got_record_date = 1;
break; break;
case 0x63: // Record time case 0x63: // Record time
This->rec_curr_frame = parse_bcd(&b, 6); This->rec_curr_frame = parse_bcd(&b, 6);
parse_num(&b, 2); parse_num(&b, 2);
This->rec_curr_second = parse_bcd(&b, 7); This->rec_curr_second = parse_bcd(&b, 7);
parse_num(&b, 1); parse_num(&b, 1);
This->rec_curr_minute = parse_bcd(&b, 7); This->rec_curr_minute = parse_bcd(&b, 7);
parse_num(&b, 1); parse_num(&b, 1);
This->rec_curr_hour = parse_bcd(&b, 6); This->rec_curr_hour = parse_bcd(&b, 6);
This->got_record_time = 1; This->got_record_time = 1;
break; break;
} }
} }
static void parse_header_block(indexer_dv_context * This, unsigned char* target) static void parse_header_block(indexer_dv_context * This, unsigned char* target)
{ {
int i; int i;
for (i = 3; i < 80; i += 5) { for (i = 3; i < 80; i += 5) {
if (target[i] != 0xff) { if (target[i] != 0xff) {
parse_packet(This, target + i); parse_packet(This, target + i);
} }
} }
} }
static void parse_subcode_blocks( static void parse_subcode_blocks(
indexer_dv_context * This, unsigned char* target) indexer_dv_context * This, unsigned char* target)
{ {
int i,j; int i,j;
for (j = 0; j < 2; j++) { for (j = 0; j < 2; j++) {
for (i = 3; i < 80; i += 5) { for (i = 3; i < 80; i += 5) {
if (target[i] != 0xff) { if (target[i] != 0xff) {
parse_packet(This, target + i); parse_packet(This, target + i);
} }
} }
} }
} }
static void parse_vaux_blocks( static void parse_vaux_blocks(
indexer_dv_context * This, unsigned char* target) indexer_dv_context * This, unsigned char* target)
{ {
int i,j; int i,j;
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
for (i = 3; i < 80; i += 5) { for (i = 3; i < 80; i += 5) {
if (target[i] != 0xff) { if (target[i] != 0xff) {
parse_packet(This, target + i); parse_packet(This, target + i);
} }
} }
target += 80; target += 80;
} }
} }
static void parse_audio_headers( static void parse_audio_headers(
indexer_dv_context * This, unsigned char* target) indexer_dv_context * This, unsigned char* target)
{ {
int i; int i;
for(i = 0; i < 9; i++) { for(i = 0; i < 9; i++) {
if (target[3] != 0xff) { if (target[3] != 0xff) {
parse_packet(This, target + 3); parse_packet(This, target + 3);
} }
target += 16 * 80; target += 16 * 80;
} }
} }
static void parse_frame(indexer_dv_context * This, static void parse_frame(indexer_dv_context * This,
unsigned char * framebuffer, int isPAL) unsigned char * framebuffer, int isPAL)
{ {
int numDIFseq = isPAL ? 12 : 10; int numDIFseq = isPAL ? 12 : 10;
unsigned char* target = framebuffer; unsigned char* target = framebuffer;
int ds; int ds;
for (ds = 0; ds < numDIFseq; ds++) { for (ds = 0; ds < numDIFseq; ds++) {
parse_header_block(This, target); parse_header_block(This, target);
target += 1 * 80; target += 1 * 80;
parse_subcode_blocks(This, target); parse_subcode_blocks(This, target);
target += 2 * 80; target += 2 * 80;
parse_vaux_blocks(This, target); parse_vaux_blocks(This, target);
target += 3 * 80; target += 3 * 80;
parse_audio_headers(This, target); parse_audio_headers(This, target);
target += 144 * 80; target += 144 * 80;
} }
} }
static void inc_frame(int * frame, time_t * t, int isPAL) static void inc_frame(int * frame, time_t * t, int isPAL)
{ {
if ((isPAL && *frame >= 25) || (!isPAL && *frame >= 30)) { if ((isPAL && *frame >= 25) || (!isPAL && *frame >= 30)) {
fprintf(stderr, "Ouchie: inc_frame: invalid_frameno: %d\n", fprintf(stderr, "Ouchie: inc_frame: invalid_frameno: %d\n",
*frame); *frame);
} }
(*frame)++; (*frame)++;
if (isPAL && *frame >= 25) { if (isPAL && *frame >= 25) {
(*t)++; (*t)++;
*frame = 0; *frame = 0;
} else if (!isPAL && *frame >= 30) { } else if (!isPAL && *frame >= 30) {
(*t)++; (*t)++;
*frame = 0; *frame = 0;
} }
} }
static void write_index(indexer_dv_context * This, anim_index_entry * entry) static void write_index(indexer_dv_context * This, anim_index_entry * entry)
@ -256,36 +256,36 @@ static void fill_gap(indexer_dv_context * This, int isPAL)
{ {
int i; int i;
for (i = 0; i < This->fsize; i++) { for (i = 0; i < This->fsize; i++) {
if (This->gap_start == This->ref_time_read && if (This->gap_start == This->ref_time_read &&
This->gap_frame == This->curr_frame) { This->gap_frame == This->curr_frame) {
fprintf(stderr, fprintf(stderr,
"indexer_dv::fill_gap: " "indexer_dv::fill_gap: "
"can't seek backwards !\n"); "can't seek backwards !\n");
break; break;
} }
inc_frame(&This->gap_frame, &This->gap_start, isPAL); inc_frame(&This->gap_frame, &This->gap_start, isPAL);
} }
while (This->gap_start != This->ref_time_read || while (This->gap_start != This->ref_time_read ||
This->gap_frame != This->curr_frame) { This->gap_frame != This->curr_frame) {
inc_frame(&This->gap_frame, &This->gap_start, isPAL); inc_frame(&This->gap_frame, &This->gap_start, isPAL);
This->frameno_offset++; This->frameno_offset++;
} }
for (i = 0; i < This->fsize; i++) { for (i = 0; i < This->fsize; i++) {
write_index(This, This->backbuffer + i); write_index(This, This->backbuffer + i);
} }
This->fsize = 0; This->fsize = 0;
} }
static void proc_frame(indexer_dv_context * This, static void proc_frame(indexer_dv_context * This,
unsigned char* UNUSED(framebuffer), int isPAL) unsigned char* UNUSED(framebuffer), int isPAL)
{ {
struct tm recDate; struct tm recDate;
time_t t; time_t t;
if (!This->got_record_date || !This->got_record_time) { if (!This->got_record_date || !This->got_record_time) {
return; return;
} }
@ -329,9 +329,9 @@ static void proc_frame(indexer_dv_context * This,
} }
static void indexer_dv_proc_frame(anim_index_builder * idx, static void indexer_dv_proc_frame(anim_index_builder * idx,
unsigned char * buffer, unsigned char * buffer,
int UNUSED(data_size), int UNUSED(data_size),
struct anim_index_entry * entry) struct anim_index_entry * entry)
{ {
int isPAL; int isPAL;
@ -354,7 +354,7 @@ static void indexer_dv_proc_frame(anim_index_builder * idx,
int i; int i;
fprintf(stderr, "indexer_dv::indexer_dv_proc_frame: " fprintf(stderr, "indexer_dv::indexer_dv_proc_frame: "
"backbuffer overrun, emergency flush"); "backbuffer overrun, emergency flush");
for (i = 0; i < This->fsize; i++) { for (i = 0; i < This->fsize; i++) {
write_index(This, This->backbuffer+i); write_index(This, This->backbuffer+i);
@ -378,8 +378,8 @@ static void indexer_dv_delete(anim_index_builder * idx)
void IMB_indexer_dv_new(anim_index_builder * idx) void IMB_indexer_dv_new(anim_index_builder * idx)
{ {
indexer_dv_context * rv = MEM_callocN( indexer_dv_context * rv = MEM_callocN(
sizeof(indexer_dv_context), "index_dv builder context"); sizeof(indexer_dv_context), "index_dv builder context");
rv->ref_time_read = -1; rv->ref_time_read = -1;
rv->curr_frame = -1; rv->curr_frame = -1;

@ -2216,8 +2216,17 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi
else else
buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc"); buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
#ifndef NDEBUG
/* safety check to ensure the string is actually set */
buf[length]= 255;
#endif
RNA_property_string_get(ptr, prop, buf); RNA_property_string_get(ptr, prop, buf);
#ifndef NDEBUG
BLI_assert(buf[length] == '\0');
#endif
return buf; return buf;
} }

@ -184,7 +184,11 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr) static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
{ {
return 32; #ifdef DISABLE_ELBEEM
return 0;
#else
return 31;
#endif
} }
static char *rna_FluidSettings_path(PointerRNA *ptr) static char *rna_FluidSettings_path(PointerRNA *ptr)

@ -111,7 +111,7 @@ void RNA_api_scene(StructRNA *srna)
#ifdef WITH_COLLADA #ifdef WITH_COLLADA
/* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export"); func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file."); RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file.");
parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements."); parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */

@ -591,7 +591,8 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
SpaceText *st= (SpaceText*)(ptr->data); SpaceText *st= (SpaceText*)(ptr->data);
st->text= value.data; st->text= value.data;
st->top= 0;
WM_main_add_notifier(NC_TEXT|NA_SELECTED, st->text);
} }
static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)

@ -680,20 +680,14 @@ static void rna_wmKeyMapItem_name_get(PointerRNA *ptr, char *value)
{ {
wmKeyMapItem *kmi= ptr->data; wmKeyMapItem *kmi= ptr->data;
wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1); wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
strcpy(value, ot ? ot->name : kmi->idname);
if (ot)
strcpy(value, ot->name);
} }
static int rna_wmKeyMapItem_name_length(PointerRNA *ptr) static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
{ {
wmKeyMapItem *kmi= ptr->data; wmKeyMapItem *kmi= ptr->data;
wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1); wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
return strlen(ot ? ot->name : kmi->idname);
if (ot)
return strlen(ot->name);
else
return 0;
} }
static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr) static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr)
@ -1652,7 +1646,9 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length", "rna_wmKeyMapItem_idname_set"); RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length", "rna_wmKeyMapItem_idname_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
/* this is infact the operator name, but if the operator can't be found we
* fallback on the operator ID */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Name of operator to call on input event"); RNA_def_property_ui_text(prop, "Name", "Name of operator to call on input event");

@ -52,11 +52,9 @@ static int Buffer_len(Buffer *self);
static PyObject *Buffer_item(Buffer *self, int i); static PyObject *Buffer_item(Buffer *self, int i);
static PyObject *Buffer_slice(Buffer *self, int begin, int end); static PyObject *Buffer_slice(Buffer *self, int begin, int end);
static int Buffer_ass_item(Buffer *self, int i, PyObject *v); static int Buffer_ass_item(Buffer *self, int i, PyObject *v);
static int Buffer_ass_slice(Buffer *self, int begin, int end, static int Buffer_ass_slice(Buffer *self, int begin, int end, PyObject *seq);
PyObject *seq);
static PyObject *Buffer_subscript(Buffer *self, PyObject *item); static PyObject *Buffer_subscript(Buffer *self, PyObject *item);
static int Buffer_ass_subscript(Buffer *self, PyObject *item, static int Buffer_ass_subscript(Buffer *self, PyObject *item, PyObject *value);
PyObject *value);
static PySequenceMethods Buffer_SeqMethods = { static PySequenceMethods Buffer_SeqMethods = {
(lenfunc) Buffer_len, /*sq_length */ (lenfunc) Buffer_len, /*sq_length */

@ -208,77 +208,34 @@ PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...)
return item; return item;
} }
/* returns the exception string as a new PyUnicode object, depends on external StringIO module */ /* returns the exception string as a new PyUnicode object, depends on external traceback module */
PyObject *PyC_ExceptionBuffer(void) PyObject *PyC_ExceptionBuffer(void)
{ {
PyObject *stdout_backup = PySys_GetObject("stdout"); /* borrowed */ PyObject *traceback_mod= NULL;
PyObject *stderr_backup = PySys_GetObject("stderr"); /* borrowed */ PyObject *format_tb_func= NULL;
PyObject *string_io = NULL; PyObject *ret= NULL;
PyObject *string_io_buf = NULL;
PyObject *string_io_mod= NULL; if(! (traceback_mod= PyImport_ImportModule("traceback")) ) {
PyObject *string_io_getvalue= NULL;
PyObject *error_type, *error_value, *error_traceback;
if (!PyErr_Occurred())
return NULL;
PyErr_Fetch(&error_type, &error_value, &error_traceback);
PyErr_Clear();
/* import io
* string_io = io.StringIO()
*/
if(! (string_io_mod= PyImport_ImportModule("io")) ) {
goto error_cleanup; goto error_cleanup;
} }
else if (! (string_io = PyObject_CallMethod(string_io_mod, (char *)"StringIO", NULL))) { else if (! (format_tb_func= PyObject_GetAttrString(traceback_mod, "format_exc"))) {
goto error_cleanup; goto error_cleanup;
} }
else if (! (string_io_getvalue= PyObject_GetAttrString(string_io, "getvalue"))) {
goto error_cleanup; ret= PyObject_CallObject(format_tb_func, NULL);
if(ret == Py_None) {
Py_DECREF(ret);
ret= NULL;
} }
Py_INCREF(stdout_backup); // since these were borrowed we dont want them freed when replaced.
Py_INCREF(stderr_backup);
PySys_SetObject("stdout", string_io); // both of these are free'd when restoring
PySys_SetObject("stderr", string_io);
PyErr_Restore(error_type, error_value, error_traceback);
PyErr_Print(); /* print the error */
PyErr_Clear();
string_io_buf = PyObject_CallObject(string_io_getvalue, NULL);
PySys_SetObject("stdout", stdout_backup);
PySys_SetObject("stderr", stderr_backup);
Py_DECREF(stdout_backup); /* now sys owns the ref again */
Py_DECREF(stderr_backup);
Py_DECREF(string_io_mod);
Py_DECREF(string_io_getvalue);
Py_DECREF(string_io); /* free the original reference */
PyErr_Clear();
return string_io_buf;
error_cleanup: error_cleanup:
/* could not import the module so print the error and close */ /* could not import the module so print the error and close */
Py_XDECREF(string_io_mod); Py_XDECREF(traceback_mod);
Py_XDECREF(string_io); Py_XDECREF(format_tb_func);
PyErr_Restore(error_type, error_value, error_traceback);
PyErr_Print(); /* print the error */
PyErr_Clear();
return NULL;
}
return ret;
}
/* string conversion, escape non-unicode chars, coerce must be set to NULL */ /* string conversion, escape non-unicode chars, coerce must be set to NULL */
const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)

@ -1298,7 +1298,9 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
{ {
int subtype= RNA_property_subtype(prop); int subtype= RNA_property_subtype(prop);
const char *buf; const char *buf;
buf= RNA_property_string_get_alloc(ptr, prop, NULL, -1); char buf_fixed[32];
buf= RNA_property_string_get_alloc(ptr, prop, buf_fixed, sizeof(buf_fixed));
#ifdef USE_STRING_COERCE #ifdef USE_STRING_COERCE
/* only file paths get special treatment, they may contain non utf-8 chars */ /* only file paths get special treatment, they may contain non utf-8 chars */
if(ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) { if(ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
@ -1310,7 +1312,9 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
#else // USE_STRING_COERCE #else // USE_STRING_COERCE
ret= PyUnicode_FromString(buf); ret= PyUnicode_FromString(buf);
#endif // USE_STRING_COERCE #endif // USE_STRING_COERCE
MEM_freeN((void *)buf); if(buf_fixed != buf) {
MEM_freeN((void *)buf);
}
break; break;
} }
case PROP_ENUM: case PROP_ENUM:
@ -4627,28 +4631,28 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
/* note: tp_base member is set to &PyType_Type on init */ /* note: tp_base member is set to &PyType_Type on init */
PyTypeObject pyrna_struct_meta_idprop_Type= { PyTypeObject pyrna_struct_meta_idprop_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_struct_meta_idprop", /* tp_name */ "bpy_struct_meta_idprop", /* tp_name */
sizeof(PyHeapTypeObject), /* tp_basicsize */ // XXX, would be PyTypeObject, but subtypes of Type must be PyHeapTypeObject's sizeof(PyHeapTypeObject), /* tp_basicsize */ // XXX, would be PyTypeObject, but subtypes of Type must be PyHeapTypeObject's
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
NULL, /* tp_dealloc */ NULL, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* deprecated in python 3.0! */ NULL, /* tp_compare */ /* deprecated in python 3.0! */
NULL, /* tp_repr */ NULL, /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
NULL /*(getattrofunc) pyrna_struct_meta_idprop_getattro*/, /* getattrofunc tp_getattro; */ NULL /*(getattrofunc) pyrna_struct_meta_idprop_getattro*/, /* getattrofunc tp_getattro; */
(setattrofunc) pyrna_struct_meta_idprop_setattro, /* setattrofunc tp_setattro; */ (setattrofunc) pyrna_struct_meta_idprop_setattro, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -4656,7 +4660,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -4666,7 +4670,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
/*** Assigned meaning in release 2.1 ***/ /*** Assigned meaning in release 2.1 ***/
/*** rich comparisons ***/ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */ NULL, /* richcmpfunc tp_richcompare; */
/*** weak reference enabler ***/ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */ 0, /* long tp_weaklistoffset; */
@ -4677,9 +4681,9 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */ NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
@ -4687,7 +4691,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
@ -4705,45 +4709,45 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
/*-----------------------BPy_StructRNA method def------------------------------*/ /*-----------------------BPy_StructRNA method def------------------------------*/
PyTypeObject pyrna_struct_Type= { PyTypeObject pyrna_struct_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_struct", /* tp_name */ "bpy_struct", /* tp_name */
sizeof(BPy_StructRNA), /* tp_basicsize */ sizeof(BPy_StructRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
(destructor) pyrna_struct_dealloc,/* tp_dealloc */ (destructor) pyrna_struct_dealloc,/* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
(reprfunc) pyrna_struct_repr, /* tp_repr */ (reprfunc) pyrna_struct_repr, /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
&pyrna_struct_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &pyrna_struct_as_sequence, /* PySequenceMethods *tp_as_sequence; */
&pyrna_struct_as_mapping, /* PyMappingMethods *tp_as_mapping; */ &pyrna_struct_as_mapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
(hashfunc) pyrna_struct_hash, /* hashfunc tp_hash; */ (hashfunc) pyrna_struct_hash, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
(reprfunc) pyrna_struct_str, /* reprfunc tp_str; */ (reprfunc) pyrna_struct_str, /* reprfunc tp_str; */
(getattrofunc) pyrna_struct_getattro, /* getattrofunc tp_getattro; */ (getattrofunc) pyrna_struct_getattro, /* getattrofunc tp_getattro; */
(setattrofunc) pyrna_struct_setattro, /* setattrofunc tp_setattro; */ (setattrofunc) pyrna_struct_setattro, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
#ifdef USE_PYRNA_STRUCT_REFERENCE #ifdef USE_PYRNA_STRUCT_REFERENCE
(traverseproc) pyrna_struct_traverse, /* traverseproc tp_traverse; */ (traverseproc) pyrna_struct_traverse, /* traverseproc tp_traverse; */
/* delete references to contained objects */ /* delete references to contained objects */
(inquiry)pyrna_struct_clear, /* inquiry tp_clear; */ (inquiry)pyrna_struct_clear, /* inquiry tp_clear; */
#else #else
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -4753,11 +4757,11 @@ PyTypeObject pyrna_struct_Type= {
/*** Assigned meaning in release 2.1 ***/ /*** Assigned meaning in release 2.1 ***/
/*** rich comparisons ***/ /*** rich comparisons ***/
(richcmpfunc)pyrna_struct_richcmp, /* richcmpfunc tp_richcompare; */ (richcmpfunc)pyrna_struct_richcmp, /* richcmpfunc tp_richcompare; */
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
offsetof(BPy_StructRNA, in_weakreflist), /* long tp_weaklistoffset; */ offsetof(BPy_StructRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else #else
0, 0,
#endif #endif
@ -4767,9 +4771,9 @@ PyTypeObject pyrna_struct_Type= {
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
pyrna_struct_methods, /* struct PyMethodDef *tp_methods; */ pyrna_struct_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
pyrna_struct_getseters, /* struct PyGetSetDef *tp_getset; */ pyrna_struct_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */ NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
@ -4777,7 +4781,7 @@ PyTypeObject pyrna_struct_Type= {
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
pyrna_struct_new, /* newfunc tp_new; */ pyrna_struct_new, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
@ -4794,32 +4798,32 @@ PyTypeObject pyrna_struct_Type= {
/*-----------------------BPy_PropertyRNA method def------------------------------*/ /*-----------------------BPy_PropertyRNA method def------------------------------*/
PyTypeObject pyrna_prop_Type= { PyTypeObject pyrna_prop_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop", /* tp_name */ "bpy_prop", /* tp_name */
sizeof(BPy_PropertyRNA), /* tp_basicsize */ sizeof(BPy_PropertyRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
(destructor) pyrna_prop_dealloc, /* tp_dealloc */ (destructor) pyrna_prop_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
(reprfunc) pyrna_prop_repr, /* tp_repr */ (reprfunc) pyrna_prop_repr, /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
(hashfunc) pyrna_prop_hash, /* hashfunc tp_hash; */ (hashfunc) pyrna_prop_hash, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
(reprfunc) pyrna_prop_str, /* reprfunc tp_str; */ (reprfunc) pyrna_prop_str, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
NULL, /* getattrofunc tp_getattro; */ NULL, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -4827,7 +4831,7 @@ PyTypeObject pyrna_prop_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -4848,11 +4852,11 @@ PyTypeObject pyrna_prop_Type= {
/*** Added in release 2.2 ***/ /*** Added in release 2.2 ***/
/* Iterators */ /* Iterators */
NULL, /* getiterfunc tp_iter; */ NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */ pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */ pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */ NULL, /* struct _typeobject *tp_base; */
@ -4862,7 +4866,7 @@ PyTypeObject pyrna_prop_Type= {
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
pyrna_prop_new, /* newfunc tp_new; */ pyrna_prop_new, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
@ -4884,34 +4888,34 @@ PyTypeObject pyrna_prop_array_Type= {
/* methods */ /* methods */
(destructor)pyrna_prop_array_dealloc, /* tp_dealloc */ (destructor)pyrna_prop_array_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
NULL,/* subclassed */ /* tp_repr */ NULL,/* subclassed */ /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
&pyrna_prop_array_as_number, /* PyNumberMethods *tp_as_number; */ &pyrna_prop_array_as_number, /* PyNumberMethods *tp_as_number; */
&pyrna_prop_array_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &pyrna_prop_array_as_sequence, /* PySequenceMethods *tp_as_sequence; */
&pyrna_prop_array_as_mapping, /* PyMappingMethods *tp_as_mapping; */ &pyrna_prop_array_as_mapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
(getattrofunc) pyrna_prop_array_getattro, /* getattrofunc tp_getattro; */ (getattrofunc) pyrna_prop_array_getattro, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -4921,7 +4925,7 @@ PyTypeObject pyrna_prop_array_Type= {
/*** Assigned meaning in release 2.1 ***/ /*** Assigned meaning in release 2.1 ***/
/*** rich comparisons ***/ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */ NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
@ -4935,22 +4939,22 @@ PyTypeObject pyrna_prop_array_Type= {
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_array_methods, /* struct PyMethodDef *tp_methods; */ pyrna_prop_array_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
&pyrna_prop_Type, /* struct _typeobject *tp_base; */ &pyrna_prop_Type, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */ NULL, /* descrsetfunc tp_descr_set; */
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */ NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */ NULL, /* PyObject *tp_bases; */
/* method resolution order */ /* method resolution order */
NULL, /* PyObject *tp_mro; */ NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */ NULL, /* PyObject *tp_cache; */
@ -4961,32 +4965,32 @@ PyTypeObject pyrna_prop_array_Type= {
PyTypeObject pyrna_prop_collection_Type= { PyTypeObject pyrna_prop_collection_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop_collection", /* tp_name */ "bpy_prop_collection", /* tp_name */
sizeof(BPy_PropertyRNA), /* tp_basicsize */ sizeof(BPy_PropertyRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
(destructor)pyrna_prop_dealloc, /* tp_dealloc */ (destructor)pyrna_prop_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
NULL, /* subclassed */ /* tp_repr */ NULL, /* subclassed */ /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
&pyrna_prop_collection_as_number, /* PyNumberMethods *tp_as_number; */ &pyrna_prop_collection_as_number, /* PyNumberMethods *tp_as_number; */
&pyrna_prop_collection_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &pyrna_prop_collection_as_sequence, /* PySequenceMethods *tp_as_sequence; */
&pyrna_prop_collection_as_mapping, /* PyMappingMethods *tp_as_mapping; */ &pyrna_prop_collection_as_mapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
(getattrofunc) pyrna_prop_collection_getattro, /* getattrofunc tp_getattro; */ (getattrofunc) pyrna_prop_collection_getattro, /* getattrofunc tp_getattro; */
(setattrofunc) pyrna_prop_collection_setattro, /* setattrofunc tp_setattro; */ (setattrofunc) pyrna_prop_collection_setattro, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -4994,7 +4998,7 @@ PyTypeObject pyrna_prop_collection_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -5008,33 +5012,33 @@ PyTypeObject pyrna_prop_collection_Type= {
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else #else
0, 0,
#endif #endif
/*** Added in release 2.2 ***/ /*** Added in release 2.2 ***/
/* Iterators */ /* Iterators */
(getiterfunc)pyrna_prop_collection_iter, /* getiterfunc tp_iter; */ (getiterfunc)pyrna_prop_collection_iter, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_collection_methods, /* struct PyMethodDef *tp_methods; */ pyrna_prop_collection_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
&pyrna_prop_Type, /* struct _typeobject *tp_base; */ &pyrna_prop_Type, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */ NULL, /* descrsetfunc tp_descr_set; */
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */ NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */ NULL, /* PyObject *tp_bases; */
/* method resolution order */ /* method resolution order */
NULL, /* PyObject *tp_mro; */ NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */ NULL, /* PyObject *tp_cache; */
@ -5046,32 +5050,32 @@ PyTypeObject pyrna_prop_collection_Type= {
/* only for add/remove/move methods */ /* only for add/remove/move methods */
static PyTypeObject pyrna_prop_collection_idprop_Type= { static PyTypeObject pyrna_prop_collection_idprop_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop_collection_idprop", /* tp_name */ "bpy_prop_collection_idprop", /* tp_name */
sizeof(BPy_PropertyRNA), /* tp_basicsize */ sizeof(BPy_PropertyRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
(destructor)pyrna_prop_dealloc, /* tp_dealloc */ (destructor)pyrna_prop_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
NULL, /* subclassed */ /* tp_repr */ NULL, /* subclassed */ /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
NULL, /* getattrofunc tp_getattro; */ NULL, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -5079,7 +5083,7 @@ static PyTypeObject pyrna_prop_collection_idprop_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -5093,33 +5097,33 @@ static PyTypeObject pyrna_prop_collection_idprop_Type= {
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else #else
0, 0,
#endif #endif
/*** Added in release 2.2 ***/ /*** Added in release 2.2 ***/
/* Iterators */ /* Iterators */
NULL, /* getiterfunc tp_iter; */ NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_collection_idprop_methods, /* struct PyMethodDef *tp_methods; */ pyrna_prop_collection_idprop_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
&pyrna_prop_collection_Type, /* struct _typeobject *tp_base; */ &pyrna_prop_collection_Type,/* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */ NULL, /* descrsetfunc tp_descr_set; */
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */ NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */ NULL, /* PyObject *tp_bases; */
/* method resolution order */ /* method resolution order */
NULL, /* PyObject *tp_mro; */ NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */ NULL, /* PyObject *tp_cache; */
@ -5131,32 +5135,32 @@ static PyTypeObject pyrna_prop_collection_idprop_Type= {
/*-----------------------BPy_PropertyRNA method def------------------------------*/ /*-----------------------BPy_PropertyRNA method def------------------------------*/
PyTypeObject pyrna_func_Type= { PyTypeObject pyrna_func_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_func", /* tp_name */ "bpy_func", /* tp_name */
sizeof(BPy_FunctionRNA), /* tp_basicsize */ sizeof(BPy_FunctionRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
NULL, /* tp_dealloc */ NULL, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
(reprfunc) pyrna_func_repr, /* tp_repr */ (reprfunc) pyrna_func_repr, /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
(ternaryfunc)pyrna_func_call, /* ternaryfunc tp_call; */ (ternaryfunc)pyrna_func_call, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
NULL, /* getattrofunc tp_getattro; */ NULL, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -5164,7 +5168,7 @@ PyTypeObject pyrna_func_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */ Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -5174,7 +5178,7 @@ PyTypeObject pyrna_func_Type= {
/*** Assigned meaning in release 2.1 ***/ /*** Assigned meaning in release 2.1 ***/
/*** rich comparisons ***/ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */ NULL, /* richcmpfunc tp_richcompare; */
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
@ -5185,13 +5189,13 @@ PyTypeObject pyrna_func_Type= {
/*** Added in release 2.2 ***/ /*** Added in release 2.2 ***/
/* Iterators */ /* Iterators */
NULL, /* getiterfunc tp_iter; */ NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */ NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */ NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
@ -5199,7 +5203,7 @@ PyTypeObject pyrna_func_Type= {
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
@ -5227,32 +5231,32 @@ static PyObject *pyrna_prop_collection_iter_next(BPy_PropertyCollectionIterRNA *
PyTypeObject pyrna_prop_collection_iter_Type= { PyTypeObject pyrna_prop_collection_iter_Type= {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop_collection_iter", /* tp_name */ "bpy_prop_collection_iter", /* tp_name */
sizeof(BPy_PropertyCollectionIterRNA), /* tp_basicsize */ sizeof(BPy_PropertyCollectionIterRNA), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
/* methods */ /* methods */
(destructor)pyrna_prop_collection_iter_dealloc, /* tp_dealloc */ (destructor)pyrna_prop_collection_iter_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */ NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */ NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
NULL,/* subclassed */ /* tp_repr */ NULL,/* subclassed */ /* tp_repr */
/* Method suites for standard classes */ /* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */ NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */ /* More standard operations (here for binary compatibility) */
NULL, /* hashfunc tp_hash; */ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */ NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */ NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */ /* will only use these if this is a subtype of a py class */
PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */
NULL, /* setattrofunc tp_setattro; */ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */ /* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */ NULL, /* PyBufferProcs *tp_as_buffer; */
@ -5260,7 +5264,7 @@ PyTypeObject pyrna_prop_collection_iter_Type= {
/*** Flags to define presence of optional/expanded features ***/ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */ Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */ NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */ /* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */ NULL, /* traverseproc tp_traverse; */
@ -5274,19 +5278,19 @@ PyTypeObject pyrna_prop_collection_iter_Type= {
/*** weak reference enabler ***/ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS #ifdef USE_WEAKREFS
offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), /* long tp_weaklistoffset; */ offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else #else
0, 0,
#endif #endif
/*** Added in release 2.2 ***/ /*** Added in release 2.2 ***/
/* Iterators */ /* Iterators */
PyObject_SelfIter, /* getiterfunc tp_iter; */ PyObject_SelfIter, /* getiterfunc tp_iter; */
(iternextfunc) pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */ (iternextfunc) pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */ NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */ NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrgetfunc tp_descr_get; */
@ -5294,12 +5298,12 @@ PyTypeObject pyrna_prop_collection_iter_Type= {
0, /* long tp_dictoffset; */ 0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */ NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */ NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */ /* Low-level free-memory routine */
NULL, /* freefunc tp_free; */ NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */ /* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */ NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */ NULL, /* PyObject *tp_bases; */
/* method resolution order */ /* method resolution order */
NULL, /* PyObject *tp_mro; */ NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */ NULL, /* PyObject *tp_cache; */

@ -178,7 +178,7 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs)
fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp); fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp);
} }
BLI_exec_cb(rs, (ID *)rs, BLI_CB_EVT_RENDER_STATS); BLI_exec_cb(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
fputc('\n', stdout); fputc('\n', stdout);
fflush(stdout); fflush(stdout);
@ -645,9 +645,9 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int
render_layer_add_pass(rr, rl, 3, SCE_PASS_REFRACT); render_layer_add_pass(rr, rl, 3, SCE_PASS_REFRACT);
if(srl->passflag & SCE_PASS_INDEXOB) if(srl->passflag & SCE_PASS_INDEXOB)
render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXOB); render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXOB);
if(srl->passflag & SCE_PASS_INDEXMA) if(srl->passflag & SCE_PASS_INDEXMA)
render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXMA); render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXMA);
if(srl->passflag & SCE_PASS_MIST) if(srl->passflag & SCE_PASS_MIST)
render_layer_add_pass(rr, rl, 1, SCE_PASS_MIST); render_layer_add_pass(rr, rl, 1, SCE_PASS_MIST);
if(rl->passflag & SCE_PASS_RAYHITS) if(rl->passflag & SCE_PASS_RAYHITS)
render_layer_add_pass(rr, rl, 4, SCE_PASS_RAYHITS); render_layer_add_pass(rr, rl, 4, SCE_PASS_RAYHITS);

@ -282,10 +282,10 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
else if(ok1==0 || ok2==0) return; else if(ok1==0 || ok2==0) return;
/* at least 1 visible interesction point */ /* at least 1 visible interesction point */
if(t1<0.0f && t2<0.0f) return; if(t1<0.0 && t2<0.0) return;
if(t1<0.0f) t1= 0.0f; if(t1<0.0) t1= 0.0;
if(t2<0.0f) t2= 0.0f; if(t2<0.0) t2= 0.0;
if(t1==t2) return; if(t1==t2) return;
@ -423,8 +423,8 @@ float fresnel_fac(float *view, float *vn, float grad, float fac)
static double saacos_d(double fac) static double saacos_d(double fac)
{ {
if(fac<= -1.0f) return M_PI; if(fac<= -1.0) return M_PI;
else if(fac>=1.0f) return 0.0; else if(fac>=1.0) return 0.0;
else return acos(fac); else return acos(fac);
} }
@ -590,7 +590,7 @@ static float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent)
i= spec(nh, hard); i= spec(nh, hard);
i= i/(0.1+nv); i= i/(0.1f+nv);
return i; return i;
} }
@ -896,7 +896,7 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi)
if(ma->ramp_col) { if(ma->ramp_col) {
if(ma->rampin_col==MA_RAMP_IN_RESULT) { if(ma->rampin_col==MA_RAMP_IN_RESULT) {
fac= 0.3*diff[0] + 0.58*diff[1] + 0.12*diff[2]; fac= 0.3f*diff[0] + 0.58f*diff[1] + 0.12f*diff[2];
do_colorband(ma->ramp_col, fac, col); do_colorband(ma->ramp_col, fac, col);
/* blending method */ /* blending method */
@ -926,7 +926,7 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa
/* input */ /* input */
switch(ma->rampin_col) { switch(ma->rampin_col) {
case MA_RAMP_IN_ENERGY: case MA_RAMP_IN_ENERGY:
fac= 0.3*r + 0.58*g + 0.12*b; fac= 0.3f*r + 0.58f*g + 0.12f*b;
break; break;
case MA_RAMP_IN_SHADER: case MA_RAMP_IN_SHADER:
fac= is; fac= is;
@ -966,7 +966,7 @@ static void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInpu
float fac; float fac;
if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) { if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) {
fac= 0.3*(*specr) + 0.58*(*specg) + 0.12*(*specb); fac= 0.3f*(*specr) + 0.58f*(*specg) + 0.12f*(*specb);
do_colorband(ma->ramp_spec, fac, col); do_colorband(ma->ramp_spec, fac, col);
/* blending method */ /* blending method */
@ -1213,7 +1213,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist)
} }
} }
} }
if (visifac <= 0.001) visifac = 0.0f; if (visifac <= 0.001f) visifac = 0.0f;
return visifac; return visifac;
} }
} }
@ -1231,7 +1231,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
view= shi->view; view= shi->view;
if (lar->energy == 0.0) return; if (lar->energy == 0.0f) return;
/* only shadow lamps shouldn't affect shadow-less materials at all */ /* only shadow lamps shouldn't affect shadow-less materials at all */
if ((lar->mode & LA_ONLYSHADOW) && (!(ma->mode & MA_SHADOW) || !(R.r.mode & R_SHADOW))) if ((lar->mode & LA_ONLYSHADOW) && (!(ma->mode & MA_SHADOW) || !(R.r.mode & R_SHADOW)))
return; return;
@ -1359,7 +1359,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* 'is' is diffuse */ /* 'is' is diffuse */
if((ma->shade_flag & MA_CUBIC) && is>0.0f && is<1.0f) if((ma->shade_flag & MA_CUBIC) && is>0.0f && is<1.0f)
is= 3.0*is*is - 2.0*is*is*is; // nicer termination of shades is= 3.0f*is*is - 2.0f*is*is*is; // nicer termination of shades
i= is*phongcorr; i= is*phongcorr;
@ -1388,7 +1388,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
lamp_get_shadow(lar, shi, inp, shadfac, shi->depth); lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
/* warning, here it skips the loop */ /* warning, here it skips the loop */
if((lar->mode & LA_ONLYSHADOW) && i>0.0) { if((lar->mode & LA_ONLYSHADOW) && i>0.0f) {
shadfac[3]= i*lar->energy*(1.0f-shadfac[3]); shadfac[3]= i*lar->energy*(1.0f-shadfac[3]);
shr->shad[0] -= shadfac[3]*shi->r*(1.0f-lashdw[0]); shr->shad[0] -= shadfac[3]*shi->r*(1.0f-lashdw[0]);
@ -1448,7 +1448,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2]; t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2];
if(lar->type==LA_HEMI) { if(lar->type==LA_HEMI) {
t= 0.5*t+0.5; t= 0.5f*t+0.5f;
} }
t= shadfac[3]*shi->spec*spec(t, shi->har); t= shadfac[3]*shi->spec*spec(t, shi->har);

@ -4115,13 +4115,13 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
add_transp_obindex(rlpp[a], od, obr->ob); add_transp_obindex(rlpp[a], od, obr->ob);
} }
} }
if(addpassflag & SCE_PASS_INDEXMA) { if(addpassflag & SCE_PASS_INDEXMA) {
ObjectRen *obr= R.objectinstance[zrow[totface-1].obi].obr; ObjectRen *obr= R.objectinstance[zrow[totface-1].obi].obr;
if(obr->ob) { if(obr->ob) {
for(a= 0; a<totfullsample; a++) for(a= 0; a<totfullsample; a++)
add_transp_obindex(rlpp[a], od, obr->ob); add_transp_obindex(rlpp[a], od, obr->ob);
} }
} }
/* for each mask-sample we alpha-under colors. then in end it's added using filter */ /* for each mask-sample we alpha-under colors. then in end it's added using filter */
memset(samp_shr, 0, sizeof(ShadeResult)*osa); memset(samp_shr, 0, sizeof(ShadeResult)*osa);

@ -108,21 +108,28 @@ static GHash *global_ops_hash= NULL;
wmOperatorType *WM_operatortype_find(const char *idname, int quiet) wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
{ {
wmOperatorType *ot; if(idname[0]) {
wmOperatorType *ot;
char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax
WM_operator_bl_idname(idname_bl, idname); /* needed to support python style names without the _OT_ syntax */
char idname_bl[OP_MAX_TYPENAME];
WM_operator_bl_idname(idname_bl, idname);
if (idname_bl[0]) {
ot= BLI_ghash_lookup(global_ops_hash, idname_bl); ot= BLI_ghash_lookup(global_ops_hash, idname_bl);
if(ot) { if(ot) {
return ot; return ot;
} }
if(!quiet) {
printf("search for unknown operator '%s', '%s'\n", idname_bl, idname);
}
} }
else {
if(!quiet) if(!quiet) {
printf("search for unknown operator %s, %s\n", idname_bl, idname); printf("search for empty operator\n");
}
}
return NULL; return NULL;
} }
@ -1259,11 +1266,12 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
split = uiLayoutSplit(layout, 0, 0); split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0); col = uiLayoutColumn(split, 0);
uiItemL(col, "Links", ICON_NONE); uiItemL(col, "Links", ICON_NONE);
uiItemStringO(col, "Donations", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment/"); uiItemStringO(col, "Donations", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259/"); uiItemStringO(col, "Credits", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits");
uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259");
uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/"); uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community/"); // uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) { if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) {
BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100); BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100);
} }

@ -51,197 +51,195 @@
/** /**
Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
*/ */
class BL_BlenderInputDevice : public SCA_IInputDevice class BL_BlenderInputDevice : public SCA_IInputDevice
{ {
// this map is Blender specific: a conversion between blender and ketsji enums // this map is Blender specific: a conversion between blender and ketsji enums
std::map<int,KX_EnumInputs> m_reverseKeyTranslateTable; std::map<int,KX_EnumInputs> m_reverseKeyTranslateTable;
public: public:
BL_BlenderInputDevice() BL_BlenderInputDevice()
{ {
/* The reverse table. In order to not confuse ourselves, we */
/* immediately convert all events that come in to KX codes. */
m_reverseKeyTranslateTable[LEFTMOUSE ] = KX_LEFTMOUSE ;
m_reverseKeyTranslateTable[MIDDLEMOUSE ] = KX_MIDDLEMOUSE ;
m_reverseKeyTranslateTable[RIGHTMOUSE ] = KX_RIGHTMOUSE ;
m_reverseKeyTranslateTable[WHEELUPMOUSE ] = KX_WHEELUPMOUSE ;
m_reverseKeyTranslateTable[WHEELDOWNMOUSE ] = KX_WHEELDOWNMOUSE ;
m_reverseKeyTranslateTable[MOUSEX ] = KX_MOUSEX ;
m_reverseKeyTranslateTable[MOUSEY ] = KX_MOUSEY ;
// TIMERS
m_reverseKeyTranslateTable[TIMER0 ] = KX_TIMER0 ; /* The reverse table. In order to not confuse ourselves, we */
m_reverseKeyTranslateTable[TIMER1 ] = KX_TIMER1 ; /* immediately convert all events that come in to KX codes. */
m_reverseKeyTranslateTable[TIMER2 ] = KX_TIMER2 ; m_reverseKeyTranslateTable[LEFTMOUSE ] = KX_LEFTMOUSE;
m_reverseKeyTranslateTable[MIDDLEMOUSE ] = KX_MIDDLEMOUSE;
// SYSTEM m_reverseKeyTranslateTable[RIGHTMOUSE ] = KX_RIGHTMOUSE;
#if 0 m_reverseKeyTranslateTable[WHEELUPMOUSE ] = KX_WHEELUPMOUSE;
/* **** XXX **** */ m_reverseKeyTranslateTable[WHEELDOWNMOUSE ] = KX_WHEELDOWNMOUSE;
m_reverseKeyTranslateTable[KEYBD ] = KX_KEYBD ; m_reverseKeyTranslateTable[MOUSEX ] = KX_MOUSEX;
m_reverseKeyTranslateTable[RAWKEYBD ] = KX_RAWKEYBD ; m_reverseKeyTranslateTable[MOUSEY ] = KX_MOUSEY;
m_reverseKeyTranslateTable[REDRAW ] = KX_REDRAW ;
m_reverseKeyTranslateTable[INPUTCHANGE ] = KX_INPUTCHANGE ; // TIMERS
m_reverseKeyTranslateTable[QFULL ] = KX_QFULL ;
m_reverseKeyTranslateTable[WINFREEZE ] = KX_WINFREEZE ; m_reverseKeyTranslateTable[TIMER0 ] = KX_TIMER0;
m_reverseKeyTranslateTable[WINTHAW ] = KX_WINTHAW ; m_reverseKeyTranslateTable[TIMER1 ] = KX_TIMER1;
m_reverseKeyTranslateTable[WINCLOSE ] = KX_WINCLOSE ; m_reverseKeyTranslateTable[TIMER2 ] = KX_TIMER2;
m_reverseKeyTranslateTable[WINQUIT ] = KX_WINQUIT ;
m_reverseKeyTranslateTable[Q_FIRSTTIME ] = KX_Q_FIRSTTIME ; // SYSTEM
/* **** XXX **** */ #if 0
#endif /* **** XXX **** */
// standard keyboard m_reverseKeyTranslateTable[KEYBD ] = KX_KEYBD;
m_reverseKeyTranslateTable[RAWKEYBD ] = KX_RAWKEYBD;
m_reverseKeyTranslateTable[AKEY ] = KX_AKEY ; m_reverseKeyTranslateTable[REDRAW ] = KX_REDRAW;
m_reverseKeyTranslateTable[BKEY ] = KX_BKEY ; m_reverseKeyTranslateTable[INPUTCHANGE ] = KX_INPUTCHANGE;
m_reverseKeyTranslateTable[CKEY ] = KX_CKEY ; m_reverseKeyTranslateTable[QFULL ] = KX_QFULL;
m_reverseKeyTranslateTable[DKEY ] = KX_DKEY ; m_reverseKeyTranslateTable[WINFREEZE ] = KX_WINFREEZE;
m_reverseKeyTranslateTable[EKEY ] = KX_EKEY ; m_reverseKeyTranslateTable[WINTHAW ] = KX_WINTHAW;
m_reverseKeyTranslateTable[FKEY ] = KX_FKEY ; m_reverseKeyTranslateTable[WINCLOSE ] = KX_WINCLOSE;
m_reverseKeyTranslateTable[GKEY ] = KX_GKEY ; m_reverseKeyTranslateTable[WINQUIT ] = KX_WINQUIT;
//XXX clean up m_reverseKeyTranslateTable[Q_FIRSTTIME ] = KX_Q_FIRSTTIME;
/* **** XXX **** */
#endif
// standard keyboard
m_reverseKeyTranslateTable[AKEY ] = KX_AKEY;
m_reverseKeyTranslateTable[BKEY ] = KX_BKEY;
m_reverseKeyTranslateTable[CKEY ] = KX_CKEY;
m_reverseKeyTranslateTable[DKEY ] = KX_DKEY;
m_reverseKeyTranslateTable[EKEY ] = KX_EKEY;
m_reverseKeyTranslateTable[FKEY ] = KX_FKEY;
m_reverseKeyTranslateTable[GKEY ] = KX_GKEY;
//XXX clean up
#ifdef WIN32 #ifdef WIN32
#define HKEY 'h' #define HKEY 'h'
#endif #endif
m_reverseKeyTranslateTable[HKEY ] = KX_HKEY ; m_reverseKeyTranslateTable[HKEY ] = KX_HKEY;
//XXX clean up //XXX clean up
#ifdef WIN32 #ifdef WIN32
#undef HKEY #undef HKEY
#endif #endif
m_reverseKeyTranslateTable[IKEY ] = KX_IKEY ; m_reverseKeyTranslateTable[IKEY ] = KX_IKEY;
m_reverseKeyTranslateTable[JKEY ] = KX_JKEY ; m_reverseKeyTranslateTable[JKEY ] = KX_JKEY;
m_reverseKeyTranslateTable[KKEY ] = KX_KKEY ; m_reverseKeyTranslateTable[KKEY ] = KX_KKEY;
m_reverseKeyTranslateTable[LKEY ] = KX_LKEY ; m_reverseKeyTranslateTable[LKEY ] = KX_LKEY;
m_reverseKeyTranslateTable[MKEY ] = KX_MKEY ; m_reverseKeyTranslateTable[MKEY ] = KX_MKEY;
m_reverseKeyTranslateTable[NKEY ] = KX_NKEY ; m_reverseKeyTranslateTable[NKEY ] = KX_NKEY;
m_reverseKeyTranslateTable[OKEY ] = KX_OKEY ; m_reverseKeyTranslateTable[OKEY ] = KX_OKEY;
m_reverseKeyTranslateTable[PKEY ] = KX_PKEY ; m_reverseKeyTranslateTable[PKEY ] = KX_PKEY;
m_reverseKeyTranslateTable[QKEY ] = KX_QKEY ; m_reverseKeyTranslateTable[QKEY ] = KX_QKEY;
m_reverseKeyTranslateTable[RKEY ] = KX_RKEY ; m_reverseKeyTranslateTable[RKEY ] = KX_RKEY;
m_reverseKeyTranslateTable[SKEY ] = KX_SKEY ; m_reverseKeyTranslateTable[SKEY ] = KX_SKEY;
m_reverseKeyTranslateTable[TKEY ] = KX_TKEY ; m_reverseKeyTranslateTable[TKEY ] = KX_TKEY;
m_reverseKeyTranslateTable[UKEY ] = KX_UKEY ; m_reverseKeyTranslateTable[UKEY ] = KX_UKEY;
m_reverseKeyTranslateTable[VKEY ] = KX_VKEY ; m_reverseKeyTranslateTable[VKEY ] = KX_VKEY;
m_reverseKeyTranslateTable[WKEY ] = KX_WKEY ; m_reverseKeyTranslateTable[WKEY ] = KX_WKEY;
m_reverseKeyTranslateTable[XKEY ] = KX_XKEY ; m_reverseKeyTranslateTable[XKEY ] = KX_XKEY;
m_reverseKeyTranslateTable[YKEY ] = KX_YKEY ; m_reverseKeyTranslateTable[YKEY ] = KX_YKEY;
m_reverseKeyTranslateTable[ZKEY ] = KX_ZKEY ; m_reverseKeyTranslateTable[ZKEY ] = KX_ZKEY;
m_reverseKeyTranslateTable[ZEROKEY ] = KX_ZEROKEY ;
m_reverseKeyTranslateTable[ONEKEY ] = KX_ONEKEY ;
m_reverseKeyTranslateTable[TWOKEY ] = KX_TWOKEY ;
m_reverseKeyTranslateTable[THREEKEY ] = KX_THREEKEY ;
m_reverseKeyTranslateTable[FOURKEY ] = KX_FOURKEY ;
m_reverseKeyTranslateTable[FIVEKEY ] = KX_FIVEKEY ;
m_reverseKeyTranslateTable[SIXKEY ] = KX_SIXKEY ;
m_reverseKeyTranslateTable[SEVENKEY ] = KX_SEVENKEY ;
m_reverseKeyTranslateTable[EIGHTKEY ] = KX_EIGHTKEY ;
m_reverseKeyTranslateTable[NINEKEY ] = KX_NINEKEY ;
m_reverseKeyTranslateTable[CAPSLOCKKEY ] = KX_CAPSLOCKKEY ;
m_reverseKeyTranslateTable[LEFTCTRLKEY ] = KX_LEFTCTRLKEY ;
m_reverseKeyTranslateTable[LEFTALTKEY ] = KX_LEFTALTKEY ;
m_reverseKeyTranslateTable[RIGHTALTKEY ] = KX_RIGHTALTKEY ;
m_reverseKeyTranslateTable[RIGHTCTRLKEY ] = KX_RIGHTCTRLKEY ;
m_reverseKeyTranslateTable[RIGHTSHIFTKEY ] = KX_RIGHTSHIFTKEY ;
m_reverseKeyTranslateTable[LEFTSHIFTKEY ] = KX_LEFTSHIFTKEY ;
m_reverseKeyTranslateTable[ESCKEY ] = KX_ESCKEY ;
m_reverseKeyTranslateTable[TABKEY ] = KX_TABKEY ;
m_reverseKeyTranslateTable[RETKEY ] = KX_RETKEY ;
m_reverseKeyTranslateTable[SPACEKEY ] = KX_SPACEKEY ;
m_reverseKeyTranslateTable[LINEFEEDKEY ] = KX_LINEFEEDKEY ;
m_reverseKeyTranslateTable[BACKSPACEKEY ] = KX_BACKSPACEKEY ;
m_reverseKeyTranslateTable[DELKEY ] = KX_DELKEY ;
m_reverseKeyTranslateTable[SEMICOLONKEY ] = KX_SEMICOLONKEY ;
m_reverseKeyTranslateTable[PERIODKEY ] = KX_PERIODKEY ;
m_reverseKeyTranslateTable[COMMAKEY ] = KX_COMMAKEY ;
m_reverseKeyTranslateTable[QUOTEKEY ] = KX_QUOTEKEY ;
m_reverseKeyTranslateTable[ACCENTGRAVEKEY ] = KX_ACCENTGRAVEKEY ;
m_reverseKeyTranslateTable[MINUSKEY ] = KX_MINUSKEY ;
m_reverseKeyTranslateTable[SLASHKEY ] = KX_SLASHKEY ;
m_reverseKeyTranslateTable[BACKSLASHKEY ] = KX_BACKSLASHKEY ;
m_reverseKeyTranslateTable[EQUALKEY ] = KX_EQUALKEY ;
m_reverseKeyTranslateTable[LEFTBRACKETKEY ] = KX_LEFTBRACKETKEY ;
m_reverseKeyTranslateTable[RIGHTBRACKETKEY ] = KX_RIGHTBRACKETKEY ;
m_reverseKeyTranslateTable[LEFTARROWKEY ] = KX_LEFTARROWKEY ;
m_reverseKeyTranslateTable[DOWNARROWKEY ] = KX_DOWNARROWKEY ;
m_reverseKeyTranslateTable[RIGHTARROWKEY ] = KX_RIGHTARROWKEY ;
m_reverseKeyTranslateTable[UPARROWKEY ] = KX_UPARROWKEY ;
m_reverseKeyTranslateTable[PAD2 ] = KX_PAD2 ;
m_reverseKeyTranslateTable[PAD4 ] = KX_PAD4 ;
m_reverseKeyTranslateTable[PAD6 ] = KX_PAD6 ;
m_reverseKeyTranslateTable[PAD8 ] = KX_PAD8 ;
m_reverseKeyTranslateTable[PAD1 ] = KX_PAD1 ;
m_reverseKeyTranslateTable[PAD3 ] = KX_PAD3 ;
m_reverseKeyTranslateTable[PAD5 ] = KX_PAD5 ;
m_reverseKeyTranslateTable[PAD7 ] = KX_PAD7 ;
m_reverseKeyTranslateTable[PAD9 ] = KX_PAD9 ;
m_reverseKeyTranslateTable[PADPERIOD ] = KX_PADPERIOD ; m_reverseKeyTranslateTable[ZEROKEY ] = KX_ZEROKEY;
m_reverseKeyTranslateTable[PADSLASHKEY ] = KX_PADSLASHKEY ; m_reverseKeyTranslateTable[ONEKEY ] = KX_ONEKEY;
m_reverseKeyTranslateTable[PADASTERKEY ] = KX_PADASTERKEY ; m_reverseKeyTranslateTable[TWOKEY ] = KX_TWOKEY;
m_reverseKeyTranslateTable[THREEKEY ] = KX_THREEKEY;
m_reverseKeyTranslateTable[FOURKEY ] = KX_FOURKEY;
m_reverseKeyTranslateTable[PAD0 ] = KX_PAD0 ; m_reverseKeyTranslateTable[FIVEKEY ] = KX_FIVEKEY;
m_reverseKeyTranslateTable[PADMINUS ] = KX_PADMINUS ; m_reverseKeyTranslateTable[SIXKEY ] = KX_SIXKEY;
m_reverseKeyTranslateTable[PADENTER ] = KX_PADENTER ; m_reverseKeyTranslateTable[SEVENKEY ] = KX_SEVENKEY;
m_reverseKeyTranslateTable[PADPLUSKEY ] = KX_PADPLUSKEY ; m_reverseKeyTranslateTable[EIGHTKEY ] = KX_EIGHTKEY;
m_reverseKeyTranslateTable[NINEKEY ] = KX_NINEKEY;
m_reverseKeyTranslateTable[F1KEY ] = KX_F1KEY ;
m_reverseKeyTranslateTable[F2KEY ] = KX_F2KEY ;
m_reverseKeyTranslateTable[F3KEY ] = KX_F3KEY ;
m_reverseKeyTranslateTable[F4KEY ] = KX_F4KEY ;
m_reverseKeyTranslateTable[F5KEY ] = KX_F5KEY ;
m_reverseKeyTranslateTable[F6KEY ] = KX_F6KEY ;
m_reverseKeyTranslateTable[F7KEY ] = KX_F7KEY ;
m_reverseKeyTranslateTable[F8KEY ] = KX_F8KEY ;
m_reverseKeyTranslateTable[F9KEY ] = KX_F9KEY ;
m_reverseKeyTranslateTable[F10KEY ] = KX_F10KEY ;
m_reverseKeyTranslateTable[F11KEY ] = KX_F11KEY ;
m_reverseKeyTranslateTable[F12KEY ] = KX_F12KEY ;
m_reverseKeyTranslateTable[F13KEY ] = KX_F13KEY ;
m_reverseKeyTranslateTable[F14KEY ] = KX_F14KEY ;
m_reverseKeyTranslateTable[F15KEY ] = KX_F15KEY ;
m_reverseKeyTranslateTable[F16KEY ] = KX_F16KEY ;
m_reverseKeyTranslateTable[F17KEY ] = KX_F17KEY ;
m_reverseKeyTranslateTable[F18KEY ] = KX_F18KEY ;
m_reverseKeyTranslateTable[F19KEY ] = KX_F19KEY ;
m_reverseKeyTranslateTable[PAUSEKEY ] = KX_PAUSEKEY ;
m_reverseKeyTranslateTable[INSERTKEY ] = KX_INSERTKEY ;
m_reverseKeyTranslateTable[HOMEKEY ] = KX_HOMEKEY ;
m_reverseKeyTranslateTable[PAGEUPKEY ] = KX_PAGEUPKEY ;
m_reverseKeyTranslateTable[PAGEDOWNKEY ] = KX_PAGEDOWNKEY ;
m_reverseKeyTranslateTable[ENDKEY ] = KX_ENDKEY ;
m_reverseKeyTranslateTable[CAPSLOCKKEY ] = KX_CAPSLOCKKEY;
}
m_reverseKeyTranslateTable[LEFTCTRLKEY ] = KX_LEFTCTRLKEY;
m_reverseKeyTranslateTable[LEFTALTKEY ] = KX_LEFTALTKEY;
m_reverseKeyTranslateTable[RIGHTALTKEY ] = KX_RIGHTALTKEY;
m_reverseKeyTranslateTable[RIGHTCTRLKEY ] = KX_RIGHTCTRLKEY;
m_reverseKeyTranslateTable[RIGHTSHIFTKEY ] = KX_RIGHTSHIFTKEY;
m_reverseKeyTranslateTable[LEFTSHIFTKEY ] = KX_LEFTSHIFTKEY;
m_reverseKeyTranslateTable[ESCKEY ] = KX_ESCKEY;
m_reverseKeyTranslateTable[TABKEY ] = KX_TABKEY;
m_reverseKeyTranslateTable[RETKEY ] = KX_RETKEY;
m_reverseKeyTranslateTable[SPACEKEY ] = KX_SPACEKEY;
m_reverseKeyTranslateTable[LINEFEEDKEY ] = KX_LINEFEEDKEY;
m_reverseKeyTranslateTable[BACKSPACEKEY ] = KX_BACKSPACEKEY;
m_reverseKeyTranslateTable[DELKEY ] = KX_DELKEY;
m_reverseKeyTranslateTable[SEMICOLONKEY ] = KX_SEMICOLONKEY;
m_reverseKeyTranslateTable[PERIODKEY ] = KX_PERIODKEY;
m_reverseKeyTranslateTable[COMMAKEY ] = KX_COMMAKEY;
m_reverseKeyTranslateTable[QUOTEKEY ] = KX_QUOTEKEY;
m_reverseKeyTranslateTable[ACCENTGRAVEKEY ] = KX_ACCENTGRAVEKEY;
m_reverseKeyTranslateTable[MINUSKEY ] = KX_MINUSKEY;
m_reverseKeyTranslateTable[SLASHKEY ] = KX_SLASHKEY;
m_reverseKeyTranslateTable[BACKSLASHKEY ] = KX_BACKSLASHKEY;
m_reverseKeyTranslateTable[EQUALKEY ] = KX_EQUALKEY;
m_reverseKeyTranslateTable[LEFTBRACKETKEY ] = KX_LEFTBRACKETKEY;
m_reverseKeyTranslateTable[RIGHTBRACKETKEY ] = KX_RIGHTBRACKETKEY;
m_reverseKeyTranslateTable[LEFTARROWKEY ] = KX_LEFTARROWKEY;
m_reverseKeyTranslateTable[DOWNARROWKEY ] = KX_DOWNARROWKEY;
m_reverseKeyTranslateTable[RIGHTARROWKEY ] = KX_RIGHTARROWKEY;
m_reverseKeyTranslateTable[UPARROWKEY ] = KX_UPARROWKEY;
m_reverseKeyTranslateTable[PAD2 ] = KX_PAD2;
m_reverseKeyTranslateTable[PAD4 ] = KX_PAD4;
m_reverseKeyTranslateTable[PAD6 ] = KX_PAD6;
m_reverseKeyTranslateTable[PAD8 ] = KX_PAD8;
m_reverseKeyTranslateTable[PAD1 ] = KX_PAD1;
m_reverseKeyTranslateTable[PAD3 ] = KX_PAD3;
m_reverseKeyTranslateTable[PAD5 ] = KX_PAD5;
m_reverseKeyTranslateTable[PAD7 ] = KX_PAD7;
m_reverseKeyTranslateTable[PAD9 ] = KX_PAD9;
m_reverseKeyTranslateTable[PADPERIOD ] = KX_PADPERIOD;
m_reverseKeyTranslateTable[PADSLASHKEY ] = KX_PADSLASHKEY;
m_reverseKeyTranslateTable[PADASTERKEY ] = KX_PADASTERKEY;
m_reverseKeyTranslateTable[PAD0 ] = KX_PAD0;
m_reverseKeyTranslateTable[PADMINUS ] = KX_PADMINUS;
m_reverseKeyTranslateTable[PADENTER ] = KX_PADENTER;
m_reverseKeyTranslateTable[PADPLUSKEY ] = KX_PADPLUSKEY;
m_reverseKeyTranslateTable[F1KEY ] = KX_F1KEY;
m_reverseKeyTranslateTable[F2KEY ] = KX_F2KEY;
m_reverseKeyTranslateTable[F3KEY ] = KX_F3KEY;
m_reverseKeyTranslateTable[F4KEY ] = KX_F4KEY;
m_reverseKeyTranslateTable[F5KEY ] = KX_F5KEY;
m_reverseKeyTranslateTable[F6KEY ] = KX_F6KEY;
m_reverseKeyTranslateTable[F7KEY ] = KX_F7KEY;
m_reverseKeyTranslateTable[F8KEY ] = KX_F8KEY;
m_reverseKeyTranslateTable[F9KEY ] = KX_F9KEY;
m_reverseKeyTranslateTable[F10KEY ] = KX_F10KEY;
m_reverseKeyTranslateTable[F11KEY ] = KX_F11KEY;
m_reverseKeyTranslateTable[F12KEY ] = KX_F12KEY;
m_reverseKeyTranslateTable[F13KEY ] = KX_F13KEY;
m_reverseKeyTranslateTable[F14KEY ] = KX_F14KEY;
m_reverseKeyTranslateTable[F15KEY ] = KX_F15KEY;
m_reverseKeyTranslateTable[F16KEY ] = KX_F16KEY;
m_reverseKeyTranslateTable[F17KEY ] = KX_F17KEY;
m_reverseKeyTranslateTable[F18KEY ] = KX_F18KEY;
m_reverseKeyTranslateTable[F19KEY ] = KX_F19KEY;
m_reverseKeyTranslateTable[PAUSEKEY ] = KX_PAUSEKEY;
m_reverseKeyTranslateTable[INSERTKEY ] = KX_INSERTKEY;
m_reverseKeyTranslateTable[HOMEKEY ] = KX_HOMEKEY;
m_reverseKeyTranslateTable[PAGEUPKEY ] = KX_PAGEUPKEY;
m_reverseKeyTranslateTable[PAGEDOWNKEY ] = KX_PAGEDOWNKEY;
m_reverseKeyTranslateTable[ENDKEY ] = KX_ENDKEY;
}
virtual ~BL_BlenderInputDevice() virtual ~BL_BlenderInputDevice()
{ {
} }
KX_EnumInputs ToNative(unsigned short incode) { KX_EnumInputs ToNative(unsigned short incode) {
return m_reverseKeyTranslateTable[incode]; return m_reverseKeyTranslateTable[incode];
} }
virtual bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)=0; virtual bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
// virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; // virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0; virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); } void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); }
void operator delete(void *mem) { MEM_freeN(mem); } void operator delete(void *mem) { MEM_freeN(mem); }
#endif #endif
}; };
#endif //__KX_BLENDERINPUTDEVICE #endif //__KX_BLENDERINPUTDEVICE

@ -129,6 +129,50 @@ void BL_ActionActuator::SetBlendTime (float newtime){
m_blendframe = newtime; m_blendframe = newtime;
} }
void BL_ActionActuator::SetLocalTime(float curtime)
{
float dt = (curtime-m_starttime)*KX_KetsjiEngine::GetAnimFrameRate();
if (m_endframe < m_startframe)
dt = -dt;
m_localtime = m_startframe + dt;
// Handle wrap around
if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe))
{
switch(m_playtype)
{
case ACT_ACTION_PLAY:
// Clamp
m_localtime = m_endframe;
break;
case ACT_ACTION_LOOP_END:
// Put the time back to the beginning
m_localtime = m_startframe;
m_starttime = curtime;
break;
case ACT_ACTION_PINGPONG:
// Swap the start and end frames
float temp = m_startframe;
m_startframe = m_endframe;
m_endframe = temp;
m_starttime = curtime;
break;
}
}
}
void BL_ActionActuator::ResetStartTime(float curtime)
{
float dt = m_localtime - m_startframe;
m_starttime = curtime - dt / (KX_KetsjiEngine::GetAnimFrameRate());
//SetLocalTime(curtime);
}
CValue* BL_ActionActuator::GetReplica() { CValue* BL_ActionActuator::GetReplica() {
BL_ActionActuator* replica = new BL_ActionActuator(*this);//m_float,GetName()); BL_ActionActuator* replica = new BL_ActionActuator(*this);//m_float,GetName());
replica->ProcessReplica(); replica->ProcessReplica();
@ -173,6 +217,9 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
case ACT_ACTION_FROM_PROP: case ACT_ACTION_FROM_PROP:
CValue* prop = GetParent()->GetProperty(m_propname); CValue* prop = GetParent()->GetProperty(m_propname);
// If we don't have a property, we can't do anything, so just bail
if (!prop) return false;
playtype = BL_Action::ACT_MODE_PLAY; playtype = BL_Action::ACT_MODE_PLAY;
start = end = prop->GetNumber(); start = end = prop->GetNumber();
@ -194,11 +241,46 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
RemoveAllEvents(); RemoveAllEvents();
} }
if (m_flag & ACT_FLAG_ATTEMPT_PLAY)
SetLocalTime(curtime);
if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE)) if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
m_localtime = obj->GetActionFrame(m_layer);
if (bPositiveEvent)
{ {
m_localtime = obj->GetActionFrame(m_layer);
ResetStartTime(curtime);
}
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
{
CValue* oldprop = obj->GetProperty(m_framepropname);
CValue* newval = new CFloatValue(obj->GetActionFrame(m_layer));
if (oldprop)
oldprop->SetValue(newval);
else
obj->SetProperty(m_framepropname, newval);
newval->Release();
}
// Handle a finished animation
if ((m_flag & ACT_FLAG_PLAY_END) && obj->IsActionDone(m_layer))
{
m_flag &= ~ACT_FLAG_ACTIVE;
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
obj->StopAction(m_layer);
return false;
}
// If a different action is playing, we've been overruled and are no longer active
if (obj->GetCurrentAction(m_layer) != m_action)
m_flag &= ~ACT_FLAG_ACTIVE;
if (bPositiveEvent || (m_flag & ACT_FLAG_ATTEMPT_PLAY && !(m_flag & ACT_FLAG_ACTIVE)))
{
if (bPositiveEvent)
ResetStartTime(curtime);
if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, m_priority, m_blendin, playtype, m_layer_weight, m_ipo_flags)) if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, m_priority, m_blendin, playtype, m_layer_weight, m_ipo_flags))
{ {
m_flag |= ACT_FLAG_ACTIVE; m_flag |= ACT_FLAG_ACTIVE;
@ -210,11 +292,11 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
else else
m_flag &= ~ACT_FLAG_PLAY_END; m_flag &= ~ACT_FLAG_PLAY_END;
} }
else m_flag |= ACT_FLAG_ATTEMPT_PLAY;
return false;
} }
else if ((m_flag & ACT_FLAG_ACTIVE) && bNegativeEvent) else if ((m_flag & ACT_FLAG_ACTIVE) && bNegativeEvent)
{ {
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
bAction *curr_action = obj->GetCurrentAction(m_layer); bAction *curr_action = obj->GetCurrentAction(m_layer);
if (curr_action && curr_action != m_action) if (curr_action && curr_action != m_action)
{ {
@ -259,27 +341,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
} }
} }
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
{
CValue* oldprop = obj->GetProperty(m_framepropname);
CValue* newval = new CFloatValue(obj->GetActionFrame(m_layer));
if (oldprop)
oldprop->SetValue(newval);
else
obj->SetProperty(m_framepropname, newval);
newval->Release();
}
// Handle a finished animation
if ((m_flag & ACT_FLAG_PLAY_END) && obj->IsActionDone(m_layer))
{
m_flag &= ~ACT_FLAG_ACTIVE;
obj->StopAction(m_layer);
return false;
}
return true; return true;
} }

@ -64,6 +64,8 @@ public:
virtual void ProcessReplica(); virtual void ProcessReplica();
void SetBlendTime (float newtime); void SetBlendTime (float newtime);
void SetLocalTime (float curtime);
void ResetStartTime (float curtime);
bAction* GetAction() { return m_action; } bAction* GetAction() { return m_action; }
void SetAction(bAction* act) { m_action= act; } void SetAction(bAction* act) { m_action= act; }
@ -150,7 +152,7 @@ enum {
ACT_FLAG_ACTIVE = 1<<3, ACT_FLAG_ACTIVE = 1<<3,
ACT_FLAG_CONTINUE = 1<<4, ACT_FLAG_CONTINUE = 1<<4,
ACT_FLAG_PLAY_END = 1<<5, ACT_FLAG_PLAY_END = 1<<5,
ACT_FLAG_ATTEMPT_PLAY = 1<<6,
}; };
#endif #endif

@ -1911,11 +1911,11 @@ void RBJconstraints(Object *ob)//not used
KX_IPhysicsController* getPhId(CListValue* sumolist,STR_String busc){//not used KX_IPhysicsController* getPhId(CListValue* sumolist,STR_String busc){//not used
for (int j=0;j<sumolist->GetCount();j++) for (int j=0;j<sumolist->GetCount();j++)
{ {
KX_GameObject* gameobje = (KX_GameObject*) sumolist->GetValue(j); KX_GameObject* gameobje = (KX_GameObject*) sumolist->GetValue(j);
if (gameobje->GetName()==busc) if (gameobje->GetName()==busc)
return gameobje->GetPhysicsController(); return gameobje->GetPhysicsController();
} }
return 0; return 0;
@ -1924,11 +1924,11 @@ KX_IPhysicsController* getPhId(CListValue* sumolist,STR_String busc){//not used
KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){ KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){
for (int j=0;j<sumolist->GetCount();j++) for (int j=0;j<sumolist->GetCount();j++)
{ {
KX_GameObject* gameobje = (KX_GameObject*) sumolist->GetValue(j); KX_GameObject* gameobje = (KX_GameObject*) sumolist->GetValue(j);
if (gameobje->GetName()==busc) if (gameobje->GetName()==busc)
return gameobje; return gameobje;
} }
return 0; return 0;
@ -2629,7 +2629,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
{ {
PHY_IPhysicsController* physctrl = (PHY_IPhysicsController*) gameobj->GetPhysicsController()->GetUserData(); PHY_IPhysicsController* physctrl = (PHY_IPhysicsController*) gameobj->GetPhysicsController()->GetUserData();
//we need to pass a full constraint frame, not just axis //we need to pass a full constraint frame, not just axis
//localConstraintFrameBasis //localConstraintFrameBasis
MT_Matrix3x3 localCFrame(MT_Vector3(dat->axX,dat->axY,dat->axZ)); MT_Matrix3x3 localCFrame(MT_Vector3(dat->axX,dat->axY,dat->axZ));
MT_Vector3 axis0 = localCFrame.getColumn(0); MT_Vector3 axis0 = localCFrame.getColumn(0);

@ -88,7 +88,7 @@ protected:
// -- // --
int m_tvtot; int m_tvtot;
BL_DeformableGameObject* m_gameobj; BL_DeformableGameObject* m_gameobj;
double m_lastDeformUpdate; double m_lastDeformUpdate;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC

@ -69,12 +69,12 @@ extern "C"{
//#undef __NLA_DEFNORMALS //#undef __NLA_DEFNORMALS
BL_ShapeDeformer::BL_ShapeDeformer(BL_DeformableGameObject *gameobj, BL_ShapeDeformer::BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
Object *bmeshobj, Object *bmeshobj,
RAS_MeshObject *mesh) RAS_MeshObject *mesh)
: :
BL_SkinDeformer(gameobj,bmeshobj, mesh), BL_SkinDeformer(gameobj,bmeshobj, mesh),
m_useShapeDrivers(false), m_useShapeDrivers(false),
m_lastShapeUpdate(-1) m_lastShapeUpdate(-1)
{ {
m_key = m_bmesh->key; m_key = m_bmesh->key;
m_bmesh->key = copy_key(m_key); m_bmesh->key = copy_key(m_key);

@ -46,8 +46,8 @@ class BL_ShapeDeformer : public BL_SkinDeformer
{ {
public: public:
BL_ShapeDeformer(BL_DeformableGameObject *gameobj, BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
Object *bmeshobj, Object *bmeshobj,
RAS_MeshObject *mesh); RAS_MeshObject *mesh);
/* this second constructor is needed for making a mesh deformable on the fly. */ /* this second constructor is needed for making a mesh deformable on the fly. */
BL_ShapeDeformer(BL_DeformableGameObject *gameobj, BL_ShapeDeformer(BL_DeformableGameObject *gameobj,

@ -170,10 +170,10 @@ float BlenderWorldInfo::getMistStart()
float BlenderWorldInfo::getMistDistance() float BlenderWorldInfo::getMistDistance()
{ {
return m_mistdistance; return m_mistdistance;
} }
float BlenderWorldInfo::getMistColorRed() float BlenderWorldInfo::getMistColorRed()
{ {
return m_mistcolor[0]; return m_mistcolor[0];

@ -679,7 +679,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo)
MEM_freeN( tmpicu ); MEM_freeN( tmpicu );
localDel_ipoCurve( tmpicu ); localDel_ipoCurve( tmpicu );
} }
} }
} else } else
{ ipo = NULL; // XXX add_ipo(blenderObject->id.name+2, ID_OB); { ipo = NULL; // XXX add_ipo(blenderObject->id.name+2, ID_OB);
blenderObject->ipo = ipo; blenderObject->ipo = ipo;

@ -942,7 +942,7 @@ void BL_ConvertActuators(char* maggiename,
case ACT_2DFILTER: case ACT_2DFILTER:
{ {
bTwoDFilterActuator *_2dfilter = (bTwoDFilterActuator*) bact->data; bTwoDFilterActuator *_2dfilter = (bTwoDFilterActuator*) bact->data;
SCA_2DFilterActuator *tmp = NULL; SCA_2DFilterActuator *tmp = NULL;
RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode; RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode;
switch(_2dfilter->type) switch(_2dfilter->type)
@ -996,7 +996,7 @@ void BL_ConvertActuators(char* maggiename,
filtermode = RAS_2DFilterManager::RAS_2DFILTER_NOFILTER; filtermode = RAS_2DFilterManager::RAS_2DFILTER_NOFILTER;
break; break;
} }
tmp = new SCA_2DFilterActuator(gameobj, filtermode, _2dfilter->flag, tmp = new SCA_2DFilterActuator(gameobj, filtermode, _2dfilter->flag,
_2dfilter->float_arg,_2dfilter->int_arg,ketsjiEngine->GetRasterizer(),scene); _2dfilter->float_arg,_2dfilter->int_arg,ketsjiEngine->GetRasterizer(),scene);
@ -1012,8 +1012,8 @@ void BL_ConvertActuators(char* maggiename,
} }
} }
baseact = tmp; baseact = tmp;
} }
break; break;
case ACT_PARENT: case ACT_PARENT:

@ -276,7 +276,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
gReverseKeyTranslateTable[ENDKEY ] = SCA_IInputDevice::KX_ENDKEY; gReverseKeyTranslateTable[ENDKEY ] = SCA_IInputDevice::KX_ENDKEY;
} }
int executePriority = 0; int executePriority = 0;
int uniqueint = 0; int uniqueint = 0;
int count = 0; int count = 0;
bSensor* sens = (bSensor*)blenderobject->sensors.first; bSensor* sens = (bSensor*)blenderobject->sensors.first;

@ -192,89 +192,89 @@ void CParser::NextSym()
switch(ch) switch(ch)
{ {
case '(': case '(':
sym = lbracksym; NextCh(); sym = lbracksym; NextCh();
break; break;
case ')': case ')':
sym = rbracksym; NextCh(); sym = rbracksym; NextCh();
break; break;
case ',': case ',':
sym = commasym; NextCh(); sym = commasym; NextCh();
break; break;
case '%' : case '%' :
sym = opsym; opkind = OPmodulus; NextCh(); sym = opsym; opkind = OPmodulus; NextCh();
break; break;
case '+' : case '+' :
sym = opsym; opkind = OPplus; NextCh(); sym = opsym; opkind = OPplus; NextCh();
break; break;
case '-' : case '-' :
sym = opsym; opkind = OPminus; NextCh(); sym = opsym; opkind = OPminus; NextCh();
break; break;
case '*' : case '*' :
sym = opsym; opkind = OPtimes; NextCh(); sym = opsym; opkind = OPtimes; NextCh();
break; break;
case '/' : case '/' :
sym = opsym; opkind = OPdivide; NextCh(); sym = opsym; opkind = OPdivide; NextCh();
break; break;
case '&' : case '&' :
sym = opsym; opkind = OPand; NextCh(); TermChar('&'); sym = opsym; opkind = OPand; NextCh(); TermChar('&');
break; break;
case '|' : case '|' :
sym = opsym; opkind = OPor; NextCh(); TermChar('|'); sym = opsym; opkind = OPor; NextCh(); TermChar('|');
break; break;
case '=' : case '=' :
sym = opsym; opkind = OPequal; NextCh(); TermChar('='); sym = opsym; opkind = OPequal; NextCh(); TermChar('=');
break; break;
case '!' : case '!' :
sym = opsym; sym = opsym;
NextCh();
if (ch == '=')
{
opkind = OPunequal;
NextCh(); NextCh();
} if (ch == '=')
else {
{ opkind = OPunequal;
opkind = OPnot; NextCh();
} }
break; else
case '>': {
sym = opsym; opkind = OPnot;
NextCh(); }
if (ch == '=') break;
{ case '>':
opkind = OPgreaterequal; sym = opsym;
NextCh(); NextCh();
} if (ch == '=')
else {
{ opkind = OPgreaterequal;
opkind = OPgreater; NextCh();
} }
break; else
case '<': {
sym = opsym; opkind = OPgreater;
NextCh(); }
if (ch == '=') { break;
opkind = OPlessequal; case '<':
sym = opsym;
NextCh(); NextCh();
} else { if (ch == '=') {
opkind = OPless; opkind = OPlessequal;
} NextCh();
break; } else {
case '\"' : { opkind = OPless;
int start; }
sym = constsym; break;
constkind = stringtype; case '\"' : {
NextCh(); int start;
start = chcount; sym = constsym;
while ((ch != '\"') && (ch != 0x0)) constkind = stringtype;
NextCh(); NextCh();
GrabRealString(start); start = chcount;
TermChar('\"'); // check for eol before '\"' while ((ch != '\"') && (ch != 0x0))
break; NextCh();
} GrabRealString(start);
case 0x0: sym = eolsym; break; TermChar('\"'); // check for eol before '\"'
default: break;
}
case 0x0: sym = eolsym; break;
default:
{ {
int start; int start;
start = chcount; start = chcount;
@ -301,7 +301,7 @@ void CParser::NextSym()
} }
GrabString(start); GrabString(start);
} else if (((ch >= 'a') && (ch <= 'z')) } else if (((ch >= 'a') && (ch <= 'z'))
|| ((ch >= 'A') && (ch <= 'Z'))) || ((ch >= 'A') && (ch <= 'Z')))
{ // reserved word? { // reserved word?
start = chcount; start = chcount;
@ -358,18 +358,18 @@ STR_String CParser::Symbol2Str(int s) {
// returns a string representation of of symbol s, // returns a string representation of of symbol s,
// for use in Term when generating an error // for use in Term when generating an error
switch(s) { switch(s) {
case errorsym: return "error"; case errorsym: return "error";
case lbracksym: return "("; case lbracksym: return "(";
case rbracksym: return ")"; case rbracksym: return ")";
case commasym: return ","; case commasym: return ",";
case opsym: return "operator"; case opsym: return "operator";
case constsym: return "constant"; case constsym: return "constant";
case sumsym: return "SUM"; case sumsym: return "SUM";
case ifsym: return "IF"; case ifsym: return "IF";
case whocodedsym: return "WHOMADE"; case whocodedsym: return "WHOMADE";
case eolsym: return "end of line"; case eolsym: return "end of line";
case idsym: return "identifier"; case idsym: return "identifier";
default: return "unknown"; // should not happen default: return "unknown"; // should not happen
} }
} }
@ -391,19 +391,19 @@ int CParser::Priority(int optorkind) {
// returns the priority of an operator // returns the priority of an operator
// higher number means higher priority // higher number means higher priority
switch(optorkind) { switch(optorkind) {
case OPor: return 1; case OPor: return 1;
case OPand: return 2; case OPand: return 2;
case OPgreater: case OPgreater:
case OPless: case OPless:
case OPgreaterequal: case OPgreaterequal:
case OPlessequal: case OPlessequal:
case OPequal: case OPequal:
case OPunequal: return 3; case OPunequal: return 3;
case OPplus: case OPplus:
case OPminus: return 4; case OPminus: return 4;
case OPmodulus: case OPmodulus:
case OPtimes: case OPtimes:
case OPdivide: return 5; case OPdivide: return 5;
} }
MT_assert(false); MT_assert(false);
return 0; // should not happen return 0; // should not happen

@ -40,20 +40,20 @@ SCA_2DFilterActuator::~SCA_2DFilterActuator()
} }
SCA_2DFilterActuator::SCA_2DFilterActuator( SCA_2DFilterActuator::SCA_2DFilterActuator(
SCA_IObject *gameobj, SCA_IObject *gameobj,
RAS_2DFilterManager::RAS_2DFILTER_MODE type, RAS_2DFilterManager::RAS_2DFILTER_MODE type,
short flag, short flag,
float float_arg, float float_arg,
int int_arg, int int_arg,
RAS_IRasterizer* rasterizer, RAS_IRasterizer* rasterizer,
SCA_IScene* scene) SCA_IScene* scene)
: SCA_IActuator(gameobj, KX_ACT_2DFILTER), : SCA_IActuator(gameobj, KX_ACT_2DFILTER),
m_type(type), m_type(type),
m_disableMotionBlur(flag), m_disableMotionBlur(flag),
m_float_arg(float_arg), m_float_arg(float_arg),
m_int_arg(int_arg), m_int_arg(int_arg),
m_rasterizer(rasterizer), m_rasterizer(rasterizer),
m_scene(scene) m_scene(scene)
{ {
m_gameobj = NULL; m_gameobj = NULL;
if(gameobj){ if(gameobj){
@ -65,9 +65,9 @@ SCA_2DFilterActuator::SCA_2DFilterActuator(
CValue* SCA_2DFilterActuator::GetReplica() CValue* SCA_2DFilterActuator::GetReplica()
{ {
SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this); SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this);
replica->ProcessReplica(); replica->ProcessReplica();
return replica; return replica;
} }
@ -94,7 +94,7 @@ bool SCA_2DFilterActuator::Update()
m_scene->Update2DFilter(m_propNames, m_gameobj, m_type, m_int_arg, m_shaderText); m_scene->Update2DFilter(m_propNames, m_gameobj, m_type, m_int_arg, m_shaderText);
} }
// once the filter is in place, no need to update it again => disable the actuator // once the filter is in place, no need to update it again => disable the actuator
return false; return false;
} }

@ -52,19 +52,19 @@ private:
public: public:
SCA_2DFilterActuator( SCA_2DFilterActuator(
class SCA_IObject* gameobj, class SCA_IObject* gameobj,
RAS_2DFilterManager::RAS_2DFILTER_MODE type, RAS_2DFilterManager::RAS_2DFILTER_MODE type,
short flag, short flag,
float float_arg, float float_arg,
int int_arg, int int_arg,
RAS_IRasterizer* rasterizer, RAS_IRasterizer* rasterizer,
SCA_IScene* scene); SCA_IScene* scene);
void SetShaderText(const char *text); void SetShaderText(const char *text);
virtual ~SCA_2DFilterActuator(); virtual ~SCA_2DFilterActuator();
virtual bool Update(); virtual bool Update();
virtual CValue* GetReplica(); virtual CValue* GetReplica();
}; };
#endif #endif

@ -216,8 +216,8 @@ void SCA_ISensor::UnregisterToManager()
void SCA_ISensor::ActivateControllers(class SCA_LogicManager* logicmgr) void SCA_ISensor::ActivateControllers(class SCA_LogicManager* logicmgr)
{ {
for(vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin(); for(vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin();
c!=m_linkedcontrollers.end();++c) c!=m_linkedcontrollers.end();++c)
{ {
SCA_IController* contr = *c; SCA_IController* contr = *c;
if (contr->IsActive()) if (contr->IsActive())

@ -132,7 +132,7 @@ bool SCA_KeyboardSensor::Evaluate()
// cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n"; // cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n";
/* See if we need to do logging: togPropState exists and is /* See if we need to do logging: togPropState exists and is
* different from 0 */ * different from 0 */
CValue* myparent = GetParent(); CValue* myparent = GetParent();
CValue* togPropState = myparent->GetProperty(m_toggleprop); CValue* togPropState = myparent->GetProperty(m_toggleprop);
if (togPropState && if (togPropState &&
@ -400,7 +400,7 @@ void SCA_KeyboardSensor::LogKeystrokes(void)
int index = 0; int index = 0;
/* Check on all keys whether they were pushed. This does not /* Check on all keys whether they were pushed. This does not
* untangle the ordering, so don't type too fast :) */ * untangle the ordering, so don't type too fast :) */
for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++) for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
{ {
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i); const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);

@ -50,12 +50,12 @@
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr,
int startx,int starty, int startx,int starty,
short int mousemode, short int mousemode,
SCA_IObject* gameobj) SCA_IObject* gameobj)
: SCA_ISensor(gameobj,eventmgr), : SCA_ISensor(gameobj,eventmgr),
m_x(startx), m_x(startx),
m_y(starty) m_y(starty)
{ {
m_mousemode = mousemode; m_mousemode = mousemode;
m_triggermode = true; m_triggermode = true;
@ -72,7 +72,7 @@ void SCA_MouseSensor::Init()
SCA_MouseSensor::~SCA_MouseSensor() SCA_MouseSensor::~SCA_MouseSensor()
{ {
/* Nothing to be done here. */ /* Nothing to be done here. */
} }
void SCA_MouseSensor::UpdateHotkey(void *self) void SCA_MouseSensor::UpdateHotkey(void *self)

@ -34,7 +34,7 @@
#ifndef KX_PYTHONCONTROLLER_H #ifndef KX_PYTHONCONTROLLER_H
#define KX_PYTHONCONTROLLER_H #define KX_PYTHONCONTROLLER_H
#include "SCA_IController.h" #include "SCA_IController.h"
#include "SCA_LogicManager.h" #include "SCA_LogicManager.h"
#include "BoolValue.h" #include "BoolValue.h"

@ -207,10 +207,10 @@ bool SCA_RandomActuator::Update()
sensible values. The termination condition states two sensible values. The termination condition states two
things: things:
1. s >= 0 is not allowed: to prevent the distro from 1. s >= 0 is not allowed: to prevent the distro from
getting a bias towards high values. This is a small getting a bias towards high values. This is a small
correction, really, and might also be left out. correction, really, and might also be left out.
2. s == 0 is not allowed: to prevent a division by zero 2. s == 0 is not allowed: to prevent a division by zero
when renormalising the drawn value to the desired when renormalising the drawn value to the desired
distribution shape. As a side effect, the distro will distribution shape. As a side effect, the distro will
never yield the exact mean. never yield the exact mean.
I am not sure whether this is consistent, since the error I am not sure whether this is consistent, since the error

@ -68,12 +68,12 @@ SCA_RandomNumberGenerator::~SCA_RandomNumberGenerator() {
void SCA_RandomNumberGenerator::SetStartVector(void) { void SCA_RandomNumberGenerator::SetStartVector(void) {
/* setting initial seeds to mt[N] using */ /* setting initial seeds to mt[N] using */
/* the generator Line 25 of Table 1 in */ /* the generator Line 25 of Table 1 in */
/* [KNUTH 1981, The Art of Computer Programming */ /* [KNUTH 1981, The Art of Computer Programming */
/* Vol. 2 (2nd Ed.), pp102] */ /* Vol. 2 (2nd Ed.), pp102] */
mt[0] = m_seed & 0xffffffff; mt[0] = m_seed & 0xffffffff;
for (mti = 1; mti < N; mti++) for (mti = 1; mti < N; mti++)
mt[mti] = (69069 * mt[mti-1]) & 0xffffffff; mt[mti] = (69069 * mt[mti-1]) & 0xffffffff;
} }
long SCA_RandomNumberGenerator::GetSeed() { return m_seed; } long SCA_RandomNumberGenerator::GetSeed() { return m_seed; }
@ -87,39 +87,39 @@ void SCA_RandomNumberGenerator::SetSeed(long newseed)
* This is the important part: copied verbatim :) * This is the important part: copied verbatim :)
*/ */
unsigned long SCA_RandomNumberGenerator::Draw() { unsigned long SCA_RandomNumberGenerator::Draw() {
static unsigned long mag01[2] = { 0x0, MATRIX_A }; static unsigned long mag01[2] = { 0x0, MATRIX_A };
/* mag01[x] = x * MATRIX_A for x=0,1 */ /* mag01[x] = x * MATRIX_A for x=0,1 */
unsigned long y; unsigned long y;
if (mti >= N) { /* generate N words at one time */ if (mti >= N) { /* generate N words at one time */
int kk; int kk;
/* I set this in the constructor, so it is always satisfied ! */ /* I set this in the constructor, so it is always satisfied ! */
// if (mti == N+1) /* if sgenrand() has not been called, */ // if (mti == N+1) /* if sgenrand() has not been called, */
// GEN_srand(4357); /* a default initial seed is used */ // GEN_srand(4357); /* a default initial seed is used */
for (kk = 0; kk < N - M; kk++) {
y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK);
mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1];
}
for (; kk < N-1; kk++) {
y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK);
mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1];
}
y = (mt[N-1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1];
mti = 0; for (kk = 0; kk < N - M; kk++) {
} y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK);
mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1];
y = mt[mti++]; }
y ^= TEMPERING_SHIFT_U(y); for (; kk < N-1; kk++) {
y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK);
y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1];
y ^= TEMPERING_SHIFT_L(y); }
y = (mt[N-1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1];
return y; mti = 0;
}
y = mt[mti++];
y ^= TEMPERING_SHIFT_U(y);
y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;
y ^= TEMPERING_SHIFT_L(y);
return y;
} }
float SCA_RandomNumberGenerator::DrawFloat() { float SCA_RandomNumberGenerator::DrawFloat() {

@ -48,8 +48,8 @@
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr,
SCA_IObject* gameobj, SCA_IObject* gameobj,
int startseed) int startseed)
: SCA_ISensor(gameobj,eventmgr) : SCA_ISensor(gameobj,eventmgr)
{ {
m_basegenerator = new SCA_RandomNumberGenerator(startseed); m_basegenerator = new SCA_RandomNumberGenerator(startseed);
@ -65,10 +65,10 @@ SCA_RandomSensor::~SCA_RandomSensor()
void SCA_RandomSensor::Init() void SCA_RandomSensor::Init()
{ {
m_iteration = 0; m_iteration = 0;
m_interval = 0; m_interval = 0;
m_lastdraw = false; m_lastdraw = false;
m_currentDraw = m_basegenerator->Draw(); m_currentDraw = m_basegenerator->Draw();
} }
@ -97,19 +97,19 @@ bool SCA_RandomSensor::IsPositiveTrigger()
bool SCA_RandomSensor::Evaluate() bool SCA_RandomSensor::Evaluate()
{ {
/* Random generator is the generator from Line 25 of Table 1 in */ /* Random generator is the generator from Line 25 of Table 1 in */
/* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */
/* (2nd Ed.), pp102] */ /* (2nd Ed.), pp102] */
/* It's a very simple max. length sequence generator. We can */ /* It's a very simple max. length sequence generator. We can */
/* draw 32 bool values before having to generate the next */ /* draw 32 bool values before having to generate the next */
/* sequence value. There are some theorems that will tell you */ /* sequence value. There are some theorems that will tell you */
/* this is a reasonable way of generating bools. Check Knuth. */ /* this is a reasonable way of generating bools. Check Knuth. */
/* Furthermore, we only draw each <delay>-eth frame. */ /* Furthermore, we only draw each <delay>-eth frame. */
bool evaluateResult = false; bool evaluateResult = false;
if (++m_interval > m_pulse_frequency) { if (++m_interval > m_pulse_frequency) {
bool drawResult = false; bool drawResult = false;
m_interval = 0; m_interval = 0;
if (m_iteration > 31) { if (m_iteration > 31) {
m_currentDraw = m_basegenerator->Draw(); m_currentDraw = m_basegenerator->Draw();
@ -122,8 +122,8 @@ bool SCA_RandomSensor::Evaluate()
evaluateResult = drawResult != m_lastdraw; evaluateResult = drawResult != m_lastdraw;
m_lastdraw = drawResult; m_lastdraw = drawResult;
} }
/* now pass this result to some controller */ /* now pass this result to some controller */
return evaluateResult; return evaluateResult;
} }

@ -63,22 +63,22 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr)
bool sensorresult = false; bool sensorresult = false;
for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin(); for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin();
!(is==m_linkedsensors.end());is++) !(is==m_linkedsensors.end());is++)
{ {
SCA_ISensor* sensor = *is; SCA_ISensor* sensor = *is;
if (sensor->GetState()) if (sensor->GetState())
{ {
if (sensorresult == true) if (sensorresult == true)
{ {
sensorresult = false; sensorresult = false;
break; break;
} }
sensorresult = true; sensorresult = true;
} }
} }
for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin(); for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
!(i==m_linkedactuators.end());i++) !(i==m_linkedactuators.end());i++)
{ {
SCA_IActuator* actua = *i; SCA_IActuator* actua = *i;
logicmgr->AddActiveActuator(actua,sensorresult); logicmgr->AddActiveActuator(actua,sensorresult);

@ -190,7 +190,7 @@ void detectBitmapFont(ImBuf *ibuf)
long i; long i;
if (ibuf != NULL) { if (ibuf != NULL) {
// bitmap must have an x size that is a power of two // bitmap must have an x size that is a power of two
if (is_power_of_two(ibuf->x)) { if (is_power_of_two(ibuf->x)) {
rect = (unsigned char *) (ibuf->rect + (ibuf->x * (ibuf->y - 1))); rect = (unsigned char *) (ibuf->rect + (ibuf->x * (ibuf->y - 1)));
// printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]); // printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]);

@ -139,7 +139,7 @@ GPG_Application::GPG_Application(GHOST_ISystem* system)
GPG_Application::~GPG_Application(void) GPG_Application::~GPG_Application(void)
{ {
if(m_pyGlobalDictString) { if(m_pyGlobalDictString) {
delete [] m_pyGlobalDictString; delete [] m_pyGlobalDictString;
m_pyGlobalDictString = 0; m_pyGlobalDictString = 0;
m_pyGlobalDictString_Length = 0; m_pyGlobalDictString_Length = 0;
@ -192,7 +192,7 @@ static LRESULT CALLBACK screenSaverWindowProc(HWND hwnd, UINT uMsg, WPARAM wPara
LONG dx = scr_save_mouse_pos.x - pt.x; LONG dx = scr_save_mouse_pos.x - pt.x;
LONG dy = scr_save_mouse_pos.y - pt.y; LONG dy = scr_save_mouse_pos.y - pt.y;
if (abs(dx) > SCR_SAVE_MOUSE_MOVE_THRESHOLD if (abs(dx) > SCR_SAVE_MOUSE_MOVE_THRESHOLD
|| abs(dy) > SCR_SAVE_MOUSE_MOVE_THRESHOLD) || abs(dy) > SCR_SAVE_MOUSE_MOVE_THRESHOLD)
{ {
close = TRUE; close = TRUE;
} }

@ -380,12 +380,12 @@ int main(int argc, char** argv)
#endif /* __linux__ */ #endif /* __linux__ */
BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]);
#ifdef __APPLE__ #ifdef __APPLE__
// Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh) // Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh)
/* /*
IBNibRef nibRef; IBNibRef nibRef;
WindowRef window; WindowRef window;
OSStatus err; OSStatus err;
// Create a Nib reference passing the name of the nib file (without the .nib extension) // Create a Nib reference passing the name of the nib file (without the .nib extension)
// CreateNibReference only searches into the application bundle. // CreateNibReference only searches into the application bundle.
err = ::CreateNibReference(CFSTR("main"), &nibRef); err = ::CreateNibReference(CFSTR("main"), &nibRef);
@ -398,7 +398,7 @@ int main(int argc, char** argv)
// We don't need the nib reference anymore. // We don't need the nib reference anymore.
::DisposeNibReference(nibRef); ::DisposeNibReference(nibRef);
*/ */
#endif // __APPLE__ #endif // __APPLE__
// We don't use threads directly in the BGE, but we need to call this so things like // We don't use threads directly in the BGE, but we need to call this so things like
@ -421,7 +421,7 @@ int main(int argc, char** argv)
BLF_init(11, U.dpi); BLF_init(11, U.dpi);
BLF_lang_init(); BLF_lang_init();
BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
// Parse command line options // Parse command line options
#if defined(DEBUG) #if defined(DEBUG)
printf("argv[0] = '%s'\n", argv[0]); printf("argv[0] = '%s'\n", argv[0]);

@ -63,7 +63,7 @@ int BL_BlenderShader::GetAttribNum()
GPU_material_vertex_attributes(mGPUMat, &attribs); GPU_material_vertex_attributes(mGPUMat, &attribs);
for(i = 0; i < attribs.totlayer; i++) for(i = 0; i < attribs.totlayer; i++)
if(attribs.layer[i].glindex+1 > enabled) if(attribs.layer[i].glindex+1 > enabled)
enabled= attribs.layer[i].glindex+1; enabled= attribs.layer[i].glindex+1;

@ -66,8 +66,8 @@ void KX_NetworkEventManager::NextFrame()
for (it.begin();!it.end();++it) for (it.begin();!it.end();++it)
{ {
// printf("KX_NetworkEventManager::proceed sensor %.2f\n", curtime); // printf("KX_NetworkEventManager::proceed sensor %.2f\n", curtime);
// process queue // process queue
(*it)->Activate(m_logicmgr); (*it)->Activate(m_logicmgr);
} }
// now a list of triggerer sensors has been built // now a list of triggerer sensors has been built

@ -43,7 +43,7 @@ class KX_NetworkEventManager : public SCA_EventManager
public: public:
KX_NetworkEventManager(class SCA_LogicManager* logicmgr, KX_NetworkEventManager(class SCA_LogicManager* logicmgr,
class NG_NetworkDeviceInterface *ndi); class NG_NetworkDeviceInterface *ndi);
virtual ~KX_NetworkEventManager (); virtual ~KX_NetworkEventManager ();
virtual void NextFrame(); virtual void NextFrame();
@ -51,7 +51,7 @@ public:
SCA_LogicManager* GetLogicManager() { return m_logicmgr; } SCA_LogicManager* GetLogicManager() { return m_logicmgr; }
class NG_NetworkDeviceInterface* GetNetworkDevice() { class NG_NetworkDeviceInterface* GetNetworkDevice() {
return m_ndi; } return m_ndi; }
}; };
#endif //KX_NETWORK_EVENTMANAGER_H #endif //KX_NETWORK_EVENTMANAGER_H

@ -91,8 +91,7 @@ bool KX_NetworkMessageActuator::Update()
CValue* KX_NetworkMessageActuator::GetReplica() CValue* KX_NetworkMessageActuator::GetReplica()
{ {
KX_NetworkMessageActuator* replica = KX_NetworkMessageActuator* replica = new KX_NetworkMessageActuator(*this);
new KX_NetworkMessageActuator(*this);
replica->ProcessReplica(); replica->ProcessReplica();
return replica; return replica;

@ -50,11 +50,11 @@
#endif #endif
KX_NetworkMessageSensor::KX_NetworkMessageSensor( KX_NetworkMessageSensor::KX_NetworkMessageSensor(
class KX_NetworkEventManager* eventmgr, // our eventmanager class KX_NetworkEventManager* eventmgr, // our eventmanager
class NG_NetworkScene *NetworkScene, // our scene class NG_NetworkScene *NetworkScene, // our scene
SCA_IObject* gameobj, // the sensor controlling object SCA_IObject* gameobj, // the sensor controlling object
const STR_String &subject const STR_String &subject
) : ) :
SCA_ISensor(gameobj,eventmgr), SCA_ISensor(gameobj,eventmgr),
m_NetworkScene(NetworkScene), m_NetworkScene(NetworkScene),
m_subject(subject), m_subject(subject),
@ -67,7 +67,7 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor(
void KX_NetworkMessageSensor::Init() void KX_NetworkMessageSensor::Init()
{ {
m_IsUp = false; m_IsUp = false;
} }
KX_NetworkMessageSensor::~KX_NetworkMessageSensor() KX_NetworkMessageSensor::~KX_NetworkMessageSensor()

@ -56,21 +56,21 @@ KX_BlenderMaterial::KX_BlenderMaterial()
} }
void KX_BlenderMaterial::Initialize( void KX_BlenderMaterial::Initialize(
KX_Scene *scene, KX_Scene *scene,
BL_Material *data) BL_Material *data)
{ {
RAS_IPolyMaterial::Initialize( RAS_IPolyMaterial::Initialize(
data->texname[0], data->texname[0],
data->matname, data->matname,
data->materialindex, data->materialindex,
data->tile, data->tile,
data->tilexrep[0], data->tilexrep[0],
data->tileyrep[0], data->tileyrep[0],
data->mode, data->mode,
data->transp, data->transp,
((data->ras_mode &ALPHA)!=0), ((data->ras_mode &ALPHA)!=0),
((data->ras_mode &ZSORT)!=0) ((data->ras_mode &ZSORT)!=0)
); );
mMaterial = data; mMaterial = data;
mShader = 0; mShader = 0;
mBlenderShader = 0; mBlenderShader = 0;
@ -80,7 +80,7 @@ void KX_BlenderMaterial::Initialize(
mConstructed = false; mConstructed = false;
mPass = 0; mPass = 0;
// -------------------------------- // --------------------------------
// RAS_IPolyMaterial variables... // RAS_IPolyMaterial variables...
m_flag |= RAS_BLENDERMAT; m_flag |= RAS_BLENDERMAT;
m_flag |= (mMaterial->IdMode>=ONETEX)? RAS_MULTITEX: 0; m_flag |= (mMaterial->IdMode>=ONETEX)? RAS_MULTITEX: 0;
m_flag |= ((mMaterial->ras_mode & USE_LIGHT)!=0)? RAS_MULTILIGHT: 0; m_flag |= ((mMaterial->ras_mode & USE_LIGHT)!=0)? RAS_MULTILIGHT: 0;
@ -93,14 +93,11 @@ void KX_BlenderMaterial::Initialize(
mMaterial->num_enabled = enabled>=max?max:enabled; mMaterial->num_enabled = enabled>=max?max:enabled;
// test the sum of the various modes for equality // test the sum of the various modes for equality
// so we can ether accept or reject this material // so we can ether accept or reject this material
// as being equal, this is rather important to // as being equal, this is rather important to
// prevent material bleeding // prevent material bleeding
for(int i=0; i<mMaterial->num_enabled; i++) { for(int i=0; i<mMaterial->num_enabled; i++) {
m_multimode += m_multimode += (mMaterial->flag[i] + mMaterial->blend_mode[i]);
( mMaterial->flag[i] +
mMaterial->blend_mode[i]
);
} }
m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT)); m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT));
} }

@ -213,16 +213,16 @@ MT_Scalar KX_BulletPhysicsController::GetMass()
MT_Vector3 KX_BulletPhysicsController::GetLocalInertia() MT_Vector3 KX_BulletPhysicsController::GetLocalInertia()
{ {
MT_Vector3 inertia(0.f, 0.f, 0.f); MT_Vector3 inertia(0.f, 0.f, 0.f);
btVector3 inv_inertia; btVector3 inv_inertia;
if (GetRigidBody()) { if (GetRigidBody()) {
inv_inertia = GetRigidBody()->getInvInertiaDiagLocal(); inv_inertia = GetRigidBody()->getInvInertiaDiagLocal();
if (!btFuzzyZero(inv_inertia.getX()) && if (!btFuzzyZero(inv_inertia.getX()) &&
!btFuzzyZero(inv_inertia.getY()) && !btFuzzyZero(inv_inertia.getY()) &&
!btFuzzyZero(inv_inertia.getZ())) !btFuzzyZero(inv_inertia.getZ()))
inertia = MT_Vector3(1.f/inv_inertia.getX(), 1.f/inv_inertia.getY(), 1.f/inv_inertia.getZ()); inertia = MT_Vector3(1.f/inv_inertia.getX(), 1.f/inv_inertia.getY(), 1.f/inv_inertia.getZ());
} }
return inertia; return inertia;
} }
MT_Vector3 KX_BulletPhysicsController::getReactionForce() MT_Vector3 KX_BulletPhysicsController::getReactionForce()

@ -271,18 +271,18 @@ void KX_Camera::ExtractFrustumSphere()
if (m_set_frustum_center) if (m_set_frustum_center)
return; return;
// compute sphere for the general case and not only symmetric frustum: // compute sphere for the general case and not only symmetric frustum:
// the mirror code in ImageRender can use very asymmetric frustum. // the mirror code in ImageRender can use very asymmetric frustum.
// We will put the sphere center on the line that goes from origin to the center of the far clipping plane // We will put the sphere center on the line that goes from origin to the center of the far clipping plane
// This is the optimal position if the frustum is symmetric or very asymmetric and probably close // This is the optimal position if the frustum is symmetric or very asymmetric and probably close
// to optimal for the general case. The sphere center position is computed so that the distance to // to optimal for the general case. The sphere center position is computed so that the distance to
// the near and far extreme frustum points are equal. // the near and far extreme frustum points are equal.
// get the transformation matrix from device coordinate to camera coordinate // get the transformation matrix from device coordinate to camera coordinate
MT_Matrix4x4 clip_camcs_matrix = m_projection_matrix; MT_Matrix4x4 clip_camcs_matrix = m_projection_matrix;
clip_camcs_matrix.invert(); clip_camcs_matrix.invert();
if (m_projection_matrix[3][3] == MT_Scalar(0.0)) if (m_projection_matrix[3][3] == MT_Scalar(0.0))
{ {
// frustrum projection // frustrum projection
// detect which of the corner of the far clipping plane is the farthest to the origin // detect which of the corner of the far clipping plane is the farthest to the origin
@ -302,7 +302,7 @@ void KX_Camera::ExtractFrustumSphere()
MT_Scalar len; MT_Scalar len;
for (int i=0; i<4; i++) for (int i=0; i<4; i++)
{ {
hpoint = clip_camcs_matrix*npoint; hpoint = clip_camcs_matrix*npoint;
point.setValue(hpoint[0]/hpoint[3], hpoint[1]/hpoint[3], hpoint[2]/hpoint[3]); point.setValue(hpoint[0]/hpoint[3], hpoint[1]/hpoint[3], hpoint[2]/hpoint[3]);
len = point.dot(point); len = point.dot(point);
if (len > F) if (len > F)
@ -321,7 +321,7 @@ void KX_Camera::ExtractFrustumSphere()
farcenter *= 0.25; farcenter *= 0.25;
// the extreme near point is the opposite point on the near clipping plane // the extreme near point is the opposite point on the near clipping plane
nfar.setValue(-nfar[0], -nfar[1], -1., 1.); nfar.setValue(-nfar[0], -nfar[1], -1., 1.);
nfar = clip_camcs_matrix*nfar; nfar = clip_camcs_matrix*nfar;
nearpoint.setValue(nfar[0]/nfar[3], nfar[1]/nfar[3], nfar[2]/nfar[3]); nearpoint.setValue(nfar[0]/nfar[3], nfar[1]/nfar[3], nfar[2]/nfar[3]);
// this is a frustrum projection // this is a frustrum projection
N = nearpoint.dot(nearpoint); N = nearpoint.dot(nearpoint);
@ -340,7 +340,7 @@ void KX_Camera::ExtractFrustumSphere()
z = (F-N)/(2.0*(e-s+c*(f-n))); z = (F-N)/(2.0*(e-s+c*(f-n)));
m_frustum_center = MT_Point3(farcenter[0]*z/e, farcenter[1]*z/e, z); m_frustum_center = MT_Point3(farcenter[0]*z/e, farcenter[1]*z/e, z);
m_frustum_radius = m_frustum_center.distance(farpoint); m_frustum_radius = m_frustum_center.distance(farpoint);
} }
else else
{ {
// orthographic projection // orthographic projection

@ -42,34 +42,34 @@ Developed as part of a Research and Development project for SAT - La Société d
// constructor // constructor
KX_Dome::KX_Dome ( KX_Dome::KX_Dome (
RAS_ICanvas* canvas, RAS_ICanvas* canvas,
/// rasterizer /// rasterizer
RAS_IRasterizer* rasterizer, RAS_IRasterizer* rasterizer,
/// render tools /// render tools
RAS_IRenderTools* rendertools, RAS_IRenderTools* rendertools,
/// engine /// engine
KX_KetsjiEngine* engine, KX_KetsjiEngine* engine,
short res, //resolution of the mesh short res, //resolution of the mesh
short mode, //mode - fisheye, truncated, warped, panoramic, ... short mode, //mode - fisheye, truncated, warped, panoramic, ...
short angle, short angle,
float resbuf, //size adjustment of the buffer float resbuf, //size adjustment of the buffer
short tilt, short tilt,
struct Text* warptext struct Text* warptext
): ):
dlistSupported(false), dlistSupported(false),
canvaswidth(-1), canvasheight(-1), canvaswidth(-1), canvasheight(-1),
m_drawingmode(engine->GetDrawType()), m_drawingmode(engine->GetDrawType()),
m_resolution(res), m_resolution(res),
m_mode(mode), m_mode(mode),
m_angle(angle), m_angle(angle),
m_resbuffer(resbuf), m_resbuffer(resbuf),
m_tilt(tilt), m_tilt(tilt),
m_canvas(canvas), m_canvas(canvas),
m_rasterizer(rasterizer), m_rasterizer(rasterizer),
m_rendertools(rendertools), m_rendertools(rendertools),
m_engine(engine) m_engine(engine)
{ {
warp.usemesh = false; warp.usemesh = false;
fboSupported = false; fboSupported = false;
@ -1984,9 +1984,9 @@ void KX_Dome::DrawDomeWarped(void)
int can_width = m_viewport.GetRight(); int can_width = m_viewport.GetRight();
int can_height = m_viewport.GetTop(); int can_height = m_viewport.GetTop();
double screen_ratio = can_width/ (double) can_height; double screen_ratio = can_width/ (double) can_height;
glOrtho(-screen_ratio,screen_ratio,-1.0,1.0,-20.0,10.0); glOrtho(-screen_ratio,screen_ratio,-1.0,1.0,-20.0,10.0);
glMatrixMode(GL_TEXTURE); glMatrixMode(GL_TEXTURE);

@ -87,32 +87,32 @@ typedef unsigned long uint_ptr;
static MT_Point3 dummy_point= MT_Point3(0.0, 0.0, 0.0); static MT_Point3 dummy_point= MT_Point3(0.0, 0.0, 0.0);
static MT_Vector3 dummy_scaling = MT_Vector3(1.0, 1.0, 1.0); static MT_Vector3 dummy_scaling = MT_Vector3(1.0, 1.0, 1.0);
static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3( 1.0, 0.0, 0.0, static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3(1.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 1.0); 0.0, 0.0, 1.0);
KX_GameObject::KX_GameObject( KX_GameObject::KX_GameObject(
void* sgReplicationInfo, void* sgReplicationInfo,
SG_Callbacks callbacks) SG_Callbacks callbacks)
: SCA_IObject(), : SCA_IObject(),
m_bDyna(false), m_bDyna(false),
m_layer(0), m_layer(0),
m_pBlenderObject(NULL), m_pBlenderObject(NULL),
m_pBlenderGroupObject(NULL), m_pBlenderGroupObject(NULL),
m_bSuspendDynamics(false), m_bSuspendDynamics(false),
m_bUseObjectColor(false), m_bUseObjectColor(false),
m_bIsNegativeScaling(false), m_bIsNegativeScaling(false),
m_bVisible(true), m_bVisible(true),
m_bCulled(true), m_bCulled(true),
m_bOccluder(false), m_bOccluder(false),
m_pPhysicsController1(NULL), m_pPhysicsController1(NULL),
m_pGraphicController(NULL), m_pGraphicController(NULL),
m_xray(false), m_xray(false),
m_pHitObject(NULL), m_pHitObject(NULL),
m_actionManager(NULL), m_actionManager(NULL),
m_isDeformable(false) m_isDeformable(false)
#ifdef WITH_PYTHON #ifdef WITH_PYTHON
, m_attr_dict(NULL) , m_attr_dict(NULL)
#endif #endif
{ {
m_ignore_activity_culling = false; m_ignore_activity_culling = false;
@ -159,6 +159,7 @@ KX_GameObject::~KX_GameObject()
} }
if (m_actionManager) if (m_actionManager)
{ {
KX_GetActiveScene()->RemoveAnimatedObject(this);
delete m_actionManager; delete m_actionManager;
} }
#ifdef WITH_PYTHON #ifdef WITH_PYTHON
@ -355,8 +356,8 @@ BL_ActionManager* KX_GameObject::GetActionManager()
{ {
// We only want to create an action manager if we need it // We only want to create an action manager if we need it
if (!m_actionManager) if (!m_actionManager)
m_actionManager = new BL_ActionManager(this); { KX_GetActiveScene()->AddAnimatedObject(this); m_actionManager = new BL_ActionManager(this);
}
return m_actionManager; return m_actionManager;
} }

@ -116,7 +116,7 @@ bool KX_KetsjiEngine::m_restrict_anim_fps = false;
* Constructor of the Ketsji Engine * Constructor of the Ketsji Engine
*/ */
KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
: m_canvas(NULL), : m_canvas(NULL),
m_rasterizer(NULL), m_rasterizer(NULL),
m_kxsystem(system), m_kxsystem(system),
m_rendertools(NULL), m_rendertools(NULL),
@ -886,8 +886,6 @@ void KX_KetsjiEngine::Render()
{ {
if((*it)->GetViewport()) if((*it)->GetViewport())
{ {
// Change the active camera so Python scripts can figure out what viewport they're in
scene->SetActiveCamera(*it);
if (scene->IsClearingZBuffer()) if (scene->IsClearingZBuffer())
m_rasterizer->ClearDepthBuffer(); m_rasterizer->ClearDepthBuffer();
@ -899,10 +897,6 @@ void KX_KetsjiEngine::Render()
it++; it++;
} }
// Now change the camera back
scene->SetActiveCamera(cam);
PostRenderScene(scene); PostRenderScene(scene);
} }
@ -1322,10 +1316,6 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
if (scene->GetPhysicsEnvironment()) if (scene->GetPhysicsEnvironment())
scene->GetPhysicsEnvironment()->debugDrawWorld(); scene->GetPhysicsEnvironment()->debugDrawWorld();
#ifdef WITH_PYTHON
scene->RunDrawingCallbacks(scene->GetPostDrawCB());
#endif
} }
void KX_KetsjiEngine::RenderFonts(KX_Scene* scene) void KX_KetsjiEngine::RenderFonts(KX_Scene* scene)
@ -1345,8 +1335,14 @@ To run once per scene
*/ */
void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene) void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene)
{ {
// We need to first make sure our viewport is correct (enabling multiple viewports can mess this up)
m_canvas->SetViewPort(0, 0, m_canvas->GetWidth(), m_canvas->GetHeight());
m_rendertools->MotionBlur(m_rasterizer); m_rendertools->MotionBlur(m_rasterizer);
scene->Render2DFilters(m_canvas); scene->Render2DFilters(m_canvas);
#ifdef WITH_PYTHON
scene->RunDrawingCallbacks(scene->GetPostDrawCB());
#endif
m_rasterizer->FlushDebugLines(); m_rasterizer->FlushDebugLines();
} }

@ -355,11 +355,11 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT
} else if (!strcmp(type, "NORMAL")) { } else if (!strcmp(type, "NORMAL")) {
retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_NORMAL); retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_NORMAL);
} }
else { else {
/* should never happen */ /* should never happen */
PyErr_SetString(PyExc_TypeError, "light.type: internal error, invalid light type"); PyErr_SetString(PyExc_TypeError, "light.type: internal error, invalid light type");
retvalue = NULL; retvalue = NULL;
} }
return retvalue; return retvalue;
} }

@ -119,7 +119,7 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;}
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
{ {
int matid= 1; int matid= 1;
STR_String matname; STR_String matname;
if (PyArg_ParseTuple(args,"i:getMaterialName",&matid)) if (PyArg_ParseTuple(args,"i:getMaterialName",&matid))
@ -131,13 +131,13 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
} }
return PyUnicode_FromString(matname.Ptr()); return PyUnicode_FromString(matname.Ptr());
} }
PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds)
{ {
int matid= 1; int matid= 1;
STR_String matname; STR_String matname;
if (PyArg_ParseTuple(args,"i:getTextureName",&matid)) if (PyArg_ParseTuple(args,"i:getTextureName",&matid))
@ -154,7 +154,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds)
PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds)
{ {
int matid= 0; int matid= 0;
int length = 0; int length = 0;
@ -177,7 +177,7 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds)
PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
{ {
int vertexindex; int vertexindex;
int matindex; int matindex;
if (!PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex)) if (!PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex))
@ -195,7 +195,7 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds)
{ {
int polyindex= 1; int polyindex= 1;
PyObject* polyob = NULL; PyObject* polyob = NULL;
if (!PyArg_ParseTuple(args,"i:getPolygon",&polyindex)) if (!PyArg_ParseTuple(args,"i:getPolygon",&polyindex))

@ -121,14 +121,14 @@ bool KX_MouseFocusSensor::Evaluate()
} }
} }
if (reset) { if (reset) {
// force an event // force an event
result = true; result = true;
} }
} else { } else {
/* No focus behaviour required: revert to the basic mode. This /* No focus behaviour required: revert to the basic mode. This
* mode is never used, because the converter never makes this * mode is never used, because the converter never makes this
* sensor for a mouse-key event. It is here for * sensor for a mouse-key event. It is here for
* completeness. */ * completeness. */
result = SCA_MouseSensor::Evaluate(); result = SCA_MouseSensor::Evaluate();
m_positive_event = (m_val!=0); m_positive_event = (m_val!=0);
} }

@ -237,9 +237,9 @@ bool KX_ObjectActuator::Update()
if (m_current_linear_factor > 1.0) if (m_current_linear_factor > 1.0)
m_current_linear_factor = 1.0; m_current_linear_factor = 1.0;
linV = m_current_linear_factor * m_linear_velocity; linV = m_current_linear_factor * m_linear_velocity;
parent->setLinearVelocity(linV,(m_bitLocalFlag.LinearVelocity) != 0); parent->setLinearVelocity(linV,(m_bitLocalFlag.LinearVelocity) != 0);
} else { } else {
parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0);
} }
} }
} }
@ -260,7 +260,7 @@ bool KX_ObjectActuator::Update()
if (m_current_angular_factor > 1.0) if (m_current_angular_factor > 1.0)
m_current_angular_factor = 1.0; m_current_angular_factor = 1.0;
angV = m_current_angular_factor * m_angular_velocity; angV = m_current_angular_factor * m_angular_velocity;
parent->setAngularVelocity(angV,(m_bitLocalFlag.AngularVelocity) != 0); parent->setAngularVelocity(angV,(m_bitLocalFlag.AngularVelocity) != 0);
} else { } else {
parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0); parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0);
} }

@ -51,6 +51,6 @@ void KX_OrientationInterpolator::Execute(float currentTime) const {
MT_Scalar ss = si*sh; MT_Scalar ss = si*sh;
m_target.setValue(cj*ch, sj*sc-cs, sj*cc+ss, m_target.setValue(cj*ch, sj*sc-cs, sj*cc+ss,
cj*sh, sj*ss+cc, sj*cs-sc, cj*sh, sj*ss+cc, sj*cs-sc,
-sj, cj*si, cj*ci); -sj, cj*si, cj*ci);
} }

@ -187,7 +187,7 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
rasty->SetCullFace(true); rasty->SetCullFace(true);
if ((m_drawingmode & RAS_IRasterizer::KX_LINES) || if ((m_drawingmode & RAS_IRasterizer::KX_LINES) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME)) (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
rasty->SetLines(true); rasty->SetLines(true);
else else
rasty->SetLines(false); rasty->SetLines(false);

@ -389,10 +389,10 @@ static PyObject* gPyGetSpectrum(PyObject*)
{ {
PyObject* resultlist = PyList_New(512); PyObject* resultlist = PyList_New(512);
for (int index = 0; index < 512; index++) for (int index = 0; index < 512; index++)
{ {
PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0)); PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0));
} }
return resultlist; return resultlist;
} }
@ -479,13 +479,13 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
char cpath[sizeof(gp_GamePythonPath)]; char cpath[sizeof(gp_GamePythonPath)];
char *searchpath = NULL; char *searchpath = NULL;
PyObject* list, *value; PyObject* list, *value;
DIR *dp; DIR *dp;
struct dirent *dirp; struct dirent *dirp;
if (!PyArg_ParseTuple(args, "|s:getBlendFileList", &searchpath)) if (!PyArg_ParseTuple(args, "|s:getBlendFileList", &searchpath))
return NULL; return NULL;
list = PyList_New(0); list = PyList_New(0);
if (searchpath) { if (searchpath) {
@ -495,23 +495,23 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
/* Get the dir only */ /* Get the dir only */
BLI_split_dirfile(gp_GamePythonPath, cpath, NULL); BLI_split_dirfile(gp_GamePythonPath, cpath, NULL);
} }
if((dp = opendir(cpath)) == NULL) { if((dp = opendir(cpath)) == NULL) {
/* todo, show the errno, this shouldnt happen anyway if the blendfile is readable */ /* todo, show the errno, this shouldnt happen anyway if the blendfile is readable */
fprintf(stderr, "Could not read directoty (%s) failed, code %d (%s)\n", cpath, errno, strerror(errno)); fprintf(stderr, "Could not read directoty (%s) failed, code %d (%s)\n", cpath, errno, strerror(errno));
return list; return list;
} }
while ((dirp = readdir(dp)) != NULL) { while ((dirp = readdir(dp)) != NULL) {
if (BLI_testextensie(dirp->d_name, ".blend")) { if (BLI_testextensie(dirp->d_name, ".blend")) {
value= PyUnicode_DecodeFSDefault(dirp->d_name); value= PyUnicode_DecodeFSDefault(dirp->d_name);
PyList_Append(list, value); PyList_Append(list, value);
Py_DECREF(value); Py_DECREF(value);
} }
} }
closedir(dp); closedir(dp);
return list; return list;
} }
static char gPyAddScene_doc[] = static char gPyAddScene_doc[] =
@ -1662,9 +1662,9 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
// Check for errors // Check for errors
if (PyErr_Occurred()) if (PyErr_Occurred())
{ {
Py_FatalError("can't initialize module bge.logic"); Py_FatalError("can't initialize module bge.logic");
} }
return m; return m;
} }
@ -1954,12 +1954,12 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
gp_Rasterizer = rasty; gp_Rasterizer = rasty;
PyObject* m; PyObject* m;
PyObject* d; PyObject* d;
PyObject* item; PyObject* item;
/* Use existing module where possible /* Use existing module where possible
* be careful not to init any runtime vars after this */ * be careful not to init any runtime vars after this */
m = PyImport_ImportModule( "Rasterizer" ); m = PyImport_ImportModule( "Rasterizer" );
if(m) { if(m) {
Py_DECREF(m); Py_DECREF(m);
@ -1967,32 +1967,32 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
} }
else { else {
PyErr_Clear(); PyErr_Clear();
// Create the module and add the functions // Create the module and add the functions
m = PyModule_Create(&Rasterizer_module_def); m = PyModule_Create(&Rasterizer_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), Rasterizer_module_def.m_name, m); PyDict_SetItemString(PySys_GetObject("modules"), Rasterizer_module_def.m_name, m);
} }
// Add some symbolic constants to the module // Add some symbolic constants to the module
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ErrorObject = PyUnicode_FromString("Rasterizer.error"); ErrorObject = PyUnicode_FromString("Rasterizer.error");
PyDict_SetItemString(d, "error", ErrorObject); PyDict_SetItemString(d, "error", ErrorObject);
Py_DECREF(ErrorObject); Py_DECREF(ErrorObject);
/* needed for get/setMaterialType */ /* needed for get/setMaterialType */
KX_MACRO_addTypesToDict(d, KX_TEXFACE_MATERIAL, KX_TEXFACE_MATERIAL); KX_MACRO_addTypesToDict(d, KX_TEXFACE_MATERIAL, KX_TEXFACE_MATERIAL);
KX_MACRO_addTypesToDict(d, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL); KX_MACRO_addTypesToDict(d, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL);
KX_MACRO_addTypesToDict(d, KX_BLENDER_GLSL_MATERIAL, KX_BLENDER_GLSL_MATERIAL); KX_MACRO_addTypesToDict(d, KX_BLENDER_GLSL_MATERIAL, KX_BLENDER_GLSL_MATERIAL);
// XXXX Add constants here // XXXX Add constants here
// Check for errors // Check for errors
if (PyErr_Occurred()) if (PyErr_Occurred())
{ {
Py_FatalError("can't initialize module Rasterizer"); Py_FatalError("can't initialize module Rasterizer");
} }
return d; return d;
} }
@ -2231,9 +2231,9 @@ PyObject* initGameKeys()
// Check for errors // Check for errors
if (PyErr_Occurred()) if (PyErr_Occurred())
{ {
Py_FatalError("can't initialize module GameKeys"); Py_FatalError("can't initialize module GameKeys");
} }
return d; return d;
} }

@ -83,7 +83,7 @@ void KX_RaySensor::Init()
KX_RaySensor::~KX_RaySensor() KX_RaySensor::~KX_RaySensor()
{ {
/* Nothing to be done here. */ /* Nothing to be done here. */
} }
@ -279,7 +279,7 @@ bool KX_RaySensor::Evaluate()
/* now pass this result to some controller */ /* now pass this result to some controller */
if (m_rayHit) if (m_rayHit)
{ {
if (!m_bTriggered) if (!m_bTriggered)
{ {
@ -288,14 +288,14 @@ bool KX_RaySensor::Evaluate()
m_bTriggered = true; m_bTriggered = true;
} }
else else
{ {
// notify logicsystem that ray is STILL hitting ... // notify logicsystem that ray is STILL hitting ...
result = false; result = false;
} }
} }
else else
{ {
if (m_bTriggered) if (m_bTriggered)
{ {
m_bTriggered = false; m_bTriggered = false;
@ -306,9 +306,9 @@ bool KX_RaySensor::Evaluate()
{ {
result = false; result = false;
} }
} }
if (reset) if (reset)
// force an event // force an event
result = true; result = true;

@ -44,11 +44,11 @@
#include "SCA_IScene.h" #include "SCA_IScene.h"
KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj, KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj,
SCA_IScene* scene): SCA_IScene* scene):
SCA_IActuator(gameobj, KX_ACT_END_OBJECT), SCA_IActuator(gameobj, KX_ACT_END_OBJECT),
m_scene(scene) m_scene(scene)
{ {
// intentionally empty // intentionally empty
} /* End of constructor */ } /* End of constructor */

@ -168,6 +168,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
m_lightlist= new CListValue(); m_lightlist= new CListValue();
m_inactivelist = new CListValue(); m_inactivelist = new CListValue();
m_euthanasyobjects = new CListValue(); m_euthanasyobjects = new CListValue();
m_animatedlist = new CListValue();
m_logicmgr = new SCA_LogicManager(); m_logicmgr = new SCA_LogicManager();
@ -253,6 +254,9 @@ KX_Scene::~KX_Scene()
if (m_euthanasyobjects) if (m_euthanasyobjects)
m_euthanasyobjects->Release(); m_euthanasyobjects->Release();
if (m_animatedlist)
m_animatedlist->Release();
if (m_logicmgr) if (m_logicmgr)
delete m_logicmgr; delete m_logicmgr;
@ -1502,10 +1506,20 @@ void KX_Scene::LogicBeginFrame(double curtime)
m_logicmgr->BeginFrame(curtime, 1.0/KX_KetsjiEngine::GetTicRate()); m_logicmgr->BeginFrame(curtime, 1.0/KX_KetsjiEngine::GetTicRate());
} }
void KX_Scene::AddAnimatedObject(CValue* gameobj)
{
m_animatedlist->Add(gameobj);
}
void KX_Scene::RemoveAnimatedObject(CValue* gameobj)
{
m_animatedlist->RemoveValue(gameobj);
}
void KX_Scene::UpdateAnimations(double curtime) void KX_Scene::UpdateAnimations(double curtime)
{ {
// Update any animations // Update any animations
for (int i=0; i<GetObjectList()->GetCount(); ++i) for (int i=0; i<m_animatedlist->GetCount(); ++i)
((KX_GameObject*)GetObjectList()->GetValue(i))->UpdateActionManager(curtime); ((KX_GameObject*)GetObjectList()->GetValue(i))->UpdateActionManager(curtime);
} }

@ -130,6 +130,7 @@ protected:
CListValue* m_parentlist; // all 'root' parents CListValue* m_parentlist; // all 'root' parents
CListValue* m_lightlist; CListValue* m_lightlist;
CListValue* m_inactivelist; // all objects that are not in the active layer CListValue* m_inactivelist; // all objects that are not in the active layer
CListValue* m_animatedlist; // all animated objects
SG_QList m_sghead; // list of nodes that needs scenegraph update SG_QList m_sghead; // list of nodes that needs scenegraph update
// the Dlist is not object that must be updated // the Dlist is not object that must be updated
@ -334,6 +335,10 @@ public:
int NewRemoveObject(CValue* gameobj); int NewRemoveObject(CValue* gameobj);
void ReplaceMesh(CValue* gameobj, void ReplaceMesh(CValue* gameobj,
void* meshob, bool use_gfx, bool use_phys); void* meshob, bool use_gfx, bool use_phys);
void AddAnimatedObject(CValue* gameobj);
void RemoveAnimatedObject(CValue* gameobj);
/** /**
* @section Logic stuff * @section Logic stuff
* Initiate an update of the logic system. * Initiate an update of the logic system.

@ -54,16 +54,16 @@
KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj,
SCA_IObject *ob, SCA_IObject *ob,
int time, int time,
bool allow3D, bool allow3D,
int trackflag, int trackflag,
int upflag) int upflag)
: SCA_IActuator(gameobj, KX_ACT_TRACKTO) : SCA_IActuator(gameobj, KX_ACT_TRACKTO)
{ {
m_time = time; m_time = time;
m_allow3D = allow3D; m_allow3D = allow3D;
m_object = ob; m_object = ob;
m_trackflag = trackflag; m_trackflag = trackflag;
m_upflag = upflag; m_upflag = upflag;
m_parentobj = 0; m_parentobj = 0;

@ -57,7 +57,7 @@ class KX_TrackToActuator : public SCA_IActuator
public: public:
KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time, KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time,
bool threedee,int trackflag,int upflag); bool threedee,int trackflag,int upflag);
virtual ~KX_TrackToActuator(); virtual ~KX_TrackToActuator();
virtual CValue* GetReplica() { virtual CValue* GetReplica() {
KX_TrackToActuator* replica = new KX_TrackToActuator(*this); KX_TrackToActuator* replica = new KX_TrackToActuator(*this);

Some files were not shown because too many files have changed in this diff Show More