diff options
Diffstat (limited to 'source/gameengine/Rasterizer')
28 files changed, 216 insertions, 216 deletions
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index f379e2eb486..2749752bc6c 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -92,7 +92,7 @@ void RAS_2DFilterManager::PrintShaderErrors(unsigned int shader, const char *tas if (errorprinted) return; - + errorprinted= true; glGetInfoLogARB(shader, sizeof(log), &length, log); @@ -130,7 +130,7 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(const char* shadersource) PrintShaderErrors(fShader, "compile", shadersource); goto fail; } - + program = glCreateProgramObjectARB(); glAttachObjectARB(program, fShader); @@ -141,7 +141,7 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(const char* shadersource) PrintShaderErrors(fShader, "link", shadersource); goto fail; } - + glValidateProgramARB(program); glGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success); if (!success) { @@ -255,7 +255,7 @@ void RAS_2DFilterManager::StartShaderProgram(int passindex) glUniform1iARB(uniformLoc, 2); } } - + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_TextureCoordinateOffset"); if (uniformLoc != -1) { @@ -316,7 +316,7 @@ void RAS_2DFilterManager::FreeTextures() void RAS_2DFilterManager::SetupTextures(bool depth, bool luminance) { FreeTextures(); - + glGenTextures(1, (GLuint*)&texname[0]); glBindTexture(GL_TEXTURE_2D, texname[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureheight, 0, GL_RGBA, @@ -374,7 +374,7 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas) GLfloat xInc = 1.0f / (GLfloat)texturewidth; GLfloat yInc = 1.0f / (GLfloat)textureheight; - + for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) @@ -395,7 +395,7 @@ void RAS_2DFilterManager::UpdateCanvasTextureCoord(const int viewport[4]) */ canvascoord[0] = (GLfloat) viewport[0] / -viewport[2]; canvascoord[1] = (GLfloat) (texturewidth - viewport[0]) / viewport[2]; - + canvascoord[2] = (GLfloat) viewport[1] / -viewport[3]; canvascoord[3] = (GLfloat)(textureheight - viewport[1]) / viewport[3]; } @@ -435,7 +435,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) UpdateCanvasTextureCoord(viewport); need_tex_update = true; } - + if (need_tex_update) { SetupTextures(need_depth, need_luminance); @@ -447,7 +447,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) glBindTexture(GL_TEXTURE_2D, texname[1]); glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, viewport[0], viewport[1], viewport[2], viewport[3], 0); } - + if (need_luminance) { glActiveTextureARB(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, texname[2]); @@ -458,7 +458,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) glActiveTextureARB(GL_TEXTURE0); // We do this to make side-by-side stereo rendering work correctly with 2D filters. It would probably be nicer to just set the viewport, - // but it can be easier for writing shaders to have the coordinates for the whole screen instead of just part of the screen. + // but it can be easier for writing shaders to have the coordinates for the whole screen instead of just part of the screen. RAS_Rect scissor_rect = canvas->GetDisplayArea(); glScissor(scissor_rect.GetLeft() + viewport[0], @@ -470,7 +470,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) // in case the previous material was wire glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // if the last rendered face had alpha add it would messes with the color of the plane we apply 2DFilter to - glDisable(GL_BLEND); + glDisable(GL_BLEND); // fix for [#34523] alpha buffer is now available for all OSs glDisable(GL_ALPHA_TEST); @@ -540,7 +540,7 @@ void RAS_2DFilterManager::EnableFilter(vector<STR_String>& propNames, void* game texflag[pass] = 0; return; } - + if (mode == RAS_2DFILTER_CUSTOMFILTER) { if (m_filters[pass]) diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index bb727fe3b29..a57acc633c9 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -55,12 +55,12 @@ private: void UpdateOffsetMatrix(RAS_ICanvas* canvas); void UpdateCanvasTextureCoord(const int viewport[4]); - + float canvascoord[4]; float textureoffsets[18]; /* float view[4]; */ /* UNUSED */ /* texname[0] contains render to texture, texname[1] contains depth texture, texname[2] contains luminance texture*/ - unsigned int texname[3]; + unsigned int texname[3]; int texturewidth; int textureheight; /* int numberoffilters; */ /* UNUSED */ diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index deca7cbed9f..547c6ec7097 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -97,7 +97,7 @@ RAS_BucketManager::~RAS_BucketManager() for (it = m_AlphaBuckets.begin(); it != m_AlphaBuckets.end(); it++) delete(*it); - + m_SolidBuckets.clear(); m_AlphaBuckets.clear(); } @@ -130,7 +130,7 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList slots[i++].set(ms, bucket, pnorm); } } - + if (alpha) sort(slots.begin(), slots.end(), backtofront()); else @@ -149,7 +149,7 @@ void RAS_BucketManager::RenderAlphaBuckets(const MT_Transform& cameratrans, RAS_ rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED); OrderBuckets(cameratrans, m_AlphaBuckets, slots, true); - + for (sit=slots.begin(); sit!=slots.end(); ++sit) { rasty->SetClientObject(sit->m_ms->m_clientObj); @@ -201,7 +201,7 @@ void RAS_BucketManager::RenderSolidBuckets(const MT_Transform& cameratrans, RAS_ } #endif } - + /* this code draws meshes order front-to-back instead to reduce overdraw. * it turned out slower due to much material state switching, a more clever * algorithm might do better. */ @@ -248,7 +248,7 @@ void RAS_BucketManager::Renderbuckets(const MT_Transform& cameratrans, RAS_IRast } } } - + rasty->SetClientObject(NULL); } @@ -262,11 +262,11 @@ RAS_MaterialBucket *RAS_BucketManager::FindBucket(RAS_IPolyMaterial *material, b for (it = m_SolidBuckets.begin(); it != m_SolidBuckets.end(); it++) if (*(*it)->GetPolyMaterial() == *material) return *it; - + for (it = m_AlphaBuckets.begin(); it != m_AlphaBuckets.end(); it++) if (*(*it)->GetPolyMaterial() == *material) return *it; - + RAS_MaterialBucket *bucket = new RAS_MaterialBucket(material); bucketCreated = true; @@ -274,14 +274,14 @@ RAS_MaterialBucket *RAS_BucketManager::FindBucket(RAS_IPolyMaterial *material, b m_AlphaBuckets.push_back(bucket); else m_SolidBuckets.push_back(bucket); - + return bucket; } void RAS_BucketManager::OptimizeBuckets(MT_Scalar distance) { BucketList::iterator bit; - + distance = 10.0f; for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) @@ -305,7 +305,7 @@ void RAS_BucketManager::ReleaseDisplayLists(RAS_IPolyMaterial *mat) } } } - + for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) { for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { @@ -328,7 +328,7 @@ void RAS_BucketManager::ReleaseMaterials(RAS_IPolyMaterial * mat) (*bit)->GetPolyMaterial()->ReleaseMaterial(); } } - + for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) { (*bit)->GetPolyMaterial()->ReleaseMaterial(); diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 5ed212ebee0..dead4c619bd 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -44,7 +44,7 @@ public: private: BucketList m_SolidBuckets; BucketList m_AlphaBuckets; - + struct sortedmeshslot; struct backtofront; struct fronttoback; @@ -57,7 +57,7 @@ public: RAS_MaterialBucket* FindBucket(RAS_IPolyMaterial *material, bool &bucketCreated); void OptimizeBuckets(MT_Scalar distance); - + void ReleaseDisplayLists(RAS_IPolyMaterial *material = NULL); void ReleaseMaterials(RAS_IPolyMaterial *material = NULL); diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp b/source/gameengine/Rasterizer/RAS_FramingManager.cpp index 8b0ec22fde3..6e7c5f1b326 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp +++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp @@ -149,18 +149,18 @@ ComputeBestFitViewRect( const float design_aspect_ratio, RAS_Rect &viewport ) { - // try and honour the aspect ratio when setting the + // try and honour the aspect ratio when setting the // drawable area. If we don't do this we are liable // to get a lot of distortion in the rendered image. - + int width = availableViewport.GetWidth(); int height = availableViewport.GetHeight(); float window_aspect = float(width)/float(height); if (window_aspect < design_aspect_ratio) { - int v_height = (int)(width / design_aspect_ratio); - int left_over = (height - v_height) / 2; - + int v_height = (int)(width / design_aspect_ratio); + int left_over = (height - v_height) / 2; + viewport.SetLeft(availableViewport.GetLeft()); viewport.SetBottom(availableViewport.GetBottom() + left_over); viewport.SetRight(availableViewport.GetLeft() + width); @@ -168,7 +168,7 @@ ComputeBestFitViewRect( } else { int v_width = (int)(height * design_aspect_ratio); - int left_over = (width - v_width) / 2; + int left_over = (width - v_width) / 2; viewport.SetLeft(availableViewport.GetLeft() + left_over); viewport.SetBottom(availableViewport.GetBottom()); @@ -195,7 +195,7 @@ ComputeViewport( float design_aspect_ratio = float(1); if (design_height == float(0)) { - // well this is ill defined + // well this is ill defined // lets just scale the thing type = RAS_FrameSettings::e_frame_scale; @@ -223,7 +223,7 @@ ComputeViewport( design_aspect_ratio, viewport ); - + break; } default : @@ -254,14 +254,14 @@ ComputeFrustum( float design_aspect_ratio = float(1); if (design_height == float(0)) { - // well this is ill defined + // well this is ill defined // lets just scale the thing type = RAS_FrameSettings::e_frame_scale; } else { design_aspect_ratio = design_width/design_height; } - + ComputeDefaultFrustum( camnear, camfar, @@ -317,7 +317,7 @@ ComputeFrustum( frustum.x2 *= x_scale; frustum.y1 *= y_scale; frustum.y2 *= y_scale; - + break; } case RAS_FrameSettings::e_frame_scale : @@ -350,14 +350,14 @@ RAS_FramingManager:: float design_aspect_ratio = float(1); if (design_height == float(0)) { - // well this is ill defined + // well this is ill defined // lets just scale the thing type = RAS_FrameSettings::e_frame_scale; } else { design_aspect_ratio = design_width/design_height; } - + ComputeDefaultOrtho( camnear, camfar, @@ -411,7 +411,7 @@ RAS_FramingManager:: frustum.x2 *= x_scale; frustum.y1 *= y_scale; frustum.y2 *= y_scale; - + break; } case RAS_FrameSettings::e_frame_scale : @@ -419,7 +419,7 @@ RAS_FramingManager:: default : break; } - + } diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index cb86a7a4484..3fb488a5af6 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -43,27 +43,27 @@ class RAS_Rect; * This is a value type describing the framing used * by a particular scene in the game engine. * Each KX_Scene contains a RAS_FrameSetting describing - * how the frustum and viewport are to be modified + * how the frustum and viewport are to be modified * depending on the canvas size. * * e_frame_scale means that the viewport is set to the current - * canvas size. If the view frustum aspect ratio is different + * canvas size. If the view frustum aspect ratio is different * to the canvas aspect this will lead to stretching. * - * e_frame_extend means that the best fit viewport will be + * e_frame_extend means that the best fit viewport will be * computed based upon the design aspect ratio - * and the view frustum will be adjusted so that + * and the view frustum will be adjusted so that * more of the scene is visible. * * e_frame_bars means that the best fit viewport will be * be computed based upon the design aspect ratio. */ -class RAS_FrameSettings +class RAS_FrameSettings { public : /** - * enum defining the policy to use + * enum defining the policy to use * in each axis. */ enum RAS_FrameType { @@ -71,7 +71,7 @@ public : e_frame_extend, e_frame_bars }; - + /** * Constructor */ @@ -82,7 +82,7 @@ public : float bar_g, float bar_b, unsigned int design_aspect_width, - unsigned int design_aspect_height + unsigned int design_aspect_height ): m_frame_type(frame_type), m_bar_r(bar_r), @@ -121,13 +121,13 @@ public : ) { m_frame_type = type; }; - + float BarRed( ) const { return m_bar_r; }; - + float BarGreen( ) const { @@ -165,7 +165,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_FrameSettings") #endif -}; +}; struct RAS_FrameFrustum { @@ -193,8 +193,8 @@ enum RAS_SensorFit /** * \section RAS_FramingManager * This class helps to compute a view frustum - * and a viewport rectangle given the - * above settings and a description of the + * and a viewport rectangle given the + * above settings and a description of the * current canvas dimensions. * * You do not have to instantiate this class @@ -219,10 +219,10 @@ public : RAS_Rect &viewport ); - + /** * compute a frustum given a valid viewport, - * RAS_FrameSettings, canvas description + * RAS_FrameSettings, canvas description * and camera description */ diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index 91cc13c8f85..2c67f454df1 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -62,18 +62,18 @@ public: RAS_ICanvas(); virtual ~RAS_ICanvas(); - virtual - void + virtual + void Init( ) = 0; - virtual - void + virtual + void BeginFrame( )=0; - virtual - void + virtual + void EndFrame( )=0; @@ -86,8 +86,8 @@ public: * */ - virtual - bool + virtual + bool BeginDraw( )=0; @@ -95,18 +95,18 @@ public: * Unitializes the canvas for drawing. */ - virtual - void + virtual + void EndDraw( )=0; /// probably needs some arguments for PS2 in future - virtual - void + virtual + void SwapBuffers( )=0; - + virtual void SetSwapInterval( @@ -118,15 +118,15 @@ public: GetSwapInterval( int& intervalOut )=0; - - virtual - void + + virtual + void ClearBuffer( int type )=0; - virtual - void + virtual + void ClearColor( float r, float g, @@ -134,13 +134,13 @@ public: float a )=0; - virtual - int + virtual + int GetWidth( ) const = 0; - virtual - int + virtual + int GetHeight( ) const = 0; @@ -183,7 +183,7 @@ public: ) = 0; /** - * Set the visible view-port + * Set the visible view-port */ virtual @@ -212,14 +212,14 @@ public: const int* GetViewPort() = 0; - virtual - void + virtual + void SetMouseState( RAS_MouseState mousestate )=0; - virtual - void + virtual + void SetMousePosition( int x, int y @@ -232,8 +232,8 @@ public: return m_mousestate; } - virtual - void + virtual + void MakeScreenShot( const char* filename )=0; @@ -241,7 +241,7 @@ public: virtual void GetDisplayDimensions(int &width, int &height) = 0; virtual - void + void ResizeWindow( int width, int height @@ -257,8 +257,8 @@ public: bool GetFullScreen()=0; - - + + protected: RAS_MouseState m_mousestate; int m_frame; /// frame number for screenshots. diff --git a/source/gameengine/Rasterizer/RAS_ILightObject.h b/source/gameengine/Rasterizer/RAS_ILightObject.h index a3d55c925d6..2ff4ec7da01 100644 --- a/source/gameengine/Rasterizer/RAS_ILightObject.h +++ b/source/gameengine/Rasterizer/RAS_ILightObject.h @@ -54,7 +54,7 @@ public: int m_layer; void *m_scene; void *m_light; - + float m_energy; float m_distance; float m_shadowclipstart; @@ -74,7 +74,7 @@ public: float m_spotblend; LightType m_type; - + bool m_nodiffuse; bool m_nospecular; bool m_glsl; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index 2a736aa7deb..cfe239a2e09 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -35,7 +35,7 @@ #include "DNA_material_types.h" -void RAS_IPolyMaterial::Initialize( +void RAS_IPolyMaterial::Initialize( const STR_String& texname, const STR_String& matname, int materialindex, @@ -69,7 +69,7 @@ void RAS_IPolyMaterial::Initialize( m_drawingmode = ConvertFaceMode(game, image); } -RAS_IPolyMaterial::RAS_IPolyMaterial() +RAS_IPolyMaterial::RAS_IPolyMaterial() : m_texturename("__Dummy_Texture_Name__"), m_materialname("__Dummy_Material_Name__"), m_tile(0), @@ -180,7 +180,7 @@ bool RAS_IPolyMaterial::Less(const RAS_IPolyMaterial& rhs) const { if (Equals(rhs)) return false; - + return m_polymatid < rhs.m_polymatid; } @@ -205,7 +205,7 @@ int RAS_IPolyMaterial::GetDrawingMode() const } const STR_String& RAS_IPolyMaterial::GetMaterialName() const -{ +{ return m_materialname; } @@ -273,7 +273,7 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const else { dolights = m_light; } - + return dolights; } diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index a34f7a9b390..70d48fce48c 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -74,7 +74,7 @@ class RAS_IPolyMaterial //todo: remove these variables from this interface/protocol class protected: STR_HashedString m_texturename; - STR_HashedString m_materialname; //also needed for touchsensor + STR_HashedString m_materialname; //also needed for touchsensor int m_tile; int m_tilexrep,m_tileyrep; int m_drawingmode; @@ -83,7 +83,7 @@ protected: bool m_zsort; bool m_light; int m_materialindex; - + unsigned int m_polymatid; static unsigned int m_newpolymatid; @@ -95,7 +95,7 @@ public: float m_shininess; MT_Vector3 m_specular; float m_specularity; - + /** Used to store caching information for materials. */ typedef void* TCachingInfo; @@ -131,7 +131,7 @@ public: struct GameSettings* game); virtual ~RAS_IPolyMaterial() {} - + /** * Returns the caching information for this material, * This can be used to speed up the rasterizing process. @@ -146,9 +146,9 @@ public: * \param rasty The rasterizer in which the material should be active. * \param cachingInfo The information about the material used to speed up rasterizing. */ - virtual bool Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const - { - return false; + virtual bool Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const + { + return false; } virtual void ActivateMeshSlot(const class RAS_MeshSlot & ms, RAS_IRasterizer* rasty) const {} diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index dc92408915b..783c216e3c5 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -64,7 +64,7 @@ typedef vector<KX_VertexArray *> vecVertexArray; typedef vector<KX_IndexArray *> vecIndexArrays; /** - * 3D rendering device context interface. + * 3D rendering device context interface. */ class RAS_IRasterizer { @@ -275,7 +275,7 @@ public: * SwapBuffers swaps the back buffer with the front buffer. */ virtual void SwapBuffers() = 0; - + // Drawing Functions /** * IndexPrimitives: Renders primitives from mesh slot. @@ -286,7 +286,7 @@ public: * IndexPrimitives_3DText will render text into the polygons. */ virtual void IndexPrimitives_3DText(class RAS_MeshSlot &ms, class RAS_IPolyMaterial *polymat) = 0; - + virtual void SetProjectionMatrix(MT_CmMatrix4x4 &mat) = 0; /* This one should become our final version, methinks. */ @@ -316,7 +316,7 @@ public: virtual void EnableFog(bool enable) = 0; virtual void SetBackColor(float color[3]) = 0; - + /** * \param drawingmode = KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED. */ @@ -374,7 +374,7 @@ public: * Sets the specular color component of the lighting equation. */ virtual void SetSpecularity(float specX, float specY, float specZ, float specval) = 0; - + /** * Sets the specular exponent component of the lighting equation. */ @@ -387,9 +387,9 @@ public: /** * Sets the emissive color component of the lighting equation. - */ + */ virtual void SetEmissive(float eX, float eY, float eZ, float e) = 0; - + virtual void SetAmbientColor(float color[3]) = 0; virtual void SetAmbient(float factor) = 0; @@ -397,12 +397,12 @@ public: * Sets a polygon offset. z depth will be: z1 = mult*z0 + add */ virtual void SetPolygonOffset(float mult, float add) = 0; - + virtual void DrawDebugLine(SCA_IScene *scene, const MT_Vector3 &from, const MT_Vector3 &to, const MT_Vector3& color) = 0; virtual void DrawDebugCircle(SCA_IScene *scene, const MT_Vector3 ¢er, const MT_Scalar radius, const MT_Vector3 &color, const MT_Vector3 &normal, int nsector) = 0; virtual void FlushDebugShapes(SCA_IScene *scene) = 0; - + virtual void SetTexCoordNum(int num) = 0; virtual void SetAttribNum(int num) = 0; virtual void SetTexCoord(TexCoGen coords, int unit) = 0; @@ -413,10 +413,10 @@ public: virtual bool QueryLists() { return false; } virtual bool QueryArrays() { return false; } - + virtual void EnableMotionBlur(float motionblurvalue) = 0; virtual void DisableMotionBlur() = 0; - + virtual float GetMotionBlurValue() = 0; virtual int GetMotionBlurState() = 0; virtual void SetMotionBlurState(int newstate) = 0; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 9cd8f77adfd..0de9af50872 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -117,7 +117,7 @@ RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot) : SG_QList() m_endindex = slot.m_endindex; for (it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { - // don't copy display arrays for now because it breaks python + // don't copy display arrays for now because it breaks python // access to vertices, but we'll need a solution if we want to // join display arrays for reducing draw calls. //*it = new RAS_DisplayArray(**it); @@ -215,7 +215,7 @@ void RAS_MeshSlot::SetDisplayArray(int numverts) { RAS_DisplayArrayList::iterator it; RAS_DisplayArray *darray = NULL; - + for (it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { darray = *it; @@ -247,7 +247,7 @@ void RAS_MeshSlot::SetDisplayArray(int numverts) darray->m_type = RAS_DisplayArray::TRIANGLE; else if (numverts == 4) darray->m_type = RAS_DisplayArray::QUAD; - + m_endarray = m_displayArrays.size()-1; m_endvertex = 0; m_endindex = 0; @@ -265,7 +265,7 @@ int RAS_MeshSlot::AddVertex(const RAS_TexVert& tv) { RAS_DisplayArray *darray; int offset; - + darray = m_currentArray; darray->m_vertex.push_back(tv); offset = darray->m_vertex.size()-1; @@ -366,7 +366,7 @@ bool RAS_MeshSlot::Equals(RAS_MeshSlot *target) return false; if (m_bObjectColor && !(m_RGBAcolor == target->m_RGBAcolor)) return false; - + return true; } @@ -382,7 +382,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) if (!Equals(target)) return false; - + MT_Vector3 co(&m_OpenGLMatrix[12]); MT_Vector3 targetco(&target->m_OpenGLMatrix[12]); @@ -394,7 +394,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) targetmat.invert(); MT_Matrix4x4 transform = targetmat*mat; - + // m_mesh, clientobj m_joinSlot = target; m_joinInvTransform = transform; @@ -407,7 +407,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) for (begin(mit); !end(mit); next(mit)) for (i=mit.startvertex; i<mit.endvertex; i++) mit.vertex[i].Transform(transform, ntransform); - + /* We know we'll need a list at least this big, reserve in advance */ target->m_displayArrays.reserve(target->m_displayArrays.size() + m_displayArrays.size()); @@ -426,7 +426,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) target->m_DisplayList->Release(); target->m_DisplayList = NULL; } - + return true; #if 0 return false; @@ -517,9 +517,9 @@ bool RAS_MeshSlot::IsCulled() struct RAS_MaterialBucket::less { - bool operator()(const RAS_MaterialBucket* x, const RAS_MaterialBucket* y) const - { - return *x->GetPolyMaterial() < *y->GetPolyMaterial(); + bool operator()(const RAS_MaterialBucket* x, const RAS_MaterialBucket* y) const + { + return *x->GetPolyMaterial() < *y->GetPolyMaterial(); } }; @@ -535,7 +535,7 @@ RAS_MaterialBucket::~RAS_MaterialBucket() } RAS_IPolyMaterial* RAS_MaterialBucket::GetPolyMaterial() const -{ +{ return m_material; } @@ -554,7 +554,7 @@ RAS_MeshSlot* RAS_MaterialBucket::AddMesh(int numverts) RAS_MeshSlot *ms; m_meshSlots.push_back(RAS_MeshSlot()); - + ms = &m_meshSlots.back(); ms->init(this, numverts); @@ -564,7 +564,7 @@ RAS_MeshSlot* RAS_MaterialBucket::AddMesh(int numverts) RAS_MeshSlot* RAS_MaterialBucket::CopyMesh(RAS_MeshSlot *ms) { m_meshSlots.push_back(RAS_MeshSlot(*ms)); - + return &m_meshSlots.back(); } @@ -593,7 +593,7 @@ list<RAS_MeshSlot>::iterator RAS_MaterialBucket::msEnd() bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty) { bool uselights; - + if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !m_material->CastsShadows()) return false; @@ -602,10 +602,10 @@ bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_I if (!rasty->SetMaterial(*m_material)) return false; - + uselights= m_material->UsesLighting(rasty); rasty->ProcessLighting(uselights, cameratrans); - + return true; } @@ -619,7 +619,7 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa ms.m_mesh->SetMeshModified(true); // KX_ReInstanceShapeFromMesh(ms.m_mesh); // Recompute the physics mesh. (Can't call KX_* from RAS_) } - + if (IsZSort() && rasty->GetDrawingMode() >= RAS_IRasterizer::KX_SOLID) ms.m_mesh->SortPolygons(ms, cameratrans*MT_Transform(ms.m_OpenGLMatrix)); @@ -665,7 +665,7 @@ void RAS_MaterialBucket::Optimize(MT_Scalar distance) /* TODO: still have to check before this works correct: * - lightlayer, frontface, text, billboard * - make it work with physics */ - + #if 0 list<RAS_MeshSlot>::iterator it; list<RAS_MeshSlot>::iterator jt; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 75cc382c78c..8ea80d883cf 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -62,7 +62,7 @@ protected: public: KX_ListSlot() { m_refcount = 1; } virtual ~KX_ListSlot() {} - virtual int Release() { + virtual int Release() { if (--m_refcount > 0) return m_refcount; delete this; @@ -92,7 +92,7 @@ public: /* LINE currently isn't used */ enum { LINE = 2, TRIANGLE = 3, QUAD = 4 } m_type; //RAS_MeshSlot *m_origSlot; - + /* Number of RAS_MeshSlot using this array */ int m_users; @@ -146,7 +146,7 @@ public: RAS_MeshSlot(); RAS_MeshSlot(const RAS_MeshSlot& slot); virtual ~RAS_MeshSlot(); - + void init(RAS_MaterialBucket *bucket, int numverts); struct iterator { @@ -218,7 +218,7 @@ class RAS_MaterialBucket public: RAS_MaterialBucket(RAS_IPolyMaterial* mat); virtual ~RAS_MaterialBucket(); - + /* Bucket Sorting */ struct less; typedef set<RAS_MaterialBucket*, less> Set; @@ -227,11 +227,11 @@ public: RAS_IPolyMaterial* GetPolyMaterial() const; bool IsAlpha() const; bool IsZSort() const; - + /* Rendering */ bool ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty); void RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_MeshSlot &ms); - + /* Mesh Slot Access */ list<RAS_MeshSlot>::iterator msBegin(); list<RAS_MeshSlot>::iterator msEnd(); @@ -257,7 +257,7 @@ private: list<RAS_MeshSlot> m_meshSlots; // all the mesh slots RAS_IPolyMaterial* m_material; SG_DList m_activeMeshSlotsHead; // only those which must be rendered - + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_MaterialBucket") diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 4360464ed32..f39af70cf71 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -49,7 +49,7 @@ struct RAS_MeshObject::polygonSlot { float m_z; int m_index[4]; - + polygonSlot() {} /* pnorm is the normal from the plane equation that the distance from is @@ -79,7 +79,7 @@ struct RAS_MeshObject::polygonSlot indexarray[offset+i] = m_index[i]; } }; - + struct RAS_MeshObject::backtofront { bool operator()(const polygonSlot &a, const polygonSlot &b) const @@ -147,12 +147,12 @@ int RAS_MeshObject::NumMaterials() } const STR_String& RAS_MeshObject::GetMaterialName(unsigned int matid) -{ +{ RAS_MeshMaterial* mmat = GetMeshMaterial(matid); if (mmat) return mmat->m_bucket->GetPolyMaterial()->GetMaterialName(); - + return s_emptyname; } @@ -182,8 +182,8 @@ RAS_Polygon* RAS_MeshObject::GetPolygon(int num) const return m_Polygons[num]; } - - + + list<RAS_MeshMaterial>::iterator GetFirstMaterial(); list<RAS_MeshMaterial>::iterator GetLastMaterial(); @@ -216,9 +216,9 @@ STR_String& RAS_MeshObject::GetName() const STR_String& RAS_MeshObject::GetTextureName(unsigned int matid) -{ +{ RAS_MeshMaterial* mmat = GetMeshMaterial(matid); - + if (mmat) return mmat->m_bucket->GetPolyMaterial()->GetTextureName(); @@ -321,7 +321,7 @@ void RAS_MeshObject::AddVertex(RAS_Polygon *poly, int i, RAS_DisplayArray *darray; RAS_MeshSlot *slot; int offset; - + mmat = GetMeshMaterial(poly->GetMaterial()->GetPolyMaterial()); slot = mmat->m_baseslot; darray = slot->CurrentDisplayArray(); @@ -373,7 +373,7 @@ int RAS_MeshObject::NumVertices(RAS_IPolyMaterial* mat) slot = mmat->m_baseslot; for (slot->begin(it); !slot->end(it); slot->next(it)) len += it.endvertex - it.startvertex; - + return len; } @@ -390,7 +390,7 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, if (!mmat) return NULL; - + slot = mmat->m_baseslot; len = 0; for (slot->begin(it); !slot->end(it); slot->next(it)) { @@ -399,7 +399,7 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, else return &it.vertex[index - len]; } - + return NULL; } @@ -416,22 +416,22 @@ void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* list<RAS_MeshMaterial>::iterator mit; for (it = m_materials.begin();it!=m_materials.end();++it) { - /* always copy from the base slot, which is never removed + /* always copy from the base slot, which is never removed * since new objects can be created with the same mesh data */ if (deformer && !deformer->UseVertexArray()) { - // HACK! + // HACK! // this deformer doesn't use vertex array => derive mesh // we must keep only the mesh slots that have unique material id // this is to match the derived mesh drawing function // Need a better solution in the future: scan the derive mesh and create vertex array RAS_IPolyMaterial* curmat = it->m_bucket->GetPolyMaterial(); - if (curmat->GetFlag() & RAS_BLENDERGLSL) + if (curmat->GetFlag() & RAS_BLENDERGLSL) { for (mit = m_materials.begin(); mit != it; ++mit) { RAS_IPolyMaterial* mat = mit->m_bucket->GetPolyMaterial(); - if ((mat->GetFlag() & RAS_BLENDERGLSL) && + if ((mat->GetFlag() & RAS_BLENDERGLSL) && mat->GetMaterialIndex() == curmat->GetMaterialIndex()) // no need to convert current mesh slot break; @@ -451,7 +451,7 @@ void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* void RAS_MeshObject::RemoveFromBuckets(void *clientobj) { list<RAS_MeshMaterial>::iterator it; - + for (it = m_materials.begin();it!=m_materials.end();++it) { RAS_MeshSlot **msp = it->m_slots[clientobj]; @@ -485,7 +485,7 @@ void RAS_MeshObject::EndConversion() //void RAS_MeshObject::Transform(const MT_Transform& trans) //{ //m_trans.translate(MT_Vector3(0,0,1));//.operator *=(trans); - + // for (int i=0;i<m_Polygons.size();i++) // { // m_Polygons[i]->Transform(trans); @@ -508,7 +508,7 @@ void RAS_MeshObject::SortPolygons(RAS_MeshSlot& ms, const MT_Transform &transfor // Limitations: sorting is quite simple, and handles many // cases wrong, partially due to polygons being sorted per // bucket. - // + // // a) mixed triangles/quads are sorted wrong // b) mixed materials are sorted wrong // c) more than 65k faces are sorted wrong @@ -569,5 +569,5 @@ void RAS_MeshObject::SchedulePolygons(int drawingmode) { m_bModified = false; m_bMeshModified = true; - } + } } diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index a6f1a1cafc6..ac643f52f06 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -107,7 +107,7 @@ public: Mesh* GetMesh() { return m_mesh; } /* mesh construction */ - + virtual RAS_Polygon* AddPolygon(RAS_MaterialBucket *bucket, int numverts); virtual void AddVertex(RAS_Polygon *poly, int i, const MT_Point3& xyz, @@ -127,7 +127,7 @@ public: int NumPolygons(); RAS_Polygon* GetPolygon(int num) const; - + /* buckets */ virtual void AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* deformer); @@ -137,7 +137,7 @@ public: /* colors */ void DebugColor(unsigned int abgr); void SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba); - + /* polygon sorting by Z for alpha */ void SortPolygons(RAS_MeshSlot& ms, const MT_Transform &transform); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h index 932d5b16fed..b2ac1008de1 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h @@ -37,7 +37,7 @@ uniform sampler2D bgl_RenderedTexture; void main(void) { - vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); + vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); float gray = dot(texcolor.rgb, vec3(0.299, 0.587, 0.114)); gl_FragColor = vec4(gray, gray, gray, texcolor.a); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sepia2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sepia2DFilter.h index 16b4e71dfdb..1aad0ddea6b 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sepia2DFilter.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sepia2DFilter.h @@ -37,7 +37,7 @@ uniform sampler2D bgl_RenderedTexture; void main(void) { - vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); + vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); float gray = dot(texcolor.rgb, vec3(0.299, 0.587, 0.114)); gl_FragColor = vec4(gray * vec3(1.2, 1.0, 0.8), texcolor.a); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 71c8cfe745f..3afb94413bc 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -89,7 +89,7 @@ void RAS_ListSlot::DrawList() } if (m_list != 0) glNewList((GLuint)m_list, GL_COMPILE); - + m_flag |= LIST_BEGIN; return; } @@ -127,7 +127,7 @@ RAS_ListRasterizer::RAS_ListRasterizer(RAS_ICanvas* canvas, bool lock, RAS_STORA { } -RAS_ListRasterizer::~RAS_ListRasterizer() +RAS_ListRasterizer::~RAS_ListRasterizer() { ReleaseAlloc(); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp index 69e859f06d9..ff0e7516fc8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp @@ -180,7 +180,7 @@ bool RAS_OpenGLLight::HasShadowBuffer() int RAS_OpenGLLight::GetShadowBindCode() { GPULamp *lamp; - + if ((lamp = GetGPULamp())) return GPU_lamp_shadow_bind_code(lamp); return -1; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 5eed9b3b8f8..fa24395a74e 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -29,10 +29,10 @@ * \ingroup bgerastogl */ - + #include <math.h> #include <stdlib.h> - + #include "RAS_OpenGLRasterizer.h" #include "GPU_glew.h" @@ -116,7 +116,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas, RAS_STORAGE_TYPE { m_viewmatrix.setIdentity(); m_viewinvmatrix.setIdentity(); - + for (int i = 0; i < 32; i++) { left_eye_vinterlace_mask[i] = 0x55555555; @@ -256,13 +256,13 @@ void RAS_OpenGLRasterizer::Exit() glDepthMask (GL_TRUE); glDepthFunc(GL_LEQUAL); glBlendFunc(GL_ONE, GL_ZERO); - + glDisable(GL_POLYGON_STIPPLE); - + glDisable(GL_LIGHTING); if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2) glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR); - + EndFrame(); } @@ -302,7 +302,7 @@ bool RAS_OpenGLRasterizer::BeginFrame(double time) m_lastauxinfo = NULL; m_lastlighting = true; /* force disable in DisableOpenGLLights() */ DisableOpenGLLights(); - + return true; } @@ -441,7 +441,7 @@ void RAS_OpenGLRasterizer::SetRenderArea() area.SetLeft(0); area.SetBottom(m_2DCanvas->GetHeight() - int(m_2DCanvas->GetHeight() - m_noOfScanlines) / 2); - + area.SetRight(int(m_2DCanvas->GetWidth())); area.SetTop(int(m_2DCanvas->GetHeight())); m_2DCanvas->SetDisplayArea(&area); @@ -463,7 +463,7 @@ void RAS_OpenGLRasterizer::SetRenderArea() area.SetLeft(0); area.SetBottom(m_2DCanvas->GetHeight() - m_2DCanvas->GetHeight() / 2); - + area.SetRight(m_2DCanvas->GetWidth()); area.SetTop(m_2DCanvas->GetHeight()); m_2DCanvas->SetDisplayArea(&area); @@ -509,7 +509,7 @@ void RAS_OpenGLRasterizer::SetRenderArea() break; } } - + void RAS_OpenGLRasterizer::SetStereoMode(const StereoMode stereomode) { m_stereomode = stereomode; @@ -646,7 +646,7 @@ const MT_Matrix4x4& RAS_OpenGLRasterizer::GetViewInvMatrix() const void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms, class RAS_IPolyMaterial* polymat) -{ +{ bool obcolor = ms.m_bObjectColor; MT_Vector4& rgba = ms.m_RGBAcolor; RAS_MeshSlot::iterator it; @@ -664,7 +664,7 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms, for (ms.begin(it); !ms.end(it); ms.next(it)) { RAS_TexVert *vertex; size_t i, j, numvert; - + numvert = it.array->m_type; if (it.array->m_type == RAS_DisplayArray::LINE) { @@ -875,7 +875,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix( float frustnear, float frustfar, float focallength, - bool + bool ) { MT_Matrix4x4 result; float mat[16]; @@ -912,11 +912,11 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix( top *= 2.0f; } } - + glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(left, right, bottom, top, frustnear, frustfar); - + glGetFloatv(GL_PROJECTION_MATRIX, mat); result.setValue(mat); @@ -938,7 +938,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetOrthoMatrix( glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(left, right, bottom, top, frustnear, frustfar); - + glGetFloatv(GL_PROJECTION_MATRIX, mat); result.setValue(mat); @@ -947,7 +947,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetOrthoMatrix( // next arguments probably contain redundant info, for later... -void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, +void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Matrix3x3 & camOrientMat3x3, const MT_Point3 & pos, const MT_Vector3 &scale, @@ -1131,7 +1131,7 @@ void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend) glAlphaFunc(GL_GREATER, 0.0f); } else if (alphablend == GPU_BLEND_CLIP) { - glDisable(GL_BLEND); + glDisable(GL_BLEND); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.5f); } @@ -1152,7 +1152,7 @@ void RAS_OpenGLRasterizer::SetFrontFace(bool ccw) glFrontFace(GL_CCW); else glFrontFace(GL_CW); - + m_last_frontface = ccw; } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 9561e207dba..b288c3c5d8f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -79,7 +79,7 @@ struct OglDebugShape class RAS_OpenGLRasterizer : public RAS_IRasterizer { RAS_ICanvas *m_2DCanvas; - + /* fogging vars */ bool m_fogenabled; @@ -87,7 +87,7 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer float m_greenback; float m_blueback; float m_alphaback; - + float m_ambr; float m_ambg; float m_ambb; @@ -200,7 +200,7 @@ public: virtual const MT_Point3& GetCameraPosition(); virtual bool GetCameraOrtho(); - + virtual void SetFog(short type, float start, float dist, float intensity, float color[3]); virtual void EnableFog(bool enable); virtual void DisplayFog(); @@ -215,7 +215,7 @@ public: virtual MT_Matrix4x4 GetFrustumMatrix( float left, float right, float bottom, float top, - float frustnear, float frustfar, + float frustnear, float frustfar, float focallength, bool perspective); virtual MT_Matrix4x4 GetOrthoMatrix( float left, float right, float bottom, float top, @@ -268,7 +268,7 @@ public: const MT_Matrix4x4 &GetViewMatrix() const; const MT_Matrix4x4 &GetViewInvMatrix() const; - + virtual void EnableMotionBlur(float motionblurvalue); virtual void DisableMotionBlur(); virtual float GetMotionBlurValue() { return m_motionblurvalue; } @@ -279,13 +279,13 @@ public: m_motionblur = 0; else if (newstate > 2) m_motionblur = 2; - else + else m_motionblur = newstate; } virtual void SetAlphaBlend(int alphablend); virtual void SetFrontFace(bool ccw); - + virtual void SetAnisotropicFiltering(short level); virtual short GetAnisotropicFiltering(); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp index f980116f5f8..b8900121d69 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp @@ -111,7 +111,7 @@ void RAS_StorageVA::IndexPrimitives(class RAS_MeshSlot& ms) // here the actual drawing takes places glDrawElements(drawmode, it.totindex, GL_UNSIGNED_SHORT, it.index); } - + glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); if (!wireframe) { @@ -192,7 +192,7 @@ void RAS_StorageVA::EnableTextures(bool enable) texco_num = *m_texco_num; attrib = m_attrib; attrib_num = *m_attrib_num; - + memcpy(m_last_texco, m_texco, sizeof(RAS_IRasterizer::TexCoGen)*(*m_texco_num)); m_last_texco_num = *m_texco_num; memcpy(m_last_attrib, m_attrib, sizeof(RAS_IRasterizer::TexCoGen)*(*m_attrib_num)); diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp index 3274ded4406..4ed9b20f325 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.cpp +++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp @@ -78,7 +78,7 @@ void RAS_Polygon::SetEdgeCode(int edgecode) m_edgecode = edgecode; }*/ - + bool RAS_Polygon::IsVisible() { return (m_polyflags & VISIBLE) != 0; diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h index 597e80ffdfb..8606eb34081 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.h +++ b/source/gameengine/Rasterizer/RAS_Polygon.h @@ -57,7 +57,7 @@ class RAS_Polygon unsigned char m_edgecode; unsigned char m_polyflags; #endif - + public: enum { VISIBLE = 1, @@ -67,7 +67,7 @@ public: RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray* darray, int numvert); virtual ~RAS_Polygon() {}; - + int VertexCount(); RAS_TexVert* GetVertex(int i); @@ -78,7 +78,7 @@ public: // - Not used yet! /* int GetEdgeCode(); void SetEdgeCode(int edgecode); */ - + bool IsVisible(); void SetVisible(bool visible); diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h index fc99c9159db..cd68b336b2a 100644 --- a/source/gameengine/Rasterizer/RAS_Rect.h +++ b/source/gameengine/Rasterizer/RAS_Rect.h @@ -36,7 +36,7 @@ #include "MEM_guardedalloc.h" #endif -/** +/** * \section interface class. * RAS_Rect just encodes a simple rectangle. * \note Should be part of a generic library diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 2e176360d61..6b178edde93 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -94,7 +94,7 @@ void RAS_TexVert::SetUV(int index, const float uv[2]) } void RAS_TexVert::SetRGBA(const unsigned int rgba) -{ +{ m_rgba = rgba; } diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index 8d08549d97e..6704f52fe69 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -46,7 +46,7 @@ static MT_Point2 g_pt2; class RAS_TexVert { - + float m_localxyz[3]; // 3*4 = 12 float m_uvs[8][2]; // 8*2*4=64 //8 = MAX_UNIT unsigned int m_rgba; // 4 @@ -69,7 +69,7 @@ public: short getFlag() const; unsigned int getUnit() const; - + RAS_TexVert()// :m_xyz(0,0,0),m_uv(0,0),m_rgba(0) {} RAS_TexVert(const MT_Point3& xyz, @@ -85,19 +85,19 @@ public: return m_uvs[unit]; }; - const float* getXYZ() const { + const float* getXYZ() const { return m_localxyz; }; - + const float* getNormal() const { return m_normal; } - + short int getSoftBodyIndex() const { return m_softBodyIndex; } - + void setSoftBodyIndex(short int sbIndex) { m_softBodyIndex = sbIndex; @@ -125,7 +125,7 @@ public: void SetTangent(const MT_Vector3& tangent); void SetFlag(const short flag); void SetUnit(const unsigned u); - + void SetRGBA(const MT_Vector4& rgba); const MT_Point3& xyz(); diff --git a/source/gameengine/Rasterizer/RAS_texmatrix.cpp b/source/gameengine/Rasterizer/RAS_texmatrix.cpp index d30a3d3a75d..acaec16851b 100644 --- a/source/gameengine/Rasterizer/RAS_texmatrix.cpp +++ b/source/gameengine/Rasterizer/RAS_texmatrix.cpp @@ -42,15 +42,15 @@ void RAS_CalcTexMatrix(RAS_TexVert p[3],MT_Point3& origin,MT_Vector3& udir,MT_Ve normal.normalize(); // determine which coordinate we drop, ie. max coordinate in the normal - + int ZCOORD = normal.closestAxis(); int XCOORD = (ZCOORD+1)%3; int YCOORD = (ZCOORD+2)%3; - + // ax+by+cz+d=0 MT_Scalar d = -p[0].xyz().dot(normal); - + MT_Matrix3x3 mat3( p[0].getUV(0)[0],p[0].getUV(0)[1], 1, p[1].getUV(0)[0],p[1].getUV(0)[1], 1, @@ -64,7 +64,7 @@ void RAS_CalcTexMatrix(RAS_TexVert p[3],MT_Point3& origin,MT_Vector3& udir,MT_Ve MT_Vector3 p123y(p[0].xyz()[YCOORD],p[1].xyz()[YCOORD],p[2].xyz()[YCOORD]); MT_Vector3 resulty = mat3inv*p123y; - // normal[ZCOORD] is not zero, because it's chosen to be maximal (absolute), and normal has length 1, + // normal[ZCOORD] is not zero, because it's chosen to be maximal (absolute), and normal has length 1, // so at least on of the coords is <> 0 //droppedvalue udir.dot(normal) =0 @@ -81,7 +81,7 @@ void RAS_CalcTexMatrix(RAS_TexVert p[3],MT_Point3& origin,MT_Vector3& udir,MT_Ve origin[XCOORD] = resultx.z(); origin[YCOORD] = resulty.z(); origin[ZCOORD] = droppedvalue; - + } @@ -103,7 +103,7 @@ int main() RAS_TexVert p1(pxyz1,puv1); RAS_TexVert p2(pxyz2,puv2); - RAS_TexVert vertices[3] = + RAS_TexVert vertices[3] = { p0, p1, |