Compile fixes for MSVC2013
parent
db3596ace1
commit
d703eb7165
|
@ -141,7 +141,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
message(STATUS "Detected MSVC compiler")
|
message(STATUS "Detected MSVC compiler")
|
||||||
|
|
||||||
set(NORMAL_CXX_FLAGS "/wd\"4244\" /wd\"4309\" /wd\"4800\" /wd\"4996\"") # disable some useless warnings
|
set(NORMAL_CXX_FLAGS "/wd\"4244\" /wd\"4309\" /wd\"4800\" /wd\"4996\" /wd\"4351\"") # disable some useless warnings
|
||||||
set(RELEASE_CXX_FLAGS "")
|
set(RELEASE_CXX_FLAGS "")
|
||||||
set(DEBUG_CXX_FLAGS "")
|
set(DEBUG_CXX_FLAGS "")
|
||||||
set(TEST_CXX_FLAGS "")
|
set(TEST_CXX_FLAGS "")
|
||||||
|
|
|
@ -37,7 +37,7 @@ template<> CInput* CSingleton<CInput>::m_instance = nullptr;
|
||||||
CInput::CInput()
|
CInput::CInput()
|
||||||
: m_keyPresses()
|
: m_keyPresses()
|
||||||
{
|
{
|
||||||
m_keyTable =
|
m_keyTable = std::map<InputSlot, std::string>
|
||||||
{
|
{
|
||||||
{ INPUT_SLOT_LEFT, "left" },
|
{ INPUT_SLOT_LEFT, "left" },
|
||||||
{ INPUT_SLOT_RIGHT, "right" },
|
{ INPUT_SLOT_RIGHT, "right" },
|
||||||
|
|
|
@ -570,7 +570,7 @@ struct KeyEventData : public EventData
|
||||||
//! NOTE: applicable only to EVENT_KEY_DOWN events!
|
//! NOTE: applicable only to EVENT_KEY_DOWN events!
|
||||||
unsigned int unicode = 0;
|
unsigned int unicode = 0;
|
||||||
//! Input binding slot for this key
|
//! Input binding slot for this key
|
||||||
InputSlot slot = {};
|
InputSlot slot = INPUT_SLOT_LEFT;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -600,7 +600,7 @@ struct MouseButtonEventData : public EventData
|
||||||
}
|
}
|
||||||
|
|
||||||
//! The mouse button
|
//! The mouse button
|
||||||
MouseButton button = {};
|
MouseButton button = MOUSE_BUTTON_LEFT;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -625,7 +625,7 @@ struct MouseWheelEventData : public EventData
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Wheel direction
|
//! Wheel direction
|
||||||
WheelDirection dir = {};
|
WheelDirection dir = WHEEL_UP;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -713,6 +713,34 @@ struct Event
|
||||||
customParam(0)
|
customParam(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Event(const Event&) = delete;
|
||||||
|
Event& operator=(const Event&) = delete;
|
||||||
|
|
||||||
|
// Workaround for MSVC2013
|
||||||
|
Event(Event&& other)
|
||||||
|
: type(std::move(other.type)),
|
||||||
|
rTime(std::move(other.rTime)),
|
||||||
|
motionInput(std::move(other.motionInput)),
|
||||||
|
kmodState(std::move(other.kmodState)),
|
||||||
|
mousePos(std::move(other.mousePos)),
|
||||||
|
mouseButtonsState(std::move(other.mouseButtonsState)),
|
||||||
|
customParam(std::move(other.customParam)),
|
||||||
|
data(std::move(other.data))
|
||||||
|
{}
|
||||||
|
|
||||||
|
Event& operator=(Event&& other)
|
||||||
|
{
|
||||||
|
type = std::move(other.type);
|
||||||
|
rTime = std::move(other.rTime);
|
||||||
|
motionInput = std::move(other.motionInput);
|
||||||
|
kmodState = std::move(other.kmodState);
|
||||||
|
mousePos = std::move(other.mousePos);
|
||||||
|
mouseButtonsState = std::move(other.mouseButtonsState);
|
||||||
|
customParam = std::move(other.customParam);
|
||||||
|
data = std::move(other.data);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//! Convenience function for getting appropriate EventData subclass
|
//! Convenience function for getting appropriate EventData subclass
|
||||||
template<typename EventDataSubclass>
|
template<typename EventDataSubclass>
|
||||||
EventDataSubclass* GetData()
|
EventDataSubclass* GetData()
|
||||||
|
|
|
@ -4758,7 +4758,7 @@ void CEngine::DrawStats()
|
||||||
|
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
|
|
||||||
auto drawStatsLine = [&](const std::string& name = "", const std::string& value = "")
|
auto drawStatsLine = [&](const std::string& name, const std::string& value)
|
||||||
{
|
{
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
{
|
{
|
||||||
|
@ -4799,13 +4799,13 @@ void CEngine::DrawStats()
|
||||||
m_app->GetPerformanceCounterData(PCNT_RENDER_SHADOW_MAP);
|
m_app->GetPerformanceCounterData(PCNT_RENDER_SHADOW_MAP);
|
||||||
|
|
||||||
drawStatsCounter("Event processing", PCNT_EVENT_PROCESSING);
|
drawStatsCounter("Event processing", PCNT_EVENT_PROCESSING);
|
||||||
drawStatsLine();
|
drawStatsLine("", "");
|
||||||
drawStatsCounter("Frame update", PCNT_UPDATE_ALL);
|
drawStatsCounter("Frame update", PCNT_UPDATE_ALL);
|
||||||
drawStatsValue (" Engine update", engineUpdate);
|
drawStatsValue (" Engine update", engineUpdate);
|
||||||
drawStatsCounter(" Particle update", PCNT_UPDATE_PARTICLE);
|
drawStatsCounter(" Particle update", PCNT_UPDATE_PARTICLE);
|
||||||
drawStatsCounter(" Game update", PCNT_UPDATE_GAME);
|
drawStatsCounter(" Game update", PCNT_UPDATE_GAME);
|
||||||
drawStatsValue( " Other update", otherUpdate);
|
drawStatsValue( " Other update", otherUpdate);
|
||||||
drawStatsLine();
|
drawStatsLine("", "");
|
||||||
drawStatsCounter("Frame render", PCNT_RENDER_ALL);
|
drawStatsCounter("Frame render", PCNT_RENDER_ALL);
|
||||||
drawStatsCounter(" Particle render", PCNT_RENDER_PARTICLE);
|
drawStatsCounter(" Particle render", PCNT_RENDER_PARTICLE);
|
||||||
drawStatsCounter(" Water render", PCNT_RENDER_WATER);
|
drawStatsCounter(" Water render", PCNT_RENDER_WATER);
|
||||||
|
@ -4815,10 +4815,10 @@ void CEngine::DrawStats()
|
||||||
drawStatsCounter(" Shadow map render", PCNT_RENDER_SHADOW_MAP);
|
drawStatsCounter(" Shadow map render", PCNT_RENDER_SHADOW_MAP);
|
||||||
drawStatsValue( " Other render", otherRender);
|
drawStatsValue( " Other render", otherRender);
|
||||||
drawStatsCounter("Swap buffers & VSync", PCNT_SWAP_BUFFERS);
|
drawStatsCounter("Swap buffers & VSync", PCNT_SWAP_BUFFERS);
|
||||||
drawStatsLine();
|
drawStatsLine("", "");
|
||||||
drawStatsLine( "Triangles", StrUtils::ToString<int>(m_statisticTriangle));
|
drawStatsLine( "Triangles", StrUtils::ToString<int>(m_statisticTriangle));
|
||||||
drawStatsValue( "FPS", m_fps);
|
drawStatsValue( "FPS", m_fps);
|
||||||
drawStatsLine();
|
drawStatsLine("", "");
|
||||||
str.str("");
|
str.str("");
|
||||||
str << std::fixed << std::setprecision(2) << m_statisticPos.x << "; " << m_statisticPos.z;
|
str << std::fixed << std::setprecision(2) << m_statisticPos.x << "; " << m_statisticPos.z;
|
||||||
drawStatsLine( "Position", str.str());
|
drawStatsLine( "Position", str.str());
|
||||||
|
|
|
@ -395,7 +395,7 @@ struct EngineGroundMark
|
||||||
//! Phase of life
|
//! Phase of life
|
||||||
EngineGroundMarkPhase phase = ENG_GR_MARK_PHASE_NULL;
|
EngineGroundMarkPhase phase = ENG_GR_MARK_PHASE_NULL;
|
||||||
//! Times for 3 life phases
|
//! Times for 3 life phases
|
||||||
float delay[3] = { 0.0f };
|
float delay[3] = {};
|
||||||
//! Fixed time
|
//! Fixed time
|
||||||
float fix = 0.0f;
|
float fix = 0.0f;
|
||||||
//! Position for marks
|
//! Position for marks
|
||||||
|
|
|
@ -220,7 +220,7 @@ struct Track
|
||||||
int posUsed = 0.0f; // number of positions in "pos"
|
int posUsed = 0.0f; // number of positions in "pos"
|
||||||
int head = 0; // head to write index
|
int head = 0; // head to write index
|
||||||
Math::Vector pos[MAXTRACKLEN];
|
Math::Vector pos[MAXTRACKLEN];
|
||||||
float len[MAXTRACKLEN] = {0.0f};
|
float len[MAXTRACKLEN] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WheelTrace
|
struct WheelTrace
|
||||||
|
@ -360,7 +360,7 @@ protected:
|
||||||
int m_wheelTraceIndex = 0;
|
int m_wheelTraceIndex = 0;
|
||||||
WheelTrace m_wheelTrace[MAXWHEELTRACE];
|
WheelTrace m_wheelTrace[MAXWHEELTRACE];
|
||||||
int m_totalInterface[MAXPARTITYPE][SH_MAX] = {};
|
int m_totalInterface[MAXPARTITYPE][SH_MAX] = {};
|
||||||
bool m_frameUpdate[SH_MAX] = {false};
|
bool m_frameUpdate[SH_MAX] = {};
|
||||||
int m_fogTotal = 0;
|
int m_fogTotal = 0;
|
||||||
int m_fog[MAXPARTIFOG] = {};
|
int m_fog[MAXPARTIFOG] = {};
|
||||||
int m_uniqueStamp = 0;
|
int m_uniqueStamp = 0;
|
||||||
|
|
|
@ -174,7 +174,7 @@ protected:
|
||||||
Math::Vector finalAngle;
|
Math::Vector finalAngle;
|
||||||
};
|
};
|
||||||
PyroBurnPart m_burnPart[10];
|
PyroBurnPart m_burnPart[10];
|
||||||
int m_burnKeepPart[10] = {0};
|
int m_burnKeepPart[10] = {};
|
||||||
float m_burnFall = 0.0f;
|
float m_burnFall = 0.0f;
|
||||||
|
|
||||||
float m_fallFloor = 0.0f;
|
float m_fallFloor = 0.0f;
|
||||||
|
|
|
@ -336,7 +336,7 @@ protected:
|
||||||
//! Terrain hardness (defines e.g. sound of walking)
|
//! Terrain hardness (defines e.g. sound of walking)
|
||||||
float hardness = 0.0f;
|
float hardness = 0.0f;
|
||||||
//! IDs of neighbor materials: up, right, down, left
|
//! IDs of neighbor materials: up, right, down, left
|
||||||
char mat[4] = {0};
|
char mat[4] = {};
|
||||||
};
|
};
|
||||||
//! Terrain materials
|
//! Terrain materials
|
||||||
std::vector<TerrainMaterial> m_materials;
|
std::vector<TerrainMaterial> m_materials;
|
||||||
|
@ -350,7 +350,7 @@ protected:
|
||||||
//! ID of material
|
//! ID of material
|
||||||
short id = 0;
|
short id = 0;
|
||||||
//! IDs of neighbor materials: up, right, down, left
|
//! IDs of neighbor materials: up, right, down, left
|
||||||
char mat[4] = {0};
|
char mat[4] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ protected:
|
||||||
CParticle* m_particle = nullptr;
|
CParticle* m_particle = nullptr;
|
||||||
CSoundInterface* m_sound = nullptr;
|
CSoundInterface* m_sound = nullptr;
|
||||||
|
|
||||||
WaterType m_type[2] = {WATER_NULL, WATER_NULL};
|
WaterType m_type[2] = {};
|
||||||
std::string m_fileName;
|
std::string m_fileName;
|
||||||
//! Overall level
|
//! Overall level
|
||||||
float m_level = 0.0f;
|
float m_level = 0.0f;
|
||||||
|
|
|
@ -170,7 +170,7 @@ struct OldModelHeader
|
||||||
//! Total number of triangles
|
//! Total number of triangles
|
||||||
int totalTriangles = 0;
|
int totalTriangles = 0;
|
||||||
//! Reserved area
|
//! Reserved area
|
||||||
int reserved[10] = {0};
|
int reserved[10] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ struct OldModelTriangleV1
|
||||||
Vertex p2;
|
Vertex p2;
|
||||||
Vertex p3;
|
Vertex p3;
|
||||||
Material material;
|
Material material;
|
||||||
char texName[20] = {0};
|
char texName[20] = {};
|
||||||
float min = 0;
|
float min = 0;
|
||||||
float max = 0;
|
float max = 0;
|
||||||
};
|
};
|
||||||
|
@ -207,7 +207,7 @@ struct OldModelTriangleV2
|
||||||
Vertex p2;
|
Vertex p2;
|
||||||
Vertex p3;
|
Vertex p3;
|
||||||
Material material;
|
Material material;
|
||||||
char texName[20] = {0};
|
char texName[20] = {};
|
||||||
float min = 0.0f;
|
float min = 0.0f;
|
||||||
float max = 0.0f;
|
float max = 0.0f;
|
||||||
long state = 0;
|
long state = 0;
|
||||||
|
@ -231,7 +231,7 @@ struct OldModelTriangleV3
|
||||||
VertexTex2 p2;
|
VertexTex2 p2;
|
||||||
VertexTex2 p3;
|
VertexTex2 p3;
|
||||||
Material material;
|
Material material;
|
||||||
char texName[20] = {0};
|
char texName[20] = {};
|
||||||
float min = 0.0f;
|
float min = 0.0f;
|
||||||
float max = 0.0f;
|
float max = 0.0f;
|
||||||
long state = 0;
|
long state = 0;
|
||||||
|
|
|
@ -268,7 +268,7 @@ private:
|
||||||
GLint uni_ShadowTexture = 0;
|
GLint uni_ShadowTexture = 0;
|
||||||
|
|
||||||
//! true enables texture
|
//! true enables texture
|
||||||
GLint uni_TextureEnabled[3] = {0};
|
GLint uni_TextureEnabled[3] = {};
|
||||||
|
|
||||||
// Alpha test parameters
|
// Alpha test parameters
|
||||||
//! true enables alpha test
|
//! true enables alpha test
|
||||||
|
@ -289,7 +289,7 @@ private:
|
||||||
//! true enables lighting
|
//! true enables lighting
|
||||||
GLint uni_LightingEnabled = 0;
|
GLint uni_LightingEnabled = 0;
|
||||||
//! true enables light source
|
//! true enables light source
|
||||||
GLint uni_LightEnabled[8] = {0};
|
GLint uni_LightEnabled[8] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ struct NewScriptName
|
||||||
{
|
{
|
||||||
bool used = false;
|
bool used = false;
|
||||||
ObjectType type = OBJECT_NULL;
|
ObjectType type = OBJECT_NULL;
|
||||||
char name[40] = {0};
|
char name[40] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ struct ShowLimit
|
||||||
Math::Vector pos;
|
Math::Vector pos;
|
||||||
float radius = 0.0f;
|
float radius = 0.0f;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
int parti[MAXSHOWPARTI] = {0};
|
int parti[MAXSHOWPARTI] = {};
|
||||||
CObject* link = nullptr;
|
CObject* link = nullptr;
|
||||||
float duration = 0.0f;
|
float duration = 0.0f;
|
||||||
float time = 0.0f;
|
float time = 0.0f;
|
||||||
|
|
|
@ -40,6 +40,26 @@
|
||||||
|
|
||||||
struct OldMusic
|
struct OldMusic
|
||||||
{
|
{
|
||||||
|
OldMusic() = default;
|
||||||
|
|
||||||
|
OldMusic(const OldMusic&) = delete;
|
||||||
|
OldMusic& operator=(const OldMusic&) = delete;
|
||||||
|
|
||||||
|
// Workaround for MSVC2013
|
||||||
|
OldMusic(OldMusic&& other)
|
||||||
|
: music(std::move(other.music)),
|
||||||
|
fadeTime(std::move(other.fadeTime)),
|
||||||
|
currentTime(std::move(other.currentTime))
|
||||||
|
{}
|
||||||
|
|
||||||
|
OldMusic& operator=(OldMusic&& other)
|
||||||
|
{
|
||||||
|
music = std::move(other.music);
|
||||||
|
fadeTime = std::move(other.fadeTime);
|
||||||
|
currentTime = std::move(other.currentTime);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<Channel> music;
|
std::unique_ptr<Channel> music;
|
||||||
float fadeTime = 0.0f;
|
float fadeTime = 0.0f;
|
||||||
float currentTime = 0.0f;
|
float currentTime = 0.0f;
|
||||||
|
|
|
@ -42,7 +42,7 @@ struct SoundOper
|
||||||
float finalFrequency = 0.0f;
|
float finalFrequency = 0.0f;
|
||||||
float totalTime = 0.0f;
|
float totalTime = 0.0f;
|
||||||
float currentTime = 0.0f;
|
float currentTime = 0.0f;
|
||||||
SoundNext nextOper = {};
|
SoundNext nextOper = SOPER_CONTINUE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ protected:
|
||||||
|
|
||||||
struct Item
|
struct Item
|
||||||
{
|
{
|
||||||
char text[100] = {0};
|
char text[100] = {};
|
||||||
bool check = false;
|
bool check = false;
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -447,8 +447,8 @@ void CScreenSetupGraphics::ChangeSetupButtons()
|
||||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_FILTER));
|
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_FILTER));
|
||||||
if ( pes != 0 )
|
if ( pes != 0 )
|
||||||
{
|
{
|
||||||
value = pes->GetVisibleValue();
|
int valueIndex = pes->GetVisibleValueIndex();
|
||||||
m_engine->SetTextureFilterMode(static_cast<Gfx::TexFilter>(value));
|
m_engine->SetTextureFilterMode(static_cast<Gfx::TexFilter>(valueIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_MIPMAP));
|
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_MIPMAP));
|
||||||
|
|
Loading…
Reference in New Issue