Fixed release compile and basic anim
This commit is contained in:
parent
d0f36302cf
commit
a3ba67e3c2
|
@ -153,7 +153,9 @@
|
|||
<ClCompile Include="Resource\OResource.cpp" />
|
||||
<ClCompile Include="Resource\ResourceManager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Thread\OysterMutex.cpp" />
|
||||
<ClCompile Include="Thread\OysterThread_Impl.cpp" />
|
||||
|
@ -173,7 +175,9 @@
|
|||
<ClInclude Include="Resource\OResource.h" />
|
||||
<ClInclude Include="Resource\ResourceManager.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ThreadSafeQueue.h" />
|
||||
<ClInclude Include="Thread\IThreadObject.h" />
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include "Dx11Includes.h"
|
||||
#include <sstream>
|
||||
#include "OysterMath.h"
|
||||
#include "../Misc/Resource/ResourceManager.h"
|
||||
//#include "../Misc/Resource/ResourceManager.h"
|
||||
#include "../../Misc/Resource/ResourceManager.h"
|
||||
//#include <vld.h>
|
||||
|
||||
namespace Oyster
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Oyster
|
|||
Math::Float4x4 View;
|
||||
Math::Float4x4 Projection;
|
||||
std::vector<Definitions::Pointlight*> Lights;
|
||||
float dt=0;
|
||||
float deltaTime;
|
||||
}
|
||||
|
||||
API::State API::Init(HWND Window, bool MSAA_Quality, bool Fullscreen, Math::Float2 resulotion)
|
||||
|
@ -61,12 +61,12 @@ namespace Oyster
|
|||
|
||||
void API::RenderScene(Model::Model models[], int count)
|
||||
{
|
||||
Render::DefaultRenderer::RenderScene(models,count, View, Projection);
|
||||
Render::DefaultRenderer::RenderScene(models,count, View, Projection, deltaTime);
|
||||
}
|
||||
|
||||
void API::RenderModel(Model::Model& m)
|
||||
void API::RenderModel(Model::Model* m)
|
||||
{
|
||||
Render::DefaultRenderer::RenderScene(&m,1, View, Projection);
|
||||
Render::DefaultRenderer::RenderScene(m,1, View, Projection, deltaTime);
|
||||
}
|
||||
|
||||
void API::EndFrame()
|
||||
|
@ -87,7 +87,7 @@ namespace Oyster
|
|||
Model::Model* m = new Model::Model();
|
||||
m->WorldMatrix = Oyster::Math::Float4x4::identity;
|
||||
m->Visible = true;
|
||||
m->Animation.data.AnimationPlaying = NULL;
|
||||
m->Animation.AnimationPlaying = NULL;
|
||||
m->info = (Model::ModelInfo*)Core::loader.LoadResource((Core::modelPath + filename).c_str(),Oyster::Graphics::Loading::LoadDAN, Oyster::Graphics::Loading::UnloadDAN);
|
||||
|
||||
Model::ModelInfo* mi = (Model::ModelInfo*)m->info;
|
||||
|
@ -177,10 +177,15 @@ namespace Oyster
|
|||
|
||||
float API::PlayAnimation(Model::Model* m, std::wstring name,bool looping)
|
||||
{
|
||||
m->Animation.data.AnimationPlaying = &(*m->info->Animations.find(name)).second;
|
||||
m->Animation.data.AnimationTime=0;
|
||||
m->Animation.data.LoopAnimation = looping;
|
||||
return m->Animation.data.AnimationPlaying->duration;
|
||||
m->Animation.AnimationPlaying = &(*m->info->Animations.find(name)).second;
|
||||
m->Animation.AnimationTime=0;
|
||||
m->Animation.LoopAnimation = looping;
|
||||
return m->Animation.AnimationPlaying->duration;
|
||||
}
|
||||
|
||||
void API::Update(float dt)
|
||||
{
|
||||
deltaTime = dt;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,7 +51,7 @@ namespace Oyster
|
|||
//! @brief Renders a list of models
|
||||
static void RenderScene(Oyster::Graphics::Model::Model models[], int count);
|
||||
//! @brief Renders a single model
|
||||
static void RenderModel(Oyster::Graphics::Model::Model& model);
|
||||
static void RenderModel(Oyster::Graphics::Model::Model* model);
|
||||
|
||||
//! @brief Configures Renderer to process 2D graphics, data will be passed in to EndFrame()
|
||||
static void StartGuiRender();
|
||||
|
|
|
@ -19,17 +19,12 @@ namespace Oyster
|
|||
float AnimationTime;
|
||||
bool LoopAnimation;
|
||||
};
|
||||
struct AnimationPlayer
|
||||
{
|
||||
AnimationData data;
|
||||
ModelInfo* info;
|
||||
};
|
||||
struct Model
|
||||
{
|
||||
ModelInfo* info;
|
||||
Oyster::Math::Float4x4 WorldMatrix;
|
||||
bool Visible;
|
||||
AnimationPlayer Animation;
|
||||
AnimationData Animation;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||
<IncludePath>C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
|
||||
|
@ -246,21 +247,21 @@
|
|||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\Passes\Blur\BlurVert.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="Shader\Passes\Post\PostPass.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace Oyster
|
|||
Resources::Post::Data.Unmap();
|
||||
}
|
||||
|
||||
void DefaultRenderer::RenderScene(Model::Model* models, int count, Math::Matrix View, Math::Matrix Projection)
|
||||
void DefaultRenderer::RenderScene(Model::Model* models, int count, Math::Matrix View, Math::Matrix Projection, float deltaTime)
|
||||
{
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
|
@ -64,8 +64,9 @@ namespace Oyster
|
|||
Model::ModelInfo* info = models[i].info;
|
||||
|
||||
Definitions::AnimationData am; //final
|
||||
if(info->Animated && models[i].Animation.data.AnimationPlaying != NULL)
|
||||
if(info->Animated && models[i].Animation.AnimationPlaying != NULL)
|
||||
{
|
||||
models[i].Animation.AnimationTime += deltaTime;
|
||||
cube->WorldMatrix = Math::Matrix::identity;
|
||||
////store inverse absolut transform
|
||||
Math::Matrix SkinTransform[100];
|
||||
|
@ -91,11 +92,11 @@ namespace Oyster
|
|||
cube2->WorldMatrix.v[3] = info->bones[b].Absolute.v[3];
|
||||
}
|
||||
int b = 0;
|
||||
Model::Animation A = *models[i].Animation.data.AnimationPlaying;
|
||||
while(models[i].Animation.data.AnimationTime>A.duration)
|
||||
models[i].Animation.data.AnimationTime -= (float)A.duration;
|
||||
Model::Animation A = *models[i].Animation.AnimationPlaying;
|
||||
while(models[i].Animation.AnimationTime>A.duration)
|
||||
models[i].Animation.AnimationTime -= (float)A.duration;
|
||||
|
||||
float position = models[i].Animation.data.AnimationTime;
|
||||
float position = models[i].Animation.AnimationTime;
|
||||
for(int b = 0; b < A.Bones;++b)
|
||||
{
|
||||
//find current frame
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Oyster
|
|||
{
|
||||
public:
|
||||
static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights);
|
||||
static void RenderScene(Model::Model* models, int count, Math::Matrix View, Math::Matrix Projection);
|
||||
static void RenderScene(Model::Model* models, int count, Math::Matrix View, Math::Matrix Projection, float DeltaTime = 0);
|
||||
static void EndFrame();
|
||||
|
||||
static Model::Model* cube;
|
||||
|
|
|
@ -168,13 +168,11 @@ HRESULT InitDirect3D()
|
|||
Oyster::Graphics::API::SetOptions(o);
|
||||
|
||||
m = Oyster::Graphics::API::CreateModel(L"crate_colonists.dan");
|
||||
m2 = Oyster::Graphics::API::CreateModel(L"T_reskinned.dan");
|
||||
m2 = Oyster::Graphics::API::CreateModel(L"char_bindpose.dan");
|
||||
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
|
||||
Oyster::Graphics::API::PlayAnimation(m2, L"Bend",true);
|
||||
//m3 = Oyster::Graphics::API::CreateModel(L"box_2.dan");
|
||||
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null);
|
||||
|
||||
t = Oyster::Graphics::API::CreateTexture(L"white.png");
|
||||
t = Oyster::Graphics::API::CreateTexture(L"structure_corp_mdg.png");
|
||||
|
||||
P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1280.0f/720.0f,.1f,10000);
|
||||
Oyster::Graphics::API::SetProjection(P);
|
||||
|
@ -198,15 +196,10 @@ float angle = 0;
|
|||
HRESULT Update(float deltaTime)
|
||||
{
|
||||
angle += Oyster::Math::pi/16 * deltaTime;
|
||||
//m->WorldMatrix = Oyster::Math3D::RotationMatrix_AxisY(angle);
|
||||
//m->WorldMatrix = m->WorldMatrix * Oyster::Math3D::RotationMatrix_AxisX(-Oyster::Math::pi/2);
|
||||
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0)*-Oyster::Math::pi/2,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
|
||||
Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity;
|
||||
//ma *= 50;
|
||||
//ma.m44 = 1;
|
||||
//m2->WorldMatrix = m2->WorldMatrix * ma;
|
||||
m2->Animation.data.AnimationTime += deltaTime;// * 0.5f;
|
||||
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0)*-0,Oyster::Math::Float3(3,4,-1*angle),Oyster::Math::Float3::null);
|
||||
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0)*-angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
|
||||
//Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity;
|
||||
Oyster::Graphics::API::Update(deltaTime);
|
||||
//m2->Animation.data.AnimationTime += deltaTime;// * 0.5f;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -215,10 +208,9 @@ HRESULT Render(float deltaTime)
|
|||
Oyster::Graphics::API::SetView(V);
|
||||
Oyster::Graphics::API::NewFrame();
|
||||
|
||||
Oyster::Graphics::API::RenderModel(*m);
|
||||
Oyster::Graphics::API::RenderModel(*m2);
|
||||
//Oyster::Graphics::API::RenderModel(*m3);
|
||||
//Oyster::Graphics::API::StartGuiRender();
|
||||
Oyster::Graphics::API::RenderModel(m);
|
||||
Oyster::Graphics::API::RenderModel(m2);
|
||||
Oyster::Graphics::API::StartGuiRender();
|
||||
Oyster::Graphics::API::RenderGuiElement(t,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(0.2f,0.2f));
|
||||
Oyster::Graphics::API::EndFrame();
|
||||
|
||||
|
|
Loading…
Reference in New Issue