Merge pull request #217 from lioncash/sign

AutoMapper/*: Resolve sign conversion warnings
This commit is contained in:
Phillip Stephens 2020-03-13 15:30:24 -07:00 committed by GitHub
commit 55955973a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 16 deletions

View File

@ -1249,7 +1249,7 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr) {
} else if (x24_world) { } else if (x24_world) {
const IGameArea* area = x24_world->IGetAreaAlways(xa0_curAreaId); const IGameArea* area = x24_world->IGetAreaAlways(xa0_curAreaId);
const CMapWorldInfo& mwInfo = *g_GameState->StateForWorld(x24_world->IGetWorldAssetId()).MapWorldInfo(); const CMapWorldInfo& mwInfo = *g_GameState->StateForWorld(x24_world->IGetWorldAssetId()).MapWorldInfo();
if (mwInfo.IsMapped(xa0_curAreaId) || mwInfo.IsAreaVisted(xa0_curAreaId)) if (mwInfo.IsMapped(xa0_curAreaId) || mwInfo.IsAreaVisited(xa0_curAreaId))
stringId = area->IGetStringTableAssetId(); stringId = area->IGetStringTableAssetId();
else else
stringId = {}; stringId = {};

View File

@ -246,9 +246,10 @@ void CMapArea::CMapAreaSurface::PostConstruct(const u8* buf, std::vector<u32>& i
} }
void CMapArea::CMapAreaSurface::Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor, void CMapArea::CMapAreaSurface::Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor,
const zeus::CColor& lineColor, float lineWidth, int instIdx) const { const zeus::CColor& lineColor, float lineWidth, size_t instIdx) const {
if (instIdx >= m_instances.size()) if (instIdx >= m_instances.size()) {
return; return;
}
Instance& instance = const_cast<Instance&>(m_instances[instIdx]); Instance& instance = const_cast<Instance&>(m_instances[instIdx]);

View File

@ -42,7 +42,7 @@ public:
CMapAreaSurface(CMapAreaSurface&&) = default; CMapAreaSurface(CMapAreaSurface&&) = default;
void PostConstruct(const u8* buf, std::vector<u32>& index); void PostConstruct(const u8* buf, std::vector<u32>& index);
void Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor, const zeus::CColor& lineColor, void Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor, const zeus::CColor& lineColor,
float lineWidth, int instIdx = 0) const; float lineWidth, size_t instIdx = 0) const;
const zeus::CVector3f& GetNormal() const { return x0_normal; } const zeus::CVector3f& GetNormal() const { return x0_normal; }
const zeus::CVector3f& GetCenterPosition() const { return xc_centroid; } const zeus::CVector3f& GetCenterPosition() const { return xc_centroid; }
}; };

View File

@ -57,7 +57,7 @@ void CMapUniverse::Draw(const CMapUniverseDrawParms& parms, const zeus::CVector3
if (!mwInfo.IsAnythingSet()) if (!mwInfo.IsAnythingSet())
continue; continue;
zeus::CColor surfColor, outlineColor; zeus::CColor surfColor, outlineColor;
if (w == parms.GetFocusWorldIndex()) { if (s32(w) == parms.GetFocusWorldIndex()) {
surfColor = data.GetSurfaceColorSelected(); surfColor = data.GetSurfaceColorSelected();
surfColor.a() *= parms.GetAlpha(); surfColor.a() *= parms.GetAlpha();
outlineColor = data.GetOutlineColorSelected(); outlineColor = data.GetOutlineColorSelected();
@ -85,7 +85,7 @@ void CMapUniverse::Draw(const CMapUniverseDrawParms& parms, const zeus::CVector3
int lastWldIdx = -1; int lastWldIdx = -1;
int lastHexIdx = -1; int lastHexIdx = -1;
int instIdx = 0; size_t instIdx = 0;
for (const CMapObjectSortInfo& info : sortInfos) { for (const CMapObjectSortInfo& info : sortInfos) {
const CMapWorldData& mwData = x10_worldDatas[info.GetWorldIndex()]; const CMapWorldData& mwData = x10_worldDatas[info.GetWorldIndex()];
zeus::CColor surfColor = info.GetSurfaceColor(); zeus::CColor surfColor = info.GetSurfaceColor();

View File

@ -244,7 +244,7 @@ void CMapWorld::DrawAreas(const CMapWorld::CMapWorldDrawParms& parms, int selAre
const zeus::CColor* outlineColor; const zeus::CColor* outlineColor;
const zeus::CColor* surfacePlayerColor; const zeus::CColor* surfacePlayerColor;
const zeus::CColor* outlinePlayerColor; const zeus::CColor* outlinePlayerColor;
if (mwInfo.IsAreaVisted(thisArea)) { if (mwInfo.IsAreaVisited(thisArea)) {
alphaSurf = parms.GetAlphaSurfaceVisited(); alphaSurf = parms.GetAlphaSurfaceVisited();
alphaOutline = parms.GetAlphaOutlineVisited(); alphaOutline = parms.GetAlphaOutlineVisited();
surfaceColor = &g_tweakAutoMapper->GetSurfaceVisitedColor(); surfaceColor = &g_tweakAutoMapper->GetSurfaceVisitedColor();

View File

@ -31,7 +31,7 @@ void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CSaveWorld& savw, CAss
for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) { for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) {
if (i < x0_visitedAreasAllocated) if (i < x0_visitedAreasAllocated)
writer.WriteEncoded(IsAreaVisted(i), 1); writer.WriteEncoded(IsAreaVisited(i), 1);
else else
writer.WriteEncoded(0, 1); writer.WriteEncoded(0, 1);
} }
@ -53,8 +53,8 @@ void CMapWorldInfo::SetDoorVisited(TEditorId eid, bool visited) { x28_visitedDoo
bool CMapWorldInfo::IsDoorVisited(TEditorId eid) const { return x28_visitedDoors.find(eid) != x28_visitedDoors.end(); } bool CMapWorldInfo::IsDoorVisited(TEditorId eid) const { return x28_visitedDoors.find(eid) != x28_visitedDoors.end(); }
bool CMapWorldInfo::IsAreaVisted(TAreaId aid) const { bool CMapWorldInfo::IsAreaVisited(TAreaId aid) const {
if (aid + 1 > x0_visitedAreasAllocated) { if (u32(aid) + 1 > x0_visitedAreasAllocated) {
const_cast<CMapWorldInfo&>(*this).x4_visitedAreas.resize((aid + 32) / 32); const_cast<CMapWorldInfo&>(*this).x4_visitedAreas.resize((aid + 32) / 32);
const_cast<CMapWorldInfo&>(*this).x0_visitedAreasAllocated = aid + 1; const_cast<CMapWorldInfo&>(*this).x0_visitedAreasAllocated = aid + 1;
} }
@ -62,7 +62,7 @@ bool CMapWorldInfo::IsAreaVisted(TAreaId aid) const {
} }
void CMapWorldInfo::SetAreaVisited(TAreaId aid, bool visited) { void CMapWorldInfo::SetAreaVisited(TAreaId aid, bool visited) {
if (aid + 1 > x0_visitedAreasAllocated) { if (u32(aid) + 1 > x0_visitedAreasAllocated) {
x4_visitedAreas.resize((aid + 32) / 32); x4_visitedAreas.resize((aid + 32) / 32);
x0_visitedAreasAllocated = aid + 1; x0_visitedAreasAllocated = aid + 1;
} }
@ -73,7 +73,7 @@ void CMapWorldInfo::SetAreaVisited(TAreaId aid, bool visited) {
} }
bool CMapWorldInfo::IsMapped(TAreaId aid) const { bool CMapWorldInfo::IsMapped(TAreaId aid) const {
if (aid + 1 > x14_mappedAreasAllocated) { if (u32(aid) + 1 > x14_mappedAreasAllocated) {
const_cast<CMapWorldInfo&>(*this).x18_mappedAreas.resize((aid + 32) / 32); const_cast<CMapWorldInfo&>(*this).x18_mappedAreas.resize((aid + 32) / 32);
const_cast<CMapWorldInfo&>(*this).x14_mappedAreasAllocated = aid + 1; const_cast<CMapWorldInfo&>(*this).x14_mappedAreasAllocated = aid + 1;
} }
@ -81,7 +81,7 @@ bool CMapWorldInfo::IsMapped(TAreaId aid) const {
} }
void CMapWorldInfo::SetIsMapped(TAreaId aid, bool mapped) { void CMapWorldInfo::SetIsMapped(TAreaId aid, bool mapped) {
if (aid + 1 > x14_mappedAreasAllocated) { if (u32(aid) + 1 > x14_mappedAreasAllocated) {
x18_mappedAreas.resize((aid + 32) / 32); x18_mappedAreas.resize((aid + 32) / 32);
x14_mappedAreasAllocated = aid + 1; x14_mappedAreasAllocated = aid + 1;
} }
@ -93,7 +93,7 @@ void CMapWorldInfo::SetIsMapped(TAreaId aid, bool mapped) {
bool CMapWorldInfo::IsWorldVisible(TAreaId aid) const { return x38_mapStationUsed || IsMapped(aid); } bool CMapWorldInfo::IsWorldVisible(TAreaId aid) const { return x38_mapStationUsed || IsMapped(aid); }
bool CMapWorldInfo::IsAreaVisible(TAreaId aid) const { return IsAreaVisted(aid) || IsMapped(aid); } bool CMapWorldInfo::IsAreaVisible(TAreaId aid) const { return IsAreaVisited(aid) || IsMapped(aid); }
bool CMapWorldInfo::IsAnythingSet() const { bool CMapWorldInfo::IsAnythingSet() const {
for (u32 i = 0; i < x0_visitedAreasAllocated; ++i) for (u32 i = 0; i < x0_visitedAreasAllocated; ++i)

View File

@ -24,7 +24,7 @@ public:
void SetIsMapped(TAreaId, bool); void SetIsMapped(TAreaId, bool);
void SetDoorVisited(TEditorId eid, bool val); void SetDoorVisited(TEditorId eid, bool val);
bool IsDoorVisited(TEditorId eid) const; bool IsDoorVisited(TEditorId eid) const;
bool IsAreaVisted(TAreaId) const; bool IsAreaVisited(TAreaId) const;
void SetAreaVisited(TAreaId, bool); void SetAreaVisited(TAreaId, bool);
bool IsWorldVisible(TAreaId) const; bool IsWorldVisible(TAreaId) const;
bool IsAreaVisible(TAreaId) const; bool IsAreaVisible(TAreaId) const;

View File

@ -2310,7 +2310,7 @@ void CStateManager::SetCurrentAreaId(TAreaId aid) {
if (aid == kInvalidAreaId) if (aid == kInvalidAreaId)
return; return;
if (x8c0_mapWorldInfo->IsAreaVisted(aid)) if (x8c0_mapWorldInfo->IsAreaVisited(aid))
return; return;
x8c0_mapWorldInfo->SetAreaVisited(aid, true); x8c0_mapWorldInfo->SetAreaVisited(aid, true);
x850_world->GetMapWorld()->RecalculateWorldSphere(*x8c0_mapWorldInfo, *x850_world); x850_world->GetMapWorld()->RecalculateWorldSphere(*x8c0_mapWorldInfo, *x850_world);