Commit Graph

316 Commits

Author SHA1 Message Date
Jorge Bernal
6ffc988ae3 BGE Clean-up: New EXP prefix for the BGE Expression module
The expression module now uses an EXP prefix and it follows a
distribution similar to blender.

Additionally the hash function in EXP_HashedPtr.h was simplified and the
files EXP_C-Api.h &.EXP_C-Api.cpp were deleted because were unused.

Reviewers: campbellbarton, moguri, sybren, hg1

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1221
2015-07-12 16:58:12 +02:00
Campbell Barton
6b3a43ccb4 BGE: dissallow calling reverse on internal clists 2015-06-20 20:02:16 +10:00
Campbell Barton
75a86d6a8e Fix for building without Python 2015-06-14 04:53:10 +10:00
Campbell Barton
33a7b72678 Fix T44919: BGE marhutils attrs leak memory 2015-06-02 11:08:17 +10:00
Campbell Barton
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
Sergey Sharybin
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05:00
Sybren A. Stüvel
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
Sybren A. Stüvel
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
Porteries Tristan
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
Porteries Tristan
7730391d74 BGE: subclass with more than 1 argument, D1237
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

    class Player(types.KX_GameObject):
        def __init__(self, gameobj, life):
            print("create new player :", self, ", life :", life)

    player = Player(own, 50)
2015-04-15 22:02:16 +10:00
Thomas Szepe
38c30c41d7 BGE: Fix ShowDeprecationWarning macro.
Reviewers: lordloki, brita_, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1144
2015-02-27 23:10:43 +01:00
Campbell Barton
b240b8e231 Freestyle: reserve array sizes before filling
also use PyList_GET_ITEM when list size is known.
2015-01-04 21:23:26 +11:00
Campbell Barton
8106a6b75d mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
2015-01-04 17:43:57 +11:00
Campbell Barton
3f2cf6da6f Cleanup: remove _DEBUG define usage 2014-08-27 18:59:32 +10:00
Campbell Barton
10af70cef8 Support for building without Python 2014-06-17 22:00:13 +10:00
Jorge Bernal
8c16f4c7d0 BGE: New Property sensor evaluation types
This patch adds "Less Than" and "Greater Than" evaluation types to the property sensor.
The Wiki Docs modifications http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Sensors/Property
Also, I have attached a screenshot and a blend to check.

Reviewers: dfelinto, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D476
2014-06-16 14:56:36 -07:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11: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
Antony Riakiotakis
dda61cc82f Fix some definitions for MinGW64 2013-07-19 19:19:15 +00:00
Campbell Barton
02ba328ca8 clang/cmake - quiet warnings for external libs and reference moto as a system include. 2013-07-15 08:26:16 +00:00
Campbell Barton
9cf6e305a9 split bge includes for scons onto their own lines (for easier merging) 2013-05-29 21:56:55 +00:00
Bastien Montagne
e9f0b1ad0a Grr, forgot this in r57127...
BF_PYTHON_INC can contain more than one path (in the mono-string format), don't know how this could not be found earlier, completely broke build of GE on any recent Debian/Ubuntu distro???
2013-05-29 18:59:59 +00:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Campbell Barton
854fd94016 bge py api: raise an overflow exception when assigning a float to a bge object which is out of the float range.
also avoid raising exceptions by ConvertPythonToValue when they will be ignored.
2013-05-03 01:13:51 +00:00
Campbell Barton
3f7f07faf5 style cleanup 2013-04-18 01:52:38 +00:00
Campbell Barton
8c1cb10cfd code cleanup: unused vars, make other vars static. 2013-04-10 22:49:50 +00:00
Campbell Barton
0874237358 code cleanup: bge warnings 2013-04-04 23:16:23 +00:00
Campbell Barton
ab41583bc2 style cleanup 2013-03-29 06:21:28 +00:00
Campbell Barton
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
Campbell Barton
e1a54214bb code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
2013-03-25 02:41:30 +00:00
Dalai Felinto
4a5a5f2968 bge bugfix: [#34677] Setting Boolean property on KX_GameObject creates Int type
we need to check for booleans before testing for longs.
2013-03-18 22:52:43 +00:00
Campbell Barton
2921d48239 code cleanup: unused vars in collada, preprocessor formatting & warning in mingw.
also compiling without bullet needed a stub added.
2013-03-04 00:53:57 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +00:00
Campbell Barton
761ac89877 style cleanup 2013-01-15 23:45:41 +00:00
Campbell Barton
68d83f4140 quiet compiler warning with string formatting in CParser::Term 2013-01-12 15:32:05 +00:00
Campbell Barton
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
Bastien Montagne
ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Campbell Barton
3fd388fb06 py api cleanup, replace use...
- PyLong_FromSsize_t --> PyLong_FromLong
- PyLong_AsSsize_t --> PyLong_AsLong

In all places except for those where python api expects PySsize_t (index lookups mainly).

- use PyBool_FromLong in a few areas of the BGE.
- fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used.
2012-11-21 02:28:36 +00:00
Campbell Barton
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
Campbell Barton
67b74f96da - property sensor was converting floating point values to text then back to float - for floating point properties.
- IntValue's GetNumber() was convert int -> float -> double.
- BL_Shader was using STR_String rather then char*, where most callers had a char*, use a char* to avoid STR_String conversion-and-alloc on shader access.
2012-11-10 22:32:15 +00:00
Campbell Barton
936f0388e8 code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
Campbell Barton
d25b13d13f code cleanup: double promotion warnings, also allow cmake to build SDL without audaspace. 2012-11-09 16:15:00 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
Campbell Barton
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
Campbell Barton
d08abbee69 add back game engine python api slicing, (was missing / regression, since move to py3x)
not many people must have used it since it would crash with non-zero start slice values.
2012-09-25 23:28:15 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Campbell Barton
beac985ab7 code cleanup: make local game engine functions static 2012-09-16 00:22:55 +00:00
Campbell Barton
5d2e4bb87e code cleanup: capitalize defines. 2012-09-06 01:31:15 +00:00