Quellcode durchsuchen

Add script bindings for the new texture read-only properties.

Lasse Öörni vor 9 Jahren
Ursprung
Commit
43535f4087

+ 3 - 0
Source/Urho3D/AngelScript/APITemplates.h

@@ -902,6 +902,9 @@ template <class T> void RegisterTexture(asIScriptEngine* engine, const char* cla
     engine->RegisterObjectMethod(className, "const Color& get_borderColor() const", asMETHOD(T, GetBorderColor), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_sRGB(bool)", asMETHOD(T, SetSRGB), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "bool get_sRGB() const", asMETHOD(T, GetSRGB), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "int get_multiSample() const", asMETHOD(T, GetMultiSample), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "bool get_autoResolve() const", asMETHOD(T, GetAutoResolve), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "bool get_resolveDirty() const", asMETHOD(T, IsResolveDirty), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_backupTexture(Texture@+)", asMETHOD(T, SetBackupTexture), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "Texture@+ get_backupTexture() const", asMETHOD(T, GetBackupTexture), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_mipsToSkip(int, int)", asMETHOD(T, SetMipsToSkip), asCALL_THISCALL);

+ 3 - 3
Source/Urho3D/Graphics/Texture.h

@@ -99,9 +99,6 @@ public:
     /// Return whether is using sRGB sampling and writing.
     bool GetSRGB() const { return sRGB_; }
 
-    /// Return backup texture.
-    Texture* GetBackupTexture() const { return backupTexture_; }
-
     /// Return texture multisampling level (1 = no multisampling).
     int GetMultiSample() const { return multiSample_; }
 
@@ -110,6 +107,9 @@ public:
 
     /// Return whether multisampled texture needs resolve.
     bool IsResolveDirty() const { return resolveDirty_; }
+    
+    /// Return backup texture.
+    Texture* GetBackupTexture() const { return backupTexture_; }
 
     /// Return mip levels to skip on a quality setting when loading.
     int GetMipsToSkip(int quality) const;

+ 6 - 0
Source/Urho3D/LuaScript/pkgs/Graphics/Texture.pkg

@@ -21,6 +21,9 @@ class Texture : public Resource
     unsigned GetAnisotropy() const;
     const Color& GetBorderColor() const;
     bool GetSRGB() const;
+    int GetMultiSample() const;
+	bool GetAutoResolve() const;
+	bool IsResolveDirty() const;
     Texture* GetBackupTexture() const;
     int GetMipsToSkip(int quality) const;
     int GetLevelWidth(unsigned level) const;
@@ -40,6 +43,9 @@ class Texture : public Resource
     tolua_property__get_set unsigned anisotropy;
     tolua_property__get_set Color& borderColor;
     tolua_property__get_set bool sRGB;
+    tolua_readonly tolua_property__get_set int multiSample;
+    tolua_readonly tolua_property__get_set bool autoResolve;
+    tolua_readonly tolua_property__is_set bool resolveDirty;
     tolua_property__get_set Texture* backupTexture;
     tolua_readonly tolua_property__get_set TextureUsage usage;
 };