Przeglądaj źródła

Fixed Light attribute names.
Fixed GLFW mouse wheel input.

Lasse Öörni 14 lat temu
rodzic
commit
f456812466
3 zmienionych plików z 4 dodań i 9 usunięć
  1. 3 3
      Engine/Graphics/Light.cpp
  2. 1 4
      Engine/Input/Input.cpp
  3. 0 2
      Engine/Input/Input.h

+ 3 - 3
Engine/Graphics/Light.cpp

@@ -122,11 +122,11 @@ void Light::RegisterObject(Context* context)
     ATTRIBUTE(Light, VAR_FLOAT, "CSM Split 3 End", shadowCascade_.splits_[2], M_LARGE_VALUE, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_FLOAT, "CSM Split 4 End", shadowCascade_.splits_[3], M_LARGE_VALUE, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_FLOAT, "CSM Fade Start", shadowCascade_.fadeStart_, M_LARGE_VALUE, AM_DEFAULT);
-    ATTRIBUTE(Light, VAR_BOOL, "Focus Shadow Map", shadowFocus_.focus_, true, AM_DEFAULT);
-    ATTRIBUTE(Light, VAR_BOOL, "Allow Non-uniform", shadowFocus_.nonUniform_, true, AM_DEFAULT);
-    ATTRIBUTE(Light, VAR_BOOL, "Auto-Size Shadow MAp", shadowFocus_.autoSize_, true, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_FLOAT, "View Size Quantize", shadowFocus_.quantize_, DEFAULT_SHADOWQUANTIZE, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_FLOAT, "View Size Minimum", shadowFocus_.minView_, DEFAULT_SHADOWMINVIEW, AM_DEFAULT);
+    ATTRIBUTE(Light, VAR_BOOL, "Focus To Scene", shadowFocus_.focus_, true, AM_DEFAULT);
+    ATTRIBUTE(Light, VAR_BOOL, "Non-uniform View", shadowFocus_.nonUniform_, true, AM_DEFAULT);
+    ATTRIBUTE(Light, VAR_BOOL, "Auto-Reduce Size", shadowFocus_.autoSize_, true, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_INT, "View Mask", viewMask_, DEFAULT_VIEWMASK, AM_DEFAULT);
     ATTRIBUTE(Light, VAR_INT, "Light Mask", lightMask_, DEFAULT_LIGHTMASK, AM_DEFAULT);
 }

+ 1 - 4
Engine/Input/Input.cpp

@@ -295,7 +295,6 @@ void Input::MakeActive()
     #else
     // Get the current mouse position as a base for movement calculations
     lastCursorPosition_ = GetCursorPosition();
-    glfwGetScrollOffset(graphics_->GetWindowHandle(), 0, &lastWheelPosition_);
     #endif
     
     using namespace Activation;
@@ -641,8 +640,7 @@ void MouseScrollCallback(GLFWwindow window, int x, int y)
     if (!instance)
         return;
     
-    instance->SetMouseWheel(y - instance->lastWheelPosition_);
-    instance->lastWheelPosition_ = y;
+    instance->SetMouseWheel(y);
 }
 #endif
 
@@ -688,7 +686,6 @@ void Input::HandleScreenMode(StringHash eventType, VariantMap& eventData)
     glfwSetMouseButtonCallback(&MouseButtonCallback);
     glfwSetScrollCallback(&MouseScrollCallback);
     lastCursorPosition_ = GetCursorPosition();
-    glfwGetScrollOffset(window, 0, &lastWheelPosition_);
     #endif
 }
 

+ 0 - 2
Engine/Input/Input.h

@@ -127,8 +127,6 @@ private:
     unsigned mouseButtonPress_;
     /// Last mouse position for calculating movement.
     IntVector2 lastCursorPosition_;
-    /// Last mouse wheel position for calculating movement.
-    int lastWheelPosition_;
     /// Mouse movement since last frame.
     IntVector2 mouseMove_;
     /// Mouse wheel movement since last frame.