diff options
Diffstat (limited to 'source/gameengine')
7 files changed, 94 insertions, 98 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h index a183d4059f8..2a96d4c5216 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h @@ -48,8 +48,9 @@ #endif /** - Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. -*/ + * Base Class for Blender specific inputdevices. + * Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. + */ class BL_BlenderInputDevice : public SCA_IInputDevice { public: diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 9006a629791..725c23c60e3 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -119,11 +119,11 @@ static void mem_error_cb(const char *errorStr) #ifdef WIN32 typedef enum { - SCREEN_SAVER_MODE_NONE = 0, - SCREEN_SAVER_MODE_PREVIEW, - SCREEN_SAVER_MODE_SAVER, - SCREEN_SAVER_MODE_CONFIGURATION, - SCREEN_SAVER_MODE_PASSWORD, + SCREEN_SAVER_MODE_NONE = 0, + SCREEN_SAVER_MODE_PREVIEW, + SCREEN_SAVER_MODE_SAVER, + SCREEN_SAVER_MODE_CONFIGURATION, + SCREEN_SAVER_MODE_PASSWORD, } ScreenSaverMode; static ScreenSaverMode scr_saver_mode = SCREEN_SAVER_MODE_NONE; diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index 60821fb5aab..c5e11195547 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -52,7 +52,7 @@ typedef unsigned long uint_ptr; // All objects should start on frame 1! Will we ever need an object to // start on another frame, the 1.0 should change. -KX_IpoSGController::KX_IpoSGController() +KX_IpoSGController::KX_IpoSGController() : m_ipo_as_force(false), m_ipo_add(false), m_ipo_local(false), diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 7fa5138de0b..7f6655861f1 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1311,48 +1311,47 @@ static PyObject *gPySetWindowSize(PyObject *, PyObject *args) } static struct PyMethodDef rasterizer_methods[] = { - {"getWindowWidth",(PyCFunction) gPyGetWindowWidth, - METH_VARARGS, "getWindowWidth doc"}, - {"getWindowHeight",(PyCFunction) gPyGetWindowHeight, - METH_VARARGS, "getWindowHeight doc"}, - {"makeScreenshot",(PyCFunction)gPyMakeScreenshot, - METH_VARARGS, "make Screenshot doc"}, - {"enableVisibility",(PyCFunction) gPyEnableVisibility, - METH_VARARGS, "enableVisibility doc"}, + {"getWindowWidth",(PyCFunction) gPyGetWindowWidth, + METH_VARARGS, "getWindowWidth doc"}, + {"getWindowHeight",(PyCFunction) gPyGetWindowHeight, + METH_VARARGS, "getWindowHeight doc"}, + {"makeScreenshot",(PyCFunction)gPyMakeScreenshot, + METH_VARARGS, "make Screenshot doc"}, + {"enableVisibility",(PyCFunction) gPyEnableVisibility, + METH_VARARGS, "enableVisibility doc"}, {"showMouse",(PyCFunction) gPyShowMouse, - METH_VARARGS, "showMouse(bool visible)"}, - {"setMousePosition",(PyCFunction) gPySetMousePosition, - METH_VARARGS, "setMousePosition(int x,int y)"}, - {"setBackgroundColor",(PyCFunction)gPySetBackgroundColor,METH_O,"set Background Color (rgb)"}, + METH_VARARGS, "showMouse(bool visible)"}, + {"setMousePosition",(PyCFunction) gPySetMousePosition, + METH_VARARGS, "setMousePosition(int x,int y)"}, + {"setBackgroundColor",(PyCFunction)gPySetBackgroundColor,METH_O,"set Background Color (rgb)"}, {"setAmbientColor",(PyCFunction)gPySetAmbientColor,METH_O,"set Ambient Color (rgb)"}, - {"disableMist",(PyCFunction)gPyDisableMist,METH_NOARGS,"turn off mist"}, - {"setMistColor",(PyCFunction)gPySetMistColor,METH_O,"set Mist Color (rgb)"}, - {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, - {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, - {"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"}, - {"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_NOARGS,"disable motion blur"}, - - - {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"}, - {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, "get the eye separation for stereo mode"}, - {"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"}, - {"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"}, - {"setMaterialMode",(PyCFunction) gPySetMaterialType, - METH_VARARGS, "set the material mode to use for OpenGL rendering"}, - {"getMaterialMode",(PyCFunction) gPyGetMaterialType, - METH_NOARGS, "get the material mode being used for OpenGL rendering"}, - {"setGLSLMaterialSetting",(PyCFunction) gPySetGLSLMaterialSetting, - METH_VARARGS, "set the state of a GLSL material setting"}, - {"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting, - METH_VARARGS, "get the state of a GLSL material setting"}, - {"setAnisotropicFiltering", (PyCFunction) gPySetAnisotropicFiltering, - METH_VARARGS, "set the anisotropic filtering level (must be one of 1, 2, 4, 8, 16)"}, - {"getAnisotropicFiltering", (PyCFunction) gPyGetAnisotropicFiltering, - METH_VARARGS, "get the anisotropic filtering level"}, - {"drawLine", (PyCFunction) gPyDrawLine, - METH_VARARGS, "draw a line on the screen"}, - {"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""}, - { NULL, (PyCFunction) NULL, 0, NULL } + {"disableMist",(PyCFunction)gPyDisableMist,METH_NOARGS,"turn off mist"}, + {"setMistColor",(PyCFunction)gPySetMistColor,METH_O,"set Mist Color (rgb)"}, + {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, + {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, + {"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"}, + {"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_NOARGS,"disable motion blur"}, + + {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"}, + {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, "get the eye separation for stereo mode"}, + {"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"}, + {"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"}, + {"setMaterialMode",(PyCFunction) gPySetMaterialType, + METH_VARARGS, "set the material mode to use for OpenGL rendering"}, + {"getMaterialMode",(PyCFunction) gPyGetMaterialType, + METH_NOARGS, "get the material mode being used for OpenGL rendering"}, + {"setGLSLMaterialSetting",(PyCFunction) gPySetGLSLMaterialSetting, + METH_VARARGS, "set the state of a GLSL material setting"}, + {"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting, + METH_VARARGS, "get the state of a GLSL material setting"}, + {"setAnisotropicFiltering", (PyCFunction) gPySetAnisotropicFiltering, + METH_VARARGS, "set the anisotropic filtering level (must be one of 1, 2, 4, 8, 16)"}, + {"getAnisotropicFiltering", (PyCFunction) gPyGetAnisotropicFiltering, + METH_VARARGS, "get the anisotropic filtering level"}, + {"drawLine", (PyCFunction) gPyDrawLine, + METH_VARARGS, "draw a line on the screen"}, + {"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""}, + { NULL, (PyCFunction) NULL, 0, NULL } }; // Initialization function for the module (*must* be called initGameLogic) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h index 6319be6ce4a..eaefd5c13fa 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h @@ -32,7 +32,7 @@ #ifndef __RAS_EROSION2DFILTER_H__ #define __RAS_EROSION2DFILTER_H__ -const char * ErosionFragmentShader=STRINGIFY( +const char * ErosionFragmentShader = STRINGIFY( uniform sampler2D bgl_RenderedTexture; uniform vec2 bgl_TextureCoordinateOffset[9]; diff --git a/source/gameengine/VideoTexture/FilterSource.h b/source/gameengine/VideoTexture/FilterSource.h index 0e0a3e8d1b9..cb9e22a133d 100644 --- a/source/gameengine/VideoTexture/FilterSource.h +++ b/source/gameengine/VideoTexture/FilterSource.h @@ -142,12 +142,12 @@ public: protected: /// filter pixel, source float buffer virtual unsigned int filter (float * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val) + short * size, unsigned int pixSize, unsigned int val) { - // Copy the float value straight away - // The user can retrieve the original float value by using - // 'F' mode in BGL buffer - memcpy(&val, src, sizeof (unsigned int)); + /* Copy the float value straight away + * The user can retrieve the original float value by using + * 'F' mode in BGL buffer */ + memcpy(&val, src, sizeof (unsigned int)); return val; } }; diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index 0836422576f..af44e394fce 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -60,7 +60,7 @@ ImageViewport::ImageViewport (void) : m_alpha(false), m_texInit(false) // destructor ImageViewport::~ImageViewport (void) { - delete [] m_viewportImage; + delete [] m_viewportImage; } @@ -127,15 +127,14 @@ void ImageViewport::calcImage (unsigned int texId, double ts) // reset image init(m_capSize[0], m_capSize[1]); // if texture wasn't initialized - if (!m_texInit) - { + if (!m_texInit) { // initialize it loadTexture(texId, m_image, m_size); m_texInit = true; } // if texture can be directly created if (texId != 0 && m_pyfilter == NULL && m_capSize[0] == calcSize(m_capSize[0]) - && m_capSize[1] == calcSize(m_capSize[1]) && !m_flip && !m_zbuff && !m_depth) + && m_capSize[1] == calcSize(m_capSize[1]) && !m_flip && !m_zbuff && !m_depth) { // just copy current viewport to texture glBindTexture(GL_TEXTURE_2D, texId); @@ -144,50 +143,47 @@ void ImageViewport::calcImage (unsigned int texId, double ts) m_avail = false; } // otherwise copy viewport to buffer, if image is not available - else if (!m_avail) - { - if (m_zbuff) - { - // Use read pixels with the depth buffer + else if (!m_avail) { + if (m_zbuff) { + // Use read pixels with the depth buffer // *** misusing m_viewportImage here, but since it has the correct size - // (4 bytes per pixel = size of float) and we just need it to apply + // (4 bytes per pixel = size of float) and we just need it to apply // the filter, it's ok - glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], - GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage); - // filter loaded data - FilterZZZA filt; - filterImage(filt, (float *)m_viewportImage, m_capSize); - } - else - - if (m_depth) - { - // Use read pixels with the depth buffer - // See warning above about m_viewportImage. - glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], - GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage); - // filter loaded data - FilterDEPTH filt; - filterImage(filt, (float *)m_viewportImage, m_capSize); - } - else - - // get frame buffer data - if (m_alpha) - { - glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGBA, - GL_UNSIGNED_BYTE, m_viewportImage); + glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], + GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage); // filter loaded data - FilterRGBA32 filt; - filterImage(filt, m_viewportImage, m_capSize); + FilterZZZA filt; + filterImage(filt, (float *)m_viewportImage, m_capSize); } - else - { - glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB, - GL_UNSIGNED_BYTE, m_viewportImage); - // filter loaded data - FilterRGB24 filt; - filterImage(filt, m_viewportImage, m_capSize); + else { + + if (m_depth) { + // Use read pixels with the depth buffer + // See warning above about m_viewportImage. + glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], + GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage); + // filter loaded data + FilterDEPTH filt; + filterImage(filt, (float *)m_viewportImage, m_capSize); + } + else { + + // get frame buffer data + if (m_alpha) { + glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGBA, + GL_UNSIGNED_BYTE, m_viewportImage); + // filter loaded data + FilterRGBA32 filt; + filterImage(filt, m_viewportImage, m_capSize); + } + else { + glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB, + GL_UNSIGNED_BYTE, m_viewportImage); + // filter loaded data + FilterRGB24 filt; + filterImage(filt, m_viewportImage, m_capSize); + } + } } } } |