minor fixing
This commit is contained in:
parent
8ec1ba5e74
commit
de3a23b98d
@ -148,7 +148,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>TARGET_SALMON;TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\openal\OpenAL11_windows_sdk;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4503</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
@ -160,7 +160,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>TARGET_SALMON;TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG;NOSOUND</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG;NOSOUND</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\openal\OpenAL11_windows_sdk;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>/wd 4503</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
@ -175,7 +175,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>TARGET_SALMON;TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\openal\OpenAL11_windows_sdk;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4503</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -1,30 +1,15 @@
|
||||
#ifndef ENGINE_H_INCLUDED
|
||||
#define ENGINE_H_INCLUDED
|
||||
|
||||
|
||||
#ifdef TARGET_SALMON
|
||||
#ifdef TARGET_WIN32
|
||||
#define SALMON_WIN32
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_ANDROID
|
||||
#define SALMON_ANDROID
|
||||
#endif
|
||||
#ifdef TARGET_IOS
|
||||
#define SALMON_IOS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SALMON_WIN32
|
||||
#ifdef TARGET_WIN32
|
||||
#include "SalmonEngineWindows.h"
|
||||
#endif
|
||||
|
||||
#ifdef SALMON_ANDROID
|
||||
#ifdef TARGET_ANDROID
|
||||
#include "SalmonEngineAndroid.h"
|
||||
#endif
|
||||
|
||||
#ifdef SALMON_IOS
|
||||
#ifdef TARGET_IOS
|
||||
#include "include/SalmonEngineIos.h"
|
||||
#endif
|
||||
|
||||
|
@ -27,30 +27,24 @@ protected:
|
||||
|
||||
float GlobalShadowAreaHalfSize;
|
||||
|
||||
vec3 CamPos; //Do not change - call CalcCamPos instead
|
||||
|
||||
virtual void DrawQuad(const T2DQuad& quad) = 0;
|
||||
public:
|
||||
|
||||
TCamera CameraMover;
|
||||
|
||||
//vec3 CamShift;
|
||||
vec3 CamPos; //Do not change - call CalcCamPosVec instead
|
||||
//vec3 CamVec; //Do not change - call CalcCamPosVec instead
|
||||
|
||||
vec3 GetCamShift()
|
||||
{
|
||||
return boost::apply_visitor(TGetCamShiftVisitor(), CameraMover);
|
||||
}
|
||||
|
||||
vec3 GetCamVec()
|
||||
{
|
||||
return boost::apply_visitor(TGetCamVecVisitor(), CameraMover);
|
||||
}
|
||||
TCamera Camera;
|
||||
|
||||
TSalmonRendererInterface();
|
||||
|
||||
virtual void InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
|
||||
|
||||
void CalcCamPosVec();
|
||||
vec3 GetCamShift();
|
||||
|
||||
vec3 GetCamVec();
|
||||
|
||||
vec3 GetCamPos();
|
||||
|
||||
void CalcCamPos();
|
||||
|
||||
virtual void SetUniforms();
|
||||
|
||||
@ -75,8 +69,6 @@ public:
|
||||
void SetGlNegZView();
|
||||
|
||||
|
||||
vec3 GetCamPos();
|
||||
|
||||
virtual void SwitchToScreen();
|
||||
virtual void SwitchToFrameBuffer(const std::string& frameName);
|
||||
void SwitchToCubemapBuffer(const std::string& frameName,cardinal cubeSide);
|
||||
|
@ -36,7 +36,7 @@ void TPanoramicCamera::MoveAlpha(float dAlpha)
|
||||
}
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ void TPanoramicCamera::MovePhi(float dPhi)
|
||||
}
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ void TPanoramicCamera::MoveDist(float dDist)
|
||||
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ void TPanoramicCamera::SetAlpha(float alpha)
|
||||
}
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
}
|
||||
|
||||
void TPanoramicCamera::MoveForward()
|
||||
@ -113,7 +113,7 @@ void TPanoramicCamera::MoveForward()
|
||||
CamShift = CamShift + mov;
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
}
|
||||
|
||||
void TPanoramicCamera::MoveBackward()
|
||||
@ -129,7 +129,7 @@ void TPanoramicCamera::MoveBackward()
|
||||
|
||||
CamShift = CamShift + mov;
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ void TPanoramicCamera::MoveLeft()
|
||||
CamShift = CamShift + mov;
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ void TPanoramicCamera::MoveRight()
|
||||
CamShift = CamShift + mov;
|
||||
|
||||
//Possibly refactor???
|
||||
Renderer->CalcCamPosVec();
|
||||
Renderer->CalcCamPos();
|
||||
|
||||
}
|
||||
|
||||
|
@ -97,13 +97,27 @@ void TSalmonRendererInterface::InitOpenGL(int screenWidth, int screenHeight, flo
|
||||
|
||||
}
|
||||
|
||||
vec3 TSalmonRendererInterface::GetCamShift()
|
||||
{
|
||||
return boost::apply_visitor(TGetCamShiftVisitor(), Camera);
|
||||
}
|
||||
|
||||
void TSalmonRendererInterface::CalcCamPosVec()
|
||||
vec3 TSalmonRendererInterface::GetCamVec()
|
||||
{
|
||||
return boost::apply_visitor(TGetCamVecVisitor(), Camera);
|
||||
}
|
||||
|
||||
vec3 TSalmonRendererInterface::GetCamPos()
|
||||
{
|
||||
return CamPos;
|
||||
}
|
||||
|
||||
void TSalmonRendererInterface::CalcCamPos()
|
||||
{
|
||||
|
||||
TCalcCamVecVisitor v;
|
||||
|
||||
boost::apply_visitor(v, CameraMover);
|
||||
boost::apply_visitor(v, Camera);
|
||||
|
||||
CamPos = GetCamShift() - GetCamVec();
|
||||
|
||||
@ -181,7 +195,7 @@ void TSalmonRendererInterface::PushPerspectiveProjectionMatrix(float angle, floa
|
||||
void TSalmonRendererInterface::SetGLCamView()
|
||||
{
|
||||
TSetCameraViewVisitor v;
|
||||
boost::apply_visitor(v, CameraMover);
|
||||
boost::apply_visitor(v, Camera);
|
||||
|
||||
CamModelViewMatrix = ModelviewMatrixStack.top();
|
||||
CamInversedModelViewMatrix = InverseModelViewMatrix(CamModelViewMatrix);
|
||||
@ -294,12 +308,6 @@ void TSalmonRendererInterface::SetGlNegZView()
|
||||
}
|
||||
|
||||
|
||||
vec3 TSalmonRendererInterface::GetCamPos()
|
||||
{
|
||||
return CamPos;
|
||||
}
|
||||
|
||||
|
||||
void TSalmonRendererInterface::SwitchToScreen()
|
||||
{
|
||||
|
||||
|
@ -173,7 +173,7 @@ LONG WINAPI WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
BeginPaint(hWnd, &ps);
|
||||
EndPaint(hWnd, &ps);
|
||||
|
||||
ProcessTickCount();
|
||||
//ProcessTickCount();
|
||||
break;
|
||||
case WM_SIZE:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user