Silence warnings, and fix Windows build

This commit is contained in:
Phillip Stephens 2016-12-21 11:27:15 -08:00
parent c92223301c
commit 598f64002c
13 changed files with 39 additions and 38 deletions

View File

@ -61,7 +61,7 @@ void CStaticAudioPlayer::DecodeMonoAndMix(s16* bufOut, u32 numSamples,
const std::unique_ptr<u8[]>& buf = x48_buffers[curBuf]; const std::unique_ptr<u8[]>& buf = x48_buffers[curBuf];
const u8* byte = &buf[cur - curBuf * RSF_BUFFER_SIZE]; const u8* byte = &buf[cur - curBuf * RSF_BUFFER_SIZE];
for (int i=0; i<remTillLoop; ++i, ++byte) for (u32 i=0; i<remTillLoop; ++i, ++byte)
{ {
if (!loopState && cur + i == loopStartCur) if (!loopState && cur + i == loopStartCur)
loopState.emplace(state); loopState.emplace(state);

View File

@ -2,7 +2,6 @@
#include "GameGlobalObjects.hpp" #include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "CGameState.hpp" #include "CGameState.hpp"
#include "GuiSys/CStringTable.hpp"
namespace urde namespace urde
{ {

View File

@ -5,6 +5,7 @@
#include "World/CWorld.hpp" #include "World/CWorld.hpp"
#include "CGameHintInfo.hpp" #include "CGameHintInfo.hpp"
#include "CSaveWorld.hpp" #include "CSaveWorld.hpp"
#include "GuiSys/CStringTable.hpp"
#include <vector> #include <vector>
// longest file name string excluding terminating zero // longest file name string excluding terminating zero
@ -15,7 +16,6 @@
namespace urde namespace urde
{ {
class CDummyWorld; class CDummyWorld;
class CStringTable;
class CSaveWorldMemory class CSaveWorldMemory
{ {

View File

@ -37,7 +37,7 @@ size_t CTexture::ComputeMippedTexelCount()
size_t w = x4_w; size_t w = x4_w;
size_t h = x6_h; size_t h = x6_h;
size_t ret = w * h; size_t ret = w * h;
for (int i=x8_mips ; i>1 ; --i) for (u32 i=x8_mips ; i>1 ; --i)
{ {
if (w > 1) if (w > 1)
w /= 2; w /= 2;
@ -53,7 +53,7 @@ size_t CTexture::ComputeMippedBlockCountDXT1()
size_t w = x4_w / 4; size_t w = x4_w / 4;
size_t h = x6_h / 4; size_t h = x6_h / 4;
size_t ret = w * h; size_t ret = w * h;
for (int i=x8_mips ; i>1 ; --i) for (u32 i=x8_mips ; i>1 ; --i)
{ {
if (w > 1) if (w > 1)
w /= 2; w /= 2;
@ -80,7 +80,7 @@ void CTexture::BuildI4FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 7) / 8; int bwidth = (w + 7) / 8;
int bheight = (h + 7) / 8; int bheight = (h + 7) / 8;
@ -128,7 +128,7 @@ void CTexture::BuildI8FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 7) / 8; int bwidth = (w + 7) / 8;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -176,7 +176,7 @@ void CTexture::BuildIA4FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 7) / 8; int bwidth = (w + 7) / 8;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -225,7 +225,7 @@ void CTexture::BuildIA8FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 3) / 4; int bwidth = (w + 3) / 4;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -339,7 +339,7 @@ void CTexture::BuildC4FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 7) / 8; int bwidth = (w + 7) / 8;
int bheight = (h + 7) / 8; int bheight = (h + 7) / 8;
@ -383,7 +383,7 @@ void CTexture::BuildC8FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 7) / 8; int bwidth = (w + 7) / 8;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -431,7 +431,7 @@ void CTexture::BuildRGB565FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 3) / 4; int bwidth = (w + 3) / 4;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -478,7 +478,7 @@ void CTexture::BuildRGB5A3FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 3) / 4; int bwidth = (w + 3) / 4;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -535,7 +535,7 @@ void CTexture::BuildRGBA8FromGCN(CInputStream& in)
int w = x4_w; int w = x4_w;
int h = x6_h; int h = x6_h;
RGBA8* targetMip = buf.get(); RGBA8* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 3) / 4; int bwidth = (w + 3) / 4;
int bheight = (h + 3) / 4; int bheight = (h + 3) / 4;
@ -599,7 +599,7 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in)
int w = x4_w / 4; int w = x4_w / 4;
int h = x6_h / 4; int h = x6_h / 4;
DXT1Block* targetMip = buf.get(); DXT1Block* targetMip = buf.get();
for (int mip=0 ; mip<x8_mips ; ++mip) for (u32 mip=0 ; mip<x8_mips ; ++mip)
{ {
int bwidth = (w + 1) / 2; int bwidth = (w + 1) / 2;
int bheight = (h + 1) / 2; int bheight = (h + 1) / 2;
@ -618,7 +618,7 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in)
{ {
target[x].color1 = hecl::SBig(source[x].color1); target[x].color1 = hecl::SBig(source[x].color1);
target[x].color2 = hecl::SBig(source[x].color2); target[x].color2 = hecl::SBig(source[x].color2);
for (int i=0 ; i<4 ; ++i) for (u32 i=0 ; i<4 ; ++i)
{ {
u8 ind[4]; u8 ind[4];
u8 packed = source[x].lines[i]; u8 packed = source[x].lines[i];

View File

@ -76,13 +76,13 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) const
} }
case EGuiModelDrawFlags::Alpha: case EGuiModelDrawFlags::Alpha:
{ {
CModelFlags flags(4, 0, (xb7_24_depthWrite << 1) | xb6_31_depthTest, moduCol); CModelFlags flags(4, 0, (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest), moduCol);
model->Draw(flags); model->Draw(flags);
break; break;
} }
case EGuiModelDrawFlags::Additive: case EGuiModelDrawFlags::Additive:
{ {
CModelFlags flags(3, 0, (xb7_24_depthWrite << 1) | xb6_31_depthTest, moduCol); CModelFlags flags(3, 0, (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest), moduCol);
model->Draw(flags); model->Draw(flags);
break; break;
} }
@ -93,7 +93,7 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) const
flags.m_blendMode = 5; flags.m_blendMode = 5;
flags.m_matSetIdx = 0; flags.m_matSetIdx = 0;
flags.m_flags = (xb7_24_depthWrite << 1) | xb6_31_depthTest; flags.m_flags = (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest);
flags.color = moduCol; flags.color = moduCol;
model->Draw(flags); model->Draw(flags);
break; break;

View File

@ -93,7 +93,7 @@ void CGuiTextSupport::Update(float dt)
{ {
if (CTextRenderBuffer* buf = GetCurrentLineRenderBuffer()) if (CTextRenderBuffer* buf = GetCurrentLineRenderBuffer())
{ {
for (int i=0 ; i<buf->GetPrimitiveCount() ; ++i) for (s32 i=0 ; i<buf->GetPrimitiveCount() ; ++i)
{ {
float chStartTime = 0.f; float chStartTime = 0.f;
for (const std::pair<float, int>& p : x40_primStartTimes) for (const std::pair<float, int>& p : x40_primStartTimes)

View File

@ -72,7 +72,7 @@ void CStringTable::LoadStringTable(CInputStream &in)
std::wstring CStringTable::GetString(s32 str) const std::wstring CStringTable::GetString(s32 str) const
{ {
if (str < 0 || str >= x0_stringCount) if (str < 0 || u32(str) >= x0_stringCount)
return L"Invalid"; return L"Invalid";
u32 off = *(reinterpret_cast<u32*>(x4_data.get() + str * 4)); u32 off = *(reinterpret_cast<u32*>(x4_data.get() + str * 4));

View File

@ -686,6 +686,7 @@ bool CFrontEndUI::SFusionBonusFrame::DoUpdateWithSaveUI(float dt, CSaveUI* saveU
{ {
} }
return false;
} }
void CFrontEndUI::SFusionBonusFrame::Draw(CSaveUI* saveUi) const void CFrontEndUI::SFusionBonusFrame::Draw(CSaveUI* saveUi) const
@ -903,10 +904,10 @@ void CFrontEndUI::Draw() const
auto vidDimensions = xcc_curMoviePtr->GetVideoDimensions(); auto vidDimensions = xcc_curMoviePtr->GetVideoDimensions();
float aspectRatio = vidDimensions.first / float(vidDimensions.second); float aspectRatio = vidDimensions.first / float(vidDimensions.second);
float verticalOff = (CGraphics::g_ViewportResolution.x / aspectRatio - CGraphics::g_ViewportResolution.y) * 0.5f; float verticalOff = (CGraphics::g_ViewportResolution.x / aspectRatio - CGraphics::g_ViewportResolution.y) * 0.5f;
xcc_curMoviePtr->SetFrame({0.f, -verticalOff, 0.f}, xcc_curMoviePtr->SetFrame(zeus::CVector3f(0.f, -verticalOff, 0.f),
{CGraphics::g_ViewportResolution.x, verticalOff, 0.f}, zeus::CVector3f(CGraphics::g_ViewportResolution.x, verticalOff, 0.f),
{0.f, CGraphics::g_ViewportResolution.y + verticalOff, 0.f}, zeus::CVector3f(0.f, CGraphics::g_ViewportResolution.y + verticalOff, 0.f),
{CGraphics::g_ViewportResolution.x, CGraphics::g_ViewportResolution.y + verticalOff, 0.f}); zeus::CVector3f(CGraphics::g_ViewportResolution.x, CGraphics::g_ViewportResolution.y + verticalOff, 0.f));
xcc_curMoviePtr->DrawFrame(); xcc_curMoviePtr->DrawFrame();
} }

View File

@ -15,7 +15,7 @@ using EState = CMemoryCardDriver::EState;
CIOWin::EMessageReturn CSaveUI::Update(float dt) CIOWin::EMessageReturn CSaveUI::Update(float dt)
{ {
return CIOWin::EMessageReturn::Normal;
} }
bool CSaveUI::PumpLoad() bool CSaveUI::PumpLoad()

View File

@ -14,8 +14,8 @@ class CCEKeyframeEmitter : public CColorElement
u32 x8_unk1; u32 x8_unk1;
bool xc_loop; bool xc_loop;
bool xd_unk2; bool xd_unk2;
u32 x10_loopEnd; s32 x10_loopEnd;
u32 x14_loopStart; s32 x14_loopStart;
std::vector<zeus::CColor> x18_keys; std::vector<zeus::CColor> x18_keys;
public: public:
CCEKeyframeEmitter(CInputStream& in); CCEKeyframeEmitter(CInputStream& in);

View File

@ -21,12 +21,12 @@ CAreaRenderOctTree::CAreaRenderOctTree(std::unique_ptr<u8[]>&& buf)
x30_bitmaps = reinterpret_cast<u32*>(x0_buf.get() + 64); x30_bitmaps = reinterpret_cast<u32*>(x0_buf.get() + 64);
u32 wc = x14_bitmapWordCount * x8_bitmapCount; u32 wc = x14_bitmapWordCount * x8_bitmapCount;
for (int i=0 ; i<wc ; ++i) for (u32 i=0 ; i<wc ; ++i)
x30_bitmaps[i] = hecl::SBig(x30_bitmaps[i]); x30_bitmaps[i] = hecl::SBig(x30_bitmaps[i]);
x34_indirectionTable = x30_bitmaps + wc; x34_indirectionTable = x30_bitmaps + wc;
x38_entries = reinterpret_cast<u8*>(x34_indirectionTable) + x10_nodeCount; x38_entries = reinterpret_cast<u8*>(x34_indirectionTable) + x10_nodeCount;
for (int i=0 ; i<x10_nodeCount ; ++i) for (u32 i=0 ; i<x10_nodeCount ; ++i)
{ {
x34_indirectionTable[i] = hecl::SBig(x34_indirectionTable[i]); x34_indirectionTable[i] = hecl::SBig(x34_indirectionTable[i]);
Node* n = reinterpret_cast<Node*>(x38_entries + x34_indirectionTable[i]); Node* n = reinterpret_cast<Node*>(x38_entries + x34_indirectionTable[i]);
@ -189,7 +189,7 @@ void CGameArea::CAreaFog::Update(float dt)
float colorDelta = x34_colorDelta * dt; float colorDelta = x34_colorDelta * dt;
zeus::CVector2f rangeDelta = x14_rangeDelta * dt; zeus::CVector2f rangeDelta = x14_rangeDelta * dt;
for (int i=0 ; i<3 ; ++i) for (u32 i=0 ; i<3 ; ++i)
{ {
float delta = x28_colorTarget[i] - x1c_colorCur[i]; float delta = x28_colorTarget[i] - x1c_colorCur[i];
if (std::fabs(delta) <= colorDelta) if (std::fabs(delta) <= colorDelta)
@ -205,7 +205,7 @@ void CGameArea::CAreaFog::Update(float dt)
} }
} }
for (int i=0 ; i<2 ; ++i) for (u32 i=0 ; i<2 ; ++i)
{ {
float delta = xc_rangeTarget[i] - x4_rangeCur[i]; float delta = xc_rangeTarget[i] - x4_rangeCur[i];
if (std::fabs(delta) <= rangeDelta[i]) if (std::fabs(delta) <= rangeDelta[i])
@ -617,7 +617,7 @@ bool CGameArea::StartStreamingMainArea()
u32 totalSz = 0; u32 totalSz = 0;
u32 secCount = GetNumPartSizes(); u32 secCount = GetNumPartSizes();
for (int i=2 ; i<secCount ; ++i) for (u32 i=2 ; i<secCount ; ++i)
totalSz += hecl::SBig(reinterpret_cast<u32*>(x110_mreaSecBufs[1].first.get())[i]); totalSz += hecl::SBig(reinterpret_cast<u32*>(x110_mreaSecBufs[1].first.get())[i]);
AllocNewAreaData(x128_mreaDataOffset, totalSz); AllocNewAreaData(x128_mreaDataOffset, totalSz);
@ -627,7 +627,7 @@ bool CGameArea::StartStreamingMainArea()
m_resolvedBufs.emplace_back(x110_mreaSecBufs[1].first.get(), x110_mreaSecBufs[1].second); m_resolvedBufs.emplace_back(x110_mreaSecBufs[1].first.get(), x110_mreaSecBufs[1].second);
u32 curOff = 0; u32 curOff = 0;
for (int i=2 ; i<secCount ; ++i) for (u32 i=2 ; i<secCount ; ++i)
{ {
u32 size = hecl::SBig(reinterpret_cast<u32*>(x110_mreaSecBufs[1].first.get())[i]); u32 size = hecl::SBig(reinterpret_cast<u32*>(x110_mreaSecBufs[1].first.get())[i]);
m_resolvedBufs.emplace_back(x110_mreaSecBufs[2].first.get() + curOff, size); m_resolvedBufs.emplace_back(x110_mreaSecBufs[2].first.get() + curOff, size);
@ -704,7 +704,7 @@ void CGameArea::PostConstructArea()
/* Models */ /* Models */
if (header.modelCount) if (header.modelCount)
{ {
for (int i=0 ; i<header.modelCount ; ++i) for (u32 i=0 ; i<header.modelCount ; ++i)
{ {
u32 surfCount = hecl::SBig(*reinterpret_cast<u32*>((secIt+6)->first.get())); u32 surfCount = hecl::SBig(*reinterpret_cast<u32*>((secIt+6)->first.get()));
secIt += 7 + surfCount; secIt += 7 + surfCount;
@ -899,7 +899,7 @@ CGameArea::MREAHeader CGameArea::VerifyHeader() const
header.arotSecIdx = r.readUint32Big(); header.arotSecIdx = r.readUint32Big();
header.secSizes.reserve(header.secCount); header.secSizes.reserve(header.secCount);
for (int i=0 ; i<header.secCount ; ++i) for (u32 i=0 ; i<header.secCount ; ++i)
header.secSizes.push_back(r.readUint32Big()); header.secSizes.push_back(r.readUint32Big());
return header; return header;

View File

@ -746,7 +746,8 @@ CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in, int prop
if (propCount > 14) if (propCount > 14)
b10 = in.readBool(); b10 = in.readBool();
u32 flags = b2 | b3 << 1 | b4 << 2 | b5 << 3 | b6 << 4 | b7 << 5 | b8 << 6 | b9 << 8; u32 flags = u32(b2) | u32(b3) << 1 | u32(b4) << 2 | u32(b5) << 3 | u32(b6) << 4 |
u32(b7) << 5 | u32(b8) << 6 | u32(b9) << 8;
return new CCinematicCamera(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, b1, f1, return new CCinematicCamera(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, b1, f1,
f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(), CCameraManager::FarPlane(), f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(), CCameraManager::FarPlane(),

2
amuse

@ -1 +1 @@
Subproject commit 1dfdf4c392a0389b1a37f0e9c2064a42dd47b63f Subproject commit 72d0df7d461841b7fca2b3c38c3dd61ccb798fd6