Windows fixes

This commit is contained in:
Jack Andersen 2016-12-10 15:54:08 -10:00
parent 0dc6729144
commit 3a24b35df7
17 changed files with 34 additions and 30 deletions

View File

@ -8,7 +8,7 @@ if(MSVC)
# 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 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 /wd4200 /wd4305 ${VS_DEFINES}) /IGNORE:4221 /wd4800 /wd4005 /wd4311 /wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 ${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

@ -889,7 +889,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
switch (colorType) switch (colorType)
{ {
case PNG_COLOR_TYPE_GRAY: case PNG_COLOR_TYPE_GRAY:
for (int i=0 ; i<width ; ++i) for (unsigned i=0 ; i<width ; ++i)
{ {
size_t outbase = (r*width+i)*4; size_t outbase = (r*width+i)*4;
bufOut[outbase] = rowBuf[i]; bufOut[outbase] = rowBuf[i];

View File

@ -240,8 +240,8 @@ void SplashScreen::resized(const boo::SWindowRect& root, const boo::SWindowRect&
boo::SWindowRect badgeRect = centerRect; boo::SWindowRect badgeRect = centerRect;
badgeRect.location[0] += LINE_WIDTH * pf; badgeRect.location[0] += LINE_WIDTH * pf;
badgeRect.location[1] += BADGE_MARGIN * pf; badgeRect.location[1] += BADGE_MARGIN * pf;
badgeRect.size[0] = BADGE_WIDTH; badgeRect.size[0] = BADGE_WIDTH * pf;
badgeRect.size[1] = BADGE_HEIGHT; badgeRect.size[1] = BADGE_HEIGHT * pf;
boo::SWindowRect textRect = centerRect; boo::SWindowRect textRect = centerRect;
textRect.location[0] += TEXT_MARGIN * pf; textRect.location[0] += TEXT_MARGIN * pf;

View File

@ -15,10 +15,9 @@ else()
set(CMAKE_FIND_APPBUNDLE FIRST) set(CMAKE_FIND_APPBUNDLE FIRST)
find_program(INKSCAPE_BIN inkscape) find_program(INKSCAPE_BIN inkscape)
endif() endif()
if(INKSCAPE_BIN STREQUAL "INKSCAPE_BIN-NOTFOUND") if(NOT INKSCAPE_BIN)
message(STATUS "Inkscape not found; downloading icons") add_custom_command(OUTPUT icons.bin COMMAND ${CMAKE_COMMAND} ARGS -P
file(DOWNLOAD "https://www.dropbox.com/s/wnj17dwgcsky0o9/icons.bin" ${CMAKE_CURRENT_SOURCE_DIR}/IconDownload.cmake)
${CMAKE_CURRENT_BINARY_DIR}/icons.bin SHOW_PROGRESS)
else() else()
message(STATUS "Inkscape found; will render icons locally") message(STATUS "Inkscape found; will render icons locally")
add_custom_command(OUTPUT icons.bin COMMAND $<TARGET_FILE:packicons> add_custom_command(OUTPUT icons.bin COMMAND $<TARGET_FILE:packicons>

View File

@ -0,0 +1,3 @@
message(STATUS "Inkscape not found; downloading icons to '${CMAKE_CURRENT_BINARY_DIR}/icons.bin'")
file(DOWNLOAD "https://www.dropbox.com/s/wnj17dwgcsky0o9/icons.bin"
${CMAKE_CURRENT_BINARY_DIR}/icons.bin SHOW_PROGRESS)

View File

@ -32,7 +32,7 @@ private:
u32 x34_size; u32 x34_size;
u8* x38_moStart; u8* x38_moStart;
u8* x3c_vertexStart; u8* x3c_vertexStart;
u32 x40_surfaceStart; u8* x40_surfaceStart;
std::unique_ptr<u8[]> x44_buf; std::unique_ptr<u8[]> x44_buf;
public: public:
CMapArea(CInputStream&, u32); CMapArea(CInputStream&, u32);

View File

@ -32,9 +32,9 @@ public:
void SetLayerActive(int areaIdx, int layerIdx, bool active) void SetLayerActive(int areaIdx, int layerIdx, bool active)
{ {
if (active) if (active)
x0_areaLayers[areaIdx].m_layerBits |= 1 << layerIdx; x0_areaLayers[areaIdx].m_layerBits |= uint64_t(1) << layerIdx;
else else
x0_areaLayers[areaIdx].m_layerBits &= ~(1 << layerIdx); x0_areaLayers[areaIdx].m_layerBits &= ~(uint64_t(1) << layerIdx);
} }
void InitializeWorldLayers(const std::vector<CWorldLayers::Area>& layers); void InitializeWorldLayers(const std::vector<CWorldLayers::Area>& layers);

View File

@ -59,7 +59,7 @@ CCharLayoutInfo::CCharLayoutInfo(CInputStream& in)
x8_segIdList(in) x8_segIdList(in)
{ {
atUint32 mapCount = in.readUint32Big(); atUint32 mapCount = in.readUint32Big();
for (int i=0 ; i<mapCount ; ++i) for (atUint32 i=0 ; i<mapCount ; ++i)
{ {
std::string key = in.readString(); std::string key = in.readString();
x18_segIdMap.emplace(key, in); x18_segIdMap.emplace(key, in);

View File

@ -29,7 +29,7 @@ void CFBStreamedAnimReaderTotals::Initialize(const CFBStreamedCompression& sourc
if (source.m_pc) if (source.m_pc)
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
xc_segIds2[b] = *reinterpret_cast<const u32*>(chans); xc_segIds2[b] = *reinterpret_cast<const u32*>(chans);
chans += 8; chans += 8;
@ -59,7 +59,7 @@ void CFBStreamedAnimReaderTotals::Initialize(const CFBStreamedCompression& sourc
} }
else else
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
xc_segIds2[b] = *reinterpret_cast<const u32*>(chans); xc_segIds2[b] = *reinterpret_cast<const u32*>(chans);
chans += 6; chans += 6;
@ -111,7 +111,7 @@ void CFBStreamedAnimReaderTotals::IncrementInto(CBitLevelLoader& loader,
if (source.m_pc) if (source.m_pc)
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
chans += 8; chans += 8;
@ -138,7 +138,7 @@ void CFBStreamedAnimReaderTotals::IncrementInto(CBitLevelLoader& loader,
} }
else else
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
chans += 6; chans += 6;
@ -167,7 +167,7 @@ void CFBStreamedAnimReaderTotals::IncrementInto(CBitLevelLoader& loader,
void CFBStreamedAnimReaderTotals::CalculateDown() void CFBStreamedAnimReaderTotals::CalculateDown()
{ {
for (int b=0 ; b<x24_boneChanCount ; ++b) for (unsigned b=0 ; b<x24_boneChanCount ; ++b)
{ {
const s32* cumulativesIn = &x4_cumulativeInts32[8*b]; const s32* cumulativesIn = &x4_cumulativeInts32[8*b];
float* compOut = &x10_computedFloats32[8*b]; float* compOut = &x10_computedFloats32[8*b];
@ -213,7 +213,7 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi
int prior = -1; int prior = -1;
int next = -1; int next = -1;
int cur = 0; int cur = 0;
for (int b=0 ; b<timeBitmap[0] ; ++b) for (unsigned b=0 ; b<timeBitmap[0] ; ++b)
{ {
int word = b / 32; int word = b / 32;
int bit = b % 32; int bit = b % 32;
@ -243,7 +243,7 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi
curTime += interval; curTime += interval;
} }
if (prior != -1 && prior < Prior().x1c_curKey) if (prior != -1 && u32(prior) < Prior().x1c_curKey)
{ {
Prior().Initialize(*x0_source); Prior().Initialize(*x0_source);
Next().Initialize(*x0_source); Next().Initialize(*x0_source);
@ -251,7 +251,7 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi
} }
if (next != -1) if (next != -1)
while (next > Next().x1c_curKey) while (u32(next) > Next().x1c_curKey)
DoIncrement(loader); DoIncrement(loader);
if (!Prior().IsCalculated()) if (!Prior().IsCalculated())

View File

@ -41,7 +41,7 @@ const u8* CFBStreamedCompression::GetBitstreamPointer() const
if (m_pc) if (m_pc)
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
chans += 20; chans += 20;
@ -53,7 +53,7 @@ const u8* CFBStreamedCompression::GetBitstreamPointer() const
} }
else else
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
chans += 15; chans += 15;
@ -102,7 +102,7 @@ u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in
if (m_pc) if (m_pc)
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
*reinterpret_cast<u32*>(out) = in.readUint32Big(); *reinterpret_cast<u32*>(out) = in.readUint32Big();
out += 4; out += 4;
@ -132,7 +132,7 @@ u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in
} }
else else
{ {
for (int b=0 ; b<boneChanCount ; ++b) for (unsigned b=0 ; b<boneChanCount ; ++b)
{ {
*reinterpret_cast<u32*>(out) = in.readUint32Big(); *reinterpret_cast<u32*>(out) = in.readUint32Big();
out += 4; out += 4;

View File

@ -1,6 +1,7 @@
#include "CGunWeapon.hpp" #include "CGunWeapon.hpp"
#include "GameGlobalObjects.hpp" #include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "Particle/CGenDescription.hpp"
namespace urde namespace urde
{ {
@ -42,7 +43,7 @@ s32 GetWeaponIndex(EWeaponType type)
CGunWeapon::CGunWeapon(ResId ancsId, EWeaponType type, TUniqueId uid, EMaterialTypes mType, const zeus::CVector3f& vec) CGunWeapon::CGunWeapon(ResId ancsId, EWeaponType type, TUniqueId uid, EMaterialTypes mType, const zeus::CVector3f& vec)
: x4_(vec), : x4_(vec),
x104_gunCharacter(g_SimplePool->GetObj({ancsId, FOURCC('ANCS')})), x104_gunCharacter(g_SimplePool->GetObj(SObjectTag{FOURCC('ANCS'), ancsId})),
x13c_armCharacter(g_SimplePool->GetObj(skSuitArmNames[0])), x13c_armCharacter(g_SimplePool->GetObj(skSuitArmNames[0])),
x1c0_weaponType(type), x1c0_weaponType(type),
x1c4_uid(uid), x1c4_uid(uid),

View File

@ -21,7 +21,7 @@ enum class EGunAnimType
class CActorLights; class CActorLights;
class CGunController; class CGunController;
class CModelFlags; struct CModelFlags;
class CStateManager; class CStateManager;
class CGunWeapon class CGunWeapon
{ {

View File

@ -1,4 +1,5 @@
#include "CPowerBeam.hpp" #include "CPowerBeam.hpp"
#include "Particle/CGenDescription.hpp"
namespace urde namespace urde
{ {

2
amuse

@ -1 +1 @@
Subproject commit eb948dfd63236cceaf4055c032fa7f88c8fa4955 Subproject commit 9cf96ad6f94ffa6594a78358d39b195909f0b27c

2
hecl

@ -1 +1 @@
Subproject commit 389c6a2e3d7aaffc132c7d027af8eb17873433ed Subproject commit f610566b0b851cbe91ff72bae7390ac0609b130f

2
nod

@ -1 +1 @@
Subproject commit bcfe1a5d33c6a191489b37ff6144a78b36099a03 Subproject commit 512a8a122d51c3bea20d0e2572c0d2dd6d6f1dce

@ -1 +1 @@
Subproject commit ac2ebd5499cfcdb6183c7fa26618555575f9b9c6 Subproject commit 78471d73feb3761887a019cf02b83df1c7423832