summaryrefslogtreecommitdiffstats
path: root/src/graphics/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/core')
-rw-r--r--src/graphics/core/color.cpp33
-rw-r--r--src/graphics/core/color.h33
-rw-r--r--src/graphics/core/device.h74
-rw-r--r--src/graphics/core/light.h34
-rw-r--r--src/graphics/core/material.h33
-rw-r--r--src/graphics/core/nulldevice.cpp343
-rw-r--r--src/graphics/core/nulldevice.h145
-rw-r--r--src/graphics/core/texture.h33
-rw-r--r--src/graphics/core/vertex.h33
9 files changed, 615 insertions, 146 deletions
diff --git a/src/graphics/core/color.cpp b/src/graphics/core/color.cpp
index f0b74f8..d51eb1a 100644
--- a/src/graphics/core/color.cpp
+++ b/src/graphics/core/color.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/core/color.h"
diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h
index 87a50f4..d73b47e 100644
--- a/src/graphics/core/color.h
+++ b/src/graphics/core/color.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/color.h
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h
index a896104..f52e07f 100644
--- a/src/graphics/core/device.h
+++ b/src/graphics/core/device.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/device.h
@@ -258,26 +260,16 @@ public:
//! Sets the transform matrix of given type
virtual void SetTransform(TransformType type, const Math::Matrix &matrix) = 0;
- //! Returns the current transform matrix of given type
- virtual const Math::Matrix& GetTransform(TransformType type) = 0;
- //! Multiplies the current transform matrix of given type by given matrix
- virtual void MultiplyTransform(TransformType type, const Math::Matrix &matrix) = 0;
//! Sets the current material
virtual void SetMaterial(const Material &material) = 0;
- //! Returns the current material
- virtual const Material& GetMaterial() = 0;
//! Returns the maximum number of lights available
virtual int GetMaxLightCount() = 0;
//! Sets the light at given index
virtual void SetLight(int index, const Light &light) = 0;
- //! Returns the current light at given index
- virtual const Light& GetLight(int index) = 0;
//! Enables/disables the light at given index
virtual void SetLightEnabled(int index, bool enabled) = 0;
- //! Returns the current enable state of light at given index
- virtual bool GetLightEnabled(int index) = 0;
//! Creates a texture from image; the image can be safely removed after that
virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params) = 0;
@@ -294,17 +286,11 @@ public:
virtual void SetTexture(int index, const Texture &texture) = 0;
//! Sets the texture image by ID at given texture stage
virtual void SetTexture(int index, unsigned int textureId) = 0;
- //! Returns the (multi)texture at given index
- virtual Texture GetTexture(int index) = 0;
//! Enables/disables the given texture stage
virtual void SetTextureEnabled(int index, bool enabled) = 0;
- //! Returns the current enable state of given texture stage
- virtual bool GetTextureEnabled(int index) = 0;
//! Sets the params for texture stage with given index
virtual void SetTextureStageParams(int index, const TextureStageParams &params) = 0;
- //! Returns the current params of texture stage with given index
- virtual TextureStageParams GetTextureStageParams(int index) = 0;
//! Sets only the texture wrap modes (for faster than thru stage params)
virtual void SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT) = 0;
@@ -348,61 +334,39 @@ public:
//! Enables/disables the given render state
virtual void SetRenderState(RenderState state, bool enabled) = 0;
- //! Returns the current setting of given render state
- virtual bool GetRenderState(RenderState state) = 0;
//! Sets the function of depth test
virtual void SetDepthTestFunc(CompFunc func) = 0;
- //! Returns the current function of depth test
- virtual CompFunc GetDepthTestFunc() = 0;
//! Sets the depth bias (constant value added to Z-coords)
virtual void SetDepthBias(float factor) = 0;
- //! Returns the current depth bias
- virtual float GetDepthBias() = 0;
//! Sets the alpha test function and reference value
virtual void SetAlphaTestFunc(CompFunc func, float refValue) = 0;
- //! Returns the current alpha test function and reference value
- virtual void GetAlphaTestFunc(CompFunc &func, float &refValue) = 0;
//! Sets the blending functions for source and destination operations
virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend) = 0;
- //! Returns the current blending functions for source and destination operations
- virtual void GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend) = 0;
//! Sets the clear color
virtual void SetClearColor(const Color &color) = 0;
- //! Returns the current clear color
- virtual Color GetClearColor() = 0;
//! Sets the global ambient color
virtual void SetGlobalAmbient(const Color &color) = 0;
- //! Returns the global ambient color
- virtual Color GetGlobalAmbient() = 0;
//! Sets the fog parameters: mode, color, start distance, end distance and density (for exp models)
virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density) = 0;
- //! Returns the current fog parameters: mode, color, start distance, end distance and density (for exp models)
- virtual void GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density) = 0;
//! Sets the current cull mode
virtual void SetCullMode(CullMode mode) = 0;
- //! Returns the current cull mode
- virtual CullMode GetCullMode() = 0;
//! Sets the shade model
virtual void SetShadeModel(ShadeModel model) = 0;
- //! Returns the current shade model
- virtual ShadeModel GetShadeModel() = 0;
//! Sets the current fill mode
virtual void SetFillMode(FillMode mode) = 0;
- //! Returns the current fill mode
- virtual FillMode GetFillMode() = 0;
//! Returns the pixels of the entire screen
- virtual void* GetFrameBufferPixels()const = 0;
+ virtual void* GetFrameBufferPixels() const = 0;
};
diff --git a/src/graphics/core/light.h b/src/graphics/core/light.h
index 923d0e9..e8eda7b 100644
--- a/src/graphics/core/light.h
+++ b/src/graphics/core/light.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/light.h
diff --git a/src/graphics/core/material.h b/src/graphics/core/material.h
index e0bfaff..1fde860 100644
--- a/src/graphics/core/material.h
+++ b/src/graphics/core/material.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/material.h
diff --git a/src/graphics/core/nulldevice.cpp b/src/graphics/core/nulldevice.cpp
new file mode 100644
index 0000000..f5e426d
--- /dev/null
+++ b/src/graphics/core/nulldevice.cpp
@@ -0,0 +1,343 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+
+#include "graphics/core/nulldevice.h"
+
+#include "common/config.h"
+#include "common/logger.h"
+
+#include "math/geometry.h"
+
+
+// Graphics module namespace
+namespace Gfx {
+
+CNullDevice::CNullDevice()
+{
+ m_matrix = Math::Matrix();
+ m_material = Material();
+ m_light = Light();
+}
+
+CNullDevice::~CNullDevice()
+{
+}
+
+void CNullDevice::DebugHook()
+{
+}
+
+void CNullDevice::DebugLights()
+{
+}
+
+bool CNullDevice::Create()
+{
+ return true;
+}
+
+void CNullDevice::Destroy()
+{
+}
+
+void CNullDevice::BeginScene()
+{
+}
+
+void CNullDevice::EndScene()
+{
+}
+
+void CNullDevice::Clear()
+{
+}
+
+void CNullDevice::SetTransform(TransformType type, const Math::Matrix &matrix)
+{
+}
+
+const Math::Matrix& CNullDevice::GetTransform(TransformType type)
+{
+ return m_matrix;
+}
+
+void CNullDevice::MultiplyTransform(TransformType type, const Math::Matrix &matrix)
+{
+}
+
+void CNullDevice::SetMaterial(const Material &material)
+{
+}
+
+const Material& CNullDevice::GetMaterial()
+{
+ return m_material;
+}
+
+int CNullDevice::GetMaxLightCount()
+{
+ return 99;
+}
+
+void CNullDevice::SetLight(int index, const Light &light)
+{
+}
+
+const Light& CNullDevice::GetLight(int index)
+{
+ return m_light;
+}
+
+void CNullDevice::SetLightEnabled(int index, bool enabled)
+{
+}
+
+bool CNullDevice::GetLightEnabled(int index)
+{
+ return false;
+}
+
+Texture CNullDevice::CreateTexture(CImage *image, const TextureCreateParams &params)
+{
+ Texture tex;
+ tex.id = 1; // tex.id = 0 => invalid texture
+ return tex;
+}
+
+Texture CNullDevice::CreateTexture(ImageData *data, const TextureCreateParams &params)
+{
+ Texture tex;
+ tex.id = 1; // tex.id = 0 => invalid texture
+ return tex;
+}
+
+void CNullDevice::DestroyTexture(const Texture &texture)
+{
+}
+
+void CNullDevice::DestroyAllTextures()
+{
+}
+
+int CNullDevice::GetMaxTextureStageCount()
+{
+ return 0;
+}
+
+void CNullDevice::SetTexture(int index, const Texture &texture)
+{
+}
+
+void CNullDevice::SetTexture(int index, unsigned int textureId)
+{
+}
+
+Texture CNullDevice::GetTexture(int index)
+{
+ return Texture();
+}
+
+void CNullDevice::SetTextureEnabled(int index, bool enabled)
+{
+}
+
+bool CNullDevice::GetTextureEnabled(int index)
+{
+ return false;
+}
+
+void CNullDevice::SetTextureStageParams(int index, const TextureStageParams &params)
+{
+}
+
+void CNullDevice::SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT)
+{
+}
+
+TextureStageParams CNullDevice::GetTextureStageParams(int index)
+{
+ return TextureStageParams();
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const Vertex *vertices, int vertexCount,
+ Color color)
+{
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount,
+ Color color)
+{
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const VertexCol *vertices, int vertexCount)
+{
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount)
+{
+ return 0;
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount)
+{
+ return 0;
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount)
+{
+ return 0;
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::DrawStaticBuffer(unsigned int bufferId)
+{
+}
+
+void CNullDevice::DestroyStaticBuffer(unsigned int bufferId)
+{
+}
+
+int CNullDevice::ComputeSphereVisibility(const Math::Vector &center, float radius)
+{
+ return 0;
+}
+
+void CNullDevice::SetRenderState(RenderState state, bool enabled)
+{
+}
+
+bool CNullDevice::GetRenderState(RenderState state)
+{
+ return false;
+}
+
+void CNullDevice::SetDepthTestFunc(CompFunc func)
+{
+}
+
+CompFunc CNullDevice::GetDepthTestFunc()
+{
+ return COMP_FUNC_NEVER;
+}
+
+void CNullDevice::SetDepthBias(float factor)
+{
+}
+
+float CNullDevice::GetDepthBias()
+{
+ return 0.0f;
+}
+
+void CNullDevice::SetAlphaTestFunc(CompFunc func, float refValue)
+{
+}
+
+void CNullDevice::GetAlphaTestFunc(CompFunc &func, float &refValue)
+{
+
+ func = COMP_FUNC_NEVER;
+ refValue = 0.0f;
+}
+
+void CNullDevice::SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend)
+{
+}
+
+void CNullDevice::GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend)
+{
+ srcBlend = BLEND_ZERO;
+ dstBlend = BLEND_ZERO;
+}
+
+void CNullDevice::SetClearColor(const Color &color)
+{
+}
+
+Color CNullDevice::GetClearColor()
+{
+ return Color(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void CNullDevice::SetGlobalAmbient(const Color &color)
+{
+}
+
+Color CNullDevice::GetGlobalAmbient()
+{
+ return Color(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void CNullDevice::SetFogParams(FogMode mode, const Color &color, float start, float end, float density)
+{
+}
+
+void CNullDevice::GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density)
+{
+ //
+}
+
+void CNullDevice::SetCullMode(CullMode mode)
+{
+}
+
+CullMode CNullDevice::GetCullMode()
+{
+ return CULL_CW;
+}
+
+void CNullDevice::SetShadeModel(ShadeModel model)
+{
+}
+
+ShadeModel CNullDevice::GetShadeModel()
+{
+ return SHADE_FLAT;
+}
+
+void CNullDevice::SetFillMode(FillMode mode)
+{
+}
+
+FillMode CNullDevice::GetFillMode()
+{
+ return FILL_POINT;
+}
+
+void* CNullDevice::GetFrameBufferPixels() const
+{
+ return nullptr;
+}
+
+
+} // namespace Gfx
+
+
diff --git a/src/graphics/core/nulldevice.h b/src/graphics/core/nulldevice.h
new file mode 100644
index 0000000..c6065a6
--- /dev/null
+++ b/src/graphics/core/nulldevice.h
@@ -0,0 +1,145 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file graphics/core/device.h
+ * \brief Abstract graphics device - CDevice class and related structs/enums
+ */
+
+#pragma once
+
+
+#include "graphics/core/device.h"
+
+// Graphics module namespace
+namespace Gfx {
+
+/**
+ * \class CNullDevice
+ * \brief Device implementation that doesn't render anything
+ *
+ */
+class CNullDevice : public CDevice
+{
+public:
+ CNullDevice();
+ virtual ~CNullDevice();
+
+ virtual void DebugHook();
+ virtual void DebugLights();
+
+ virtual bool Create();
+ virtual void Destroy();
+
+ virtual void BeginScene();
+ virtual void EndScene();
+
+ virtual void Clear();
+
+ virtual void SetTransform(TransformType type, const Math::Matrix &matrix);
+ virtual const Math::Matrix& GetTransform(TransformType type);
+ virtual void MultiplyTransform(TransformType type, const Math::Matrix &matrix);
+
+ virtual void SetMaterial(const Material &material);
+ virtual const Material& GetMaterial();
+
+ virtual int GetMaxLightCount();
+ virtual void SetLight(int index, const Light &light);
+ virtual const Light& GetLight(int index);
+ virtual void SetLightEnabled(int index, bool enabled);
+ virtual bool GetLightEnabled(int index);
+
+ virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params);
+ virtual Texture CreateTexture(ImageData *data, const TextureCreateParams &params);
+ virtual void DestroyTexture(const Texture &texture);
+ virtual void DestroyAllTextures();
+
+ virtual int GetMaxTextureStageCount();
+ virtual void SetTexture(int index, const Texture &texture);
+ virtual void SetTexture(int index, unsigned int textureId);
+ virtual Texture GetTexture(int index);
+ virtual void SetTextureEnabled(int index, bool enabled);
+ virtual bool GetTextureEnabled(int index);
+
+ virtual void SetTextureStageParams(int index, const TextureStageParams &params);
+ virtual TextureStageParams GetTextureStageParams(int index);
+
+ virtual void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT);
+
+ virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
+ virtual void DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount,
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
+ virtual void DrawPrimitive(PrimitiveType type, const VertexCol *vertices , int vertexCount);
+
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
+ virtual void DrawStaticBuffer(unsigned int bufferId);
+ virtual void DestroyStaticBuffer(unsigned int bufferId);
+
+ virtual int ComputeSphereVisibility(const Math::Vector &center, float radius);
+
+ virtual void SetRenderState(RenderState state, bool enabled);
+ virtual bool GetRenderState(RenderState state);
+
+ virtual void SetDepthTestFunc(CompFunc func);
+ virtual CompFunc GetDepthTestFunc();
+
+ virtual void SetDepthBias(float factor);
+ virtual float GetDepthBias();
+
+ virtual void SetAlphaTestFunc(CompFunc func, float refValue);
+ virtual void GetAlphaTestFunc(CompFunc &func, float &refValue);
+
+ virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend);
+ virtual void GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend);
+
+ virtual void SetClearColor(const Color &color);
+ virtual Color GetClearColor();
+
+ virtual void SetGlobalAmbient(const Color &color);
+ virtual Color GetGlobalAmbient();
+
+ virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density);
+ virtual void GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density);
+
+ virtual void SetCullMode(CullMode mode);
+ virtual CullMode GetCullMode();
+
+ virtual void SetShadeModel(ShadeModel model);
+ virtual ShadeModel GetShadeModel();
+
+ virtual void SetFillMode(FillMode mode) ;
+ virtual FillMode GetFillMode();
+
+ virtual void* GetFrameBufferPixels() const;
+
+private:
+ Math::Matrix m_matrix;
+ Material m_material;
+ Light m_light;
+};
+
+
+} // namespace Gfx
+
diff --git a/src/graphics/core/texture.h b/src/graphics/core/texture.h
index 0702428..3ce06ee 100644
--- a/src/graphics/core/texture.h
+++ b/src/graphics/core/texture.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/texture.h
diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h
index ca68352..7af7212 100644
--- a/src/graphics/core/vertex.h
+++ b/src/graphics/core/vertex.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/vertex.h