Commit Graph

3360 Commits

Author SHA1 Message Date
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Antony Riakiotakis
09e3ef29c1 Get rid of three needless instances of DM_DRAW_OPTION_NO_MCOL.
It would be good to get rid of this entirely, ideally decision
about mcols can be taken at material level and not done per face. More
work needs to be done for that to work though.
2016-01-02 23:22:22 +01:00
Porteries Tristan
f320724195 BGE: Fix invalid operator< for microsoft compiler.
It fixes the strict weak ordering assertion failure, see : https://support.microsoft.com/en-us/kb/949171.
sybren and youle are the author of this commit.
2015-12-30 13:47:43 +01:00
Bastien Montagne
3fcf535d2e Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.

This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.

id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.

New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.

Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.

Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1683
2015-12-27 12:00:33 +01:00
Alexander Romanov
700c40e2f9 OpenGL: stipple support added to basic GLSL shader
The is intended to replace the deprecated glPolygonStipple() calls with a shader
based alternative, once we switch over to GLSL shaders.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D1688
2015-12-26 22:15:23 +01:00
Campbell Barton
df6264f528 Fix T46959: sys.meta_path reset on on exit 2015-12-18 03:00:38 +11:00
Campbell Barton
70273114a1 Cleanup: quiet warning 2015-12-18 02:46:08 +11:00
Jorge Bernal
ee59df521f BGE clean up: use float version of trigonometric functions 2015-12-16 01:53:48 +01:00
Jorge Bernal
0c19a043e8 BGE Ketsji clean-up: double-promotion warnings 2015-12-16 01:53:48 +01:00
Mike Erwin
87fac9a816 use float (not double) for font matrix
Following up on recent double --> float commits in the game engine.
2015-12-14 22:28:12 -05:00
Jorge Bernal
4510fe82aa BGE Physics clean up: double-promotion warnings 2015-12-14 06:56:50 +01:00
Jorge Bernal
94b34c9d44 BGE Scenegraph clean up: double-promotion warnings 2015-12-14 06:56:50 +01:00
Jorge Bernal
d9ee88d126 BGE Rasterizer clean up: double-promotion warnings 2015-12-13 03:20:27 +01:00
Porteries Tristan
6329e20cbb BGE: Use float as default instead of double in Moto library.
Use float in moto instead of double for MT_Scalar.
This switch allow future optimization like SSE.
Additionally, it changes the OpenGL calls to float versions as they are
very bad with doubles.

Reviewers: campbellbarton, moguri, lordloki

Reviewed By: lordloki

Subscribers: brecht, lordloki

Differential Revision: https://developer.blender.org/D1610
2015-12-13 02:09:05 +01:00
Arnaud Degroote
aae93ae4c6 BGE: Improve clock management
This patch improves clock management in BGE, to be able to accelerate /
slow the time, and also to finely synchronize clock with external
engines. Several new python functions have been added and existence ones
have been improved for that purpose. Now we have:

- getClockTime(): Get the current BGE render time, in seconds. The BGE
render time is the simulation time corresponding to the next scene that
will be rendered.

- getFrameTime(): Get the current BGE frame time, in seconds. The BGE
frame time is the simulation time corresponding to the current call of
the logic system. Generally speaking, it is what the user is interested
in.

- getRealTime(): Get the number of real (system-clock) seconds elapsed
since the beginning of the simulation.

- getTimeScale(): Get the time multiplier between real-time and
simulation time. The default value is 1.0. A value greater than 1.0
means that the simulation is going faster than real-time, a value lower
than 1.0 means that the simulation is going slower than real-time.

- setTimeScale(time_scale): Set the time multiplier between real-time
and simulation time. A value greater than 1.0 means that the simulation
is going faster than real-time, a value lower than 1.0 means that the
simulation is going slower than real-time. Note that a too large value
may lead to some physics instabilities.

- getUseExternalClock(): Get if the BGE use the inner BGE clock, or rely
or on an external clock. The default is to use the inner BGE clock.

- setUseExternalClock(use_external_clock): Set if the BGE use the inner
BGE clock, or rely or on an external clock. If the user selects the use
of an external clock, he should call regularly the setClockTime method.

- setClockTime(new_time): Set the next value of the simulation clock. It
is preferable to use this method from a custom main function in python,
as calling it in the logic block can easily lead to a blocked system (if
the time does not advance enough to run at least the next logic step).

Rationale are described more precisely in the thread
http://lists.blender.org/pipermail/bf-gamedev/2013-November/000165.html.

See also T37640

Reviewers: sybren, panzergame, #game_engine, lordloki, moguri

Reviewed By: sybren, panzergame, #game_engine, lordloki, moguri

Subscribers: moguri, hg1, sybren, panzergame, dfelinto, lordloki

Projects: #game_engine

Maniphest Tasks: T37640

Differential Revision: https://developer.blender.org/D728
2015-12-12 02:46:53 +01:00
0dfc8d6939 OpenGL: split off framebuffer, shader and texture code into separate files. 2015-12-08 19:00:56 +01:00
b25e4b310f OpenGL: remove non-power-of-two texture check, where even ES 2.0 does not need it. 2015-12-08 18:58:52 +01:00
Mitchell Stokes
964107fbce BGE code cleanup: Removing RAS_GLExtensionManager.
This class did nothing but print out extensions if they were found.
Instead, the code from bge.logic.PrintGLInfo() is now printed as the
Rasterizer is initialized. This gives better information, and it removes
some GL code from KX_PythonInit.cpp (the PrintGLInfo method now calls
the Rasterizer to print the information).

Differential Revision: https://developer.blender.org/D438
2015-12-07 19:25:12 -08:00
Mitchell Stokes
fe2f3a131d OpenGL/BGE: Remove RAS_StorageIM (glBegin/glEnd rendering of mesh data)
The only use we had for RAS_StorageIM was to render derived meshes using
Blender's mesh drawing. This is now handled as a special case in
RAS_OpenGLRasterizer instead of in RAS_StorageIM.

We are now left with RAS_StorageVA and RAS_StorageVBO. At the moment
vertex arrays are still the default since our vertex array with display
lists implementation is still much faster than our VBO code in a lot of
cases. As we improve our VBO code, we can drop vertex arrays since
Blender's minimum OpenGL version is being bumped up to 2.1, which
supports VBOs.
2015-12-07 19:05:09 -08:00
Mitchell Stokes
9d03307033 BGE: Remove RAS_IRasterizer::IndexPrimitivesMulti()
The work that was being done in IndexPrimitiveMulti() is now done by
IndexPrimitive() and we always assume multitexture support.
2015-12-07 19:05:04 -08:00
Ulysse Martin
34f51cd498 Fix a regression introduced by https://developer.blender.org/D1396 on video playing
Fix a regression introduced by https://developer.blender.org/D1396 on video playing

Look at @mariomey example file.

Reviewers: panzergame

Subscribers: mariomey

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1623
2015-11-28 14:56:22 +01:00
Porteries Tristan
b3808a4e06 BGE: Fix ray cast with unfound property.
To return a valid ray cast result the object must not be NULL and KX_RayCast::RayTest must return true.
2015-11-26 19:54:27 +01:00
Campbell Barton
88556d801f Fix T46870: bge globalDict kept between sessions 2015-11-26 11:08:35 +11:00
Sybren A. Stüvel
31cc60e76b BGE: Save screenshots in a different thread
This patch allows the game engine to keep running while performing things like PNG compression and disk I/O.

As an example, my crowd simulation rasterizer saves a screenshot for every frame. This now takes up 13 msec per frame, which was 31 msec before this patch. Effectively, it allows the simulation to save every frame and still run at 60 FPS.

Reviewers: lordloki, moguri, panzergame

Reviewed By: moguri, panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1507
2015-11-24 09:15:15 +01:00
Antony Riakiotakis
db1f0e3616 Error out on Windows if driver does not support OpenGL 2.1 with an error
messagebox.
2015-11-22 20:53:57 +01:00
Antony Riakiotakis
c402a379a2 Remove vertex array support from GPUBuffers. Remove USER_DISABLE_VBO. All
GPUBuffer rendering is now done using vertex buffers.

Vertex arrays are completely removed from GL 3.2 core profile, so we'll
have to do this change at some point anyway.

This commit, though big, is not modifying blender in any way. Use should
be exactly as if the vetex buffer option is constantly on.
2015-11-22 19:47:54 +01:00
Campbell Barton
6cbccdd31c Cleanup: unused defines 2015-11-12 18:54:26 +11:00
Sybren A. Stüvel
3dbc123061 BGE: allow setting velocity to zero in a motion actuator.
The motion actuator goes out of its way to prevent setting zero velocities,
which should actually be supported. This patch just works around it as a
first test. We should investigate whether the flags
`m_bitLocalFlag.ZeroLinearVelocity` and `m_bitLocalFlag.ZeroAngularVelocity`
are actually needed/desired at all.

One of the issues that's already visible with this simple change, is
that objects aren't actually frozen but still move a little bit; see
test with {F241908}.

Reviewers: lordloki, hg1, moguri, panzergame

Reviewed By: lordloki, panzergame

Differential Revision: https://developer.blender.org/D1545
2015-11-10 13:39:20 +01:00
Bastien Montagne
865796375b Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
2015-11-09 21:00:53 +01:00
Porteries Tristan
fcf8f01ca0 BGE: Cleanup occlusion buffer in CcdPhysicsEnvironment.cpp
This patch cleanup spaces/braces and newlines.

Reviewers: moguri, kupoman

Reviewed By: moguri, kupoman

Subscribers: kupoman

Differential Revision: https://developer.blender.org/D1607
2015-11-05 12:34:31 +01:00
Porteries Tristan
f29f4c92f2 BGE: Remove KX_IPOActuator.
KX_IPOActuator is not used since 2.4.

This patch removes:
	- KX_IPOActuator.h/cpp;
	- Python doc;
	- Write of IPO actuator in write.c;
	- Allocation of IPOactuator in sca.c;
	- Conversion in KX_ConvertActuators.cpp;
	- Initialization of the python proxy in KX_PythonInitTypes.cpp;
	- Other minor remove in logic_windows.c and in KX_PythonInit.cpp.

Reviewers: sybren, campbellbarton

Reviewed By: campbellbarton

Subscribers: moguri

Differential Revision: https://developer.blender.org/D1603
2015-11-03 10:31:08 +01:00
Jorge Bernal
d2af140151 BGE: Fix SetMass function affecting own object gravity.
Each time we setted the mass the own object gravity was divided by its
old mass (i.e you could convert you car in a flying DeLorean with a
simple mass car modification).

A note will be included in release notes due to retro compability
issues.
2015-10-30 06:51:22 +01:00
Porteries Tristan
286f5ffa59 BGE: Fix T38986: Start object position not initialized in IPO.
The start position must be initialized at the first call of KX_IpoSGController::Update when m_ipo_start_initialized is to false, not when also the frame time is not 0.
2015-10-29 18:44:09 +01:00
Porteries Tristan
fc5f717888 BGE: Cleanup KX_IPO_SGCOntroller.
- Add spaces around operators.
- Replace !(a == b) by a != b
- Add "f" at end of float value.
- Remove extras lines in fonctions declaration.
- Remove indentation to align attributes definition.
2015-10-29 17:24:35 +01:00
Porteries Tristan
8d3d931f6a BGE: Fix T46338 replace mesh from an other scene.
To make consistent with KX_GameObject.replaceMesh, we don't allow this behavior but print an error message for the replace mesh actuator.
e.g : Warning: object "Cube" from ReplaceMesh actuator "Edit Object" uses a mesh not owned by an object in scene "scene1"

Reviewers: youle.
2015-10-29 12:14:40 +01:00
Porteries Tristan
a15a3952f4 BGE: Fix T35188: Duplicate an instance of group.
This behavior caused a double free.
Before when we duplicated an instance of a group the new instance keep the pointer of the group but was not added in the group instance list (normal).
And during the object deletion we tried to remove the object in the instance list but anyways if it failed decrement the reference count.
Set the group and the instance list to NULL in ProcessReplica avoid these kind of problems.
2015-10-28 22:11:15 +01:00
Porteries Tristan
f10db730bc BGE: Fix T45945: Action bouncing.
Bug introduced in 583fa7d1e, KX_GameObject.setActionFrame can make BL_Action::m_starttime negative. But in BL_Action::Update m_starttime is set to the current time if it's negative.
To fix it we use a boolean BL_Action::m_initializedTime to know if we should initialize the time in BL_Action::Update, it's more stable than comparing times.

Tested with bug task T45945 and T32054, with an extra patch about to fix suspend resume scene issues with actions : D1569
2015-10-28 15:13:12 +01:00
Ulysse Martin
b2f57190d9 BGE: Fix T43218: Text of framerate and profile glitch in Multitexture shading
Fix T43218: Text of framerate and profile glitch in Multitexture shading

Reviewers: lordloki, panzergame

Reviewed By: panzergame

Subscribers: medved

Projects: #game_engine

Maniphest Tasks: T43218

Differential Revision: https://developer.blender.org/D1536
2015-10-27 15:29:09 +01:00
Porteries Tristan
13a4bcd148 BGE: Fix T31357: wrong zoom when sets camera.
This patch makes independant the override camera zoom and the default camera object zoom. The override zoom is 2.0f and the camera object zoom is computed with the RegionView3D camera zoom.
These features are only used for the embedded BGE, so there's no compatibility issues with the blenderplayer.
I let the override zoom with a setter to allow later to create an override camera in blenderplayer easily.

Tested with the 3 framing modes in embedded and standalone.
2015-10-27 11:10:12 +01:00
Porteries Tristan
95164a09a7 BGE: generic python callback list + replace KX_PythonSeq.
I made this patch to declared a python list without converting all elements in python object (too slow) or use a CListValue which required CValue items (too expensive in memory).  In the case of a big list of points like a collision contacts points list, to use a CListValue we must implement a new class based on CValue for 3D vector to create a python proxy even if mathutils do it perfectly, we must also convert all points (frequently ~100 points) when fill the CListValue even if the list is not used (in the case of the collision callback). The easy way is to use callback (it doesn't worth to do an inheritance) which convert the item in PyObject only during an acces.
5 callbacks are used :
- Check if the list is valid = allow acces (like PyObjectPlus.invalid)
- Get the list size
- Get an item in the list by index.
- Get an item name in the list by index (used for operator `list["name"]`)
- Set an item in the list at the index position.
All of these callback take as first argument the client instance.
Why do we use a void * for the client instance ? : In KX_PythonInitTypes.cpp we have to initialize each python inherited class, if we use a template (the only other way) we must add this class each time we use a new type with in KX_PythonInitTypes.cpp

To check if the list can be accessed from python by the user, we check if the python proxy,  which is the `m_base` member, is still a valid proxy like in PyObjectPlus. But we can use a callback for more control of user access (e.g a list of collision point invalidate a frame later, in this case no real python owner).

This python list is easily defined with :
```
CPythonCallBackList(
void *client, // The client instance
PyObject *base, // The python instance which owned this list, used to know if the list is valid (like in KX_PythonSeq)
bool (*checkValid)(void *), // A callback to check if this list is till valid (optional)
int (*getSize)(void *), // A callback to get size
PyObject *(*getItem)(void *, int), // A callback to get an item
const char *(*getItemName)(void *, int), // A callback to get an item name (optional) use for acces by string key
bool (*setItem)(void *, int, PyObject *) // A callback to set an item (optional)
)
```
To show its usecase i replaced the odd KX_PythonSeq, it modify KX_Gameobject.sensors/controllers/actuators, SCA_IController.sensors/actuators and BL_ArmatureObject.constraints/channels.

Example : {F245193}, See message in console, press R to erase the object and see invalid proxy error message.

Reviewers: brita_, #game_python, youle, campbellbarton, moguri, agoose77, sergey

Reviewed By: campbellbarton, moguri, agoose77, sergey

Subscribers: sergey

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1363
2015-10-26 20:27:08 +01:00
Campbell Barton
afe3b55483 Cleanup: warning & whitespace 2015-10-26 22:22:30 +11:00
Thomas Szepe
4f767e37e8 BGE: Cleanup: Code style BL_Shader
Reviewers: lordloki, youle, campbellbarton, sergey, kupoman, moguri, panzergame

Reviewed By: panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1397
2015-10-25 19:43:46 +01:00
Porteries Tristan
06d2ad0185 BGE: Fix issues with async libload.
This patch fixes:
- the call of LibFree on a unfinished loaded library;
- memory leak created on end of game : the async libraries are loaded but not converted, so not freed with the master scene.

Reviewers: campbellbarton, sybren, youle, hg1, moguri, lordloki

Reviewed By: moguri, lordloki

Differential Revision: https://developer.blender.org/D1571
2015-10-25 19:22:29 +01:00
Porteries Tristan
0d638172ec BGE: Fix T30179 action actuator not stoped when state changed.
The function SCA_IActuator::DecLink is now under virtual : in some case the actuator have to know when is useless.
2015-10-23 10:54:08 +02:00
Porteries Tristan
586ec50022 BGE: Fix T46556: check on null sound datablock pointer. 2015-10-22 20:11:05 +02:00
Porteries Tristan
85072eb4e9 BGE: Cleanup ConvertMaterial function.
- cleanup spaces;
- add braces;
- remove indendation around operator.
2015-10-21 22:28:33 +02:00
Porteries Tristan
729e9651ac BGE: Fix physics meshes conversion with modifiers.
Previously meshes with modifiers were considerate as empty (no polys).
2015-10-21 12:15:35 +02:00
Campbell Barton
70dfb61300 Cleanup: remove _POSIX_C_SOURCE undefine 2015-10-20 14:06:29 +11:00
Porteries Tristan
ed7c7a0a05 BGE: Cleanup BL_Action
Remove initialization of m_endtime : fix compile about previous BL_Action cleanup.
2015-10-19 20:28:05 +02:00
Porteries Tristan
2c369b1490 BGE: Cleanup BL_Action.
- Rename m_localtime to m_localframe to avoid ambiguity : it's a count for the actual action frame, not time.
- Delete m_end : it's unused.
2015-10-19 20:27:04 +02:00