Change of paths in src/graphics
- moved abstract core to src/graphics/core - moved proper graphics engine to src/graphics/enginedev-ui
parent
045f17a274
commit
4ddcd9f810
|
@ -43,19 +43,19 @@ common/iman.cpp
|
||||||
# common/profile.cpp
|
# common/profile.cpp
|
||||||
# common/restext.cpp
|
# common/restext.cpp
|
||||||
common/stringutils.cpp
|
common/stringutils.cpp
|
||||||
graphics/common/camera.cpp
|
graphics/core/color.cpp
|
||||||
graphics/common/cloud.cpp
|
graphics/engine/camera.cpp
|
||||||
graphics/common/color.cpp
|
graphics/engine/cloud.cpp
|
||||||
graphics/common/engine.cpp
|
graphics/engine/engine.cpp
|
||||||
graphics/common/light.cpp
|
graphics/engine/lightman.cpp
|
||||||
graphics/common/lightning.cpp
|
graphics/engine/lightning.cpp
|
||||||
graphics/common/modelfile.cpp
|
graphics/engine/modelfile.cpp
|
||||||
graphics/common/particle.cpp
|
graphics/engine/particle.cpp
|
||||||
graphics/common/planet.cpp
|
graphics/engine/planet.cpp
|
||||||
graphics/common/pyro.cpp
|
graphics/engine/pyro.cpp
|
||||||
graphics/common/terrain.cpp
|
graphics/engine/terrain.cpp
|
||||||
graphics/common/text.cpp
|
graphics/engine/text.cpp
|
||||||
graphics/common/water.cpp
|
graphics/engine/water.cpp
|
||||||
graphics/opengl/gldevice.cpp
|
graphics/opengl/gldevice.cpp
|
||||||
# object/auto/auto.cpp
|
# object/auto/auto.cpp
|
||||||
# object/auto/autobase.cpp
|
# object/auto/autobase.cpp
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
#include "common/misc.h"
|
#include "common/misc.h"
|
||||||
#include "common/singleton.h"
|
#include "common/singleton.h"
|
||||||
#include "graphics/common/device.h"
|
#include "graphics/core/device.h"
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
src/graphics/common
|
|
||||||
|
|
||||||
Universal structs and classes used in graphics engine
|
|
||||||
|
|
||||||
Concrete implementation in OpenGL is in graphics/opengl directory.
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
src/graphics/core
|
||||||
|
|
||||||
|
Abstract core of graphics engine
|
||||||
|
|
||||||
|
Core types, enums, structs and CDevice abstract class that define
|
||||||
|
the abstract graphics device used in graphics engine
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
// color.cpp
|
// color.cpp
|
||||||
|
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
|
|
||||||
#include "math/func.h"
|
#include "math/func.h"
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
#include "graphics/common/light.h"
|
#include "graphics/core/light.h"
|
||||||
#include "graphics/common/material.h"
|
#include "graphics/core/material.h"
|
||||||
#include "graphics/common/texture.h"
|
#include "graphics/core/texture.h"
|
||||||
#include "graphics/common/vertex.h"
|
#include "graphics/core/vertex.h"
|
||||||
#include "math/matrix.h"
|
#include "math/matrix.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
|
@ -0,0 +1,91 @@
|
||||||
|
// * 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/.
|
||||||
|
|
||||||
|
// light.h
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
#include "graphics/core/color.h"
|
||||||
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Gfx {
|
||||||
|
|
||||||
|
/**
|
||||||
|
\enum LightType
|
||||||
|
\brief Type of light in 3D scene */
|
||||||
|
enum LightType
|
||||||
|
{
|
||||||
|
LIGHT_POINT,
|
||||||
|
LIGHT_SPOT,
|
||||||
|
LIGHT_DIRECTIONAL
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
\struct Light
|
||||||
|
\brief Properties of light in 3D scene
|
||||||
|
|
||||||
|
This structure was created as analog to DirectX's D3DLIGHT. */
|
||||||
|
struct Light
|
||||||
|
{
|
||||||
|
//! Type of light source
|
||||||
|
Gfx::LightType type;
|
||||||
|
//! Color of ambient light
|
||||||
|
Gfx::Color ambient;
|
||||||
|
//! Color of diffuse light
|
||||||
|
Gfx::Color diffuse;
|
||||||
|
//! Color of specular light
|
||||||
|
Gfx::Color specular;
|
||||||
|
//! Position in world space (for point & spot lights)
|
||||||
|
Math::Vector position;
|
||||||
|
//! Direction in world space (for directional & spot lights)
|
||||||
|
Math::Vector direction;
|
||||||
|
//! Constant attenuation factor
|
||||||
|
float attenuation0;
|
||||||
|
//! Linear attenuation factor
|
||||||
|
float attenuation1;
|
||||||
|
//! Quadratic attenuation factor
|
||||||
|
float attenuation2;
|
||||||
|
//! Angle of spotlight cone (0-90 degrees)
|
||||||
|
float spotAngle;
|
||||||
|
//! Intensity of spotlight (0 = uniform; 128 = most intense)
|
||||||
|
float spotIntensity;
|
||||||
|
|
||||||
|
//! Constructor; calls LoadDefault()
|
||||||
|
Light()
|
||||||
|
{
|
||||||
|
LoadDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Loads default values
|
||||||
|
void LoadDefault()
|
||||||
|
{
|
||||||
|
type = LIGHT_POINT;
|
||||||
|
ambient = Gfx::Color(0.4f, 0.4f, 0.4f);
|
||||||
|
diffuse = Gfx::Color(0.8f, 0.8f, 0.8f);
|
||||||
|
specular = Gfx::Color(1.0f, 1.0f, 1.0f);
|
||||||
|
position = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||||
|
direction = Math::Vector(0.0f, 0.0f, 1.0f);
|
||||||
|
attenuation0 = 1.0f;
|
||||||
|
attenuation1 = attenuation2 = 0.0f;
|
||||||
|
spotAngle = 90.0f;
|
||||||
|
spotIntensity = 0.0f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}; // namespace Gfx
|
|
@ -19,7 +19,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
|
@ -19,7 +19,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
#include "math/point.h"
|
#include "math/point.h"
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
src/graphics/engine
|
||||||
|
|
||||||
|
Graphics engine
|
||||||
|
|
||||||
|
CEngine class and various other classes implementing the main features
|
||||||
|
of graphics engine from model loading to decorative particles
|
||||||
|
|
||||||
|
Graphics operations are done on abstract interface from src/graphics/core
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// camera.cpp
|
// camera.cpp
|
||||||
|
|
||||||
#include "graphics/common/camera.h"
|
#include "graphics/engine/camera.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// cloud.cpp
|
// cloud.cpp
|
||||||
|
|
||||||
#include "graphics/common/cloud.h"
|
#include "graphics/engine/cloud.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -20,7 +20,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
#include "math/point.h"
|
#include "math/point.h"
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
|
|
||||||
// engine.cpp
|
// engine.cpp
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
|
|
||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
#include "common/iman.h"
|
#include "common/iman.h"
|
||||||
#include "common/image.h"
|
#include "common/image.h"
|
||||||
#include "common/key.h"
|
#include "common/key.h"
|
||||||
#include "common/logger.h"
|
#include "common/logger.h"
|
||||||
#include "graphics/common/device.h"
|
#include "graphics/core/device.h"
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
// Initial size of various vectors
|
// Initial size of various vectors
|
|
@ -21,10 +21,10 @@
|
||||||
|
|
||||||
|
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/color.h"
|
||||||
#include "graphics/common/material.h"
|
#include "graphics/core/material.h"
|
||||||
#include "graphics/common/texture.h"
|
#include "graphics/core/texture.h"
|
||||||
#include "graphics/common/vertex.h"
|
#include "graphics/core/vertex.h"
|
||||||
#include "math/intpoint.h"
|
#include "math/intpoint.h"
|
||||||
#include "math/matrix.h"
|
#include "math/matrix.h"
|
||||||
#include "math/point.h"
|
#include "math/point.h"
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
// light.cpp
|
// light.cpp
|
||||||
|
|
||||||
#include "graphics/common/light.h"
|
#include "graphics/engine/lightman.h"
|
||||||
|
|
||||||
#include "common/iman.h"
|
#include "common/iman.h"
|
||||||
#include "graphics/common/device.h"
|
#include "graphics/core/device.h"
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
|
@ -15,80 +15,19 @@
|
||||||
// * You should have received a copy of the GNU General Public License
|
// * You should have received a copy of the GNU General Public License
|
||||||
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
// light.h
|
// lightman.h
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/core/color.h"
|
||||||
#include "graphics/common/color.h"
|
#include "graphics/core/light.h"
|
||||||
|
#include "graphics/engine/engine.h"
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
|
||||||
/**
|
|
||||||
\enum LightType
|
|
||||||
\brief Type of light in 3D scene */
|
|
||||||
enum LightType
|
|
||||||
{
|
|
||||||
LIGHT_POINT,
|
|
||||||
LIGHT_SPOT,
|
|
||||||
LIGHT_DIRECTIONAL
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
\struct Light
|
|
||||||
\brief Properties of light in 3D scene
|
|
||||||
|
|
||||||
This structure was created as analog to DirectX's D3DLIGHT. */
|
|
||||||
struct Light
|
|
||||||
{
|
|
||||||
//! Type of light source
|
|
||||||
Gfx::LightType type;
|
|
||||||
//! Color of ambient light
|
|
||||||
Gfx::Color ambient;
|
|
||||||
//! Color of diffuse light
|
|
||||||
Gfx::Color diffuse;
|
|
||||||
//! Color of specular light
|
|
||||||
Gfx::Color specular;
|
|
||||||
//! Position in world space (for point & spot lights)
|
|
||||||
Math::Vector position;
|
|
||||||
//! Direction in world space (for directional & spot lights)
|
|
||||||
Math::Vector direction;
|
|
||||||
//! Constant attenuation factor
|
|
||||||
float attenuation0;
|
|
||||||
//! Linear attenuation factor
|
|
||||||
float attenuation1;
|
|
||||||
//! Quadratic attenuation factor
|
|
||||||
float attenuation2;
|
|
||||||
//! Angle of spotlight cone (0-90 degrees)
|
|
||||||
float spotAngle;
|
|
||||||
//! Intensity of spotlight (0 = uniform; 128 = most intense)
|
|
||||||
float spotIntensity;
|
|
||||||
|
|
||||||
//! Constructor; calls LoadDefault()
|
|
||||||
Light()
|
|
||||||
{
|
|
||||||
LoadDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Loads default values
|
|
||||||
void LoadDefault()
|
|
||||||
{
|
|
||||||
type = LIGHT_POINT;
|
|
||||||
ambient = Gfx::Color(0.4f, 0.4f, 0.4f);
|
|
||||||
diffuse = Gfx::Color(0.8f, 0.8f, 0.8f);
|
|
||||||
specular = Gfx::Color(1.0f, 1.0f, 1.0f);
|
|
||||||
position = Math::Vector(0.0f, 0.0f, 0.0f);
|
|
||||||
direction = Math::Vector(0.0f, 0.0f, 1.0f);
|
|
||||||
attenuation0 = 1.0f;
|
|
||||||
attenuation1 = attenuation2 = 0.0f;
|
|
||||||
spotAngle = 90.0f;
|
|
||||||
spotIntensity = 0.0f;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\struct LightProgression
|
\struct LightProgression
|
||||||
\brief Describes the progression of light parameters change */
|
\brief Describes the progression of light parameters change */
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// lightning.cpp (aka blitz.cpp)
|
// lightning.cpp (aka blitz.cpp)
|
||||||
|
|
||||||
#include "graphics/common/lightning.h"
|
#include "graphics/engine/lightning.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// modelfile.cpp (aka modfile.cpp)
|
// modelfile.cpp (aka modfile.cpp)
|
||||||
|
|
||||||
#include "graphics/common/modelfile.h"
|
#include "graphics/engine/modelfile.h"
|
||||||
|
|
||||||
#include "common/iman.h"
|
#include "common/iman.h"
|
||||||
#include "common/ioutils.h"
|
#include "common/ioutils.h"
|
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
// modelfile.h (aka modfile.h)
|
// modelfile.h (aka modfile.h)
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
#include "graphics/common/vertex.h"
|
#include "graphics/core/vertex.h"
|
||||||
#include "graphics/common/material.h"
|
#include "graphics/core/material.h"
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// particle.cpp (aka particule.cpp)
|
// particle.cpp (aka particule.cpp)
|
||||||
|
|
||||||
#include "graphics/common/particle.h"
|
#include "graphics/engine/particle.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// planet.cpp
|
// planet.cpp
|
||||||
|
|
||||||
#include "graphics/common/planet.h"
|
#include "graphics/engine/planet.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// pyro.cpp
|
// pyro.cpp
|
||||||
|
|
||||||
#include "graphics/common/pyro.h"
|
#include "graphics/engine/pyro.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -20,7 +20,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common/misc.h"
|
#include "common/misc.h"
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
//#include "object/object.h"
|
//#include "object/object.h"
|
||||||
// TEMPORARILY!
|
// TEMPORARILY!
|
||||||
enum ObjectType {};
|
enum ObjectType {};
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// terrain.cpp
|
// terrain.cpp
|
||||||
|
|
||||||
#include "graphics/common/terrain.h"
|
#include "graphics/engine/terrain.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
|
|
||||||
|
|
||||||
class CInstanceManager;
|
class CInstanceManager;
|
|
@ -1,4 +1,4 @@
|
||||||
#include "graphics/common/modelfile.h"
|
#include "graphics/engine/modelfile.h"
|
||||||
#include "common/iman.h"
|
#include "common/iman.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// text.cpp
|
// text.cpp
|
||||||
|
|
||||||
#include "graphics/common/text.h"
|
#include "graphics/engine/text.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
#include "graphics/common/device.h"
|
#include "graphics/core/device.h"
|
||||||
#include "math/point.h"
|
#include "math/point.h"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// water.cpp
|
// water.cpp
|
||||||
|
|
||||||
#include "graphics/common/water.h"
|
#include "graphics/engine/water.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO implementation
|
// TODO implementation
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "graphics/common/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
#include "graphics/common/particle.h"
|
#include "graphics/engine/particle.h"
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@ src/graphics/opengl
|
||||||
|
|
||||||
OpenGL engine implementation
|
OpenGL engine implementation
|
||||||
|
|
||||||
Contains the concreate implementation using OpenGL of functions
|
Contains the concrete implementation using OpenGL of abstract CDevice class
|
||||||
of grahpics engine in graphics/common.
|
from src/graphics/core
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "graphics/common/device.h"
|
#include "graphics/core/device.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -37,7 +37,7 @@ texture_test.cpp
|
||||||
|
|
||||||
set(MODEL_SOURCES
|
set(MODEL_SOURCES
|
||||||
../gldevice.cpp
|
../gldevice.cpp
|
||||||
../../common/modelfile.cpp
|
../../engine/modelfile.cpp
|
||||||
../../../common/logger.cpp
|
../../../common/logger.cpp
|
||||||
../../../common/image.cpp
|
../../../common/image.cpp
|
||||||
../../../common/iman.cpp
|
../../../common/iman.cpp
|
||||||
|
@ -84,4 +84,4 @@ add_executable(transform_test ${TRANSFORM_SOURCES})
|
||||||
target_link_libraries(transform_test ${LIBS})
|
target_link_libraries(transform_test ${LIBS})
|
||||||
|
|
||||||
add_executable(light_test ${LIGHT_SOURCES})
|
add_executable(light_test ${LIGHT_SOURCES})
|
||||||
target_link_libraries(light_test ${LIBS})
|
target_link_libraries(light_test ${LIBS})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "common/logger.h"
|
#include "common/logger.h"
|
||||||
#include "common/image.h"
|
#include "common/image.h"
|
||||||
#include "common/iman.h"
|
#include "common/iman.h"
|
||||||
#include "graphics/common/modelfile.h"
|
#include "graphics/engine/modelfile.h"
|
||||||
#include "graphics/opengl/gldevice.h"
|
#include "graphics/opengl/gldevice.h"
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue