From c3ab23ac9dc02d59180f2f1af5f3aa5b50f9f8d8 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Thu, 9 Aug 2012 22:50:04 +0200 Subject: [PATCH] Graphics stubs - added stubs for functions in CLightning, CParticle and CPyro - cleaned object.h and physics.h headers - created temporary stubs to compile CCamera - other necessary changes to compile successfully --- src/CMakeLists.txt | 2 +- src/common/event.h | 57 +++--- src/graphics/engine/camera.cpp | 81 +++++++-- src/graphics/engine/camera.h | 4 +- src/graphics/engine/cloud.cpp | 8 +- src/graphics/engine/engine.cpp | 129 +++++++++++++- src/graphics/engine/engine.h | 22 ++- src/graphics/engine/lightning.cpp | 68 +++++++- src/graphics/engine/lightning.h | 2 +- src/graphics/engine/particle.cpp | 281 +++++++++++++++++++++++++++++- src/graphics/engine/particle.h | 91 +++++----- src/graphics/engine/pyro.cpp | 158 ++++++++++++++++- src/graphics/engine/pyro.h | 49 +++--- src/graphics/engine/water.cpp | 6 +- src/object/object.h | 220 +++++++++++------------ src/physics/physics.h | 82 ++++----- 16 files changed, 987 insertions(+), 273 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 25a576e4..b998d19c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,7 +67,7 @@ common/iman.cpp # common/restext.cpp common/stringutils.cpp graphics/core/color.cpp -# graphics/engine/camera.cpp # new code but depends on other modules +graphics/engine/camera.cpp graphics/engine/cloud.cpp graphics/engine/engine.cpp graphics/engine/lightman.cpp diff --git a/src/common/event.h b/src/common/event.h index 0d9aa7c9..a82282e4 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -40,9 +40,10 @@ enum EventType EVENT_NULL = 0, //! Event sent on user or system quit request - EVENT_QUIT = 1, + EVENT_QUIT = 1, - //? EVENT_FRAME = 2, + //! Frame update event + EVENT_FRAME = 2, //! Event sent after pressing a mouse button EVENT_MOUSE_BUTTON_DOWN = 3, @@ -669,29 +670,41 @@ struct Event //! If true, the event was produced by system (SDL); else, it has come from user interface bool systemEvent; - //! Additional data for EVENT_KEY_DOWN and EVENT_KEY_UP - KeyEventData key; - //! Additional data for EVENT_MOUSE_BUTTON_DOWN and EVENT_MOUSE_BUTTON_UP - MouseButtonEventData mouseButton; - //! Additional data for EVENT_MOUSE_MOVE - MouseMoveEventData mouseMove; - //! Additional data for EVENT_JOY - JoyAxisEventData joyAxis; - //! Additional data for EVENT_JOY_AXIS - JoyButtonEventData joyButton; - //! Additional data for EVENT_ACTIVE - ActiveEventData active; + union + { + //! Additional data for EVENT_KEY_DOWN and EVENT_KEY_UP + KeyEventData key; + //! Additional data for EVENT_MOUSE_BUTTON_DOWN and EVENT_MOUSE_BUTTON_UP + MouseButtonEventData mouseButton; + //! Additional data for EVENT_MOUSE_MOVE + MouseMoveEventData mouseMove; + //! Additional data for EVENT_JOY + JoyAxisEventData joyAxis; + //! Additional data for EVENT_JOY_AXIS + JoyButtonEventData joyButton; + //! Additional data for EVENT_ACTIVE + ActiveEventData active; + }; - //? long param; // parameter - //? Math::Point pos; // mouse position (0 .. 1) - //? float axeX; // control the X axis (-1 .. 1) - //? float axeY; // control of the Y axis (-1 .. 1) - //? float axeZ; // control the Z axis (-1 .. 1) - //? short keyState; // state of the keyboard (KS_ *) - //? float rTime; // relative time + // TODO: refactor/rewrite + long param; // parameter + Math::Point pos; // mouse position (0 .. 1) + float axeX; // control the X axis (-1 .. 1) + float axeY; // control of the Y axis (-1 .. 1) + float axeZ; // control the Z axis (-1 .. 1) + short keyState; // state of the keyboard (KS_ *) + float rTime; // relative time Event(EventType aType = EVENT_NULL) - : type(aType), systemEvent(false) {} + { + type = aType; + systemEvent = false; + + param = 0; + axeX = axeY = axeZ = 0.0f; + keyState = 0; + rTime = 0.0f; + } }; diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index c7ca5035..2db6398f 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -29,6 +29,66 @@ #include "physics/physics.h" +// TODO temporary stubs for CObject and CPhysics + +void CObject::SetTransparency(float) +{ +} + +CObject* CObject::GetFret() +{ + return nullptr; +} + +CObject* CObject::GetPower() +{ + return nullptr; +} + +CObject* CObject::GetTruck() +{ + return nullptr; +} + +ObjectType CObject::GetType() +{ + return OBJECT_NULL; +} + +void CObject::SetGunGoalH(float) +{ +} + +void CObject::GetGlobalSphere(Math::Vector &pos, float &radius) +{ +} + +float CObject::GetAngleY(int) +{ + return 0.0f; +} + +Math::Vector CObject::GetPosition(int) +{ + return Math::Vector(); +} + +void CObject::SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, + Math::Vector &lookat, Math::Vector &upVec, + Gfx::CameraType type) +{ +} + +CPhysics* CObject::GetPhysics() +{ + return nullptr; +} + +bool CPhysics::GetLand() +{ + return false; +} + //! Changes the level of transparency of an object and objects transported (battery & cargo) void SetTransparency(CObject* obj, float value) { @@ -332,7 +392,7 @@ void Gfx::CCamera::SetType(CameraType type) SetSmooth(Gfx::CAM_SMOOTH_NORM); } -CameraType Gfx::CCamera::GetType() +Gfx::CameraType Gfx::CCamera::GetType() { return m_type; } @@ -342,7 +402,7 @@ void Gfx::CCamera::SetSmooth(CameraSmooth type) m_smooth = type; } -CameraSmooth Gfx::CCamera::GetSmoth() +Gfx::CameraSmooth Gfx::CCamera::GetSmoth() { return m_smooth; } @@ -692,7 +752,7 @@ void Gfx::CCamera::OverFrame(const Event &event) } else { - color = Gfx::Color(0.0f. 0.0f, 0.0f); + color = Gfx::Color(0.0f, 0.0f, 0.0f); } color.a = 0.0f; m_engine->SetOverColor(color, m_overMode); @@ -873,7 +933,7 @@ bool Gfx::CCamera::IsCollisionBack(Math::Vector &eye, Math::Vector lookat) for (int i = 0 ;i < 1000000; i++) { - CObject *obj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + CObject *obj = static_cast( m_iMan->SearchInstance(CLASS_OBJECT, i) ); if (obj == NULL) break; if (obj->GetTruck()) continue; // battery or cargo? @@ -899,7 +959,7 @@ bool Gfx::CCamera::IsCollisionBack(Math::Vector &eye, Math::Vector lookat) iType == OBJECT_SAFE || iType == OBJECT_HUSTON ) continue; - ObjType oType = obj->GetType(); + ObjectType oType = obj->GetType(); if ( oType == OBJECT_HUMAN || oType == OBJECT_TECH || oType == OBJECT_TOTO || @@ -995,7 +1055,6 @@ bool Gfx::CCamera::EventProcess(const Event &event) { switch (event.type) { - // TODO: frame update event case EVENT_FRAME: EventFrame(event); break; @@ -1004,11 +1063,11 @@ bool Gfx::CCamera::EventProcess(const Event &event) EventMouseMove(event); break; - case EVENT_KEY_DOWN: - // TODO: mouse wheel event + // TODO: mouse wheel event + /*case EVENT_KEY_DOWN: if ( event.param == VK_WHEELUP ) EventMouseWheel(+1); if ( event.param == VK_WHEELDOWN ) EventMouseWheel(-1); - break; + break;*/ default: break; @@ -1489,8 +1548,6 @@ bool Gfx::CCamera::EventFrameFix(const Event &event) bool Gfx::CCamera::EventFrameExplo(const Event &event) { - float factor = m_heightEye * 0.5f + 30.0f; - if (m_mouseDirH != 0.0f) m_directionH -= m_mouseDirH * event.rTime * 0.7f * m_speed; @@ -1526,7 +1583,7 @@ bool Gfx::CCamera::EventFrameOnBoard(const Event &event) { Math::Vector lookatPt, upVec; m_cameraObj->SetViewFromHere(m_eyePt, m_directionH, m_directionV, - lookatPt, vUpVec, m_type); + lookatPt, upVec, m_type); Math::Vector eye = m_effectOffset * 0.3f + m_eyePt; Math::Vector lookat = m_effectOffset * 0.3f + lookatPt; diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h index 935f8b01..ec6afcb2 100644 --- a/src/graphics/engine/camera.h +++ b/src/graphics/engine/camera.h @@ -353,13 +353,13 @@ protected: float m_centeringTime; float m_centeringProgress; - CameraEffect m_effectType; + Gfx::CameraEffect m_effectType; Math::Vector m_effectPos; float m_effectForce; float m_effectProgress; Math::Vector m_effectOffset; - OverEffect m_overType; + Gfx::CameraOverEffect m_overType; float m_overForce; float m_overTime; Gfx::Color m_overColorBase; diff --git a/src/graphics/engine/cloud.cpp b/src/graphics/engine/cloud.cpp index e46b0742..71dd9690 100644 --- a/src/graphics/engine/cloud.cpp +++ b/src/graphics/engine/cloud.cpp @@ -55,16 +55,14 @@ Gfx::CCloud::~CCloud() bool Gfx::CCloud::EventProcess(const Event &event) { - /* TODO! - if ( event.event == EVENT_FRAME ) - return EventFrame(event); */ + if ( event.type == EVENT_FRAME ) + return EventFrame(event); return true; } bool Gfx::CCloud::EventFrame(const Event &event) { - /* TODO! if (m_engine->GetPause()) return true; m_time += event.rTime; @@ -73,7 +71,7 @@ bool Gfx::CCloud::EventFrame(const Event &event) if (m_time - m_lastTest < 0.2f) return true; - m_lastTest = m_time; */ + m_lastTest = m_time; return true; } diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 4bf80d27..c8fa05ca 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -25,8 +25,16 @@ #include "common/key.h" #include "common/logger.h" #include "graphics/core/device.h" +#include "graphics/engine/camera.h" +#include "graphics/engine/cloud.h" #include "graphics/engine/lightman.h" +#include "graphics/engine/lightning.h" +#include "graphics/engine/particle.h" +#include "graphics/engine/planet.h" +#include "graphics/engine/pyro.h" +#include "graphics/engine/terrain.h" #include "graphics/engine/text.h" +#include "graphics/engine/water.h" #include "math/geometry.h" // Initial size of various vectors @@ -207,12 +215,11 @@ bool Gfx::CEngine::Create() m_lightMan = new Gfx::CLightManager(m_iMan, this); m_text = new Gfx::CText(m_iMan, this); - /* TODO: m_particle = new Gfx::CParticle(m_iMan, this); m_water = new Gfx::CWater(m_iMan, this); m_cloud = new Gfx::CCloud(m_iMan, this); m_lightning = new Gfx::CLightning(m_iMan, this); - m_planet = new Gfx::CPlanet(m_iMan, this);*/ + m_planet = new Gfx::CPlanet(m_iMan, this); m_text->SetDevice(m_device); if (! m_text->Create()) @@ -250,7 +257,6 @@ void Gfx::CEngine::Destroy() delete m_text; m_text = nullptr; - /* TODO: delete m_particle; m_particle = nullptr; @@ -264,7 +270,7 @@ void Gfx::CEngine::Destroy() m_lightning = nullptr; delete m_planet; - m_planet = nullptr;*/ + m_planet = nullptr; } void Gfx::CEngine::ResetAfterDeviceChanged() @@ -807,3 +813,118 @@ bool Gfx::CEngine::GetShowStat() return m_showStats; } +void Gfx::CEngine::SetFocus(float focus) +{ + m_focus = focus; +} + + +void Gfx::CEngine::SetOverColor(const Gfx::Color& color, int mode) +{ + // TODO! +} + +void Gfx::CEngine::SetFogColor(const Gfx::Color& color, int rank) +{ + // TODO! +} + +Gfx::Color Gfx::CEngine::GetFogColor(int rank) +{ + // TODO! + return Gfx::Color(); +} + +void Gfx::CEngine::SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt, + const Math::Vector& upVec, float eyeDistance) +{ + // TODO! +} + +void Gfx::CEngine::SetRankView(int rank) +{ + m_rankView = rank; +} + +float Gfx::CEngine::GetEyeDirH() +{ + return m_eyeDirH; +} + +float Gfx::CEngine::GetEyeDirV() +{ + return m_eyeDirV; +} + +float Gfx::CEngine::GetClippingDistance() +{ + return m_clippingDistance; +} + +bool Gfx::CEngine::GetGroundSpot() +{ + return m_groundSpotVisible; +} + +void Gfx::CEngine::SetTerrain(Gfx::CTerrain* terrain) +{ + m_terrain = terrain; +} + +void Gfx::CEngine::SetTerrainVision(float vision) +{ + // TODO! +} + +bool Gfx::CEngine::LoadTexture(const std::string& name, int stage) +{ + // TODO! + return true; +} + +float Gfx::CEngine::ParticleAdapt(float factor) +{ + // TODO! + return 0.0f; +} + +bool Gfx::CEngine::SetObjectType(int objRank, Gfx::EngineObjectType type) +{ + // TODO! + return true; +} + +bool Gfx::CEngine::SetObjectTransform(int objRank, const Math::Matrix& transform) +{ + // TODO! + return true; +} + +int Gfx::CEngine::CreateObject() +{ + // TODO! + return 0; +} + +bool Gfx::CEngine::DeleteObject(int objRank) +{ + // TODO! + return true; +} + +int Gfx::CEngine::GroundMarkCreate(Math::Vector pos, float radius, float delay1, float delay2, float delay3, int dx, int dy, char* table) +{ + // TODO! + return 0; +} + +bool Gfx::CEngine::AddQuick(int objRank, const Gfx::EngineObjLevel5& buffer, std::string texName1, std::string texName2, float min, float max, bool globalUpdate) +{ + // TODO! + return false; +} + +void Gfx::CEngine::Update() +{ + // TODO! +} diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index cd89a1cf..e61aca65 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -170,7 +170,10 @@ struct EngineObjLevel5 Gfx::EngineTriangleType type; std::vector vertices; - EngineObjLevel5(); + EngineObjLevel5() + { + state = 0; + } }; /** @@ -182,7 +185,10 @@ struct EngineObjLevel4 std::vector up; Gfx::EngineObjLevel3* down; - EngineObjLevel4(); + EngineObjLevel4() + { + reserved = 0; + } }; /** @@ -195,7 +201,10 @@ struct EngineObjLevel3 std::vector up; Gfx::EngineObjLevel2* down; - EngineObjLevel3(); + EngineObjLevel3() + { + min = max = 0.0f; + } }; /** @@ -207,7 +216,10 @@ struct EngineObjLevel2 std::vector up; Gfx::EngineObjLevel1* down; - EngineObjLevel2(); + EngineObjLevel2() + { + objRank = 0; + } }; /** @@ -219,7 +231,7 @@ struct EngineObjLevel1 Gfx::Texture tex2; std::vector up; - EngineObjLevel1(); + EngineObjLevel1() {} }; /** diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp index 4db5511a..4ecdb3c4 100644 --- a/src/graphics/engine/lightning.cpp +++ b/src/graphics/engine/lightning.cpp @@ -19,5 +19,71 @@ #include "graphics/engine/lightning.h" +#include "common/logger.h" -// TODO implementation + +Gfx::CLightning::CLightning(CInstanceManager* iMan, Gfx::CEngine* engine) +{ + GetLogger()->Info("CLightning::CLightning() stub!\n"); + // TODO! +} + +Gfx::CLightning::~CLightning() +{ + GetLogger()->Info("CLightning::~CLightning() stub!\n"); + // TODO! +} + +void Gfx::CLightning::Flush() +{ + GetLogger()->Info("CLightning::Flush() stub!\n"); + // TODO! +} + +bool Gfx::CLightning::EventProcess(const Event &event) +{ + GetLogger()->Info("CLightning::EventProcess() stub!\n"); + // TODO! + return true; +} + +bool Gfx::CLightning::Create(float sleep, float delay, float magnetic) +{ + GetLogger()->Info("CLightning::Create() stub!\n"); + // TODO! + return true; +} + +bool Gfx::CLightning::GetStatus(float &sleep, float &delay, float &magnetic, float &progress) +{ + GetLogger()->Info("CLightning::GetStatus() stub!\n"); + // TODO! + return true; +} + +bool Gfx::CLightning::SetStatus(float sleep, float delay, float magnetic, float progress) +{ + GetLogger()->Info("CLightning::SetStatus() stub!\n"); + // TODO! + return true; +} + +void Gfx::CLightning::Draw() +{ + GetLogger()->Info("CLightning::Draw() stub!\n"); + // TODO! +} + +bool Gfx::CLightning::EventFrame(const Event &event) +{ + GetLogger()->Info("CLightning::EventFrame() stub!\n"); + // TODO! + return true; +} + +CObject* Gfx::CLightning::SearchObject(Math::Vector pos) +{ + GetLogger()->Info("CLightning::SearchObject() stub!\n"); + // TODO! + return nullptr; +} diff --git a/src/graphics/engine/lightning.h b/src/graphics/engine/lightning.h index 957344c1..9e854be8 100644 --- a/src/graphics/engine/lightning.h +++ b/src/graphics/engine/lightning.h @@ -73,7 +73,7 @@ protected: float m_sleep; float m_delay; float m_magnetic; - BlitzPhase m_phase; + Gfx::BlitzPhase m_phase; float m_time; float m_speed; float m_progress; diff --git a/src/graphics/engine/particle.cpp b/src/graphics/engine/particle.cpp index 84e2f9d7..9a21fe04 100644 --- a/src/graphics/engine/particle.cpp +++ b/src/graphics/engine/particle.cpp @@ -19,5 +19,284 @@ #include "graphics/engine/particle.h" +#include "common/logger.h" -// TODO implementation + +Gfx::CParticle::CParticle(CInstanceManager* iMan, Gfx::CEngine* engine) +{ + GetLogger()->Info("CParticle::CParticle() stub!\n"); + // TODO! +} + +Gfx::CParticle::~CParticle() +{ + GetLogger()->Info("CParticle::~CParticle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetDevice(Gfx::CDevice* device) +{ + GetLogger()->Info("CParticle::SetDevice() stub!\n"); + // TODO! +} + +void Gfx::CParticle::FlushParticle() +{ + GetLogger()->Info("CParticle::FlushParticle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::FlushParticle(int sheet) +{ + GetLogger()->Info("CParticle::FlushParticle() stub!\n"); + // TODO! +} + +int Gfx::CParticle::CreateParticle(Math::Vector pos, Math::Vector speed, Math::Point dim, + Gfx::ParticleType type, float duration, float mass, + float windSensitivity, int sheet) +{ + GetLogger()->Info("CParticle::CreateParticle() stub!\n"); + // TODO! + return 0; +} + +int Gfx::CParticle::CreateFrag(Math::Vector pos, Math::Vector speed, Gfx::EngineTriangle *triangle, + Gfx::ParticleType type, float duration, float mass, + float windSensitivity, int sheet) +{ + GetLogger()->Info("CParticle::CreateFrag() stub!\n"); + // TODO! + return 0; +} + +int Gfx::CParticle::CreatePart(Math::Vector pos, Math::Vector speed, Gfx::ParticleType type, + float duration, float mass, float weight, + float windSensitivity, int sheet) +{ + GetLogger()->Info("CParticle::CreatePart() stub!\n"); + // TODO! + return 0; +} + +int Gfx::CParticle::CreateRay(Math::Vector pos, Math::Vector goal, Gfx::ParticleType type, Math::Point dim, + float duration, int sheet) +{ + GetLogger()->Info("CParticle::CreateRay() stub!\n"); + // TODO! + return 0; +} + +int Gfx::CParticle::CreateTrack(Math::Vector pos, Math::Vector speed, Math::Point dim, Gfx::ParticleType type, + float duration, float mass, float length, float width) +{ + GetLogger()->Info("CParticle::CreateTrack() stub!\n"); + // TODO! + return 0; +} + +void Gfx::CParticle::CreateWheelTrace(const Math::Vector &p1, const Math::Vector &p2, const Math::Vector &p3, + const Math::Vector &p4, Gfx::ParticleType type) +{ + GetLogger()->Info("CParticle::CreateWheelTrace() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DeleteParticle(Gfx::ParticleType type) +{ + GetLogger()->Info("CParticle::DeleteParticle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DeleteParticle(int channel) +{ + GetLogger()->Info("CParticle::DeleteParticle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetObjectLink(int channel, CObject *object) +{ + GetLogger()->Info("CParticle::SetObjectLink() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetObjectFather(int channel, CObject *object) +{ + GetLogger()->Info("CParticle::SetObjectFather() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetPosition(int channel, Math::Vector pos) +{ + GetLogger()->Info("CParticle::SetPosition() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetDimension(int channel, Math::Point dim) +{ + GetLogger()->Info("CParticle::SetDimension() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetZoom(int channel, float zoom) +{ + GetLogger()->Info("CParticle::SetZoom() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetAngle(int channel, float angle) +{ + GetLogger()->Info("CParticle::SetAngle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetIntensity(int channel, float intensity) +{ + GetLogger()->Info("CParticle::SetIntensity() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetParam(int channel, Math::Vector pos, Math::Point dim, float zoom, float angle, float intensity) +{ + GetLogger()->Info("CParticle::SetParam() stub!\n"); + // TODO! +} + +void Gfx::CParticle::SetPhase(int channel, Gfx::ParticlePhase phase, float duration) +{ + GetLogger()->Info("CParticle::SetPhase() stub!\n"); + // TODO! +} + +bool Gfx::CParticle::GetPosition(int channel, Math::Vector &pos) +{ + GetLogger()->Info("CParticle::GetPosition() stub!\n"); + // TODO! + return true; +} + +Gfx::Color Gfx::CParticle::GetFogColor(Math::Vector pos) +{ + GetLogger()->Info("CParticle::GetFogColor() stub!\n"); + // TODO! + return Gfx::Color(); +} + +void Gfx::CParticle::SetFrameUpdate(int sheet, bool update) +{ + GetLogger()->Info("CParticle::SetFrameUpdate() stub!\n"); + // TODO! +} + +void Gfx::CParticle::FrameParticle(float rTime) +{ + GetLogger()->Info("CParticle::FrameParticle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticle(int sheet) +{ + GetLogger()->Info("CParticle::DrawParticle() stub!\n"); + // TODO! +} + +bool Gfx::CParticle::WriteWheelTrace(char *filename, int width, int height, Math::Vector dl, Math::Vector ur) +{ + GetLogger()->Info("CParticle::WriteWheelTrace() stub!\n"); + // TODO! + return true; +} + +void Gfx::CParticle::DeleteRank(int rank) +{ + GetLogger()->Info("CParticle::DeleteRank() stub!\n"); + // TODO! +} + +bool Gfx::CParticle::CheckChannel(int &channel) +{ + GetLogger()->Info("CParticle::CheckChannel() stub!\n"); + // TODO! + return true; +} + +void Gfx::CParticle::DrawParticleTriangle(int i) +{ + GetLogger()->Info("CParticle::DrawParticleTriangle() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleNorm(int i) +{ + GetLogger()->Info("CParticle::DrawParticleNorm() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleFlat(int i) +{ + GetLogger()->Info("CParticle::DrawParticleFlat() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleFog(int i) +{ + GetLogger()->Info("CParticle::DrawParticleFog() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleRay(int i) +{ + GetLogger()->Info("CParticle::DrawParticleRay() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleSphere(int i) +{ + GetLogger()->Info("CParticle::DrawParticleSphere() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleCylinder(int i) +{ + GetLogger()->Info("CParticle::DrawParticleCylinder() stub!\n"); + // TODO! +} + +void Gfx::CParticle::DrawParticleWheel(int i) +{ + GetLogger()->Info("CParticle::DrawParticleWheel() stub!\n"); + // TODO! +} + +CObject* Gfx::CParticle::SearchObjectGun(Math::Vector old, Math::Vector pos, Gfx::ParticleType type, CObject *father) +{ + GetLogger()->Info("CParticle::SearchObjectGun() stub!\n"); + // TODO! + return nullptr; +} + +CObject* Gfx::CParticle::SearchObjectRay(Math::Vector pos, Math::Vector goal, Gfx::ParticleType type, CObject *father) +{ + GetLogger()->Info("CParticle::SearchObjectRay() stub!\n"); + // TODO! + return nullptr; +} + +void Gfx::CParticle::Play(Sound sound, Math::Vector pos, float amplitude) +{ + GetLogger()->Info("CParticle::Play() stub!\n"); + // TODO! +} + +bool Gfx::CParticle::TrackMove(int i, Math::Vector pos, float progress) +{ + GetLogger()->Info("CParticle::TrackMove() stub!\n"); + // TODO! + return true; +} + +void Gfx::CParticle::TrackDraw(int i, Gfx::ParticleType type) +{ + GetLogger()->Info("CParticle::TrackDraw() stub!\n"); + // TODO! +} diff --git a/src/graphics/engine/particle.h b/src/graphics/engine/particle.h index 94aacfc7..89e2c5be 100644 --- a/src/graphics/engine/particle.h +++ b/src/graphics/engine/particle.h @@ -202,26 +202,26 @@ enum ParticlePhase struct Particle { - char bUsed; // TRUE -> particle used - char bRay; // TRUE -> ray with goal - unsigned short uniqueStamp; // unique mark + char used; // TRUE -> particle used + char ray; // TRUE -> ray with goal + unsigned short uniqueStamp; // unique mark short sheet; // sheet (0..n) - ParticleType type; // type PARTI* - ParticlePhase phase; // phase PARPH* + ParticleType type; // type PARTI* + ParticlePhase phase; // phase PARPH* float mass; // mass of the particle (in rebounding) float weight; // weight of the particle (for noise) float duration; // length of life - Math::Vector pos; // absolute position (relative if object links) - Math::Vector goal; // goal position (if bRay) - Math::Vector speed; // speed of displacement + Math::Vector pos; // absolute position (relative if object links) + Math::Vector goal; // goal position (if ray) + Math::Vector speed; // speed of displacement float windSensitivity; short bounce; // number of rebounds - Math::Point dim; // dimensions of the rectangle + Math::Point dim; // dimensions of the rectangle float zoom; // zoom (0..1) float angle; // angle of rotation float intensity; // intensity - Math::Point texSup; // coordinated upper texture - Math::Point texInf; // coordinated lower texture + Math::Point texSup; // coordinated upper texture + Math::Point texInf; // coordinated lower texture float time; // age of the particle (0..n) float phaseTime; // age at the beginning of phase float testTime; // time since last test @@ -233,22 +233,22 @@ struct Particle struct Track { - char bUsed; // TRUE -> drag used - char bDrawParticle; + char used; // TRUE -> drag used + char drawParticle; float step; // duration of not float last; // increase last not memorized float intensity; // intensity at starting (0..1) float width; // tail width - int used; // number of positions in "pos" - int head; // head to write index - Math::Vector pos[MAXTRACKLEN]; + int posUsed; // number of positions in "pos" + int head; // head to write index + Math::Vector pos[MAXTRACKLEN]; float len[MAXTRACKLEN]; }; struct WheelTrace { - ParticleType type; // type PARTI* - Math::Vector pos[4]; // rectangle positions + ParticleType type; // type PARTI* + Math::Vector pos[4]; // rectangle positions float startTime; // beginning of life }; @@ -257,20 +257,29 @@ struct WheelTrace class CParticle { public: - CParticle(CInstanceManager* iMan, CEngine* engine); + CParticle(CInstanceManager* iMan, Gfx::CEngine* engine); ~CParticle(); - void SetDevice(CDevice* device); + void SetDevice(Gfx::CDevice* device); void FlushParticle(); void FlushParticle(int sheet); - int CreateParticle(Math::Vector pos, Math::Vector speed, Math::Point dim, ParticleType type, float duration=1.0f, float mass=0.0f, float windSensitivity=1.0f, int sheet=0); - int CreateFrag(Math::Vector pos, Math::Vector speed, Gfx::EngineTriangle *triangle, ParticleType type, float duration=1.0f, float mass=0.0f, float windSensitivity=1.0f, int sheet=0); - int CreatePart(Math::Vector pos, Math::Vector speed, ParticleType type, float duration=1.0f, float mass=0.0f, float weight=0.0f, float windSensitivity=1.0f, int sheet=0); - int CreateRay(Math::Vector pos, Math::Vector goal, ParticleType type, Math::Point dim, float duration=1.0f, int sheet=0); - int CreateTrack(Math::Vector pos, Math::Vector speed, Math::Point dim, ParticleType type, float duration=1.0f, float mass=0.0f, float length=10.0f, float width=1.0f); - void CreateWheelTrace(const Math::Vector &p1, const Math::Vector &p2, const Math::Vector &p3, const Math::Vector &p4, ParticleType type); - void DeleteParticle(ParticleType type); + int CreateParticle(Math::Vector pos, Math::Vector speed, Math::Point dim, + Gfx::ParticleType type, float duration=1.0f, float mass=0.0f, + float windSensitivity=1.0f, int sheet=0); + int CreateFrag(Math::Vector pos, Math::Vector speed, Gfx::EngineTriangle *triangle, + Gfx::ParticleType type, float duration=1.0f, float mass=0.0f, + float windSensitivity=1.0f, int sheet=0); + int CreatePart(Math::Vector pos, Math::Vector speed, Gfx::ParticleType type, + float duration=1.0f, float mass=0.0f, float weight=0.0f, + float windSensitivity=1.0f, int sheet=0); + int CreateRay(Math::Vector pos, Math::Vector goal, Gfx::ParticleType type, Math::Point dim, + float duration=1.0f, int sheet=0); + int CreateTrack(Math::Vector pos, Math::Vector speed, Math::Point dim, Gfx::ParticleType type, + float duration=1.0f, float mass=0.0f, float length=10.0f, float width=1.0f); + void CreateWheelTrace(const Math::Vector &p1, const Math::Vector &p2, const Math::Vector &p3, + const Math::Vector &p4, Gfx::ParticleType type); + void DeleteParticle(Gfx::ParticleType type); void DeleteParticle(int channel); void SetObjectLink(int channel, CObject *object); void SetObjectFather(int channel, CObject *object); @@ -280,12 +289,12 @@ public: void SetAngle(int channel, float angle); void SetIntensity(int channel, float intensity); void SetParam(int channel, Math::Vector pos, Math::Point dim, float zoom, float angle, float intensity); - void SetPhase(int channel, ParticlePhase phase, float duration); + void SetPhase(int channel, Gfx::ParticlePhase phase, float duration); bool GetPosition(int channel, Math::Vector &pos); Gfx::Color GetFogColor(Math::Vector pos); - void SetFrameUpdate(int sheet, bool bUpdate); + void SetFrameUpdate(int sheet, bool update); void FrameParticle(float rTime); void DrawParticle(int sheet); @@ -302,29 +311,29 @@ protected: void DrawParticleSphere(int i); void DrawParticleCylinder(int i); void DrawParticleWheel(int i); - CObject* SearchObjectGun(Math::Vector old, Math::Vector pos, ParticleType type, CObject *father); - CObject* SearchObjectRay(Math::Vector pos, Math::Vector goal, ParticleType type, CObject *father); + CObject* SearchObjectGun(Math::Vector old, Math::Vector pos, Gfx::ParticleType type, CObject *father); + CObject* SearchObjectRay(Math::Vector pos, Math::Vector goal, Gfx::ParticleType type, CObject *father); void Play(Sound sound, Math::Vector pos, float amplitude); bool TrackMove(int i, Math::Vector pos, float progress); - void TrackDraw(int i, ParticleType type); + void TrackDraw(int i, Gfx::ParticleType type); protected: CInstanceManager* m_iMan; - CEngine* m_engine; - CDevice* m_device; - CRobotMain* m_main; - CTerrain* m_terrain; - CWater* m_water; - CSound* m_sound; + Gfx::CEngine* m_engine; + Gfx::CDevice* m_device; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + CRobotMain* m_main; + CSound* m_sound; Gfx::Particle m_particule[MAXPARTICULE*MAXPARTITYPE]; Gfx::EngineTriangle m_triangle[MAXPARTICULE]; // triangle if PartiType == 0 - Track m_track[MAXTRACK]; + Gfx::Track m_track[MAXTRACK]; int m_wheelTraceTotal; int m_wheelTraceIndex; - WheelTrace m_wheelTrace[MAXWHEELTRACE]; + Gfx::WheelTrace m_wheelTrace[MAXWHEELTRACE]; int m_totalInterface[MAXPARTITYPE][SH_MAX]; - bool m_bFrameUpdate[SH_MAX]; + bool m_frameUpdate[SH_MAX]; int m_fogTotal; int m_fog[MAXPARTIFOG]; int m_uniqueStamp; diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index e699db2a..327befa5 100644 --- a/src/graphics/engine/pyro.cpp +++ b/src/graphics/engine/pyro.cpp @@ -19,5 +19,161 @@ #include "graphics/engine/pyro.h" +#include "common/logger.h" -// TODO implementation + +Gfx::CPyro::CPyro(CInstanceManager* iMan) +{ + GetLogger()->Info("CParticle::CPyro() stub!\n"); + // TODO! +} + +Gfx::CPyro::~CPyro() +{ + GetLogger()->Info("CPyro::~CPyro() stub!"); + // TODO! +} + +void Gfx::CPyro::DeleteObject(bool all) +{ + GetLogger()->Info("CPyro::DeleteObject() stub!"); + // TODO! +} + +bool Gfx::CPyro::Create(Gfx::PyroType type, CObject* pObj, float force) +{ + GetLogger()->Info("CPyro::Create() stub!"); + // TODO! + return true; +} + +bool Gfx::CPyro::EventProcess(const Event &event) +{ + GetLogger()->Info("CPyro::EventProcess() stub!\n"); + // TODO! + return true; +} + +Error Gfx::CPyro::IsEnded() +{ + GetLogger()->Info("CPyro::IsEnded() stub!\n"); + // TODO! + return ERR_OK; +} + +void Gfx::CPyro::CutObjectLink(CObject* pObj) +{ + GetLogger()->Info("CPyro::CutObjectLink() stub!\n"); + // TODO! +} + +void Gfx::CPyro::DisplayError(PyroType type, CObject* pObj) +{ + GetLogger()->Info("CPyro::DisplayError() stub!\n"); + // TODO! +} + +bool Gfx::CPyro::CreateLight(Math::Vector pos, float height) +{ + GetLogger()->Info("CPyro::CreateLight() stub!\n"); + // TODO! + return true; +} + +void Gfx::CPyro::DeleteObject(bool primary, bool secondary) +{ + GetLogger()->Info("CPyro::DeleteObject() stub!\n"); + // TODO! +} + +void Gfx::CPyro::CreateTriangle(CObject* pObj, ObjectType oType, int part) +{ + GetLogger()->Info("CPyro::CreateTriangle() stub!\n"); + // TODO! +} + +void Gfx::CPyro::ExploStart() +{ + GetLogger()->Info("CPyro::ExploStart() stub!\n"); + // TODO! +} +void Gfx::CPyro::ExploTerminate() +{ + GetLogger()->Info("CPyro::ExploTerminate() stub!\n"); + // TODO! +} + +void Gfx::CPyro::BurnStart() +{ + GetLogger()->Info("CPyro::BurnStart() stub!\n"); + // TODO! +} + +void Gfx::CPyro::BurnAddPart(int part, Math::Vector pos, Math::Vector angle) +{ + GetLogger()->Info("CPyro::BurnAddPart() stub!\n"); + // TODO! +} + +void Gfx::CPyro::BurnProgress() +{ + GetLogger()->Info("CPyro::BurnProgress() stub!\n"); + // TODO! +} + +bool Gfx::CPyro::BurnIsKeepPart(int part) +{ + GetLogger()->Info("CPyro::BurnIsKeepPart() stub!\n"); + // TODO! + return true; +} + +void Gfx::CPyro::BurnTerminate() +{ + GetLogger()->Info("CPyro::BurnTerminate() stub!\n"); + // TODO! +} + +void Gfx::CPyro::FallStart() +{ + GetLogger()->Info("CPyro::FallStart() stub!\n"); + // TODO! +} + +CObject* Gfx::CPyro::FallSearchBeeExplo() +{ + GetLogger()->Info("CPyro::FallSearchBeeExplo() stub!\n"); + // TODO! + return nullptr; +} + +void Gfx::CPyro::FallProgress(float rTime) +{ + GetLogger()->Info("CPyro::FallProgress() stub!\n"); + // TODO! +} + +Error Gfx::CPyro::FallIsEnded() +{ + GetLogger()->Info("CPyro::FallIsEnded() stub!\n"); + // TODO! + return ERR_OK; +} + +void Gfx::CPyro::LightOperFlush() +{ + GetLogger()->Info("CPyro::LightOperFlush() stub!\n"); + // TODO! +} + +void Gfx::CPyro::LightOperAdd(float progress, float intensity, float r, float g, float b) +{ + GetLogger()->Info("CPyro::LightOperAdd() stub!\n"); + // TODO! +} + +void Gfx::CPyro::LightOperFrame(float rTime) +{ + GetLogger()->Info("CPyro::LightOperFrame() stub!\n"); + // TODO! +} diff --git a/src/graphics/engine/pyro.h b/src/graphics/engine/pyro.h index d663ca58..35b5c5ff 100644 --- a/src/graphics/engine/pyro.h +++ b/src/graphics/engine/pyro.h @@ -21,9 +21,7 @@ #include "common/misc.h" #include "graphics/engine/engine.h" -//#include "object/object.h" -// TEMPORARILY! -enum ObjectType {}; +#include "object/object.h" class CInstanceManager; @@ -90,13 +88,14 @@ struct PyroLightOper -class CPyro { +class CPyro +{ public: CPyro(CInstanceManager* iMan); ~CPyro(); - void DeleteObject(bool bAll=false); - bool Create(PyroType type, CObject* pObj, float force=1.0f); + void DeleteObject(bool all=false); + bool Create(Gfx::PyroType type, CObject* pObj, float force=1.0f); bool EventProcess(const Event &event); Error IsEnded(); void CutObjectLink(CObject* pObj); @@ -104,7 +103,7 @@ public: protected: void DisplayError(PyroType type, CObject* pObj); bool CreateLight(Math::Vector pos, float height); - void DeleteObject(bool bPrimary, bool bSecondary); + void DeleteObject(bool primary, bool secondary); void CreateTriangle(CObject* pObj, ObjectType oType, int part); @@ -127,21 +126,21 @@ protected: void LightOperFrame(float rTime); protected: - CInstanceManager* m_iMan; - CEngine* m_engine; - CTerrain* m_terrain; - CCamera* m_camera; - CParticle* m_particule; - CLight* m_light; - CObject* m_object; - CDisplayText* m_displayText; - CRobotMain* m_main; - CSound* m_sound; + CInstanceManager* m_iMan; + Gfx::CEngine* m_engine; + Gfx::CTerrain* m_terrain; + Gfx::CCamera* m_camera; + Gfx::CParticle* m_particule; + Gfx::CLightManager* m_lightMan; + CObject* m_object; + CDisplayText* m_displayText; + CRobotMain* m_main; + CSound* m_sound; - Math::Vector m_pos; // center of the effect - Math::Vector m_posPower; // center of the battery - bool m_bPower; // battery exists? - PyroType m_type; + Math::Vector m_pos; // center of the effect + Math::Vector m_posPower; // center of the battery + bool m_power; // battery exists? + Gfx::PyroType m_type; float m_force; float m_size; float m_progress; @@ -153,22 +152,22 @@ protected: int m_lightRank; int m_lightOperTotal; - PyroLightOper m_lightOper[10]; + Gfx::PyroLightOper m_lightOper[10]; float m_lightHeight; ObjectType m_burnType; int m_burnPartTotal; - PyroBurnPart m_burnPart[10]; + Gfx::PyroBurnPart m_burnPart[10]; int m_burnKeepPart[10]; float m_burnFall; float m_fallFloor; float m_fallSpeed; float m_fallBulletTime; - bool m_bFallEnding; + bool m_fallEnding; int m_crashSphereUsed; // number of spheres used - Math::Vector m_crashSpherePos[50]; + Math::Vector m_crashSpherePos[50]; float m_crashSphereRadius[50]; }; diff --git a/src/graphics/engine/water.cpp b/src/graphics/engine/water.cpp index 1f116717..0ec52ebf 100644 --- a/src/graphics/engine/water.cpp +++ b/src/graphics/engine/water.cpp @@ -66,16 +66,14 @@ Gfx::CWater::~CWater() bool Gfx::CWater::EventProcess(const Event &event) { - /* TODO! if (event.type == EVENT_FRAME) return EventFrame(event); -*/ + return true; } bool Gfx::CWater::EventFrame(const Event &event) { - /* TODO! if (m_engine->GetPause()) return true; m_time += event.rTime; @@ -83,7 +81,7 @@ bool Gfx::CWater::EventFrame(const Event &event) if (m_type[0] == WATER_NULL) return true; if (m_lava) - LavaFrame(event.rTime);*/ + LavaFrame(event.rTime); return true; } diff --git a/src/object/object.h b/src/object/object.h index 75283d67..38254120 100644 --- a/src/object/object.h +++ b/src/object/object.h @@ -19,9 +19,9 @@ #pragma once -#include "old/d3dengine.h" -#include "old/camera.h" -#include "old/sound.h" +#include "graphics/engine/engine.h" +#include "graphics/engine/camera.h" +#include "sound/sound.h" class CInstanceManager; @@ -377,16 +377,16 @@ public: int CreatePart(); void DeletePart(int part); void SetObjectRank(int part, int objRank); - int RetObjectRank(int part); + int GetObjectRank(int part); void SetObjectParent(int part, int parent); void SetType(ObjectType type); - ObjectType RetType(); - char* RetName(); + ObjectType GetType(); + char* GetName(); void SetOption(int option); - int RetOption(); + int GetOption(); void SetID(int id); - int RetID(); + int GetID(); bool Write(char *line); bool Read(char *line); @@ -413,203 +413,205 @@ public: bool WriteProgram(int rank, char* filename); bool RunProgram(int rank); - int RetShadowLight(); - int RetEffectLight(); + int GetShadowLight(); + int GetEffectLight(); void FlushCrashShere(); int CreateCrashSphere(Math::Vector pos, float radius, Sound sound, float hardness=0.45f); - int RetCrashSphereTotal(); + int GetCrashSphereTotal(); bool GetCrashSphere(int rank, Math::Vector &pos, float &radius); - float RetCrashSphereHardness(int rank); - Sound RetCrashSphereSound(int rank); + float GetCrashSphereHardness(int rank); + Sound GetCrashSphereSound(int rank); void DeleteCrashSphere(int rank); void SetGlobalSphere(Math::Vector pos, float radius); void GetGlobalSphere(Math::Vector &pos, float &radius); void SetJotlerSphere(Math::Vector pos, float radius); void GetJotlerSphere(Math::Vector &pos, float &radius); void SetShieldRadius(float radius); - float RetShieldRadius(); + float GetShieldRadius(); void SetFloorHeight(float height); void FloorAdjust(); void SetLinVibration(Math::Vector dir); - Math::Vector RetLinVibration(); + Math::Vector GetLinVibration(); void SetCirVibration(Math::Vector dir); - Math::Vector RetCirVibration(); + Math::Vector GetCirVibration(); void SetInclinaison(Math::Vector dir); - Math::Vector RetInclinaison(); + Math::Vector GetInclinaison(); void SetPosition(int part, const Math::Vector &pos); - Math::Vector RetPosition(int part); + Math::Vector GetPosition(int part); void SetAngle(int part, const Math::Vector &angle); - Math::Vector RetAngle(int part); + Math::Vector GetAngle(int part); void SetAngleY(int part, float angle); void SetAngleX(int part, float angle); void SetAngleZ(int part, float angle); - float RetAngleY(int part); - float RetAngleX(int part); - float RetAngleZ(int part); + float GetAngleY(int part); + float GetAngleX(int part); + float GetAngleZ(int part); void SetZoom(int part, float zoom); void SetZoom(int part, Math::Vector zoom); - Math::Vector RetZoom(int part); + Math::Vector GetZoom(int part); void SetZoomX(int part, float zoom); - float RetZoomX(int part); + float GetZoomX(int part); void SetZoomY(int part, float zoom); - float RetZoomY(int part); + float GetZoomY(int part); void SetZoomZ(int part, float zoom); - float RetZoomZ(int part); + float GetZoomZ(int part); - float RetWaterLevel(); + float GetWaterLevel(); void SetTrainer(bool bEnable); - bool RetTrainer(); + bool GetTrainer(); void SetToy(bool bEnable); - bool RetToy(); + bool GetToy(); void SetManual(bool bManual); - bool RetManual(); + bool GetManual(); void SetResetCap(ResetCap cap); - ResetCap RetResetCap(); + ResetCap GetResetCap(); void SetResetBusy(bool bBusy); - bool RetResetBusy(); + bool GetResetBusy(); void SetResetPosition(const Math::Vector &pos); - Math::Vector RetResetPosition(); + Math::Vector GetResetPosition(); void SetResetAngle(const Math::Vector &angle); - Math::Vector RetResetAngle(); + Math::Vector GetResetAngle(); void SetResetRun(int run); - int RetResetRun(); + int GetResetRun(); void SetMasterParticule(int part, int parti); - int RetMasterParticule(int part); + int GetMasterParticule(int part); void SetPower(CObject* power); - CObject* RetPower(); + CObject* GetPower(); void SetFret(CObject* fret); - CObject* RetFret(); + CObject* GetFret(); void SetTruck(CObject* truck); - CObject* RetTruck(); + CObject* GetTruck(); void SetTruckPart(int part); - int RetTruckPart(); + int GetTruckPart(); void InfoFlush(); void DeleteInfo(int rank); void SetInfo(int rank, Info info); - Info RetInfo(int rank); - int RetInfoTotal(); - void SetInfoReturn(float value); - float RetInfoReturn(); + Info GetInfo(int rank); + int GetInfoTotal(); + void SetInfoGeturn(float value); + float GetInfoGeturn(); void SetInfoUpdate(bool bUpdate); - bool RetInfoUpdate(); + bool GetInfoUpdate(); bool SetCmdLine(int rank, float value); - float RetCmdLine(int rank); + float GetCmdLine(int rank); - Math::Matrix* RetRotateMatrix(int part); - Math::Matrix* RetTranslateMatrix(int part); - Math::Matrix* RetTransformMatrix(int part); - Math::Matrix* RetWorldMatrix(int part); + Math::Matrix* GetRotateMatrix(int part); + Math::Matrix* GetTranslateMatrix(int part); + Math::Matrix* GetTransformMatrix(int part); + Math::Matrix* GetWorldMatrix(int part); - void SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, Math::Vector &lookat, Math::Vector &upVec, CameraType type); + void SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, + Math::Vector &lookat, Math::Vector &upVec, + Gfx::CameraType type); void SetCharacter(Character* character); void GetCharacter(Character* character); - Character* RetCharacter(); + Character* GetCharacter(); - float RetAbsTime(); + float GetAbsTime(); void SetEnergy(float level); - float RetEnergy(); + float GetEnergy(); void SetCapacity(float capacity); - float RetCapacity(); + float GetCapacity(); void SetShield(float level); - float RetShield(); + float GetShield(); void SetRange(float delay); - float RetRange(); + float GetRange(); void SetTransparency(float value); - float RetTransparency(); + float GetTransparency(); - ObjectMaterial RetMaterial(); + ObjectMaterial GetMaterial(); void SetGadget(bool bMode); - bool RetGadget(); + bool GetGadget(); void SetFixed(bool bFixed); - bool RetFixed(); + bool GetFixed(); void SetClip(bool bClip); - bool RetClip(); + bool GetClip(); bool JostleObject(float force); void StartDetectEffect(CObject *target, bool bFound); void SetVirusMode(bool bEnable); - bool RetVirusMode(); - float RetVirusTime(); + bool GetVirusMode(); + float GetVirusTime(); - void SetCameraType(CameraType type); - CameraType RetCameraType(); + void SetCameraType(Gfx::CameraType type); + Gfx::CameraType GetCameraType(); void SetCameraDist(float dist); - float RetCameraDist(); + float GetCameraDist(); void SetCameraLock(bool bLock); - bool RetCameraLock(); + bool GetCameraLock(); void SetHilite(bool bMode); - bool RetHilite(); + bool GetHilite(); void SetSelect(bool bMode, bool bDisplayError=true); - bool RetSelect(bool bReal=false); + bool GetSelect(bool bReal=false); void SetSelectable(bool bMode); - bool RetSelectable(); + bool GetSelectable(); void SetActivity(bool bMode); - bool RetActivity(); + bool GetActivity(); void SetVisible(bool bVisible); - bool RetVisible(); + bool GetVisible(); void SetEnable(bool bEnable); - bool RetEnable(); + bool GetEnable(); void SetCheckToken(bool bMode); - bool RetCheckToken(); + bool GetCheckToken(); void SetProxyActivate(bool bActivate); - bool RetProxyActivate(); + bool GetProxyActivate(); void SetProxyDistance(float distance); - float RetProxyDistance(); + float GetProxyDistance(); void SetMagnifyDamage(float factor); - float RetMagnifyDamage(); + float GetMagnifyDamage(); void SetParam(float value); - float RetParam(); + float GetParam(); void SetExplo(bool bExplo); - bool RetExplo(); + bool GetExplo(); void SetLock(bool bLock); - bool RetLock(); + bool GetLock(); void SetCargo(bool bCargo); - bool RetCargo(); + bool GetCargo(); void SetBurn(bool bBurn); - bool RetBurn(); + bool GetBurn(); void SetDead(bool bDead); - bool RetDead(); - bool RetRuin(); - bool RetActif(); + bool GetDead(); + bool GetRuin(); + bool GetActif(); void SetGunGoalV(float gunGoal); void SetGunGoalH(float gunGoal); - float RetGunGoalV(); - float RetGunGoalH(); + float GetGunGoalV(); + float GetGunGoalH(); bool StartShowLimit(); void StopShowLimit(); @@ -618,16 +620,16 @@ public: void CreateSelectParticule(); void SetRunScript(CScript* script); - CScript* RetRunScript(); - CBotVar* RetBotVar(); - CPhysics* RetPhysics(); - CBrain* RetBrain(); - CMotion* RetMotion(); - CAuto* RetAuto(); + CScript* GetRunScript(); + CBotVar* GetBotVar(); + CPhysics* GetPhysics(); + CBrain* GetBrain(); + CMotion* GetMotion(); + CAuto* GetAuto(); void SetAuto(CAuto* automat); void SetDefRank(int rank); - int RetDefRank(); + int GetDefRank(); bool GetTooltipName(char* name); @@ -635,17 +637,17 @@ public: CObject* SubDeselList(); void DeleteDeselList(CObject* pObj); - bool CreateShadowCircle(float radius, float intensity, D3DShadowType type=D3DSHADOWNORM); - bool CreateShadowLight(float height, D3DCOLORVALUE color); - bool CreateEffectLight(float height, D3DCOLORVALUE color); + bool CreateShadowCircle(float radius, float intensity, Gfx::EngineShadowType type = Gfx::ENG_SHADOW_NORM); + bool CreateShadowLight(float height, Gfx::Color color); + bool CreateEffectLight(float height, Gfx::Color color); void FlatParent(); - bool RetTraceDown(); + bool GetTraceDown(); void SetTraceDown(bool bDown); - int RetTraceColor(); + int GetTraceColor(); void SetTraceColor(int color); - float RetTraceWidth(); + float GetTraceWidth(); void SetTraceWidth(float width); protected: @@ -663,12 +665,12 @@ protected: protected: CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CLight* m_light; - CTerrain* m_terrain; - CWater* m_water; - CCamera* m_camera; - CParticule* m_particule; + Gfx::CEngine* m_engine; + Gfx::CLightManager* m_lightMan; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCamera* m_camera; + Gfx::CParticle* m_particle; CPhysics* m_physics; CBrain* m_brain; CMotion* m_motion; @@ -732,7 +734,7 @@ protected: float m_showLimitRadius; float m_gunGoalV; float m_gunGoalH; - CameraType m_cameraType; + Gfx::CameraType m_cameraType; float m_cameraDist; bool m_bCameraLock; int m_defRank; @@ -767,7 +769,7 @@ protected: int m_infoTotal; Info m_info[OBJECTMAXINFO]; - float m_infoReturn; + float m_infoGeturn; bool m_bInfoUpdate; float m_cmdLine[OBJECTMAXCMDLINE]; diff --git a/src/physics/physics.h b/src/physics/physics.h index 6865b6af..2e1f5eb8 100644 --- a/src/physics/physics.h +++ b/src/physics/physics.h @@ -19,23 +19,27 @@ #pragma once -#include "old/d3dengine.h" #include "common/misc.h" #include "object/object.h" +#include "math/vector.h" class CInstanceManager; -class CD3DEngine; -class CLight; -class CParticule; -class CTerrain; -class CWater; class CCamera; class CObject; class CBrain; class CMotion; class CSound; +namespace Gfx +{ +class CEngine; +class CLight; +class CParticule; +class CTerrain; +class CWater; +}; + enum PhysicsType { @@ -98,64 +102,64 @@ public: void SetMotion(CMotion* motion); void SetType(PhysicsType type); - PhysicsType RetType(); + PhysicsType GetType(); bool Write(char *line); bool Read(char *line); void SetGravity(float value); - float RetGravity(); + float GetGravity(); - float RetFloorHeight(); + float GetFloorHeight(); void SetLinMotion(PhysicsMode mode, Math::Vector value); - Math::Vector RetLinMotion(PhysicsMode mode); + Math::Vector GetLinMotion(PhysicsMode mode); void SetLinMotionX(PhysicsMode mode, float value); void SetLinMotionY(PhysicsMode mode, float value); void SetLinMotionZ(PhysicsMode mode, float value); - float RetLinMotionX(PhysicsMode mode); - float RetLinMotionY(PhysicsMode mode); - float RetLinMotionZ(PhysicsMode mode); + float GetLinMotionX(PhysicsMode mode); + float GetLinMotionY(PhysicsMode mode); + float GetLinMotionZ(PhysicsMode mode); void SetCirMotion(PhysicsMode mode, Math::Vector value); - Math::Vector RetCirMotion(PhysicsMode mode); + Math::Vector GetCirMotion(PhysicsMode mode); void SetCirMotionX(PhysicsMode mode, float value); void SetCirMotionY(PhysicsMode mode, float value); void SetCirMotionZ(PhysicsMode mode, float value); - float RetCirMotionX(PhysicsMode mode); - float RetCirMotionY(PhysicsMode mode); - float RetCirMotionZ(PhysicsMode mode); + float GetCirMotionX(PhysicsMode mode); + float GetCirMotionY(PhysicsMode mode); + float GetCirMotionZ(PhysicsMode mode); - float RetLinStopLength(PhysicsMode sMode=MO_ADVSPEED, PhysicsMode aMode=MO_STOACCEL); - float RetCirStopLength(); - float RetLinMaxLength(float dir); - float RetLinTimeLength(float dist, float dir=1.0f); - float RetLinLength(float dist); + float GetLinStopLength(PhysicsMode sMode=MO_ADVSPEED, PhysicsMode aMode=MO_STOACCEL); + float GetCirStopLength(); + float GetLinMaxLength(float dir); + float GetLinTimeLength(float dist, float dir=1.0f); + float GetLinLength(float dist); void SetMotor(bool bState); - bool RetMotor(); + bool GetMotor(); void SetLand(bool bState); - bool RetLand(); + bool GetLand(); void SetSwim(bool bState); - bool RetSwim(); + bool GetSwim(); void SetCollision(bool bCollision); - bool RetCollision(); + bool GetCollision(); void SetFreeze(bool bFreeze); - bool RetFreeze(); + bool GetFreeze(); void SetReactorRange(float range); - float RetReactorRange(); + float GetReactorRange(); void SetMotorSpeed(Math::Vector speed); void SetMotorSpeedX(float speed); void SetMotorSpeedY(float speed); void SetMotorSpeedZ(float speed); - Math::Vector RetMotorSpeed(); - float RetMotorSpeedX(); - float RetMotorSpeedY(); - float RetMotorSpeedZ(); + Math::Vector GetMotorSpeed(); + float GetMotorSpeedX(); + float GetMotorSpeedY(); + float GetMotorSpeedZ(); void CreateInterface(bool bSelect); - Error RetError(); + Error GetError(); protected: bool EventFrame(const Event &event); @@ -186,12 +190,12 @@ protected: protected: CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CLight* m_light; - CParticule* m_particule; - CTerrain* m_terrain; - CWater* m_water; - CCamera* m_camera; + Gfx::CEngine* m_engine; + Gfx::CLightManager* m_lightMan; + Gfx::CParticle* m_particle; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCamera* m_camera; CObject* m_object; CBrain* m_brain; CMotion* m_motion;