Преглед изворни кода

Use function pointers directly for preparing AngelScript context.
Use bilinear filtering also in non-hardware shadow map mode for consistency between Direct3D9 & OpenGL.

Lasse Öörni пре 14 година
родитељ
комит
b068022660
3 измењених фајлова са 6 додато и 7 уклоњено
  1. 1 2
      Engine/Graphics/Renderer.cpp
  2. 1 1
      Engine/Script/Script.cpp
  3. 4 4
      Engine/Script/ScriptFile.cpp

+ 1 - 2
Engine/Graphics/Renderer.cpp

@@ -748,7 +748,6 @@ Texture2D* Renderer::GetShadowMap(Light* light, Camera* camera, unsigned viewWid
     unsigned shadowMapFormat = (shadowQuality_ & SHADOWQUALITY_LOW_24BIT) ? graphics_->GetHiresShadowMapFormat() :
     unsigned shadowMapFormat = (shadowQuality_ & SHADOWQUALITY_LOW_24BIT) ? graphics_->GetHiresShadowMapFormat() :
         graphics_->GetShadowMapFormat();
         graphics_->GetShadowMapFormat();
     unsigned dummyColorFormat = graphics_->GetDummyColorFormat();
     unsigned dummyColorFormat = graphics_->GetDummyColorFormat();
-    bool hardwarePCF = graphics_->GetHardwareShadowSupport();
     if (!shadowMapFormat)
     if (!shadowMapFormat)
         return 0;
         return 0;
     
     
@@ -785,7 +784,7 @@ Texture2D* Renderer::GetShadowMap(Light* light, Camera* camera, unsigned viewWid
         }
         }
         else
         else
         {
         {
-            newShadowMap->SetFilterMode(hardwarePCF ? FILTER_BILINEAR : FILTER_NEAREST);
+            newShadowMap->SetFilterMode(FILTER_BILINEAR);
             if (!fallback)
             if (!fallback)
             {
             {
                 // If no dummy color rendertarget for this size exists yet, create one now
                 // If no dummy color rendertarget for this size exists yet, create one now

+ 1 - 1
Engine/Script/Script.cpp

@@ -175,7 +175,7 @@ bool Script::Execute(const String& line)
     if (module->CompileFunction("", wrappedLine.CString(), -1, 0, &function) < 0)
     if (module->CompileFunction("", wrappedLine.CString(), -1, 0, &function) < 0)
         return false;
         return false;
     
     
-    if (immediateContext_->Prepare(function->GetId()) < 0)
+    if (immediateContext_->Prepare(function) < 0)
     {
     {
         function->Release();
         function->Release();
         return false;
         return false;

+ 4 - 4
Engine/Script/ScriptFile.cpp

@@ -177,7 +177,7 @@ bool ScriptFile::Execute(asIScriptFunction* function, const VariantVector& param
         return false;
         return false;
     }
     }
     
     
-    if (context->Prepare(function->GetId()) < 0)
+    if (context->Prepare(function) < 0)
         return false;
         return false;
     
     
     SetParameters(context, function, parameters);
     SetParameters(context, function, parameters);
@@ -221,7 +221,7 @@ bool ScriptFile::Execute(asIScriptObject* object, asIScriptFunction* method, con
         return false;
         return false;
     }
     }
     
     
-    if (context->Prepare(method->GetId()) < 0)
+    if (context->Prepare(method) < 0)
         return false;
         return false;
     
     
     context->SetObject(object);
     context->SetObject(object);
@@ -282,8 +282,8 @@ asIScriptObject* ScriptFile::CreateObject(const String& className)
     
     
     // Get the factory function id from the object type
     // Get the factory function id from the object type
     String factoryName = className + "@ " + className + "()";
     String factoryName = className + "@ " + className + "()";
-    int factoryId = type->GetFactoryIdByDecl(factoryName.CString());
-    if (factoryId < 0 || context->Prepare(factoryId) < 0 || context->Execute() < 0)
+    asIScriptFunction* factory = type->GetFactoryByDecl(factoryName.CString());
+    if (!factory || context->Prepare(factory) < 0 || context->Execute() < 0)
         return 0;
         return 0;
     
     
     asIScriptObject* obj = *(static_cast<asIScriptObject**>(context->GetAddressOfReturnValue()));
     asIScriptObject* obj = *(static_cast<asIScriptObject**>(context->GetAddressOfReturnValue()));