Commit Graph

239 Commits

Author SHA1 Message Date
Mitchell Stokes
a6007d1a5c A couple of changes to 2D filters to make adding new built-in ones nicer:
* Built-in filters were not being analyzed, which means no depth or luminance textures for them
  * Removed an unnecessary if that becomes really hairy when new built-in filters are added (ie, when filters are defined beyond the value used for custom filters)
2010-11-01 00:15:12 +00:00
Campbell Barton
0876fce009 rename and negate DISABLE_PYTHON --> WITH_PYTHON 2010-10-31 04:11:39 +00:00
Campbell Barton
c6976e7351 use explicit file paths for CMake rather then globing, This is recommended by cmake devs.
globbing vs explicit is discussed here.
http://www.cmake.org/pipermail/cmake/2008-December/025694.html

Practical implications are:
- developers need to keep CMakeLists.txt files up to date.
- Users wont get strange linking errors if they build after a file is added, since CMake detects CMakeLists.txt is modified and automatically reconfigure.
2010-10-23 04:05:55 +00:00
Nathan Letwory
a293f76cdf Use DEBUG instead of NDEBUG 2010-10-18 06:52:10 +00:00
Dalai Felinto
3a369128b4 BGE Bugfix for [#22371] Alpha Planes affecting 2DFilters
disabling GL_Blend at the 2dfilter drawing routine makes the trick here. there is not a clear function invoked before the 2dfilter drawing routine. Therefore I found better to disable alpha blending while we are setting the other OpenGl attributes/matrixes.

We are not re-enabling GL_BLEND after we disable it. We could and it wouldn't hurt but I can't see why to. open to suggestions here of course.
2010-10-11 20:55:05 +00:00
Nathan Letwory
663ce490e0 Enable CXX_GUARDEDALLOC support through SCons. 2010-10-08 20:39:56 +00:00
Campbell Barton
9b518710c6 update for MingW/CMake
- ignore MSVC warnings when FREE_WINDOWS is defined to quiet warnings.
- the CMake flags were not being set correctly making blender have weirdo colors (no -funsigned-char).
2010-09-15 16:13:32 +00:00
Nathan Letwory
6c113b54b3 Finally change SConscript tabs to spaces. 2010-08-29 20:52:05 +00:00
Guillermo S. Romero
95aa8cfa4a Update address in license block. 2010-08-10 21:22:26 +00:00
Campbell Barton
940d1dcd0a remove commented scons lines from cmake files, fixed use of pointer poll function for ID drobdowns (currently unused) 2010-08-03 08:12:55 +00:00
Brecht Van Lommel
5e5b0cbb26 Game engine was not updated yet to disable vertex/normal state on exit as
other parts of Blender expect, might have caused issues with VBO's in some
cases.
2010-07-27 11:07:34 +00:00
Brecht Van Lommel
f65c15cd5a Fix #22772: remove unnecessary -fpascal-strings flag on OS X, only
some debug code in webplugin needed it.
2010-07-07 15:26:02 +00:00
Mitchell Stokes
08a94f9bbd BGE: When dynamically loading scenes (bge.logic.LibLoad()) in GLSL mode, the lights in the loaded scene would not affect the current scene and vice versa. To fix this, I've updated to merge code to update the scenes that the shaders are using to the scene being merged into. 2010-06-16 19:07:20 +00:00
Campbell Barton
ed338da8c9 - WITH_CXX_GUARDEDALLOC working again
- CMake building without python or fluidsim working again (broke in recent commit)
- remove BLI_short_filename(), it wasnt used anywhere.
2010-06-06 01:15:44 +00:00
Dalai Felinto
c6bec43330 reverting previous commit from Mitchell. His commit went to the trunk instead of the branch :)
svn merge -r 29067:29066 https://svn.blender.org/svnroot/bf-blender/trunk/blender
2010-05-29 21:31:57 +00:00
Mitchell Stokes
9d3157eed0 Reversing the last merge because I botched it. 2010-05-29 21:22:24 +00:00
Dalai Felinto
edc56fae18 BGE Fix: [#19951] mouse over sensor is broken with letterboxing framing
Tested with GameLogic.mouse.position and mouse over sensor.
It should be working with other mouse sensor as well. If not, please help to test and report a bug.
(couldn't test blenderplayer but it should be working there as well).

(Benoit, this is the same patch that I sent you. I hope it's OOP enough. Looking forward to hear from you on that)

I believe that this was the last "mouse" related bug we had reported. MouseLoook scripts should be working 100% in Blender/BGE 2.50 now \o/
2010-04-23 22:48:26 +00:00
Campbell Barton
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
Dalai Felinto
795b438bf5 Patch #21789 - BGE Keyboard and Mouse Python types - by Mitchell Stokes(Moguri)
The patch exposes mouse and keyboard read-only properties in the GameLogic module
Also renames bge.keys to bge.events (* Note: name of bge submodules (logic, render, ...) may change before 2.5 final release [right Campbell?]).

"""
This patch adds two new types to the BGE:
SCA_PythonKeyboard
SCA_PythonMouse

These two types allow users to make use of the keyboard and mouse without the need for a keyboard or mouse sensor.

SCA_PythonKeyboard has an events property that acts just like SCA_KeyboardSensor.events.

SCA_PythonMouse also has an events property to check for mouse events. Further more it supports getting and setting normalized cursor position (from 0.0 to 1.0) with SCA_PythonMouse.position. The cursor can be shown/hidden using SCA_PythonMouse.visible.
"""

Its use is similar with current mouse and keyboard controllers. With the exception of mouse position being normalized and writable as well (replacing Rasterizer.setMousePosition).

Code Sample:
######
from bge import logic, events

mouse = logic.mouse
keyboard = logic.keyboard

for key,status in keyboard.events:
    if status == logic.KX_INPUT_JUST_ACTIVATED:
        if key == events.WKEY:
            print(mouse.position)
            # move_forward()

mouse.visible = True # turn cursor visible
mouse.position = 0.5,0.5  # centralize mouse - use tuple
######

* Important Note: mouse.position still will not work properly for Letterbox mode.
In order to fix letterboxing I may need to move the set x,y mouse function to inside the canvas code (to avoid duplicated code between mouse sensor and bge.logic.mouse). I'll leave this for another commit though.
Thanks Mitchell for the work on that.
2010-04-17 06:52:14 +00:00
Benoit Bolsee
2ae418e0a8 Fix compilation error in MinGW with my last commit. 2010-03-25 08:48:31 +00:00
Benoit Bolsee
f1cfb5f13c BGE: bug #21684 fixed: multiple material with static modifier now supported with display list. 2010-03-24 22:55:45 +00:00
Dalai Felinto
0cad3ae24c BGE 2D Filters: filters run per scene now (fix for [#18152]) - it (slightly) breaks backward compatibility !!!
Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use.

(1) Performance - To run the filters 2X == 2X slower
(2) flexibility of use - Very often we want the filter in the scene but not in the UI for example.

For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now.
To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes.

* * * * *

Imagine that we have:
(a) Main Scene
(b) Overlay Scene

in Main Scene the Z Buffer and RGB will be from the main scene.
in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b].

So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
2010-03-03 06:38:47 +00:00
Campbell Barton
b65a983d39 use BLI_findstring in more places & remove some warnings, no functional changes. 2010-02-22 09:22:36 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Dalai Felinto
90e2b22fee BGE: fix for [#20684] Game Render blanks screen on Anaglyph Stereo view
The problem was: the Blender default camera has DOF distance as 0.0. Since we are using this as Focal Length for the stereo calculation we had terrible stereo by default.

Fix: whenever DOF == 0.0 we use focal length as eye separation * 30.0 (known to be a reasonable value)
2010-02-01 15:13:05 +00:00
Dalai Felinto
e37e3845a1 BGE: stereoscopic settings changes: (1) eye separation is the UI (2) focallength uses camera focallength
Now the default eye separation value is 0.10 (reasonable for games with 1 meter == 1 B.U.
The focallength used is the camera focal length (DOF settings). It allow you to even use different focal lengths for different scenes (good for UI)

In order to change it you can change the camera focal length or use Rasterizer.setFocalLength.
If you use the Rasterizer method it will use this value for all the cameras.

ToDo:
- Blenderplayer settings
- Update wiki documentation (any volunteer)?

* Note to stereo fans:
I don't have a real stereo environment to test it (other than cheap cyan-red glasses). If you can give it a try in a more robust system and report bugs or problems with BGE current system please let me know. I would be glad to help to make it work 100% by the time Blender 2.5 is out.

For the record, BGE is using the method known as 'parallel axis asymmetric frustum perspective projection'. This method is well documented here:
http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/stereographics/stereorender/
2009-12-29 15:47:20 +00:00
Guillermo S. Romero
7b6bc0225d Add guardealloc for RAS_MeshObject.cpp (and clean whitespace). 2009-11-24 23:24:56 +00:00
Benoit Bolsee
5b722b1e87 BGE: replace mesh works for Soft Body (including reinstantiation of physics soft body mesh).
Even a static mesh can be used as replacement: the mesh
will be instantiated with the soft body settings of the
object. The position and orientation of the soft body
is preserved after the replacement.

Known limitation: the velocity of the soft body is reset
aftet the replacement. This is because soft body don't
have a well defined velocity.
2009-11-24 22:44:29 +00:00
Dalai Felinto
d875f4927e patch [#19796] GLEW update by Mitchell Stokes (Moguri)
GLEW update to version 1.5.1 [11-03-08]
this opens room for Geometry Shader support.

* - Brecht, Campbell told me you did some local changes in order to make it right in Linux. I get to you in order to know what those changes are (or feel free to commit them directly)
2009-11-21 20:36:03 +00:00
Benoit Bolsee
b45ab480e0 BGE: dynamic loading patch commited. API and demo files available here: https://projects.blender.org/tracker/?func=detail&aid=19492&group_id=9&atid=127 2009-11-15 23:58:56 +00:00
Campbell Barton
641072a769 BGE: when letterbox is enabled use the camera framing as a clipping area (good for avoiding the HUD showing outside the bounds), use the framing color too (from dalai and myself) 2009-10-27 00:25:38 +00:00
Campbell Barton
839ac92f65 added SetDisplayArea, GetDisplayArea was used in a confusing way 2009-10-26 22:33:43 +00:00
Campbell Barton
98ee2a781d option to build the BGE without python, uses existing python check (cmake and scons)
when python is disabled videotextures are not built.
2009-09-29 21:42:40 +00:00
Campbell Barton
0a3694cd6e white space commit. (2 spaces -> tab).
Was annoying to use a different editor for cmake only.
theeth says this should be ok with gsoc and merges from branches.
2009-09-06 01:51:23 +00:00
Nathan Letwory
9216efcba2 == SCons ==
* bring back 'player' libtype, after investigation with ideasman.
  scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
2009-09-05 01:58:02 +00:00
Nathan Letwory
20f39ec7d8 == SCons ==
* further cleaning of 'player' stuff. Now only 3 libs are remaining, of which ideally the stubs lib will be fixed at some point, fading away into the dark history of not-so-nice code. The current blenderplayer part is still a little bit hackish, I'll see if I can find a better alternative, for now it works good enough.
2009-09-04 12:56:30 +00:00
Nathan Letwory
bade641408 == SCons ==
* first working changes to get blenderplayer linking
* blenderplayer/ moved into source/ (CMakeLists.txt changed for that too)
* added externs for bprogname to gp_ghost, so that it links properly
2009-09-04 10:40:41 +00:00
Nathan Letwory
3f5115064a == SCons ==
* Add BGE_CXXFLAGS so we can get rid of hard-coded BGE compiler settings. This was only done for windows, but now linuxers and osxers should be able to set BGE-specific optimisation too. See the windows default configs for example.
2009-09-01 23:32:34 +00:00
Campbell Barton
f12f238062 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22875:22935
Note, missing r22897, schlaile
source/blender/src/hddaudio.c
2009-09-01 18:49:33 +00:00
Campbell Barton
6b3351c327 bugfix [#19254] KX_PolyProxy returns improper VertexIndex with triangles, using .getVertexIndex() and .v1, .v2, etc.
Surprising this wasn't noticed before. Any mix of quads/tris caused the face verts of either quads/tries (whichever comes last).

Tested by exporting the KX_MeshProxy and re-importing as an OBJ.

This fix assumes there are only 2 m_darray's per face array which is currently true, but wont be if edge support is added back.
2009-08-31 03:36:02 +00:00
Campbell Barton
c3041ae7cd - fix for BGE warnings
- when C++ uses guardedalloc SYS_DeleteSystem was called after MEM_printmemlist(), making it look like there was a leak.
2009-08-19 10:26:43 +00:00
Campbell Barton
14d33b3c1f BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for better tracking memory usage.
* off by default.
* new/delete are at the bottom of each class
* python BGE objects have the new/delete in the Py_Header macro.
2009-08-18 15:37:31 +00:00
Campbell Barton
9bb8540ba9 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22130:22205 2009-08-04 05:34:21 +00:00
Campbell Barton
856dba000b no need to store the physics env in each KX_GameObject 2009-08-04 05:14:10 +00:00
Campbell Barton
0b3fd395ef svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22075:22099 2009-07-31 23:42:22 +00:00
Campbell Barton
3eb8000eb4 remove more unneeded args, also allow ipo to animate the ref value for KX_BlenderMaterial's 2009-07-31 09:05:13 +00:00
Campbell Barton
c371f49d9a svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21908:22075 2009-07-31 00:42:10 +00:00
Campbell Barton
7301f33b26 remove some unused function args 2009-07-30 21:42:29 +00:00
Campbell Barton
777a0d78e7 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21899:21908 2009-07-25 23:16:45 +00:00
Campbell Barton
e9ca43521f BGE Physics
Add support back for reinstancePhysics mesh, a frequently requested feature in the BGE forums.
from what I can tell Sumo supported this but bullet never did.
Currently only accessible via python at the moment.

- rigid body, dynamic, static types work.
- instanced physics meshes are modified too.
- compound shapes are not supported.

Physics mesh can be re-instanced from...
* shape keys & armature deformations
* subsurf (any other modifiers too)
* RAS_TexVert's (can be modified from python)

Moved the reinstancePhysicsMesh functions from RAS_MeshObject into KX_GameObject since the physics data is stored here.

video and blend file demo.
http://www.graphicall.org/ftp/ideasman42/reinstance.ogv
http://www.graphicall.org/ftp/ideasman42/reinstance_demo.blend
2009-07-25 22:57:29 +00:00