Browse Source

Rename ClearFlag to ClearMode and fix lua bindings.

Rokas Kupstys 7 years ago
parent
commit
b4dec95887

+ 4 - 4
Source/Urho3D/AngelScript/GraphicsAPI.cpp

@@ -326,10 +326,10 @@ static void RegisterRenderPath(asIScriptEngine* engine)
     engine->RegisterEnumValue("TextureUnit", "MAX_MATERIAL_TEXTURE_UNITS", MAX_MATERIAL_TEXTURE_UNITS);
     engine->RegisterEnumValue("TextureUnit", "MAX_TEXTURE_UNITS", MAX_TEXTURE_UNITS);
 
-    engine->RegisterEnum("ClearFlag");
-    engine->RegisterEnumValue("ClearFlag", "CLEAR_COLOR", CLEAR_COLOR);
-    engine->RegisterEnumValue("ClearFlag", "CLEAR_DEPTH", CLEAR_DEPTH);
-    engine->RegisterEnumValue("ClearFlag", "CLEAR_STENCIL", CLEAR_STENCIL);
+    engine->RegisterEnum("ClearMode");
+    engine->RegisterEnumValue("ClearMode", "CLEAR_COLOR", CLEAR_COLOR);
+    engine->RegisterEnumValue("ClearMode", "CLEAR_DEPTH", CLEAR_DEPTH);
+    engine->RegisterEnumValue("ClearMode", "CLEAR_STENCIL", CLEAR_STENCIL);
 
     engine->RegisterObjectType("RenderTargetInfo", sizeof(RenderTargetInfo), asOBJ_VALUE | asOBJ_APP_CLASS_C);
     engine->RegisterObjectBehaviour("RenderTargetInfo", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructRenderTargetInfo), asCALL_CDECL_OBJLAST);

+ 1 - 1
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -590,7 +590,7 @@ void Graphics::EndFrame()
     CleanupScratchBuffers();
 }
 
-void Graphics::Clear(ClearFlags flags, const Color& color, float depth, unsigned stencil)
+void Graphics::Clear(ClearModeFlags flags, const Color& color, float depth, unsigned stencil)
 {
     IntVector2 rtSize = GetRenderTargetDimensions();
 

+ 1 - 1
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -771,7 +771,7 @@ void Graphics::EndFrame()
     CleanupScratchBuffers();
 }
 
-void Graphics::Clear(ClearFlags flags, const Color& color, float depth, unsigned stencil)
+void Graphics::Clear(ClearModeFlags flags, const Color& color, float depth, unsigned stencil)
 {
     DWORD d3dFlags = 0;
     if (flags & CLEAR_COLOR)

+ 1 - 1
Source/Urho3D/Graphics/Graphics.h

@@ -125,7 +125,7 @@ public:
     /// End frame rendering and swap buffers.
     void EndFrame();
     /// Clear any or all of rendertarget, depth buffer and stencil buffer.
-    void Clear(ClearFlags flags, const Color& color = Color(0.0f, 0.0f, 0.0f, 0.0f), float depth = 1.0f, unsigned stencil = 0);
+    void Clear(ClearModeFlags flags, const Color& color = Color(0.0f, 0.0f, 0.0f, 0.0f), float depth = 1.0f, unsigned stencil = 0);
     /// Resolve multisampled backbuffer to a texture rendertarget. The texture's size should match the viewport size.
     bool ResolveToTexture(Texture2D* destination, const IntRect& viewport);
     /// Resolve a multisampled texture on itself.

+ 2 - 2
Source/Urho3D/Graphics/GraphicsDefs.h

@@ -439,13 +439,13 @@ enum MaterialQuality : unsigned
     QUALITY_MAX = 15,
 };
 
-enum ClearFlag : unsigned
+enum ClearMode : unsigned
 {
     CLEAR_COLOR = 0x1,
     CLEAR_DEPTH = 0x2,
     CLEAR_STENCIL = 0x4,
 };
-URHO3D_FLAGSET(ClearFlag, ClearFlags);
+URHO3D_FLAGSET(ClearMode, ClearModeFlags);
 
 // Legacy vertex element bitmasks.
 enum VertexMask : unsigned

+ 1 - 1
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -659,7 +659,7 @@ void Graphics::EndFrame()
     CleanupScratchBuffers();
 }
 
-void Graphics::Clear(ClearFlags flags, const Color& color, float depth, unsigned stencil)
+void Graphics::Clear(ClearModeFlags flags, const Color& color, float depth, unsigned stencil)
 {
     PrepareDraw();
 

+ 1 - 1
Source/Urho3D/Graphics/RenderPath.h

@@ -161,7 +161,7 @@ struct URHO3D_API RenderPathCommand
     /// Depth-stencil output name.
     String depthStencilName_;
     /// Clear flags. Affects clear command only.
-    ClearFlags clearFlags_{};
+    ClearModeFlags clearFlags_{};
     /// Clear color. Affects clear command only.
     Color clearColor_;
     /// Clear depth. Affects clear command only.

+ 1 - 1
Source/Urho3D/LuaScript/pkgs/Graphics/GraphicsDefs.pkg

@@ -237,7 +237,7 @@ enum MaterialQuality
     QUALITY_MAX
 };
 
-enum ClearFlag
+enum ClearMode
 {
     CLEAR_COLOR,
     CLEAR_DEPTH,

+ 1 - 1
Source/Urho3D/LuaScript/pkgs/Graphics/RenderPath.pkg

@@ -140,7 +140,7 @@ static int tolua_set_RenderPathCommand_clearFlags(lua_State* tolua_S)
  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
  tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
 #endif
-  self->clearFlags_ = ClearFlags((unsigned)  tolua_tonumber(tolua_S,2,0))
+  self->clearFlags_ = ClearModeFlags((unsigned)  tolua_tonumber(tolua_S,2,0))
 ;
  return 0;
 }

+ 3 - 3
Source/Urho3D/LuaScript/pkgs/UI/UIElement.pkg

@@ -123,7 +123,7 @@ class UIElement : public Animatable
     void SetSelected(bool enable);
     void SetVisible(bool enable);
     void SetFocusMode(FocusMode mode);
-    void SetDragDropMode(unsigned mode);
+    void SetDragDropMode(DragAndDropMode mode);
 
     bool SetStyle(const String styleName, XMLFile* file = 0);
 
@@ -207,7 +207,7 @@ class UIElement : public Animatable
     bool IsInternal() const;
     bool HasColorGradient() const;
     FocusMode GetFocusMode() const;
-    unsigned GetDragDropMode() const;
+    DragAndDropMode GetDragDropMode() const;
     const String GetAppliedStyle() const;
     XMLFile* GetDefaultStyle(bool recursiveUp = true) const;
     LayoutMode GetLayoutMode() const;
@@ -295,7 +295,7 @@ class UIElement : public Animatable
     tolua_property__is_set bool internal;
     tolua_readonly tolua_property__has_set bool colorGradient;
     tolua_property__get_set FocusMode focusMode;
-    tolua_property__get_set unsigned dragDropMode;
+    tolua_property__get_set DragAndDropMode dragDropMode;
     tolua_property__get_set String style;
     tolua_property__get_set XMLFile* defaultStyle;
     tolua_property__get_set LayoutMode layoutMode;