Commit Graph

2826 Commits

Author SHA1 Message Date
Campbell Barton
5be5ad039d patch [#36503] BGE Python - Radar and Ray sensor wrong AXIS constants wrong defined
from Jorge Bernal (lordloki)
2013-08-20 13:13:30 +00:00
Bastien Montagne
16ed997d21 Fix build with GE and WITH_CXX_GUARDEDALLOC enabled… 2013-08-19 15:02:28 +00:00
Sergey Sharybin
c0f8e15295 Speedup for guarded allocator
- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization
2013-08-19 10:51:40 +00:00
Sergey Sharybin
9f7961b6b1 Optimization and threading fix for shapekeys weights calculation
This commit fixes two different issues, which were caused by
how weights are being calculated for relative shapekeys.

Weights for key block used to saved in KeyBlock DNA structure,
which lead to situations when different objects could start
writing to the same weights array if they're sharing the same
key datablock.

Solved this in a way so weights are never stored in KeyBlock
and being passed to shapekeys routines as an array of pointers.
This way weights are still computed run-time (meaning they're
calculated before shapekey evaluation and freed afterwards).

This required some changes to GameEngine as well, to make it
never cache weights in the key blocks.

Another aspect of this commit makes it so weight for a given
vertex group is only computed once. So if multiple key blocks
are using the same influence vertex group, they'll share the
same exact weights array. This gave around 1.7x speedup in
test chinchilla file which is close enough to if we've been
caching weights permanently in DNA (test machine is dual-code
4 threads laptop, speedup measured in depsgraph_mt branch,
trunk might be not so much high speedup).

Some further speed is optimization possible, but it could be
done later as well.

Thanks Brecht for idea of how the things might be solved in
really clear way.

--
svn merge -r58786:58787  ^/branches/soc-2013-depsgraph_mt
2013-08-19 10:36:39 +00:00
Sergey Sharybin
beffaa293e Made modifiers_getVirtualModifierList safe for threading
Move static variables to context filling in by this fcuntion
and owned by a callee function. This ensures no conflicts
between threads happens because of static variables used in
this function.

Also moved modifier types and virtual modifiers data to a
function called from creator. This is needed to be sure all
the information is properly initialied to the time when
threads starts to use this data.

--
svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt
2013-08-19 09:05:34 +00:00
Campbell Barton
47c23750e8 style cleanup: indent/whitespace 2013-08-19 01:48:44 +00:00
Brecht Van Lommel
a2541508ac Fix a few compiler warnings reported by clang. 2013-08-18 14:15:51 +00:00
Mitchell Stokes
82c845425f BGE: Adding partial support for LibLoaded lights with GLSL materials.
Any GLSL materials loaded after lights are LibLoaded will now use the lights in
heir shaders. This includes materials loaded from the same scene as the LibLoaded
lights. We could later add a new flag to LibLoad to recompile all existing shaders,
but this commit should offer a lot more flexibility as is.
2013-08-17 04:37:25 +00:00
Mitchell Stokes
51bca0d7dc BGE: Flipping vsync constants so VSYNC_ON is 0.
This will make transitions from older versions of Blender easier since VSYNC_ON
will be the default. This could have been changed in a do_version, but the vsync
code has yet to see an official release, so I figured this would be a bit nicer.
Also, this makes VSYNC_ON the default for new scenes as well.
2013-08-17 02:06:45 +00:00
Mitchell Stokes
196d30e004 BGE: The Action Actuator can now make use of additive blending. 2013-08-14 23:32:00 +00:00
Mitchell Stokes
9afae77fed BGE: Finally adding support for additive layer blending.
Currently this is only for the Python API. The logic brick will be updated in a future commit.
2013-08-14 23:31:49 +00:00
Joerg Mueller
c8f75fb5b1 Adding a new state for sound handles in audaspace: stopped.
Now sounds that stopped playing but are still kept in the device can be differentiated from paused sounds with this state.
This should also fix the performance issues mentioned in [#36466] End of SequencerEntrys not set correctly.
Please test if sound pausing, resuming and stopping works fine in the BGE and sequencer, my tests all worked fine, but there might be a use case that needs some fixing.
2013-08-14 21:21:00 +00:00
Dalai Felinto
eccde9f72a BGE Dome: bugfix - Warp Mesh not working
Fix: to swap the drawing order for the warp mesh polygon
The code was drawing CW instead of CCW.

It would work in some cases where the drawing flags would allow for the
back faces to be visible.

More specifically the alternative fix were:
glDisable ( GL_CULL_FACE );
glFrontFace( GL_CW );

Bug originally reported in the small_planetarium mailing list.
This bug fix was a comissioned job by a group who prefer not to be
credited. Thanks regardless.
2013-08-14 02:59:09 +00:00
Mitchell Stokes
851627f6e0 BGE: Updating the bge.logic.expandPath() documentation to better reflect its current behavior. 2013-08-13 07:48:07 +00:00
Mitchell Stokes
d23b383af0 BGE: Adding a GPU Latency profile category to represent the CPU time spent waiting on the graphics card. 2013-08-13 03:09:58 +00:00
Mitchell Stokes
3627541894 BGE: Fixing the memory leaks reported when the BlenderPlayer exits.
They were caused by not having a free_windowmanager_cb set and by not having registered SpaceTypes, which meant data allocated for thosse SpaceTypes could not be freed. These were solved by defining a free_windowmanager_cb for the player that just frees wmWindows, and by making sure we only allocate memory for registered SpaceTypes.
2013-08-10 21:17:46 +00:00
Daniel Stokes
d17bf45842 As requested by Mitchell Stokes, reverting r58837 as it is causing some problems with the embedded game engine's python execution. 2013-08-10 01:29:23 +00:00
Daniel Stokes
29c8e4512c Adding a fov attribute to KX_Camera. This attribute converts the field of view value and uses it to set lens. 2013-08-07 05:24:47 +00:00
Daniel Stokes
3c8cdb8c68 BGE Fix [#33215] KX_MeshProxy.transformUV() argument ValueError 2013-08-06 21:52:05 +00:00
Mitchell Stokes
98176b4e1e BGE: Making sure the BlenderPlayer calls Py_Finalize(). 2013-08-06 02:05:32 +00:00
Campbell Barton
fdc336510a code cleanup: remove redundant NULL checks 2013-08-04 19:13:07 +00:00
Campbell Barton
78d69a1e15 code cleanup: replace strcpy with BLI_strncpy for fixed size strings, and correct some harmless but incorrect sizeof() use 2013-08-04 18:12:49 +00:00
Campbell Barton
aa43a978c1 fix memory leak in KX_ObstacleSimulation 2013-08-04 17:20:03 +00:00
Campbell Barton
7e697846a5 fix for BL_ArmatureConstraint::UpdateTarget(), was getting the pose from the target, not the subtarget. 2013-08-04 16:48:10 +00:00
Campbell Barton
fee152d0ec fix read outside buffer range KX_ObstacleSimulationTOI_rays::sampleRVO,
Was using 3d vectors for 2d operations, passing float[2] to args that use MT_Vector3 was reading the 3rd value of a 2d array
2013-08-04 04:07:29 +00:00
Campbell Barton
c0b73fa1b0 KX_ObstacleSimulation: replace inline math functions with BLI_math functions 2013-08-04 03:47:43 +00:00
Campbell Barton
93f5e2218a code cleanup: replace strncpy -> BLI_strncpy, skip first 2 chars when making a hash from the object name. 2013-08-04 03:45:30 +00:00
Campbell Barton
704598ef4e avoid freeing NULL pointer for navmesh BuildVertIndArrays and dont truncate memset arg. 2013-08-04 03:02:35 +00:00
Campbell Barton
5881fe5d67 avoid runtime overflow (1 << 31), for RNA and armature layer UI. 2013-08-04 00:01:41 +00:00
Campbell Barton
dd037a85a0 code cleanup: remove unused define, correct header guard mismatch, add NULL check so DM_to_mesh() can have a NULL object passed (currently not used) and remove redundant NULL check. 2013-08-03 23:58:17 +00:00
Campbell Barton
c3b9ec82d0 fix for strange error with BGE 2d filter code,
RAS_2DFilterManager::RenderFilters was casting an int to an unsigned int, then doing a subtraction which would give a negative number.
2013-08-03 23:40:15 +00:00
Mitchell Stokes
e131447582 BGE: Making sure m_drawingmode is initialized in the various RAS_Storage constructors. 2013-08-03 05:02:03 +00:00
Mitchell Stokes
411a49445f BGE: Making sure m_left, m_right, m_parent, m_radius, and m_client_object are initialized in the SG_Tree constructors. 2013-08-03 05:01:57 +00:00
Mitchell Stokes
e8ca7abb9a BGE: Making sure m_objType is initialized in the BlendType (VideoTexture) constructor. 2013-08-03 05:01:50 +00:00
Mitchell Stokes
e4d396f300 BGE: Making sure m_line is initialized in the Exception (VideoTexture) constructor. 2013-08-03 05:01:45 +00:00
Mitchell Stokes
ad65bc3315 BGE: Making sure m_buffV, m_buffU, and m_pitchUV are initialized in the FilterYV12 constructor. 2013-08-03 05:01:40 +00:00
Mitchell Stokes
c90a170d57 BGE: Making sure m_offset is initialized in the ImageSourceMix constructor. 2013-08-03 05:01:36 +00:00
Mitchell Stokes
375309f7a9 BGE: Making sure m_mirrorHalfWidth and m_mirrorHalfHeight are initialized in the ImageRender constructor. 2013-08-03 05:01:32 +00:00
Mitchell Stokes
5a042eb734 BGE: Removing some unreachable and unused code in BL_ActionManager.cpp. 2013-08-03 05:01:23 +00:00
Mitchell Stokes
b5016e34ed BGE: Fixing a memory leak with PyType_Ready_ADD. 2013-08-02 22:23:42 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Mitchell Stokes
2840edba84 BGE: Adding bge.physics as another alias for the PhysicsConstraints module. 2013-07-29 22:20:06 +00:00
Campbell Barton
1448499d70 patch [#36233] Fix Halo and Billboard Normal and Behavior
from Vitor Balbio (vitorbalbio)

Fixes billboard flipping (flipped normals and textures too)
2013-07-28 12:03:53 +00:00
Daniel Stokes
4f8fd8c68b BGE Fix [#18804] Shadow type faces cast onto invisible faces (non-GLSL)
Changing the RayHit method to ignore invisible faces
2013-07-25 23:42:20 +00:00
Daniel Stokes
d0f225393c BGE Fix [#29575] Object not drawn in game engine
Implementing a GetBlenderImage for KX_BlenderMaterial so that modifiers draw correctly in multitexture mode. The preexisting limitation of 1 texture per material on objects with modifiers in multitexture mode still exists.
2013-07-24 05:12:51 +00:00
Daniel Stokes
017d7b5447 BGE fix [#21488] Pumpkin in Gamekit Tutorial flips upside down
A reference was being grabbed when a copy was wanted.
2013-07-24 00:32:26 +00:00
Campbell Barton
3ff3d1bc0f replace use of strcat() where the string offset is known.
also correct bad logic with converting a textblock to 3d-text, bytes-vs-number of chars wasn't handled right.
2013-07-23 12:49:30 +00:00
Campbell Barton
fb92835819 bge: de-duplicate cleanup code for empty mesh error case 2013-07-23 10:59:29 +00:00
Mitchell Stokes
33e52d0df4 BGE: Fix for [#34398] "«illegal operator» in Expression Controller" reported by Andrey Kashlak (andreymal)
The expressions system now supports the not operator on ints and floats.
2013-07-22 22:46:17 +00:00
Campbell Barton
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00