From e0f3031187eeca214524f12b84faf23b13d77be4 Mon Sep 17 00:00:00 2001 From: lanariel Date: Mon, 10 Feb 2014 16:08:03 +0100 Subject: [PATCH] Pointlight no pointer Model render pointer --- .../Game/DanBiasGame/GameClientState/C_obj/C_DynamicObj.cpp | 2 +- Code/Game/DanBiasGame/GameClientState/C_obj/C_Player.cpp | 2 +- Code/Game/DanBiasGame/GameClientState/C_obj/C_StaticObj.cpp | 2 +- Code/Game/DanBiasGame/GameClientState/C_obj/C_UIobject.cpp | 2 +- Code/OysterGraphics/DllInterfaces/GFXAPI.cpp | 6 +++--- Code/OysterGraphics/DllInterfaces/GFXAPI.h | 2 +- Code/OysterGraphics/Render/DefaultRenderer.cpp | 4 ++-- Code/OysterGraphics/Render/DefaultRenderer.h | 2 +- Code/Tester/MainTest.cpp | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Code/Game/DanBiasGame/GameClientState/C_obj/C_DynamicObj.cpp b/Code/Game/DanBiasGame/GameClientState/C_obj/C_DynamicObj.cpp index 3df74e40..b368b7c4 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_obj/C_DynamicObj.cpp +++ b/Code/Game/DanBiasGame/GameClientState/C_obj/C_DynamicObj.cpp @@ -35,7 +35,7 @@ void C_DynamicObj::setPos(Oyster::Math::Float4x4 world) void C_DynamicObj::Render() { - Oyster::Graphics::API::RenderModel(*(privData->model)); + Oyster::Graphics::API::RenderModel(privData->model); } void C_DynamicObj::Release() { diff --git a/Code/Game/DanBiasGame/GameClientState/C_obj/C_Player.cpp b/Code/Game/DanBiasGame/GameClientState/C_obj/C_Player.cpp index 49c450b5..1ab43024 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_obj/C_Player.cpp +++ b/Code/Game/DanBiasGame/GameClientState/C_obj/C_Player.cpp @@ -39,7 +39,7 @@ void C_Player::setPos(Oyster::Math::Float4x4 world) void C_Player::Render() { - Oyster::Graphics::API::RenderModel(*(privData->model)); + Oyster::Graphics::API::RenderModel(privData->model); } void C_Player::Release() { diff --git a/Code/Game/DanBiasGame/GameClientState/C_obj/C_StaticObj.cpp b/Code/Game/DanBiasGame/GameClientState/C_obj/C_StaticObj.cpp index 177b032b..5e96c239 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_obj/C_StaticObj.cpp +++ b/Code/Game/DanBiasGame/GameClientState/C_obj/C_StaticObj.cpp @@ -38,7 +38,7 @@ void C_StaticObj::setPos(Oyster::Math::Float4x4 world) void C_StaticObj::Render() { - Oyster::Graphics::API::RenderModel(*(privData->model)); + Oyster::Graphics::API::RenderModel(privData->model); } void C_StaticObj::Release() { diff --git a/Code/Game/DanBiasGame/GameClientState/C_obj/C_UIobject.cpp b/Code/Game/DanBiasGame/GameClientState/C_obj/C_UIobject.cpp index fa5dff04..8df19dc1 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_obj/C_UIobject.cpp +++ b/Code/Game/DanBiasGame/GameClientState/C_obj/C_UIobject.cpp @@ -34,7 +34,7 @@ void C_UIobject::setPos(Oyster::Math::Float4x4 world) void C_UIobject::Render() { - Oyster::Graphics::API::RenderModel(*(privData->model)); + Oyster::Graphics::API::RenderModel(privData->model); } void C_UIobject::Release() { diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index 04795f31..3722f9f8 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -17,7 +17,7 @@ namespace Oyster { Math::Float4x4 View; Math::Float4x4 Projection; - std::vector Lights; + std::vector Lights; float deltaTime; } @@ -55,7 +55,7 @@ namespace Oyster } else { - Render::DefaultRenderer::NewFrame(View, Projection, NULL, 0); + Render::DefaultRenderer::NewFrame(View, Projection, Definitions::Pointlight(), 0); } } @@ -128,7 +128,7 @@ namespace Oyster SAFE_RELEASE(Core::device); } - void API::AddLight(Definitions::Pointlight *light) + void API::AddLight(Definitions::Pointlight light) { Lights.push_back(light); } diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.h b/Code/OysterGraphics/DllInterfaces/GFXAPI.h index 1c489dc8..cb9e26cc 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.h +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.h @@ -71,7 +71,7 @@ namespace Oyster static void DeleteTexture(Texture); //! @brief adds a light to the scene - static void AddLight(Definitions::Pointlight* light); + static void AddLight(Definitions::Pointlight light); //! @brief removes all lights from the scene static void ClearLights(); diff --git a/Code/OysterGraphics/Render/DefaultRenderer.cpp b/Code/OysterGraphics/Render/DefaultRenderer.cpp index 754197e8..c3b91192 100644 --- a/Code/OysterGraphics/Render/DefaultRenderer.cpp +++ b/Code/OysterGraphics/Render/DefaultRenderer.cpp @@ -16,7 +16,7 @@ namespace Oyster Model::Model* DefaultRenderer::cube = NULL; Model::Model* DefaultRenderer::cube2 = NULL; - void DefaultRenderer::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights) + void DefaultRenderer::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight Lights, int numLights) { Preparations::Basic::ClearBackBuffer(Oyster::Math::Float4(1,0,0,1)); Preparations::Basic::ClearRTV(Resources::GBufferRTV,Resources::GBufferSize,Math::Float4(0,0,0,0)); @@ -37,7 +37,7 @@ namespace Oyster Resources::Light::LightConstantsData.Unmap(); data = Resources::Light::PointLightsData.Map(); - memcpy(data, Lights, sizeof(Definitions::Pointlight) * numLights); + memcpy(data, &Lights, sizeof(Definitions::Pointlight) * numLights); Resources::Light::PointLightsData.Unmap(); Definitions::PostData pd; diff --git a/Code/OysterGraphics/Render/DefaultRenderer.h b/Code/OysterGraphics/Render/DefaultRenderer.h index 54075a3f..627998fa 100644 --- a/Code/OysterGraphics/Render/DefaultRenderer.h +++ b/Code/OysterGraphics/Render/DefaultRenderer.h @@ -13,7 +13,7 @@ namespace Oyster class DefaultRenderer { public: - static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights); + 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, float DeltaTime = 0); static void EndFrame(); diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index 8810a825..a577f010 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -187,7 +187,7 @@ HRESULT InitDirect3D() pl.Pos = Oyster::Math::Float3(0,-20.0f,0.4f); pl.Radius = 90; - Oyster::Graphics::API::AddLight(&pl); + Oyster::Graphics::API::AddLight(pl); return S_OK;