Windows compile fixes, and warning squash

This commit is contained in:
Phillip Stephens 2016-07-23 23:05:12 -07:00
parent 4b10697a5a
commit 76b88d0ad6
11 changed files with 48 additions and 18 deletions

View File

@ -7,7 +7,7 @@ if(MSVC)
endif() endif()
# Shaddup MSVC # Shaddup MSVC
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305 ${VS_DEFINES}) add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /IGNORE:4221 /wd4800 /wd4005 /wd4311 /wd4267 /wd4244 /wd4305 ${VS_DEFINES})
# Link-time Code Generation for Release builds # Link-time Code Generation for Release builds
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD") set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD")

View File

@ -29,7 +29,7 @@ static void BoxFilter(const uint8_t* input, unsigned chanCount,
if (inHeight > 1) if (inHeight > 1)
mipHeight = inHeight / 2; mipHeight = inHeight / 2;
int y,x,c; unsigned y,x,c;
for (y=0 ; y<mipHeight ; ++y) for (y=0 ; y<mipHeight ; ++y)
{ {
unsigned miplineBase = mipWidth * y; unsigned miplineBase = mipWidth * y;
@ -753,7 +753,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
} }
break; break;
case PNG_COLOR_TYPE_GRAY_ALPHA: case PNG_COLOR_TYPE_GRAY_ALPHA:
for (int i=0 ; i<width ; ++i) for (unsigned i=0 ; i<width ; ++i)
{ {
size_t inbase = i*2; size_t inbase = i*2;
size_t outbase = (r*width+i)*4; size_t outbase = (r*width+i)*4;
@ -764,7 +764,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
} }
break; break;
case PNG_COLOR_TYPE_RGB: case PNG_COLOR_TYPE_RGB:
for (int i=0 ; i<width ; ++i) for (unsigned i=0 ; i<width ; ++i)
{ {
size_t inbase = i*3; size_t inbase = i*3;
size_t outbase = (r*width+i)*4; size_t outbase = (r*width+i)*4;
@ -775,7 +775,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
} }
break; break;
case PNG_COLOR_TYPE_RGB_ALPHA: case PNG_COLOR_TYPE_RGB_ALPHA:
for (int i=0 ; i<width ; ++i) for (unsigned i=0 ; i<width ; ++i)
{ {
size_t inbase = i*4; size_t inbase = i*4;
size_t outbase = (r*width+i)*4; size_t outbase = (r*width+i)*4;

View File

@ -204,7 +204,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Calculate offset to EGMC section */ /* Calculate offset to EGMC section */
atUint64 egmcOffset = 0; atUint64 egmcOffset = 0;
for (int i = 0; i < head.egmcSecIdx; i++) for (unsigned i = 0; i < head.egmcSecIdx; i++)
egmcOffset += head.secSizes[i]; egmcOffset += head.secSizes[i];
/* Load EGMC if possible so we can assign meshes to scanIds */ /* Load EGMC if possible so we can assign meshes to scanIds */

View File

@ -1,3 +1,6 @@
#if _WIN32
#include <D3Dcommon.h>
#endif
#include "CBooRenderer.hpp" #include "CBooRenderer.hpp"
namespace urde namespace urde
@ -182,6 +185,7 @@ void CBooRenderer::DrawString(const char*, int, int)
u32 CBooRenderer::GetFPS() u32 CBooRenderer::GetFPS()
{ {
return 0;
} }
void CBooRenderer::CacheReflection(TReflectionCallback, void*, bool) void CBooRenderer::CacheReflection(TReflectionCallback, void*, bool)
@ -232,6 +236,7 @@ void CBooRenderer::DoThermalBlendHot()
u32 CBooRenderer::GetStaticWorldDataSize() u32 CBooRenderer::GetStaticWorldDataSize()
{ {
return 0;
} }
} }

View File

@ -1,7 +1,7 @@
if(WIN32) if(WIN32)
set(PLAT_SRCS Shaders/CLineRendererShadersHLSL.cpp Shaders/CModelShadersHLSL.cpp) set(PLAT_SRCS Shaders/CLineRendererShadersHLSL.cpp Shaders/CModelShadersHLSL.cpp Shaders/CThermalColdFilterHLSL.cpp)
elseif(APPLE) elseif(APPLE)
set(PLAT_SRCS Shaders/CLineRendererShadersMetal.cpp Shaders/CModelShadersMetal.cpp) set(PLAT_SRCS Shaders/CLineRendererShadersMetal.cpp Shaders/CModelShadersMetal.cpp Shaders/CThermalColdFilterMetal.cpp)
endif() endif()
set(GRAPHICS_SOURCES set(GRAPHICS_SOURCES

View File

@ -1,5 +1,5 @@
#include "CLineRendererShaders.hpp" #include "CLineRendererShaders.hpp"
#include "CLineRenderer.hpp" #include "Graphics/CLineRenderer.hpp"
namespace urde namespace urde
{ {

View File

@ -3,7 +3,7 @@
namespace urde namespace urde
{ {
TFilterShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::ID3DDataFactory::Context& ctx, TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::ID3DDataFactory::Context& ctx,
boo::IShaderPipeline*& pipeOut, boo::IShaderPipeline*& pipeOut,
boo::IVertexFormat*& vtxFmtOut) boo::IVertexFormat*& vtxFmtOut)
{ {

View File

@ -3,7 +3,7 @@
namespace urde namespace urde
{ {
TFilterShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::MetalDataFactory::Context& ctx, TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::MetalDataFactory::Context& ctx,
boo::IShaderPipeline*& pipeOut, boo::IShaderPipeline*& pipeOut,
boo::IVertexFormat*& vtxFmtOut) boo::IVertexFormat*& vtxFmtOut)
{ {

View File

@ -27,6 +27,7 @@ void CGameArea::CAreaFog::SetFogExplicit(ERglFogMode, const zeus::CColor& color,
bool CGameArea::CAreaFog::IsFogDisabled() const bool CGameArea::CAreaFog::IsFogDisabled() const
{ {
return true;
} }
void CGameArea::CAreaFog::DisableFog() void CGameArea::CAreaFog::DisableFog()
@ -45,49 +46,58 @@ CDummyGameArea::CDummyGameArea(CInputStream& in, int idx, int mlvlVersion)
u32 attachAreaCount = in.readUint32Big(); u32 attachAreaCount = in.readUint32Big();
x44_attachedAreaIndices.reserve(attachAreaCount); x44_attachedAreaIndices.reserve(attachAreaCount);
for (int i=0 ; i<attachAreaCount ; ++i) for (u32 i=0 ; i<attachAreaCount ; ++i)
x44_attachedAreaIndices.push_back(in.readUint16Big()); x44_attachedAreaIndices.push_back(in.readUint16Big());
u32 depCount = in.readUint32Big(); u32 depCount = in.readUint32Big();
for (int i=0 ; i<depCount ; ++i) for (u32 i=0 ; i<depCount ; ++i)
in.readUint32Big(); in.readUint32Big();
u32 dockCount = in.readUint32Big(); u32 dockCount = in.readUint32Big();
x54_docks.reserve(dockCount); x54_docks.reserve(dockCount);
for (int i=0 ; i<dockCount ; ++i) for (u32 i=0 ; i<dockCount ; ++i)
x54_docks.emplace_back(in, x14_transform); x54_docks.emplace_back(in, x14_transform);
} }
bool CDummyGameArea::IGetScriptingMemoryAlways() const bool CDummyGameArea::IGetScriptingMemoryAlways() const
{ {
return false;
} }
TAreaId CDummyGameArea::IGetAreaId() const TAreaId CDummyGameArea::IGetAreaId() const
{ {
return 0;
} }
ResId CDummyGameArea::IGetAreaAssetId() const ResId CDummyGameArea::IGetAreaAssetId() const
{ {
return 0;
} }
bool CDummyGameArea::IIsActive() const bool CDummyGameArea::IIsActive() const
{ {
return false;
} }
TAreaId CDummyGameArea::IGetAttachedAreaId(int) const TAreaId CDummyGameArea::IGetAttachedAreaId(int) const
{ {
return 0;
} }
u32 CDummyGameArea::IGetNumAttachedAreas() const u32 CDummyGameArea::IGetNumAttachedAreas() const
{ {
return 0;
} }
ResId CDummyGameArea::IGetStringTableAssetId() const ResId CDummyGameArea::IGetStringTableAssetId() const
{ {
return 0;
} }
static zeus::CTransform identityXf(zeus::CMatrix3f::skIdentityMatrix3f);
const zeus::CTransform& CDummyGameArea::IGetTM() const const zeus::CTransform& CDummyGameArea::IGetTM() const
{ {
return identityXf;
} }
static std::vector<SObjectTag> ReadDependencyList(CInputStream& in) static std::vector<SObjectTag> ReadDependencyList(CInputStream& in)
@ -95,7 +105,7 @@ static std::vector<SObjectTag> ReadDependencyList(CInputStream& in)
std::vector<SObjectTag> ret; std::vector<SObjectTag> ret;
u32 count = in.readUint32Big(); u32 count = in.readUint32Big();
ret.reserve(count); ret.reserve(count);
for (int i=0 ; i<count ; ++i) for (u32 i=0 ; i<count ; ++i)
{ {
ret.emplace_back(); ret.emplace_back();
ret.back().readMLVL(in); ret.back().readMLVL(in);
@ -119,7 +129,7 @@ CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion)
u32 attachedCount = in.readUint32Big(); u32 attachedCount = in.readUint32Big();
x8c_attachedAreaIndices.reserve(attachedCount); x8c_attachedAreaIndices.reserve(attachedCount);
for (int i=0 ; i<attachedCount ; ++i) for (u32 i=0 ; i<attachedCount ; ++i)
x8c_attachedAreaIndices.push_back(in.readUint16Big()); x8c_attachedAreaIndices.push_back(in.readUint16Big());
x9c_deps1 = ::urde::ReadDependencyList(in); x9c_deps1 = ::urde::ReadDependencyList(in);
@ -129,42 +139,52 @@ CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion)
bool CGameArea::IGetScriptingMemoryAlways() const bool CGameArea::IGetScriptingMemoryAlways() const
{ {
return false;
} }
TAreaId CGameArea::IGetAreaId() const TAreaId CGameArea::IGetAreaId() const
{ {
return 0;
} }
ResId CGameArea::IGetAreaAssetId() const ResId CGameArea::IGetAreaAssetId() const
{ {
return 0;
} }
bool CGameArea::IIsActive() const bool CGameArea::IIsActive() const
{ {
return false;
} }
TAreaId CGameArea::IGetAttachedAreaId(int) const TAreaId CGameArea::IGetAttachedAreaId(int) const
{ {
return 0;
} }
u32 CGameArea::IGetNumAttachedAreas() const u32 CGameArea::IGetNumAttachedAreas() const
{ {
return 0;
} }
ResId CGameArea::IGetStringTableAssetId() const ResId CGameArea::IGetStringTableAssetId() const
{ {
return 0;
} }
const zeus::CTransform& CGameArea::IGetTM() const const zeus::CTransform& CGameArea::IGetTM() const
{ {
return identityXf;
} }
bool CGameArea::DoesAreaNeedEnvFx() const bool CGameArea::DoesAreaNeedEnvFx() const
{ {
return false;
} }
bool CGameArea::DoesAreaNeedSkyNow() const bool CGameArea::DoesAreaNeedSkyNow() const
{ {
return false;
} }
void CGameArea::UpdateFog(float dt) void CGameArea::UpdateFog(float dt)
@ -173,6 +193,7 @@ void CGameArea::UpdateFog(float dt)
bool CGameArea::OtherAreaOcclusionChanged() bool CGameArea::OtherAreaOcclusionChanged()
{ {
return false;
} }
void CGameArea::PingOcclusionState() void CGameArea::PingOcclusionState()
@ -238,6 +259,7 @@ void CGameArea::StartStreamingMainArea()
u32 CGameArea::GetNumPartSizes() const u32 CGameArea::GetNumPartSizes() const
{ {
return 0;
} }
void CGameArea::AllocNewAreaData(int, int) void CGameArea::AllocNewAreaData(int, int)
@ -258,6 +280,7 @@ void CGameArea::StartStreamIn(CStateManager& mgr)
bool CGameArea::Validate(CStateManager& mgr) bool CGameArea::Validate(CStateManager& mgr)
{ {
return false;
} }
void CGameArea::PostConstructArea() void CGameArea::PostConstructArea()
@ -278,10 +301,12 @@ void CGameArea::ClearTokenList()
u32 CGameArea::GetPreConstructedSize() const u32 CGameArea::GetPreConstructedSize() const
{ {
return 0;
} }
bool CGameArea::VerifyHeader() const bool CGameArea::VerifyHeader() const
{ {
return false;
} }
} }

View File

@ -4,7 +4,6 @@
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "CStateManager.hpp" #include "CStateManager.hpp"
#include "CInGameTweakManagerBase.hpp" #include "CInGameTweakManagerBase.hpp"
#include "AutoMapper/CMapWorld.hpp"
namespace urde namespace urde
{ {

View File

@ -5,13 +5,14 @@
#include "ScriptObjectSupport.hpp" #include "ScriptObjectSupport.hpp"
#include "CGameArea.hpp" #include "CGameArea.hpp"
#include "Graphics/CModel.hpp" #include "Graphics/CModel.hpp"
#include "AutoMapper/CMapWorld.hpp"
namespace urde namespace urde
{ {
class CGameArea; class CGameArea;
class IObjectStore; class IObjectStore;
class CResFactory; class CResFactory;
class CMapWorld;
class IGameArea; class IGameArea;
class IWorld class IWorld