CApplication and Gfx::CEngine interfaces & other

- added CApplication and Gfx::CEngine interfaces
- added Gfx::Material struct
- added Math::IntPoint struct
- added template for Gfx::CDevice class
- added templates for Gfx::CGLDevice and Gfx::CGLEngine classes
dev-ui
Piotr Dziwinski 2012-06-24 15:41:56 +02:00
parent 11c947f212
commit 3478978c21
9 changed files with 397 additions and 99 deletions

View File

@ -43,6 +43,8 @@ graphics/common/pyro.cpp
graphics/common/terrain.cpp graphics/common/terrain.cpp
graphics/common/text.cpp graphics/common/text.cpp
graphics/common/water.cpp graphics/common/water.cpp
graphics/opengl/gldevice.cpp
graphics/opengl/glengine.cpp
object/auto/auto.cpp object/auto/auto.cpp
object/auto/autobase.cpp object/auto/autobase.cpp
object/auto/autoconvert.cpp object/auto/autoconvert.cpp

View File

@ -20,8 +20,137 @@
#pragma once #pragma once
#include "common/misc.h"
#include "graphics/common/engine.h"
class CInstanceManager;
class CEvent;
class CRobotMain;
class CSound;
class CApplication class CApplication
{ {
// TODO public:
CApplication();
~CApplication();
protected:
//LRESULT OnQuerySuspend( DWORD dwFlags );
//LRESULT OnResumeSuspend( DWORD dwData );
public:
Error RegQuery();
Error AudioQuery();
Error CheckMistery(char *strCmdLine);
int GetVidMemTotal();
bool IsVideo8MB();
bool IsVideo32MB();
//HRESULT Create( HINSTANCE, TCHAR* );
int Run();
//LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
void Pause(bool pause);
//Math::Point ConvPosToInterface(HWND hWnd, LPARAM lParam);
void SetMousePos(Math::Point pos);
void StepSimul(float rTime);
char* RetCDpath();
void SetShowStat(bool show);
bool RetShowStat();
void SetDebugMode(bool mode);
bool RetDebugMode();
bool RetSetupMode();
bool EnumDevices(char *bufDevices, int lenDevices, char *bufModes, int lenModes, int &totalDevices, int &selectDevices, int &totalModes, int &selectModes);
bool RetFullScreen();
bool ChangeDevice(char *device, char *mode, bool bFull);
void FlushPressKey();
void ResetKey();
void SetKey(int keyRank, int option, int key);
int RetKey(int keyRank, int option);
void SetJoystick(bool bEnable);
bool RetJoystick();
void SetMouseType(Gfx::MouseType type);
void SetNiceMouse(bool bNice);
bool RetNiceMouse();
bool RetNiceMouseCap();
bool WriteScreenShot(char *filename, int width, int height);
//bool GetRenderDC(HDC &hDC);
//bool ReleaseRenderDC(HDC &hDC);
//PBITMAPINFO CreateBitmapInfoStruct(HBITMAP hBmp);
//bool CreateBMPFile(LPTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, HDC hDC);
protected:
//HRESULT ConfirmDevice( DDCAPS* pddDriverCaps, D3DDEVICEDESC7* pd3dDeviceDesc );
//HRESULT Initialize3DEnvironment();
//HRESULT Change3DEnvironment();
//HRESULT CreateZBuffer(GUID* pDeviceGUID);
//HRESULT Render3DEnvironment();
//VOID Cleanup3DEnvironment();
//VOID DeleteDeviceObjects();
//VOID DisplayFrameworkError( HRESULT, DWORD );
void InitText();
void DrawSuppl();
void ShowStats();
void OutputText(long x, long y, char* str);
protected:
CInstanceManager* m_iMan;
CEvent* m_event;
//HINSTANCE m_instance;
//HWND m_hWnd;
//D3DEnum_DeviceInfo* m_pDeviceInfo;
//LPDIRECTDRAW7 m_pDD;
//LPDIRECT3D7 m_pD3D;
//LPDIRECT3DDEVICE7 m_pD3DDevice;
//LPDIRECTDRAWSURFACE7 m_pddsRenderTarget;
//DDSURFACEDESC2 m_ddsdRenderTarget;
//LPDIRECTDRAWSURFACE7 m_pddsDepthBuffer;
//HANDLE m_thread;
//DWORD m_threadId;
char m_CDpath[100];
//CD3DFramework7* m_pFramework;
bool m_active;
bool m_activateApp;
bool m_ready;
bool m_joystick;
long m_vidMemTotal;
char* m_strWindowTitle;
bool m_bAppUseZBuffer;
bool m_bAppUseStereo;
bool m_bShowStats;
bool m_bDebugMode;
bool m_bAudioState;
bool m_bAudioTrack;
bool m_bNiceMouse;
bool m_bSetupMode;
//HRESULT (*m_fnConfirmDevice)(DDCAPS*, D3DDEVICEDESC7*);
public:
Gfx::CEngine* m_pD3DEngine;
CRobotMain* m_pRobotMain;
CSound* m_pSound;
int m_keyState;
Math::Vector m_axeKey;
Math::Vector m_axeJoy;
bool m_joyButton[32];
Math::Point m_mousePos;
long m_mshMouseWheel;
float m_aTime;
long m_key[50][2];
}; };

View File

@ -0,0 +1,30 @@
// * 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/.
// device.h
#pragma once
namespace Gfx {
class CDevice
{
// TODO
};
}; // namespace Gfx

View File

@ -20,28 +20,31 @@
#pragma once #pragma once
#include "graphics/common/color.h"
#include "graphics/common/material.h"
#include "graphics/common/vertex.h"
#include "math/intpoint.h"
#include "math/matrix.h"
#include "math/point.h" #include "math/point.h"
#include "math/vector.h" #include "math/vector.h"
#include "math/matrix.h"
namespace Gfx {
/*
TODO
class CApplication; class CApplication;
class CInstanceManager; class CInstanceManager;
class CObject; class CObject;
class CSound;
namespace Gfx {
class CDevice;
class CLight; class CLight;
class CText; class CText;
class CParticule; class CParticle;
class CWater; class CWater;
class CCloud; class CCloud;
class CBlitz; class CLightning;
class CPlanet; class CPlanet;
class CSound;
class CTerrain; class CTerrain;
@ -174,7 +177,7 @@ struct ObjLevel6
Gfx::Material material; Gfx::Material material;
int state; int state;
Gfx::TriangleType type; Gfx::TriangleType type;
Math::VertexTex2 vertex[1]; Gfx::VertexTex2 vertex[1];
}; };
struct ObjLevel5 struct ObjLevel5
@ -280,29 +283,29 @@ struct GroundMark
class CGfxEngine class CEngine
{ {
public: public:
CGfxEngine(CInstanceManager *iMan, CApplication *app); CEngine(CInstanceManager *iMan, CApplication *app);
~CGfxEngine(); ~CEngine();
void SetDevice(Gfx::Device *device); void SetDevice(Gfx::CDevice *device);
Gfx::Device* RetDevice(); Gfx::CDevice* RetDevice();
void SetTerrain(Gfx::CTerrain* terrain); void SetTerrain(Gfx::CTerrain* terrain);
bool WriteProfile(); bool WriteProfile();
void SetPause(bool bPause); void SetPause(bool pause);
bool RetPause(); bool RetPause();
void SetMovieLock(bool bLock); void SetMovieLock(bool lock);
bool RetMovieLock(); bool RetMovieLock();
void SetShowStat(bool bShow); void SetShowStat(bool show);
bool RetShowStat(); bool RetShowStat();
void SetRenderEnable(bool bEnable); void SetRenderEnable(bool enable);
int OneTimeSceneInit(); int OneTimeSceneInit();
int InitDeviceObjects(); int InitDeviceObjects();
@ -320,14 +323,14 @@ public:
void SetInfoText(int line, char* text); void SetInfoText(int line, char* text);
char * RetInfoText(int line); char * RetInfoText(int line);
//LRESULT MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); //LRESULT MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void FirstExecuteAdapt(bool bFirst); void FirstExecuteAdapt(bool first);
//int GetVidMemTotal(); //int GetVidMemTotal();
//bool IsVideo8MB(); //bool IsVideo8MB();
//bool IsVideo32MB(); //bool IsVideo32MB();
bool EnumDevices(char *bufDevices, int lenDevices, char *bufModes, int lenModes, int &totalDevices, int &selectDevices, int &totalModes, int &selectModes); bool EnumDevices(char *bufDevices, int lenDevices, char *bufModes, int lenModes, int &totalDevices, int &selectDevices, int &totalModes, int &selectModes);
bool RetFullScreen(); bool RetFullScreen();
bool ChangeDevice(char *device, char *mode, bool bFull); bool ChangeDevice(char *device, char *mode, bool full);
Math::Matrix* RetMatView(); Math::Matrix* RetMatView();
Math::Matrix* RetMatLeftView(); Math::Matrix* RetMatLeftView();
@ -342,19 +345,19 @@ public:
int CreateObject(); int CreateObject();
void FlushObject(); void FlushObject();
bool DeleteObject(int objRank); bool DeleteObject(int objRank);
bool SetDrawWorld(int objRank, bool bDraw); bool SetDrawWorld(int objRank, bool draw);
bool SetDrawFront(int objRank, bool bDraw); bool SetDrawFront(int objRank, bool draw);
bool AddTriangle(int objRank, Math::VertexTex2* vertex, int nb, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, bool bGlobalUpdate); bool AddTriangle(int objRank, Gfx::VertexTex2* vertex, int nb, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, bool globalUpdate);
bool AddSurface(int objRank, Math::VertexTex2* vertex, int nb, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, bool bGlobalUpdate); bool AddSurface(int objRank, Gfx::VertexTex2* vertex, int nb, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, bool globalUpdate);
bool AddQuick(int objRank, Gfx::ObjLevel6* buffer, char* texName1, char* texName2, float min, float max, bool bGlobalUpdate); bool AddQuick(int objRank, Gfx::ObjLevel6* buffer, char* texName1, char* texName2, float min, float max, bool globalUpdate);
Gfx::ObjLevel6* SearchTriangle(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max); Gfx::ObjLevel6* SearchTriangle(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max);
void ChangeLOD(); void ChangeLOD();
bool ChangeSecondTexture(int objRank, char* texName2); bool ChangeSecondTexture(int objRank, char* texName2);
int RetTotalTriangles(int objRank); int RetTotalTriangles(int objRank);
int GetTriangles(int objRank, float min, float max, Gfx::Triangle* buffer, int size, float percent); int GetTriangles(int objRank, float min, float max, Gfx::Triangle* buffer, int size, float percent);
bool GetBBox(int objRank, Math::Vector &min, Math::Vector &max); bool GetBBox(int objRank, Math::Vector &min, Math::Vector &max);
bool ChangeTextureMapping(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, Gfx::Maping mode, float au, float bu, float av, float bv); bool ChangeTextureMapping(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, Gfx::Mapping mode, float au, float bu, float av, float bv);
bool TrackTextureMapping(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, Gfx::Maping mode, float pos, float factor, float tl, float ts, float tt); bool TrackTextureMapping(int objRank, const Gfx::Material &mat, int state, char* texName1, char* texName2, float min, float max, Gfx::Mapping mode, float pos, float factor, float tl, float ts, float tt);
bool SetObjectTransform(int objRank, const Math::Matrix &transform); bool SetObjectTransform(int objRank, const Math::Matrix &transform);
bool GetObjectTransform(int objRank, Math::Matrix &transform); bool GetObjectTransform(int objRank, Math::Matrix &transform);
bool SetObjectType(int objRank, Gfx::ObjectType type); bool SetObjectType(int objRank, Gfx::ObjectType type);
@ -363,7 +366,7 @@ public:
bool ShadowCreate(int objRank); bool ShadowCreate(int objRank);
void ShadowDelete(int objRank); void ShadowDelete(int objRank);
bool SetObjectShadowHide(int objRank, bool bHide); bool SetObjectShadowHide(int objRank, bool hide);
bool SetObjectShadowType(int objRank, Gfx::ShadowType type); bool SetObjectShadowType(int objRank, Gfx::ShadowType type);
bool SetObjectShadowPos(int objRank, const Math::Vector &pos); bool SetObjectShadowPos(int objRank, const Math::Vector &pos);
bool SetObjectShadowNormal(int objRank, const Math::Vector &n); bool SetObjectShadowNormal(int objRank, const Math::Vector &n);
@ -394,17 +397,17 @@ public:
bool LoadAllTexture(); bool LoadAllTexture();
void SetLimitLOD(int rank, float limit); void SetLimitLOD(int rank, float limit);
float RetLimitLOD(int rank, bool bLast=false); float RetLimitLOD(int rank, bool last=false);
void SetTerrainVision(float vision); void SetTerrainVision(float vision);
void SetGroundSpot(bool bMode); void SetGroundSpot(bool mode);
bool RetGroundSpot(); bool RetGroundSpot();
void SetShadow(bool bMode); void SetShadow(bool mode);
bool RetShadow(); bool RetShadow();
void SetDirty(bool bMode); void SetDirty(bool mode);
bool RetDirty(); bool RetDirty();
void SetFog(bool bMode); void SetFog(bool mode);
bool RetFog(); bool RetFog();
bool RetStateColor(); bool RetStateColor();
@ -414,8 +417,8 @@ public:
void SetRankView(int rank); void SetRankView(int rank);
int RetRankView(); int RetRankView();
void SetDrawWorld(bool bDraw); void SetDrawWorld(bool draw);
void SetDrawFront(bool bDraw); void SetDrawFront(bool draw);
void SetAmbiantColor(const Gfx::Color &color, int rank=0); void SetAmbiantColor(const Gfx::Color &color, int rank=0);
Gfx::Color RetAmbiantColor(int rank=0); Gfx::Color RetAmbiantColor(int rank=0);
@ -426,17 +429,17 @@ public:
void SetFogColor(const Gfx::Color &color, int rank=0); void SetFogColor(const Gfx::Color &color, int rank=0);
Gfx::Color RetFogColor(int rank=0); Gfx::Color RetFogColor(int rank=0);
void SetDeepView(float length, int rank=0, bool bRef=false); void SetDeepView(float length, int rank=0, bool ref=false);
float RetDeepView(int rank=0); float RetDeepView(int rank=0);
void SetFogStart(float start, int rank=0); void SetFogStart(float start, int rank=0);
float RetFogStart(int rank=0); float RetFogStart(int rank=0);
void SetBackground(char *name, Gfx::Color up=0, Gfx::Color down=0, Gfx::Color cloudUp=0, Gfx::Color cloudDown=0, bool bFull=false, bool bQuarter=false); void SetBackground(char *name, Gfx::Color up=Gfx::Color(), Gfx::Color down=Gfx::Color(), Gfx::Color cloudUp=Gfx::Color(), Gfx::Color cloudDown=Gfx::Color(), bool full=false, bool quarter=false);
void RetBackground(char *name, Gfx::Color &up, Gfx::Color &down, Gfx::Color &cloudUp, Gfx::Color &cloudDown, bool &bFull, bool &bQuarter); void RetBackground(char *name, Gfx::Color &up, Gfx::Color &down, Gfx::Color &cloudUp, Gfx::Color &cloudDown, bool &full, bool &quarter);
void SetFrontsizeName(char *name); void SetFrontsizeName(char *name);
void SetOverFront(bool bFront); void SetOverFront(bool front);
void SetOverColor(const Gfx::Color &color=0, int mode=RSTATE_TCOLOR_BLACK); void SetOverColor(const Gfx::Color &color=Gfx::Color(), int mode=RSTATE_TCOLOR_BLACK);
void SetParticuleDensity(float value); void SetParticuleDensity(float value);
float RetParticuleDensity(); float RetParticuleDensity();
@ -454,31 +457,31 @@ public:
void SetTextureQuality(int value); void SetTextureQuality(int value);
int RetTextureQuality(); int RetTextureQuality();
void SetTotoMode(bool bPresent); void SetTotoMode(bool present);
bool RetTotoMode(); bool RetTotoMode();
void SetLensMode(bool bPresent); void SetLensMode(bool present);
bool RetLensMode(); bool RetLensMode();
void SetWaterMode(bool bPresent); void SetWaterMode(bool present);
bool RetWaterMode(); bool RetWaterMode();
void SetBlitzMode(bool bPresent); void SetBlitzMode(bool present);
bool RetBlitzMode(); bool RetBlitzMode();
void SetSkyMode(bool bPresent); void SetSkyMode(bool present);
bool RetSkyMode(); bool RetSkyMode();
void SetBackForce(bool bPresent); void SetBackForce(bool present);
bool RetBackForce(); bool RetBackForce();
void SetPlanetMode(bool bPresent); void SetPlanetMode(bool present);
bool RetPlanetMode(); bool RetPlanetMode();
void SetLightMode(bool bPresent); void SetLightMode(bool present);
bool RetLightMode(); bool RetLightMode();
void SetEditIndentMode(bool bAuto); void SetEditIndentMode(bool auto);
bool RetEditIndentMode(); bool RetEditIndentMode();
void SetEditIndentValue(int value); void SetEditIndentValue(int value);
@ -506,17 +509,17 @@ public:
void SetKey(int keyRank, int option, int key); void SetKey(int keyRank, int option, int key);
int RetKey(int keyRank, int option); int RetKey(int keyRank, int option);
void SetJoystick(bool bEnable); void SetJoystick(bool enable);
bool RetJoystick(); bool RetJoystick();
void SetDebugMode(bool bMode); void SetDebugMode(bool mode);
bool RetDebugMode(); bool RetDebugMode();
bool RetSetupMode(); bool RetSetupMode();
bool IsVisiblePoint(const Math::Vector &pos); bool IsVisiblePoint(const Math::Vector &pos);
int DetectObject(Math::Point mouse); int DetectObject(Math::Point mouse);
void SetState(int state, Gfx::Color color=0xffffffff); void SetState(int state, Gfx::Color color=Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f));
void SetTexture(char *name, int stage=0); void SetTexture(char *name, int stage=0);
void SetMaterial(const Gfx::Material &mat); void SetMaterial(const Gfx::Material &mat);
@ -525,15 +528,15 @@ public:
Math::Point RetMousePos(); Math::Point RetMousePos();
void SetMouseType(Gfx::MouseType type); void SetMouseType(Gfx::MouseType type);
Gfx::MouseType RetMouseType(); Gfx::MouseType RetMouseType();
void SetMouseHide(bool bHide); void SetMouseHide(bool hide);
bool RetMouseHide(); bool RetMouseHide();
void SetNiceMouse(bool bNice); void SetNiceMouse(bool nice);
bool RetNiceMouse(); bool RetNiceMouse();
bool RetNiceMouseCap(); bool RetNiceMouseCap();
CText* RetText(); CText* RetText();
bool ChangeColor(char *name, Gfx::Color colorRef1, Gfx::Color colorNew1, Gfx::Color colorRef2, Gfx::Color colorNew2, float tolerance1, float tolerance2, Math::Point ts, Math::Point ti, Math::Point *pExclu=0, float shift=0.0f, bool bHSV=false); bool ChangeColor(char *name, Gfx::Color colorRef1, Gfx::Color colorNew1, Gfx::Color colorRef2, Gfx::Color colorNew2, float tolerance1, float tolerance2, Math::Point ts, Math::Point ti, Math::Point *pExclu=0, float shift=0.0f, bool hSV=false);
bool OpenImage(char *name); bool OpenImage(char *name);
bool CopyImage(); bool CopyImage();
bool LoadImage(); bool LoadImage();
@ -562,7 +565,7 @@ protected:
bool IsVisible(int objRank); bool IsVisible(int objRank);
bool DetectBBox(int objRank, Math::Point mouse); bool DetectBBox(int objRank, Math::Point mouse);
bool DetectTriangle(Math::Point mouse, Math::VertexTex2 *triangle, int objRank, float &dist); bool DetectTriangle(Math::Point mouse, Gfx::VertexTex2 *triangle, int objRank, float &dist);
bool TransformPoint(Math::Vector &p2D, int objRank, Math::Vector p3D); bool TransformPoint(Math::Vector &p2D, int objRank, Math::Vector p3D);
void ComputeDistance(); void ComputeDistance();
void UpdateGeometry(); void UpdateGeometry();
@ -583,16 +586,16 @@ protected:
protected: protected:
CInstanceManager* m_iMan; CInstanceManager* m_iMan;
CApplication* m_app; CApplication* m_app;
Gfx::Device* m_device; Gfx::CDevice* m_device;
CText* m_text; Gfx::CText* m_text;
CLight* m_light; Gfx::CLight* m_light;
CParticule* m_particule; Gfx::CParticle* m_particule;
CWater* m_water; Gfx::CWater* m_water;
CCloud* m_cloud; Gfx::CCloud* m_cloud;
CBlitz* m_blitz; Gfx::CLightning* m_blitz;
CPlanet* m_planet; Gfx::CPlanet* m_planet;
Gfx::CTerrain* m_terrain;
CSound* m_sound; CSound* m_sound;
CTerrain* m_terrain;
int m_blackSrcBlend[2]; int m_blackSrcBlend[2];
int m_blackDestBlend[2]; int m_blackDestBlend[2];
@ -618,12 +621,12 @@ protected:
float m_absTime; float m_absTime;
float m_lastTime; float m_lastTime;
float m_speed; float m_speed;
bool m_bPause; bool m_pause;
bool m_bRender; bool m_render;
bool m_bMovieLock; bool m_movieLock;
POINT m_dim; Math::IntPoint m_dim;
POINT m_lastDim; Math::IntPoint m_lastDim;
Gfx::ObjLevel1* m_objectPointer; Gfx::ObjLevel1* m_objectPointer;
int m_objectParamTotal; int m_objectParamTotal;
Gfx::Object* m_objectParam; Gfx::Object* m_objectParam;
@ -643,30 +646,30 @@ protected:
float m_fogStart[2]; float m_fogStart[2];
Gfx::Color m_waterAddColor; Gfx::Color m_waterAddColor;
int m_statisticTriangle; int m_statisticTriangle;
bool m_bUpdateGeometry; bool m_updateGeometry;
char m_infoText[10][200]; char m_infoText[10][200];
int m_alphaMode; int m_alphaMode;
bool m_bStateColor; bool m_stateColor;
bool m_bForceStateColor; bool m_forceStateColor;
bool m_bGroundSpot; bool m_groundSpotVisible;
bool m_bShadow; bool m_shadowVisible;
bool m_bDirty; bool m_dirty;
bool m_bFog; bool m_fog;
bool m_bFirstGroundSpot; bool m_firstGroundSpot;
int m_secondTexNum; int m_secondTexNum;
char m_backgroundName[50]; char m_backgroundName[50];
Gfx::Color m_backgroundColorUp; Gfx::Color m_backgroundColorUp;
Gfx::Color m_backgroundColorDown; Gfx::Color m_backgroundColorDown;
Gfx::Color m_backgroundCloudUp; Gfx::Color m_backgroundCloudUp;
Gfx::Color m_backgroundCloudDown; Gfx::Color m_backgroundCloudDown;
bool m_bBackgroundFull; bool m_backgroundFull;
bool m_bBackgroundQuarter; bool m_backgroundQuarter;
bool m_bOverFront; bool m_overFront;
Gfx::Color m_overColor; Gfx::Color m_overColor;
int m_overMode; int m_overMode;
char m_frontsizeName[50]; char m_frontsizeName[50];
bool m_bDrawWorld; bool m_drawWorld;
bool m_bDrawFront; bool m_drawFront;
float m_limitLOD[2]; float m_limitLOD[2];
float m_particuleDensity; float m_particuleDensity;
float m_clippingDistance; float m_clippingDistance;
@ -676,19 +679,19 @@ protected:
float m_terrainVision; float m_terrainVision;
float m_gadgetQuantity; float m_gadgetQuantity;
int m_textureQuality; int m_textureQuality;
bool m_bTotoMode; bool m_totoMode;
bool m_bLensMode; bool m_lensMode;
bool m_bWaterMode; bool m_waterMode;
bool m_bSkyMode; bool m_skyMode;
bool m_bBackForce; bool m_backForce;
bool m_bPlanetMode; bool m_planetMode;
bool m_bLightMode; bool m_lightMode;
bool m_bEditIndentMode; bool m_editIndentMode;
int m_editIndentValue; int m_editIndentValue;
float m_tracePrecision; float m_tracePrecision;
int m_hiliteRank[100]; int m_hiliteRank[100];
bool m_bHilite; bool m_hilite;
Math::Point m_hiliteP1; Math::Point m_hiliteP1;
Math::Point m_hiliteP2; Math::Point m_hiliteP2;
@ -699,14 +702,14 @@ protected:
Math::Point m_mousePos; Math::Point m_mousePos;
Gfx::MouseType m_mouseType; Gfx::MouseType m_mouseType;
bool m_bMouseHide; bool m_mouseHide;
bool m_bNiceMouse; bool m_niceMouse;
//LPDIRECTDRAWSURFACE7 m_imageSurface; //LPDIRECTDRAWSURFACE7 m_imageSurface;
//DDSURFACEDESC2 m_imageDDSD; //DDSURFACEDESC2 m_imageDDSD;
//WORD* m_imageCopy; //WORD* m_imageCopy;
//int m_imageDX; //int m_imageDX;
//int m_imageDY; //int m_imageDY;
};*/ };
}; // namespace Gfx }; // namespace Gfx

View File

@ -21,6 +21,23 @@
namespace Gfx { namespace Gfx {
// TODO struct Material /**
* \struct Material Material of a surface
*
* This structure was created as analog to DirectX's D3DMATERIAL.
*
* It contains values of 3 material colors: diffuse, ambient and specular.
* In D3DMATERIAL there are other fields, but they are not used
* by the graphics engine.
*/
struct Material
{
//! Diffuse color
Gfx::Color diffuse;
//! Ambient color
Gfx::Color ambient;
//! Specular color
Gfx::Color specular;
};
}; // namespace Gfx }; // namespace Gfx

View File

@ -0,0 +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/.
// gldevice.cpp
#include "graphics/opengl/gldevice.h"
// TODO

View File

@ -0,0 +1,31 @@
// * 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/.
// gldevice.h
#pragma once
#include "graphics/common/device.h"
namespace Gfx {
class CGLDevice : public Gfx::CDevice
{
// TODO
};
}; // namespace Gfx

View File

@ -0,0 +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/.
// glengine.h
#include "graphics/opengl/glengine.h"
// TODO

44
src/math/intpoint.h Normal file
View File

@ -0,0 +1,44 @@
// * 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/.
/** @defgroup MathIntPointModule math/intpoint.h
Contains the IntPoint struct.
*/
#pragma once
namespace Math {
/* @{ */ // start of group
/**
* \struct IntPoint 2D Point with integer coords
*
* Analog of WinAPI's POINT struct.
*/
struct IntPoint
{
//! X coord
long x;
//! Y coord
long y;
IntPoint(long aX = 0, long aY = 0) : x(aX), y(aY) {}
};
/* @} */ // end of group
}; // namespace Math