Commit Graph

213 Commits

Author SHA1 Message Date
Mitchell Stokes
df9d6737b9 BGE code cleanup: Removing OpenGL and bf_gpu code from KX_LightObject
The ultimate goal is to only allow the rasterizer to handle OpenGL and bf_gpu
calls. This commit creates a RAS_ILightObject interface and a RAS_OpenGLLight
implementation.
2014-03-27 22:32:06 -07:00
Mitchell Stokes
9d244e0ad7 Code cleanup: Removing KX_KetsjiEngine::m_drawingmode
The rasterizer is already handling this, and there is
no need to duplicate the data.
2014-03-24 20:11:11 -07:00
Campbell Barton
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Sergey Sharybin
9bec4f7779 Fix T38455: Blenderplayer is not working
Was a regression since avg_frame_rate changes.

Didn't find reliable way to get stream duration which will
work with both FFmpeg and Libav so added some freaking black
magic to distinguish one from another.
2014-02-03 17:25:47 +06:00
Anton Khirnov
f99e581ae1 libavformat API usage: use avformat_close_input() instead of av_close_input_file() 2014-01-28 14:20:22 +06:00
Mitchell Stokes
fb94a53978 BGE Rasterizer Cleanup: Cleaning up some includes. 2013-11-04 19:22:10 +00:00
Mitchell Stokes
0cec5c63da BGE Rasterizer Cleanup: Removing the Singletexture material mode. More conversion code will probably be needed. 2013-11-04 19:21:50 +00:00
Mitchell Stokes
cf9fe8f329 BGE Rasterizer Cleanup: Removing RAS_IRenderTools and moving the functionality to RAS_IRasterizer. RAS_OpenGLRasterizer is a bit of a mess now with references to Ketsji and other modules it shouldn't be accessing. 2013-11-04 19:21:07 +00:00
Mitchell Stokes
e8ca7abb9a BGE: Making sure m_objType is initialized in the BlendType (VideoTexture) constructor. 2013-08-03 05:01:50 +00:00
Mitchell Stokes
e4d396f300 BGE: Making sure m_line is initialized in the Exception (VideoTexture) constructor. 2013-08-03 05:01:45 +00:00
Mitchell Stokes
ad65bc3315 BGE: Making sure m_buffV, m_buffU, and m_pitchUV are initialized in the FilterYV12 constructor. 2013-08-03 05:01:40 +00:00
Mitchell Stokes
c90a170d57 BGE: Making sure m_offset is initialized in the ImageSourceMix constructor. 2013-08-03 05:01:36 +00:00
Mitchell Stokes
375309f7a9 BGE: Making sure m_mirrorHalfWidth and m_mirrorHalfHeight are initialized in the ImageRender constructor. 2013-08-03 05:01:32 +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
Brecht Van Lommel
2df82a2a2b Code cleanup: fix some vs2012 compiler warnings 2013-06-21 12:33:19 +00:00
Mitchell Stokes
1e64732d52 BGE: Fix for [#34781] "bge.texture.ImageRender does not show Font object" reported by Monster.
This fix is mostly based off of HG1's patch from the bug report, which had ImageRender::Render() call KX_KetsjiEngine::RenderFonts(). However, I have moved RenderFonts() from KX_KetsjiEngine to KX_Scene where all of the other font and rendering functions are. The real fix for this mess would be to not have ImageRender::Render() have so much duplicate code from KX_KetsjiEngine::Render(), but that's a code cleanup problem for another day.
2013-06-20 03:50:02 +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
Brecht Van Lommel
70eaf2fe44 Image paint: 2D painting now supports texture masks and does masking more
consistent with projection painting.

Also did some refactoring of this code, moving the brush image creation code
out of brush.c and making it consistent with image updating code.
2013-05-12 09:14:13 +00:00
Brecht Van Lommel
63f05576b8 More image painting fixes:
* 2D image painting support for masking to limit the max contribution of a stroke
  to a pixel, to get it working compatible with projection painting. Not strictly
  a bugfix, but the inconsistency here was annoying.

* Fix python errors in Texture Mask panel in image editor, was missing overlay
  options.

* Clamp paint mask to 0..1 in case some texture exceeds it, this could give black
  pixels due to integer overflow.
2013-04-30 06:07:42 +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
dee2f0c9ac correction to previous warning cleanup, also quiet shadow-warning for thumbnail size 2013-04-05 00:10:33 +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
Campbell Barton
16b82845ee code cleanup: add 'const' to headers to quiet msvc warnings, also remove (char *) casts that aren't needed now we're on Python3.3 2013-03-17 18:30:31 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +00:00
Sergey Sharybin
aab01c86cf Patch #33837: ffmpeg1.1 and libav9.1 compatibility update
Patch makes it possible to compile blender with recent ffmpeg
and libav libraries, mainly by getting rid of deprecated API.

Original patch by Campbell Barton with own modifications to
support compilation with older ffmpeg versions.

This patch could break compatibility of FFV1 videos playing
back in older players, mainly because of alpha support changes.
Preserving compatibility with such players became a headache
and think it's high time to get rid of workarounds here.
2013-01-12 12:51:10 +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
8b57f7502b code cleanup: gpl header update (formatting) 2012-11-18 00:30:06 +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
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +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
Benoit Bolsee
4213eca5fc BGE VideoTexture: add depth buffer access to ImageViewport and ImageRender.
2 new attributes to ImageViewport and ImageRender object:
depth: set to True to retrieve the depth buffer as an array of float
       (not suitable for texture source).
zbuff: set to True to retrieve the depth buffer as a grey scale pixel array
       (suitable for texture source).

A new mode 'F' is added to VideoTexture.imageToArray() to allow returning the image
buffer as a one dimensional array of float. This mode should only be used to retrieve
the depth buffer of ImageViewport and ImageRender objects.

Example:

viewport = VideoTexture.ImageViewport()
viewport.depth = True
depth = VideoTexture.imageToArray(viewport,'F')
# show depth of bottom left pixel
# 1.0 = infinite, 0.0 = on near clip plane.
print(depth[0])
2012-10-20 22:28:44 +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
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Campbell Barton
c2a1dcf621 fix for error in recent commit (made function static that shouldn't have been), add extra gcc warnings to cmake. 2012-09-16 01:35:00 +00:00
Campbell Barton
beac985ab7 code cleanup: make local game engine functions static 2012-09-16 00:22:55 +00:00
Sergey Sharybin
1b487e9948 Some FFmpeg changes
- Make FFmpeg initialization called from creator, not from functions
  which requires FFmpeg. Makes it easier to follow when initialization
  should happen.

- Enable DNxHD codec. It was commented a while ago due to some strange
  behavior on some platforms. Re-tested it on Linux and Windows and
  it seemd to be working quite nice. Would let it be tested further,
  if it wouldn't be stable enough, easy to comment it again.

- Make non-error messages from writeffmpeg.c printed only if ffmpeg
  debug argument was passed to blender. Reduces console pollution
  with messages which are not useful for general troubleshooting.
  Error messages would still be printed to the console.

- Show FFmpeg error message when video stream failed to allocate.
  makes it easier to understand what exactly is wrong from Blender
  interface, no need to restart blender with FFmpeg debug flag and
  check for console messages.

  Used custom log callback for this which stores last error message
  in static variable. This is not thread safe, but with current
  design FFmpeg routines could not be called form several threads
  anyway, so think it's fine solution/
2012-08-26 11:01:14 +00:00
Campbell Barton
9ecc6fdcc7 style cleanup 2012-08-23 07:10:48 +00:00
Campbell Barton
6972e19fd5 code cleanup:
- replace (strcmp(vfont->name, FO_BUILTIN_NAME) == 0)  with  (BKE_vfont_is_builtin(vfont)).
- reduce some double promotions.
2012-08-03 22:12:57 +00:00
Mitchell Stokes
f02254f026 Getting rid of some GLEW warnings when compiling ge_videotex in SCons. 2012-07-27 21:54:07 +00:00
Campbell Barton
9b51503307 style cleanup 2012-07-21 22:58:08 +00:00
Campbell Barton
62a73381a7 use fabsf when using floats. 2012-07-21 15:27:40 +00:00
Campbell Barton
d0e892a728 quiet double promotion warnings for the game engine. 2012-07-18 23:03:27 +00:00
Sergey Sharybin
0d64e050ea Reduce amount of deprecated symbols used from FFmpeg
This switches some areas of Blender which are related on FFmpeg stuff
from deprecated symbols to currently supported one.

Pretty straightforward changes based on documentation of FFmpeg's
API which symbols should be now used.

This should make Blender compatible with recent FFmpeg 0.11.

Should be no functional changes.
2012-06-18 10:29:11 +00:00
Campbell Barton
b5b8306685 code cleanup: includes, also correct some py example typos 2012-06-16 20:20:07 +00:00
Campbell Barton
5534701e5d style cleanup: use capital camel case names for typedef's 2012-06-10 15:20:10 +00:00