Commit Graph

225 Commits

Author SHA1 Message Date
Campbell Barton
93f420b666 correct typo's 2010-04-25 15:24:18 +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
Dalai Felinto
a8bca52d09 BGE fix #20456 - 2.5: mouse position problem (offseted by 1 vertically)
In Blender 2.49 the win width and height were been calculated including an extra pixel (e.g. a fullscreen editor would be (width + 1) by (height + 1) )
In opposite to that, Blender 2.5 window/editor code were fixed to have the exact width,height size.
So although the BGE canvas code was still the same as 2.49 it was producing a wrong result.

I'm also adding some commentaries in the setViewport code. BGE is setting the viewports 1 pixel larger.
the setViewport command is been used as if one should pass (minx, miny, width, height), while it should be (minx, miny, maxx, maxy). I will take care of that later, if any one has extra comments on that, please let me know.
2010-04-11 01:53:21 +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
790d6ca256 small png include adjustments (ifndef NOPNG ...).
* gameplayer is now probably not going to build without PNG turned ON.

To fix that it would be necessary to use #ifndef NOPNG  around the GPC_Canvas::MakeScreenShot.
Since I don't this function it's working in 2.5 yet it's better to wait for that before doing it.
2010-03-03 19:34:17 +00:00
Dalai Felinto
c5231858d4 fix for CMake compile in windows. ($PNG_INC was needed) - partial revert of commit 27251 2010-03-03 19:18:50 +00:00
Campbell Barton
f09efddcda fix for minor errors/warnings 2010-03-03 13:59:57 +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
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
Andrea Weikert
8fdaa263c0 MSVC 9 projectfiles
* Added GLEW_STATIC where necessary to make Blender compile again
* First attempt at compiling blenderplayer again - compiles, but doesn't link yet 
* removed deprecated SND_ functions from blenderplayer
2009-11-22 13:15:36 +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
Campbell Barton
6bfcd5a811 how embarrassing! 2009-11-02 17:25:15 +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
Campbell Barton
070f12d0dd sound init/exit so at least the player opens 2009-09-03 07:12:41 +00:00
Dalai Felinto
6239d18d50 BlenderPlayer linking again for cmake - 148 errors gone.
After talking with Ton and Campbell we agreed that it wouldn't hurt to have blenderplayer again (specially now since BGE is almost 100% working in 2.5).
However in order to make it link, I needed to bring back stubs, a lot of so-called bad calls.

I'm not sure how we should proceed from here, but it looks like people could start to take a look at source/blenderplayer/bad_level_calls_stubs/stubs.c and fix their own modules/functions

** NOTE: I removed the sound calls from BlenderPlayer. In order to fix it look at //XXX ADD SOUND in GPG_Application.cpp and GPC_Engine

*** tested in CMake+MSVC.
- Scons is not building !!! (why does the building systems have to be so different?)
And someone may like to fix make. (take a look at /trunk/source/blender/blenkernel/bad_level_call_stubs/Makefile )

**** it may work better inside /source/gameengine/GamePlayer
2009-09-03 02:55:23 +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
360235a5f4 cmake cleanup (remove unused includes, make some within IF checks) 2009-08-19 07:48:56 +00:00
Brecht Van Lommel
3682624616 2.5: Game Engine
* Added Shading and Performance panels in the scene buttons,
  containing the options previously in the 2.4x game menu.
* Added show framerate/debug/physics/warnings back in game menu.
* Moved these settings from G.fileflags to scene GameData.
* Enabled Display Lists by default.
* Some other small game scene button tweaks.
2009-08-18 15:27:48 +00:00
Ton Roosendaal
d8dc1b9fd4 2.5
Makefiles to get new AUD stuff to compile (OSX 10.3 PPC)
It uses lib/samplerate, which gets committed soon too
2009-08-11 18:14:49 +00:00
Joerg Mueller
a27cc1adf0 2.5 audio cleanup:
* Removed CD Actuator
* Removed bSample and bSoundListener
* Removed SoundSystem
* Removed -noaudio parameter
2009-08-10 15:39:11 +00:00
Campbell Barton
59bfe91f21 remove makefile cruft, mostly BGE related references to SUMO, Fuzzics, Blenkey etc.
also remove define MOZ_NOT_NET that was being used all over for telling the plugin to link against mozilla (not netscape)
2009-08-04 03:13:36 +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
0949d48d25 missed this line in last commit 2009-07-31 23:15:00 +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
Dalai Felinto
9a9d118bbf BGE panels: wip
Logic Panel:
- world settings (moved from world)
 ... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
 ... separated stereom into stereoflag and stereomode
- properties
 ... (didn't touch it)

Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
 ... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
 ... a datablock link to the materials of an object + the dynamic physic variables

* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
2009-07-20 20:28:29 +00:00
Nathan Letwory
2e854ec7cf SCons
* ensure all SConscripts are ready for win64-vc (where necessary).
* ensure we have proper _DEBUG flag for Python when we're doing a debug build.
* some cleaning up of linking etc.
* ensure /EHsc is there for game engine modules.
2009-07-16 19:41:28 +00:00
Campbell Barton
8ead648fd1 Spring Cleaning
* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
2009-06-21 16:18:38 +00:00
Brecht Van Lommel
aa0aac706e 2.5
* Optimized RNA property lookups and path resolving, still can be
  much better, but now the 1000 IPO example on bf-taskforce25
  runs at reasonable speed.
* Also an optimization in the depsgraph when dealing with many
  objects, this was actually also a bottleneck here.
2009-06-19 23:05:21 +00:00
Brecht Van Lommel
401b58cb45 2.5: Image Editor
* Started porting over to python, menus nearly done, header WIP.
* Game Properties panel is in python too
* Deprecated "Tiles" as a per face flag here, now it's always on
  the image, used to be both, working in a very confusing way.
  Unlikely someone actually had a purpose for this being per face.
* Remove GPC_PolygonMaterial.cpp/h, it's not actually used anymore,
  so I don't want to bother updating it.
* Fix crash in image painting (own mistake in porting over bugfix
  from 2.4x).
2009-06-16 01:22:56 +00:00
Campbell Barton
fa01eef27e svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20849:20855
to get the BGE building with py3k and no sdl
2009-06-13 14:07:38 +00:00
Campbell Barton
b40eb540d3 G.sipo was being passed in the BGE when it wasnt needed, just access G.sipo directly.
KX_PythonSeq.cpp - disable the cmpfunc with py3, need to have richcmp.
2009-06-13 13:02:01 +00:00
Campbell Barton
eed13b43b1 merged from trunk 20741:20848
* Missing changes to release/windows/installer
* Sequencer fixes in source/blender/src/seqaudio.c dont apply to 2.5
* brechts fix for #18855 r20763 wasnt merged, does this apply to 2.5?
2009-06-13 11:09:13 +00:00
Brecht Van Lommel
e29c9bc4da Fix for bug #18900: game engine lights in non-glsl mode did move
anymore, missing matrix update. Also move some code to KX_LightObject
to avoid duplication with player.
2009-06-09 13:51:32 +00:00