summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-08-09 22:50:04 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-08-09 22:50:04 +0200
commitc3ab23ac9dc02d59180f2f1af5f3aa5b50f9f8d8 (patch)
tree42aa2b0fa35ad756f68802682404f203337a2392 /src/graphics
parentacff306cc132c4f8cc71f44f85ffd7bdd18a114e (diff)
downloadcolobot-c3ab23ac9dc02d59180f2f1af5f3aa5b50f9f8d8.tar.gz
colobot-c3ab23ac9dc02d59180f2f1af5f3aa5b50f9f8d8.tar.bz2
colobot-c3ab23ac9dc02d59180f2f1af5f3aa5b50f9f8d8.zip
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
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/camera.cpp81
-rw-r--r--src/graphics/engine/camera.h4
-rw-r--r--src/graphics/engine/cloud.cpp8
-rw-r--r--src/graphics/engine/engine.cpp129
-rw-r--r--src/graphics/engine/engine.h22
-rw-r--r--src/graphics/engine/lightning.cpp68
-rw-r--r--src/graphics/engine/lightning.h2
-rw-r--r--src/graphics/engine/particle.cpp281
-rw-r--r--src/graphics/engine/particle.h91
-rw-r--r--src/graphics/engine/pyro.cpp158
-rw-r--r--src/graphics/engine/pyro.h51
-rw-r--r--src/graphics/engine/water.cpp6
12 files changed, 798 insertions, 103 deletions
diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp
index c7ca503..2db6398 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<CObject*>( 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 935f8b0..ec6afcb 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 e46b074..71dd969 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 4bf80d2..c8fa05c 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 cd89a1c..e61aca6 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -170,7 +170,10 @@ struct EngineObjLevel5
Gfx::EngineTriangleType type;
std::vector<Gfx::VertexTex2> vertices;
- EngineObjLevel5();
+ EngineObjLevel5()
+ {
+ state = 0;
+ }
};
/**
@@ -182,7 +185,10 @@ struct EngineObjLevel4
std::vector<Gfx::EngineObjLevel5> up;
Gfx::EngineObjLevel3* down;
- EngineObjLevel4();
+ EngineObjLevel4()
+ {
+ reserved = 0;
+ }
};
/**
@@ -195,7 +201,10 @@ struct EngineObjLevel3
std::vector<Gfx::EngineObjLevel4> up;
Gfx::EngineObjLevel2* down;
- EngineObjLevel3();
+ EngineObjLevel3()
+ {
+ min = max = 0.0f;
+ }
};
/**
@@ -207,7 +216,10 @@ struct EngineObjLevel2
std::vector<Gfx::EngineObjLevel3> up;
Gfx::EngineObjLevel1* down;
- EngineObjLevel2();
+ EngineObjLevel2()
+ {
+ objRank = 0;
+ }
};
/**
@@ -219,7 +231,7 @@ struct EngineObjLevel1
Gfx::Texture tex2;
std::vector<Gfx::EngineObjLevel2> up;
- EngineObjLevel1();
+ EngineObjLevel1() {}
};
/**
diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp
index 4db5511..4ecdb3c 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 957344c..9e854be 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 84e2f9d..9a21fe0 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 94aacfc..89e2c5b 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 e699db2..327befa 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 d663ca5..35b5c5f 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;
-
- Math::Vector m_pos; // center of the effect
- Math::Vector m_posPower; // center of the battery
- bool m_bPower; // battery exists?
- PyroType m_type;
+ 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_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 1f11671..0ec52eb 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;
}