Commit Graph

185 Commits

Author SHA1 Message Date
Mitchell Stokes
48cda2e08e Plugging up some memory leaks in the Blenderplayer that I found with valgrind 2010-12-21 06:58:44 +00:00
Campbell Barton
afacd18498 use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed. 2010-12-08 08:43:06 +00:00
Campbell Barton
42d6603cae Add option for CMake to build libredcode, also use CODEC prefix for ffmpeg, quicktime & sndfile options. 2010-11-30 18:52:39 +00:00
Campbell Barton
1dd1cea06e fix for error when changing DISBALE_PYTHON -> WITH_PYTHON,
This define wasn't set in some parts of the BGE causing problems with the view matrix.
in CMake define for the entire BGE fixes this.
2010-11-29 07:56:45 +00:00
Campbell Barton
e8397e6193 include headers in cmake source, added a script to check for consistency, reporting missing headers & C files.
this is important so IDE's using CMake integration always get blender headers. - QtCreator & MSVC for eg, probably others too.
2010-11-29 04:35:56 +00:00
Campbell Barton
da1f288f50 rename libs internal libs for CMake + SCons (used in MSVC project files)
for game engine use "ge_" prefix & make names generally more descriptive.
2010-11-18 11:42:05 +00:00
Mitchell Stokes
d43d5d7690 Getting BLF to work with the Blenderplayer. 2010-11-12 07:16:33 +00:00
Campbell Barton
da402c937e fix for linking the player, also fixes building without python and bullet. 2010-11-05 01:47:55 +00:00
Brecht Van Lommel
12812e494f Fix cmake building of blender player. 2010-10-31 12:31:15 +00:00
Campbell Barton
0876fce009 rename and negate DISABLE_PYTHON --> WITH_PYTHON 2010-10-31 04:11:39 +00:00
Campbell Barton
29605fc06d Added function RNA_property_update_check() to check if an update call is needed,
Simple python benchmark shows this to be about 3x faster in the case where an update isn't needed.

This also speeds up rna function argument parsing, since each arg in a function call did 2 string lookups on the context which were never needed.
2010-10-25 21:57:45 +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
Campbell Barton
4d37cf90b9 remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).

Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
2010-10-18 06:41:16 +00:00
Nathan Letwory
53ced0be29 Now sound init param removal revert should be fine (apparently my cmake project files missed rebuild hint for these, fortunately SCons did its job well). 2010-10-16 15:00:04 +00:00
Campbell Barton
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
Dalai Felinto
46f25680aa blenderplayer fix for "offset" problem when in fullscreen mode (worked together with Nathan Letwory - jesterKing)
The FullScreen state was never set. Therefore the window boundary was returning the wrong dimensions (it was assuming that it was not fullscreen).

* Note: blender.exe -W has a similar problem. We are working on that ...

Tested in Windows only. If someone can test in Linux and OSX please let me know if it's good there as well. To test it: ./blenderplayer -f myfile.blend
2010-09-14 08:19:42 +00:00
Dalai Felinto
898e7857f4 blenderplayer parsing code (better) fix
After last commit I realized that we have a different behavior when running blenderplayer or a runtime. Reason being is that when running blenderplayer the filename is mandatory. While in runtime mode it has no use for it (it can still be passed, but it makes no difference).

I also updated the -h (help) message to be multiplataform and to pass the filename argument only when in blenderplayer mode.

If someone wants to have fun it would be nice to port the blender new parsing code to the gameplayer.
* note: how come "noaudio" is used in the examples but it's not in the options list? *ouch*
I'm leaving as it's in case noaudio get implemented ...
2010-09-13 08:30:56 +00:00
Dalai Felinto
9153e82d21 blenderplayer commandline argument fixes (for -f and -w)
argc always include the filename, therefore all the optional parameters should check for < argc instead of <=argc.

E.g. That was causing "blenderplayer -f 800 600 myfile.blend" to play in a wrong  Bpp (since it was trying to parse the filename to fullScreenBpp).

Bug introduced on rev. 16448 (in 2.49) and merged to 2.5 in rev. 19323
2010-09-13 04:52:20 +00:00
Nathan Letwory
6c113b54b3 Finally change SConscript tabs to spaces. 2010-08-29 20:52:05 +00:00
Campbell Barton
c20bb3ec43 own rna naming commits r31439 r31472 also renamed BGE vars unintentionally 2010-08-26 23:49:46 +00:00
Campbell Barton
4f5f868a52 rna data path names which are more likely to break animations.
Added an operator "Update Animation Data",
access from the search menu to update drivers and fcurves.
2010-08-20 06:09:58 +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
Campbell Barton
75410037fd - correct some spelling errors.
- remove FreeCamera struct (wasnt used)
- remove world color alpha values (not used anywhre).
2010-07-20 10:41:08 +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
Brecht Van Lommel
008863daec Merge image related changes from the render branch. This includes the image
tile cache code in imbuf, but it is not hooked up to the render engine.


Imbuf module: some small refactoring and removing a lot of unused or old code
(about 6.5k lines).

* Added a ImFileType struct with callbacks to make adding an file format type,
  or making changes to the API easier.
* Move imbuf init/exit code into IMB_init()/IMB_exit() functions.
* Increased mipmap levels from 10 to 20, you run into this limit already with
  a 2k image.
* Removed hamx, amiga, anim5 format support.
* Removed colormap saving, only simple colormap code now for reading tga.
* Removed gen_dynlibtiff.py, editing this is almost as much work as just
  editing the code directly.
* Functions removed that were only used for sequencer plugin API:
  IMB_anim_nextpic, IMB_clever_double, IMB_antialias, IMB_gamwarp,
  IMB_scalefieldImBuf, IMB_scalefastfieldImBuf, IMB_onethird, IMB_halflace,
  IMB_dit0, IMB_dit2, IMB_cspace
* Write metadata info into OpenEXR images. Can be viewed with the command
  line utility 'exrheader'

For the image tile cache code, see this page:
http://wiki.blender.org/index.php/Dev:2.5/Source/Imaging/ImageTileCache
2010-05-07 15:18:04 +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
Matt Ebb
45abe2baf2 Added F13 - F19 keys for game engine too. 2010-04-20 01:04:00 +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
Campbell Barton
1708ac0723 rename some functions to use easier to understand names.
'BLI_makestringcode' --> 'BLI_path_rel'
'BLI_convertstringcwd' --> 'BLI_path_cwd'
'BLI_convertstringframe' --> 'BLI_path_frame'
'BLI_convertstringframe_range' --> 'BLI_path_frame_range'
'BLI_make_cwdpath' --> 'BLI_path_cwd'
2010-03-09 17:36:23 +00:00
Dalai Felinto
4d3accd0cb BGE Dome: BlenderPlayer Console arguments: warpdata working now (only with absolute path)
I forgot to say in the last commit that those arguments are only for the BlenderPlayer.
we can now set external warpdata files.

2Do:
(1) convert relative to absolute paths for warpdata files
(2) investigate weird bug on lack of light in blenderplayer with warpmesh

... [old 2Do]

(3) documentation
(4) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
2010-02-25 06:05:56 +00:00
Dalai Felinto
47d79b04d1 BGE Dome: Console arguments: angle, tilt, mode and warpdata (not working yet)
2Do:
(1) open external warpdata file
(2) documentation
(3) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
otherwise it's a nightmare to update all your files every time you change your projection system. See note.
Maybe SYS_WriteCommandLineInt/Float/String can be used for that. Gotta investigate further.

* Note: an external warpdata file is a must ! Currently every time you need to calibrate your system you have to update the warp file in all your demo files. This is terrible. I'm glad I *now* have a dome near by to test it ;)
* FYI: A recent 'Yo Frankie in a dome' video if you want to see how it works: http://www.vimeo.com/9629626 I'm going to record a better one tomorrow.
2010-02-24 23:01:49 +00:00
Campbell Barton
4ef1fd1078 game engine support for recording animation back & some other minor changes. 2010-02-22 12:25:58 +00:00
Joerg Mueller
81847df968 Fix for the player by nazg-gul. 2010-02-22 08:27:45 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton
affe84a453 get rid of annoying duplicate python initialization code, added setupGamePython() which initializes modules 2010-01-10 22:03:26 +00:00
Dalai Felinto
3e5b6ed469 BGE: (1) stereo tooltip update (2) blenderplayer working with new stereo setting (3) blenderplayer building again (patch by Mitchell Stokes - Moguri)
(1) the new text suggest what was the default eye separation before. Now I'm confident that changing the eye separation for the UI is a good move
(2) no big deal here. It's not reading the parameter from the command line. But does it ever read it?
(3) stubs.c update and glew linking statically. patch by Mitchell Stokes, thanks for that. 

And now we finish 2009 with a building blenderplayer =D
2009-12-31 04:56:23 +00:00
Dalai Felinto
f3692d5e72 BPlayer fix (we were still using old scene.r instead of scene.gm here) and more stubs update from Mitchell Stokes (Moguri)
(+ a fix in a logic_window.c comment)
2009-11-28 01:26:14 +00:00
Dalai Felinto
349fa813ea bpplayer compiling fixes: ([#19890] Getting the Blenderplayer to build again by Mitchel Stokes (moguri) and some changes form mine)
1) SetDisplayArea was created in Blender but we forgot to set it in the player
2) Fix some SCons incs (using lists instead of strings)
3) added more nasty stubs calls (this file is getting big)

* typo fix from last commit

**) it's raining with bolts here and I have to turn the internet off. I couldnt hard test this commit but it looks like working. sorry if sometihng go wrong
2009-11-15 23:48:21 +00:00
Brecht Van Lommel
e2fa58f7f3 Fix #19669 and other: triple buffer & icon texture drawing could cause
a system crash and other issues on ATI/Apple, due to a buggy driver
(similar issues reported for other OpenGL applications). For now, work
around it by not using non-power-of-two textures on this combination.
2009-10-19 10:10:05 +00:00
Campbell Barton
8b6f5c171d - rather then passing the python namespace dictionary to the controller function get the namespace from the converter.
- renamed SetPythonDictionary() to SetPyNamespace()
- remove IsLight(), GetGameObjectType() existed before this but wasnt used for lights.
2009-09-29 22:49:33 +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
Joerg Mueller
5342f7930f Added sound device default settings for the gameplayer. 2009-09-04 20:14:59 +00:00
Joerg Mueller
944d0e9087 Fixed sound stuff for gameplayer, no sound though as U.audiodevice is set to 0 (="No Audio"). 2009-09-04 20:03:27 +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