2012-06-22 14:31:55 +00:00
|
|
|
// * This file is part of the COLOBOT source code
|
2012-08-10 21:31:42 +00:00
|
|
|
// * Copyright (C) 2001-2008, Daniel ROUX& EPSITEC SA, www.epsitec.ch
|
2012-06-22 14:31:55 +00:00
|
|
|
// * 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/.
|
|
|
|
|
2012-08-11 16:39:16 +00:00
|
|
|
/**
|
|
|
|
* \file graphics/engine/engine.h
|
|
|
|
* \brief Main graphics engine - Gfx::CEngine class
|
|
|
|
*/
|
2012-06-22 14:31:55 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
#include "app/system.h"
|
2012-07-22 20:05:12 +00:00
|
|
|
#include "common/event.h"
|
2012-07-26 20:26:19 +00:00
|
|
|
#include "graphics/core/color.h"
|
|
|
|
#include "graphics/core/material.h"
|
|
|
|
#include "graphics/core/texture.h"
|
|
|
|
#include "graphics/core/vertex.h"
|
2012-06-24 13:41:56 +00:00
|
|
|
#include "math/intpoint.h"
|
|
|
|
#include "math/matrix.h"
|
2012-06-22 14:31:55 +00:00
|
|
|
#include "math/point.h"
|
|
|
|
#include "math/vector.h"
|
|
|
|
|
|
|
|
|
2012-06-30 23:37:30 +00:00
|
|
|
#include <string>
|
2012-07-22 20:05:12 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
2012-06-30 23:37:30 +00:00
|
|
|
|
|
|
|
|
2012-06-22 14:31:55 +00:00
|
|
|
class CApplication;
|
|
|
|
class CInstanceManager;
|
|
|
|
class CObject;
|
2012-08-10 21:31:42 +00:00
|
|
|
class CSoundInterface;
|
2012-06-24 13:41:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace Gfx {
|
|
|
|
|
|
|
|
class CDevice;
|
2012-07-26 19:35:04 +00:00
|
|
|
class CLightManager;
|
2012-06-22 14:31:55 +00:00
|
|
|
class CText;
|
2012-06-24 13:41:56 +00:00
|
|
|
class CParticle;
|
2012-06-22 14:31:55 +00:00
|
|
|
class CWater;
|
|
|
|
class CCloud;
|
2012-06-24 13:41:56 +00:00
|
|
|
class CLightning;
|
2012-06-22 14:31:55 +00:00
|
|
|
class CPlanet;
|
|
|
|
class CTerrain;
|
|
|
|
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineTriangleType
|
|
|
|
\brief Type of triangles drawn for engine objects */
|
|
|
|
enum EngineTriangleType
|
|
|
|
{
|
|
|
|
//! Triangles
|
|
|
|
ENG_TRIANGLE_TYPE_6T = 1,
|
|
|
|
//! Surfaces
|
|
|
|
ENG_TRIANGLE_TYPE_6S = 2
|
|
|
|
};
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\struct EngineTriangle
|
|
|
|
\brief A triangle drawn by the graphics engine */
|
|
|
|
struct EngineTriangle
|
|
|
|
{
|
|
|
|
//! Triangle vertices
|
|
|
|
Gfx::VertexTex2 triangle[3];
|
|
|
|
//! Material
|
|
|
|
Gfx::Material material;
|
|
|
|
//! Render state (TODO: ?)
|
|
|
|
int state;
|
|
|
|
//! 1st texture
|
|
|
|
Gfx::Texture tex1;
|
|
|
|
//! 2nd texture
|
|
|
|
Gfx::Texture tex2;
|
|
|
|
|
|
|
|
EngineTriangle()
|
|
|
|
{
|
|
|
|
state = 0;
|
|
|
|
}
|
|
|
|
};
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineObjectType
|
|
|
|
\brief Class of graphics engine object */
|
|
|
|
enum EngineObjectType
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Object doesn't exist
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_NULL = 0,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Terrain
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_TERRAIN = 1,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Fixed object
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_FIX = 2,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Moving object
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_VEHICULE = 3,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Part of a moving object
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_DESCENDANT = 4,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Fixed object type quartz
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_QUARTZ = 5,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Fixed object type metal
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_OBJTYPE_METAL = 6
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObject
|
|
|
|
\brief Object drawn by the graphics engine */
|
|
|
|
struct EngineObject
|
|
|
|
{
|
|
|
|
//! If true, the object is drawn
|
|
|
|
bool visible;
|
|
|
|
//! If true, object is behind the 2D interface
|
|
|
|
bool drawWorld;
|
|
|
|
//! If true, the shape is before the 2D interface
|
|
|
|
bool drawFront;
|
|
|
|
//! Number of triangles
|
|
|
|
int totalTriangles;
|
|
|
|
//! Type of object
|
|
|
|
Gfx::EngineObjectType type;
|
|
|
|
//! Transformation matrix
|
|
|
|
Math::Matrix transform;
|
|
|
|
//! Distance view - origin (TODO: ?)
|
|
|
|
float distance;
|
|
|
|
//! Bounding box min (origin 0,0,0 always included)
|
|
|
|
Math::Vector bboxMin;
|
|
|
|
//! bounding box max (origin 0,0,0 always included)
|
|
|
|
Math::Vector bboxMax;
|
|
|
|
//! Radius of the sphere at the origin
|
|
|
|
float radius;
|
|
|
|
//! Rank of the associated shadow
|
|
|
|
int shadowRank;
|
|
|
|
//! Transparency of the object [0, 1]
|
|
|
|
float transparency;
|
|
|
|
|
|
|
|
EngineObject()
|
|
|
|
{
|
|
|
|
visible = false;
|
|
|
|
drawWorld = false;
|
|
|
|
drawFront = false;
|
|
|
|
totalTriangles = 0;
|
|
|
|
distance = 0.0f;
|
|
|
|
radius = 0.0f;
|
|
|
|
shadowRank = 0;
|
|
|
|
transparency = 0.0f;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EngineObjLevel1;
|
|
|
|
struct EngineObjLevel2;
|
|
|
|
struct EngineObjLevel3;
|
|
|
|
struct EngineObjLevel4;
|
|
|
|
struct EngineObjLevel5;
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObjLevel5
|
|
|
|
\brief Tier 5 of object tree */
|
|
|
|
struct EngineObjLevel5
|
|
|
|
{
|
|
|
|
Gfx::Material material;
|
|
|
|
int state;
|
|
|
|
Gfx::EngineTriangleType type;
|
|
|
|
std::vector<Gfx::VertexTex2> vertices;
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
EngineObjLevel5()
|
|
|
|
{
|
|
|
|
state = 0;
|
|
|
|
}
|
2012-07-22 20:05:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObjLevel4
|
|
|
|
\brief Tier 4 of object tree */
|
|
|
|
struct EngineObjLevel4
|
|
|
|
{
|
|
|
|
int reserved;
|
|
|
|
std::vector<Gfx::EngineObjLevel5> up;
|
|
|
|
Gfx::EngineObjLevel3* down;
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
EngineObjLevel4()
|
|
|
|
{
|
|
|
|
reserved = 0;
|
|
|
|
}
|
2012-07-22 20:05:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObjLevel3
|
|
|
|
\brief Tier 3 of object tree */
|
|
|
|
struct EngineObjLevel3
|
|
|
|
{
|
|
|
|
float min;
|
|
|
|
float max;
|
|
|
|
std::vector<Gfx::EngineObjLevel4> up;
|
|
|
|
Gfx::EngineObjLevel2* down;
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
EngineObjLevel3()
|
|
|
|
{
|
|
|
|
min = max = 0.0f;
|
|
|
|
}
|
2012-07-22 20:05:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObjLevel2
|
|
|
|
\brief Tier 2 of object tree */
|
|
|
|
struct EngineObjLevel2
|
|
|
|
{
|
|
|
|
int objRank;
|
|
|
|
std::vector<Gfx::EngineObjLevel3> up;
|
|
|
|
Gfx::EngineObjLevel1* down;
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
EngineObjLevel2()
|
|
|
|
{
|
|
|
|
objRank = 0;
|
|
|
|
}
|
2012-07-22 20:05:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineObjLevel1
|
|
|
|
\brief Tier 1 of object tree */
|
|
|
|
struct EngineObjLevel1
|
|
|
|
{
|
|
|
|
Gfx::Texture tex1;
|
|
|
|
Gfx::Texture tex2;
|
|
|
|
std::vector<Gfx::EngineObjLevel2> up;
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
EngineObjLevel1() {}
|
2012-07-22 20:05:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineShadowType
|
|
|
|
\brief Type of shadow drawn by the graphics engine */
|
|
|
|
enum EngineShadowType
|
|
|
|
{
|
|
|
|
//! Normal shadow
|
|
|
|
ENG_SHADOW_NORM = 0,
|
|
|
|
//! TODO: ?
|
|
|
|
ENG_SHADOW_WORM = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
\struct EngineShadow
|
|
|
|
\brief Shadow drawn by the graphics engine */
|
|
|
|
struct EngineShadow
|
|
|
|
{
|
|
|
|
//! If true, shadow is invisible (object being carried for example)
|
|
|
|
bool hide;
|
|
|
|
//! Rank of the associated object
|
|
|
|
int objRank;
|
|
|
|
//! Type of shadow
|
|
|
|
Gfx::EngineShadowType type;
|
|
|
|
//! Position of the shadow
|
|
|
|
Math::Vector pos;
|
|
|
|
//! Normal to the terrain
|
|
|
|
Math::Vector normal;
|
|
|
|
//! Angle of the shadow
|
|
|
|
float angle;
|
|
|
|
//! Radius of the shadow
|
|
|
|
float radius;
|
|
|
|
//! Intensity of the shadow
|
|
|
|
float intensity;
|
|
|
|
//! Height from the ground
|
|
|
|
float height;
|
|
|
|
|
|
|
|
EngineShadow()
|
|
|
|
{
|
|
|
|
hide = false;
|
|
|
|
objRank = 0;
|
|
|
|
angle = radius = intensity = height = 0.0f;
|
|
|
|
}
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\struct EngineGroundSpot
|
|
|
|
\brief A spot (large shadow) drawn on the ground by the graphics engine */
|
|
|
|
struct EngineGroundSpot
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Color of the shadow
|
|
|
|
Gfx::Color color;
|
|
|
|
//! Min altitude
|
|
|
|
float min;
|
|
|
|
//! Max altitude
|
|
|
|
float max;
|
|
|
|
//! Transition area
|
|
|
|
float smooth;
|
|
|
|
//! Position for the shadow
|
|
|
|
Math::Vector pos;
|
|
|
|
//! Radius of the shadow
|
|
|
|
float radius;
|
|
|
|
//! Position of the shadow drawn
|
|
|
|
Math::Vector drawPos;
|
|
|
|
//! Radius of the shadow drawn
|
|
|
|
float drawRadius;
|
|
|
|
|
|
|
|
EngineGroundSpot()
|
|
|
|
{
|
|
|
|
min = max = smooth = radius = drawRadius = 0.0f;
|
|
|
|
}
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineGroundMarkPhase
|
|
|
|
\brief Phase of life of an EngineGroundMark */
|
|
|
|
enum EngineGroundMarkPhase
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Null phase
|
|
|
|
ENG_GR_MARK_PHASE_NULL = 0,
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Increase
|
|
|
|
ENG_GR_MARK_PHASE_INC = 1,
|
|
|
|
//! Fixed
|
|
|
|
ENG_GR_MARK_PHASE_FIX = 2,
|
|
|
|
//! Decrease
|
2012-08-10 21:31:42 +00:00
|
|
|
ENG_GR_MARK_PHASE_DEC = 3
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\struct EngineGroundMark
|
|
|
|
\brief A mark on ground drawn by the graphics engine */
|
|
|
|
struct EngineGroundMark
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-07-22 20:05:12 +00:00
|
|
|
//! If true, draw mark
|
|
|
|
bool draw;
|
|
|
|
//! Phase of life
|
|
|
|
Gfx::EngineGroundMarkPhase phase;
|
|
|
|
//! Times for 3 life phases
|
|
|
|
float delay[3];
|
|
|
|
//! Fixed time
|
|
|
|
float fix;
|
|
|
|
//! Position for marks
|
|
|
|
Math::Vector pos;
|
|
|
|
//! Radius of marks
|
|
|
|
float radius;
|
|
|
|
//! Color intensity
|
|
|
|
float intensity;
|
|
|
|
//! Draw position for marks
|
|
|
|
Math::Vector drawPos;
|
|
|
|
//! Radius for marks
|
|
|
|
float drawRadius;
|
|
|
|
//! Draw intensity for marks
|
|
|
|
float drawIntensity;
|
|
|
|
//! X dimension of table
|
|
|
|
int dx;
|
|
|
|
//! Y dimension of table
|
|
|
|
int dy;
|
|
|
|
//! Pointer to the table
|
|
|
|
char* table;
|
|
|
|
|
|
|
|
EngineGroundMark()
|
|
|
|
{
|
|
|
|
draw = false;
|
|
|
|
delay[0] = delay[1] = delay[2] = 0.0f;
|
|
|
|
fix = radius = intensity = drawRadius = drawIntensity = 0.0f;
|
|
|
|
dx = dy = 0;
|
|
|
|
table = NULL;
|
|
|
|
}
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineTextureMapping
|
|
|
|
\brief Type of texture mapping
|
|
|
|
*/
|
|
|
|
enum EngineTextureMapping
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-07-22 20:05:12 +00:00
|
|
|
ENG_TEX_MAPPING_X = 1,
|
|
|
|
ENG_TEX_MAPPING_Y = 2,
|
|
|
|
ENG_TEX_MAPPING_Z = 3,
|
|
|
|
ENG_TEX_MAPPING_1X = 4,
|
|
|
|
ENG_TEX_MAPPING_1Y = 5,
|
|
|
|
ENG_TEX_MAPPING_1Z = 6
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-23 19:41:27 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineRenderState
|
|
|
|
\brief Render state of graphics engine
|
|
|
|
|
|
|
|
States are used for settings certain modes, for instance texturing and blending.
|
|
|
|
The enum is a bitmask and some of the states can be OR'd together. */
|
2012-06-30 23:37:30 +00:00
|
|
|
enum EngineRenderState
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Normal opaque materials
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_NORMAL = 0,
|
2012-06-26 20:23:05 +00:00
|
|
|
//! The transparent texture (black = no)
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_TTEXTURE_BLACK = (1<<0),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! The transparent texture (white = no)
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_TTEXTURE_WHITE = (1<<1),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! The transparent diffuse color
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_TDIFFUSE = (1<<2),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Texture wrap
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_WRAP = (1<<3),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Texture borders with solid color
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_CLAMP = (1<<4),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Light texture (ambient max)
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_LIGHT = (1<<5),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Double black texturing
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_DUAL_BLACK = (1<<6),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Double white texturing
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_DUAL_WHITE = (1<<7),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Part 1 (no change in. MOD!)
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_PART1 = (1<<8),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Part 2
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_PART2 = (1<<9),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Part 3
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_PART3 = (1<<10),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Part 4
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_PART4 = (1<<11),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Double-sided face
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_2FACE = (1<<12),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Image using alpha channel
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_ALPHA = (1<<13),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Always use 2nd floor texturing
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_SECOND = (1<<14),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Causes the fog
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_FOG = (1<<15),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! The transparent color (black = no)
|
2012-06-30 23:37:30 +00:00
|
|
|
ENG_RSTATE_TCOLOR_BLACK = (1<<16),
|
2012-06-26 20:23:05 +00:00
|
|
|
//! The transparent color (white = no)
|
2012-08-06 18:20:50 +00:00
|
|
|
ENG_RSTATE_TCOLOR_WHITE = (1<<17),
|
|
|
|
//! Mode for rendering text
|
|
|
|
ENG_RSTATE_TEXT = (1<<18)
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-23 19:41:27 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\enum EngineMouseType
|
|
|
|
\brief Type of mouse cursor displayed in-game */
|
|
|
|
enum EngineMouseType
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Normal cursor (arrow)
|
|
|
|
ENG_MOUSE_NORM = 0,
|
|
|
|
//! Busy
|
|
|
|
ENG_MOUSE_WAIT = 1,
|
|
|
|
//! Edit (I-beam)
|
|
|
|
ENG_MOUSE_EDIT = 2,
|
|
|
|
//! Hand
|
|
|
|
ENG_MOUSE_HAND = 3,
|
|
|
|
//! Small cross
|
|
|
|
ENG_MOUSE_CROSS = 4,
|
|
|
|
//! TODO: ?
|
|
|
|
ENG_MOUSE_SHOW = 5,
|
|
|
|
//! Crossed out sign
|
|
|
|
ENG_MOUSE_NO = 6,
|
|
|
|
//! Resize
|
|
|
|
ENG_MOUSE_MOVE = 7,
|
|
|
|
//! Resize horizontally
|
|
|
|
ENG_MOUSE_MOVEH = 8,
|
|
|
|
//! Resize vertically
|
|
|
|
ENG_MOUSE_MOVEV = 9,
|
|
|
|
//! Resize diagonally bottom-left to top-right
|
|
|
|
ENG_MOUSE_MOVED = 10,
|
|
|
|
//! Resize diagonally top-left to bottom-right
|
|
|
|
ENG_MOUSE_MOVEI = 11,
|
|
|
|
//! Scroll to the left
|
|
|
|
ENG_MOUSE_SCROLLL = 12,
|
|
|
|
//! Scroll to the right
|
|
|
|
ENG_MOUSE_SCROLLR = 13,
|
|
|
|
//! Scroll up
|
|
|
|
ENG_MOUSE_SCROLLU = 14,
|
|
|
|
//! Scroll down
|
|
|
|
ENG_MOUSE_SCROLLD = 15,
|
|
|
|
//! Larger crosshair
|
|
|
|
ENG_MOUSE_TARGET = 16,
|
|
|
|
|
|
|
|
//! Number of items in enum
|
|
|
|
ENG_MOUSE_COUNT
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|
2012-07-23 19:41:27 +00:00
|
|
|
/**
|
|
|
|
\struct EngineMouse
|
|
|
|
\brief Information about mouse cursor */
|
|
|
|
struct EngineMouse
|
|
|
|
{
|
|
|
|
//! Index of texture element for 1st image
|
|
|
|
int icon1;
|
|
|
|
//! Index of texture element for 2nd image
|
|
|
|
int icon2;
|
|
|
|
//! Shadow texture part
|
|
|
|
int iconShadow;
|
|
|
|
//! Mode to render 1st image in
|
|
|
|
Gfx::EngineRenderState mode1;
|
|
|
|
//! Mode to render 2nd image in
|
|
|
|
Gfx::EngineRenderState mode2;
|
|
|
|
//! Hot point
|
|
|
|
Math::Point hotPoint;
|
|
|
|
|
|
|
|
EngineMouse(int icon1 = -1, int icon2 = -1, int iconShadow = -1,
|
|
|
|
Gfx::EngineRenderState mode1 = Gfx::ENG_RSTATE_NORMAL,
|
|
|
|
Gfx::EngineRenderState mode2 = Gfx::ENG_RSTATE_NORMAL,
|
|
|
|
Math::Point hotPoint = Math::Point())
|
|
|
|
{
|
|
|
|
this->icon1 = icon1;
|
|
|
|
this->icon2 = icon2;
|
|
|
|
this->iconShadow = iconShadow;
|
|
|
|
this->mode1 = mode1;
|
|
|
|
this->mode2 = mode2;
|
|
|
|
this->hotPoint = hotPoint;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
/**
|
|
|
|
\class CEngine
|
|
|
|
\brief The graphics engine
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
This is the main class for graphics engine. It is responsible for drawing the 3D scene,
|
|
|
|
setting various render states, and facilitating the drawing of 2D interface.
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
It uses a lower-level CDevice object which is implementation-independent core engine.
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
\section Objecs Engine objects
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
The 3D scene is composed of objects which are basically collections of triangles forming
|
|
|
|
a surface or simply independent triangles in space. Objects are stored in the engine
|
|
|
|
as a tree structure which is composed of 5 tiers (EngineObjLevel1, EngineObjLevel2 and so on).
|
|
|
|
Each tier stores some data about object triangle, like textures or materials used.
|
|
|
|
Additional information on objects stored are in EngineObject structure.
|
|
|
|
Each object is uniquely identified by its rank.
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
...
|
|
|
|
*/
|
2012-06-24 13:41:56 +00:00
|
|
|
class CEngine
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-08-10 21:31:42 +00:00
|
|
|
CEngine(CInstanceManager* iMan, CApplication* app);
|
2012-06-26 20:23:05 +00:00
|
|
|
~CEngine();
|
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Returns the last error encountered
|
2012-07-01 20:59:22 +00:00
|
|
|
std::string GetError();
|
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Sets the device to be used
|
2012-08-10 21:31:42 +00:00
|
|
|
void SetDevice(Gfx::CDevice* device);
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Returns the current device
|
2012-07-01 20:59:22 +00:00
|
|
|
Gfx::CDevice* GetDevice();
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Sets the terrain object
|
|
|
|
void SetTerrain(Gfx::CTerrain* terrain);
|
|
|
|
|
|
|
|
//! Returns the text rendering engine
|
|
|
|
CText* GetText();
|
|
|
|
|
|
|
|
|
2012-08-03 21:23:13 +00:00
|
|
|
//! Performs the initialization; must be called after device was set
|
|
|
|
bool Create();
|
|
|
|
//! Frees all resources before exit
|
|
|
|
void Destroy();
|
2012-07-01 20:59:22 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Resets some states and flushes textures after device was changed (e.g. resoulution changed)
|
|
|
|
void ResetAfterDeviceChanged();
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Called once per frame, the call is the entry point for rendering
|
|
|
|
void Render();
|
|
|
|
|
2012-07-01 20:59:22 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Processes incoming event
|
2012-08-10 21:31:42 +00:00
|
|
|
bool ProcessEvent(const Event& event);
|
2012-07-01 20:59:22 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Called once per frame, the call is the entry point for animating the scene
|
|
|
|
void FrameMove(float rTime);
|
|
|
|
//! Evolved throughout the game
|
|
|
|
void StepSimulation(float rTime);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-03 21:23:13 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Writes a screenshot containing the current frame
|
|
|
|
bool WriteScreenShot(const std::string& fileName, int width, int height);
|
2012-08-03 21:23:13 +00:00
|
|
|
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Reads settings from INI
|
|
|
|
bool ReadSettings();
|
|
|
|
//! Writes settings to INI
|
|
|
|
bool WriteSettings();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of game pause mode
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetPause(bool pause);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetPause();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of lock for the duration of movie sequence
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetMovieLock(bool lock);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetMovieLock();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of displaying statistic information
|
|
|
|
void SetShowStats(bool show);
|
|
|
|
bool GetShowStats();
|
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Enables/disables rendering
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetRenderEnable(bool enable);
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Returns current size of viewport window
|
2012-08-11 15:17:04 +00:00
|
|
|
Math::IntPoint GetWindowSize();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Returns the last size of viewport window
|
2012-08-11 15:17:04 +00:00
|
|
|
Math::IntPoint GetLastWindowSize();
|
2012-08-10 21:31:42 +00:00
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//@{
|
|
|
|
//! Conversion functions between window and interface coordinates
|
|
|
|
/** Window coordinates are from top-left (0,0) to bottom-right (w,h) - size of window
|
|
|
|
Interface cords are from bottom-left (0,0) to top-right (1,1) - and do not depend on window size */
|
2012-08-10 21:31:42 +00:00
|
|
|
Math::Point WindowToInterfaceCoords(Math::IntPoint pos);
|
|
|
|
Math::IntPoint InterfaceToWindowCoords(Math::Point pos);
|
2012-08-11 15:17:04 +00:00
|
|
|
//@}
|
2012-08-10 21:31:42 +00:00
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//@{
|
|
|
|
//! Conversion functions between window and interface sizes
|
|
|
|
/** Unlike coordinate conversions, this is only scale conversion, not translation and scale. */
|
|
|
|
Math::Point WindowToInterfaceSize(Math::IntPoint size);
|
|
|
|
Math::IntPoint InterfaceToWindowSize(Math::Point size);
|
|
|
|
//@}
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Returns the name of directory with textures
|
|
|
|
std::string GetTextureDir();
|
|
|
|
|
|
|
|
//! Increments the triangle counter for the current frame
|
2012-06-26 20:23:05 +00:00
|
|
|
void AddStatisticTriangle(int nb);
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Returns the number of triangles in current frame
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetStatisticTriangle();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
/* *************** Object management *************** */
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
int CreateObject();
|
|
|
|
void FlushObject();
|
|
|
|
bool DeleteObject(int objRank);
|
|
|
|
bool SetDrawWorld(int objRank, bool draw);
|
|
|
|
bool SetDrawFront(int objRank, bool draw);
|
2012-07-22 20:05:12 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
bool AddTriangle(int objRank, Gfx::VertexTex2* vertex, int nb, const Gfx::Material& mat,
|
2012-07-22 20:05:12 +00:00
|
|
|
int state, std::string texName1, std::string texName2,
|
|
|
|
float min, float max, bool globalUpdate);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool AddSurface(int objRank, Gfx::VertexTex2* vertex, int nb, const Gfx::Material& mat,
|
2012-07-22 20:05:12 +00:00
|
|
|
int state, std::string texName1, std::string texName2,
|
|
|
|
float min, float max, bool globalUpdate);
|
2012-08-08 19:32:44 +00:00
|
|
|
bool AddQuick(int objRank, const Gfx::EngineObjLevel5& buffer,
|
2012-07-22 20:05:12 +00:00
|
|
|
std::string texName1, std::string texName2,
|
|
|
|
float min, float max, bool globalUpdate);
|
2012-08-10 21:31:42 +00:00
|
|
|
Gfx::EngineObjLevel5* SearchTriangle(int objRank, const Gfx::Material& mat,
|
2012-07-22 20:05:12 +00:00
|
|
|
int state, std::string texName1, std::string texName2,
|
|
|
|
float min, float max);
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
void ChangeLOD();
|
2012-08-10 21:31:42 +00:00
|
|
|
bool ChangeSecondTexture(int objRank, const std::string& texName2);
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetTotalTriangles(int objRank);
|
2012-07-22 20:05:12 +00:00
|
|
|
int GetTriangles(int objRank, float min, float max, Gfx::EngineTriangle* buffer, int size, float percent);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool GetBBox(int objRank, Math::Vector& min, Math::Vector& max);
|
|
|
|
bool ChangeTextureMapping(int objRank, const Gfx::Material& mat, int state,
|
|
|
|
const std::string& texName1, const std::string& texName2,
|
2012-07-22 20:05:12 +00:00
|
|
|
float min, float max, Gfx::EngineTextureMapping mode,
|
|
|
|
float au, float bu, float av, float bv);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool TrackTextureMapping(int objRank, const Gfx::Material& mat, int state,
|
|
|
|
const std::string& texName1, const std::string& texName2,
|
2012-07-22 20:05:12 +00:00
|
|
|
float min, float max, Gfx::EngineTextureMapping mode,
|
|
|
|
float pos, float factor, float tl, float ts, float tt);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool SetObjectTransform(int objRank, const Math::Matrix& transform);
|
|
|
|
bool GetObjectTransform(int objRank, Math::Matrix& transform);
|
2012-07-22 20:05:12 +00:00
|
|
|
bool SetObjectType(int objRank, Gfx::EngineObjectType type);
|
|
|
|
Gfx::EngineObjectType GetObjectType(int objRank);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool SetObjectTransparency(int objRank, float value);
|
|
|
|
|
|
|
|
bool ShadowCreate(int objRank);
|
|
|
|
void ShadowDelete(int objRank);
|
|
|
|
bool SetObjectShadowHide(int objRank, bool hide);
|
2012-07-22 20:05:12 +00:00
|
|
|
bool SetObjectShadowType(int objRank, Gfx::EngineShadowType type);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool SetObjectShadowPos(int objRank, const Math::Vector& pos);
|
|
|
|
bool SetObjectShadowNormal(int objRank, const Math::Vector& n);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool SetObjectShadowAngle(int objRank, float angle);
|
|
|
|
bool SetObjectShadowRadius(int objRank, float radius);
|
|
|
|
bool SetObjectShadowIntensity(int objRank, float intensity);
|
|
|
|
bool SetObjectShadowHeight(int objRank, float h);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetObjectShadowRadius(int objRank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Lists the ranks of objects and subobjects selected
|
|
|
|
void SetHighlightRank(int* rankList);
|
|
|
|
//! Returns the highlighted rectangle
|
|
|
|
bool GetHighlight(Math::Point& p1, Math::Point& p2);
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
void GroundSpotFlush();
|
|
|
|
int GroundSpotCreate();
|
|
|
|
void GroundSpotDelete(int rank);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool SetObjectGroundSpotPos(int rank, const Math::Vector& pos);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool SetObjectGroundSpotRadius(int rank, float radius);
|
2012-08-10 21:31:42 +00:00
|
|
|
bool SetObjectGroundSpotColor(int rank, const Gfx::Color& color);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool SetObjectGroundSpotMinMax(int rank, float min, float max);
|
|
|
|
bool SetObjectGroundSpotSmooth(int rank, float smooth);
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
int GroundMarkCreate(Math::Vector pos, float radius,
|
|
|
|
float delay1, float delay2, float delay3,
|
|
|
|
int dx, int dy, char* table);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool GroundMarkDelete(int rank);
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Updates the state after creating objects
|
2012-06-26 20:23:05 +00:00
|
|
|
void Update();
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
/* *************** Mode setting *************** */
|
|
|
|
|
|
|
|
//! Sets the current rendering state
|
|
|
|
void SetState(int state, const Gfx::Color& color = Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f));
|
|
|
|
|
|
|
|
//! Sets the current material
|
|
|
|
void SetMaterial(const Gfx::Material& mat);
|
|
|
|
|
|
|
|
//! Specifies the location and direction of view
|
|
|
|
void SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt,
|
|
|
|
const Math::Vector& upVec, float eyeDistance);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
Gfx::Texture CreateTexture(const std::string& texName,
|
|
|
|
const Gfx::TextureCreateParams& params);
|
|
|
|
Gfx::Texture CreateTexture(const std::string& texName);
|
|
|
|
void DestroyTexture(const std::string& texName);
|
|
|
|
bool LoadTexture(const std::string& name, int stage = 0);
|
2012-07-22 20:05:12 +00:00
|
|
|
bool LoadAllTextures();
|
2012-08-10 21:31:42 +00:00
|
|
|
bool SetTexture(const std::string& name, int stage = 0);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Border management (distance limits) depends of the resolution (LOD = level-of-detail)
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetLimitLOD(int rank, float limit);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetLimitLOD(int rank, bool last=false);
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Defines of the distance field of vision
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTerrainVision(float vision);
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of camera angle
|
|
|
|
/**
|
|
|
|
0.75 = normal
|
|
|
|
1.50 = wide-angle */
|
|
|
|
void SetFocus(float focus);
|
|
|
|
float GetFocus();
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of the global mode of marking
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetGroundSpot(bool mode);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetGroundSpot();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of the global mode of shading
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetShadow(bool mode);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetShadow();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of the global mode of contamination
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetDirty(bool mode);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetDirty();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of the global mode of horizontal fog patches
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetFog(bool mode);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetFog();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//! Indicates whether it is possible to give a color SetState
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetStateColor();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the global mode of secondary texturing
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetSecondTexture(int texNum);
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetSecondTexture();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of view mode
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetRankView(int rank);
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetRankView();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Whether to draw the world
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetDrawWorld(bool draw);
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Whether to draw the world on the interface
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetDrawFront(bool draw);
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Ambient color management
|
|
|
|
void SetAmbientColor(const Gfx::Color& color, int rank = 0);
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::Color GetAmbientColor(int rank = 0);
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Color management under water
|
|
|
|
void SetWaterAddColor(const Gfx::Color& color);
|
2012-07-01 20:59:22 +00:00
|
|
|
Gfx::Color GetWaterAddColor();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the fog color
|
|
|
|
void SetFogColor(const Gfx::Color& color, int rank = 0);
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::Color GetFogColor(int rank = 0);
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the depth of field.
|
|
|
|
/** Beyond this distance, nothing is visible.
|
|
|
|
Shortly (according SetFogStart), one enters the fog. */
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetDeepView(float length, int rank = 0, bool ref=false);
|
|
|
|
float GetDeepView(int rank = 0);
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the start of fog.
|
|
|
|
/** With 0.0, the fog from the point of view (fog max).
|
|
|
|
With 1.0, the fog from the depth of field (no fog). */
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetFogStart(float start, int rank = 0);
|
|
|
|
float GetFogStart(int rank = 0);
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the background image to use
|
|
|
|
void SetBackground(const std::string& name, Gfx::Color up = Gfx::Color(), Gfx::Color down = Gfx::Color(),
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::Color cloudUp = Gfx::Color(), Gfx::Color cloudDown = Gfx::Color(),
|
|
|
|
bool full = false, bool quarter = false);
|
2012-08-10 21:31:42 +00:00
|
|
|
void GetBackground(std::string& name, Gfx::Color& up, Gfx::Color& down,
|
|
|
|
Gfx::Color& cloudUp, Gfx::Color& cloudDown,
|
|
|
|
bool& full, bool& quarter);
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//! Specifies the foreground image
|
|
|
|
void SetForegroundImageName(const std::string& name);
|
|
|
|
//! Specifies whether to draw the foreground
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetOverFront(bool front);
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Sets the foreground overlay color
|
|
|
|
void SetOverColor(const Gfx::Color& color = Gfx::Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the particle density
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetParticleDensity(float value);
|
|
|
|
float GetParticleDensity();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//! Adapts particle factor according to particle density
|
2012-07-22 20:05:12 +00:00
|
|
|
float ParticleAdapt(float factor);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of the distance of clipping.
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetClippingDistance(float value);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetClippingDistance();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of objects detals.
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetObjectDetail(float value);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetObjectDetail();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! The amount of management objects gadgets
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetGadgetQuantity(float value);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetGadgetQuantity();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the quality of textures
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTextureQuality(int value);
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetTextureQuality();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management mode of toto
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTotoMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetTotoMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the mode of foreground
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetLensMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetLensMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the mode of water
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetWaterMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetWaterMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetLightingMode(bool present);
|
|
|
|
bool GetLightingMode();
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the mode of sky
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetSkyMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetSkyMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the mode of background
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetBackForce(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetBackForce();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management the mode of planets
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetPlanetMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetPlanetMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Managing the mode of dynamic lights.
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetLightMode(bool present);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetLightMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
// TODO: move to more appropriate class ?
|
|
|
|
//! Management of the indentation mode while editing (CEdit)
|
2012-06-29 22:12:04 +00:00
|
|
|
void SetEditIndentMode(bool autoIndent);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetEditIndentMode();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
// TODO: move to more appropriate class ?
|
|
|
|
//! Management of tab indent when editing (CEdit)
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetEditIndentValue(int value);
|
2012-07-01 20:59:22 +00:00
|
|
|
int GetEditIndentValue();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of game speed
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetSpeed(float speed);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetSpeed();
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of precision of robot tracks
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTracePrecision(float factor);
|
2012-07-01 20:59:22 +00:00
|
|
|
float GetTracePrecision();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//@{
|
|
|
|
//! Management of mouse cursor visibility
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetMouseVisible(bool show);
|
|
|
|
bool GetMouseVisible();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of mouse cursor position
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetMousePos(Math::Point pos);
|
|
|
|
Math::Point GetMousePos();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of mouse cursor type
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetMouseType(Gfx::EngineMouseType type);
|
|
|
|
Gfx::EngineMouseType GetMouseType();
|
2012-08-10 21:31:42 +00:00
|
|
|
//@}
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Returns the view matrix
|
|
|
|
const Math::Matrix& GetMatView();
|
|
|
|
//! Returns the camera center point
|
|
|
|
Math::Vector GetEyePt();
|
|
|
|
//! Returns the camera target point
|
|
|
|
Math::Vector GetLookatPt();
|
|
|
|
//! Returns the horizontal direction angle of view
|
|
|
|
float GetEyeDirH();
|
|
|
|
//! Returns the vertical direction angle of view
|
|
|
|
float GetEyeDirV();
|
|
|
|
//! Indicates whether a point is visible
|
|
|
|
bool IsVisiblePoint(const Math::Vector& pos);
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Resets the projection matrix after changes
|
|
|
|
void UpdateMatProj();
|
2012-06-22 14:31:55 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Updates the scene after a change of parameters
|
|
|
|
void ApplyChange();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
protected:
|
|
|
|
//! Prepares the interface for 3D scene
|
|
|
|
void Draw3DScene();
|
|
|
|
//! Draws the user interface over the scene
|
|
|
|
void DrawInterface();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Updates the textures used for drawing ground spot
|
|
|
|
void UpdateGroundSpotTextures();
|
2012-07-22 20:05:12 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws shadows
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawShadow();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws the gradient background
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawBackground();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws the gradient background
|
|
|
|
void DrawBackgroundGradient(const Gfx::Color& up, const Gfx::Color& down);
|
|
|
|
//! Draws a portion of the image background
|
|
|
|
void DrawBackgroundImageQuarter(Math::Point p1, Math::Point p2, const std::string& name);
|
|
|
|
//! Draws the image background
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawBackgroundImage();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws all the planets
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawPlanet();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws the image foreground
|
|
|
|
void DrawForegroundImage();
|
|
|
|
//! Draws the foreground color
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawOverColor();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draws the rectangle of the object highlighted
|
|
|
|
void DrawHighlight();
|
|
|
|
//! Draws the mouse cursor
|
2012-06-26 20:23:05 +00:00
|
|
|
void DrawMouse();
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Draw part of mouse cursor sprite
|
2012-07-22 20:05:12 +00:00
|
|
|
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Tests whether the given object is visible
|
2012-07-22 20:05:12 +00:00
|
|
|
bool IsVisible(int objRank);
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Detects whether an object is affected by the mouse
|
2012-07-22 20:05:12 +00:00
|
|
|
bool DetectBBox(int objRank, Math::Point mouse);
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Compute and return the 2D box on screen of any object
|
|
|
|
bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
|
|
|
|
|
|
|
|
//! Detects the target object that is selected with the mouse
|
|
|
|
/** Returns the rank of the object or -1. */
|
|
|
|
int DetectObject(Math::Point mouse);
|
|
|
|
|
|
|
|
//! Detects whether the mouse is in a triangle.
|
|
|
|
bool DetectTriangle(Math::Point mouse, Gfx::VertexTex2* triangle, int objRank, float& dist);
|
|
|
|
|
|
|
|
//! Transforms a 3D point (x, y, z) in 2D space (x, y, -) of the window
|
|
|
|
/** The coordinated p2D.z gives the distance. */
|
|
|
|
bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
|
|
|
|
|
|
|
|
//! Calculates the distances between the viewpoint and the origin of different objects
|
2012-07-22 20:05:12 +00:00
|
|
|
void ComputeDistance();
|
2012-08-10 21:31:42 +00:00
|
|
|
|
|
|
|
//! Updates all the geometric parameters of objects
|
2012-07-22 20:05:12 +00:00
|
|
|
void UpdateGeometry();
|
2012-06-22 14:31:55 +00:00
|
|
|
|
|
|
|
protected:
|
2012-07-26 19:35:04 +00:00
|
|
|
CInstanceManager* m_iMan;
|
|
|
|
CApplication* m_app;
|
2012-08-10 21:31:42 +00:00
|
|
|
CSoundInterface* m_sound;
|
2012-07-26 19:35:04 +00:00
|
|
|
Gfx::CDevice* m_device;
|
|
|
|
Gfx::CText* m_text;
|
|
|
|
Gfx::CLightManager* m_lightMan;
|
|
|
|
Gfx::CParticle* m_particle;
|
|
|
|
Gfx::CWater* m_water;
|
|
|
|
Gfx::CCloud* m_cloud;
|
|
|
|
Gfx::CLightning* m_lightning;
|
|
|
|
Gfx::CPlanet* m_planet;
|
|
|
|
Gfx::CTerrain* m_terrain;
|
2012-06-30 23:37:30 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Last encountered error
|
2012-06-30 23:37:30 +00:00
|
|
|
std::string m_error;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Whether to show stats (FPS, etc)
|
|
|
|
bool m_showStats;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Speed of animation
|
|
|
|
float m_speed;
|
|
|
|
//! Pause mode
|
|
|
|
bool m_pause;
|
|
|
|
//! Rendering enabled?
|
|
|
|
bool m_render;
|
|
|
|
//! Lock for duration of movie?
|
|
|
|
bool m_movieLock;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Projection matrix for 3D scene
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix m_matProj;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! View matrix for 3D scene
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix m_matView;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Camera angle for 3D scene
|
2012-06-26 20:23:05 +00:00
|
|
|
float m_focus;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! World matrix for 2D interface
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix m_matWorldInterface;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Projection matrix for 2D interface
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix m_matProjInterface;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! View matrix for 2D interface
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix m_matViewInterface;
|
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Current size of viewport window
|
2012-08-11 15:17:04 +00:00
|
|
|
Math::IntPoint m_size;
|
2012-08-10 21:31:42 +00:00
|
|
|
//! Previous size of viewport window
|
2012-08-11 15:17:04 +00:00
|
|
|
Math::IntPoint m_lastSize;
|
2012-07-22 20:05:12 +00:00
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Root of tree object structure (level 1 list)
|
2012-07-22 20:05:12 +00:00
|
|
|
std::vector<Gfx::EngineObjLevel1> m_objectTree;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Object parameters
|
2012-07-22 20:05:12 +00:00
|
|
|
std::vector<Gfx::EngineObject> m_objects;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Shadow list
|
|
|
|
std::vector<Gfx::EngineShadow> m_shadows;
|
|
|
|
//! Ground spot list
|
|
|
|
std::vector<Gfx::EngineGroundSpot> m_groundSpots;
|
|
|
|
//! Ground mark
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::EngineGroundMark m_groundMark;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Location of camera
|
2012-07-22 20:05:12 +00:00
|
|
|
Math::Vector m_eyePt;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Camera target
|
2012-07-22 20:05:12 +00:00
|
|
|
Math::Vector m_lookatPt;
|
2012-06-26 20:23:05 +00:00
|
|
|
float m_eyeDirH;
|
|
|
|
float m_eyeDirV;
|
|
|
|
int m_rankView;
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::Color m_ambientColor[2];
|
2012-06-26 20:23:05 +00:00
|
|
|
Gfx::Color m_backColor[2];
|
|
|
|
Gfx::Color m_fogColor[2];
|
|
|
|
float m_deepView[2];
|
|
|
|
float m_fogStart[2];
|
|
|
|
Gfx::Color m_waterAddColor;
|
|
|
|
int m_statisticTriangle;
|
|
|
|
bool m_updateGeometry;
|
|
|
|
int m_alphaMode;
|
|
|
|
bool m_stateColor;
|
|
|
|
bool m_forceStateColor;
|
|
|
|
bool m_groundSpotVisible;
|
|
|
|
bool m_shadowVisible;
|
|
|
|
bool m_dirty;
|
|
|
|
bool m_fog;
|
|
|
|
bool m_firstGroundSpot;
|
|
|
|
int m_secondTexNum;
|
2012-07-22 20:05:12 +00:00
|
|
|
std::string m_backgroundName;
|
2012-06-26 20:23:05 +00:00
|
|
|
Gfx::Color m_backgroundColorUp;
|
|
|
|
Gfx::Color m_backgroundColorDown;
|
|
|
|
Gfx::Color m_backgroundCloudUp;
|
|
|
|
Gfx::Color m_backgroundCloudDown;
|
|
|
|
bool m_backgroundFull;
|
|
|
|
bool m_backgroundQuarter;
|
|
|
|
bool m_overFront;
|
|
|
|
Gfx::Color m_overColor;
|
|
|
|
int m_overMode;
|
2012-08-10 21:31:42 +00:00
|
|
|
std::string m_foregroundImageName;
|
2012-06-26 20:23:05 +00:00
|
|
|
bool m_drawWorld;
|
|
|
|
bool m_drawFront;
|
|
|
|
float m_limitLOD[2];
|
2012-08-10 21:31:42 +00:00
|
|
|
float m_particleDensity;
|
2012-06-26 20:23:05 +00:00
|
|
|
float m_clippingDistance;
|
|
|
|
float m_lastClippingDistance;
|
|
|
|
float m_objectDetail;
|
|
|
|
float m_lastObjectDetail;
|
|
|
|
float m_terrainVision;
|
|
|
|
float m_gadgetQuantity;
|
|
|
|
int m_textureQuality;
|
|
|
|
bool m_totoMode;
|
|
|
|
bool m_lensMode;
|
|
|
|
bool m_waterMode;
|
|
|
|
bool m_skyMode;
|
|
|
|
bool m_backForce;
|
|
|
|
bool m_planetMode;
|
|
|
|
bool m_lightMode;
|
|
|
|
bool m_editIndentMode;
|
|
|
|
int m_editIndentValue;
|
|
|
|
float m_tracePrecision;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Ranks of highlighted objects
|
2012-08-10 21:31:42 +00:00
|
|
|
int m_highlightRank[100];
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Highlight visible?
|
2012-08-10 21:31:42 +00:00
|
|
|
bool m_highlight;
|
2012-08-11 15:17:04 +00:00
|
|
|
//@{
|
|
|
|
//! Highlight rectangle points
|
2012-08-10 21:31:42 +00:00
|
|
|
Math::Point m_highlightP1;
|
|
|
|
Math::Point m_highlightP2;
|
2012-08-11 15:17:04 +00:00
|
|
|
//@}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Texture directory name
|
2012-07-22 20:05:12 +00:00
|
|
|
std::string m_texPath;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Default texture create params
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::TextureCreateParams m_defaultTexParams;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Map of loaded textures (by name)
|
2012-07-22 20:05:12 +00:00
|
|
|
std::map<std::string, Gfx::Texture> m_texNameMap;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Reverse map of loaded textures (by texture)
|
2012-07-22 20:05:12 +00:00
|
|
|
std::map<Gfx::Texture, std::string> m_revTexNameMap;
|
|
|
|
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Mouse cursor definitions
|
2012-07-23 19:41:27 +00:00
|
|
|
Gfx::EngineMouse m_mice[Gfx::ENG_MOUSE_COUNT];
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Texture with mouse cursors
|
2012-07-24 22:27:01 +00:00
|
|
|
Gfx::Texture m_miceTexture;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Size of mouse cursor
|
2012-07-23 19:41:27 +00:00
|
|
|
Math::Point m_mouseSize;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Type of mouse cursor
|
2012-07-22 20:05:12 +00:00
|
|
|
Gfx::EngineMouseType m_mouseType;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Position of mouse in interface coords
|
2012-07-22 20:05:12 +00:00
|
|
|
Math::Point m_mousePos;
|
2012-08-11 15:17:04 +00:00
|
|
|
//! Is mouse visible?
|
2012-07-22 20:05:12 +00:00
|
|
|
bool m_mouseVisible;
|
2012-08-11 15:17:04 +00:00
|
|
|
|
|
|
|
//! Last engine render state (-1 at the beginning of frame)
|
|
|
|
int m_lastState;
|
|
|
|
//! Last color set with render state
|
|
|
|
Gfx::Color m_lastColor;
|
|
|
|
//! Last texture names for 2 used texture stages
|
|
|
|
std::string m_lastTexture[2];
|
|
|
|
//! Last material
|
|
|
|
Gfx::Material m_lastMaterial;
|
2012-06-24 13:41:56 +00:00
|
|
|
};
|
2012-06-22 14:31:55 +00:00
|
|
|
|
|
|
|
}; // namespace Gfx
|