changes needeto to cimpile on windows.

dev-ui
Zaba999 2012-09-17 20:47:27 +02:00
parent 050f9d2542
commit 844e11db4f
10 changed files with 41 additions and 38 deletions

View File

@ -18,6 +18,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(PLATFORM_WINDOWS 1)
set(PLATFORM_LINUX 0)
set(PLATFORM_OTHER 0)
set(PLATFORM_LIBS "-lintl")
# On Windows, GLEW is required
if (${USE_GLEW} MATCHES "auto")
set(USE_GLEW 1)

View File

@ -202,12 +202,12 @@ void Gfx::CCamera::Init(Math::Vector eye, Math::Vector lookat, float delay)
}
void Gfx::CCamera::SetObject(CObject* object)
void Gfx::CCamera::SetControllingObject(CObject* object)
{
m_cameraObj = object;
}
CObject* Gfx::CCamera::GetObject()
CObject* Gfx::CCamera::GetControllingObject()
{
return m_cameraObj;
}

View File

@ -136,8 +136,8 @@ class CCamera {
void Init(Math::Vector eye, Math::Vector lookat, float delay);
//! Sets the object controlling the camera
void SetObject(CObject* object);
CObject* GetObject();
void SetControllingObject(CObject* object);
CObject* GetControllingObject();
//! Change the type of camera
void SetType(Gfx::CameraType type);

View File

@ -154,7 +154,7 @@ begin:
pObj = m_main->GetSelectObject();
m_main->SelectObject(pObj);
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
if ( pObj == 0 )
{
m_camera->SetType(Gfx::CAM_TYPE_BACK);
@ -624,7 +624,7 @@ begin:
pObj = m_main->GetSelectObject();
m_main->SelectObject(pObj);
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
if ( pObj == 0 )
{
m_camera->SetType(Gfx::CAM_TYPE_BACK);
@ -1156,7 +1156,7 @@ bool CAutoBase::Abort()
pObj = m_main->GetSelectObject();
m_main->SelectObject(pObj);
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
if ( pObj == 0 )
{
m_camera->SetType(Gfx::CAM_TYPE_BACK);

View File

@ -308,7 +308,7 @@ bool CAutoPortico::EventProcess(const Event &event)
pObj = m_main->SearchHuman();
m_main->SelectObject(pObj);
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
m_camera->SetType(Gfx::CAM_TYPE_BACK);
m_phase = APOP_WAIT;
@ -367,7 +367,7 @@ bool CAutoPortico::Abort()
pObj = m_main->SearchHuman();
m_main->SelectObject(pObj);
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
m_camera->SetType(Gfx::CAM_TYPE_BACK);
if ( m_soundChannel != -1 )

View File

@ -382,9 +382,9 @@ void CObject::DeleteObject(bool bAll)
m_botVar->SetUserPtr(OBJECTDELETED);
}
if ( m_camera->GetObject() == this )
if ( m_camera->GetControllingObject() == this )
{
m_camera->SetObject(0);
m_camera->SetControllingObject(0);
}
for ( i=0 ; i<1000000 ; i++ )
@ -403,17 +403,17 @@ void CObject::DeleteObject(bool bAll)
type == Gfx::CAM_TYPE_FIX ||
type == Gfx::CAM_TYPE_EXPLO ||
type == Gfx::CAM_TYPE_ONBOARD) &&
m_camera->GetObject() == this )
m_camera->GetControllingObject() == this )
{
pObj = m_main->SearchNearest(GetPosition(0), this);
if ( pObj == 0 )
{
m_camera->SetObject(0);
m_camera->SetControllingObject(0);
m_camera->SetType(Gfx::CAM_TYPE_FREE);
}
else
{
m_camera->SetObject(pObj);
m_camera->SetControllingObject(pObj);
m_camera->SetType(Gfx::CAM_TYPE_BACK);
}
}

View File

@ -866,7 +866,7 @@ void CRobotMain::ChangePhase(Phase phase)
{
SaveAllScript();
m_sound->StopMusic();
m_camera->SetObject(0);
m_camera->SetControllingObject(0);
/* TODO: #if _SCHOOL
if ( true )
@ -2226,7 +2226,7 @@ CObject* CRobotMain::DeselectAll()
void CRobotMain::SelectOneObject(CObject* obj, bool displayError)
{
obj->SetSelect(true, displayError);
m_camera->SetObject(obj);
m_camera->SetControllingObject(obj);
ObjectType type = obj->GetType();
if ( type == OBJECT_HUMAN ||
@ -2737,8 +2737,8 @@ void CRobotMain::HiliteObject(Math::Point pos)
obj = DetectObject(pos);
if (m_camera->GetType() == Gfx::CAM_TYPE_ONBOARD &&
m_camera->GetObject() == obj)
if ((m_camera->GetType() == Gfx::CAM_TYPE_ONBOARD) &&
(m_camera->GetControllingObject() == obj))
return;
}
}
@ -4309,7 +4309,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (obj != nullptr)
{
SelectObject(obj);
m_camera->SetObject(obj);
m_camera->SetControllingObject(obj);
m_camera->SetType(obj->GetCameraType());
}
}
@ -4324,7 +4324,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
m_camera->FixCamera();
SelectObject(sel);
m_camera->SetObject(sel);
m_camera->SetControllingObject(sel);
m_beginSatCom = true; // message already displayed
}

View File

@ -18,6 +18,7 @@
#include <cstring>
#include <cstdio>
#include "math/geometry.h"
#include "graphics/engine/engine.h"

View File

@ -20,6 +20,7 @@
#include "common/global.h"
#include <string.h>
#include <cstdio>
@ -816,7 +817,7 @@ float OpFloat(char *line, const char *op, float def)
// Returns a string.
void OpString(char *line, char *op, char *buffer)
void OpString(char *line, const char *op, char *buffer)
{
line = SearchOp(line, op);
if ( *line == 0 )
@ -831,7 +832,7 @@ void OpString(char *line, char *op, char *buffer)
// Returns the type of an object.
ObjectType OpTypeObject(char *line, char *op, ObjectType def)
ObjectType OpTypeObject(char *line, const char *op, ObjectType def)
{
line = SearchOp(line, op);
if ( *line == 0 ) return def;
@ -840,7 +841,7 @@ ObjectType OpTypeObject(char *line, char *op, ObjectType def)
// Returns the type of a water.
Gfx::WaterType OpTypeWater(char *line, char *op, Gfx::WaterType def)
Gfx::WaterType OpTypeWater(char *line, const char *op, Gfx::WaterType def)
{
line = SearchOp(line, op);
if ( *line == 0 ) return def;
@ -849,7 +850,7 @@ Gfx::WaterType OpTypeWater(char *line, char *op, Gfx::WaterType def)
// Returns the type of a terrain.
Gfx::EngineObjectType OpTypeTerrain(char *line, char *op, Gfx::EngineObjectType def)
Gfx::EngineObjectType OpTypeTerrain(char *line, const char *op, Gfx::EngineObjectType def)
{
line = SearchOp(line, op);
if ( *line == 0 ) return def;
@ -858,7 +859,7 @@ Gfx::EngineObjectType OpTypeTerrain(char *line, char *op, Gfx::EngineObjectType
// Returns the type of research.
int OpResearch(char *line, char *op)
int OpResearch(char *line, const char *op)
{
line = SearchOp(line, op);
if ( *line == 0 ) return 0;
@ -867,7 +868,7 @@ int OpResearch(char *line, char *op)
// Returns the type of pyrotechnic effect.
Gfx::PyroType OpPyro(char *line, char *op)
Gfx::PyroType OpPyro(char *line, const char *op)
{
line = SearchOp(line, op);
if ( *line == 0 ) return Gfx::PT_NULL;
@ -885,7 +886,7 @@ Gfx::CameraType OpCamera(char *line, const char *op)
// Returns the type of a building.
int OpBuild(char *line, char *op)
int OpBuild(char *line, const char *op)
{
line = SearchOp(line, op);
if ( *line == 0 ) return 0;
@ -894,7 +895,7 @@ int OpBuild(char *line, char *op)
// Returns a position in the XZ plane (top view).
Math::Vector OpPos(char *line, char *op)
Math::Vector OpPos(char *line, const char *op)
{
Math::Vector pos;
@ -929,7 +930,7 @@ Math::Vector OpDir(char *line, const char *op)
}
// Reads a color (-1 .. 1).
Gfx::Color OpColor(char *line, char *op, Gfx::Color def)
Gfx::Color OpColor(char *line, const char *op, Gfx::Color def)
{
Gfx::Color color;

View File

@ -44,15 +44,15 @@ extern const char* GetCamera(Gfx::CameraType type);
extern int OpInt(char *line, const char *op, int def);
extern float OpFloat(char *line, const char *op, float def);
extern void OpString(char *line, char *op, char *buffer);
extern ObjectType OpTypeObject(char *line, char *op, ObjectType def);
extern Gfx::WaterType OpTypeWater(char *line, char *op, Gfx::WaterType def);
extern Gfx::EngineObjectType OpTypeTerrain(char *line, char *op, Gfx::EngineObjectType def);
extern int OpResearch(char *line, char *op);
extern Gfx::PyroType OpPyro(char *line, char *op);
extern void OpString(char *line, const char *op, char *buffer);
extern ObjectType OpTypeObject(char *line, const char *op, ObjectType def);
extern Gfx::WaterType OpTypeWater(char *line, const char *op, Gfx::WaterType def);
extern Gfx::EngineObjectType OpTypeTerrain(char *line, const char *op, Gfx::EngineObjectType def);
extern int OpResearch(char *line, const char *op);
extern Gfx::PyroType OpPyro(char *line, const char *op);
extern Gfx::CameraType OpCamera(char *line, const char *op);
extern int OpBuild(char *line, char *op);
extern Math::Vector OpPos(char *line, char *op);
extern int OpBuild(char *line, const char *op);
extern Math::Vector OpPos(char *line, const char *op);
extern Math::Vector OpDir(char *line, const char *op);
extern Gfx::Color OpColor(char *line, char *op, Gfx::Color def);
extern Gfx::Color OpColor(char *line, const char *op, Gfx::Color def);