Explorar el Código

Moved definitions of the inbuild shader hashes to a separate file.
Removed debug print from Input.

Lasse Öörni hace 14 años
padre
commit
7addf89464
Se han modificado 3 ficheros con 96 adiciones y 35 borrados
  1. 62 0
      Engine/Graphics/GraphicsDefs.cpp
  2. 34 34
      Engine/Graphics/GraphicsDefs.h
  3. 0 1
      Engine/Input/Input.cpp

+ 62 - 0
Engine/Graphics/GraphicsDefs.cpp

@@ -0,0 +1,62 @@
+//
+// Urho3D Engine
+// Copyright (c) 2008-2011 Lasse Öörni
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#include "Precompiled.h"
+#include "StringHash.h"
+
+#include "DebugNew.h"
+
+StringHash VSP_CAMERAPOS("CameraPos");
+StringHash VSP_CAMERAROT("CameraRot");
+StringHash VSP_DEPTHMODE("DepthMode");
+StringHash VSP_ELAPSEDTIME("ElapsedTime");
+StringHash VSP_FRUSTUMSIZE("FrustumSize");
+StringHash VSP_GBUFFEROFFSETS("GBufferOffsets");
+StringHash VSP_MODEL("Model");
+StringHash VSP_SHADOWPROJ("ShadowProj");
+StringHash VSP_SPOTPROJ("SpotProj");
+StringHash VSP_VIEWPROJ("ViewProj");
+StringHash VSP_UOFFSET("UOffset");
+StringHash VSP_VOFFSET("VOffset");
+StringHash VSP_VIEWRIGHTVECTOR("ViewRightVector");
+StringHash VSP_VIEWUPVECTOR("ViewUpVector");
+StringHash VSP_SKINMATRICES("SkinMatrices");
+StringHash PSP_AMBIENTCOLOR("AmbientColor");
+StringHash PSP_DEPTHRECONSTRUCT("DepthReconstruct");
+StringHash PSP_EDGEFILTERPARAMS("EdgeFilterParams");
+StringHash PSP_ELAPSEDTIME("ElapsedTimePS");
+StringHash PSP_FOGCOLOR("FogColor");
+StringHash PSP_FOGPARAMS("FogParams");
+StringHash PSP_LIGHTATTEN("LightAtten");
+StringHash PSP_LIGHTCOLOR("LightColor");
+StringHash PSP_LIGHTDIR("LightDir");
+StringHash PSP_LIGHTPOS("LightPos");
+StringHash PSP_LIGHTSPLITS("LightSplits");
+StringHash PSP_LIGHTVECROT("LightVecRot");
+StringHash PSP_MATDIFFCOLOR("MatDiffColor");
+StringHash PSP_MATEMISSIVECOLOR("MatEmissiveColor");
+StringHash PSP_MATSPECPROPERTIES("MatSpecProperties");
+StringHash PSP_SAMPLEOFFSETS("SampleOffsets");
+StringHash PSP_SHADOWINTENSITY("ShadowIntensity");
+StringHash PSP_SHADOWPROJ("ShadowProjPS");
+StringHash PSP_SPOTPROJ("SpotProjPS");

+ 34 - 34
Engine/Graphics/GraphicsDefs.h

@@ -201,40 +201,40 @@ enum ShaderType
 };
 
 // Inbuilt shader parameters
-static const StringHash VSP_CAMERAPOS("CameraPos");
-static const StringHash VSP_CAMERAROT("CameraRot");
-static const StringHash VSP_DEPTHMODE("DepthMode");
-static const StringHash VSP_ELAPSEDTIME("ElapsedTime");
-static const StringHash VSP_FRUSTUMSIZE("FrustumSize");
-static const StringHash VSP_GBUFFEROFFSETS("GBufferOffsets");
-static const StringHash VSP_MODEL("Model");
-static const StringHash VSP_SHADOWPROJ("ShadowProj");
-static const StringHash VSP_SPOTPROJ("SpotProj");
-static const StringHash VSP_VIEWPROJ("ViewProj");
-static const StringHash VSP_UOFFSET("UOffset");
-static const StringHash VSP_VOFFSET("VOffset");
-static const StringHash VSP_VIEWRIGHTVECTOR("ViewRightVector");
-static const StringHash VSP_VIEWUPVECTOR("ViewUpVector");
-static const StringHash VSP_SKINMATRICES("SkinMatrices");
-static const StringHash PSP_AMBIENTCOLOR("AmbientColor");
-static const StringHash PSP_DEPTHRECONSTRUCT("DepthReconstruct");
-static const StringHash PSP_EDGEFILTERPARAMS("EdgeFilterParams");
-static const StringHash PSP_ELAPSEDTIME("ElapsedTimePS");
-static const StringHash PSP_FOGCOLOR("FogColor");
-static const StringHash PSP_FOGPARAMS("FogParams");
-static const StringHash PSP_LIGHTATTEN("LightAtten");
-static const StringHash PSP_LIGHTCOLOR("LightColor");
-static const StringHash PSP_LIGHTDIR("LightDir");
-static const StringHash PSP_LIGHTPOS("LightPos");
-static const StringHash PSP_LIGHTSPLITS("LightSplits");
-static const StringHash PSP_LIGHTVECROT("LightVecRot");
-static const StringHash PSP_MATDIFFCOLOR("MatDiffColor");
-static const StringHash PSP_MATEMISSIVECOLOR("MatEmissiveColor");
-static const StringHash PSP_MATSPECPROPERTIES("MatSpecProperties");
-static const StringHash PSP_SAMPLEOFFSETS("SampleOffsets");
-static const StringHash PSP_SHADOWINTENSITY("ShadowIntensity");
-static const StringHash PSP_SHADOWPROJ("ShadowProjPS");
-static const StringHash PSP_SPOTPROJ("SpotProjPS");
+extern StringHash VSP_CAMERAPOS;
+extern StringHash VSP_CAMERAROT;
+extern StringHash VSP_DEPTHMODE;
+extern StringHash VSP_ELAPSEDTIME;
+extern StringHash VSP_FRUSTUMSIZE;
+extern StringHash VSP_GBUFFEROFFSETS;
+extern StringHash VSP_MODEL;
+extern StringHash VSP_SHADOWPROJ;
+extern StringHash VSP_SPOTPROJ;
+extern StringHash VSP_VIEWPROJ;
+extern StringHash VSP_UOFFSET;
+extern StringHash VSP_VOFFSET;
+extern StringHash VSP_VIEWRIGHTVECTOR;
+extern StringHash VSP_VIEWUPVECTOR;
+extern StringHash VSP_SKINMATRICES;
+extern StringHash PSP_AMBIENTCOLOR;
+extern StringHash PSP_DEPTHRECONSTRUCT;
+extern StringHash PSP_EDGEFILTERPARAMS;
+extern StringHash PSP_ELAPSEDTIME;
+extern StringHash PSP_FOGCOLOR;
+extern StringHash PSP_FOGPARAMS;
+extern StringHash PSP_LIGHTATTEN;
+extern StringHash PSP_LIGHTCOLOR;
+extern StringHash PSP_LIGHTDIR;
+extern StringHash PSP_LIGHTPOS;
+extern StringHash PSP_LIGHTSPLITS;
+extern StringHash PSP_LIGHTVECROT;
+extern StringHash PSP_MATDIFFCOLOR;
+extern StringHash PSP_MATEMISSIVECOLOR;
+extern StringHash PSP_MATSPECPROPERTIES;
+extern StringHash PSP_SAMPLEOFFSETS;
+extern StringHash PSP_SHADOWINTENSITY;
+extern StringHash PSP_SHADOWPROJ;
+extern StringHash PSP_SPOTPROJ;
 
 /// Texture units
 enum TextureUnit

+ 0 - 1
Engine/Input/Input.cpp

@@ -391,7 +391,6 @@ void Input::SetKey(int key, bool newState)
     
     if (newState)
     {
-        LOGINFO("Keydown: " + String(key));
         if (!keyDown_.Contains(key))
         {
             keyDown_.Insert(key);