mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-12 05:26:57 +03:00
Fix various discarded W4 compiler warnings
This commit is contained in:
parent
a79d63f61d
commit
b91dce1ce1
39 changed files with 40 additions and 90 deletions
|
@ -225,7 +225,7 @@ void ClearLOT(LOTInfo* LOT)
|
|||
LOT->RequiredBox = NO_BOX;
|
||||
|
||||
auto* node = LOT->Node.data();
|
||||
for(auto& node : LOT->Node)
|
||||
for (auto& node : LOT->Node)
|
||||
{
|
||||
node.exitBox = NO_BOX;
|
||||
node.nextExpansion = NO_BOX;
|
||||
|
|
|
@ -1169,7 +1169,6 @@ void TriggerWaterfallMist(const ItemInfo& item)
|
|||
auto endColor = item.Model.Color / 8.0f * finalFade * float(UCHAR_MAX);
|
||||
|
||||
float step = size * scale;
|
||||
int steps = int((width / 2) / step);
|
||||
int currentStep = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -1663,7 +1662,7 @@ void TriggerFireFlame(int x, int y, int z, FlameType type, const Vector3& color1
|
|||
spark->sLife = spark->life >> 2;
|
||||
}
|
||||
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 48;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 48;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -299,8 +299,6 @@ namespace TEN::Effects::Environment
|
|||
p.CollisionCheckDelay--;
|
||||
}
|
||||
|
||||
auto& r = g_Level.Rooms[p.Room];
|
||||
|
||||
// Check if particle got out of room bounds
|
||||
|
||||
if (!IsPointInRoom(p.Position, p.Room))
|
||||
|
|
|
@ -146,7 +146,7 @@ struct ItemInfo
|
|||
short TriggerFlags;
|
||||
|
||||
// TODO: Move to CreatureInfo?
|
||||
uint8_t AIBits; // AIObjectType enum.
|
||||
unsigned char AIBits; // AIObjectType enum.
|
||||
short AfterDeath;
|
||||
short CarriedItem;
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ void HighObject2Control(short itemNumber)
|
|||
spark->rotAdd = (GetRandomControl() & 0x3F) - 32;
|
||||
spark->maxYvel = 0;
|
||||
spark->yVel = -512 - (GetRandomControl() & 0x3FF);
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 32;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 32;
|
||||
spark->dSize = spark->size / 4;
|
||||
|
||||
if (GetRandomControl() & 3)
|
||||
|
|
|
@ -15,19 +15,15 @@ namespace TEN::Entities::Creatures::TR1
|
|||
{
|
||||
ItemInfo* FindReference(ItemInfo* item, short objectNumber)
|
||||
{
|
||||
bool found = false;
|
||||
int itemNumber = NO_ITEM;
|
||||
for (int i = 0; i < g_Level.NumItems; i++)
|
||||
{
|
||||
auto* currentItem = &g_Level.Items[i];
|
||||
if (currentItem->ObjectNumber == objectNumber && item->TriggerFlags == currentItem->TriggerFlags)
|
||||
{
|
||||
itemNumber = i;
|
||||
found = true;
|
||||
break;
|
||||
return currentItem;
|
||||
}
|
||||
}
|
||||
return (itemNumber == NO_ITEM ? nullptr : &g_Level.Items[itemNumber]);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
short GetWeaponDamage(LaraWeaponType weaponType)
|
||||
|
|
|
@ -172,7 +172,6 @@ namespace TEN::Entities::Creatures::TR3
|
|||
return;
|
||||
|
||||
auto& item = g_Level.Items[itemNumber];
|
||||
auto& object = Objects[item.ObjectNumber];
|
||||
auto& creature = *GetCreatureInfo(&item);
|
||||
|
||||
short angle = 0;
|
||||
|
|
|
@ -298,7 +298,6 @@ namespace TEN::Entities::Creatures::TR3
|
|||
return;
|
||||
|
||||
auto& item = g_Level.Items[itemNumber];
|
||||
auto& object = Objects[item.ObjectNumber];
|
||||
auto& creature = *GetCreatureInfo(&item);
|
||||
|
||||
short headingAngle = 0;
|
||||
|
|
|
@ -492,7 +492,6 @@ namespace TEN::Entities::Creatures::TR3
|
|||
auto* creature = GetCreatureInfo(item);
|
||||
|
||||
short headingAngle = 0;
|
||||
short tiltAngle = 0;
|
||||
short headAngle = 0;
|
||||
short torsoX = 0;
|
||||
short torsoY = 0;
|
||||
|
|
|
@ -144,7 +144,6 @@ namespace TEN::Entities::TR3
|
|||
|
||||
void CorpseHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex)
|
||||
{
|
||||
const auto& object = Objects[target.ObjectNumber];
|
||||
const auto& player = *GetLaraInfo(&source);
|
||||
|
||||
if (pos.has_value() && (player.Control.Weapon.GunType == LaraWeaponType::Pistol ||
|
||||
|
|
|
@ -169,7 +169,6 @@ namespace TEN::Entities::Vehicles
|
|||
{
|
||||
auto* minecartItem = &g_Level.Items[itemNumber];
|
||||
minecartItem->Data = MinecartInfo();
|
||||
auto* minecart = GetMinecartInfo(minecartItem);
|
||||
}
|
||||
|
||||
void MinecartPlayerCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||
|
|
|
@ -176,7 +176,6 @@ namespace TEN::Entities::Vehicles
|
|||
void QuadBikePlayerCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||
{
|
||||
auto* quadBikeItem = &g_Level.Items[itemNumber];
|
||||
auto* quadBike = GetQuadBikeInfo(quadBikeItem);
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
if (laraItem->HitPoints < 0 || lara->Context.Vehicle != NO_ITEM)
|
||||
|
|
|
@ -942,7 +942,7 @@ namespace TEN::Entities::Vehicles
|
|||
|
||||
if (UPV->Velocity || TrInput & (VEHICLE_IN_LEFT | VEHICLE_IN_RIGHT | VEHICLE_IN_UP | VEHICLE_IN_DOWN))
|
||||
{
|
||||
int waterHeight = GetWaterHeight(UPVItem);
|
||||
waterHeight = GetWaterHeight(UPVItem);
|
||||
SpawnVehicleWake(*UPVItem, UPV_WAKE_OFFSET, waterHeight, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -319,7 +319,6 @@ namespace TEN::Entities::TR4
|
|||
creature->Enemy = nullptr;
|
||||
|
||||
auto* enemyItem = creature->Enemy;
|
||||
auto* object = &Objects[ID_BADDY1];
|
||||
|
||||
short angle = 0;
|
||||
short tilt = 0;
|
||||
|
|
|
@ -178,7 +178,6 @@ namespace TEN::Entities::TR4
|
|||
return;
|
||||
|
||||
auto* item = &g_Level.Items[itemNumber];
|
||||
auto* object = &Objects[item->ObjectNumber];
|
||||
auto* creature = GetCreatureInfo(item);
|
||||
|
||||
short angle = 0;
|
||||
|
|
|
@ -321,8 +321,6 @@ namespace TEN::Entities::TR4
|
|||
laraAI.distance = pow(deltaX, 2) + pow(deltaZ, 2);
|
||||
}
|
||||
|
||||
short tilt = 0;
|
||||
|
||||
if (item->HitStatus &&
|
||||
laraAI.angle < ANGLE(67.5f) &&
|
||||
laraAI.angle > -ANGLE(67.5f) &&
|
||||
|
|
|
@ -98,7 +98,6 @@ namespace TEN::Entities::TR4
|
|||
auto* creature = GetCreatureInfo(item);
|
||||
|
||||
short headingAngle = 0;
|
||||
short tiltAngle = 0;
|
||||
short joint0 = 0;
|
||||
short joint1 = 0;
|
||||
short joint2 = 0;
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace TEN::Entities::TR4
|
|||
spark->gravity = -4 - (GetRandomControl() & 3);
|
||||
spark->scalar = 3;
|
||||
spark->maxYvel = -4 - (GetRandomControl() & 3);
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 8;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 8;
|
||||
spark->dSize = spark->size * 4;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,9 +69,7 @@ namespace TEN::Entities::TR4
|
|||
auto* creature = GetCreatureInfo(item);
|
||||
|
||||
short angle = 0;
|
||||
short tilt = 0;
|
||||
short head = 0;
|
||||
short neck = 0;
|
||||
short joint0 = 0;
|
||||
short joint1 = 0;
|
||||
short joint2 = 0;
|
||||
|
|
|
@ -73,7 +73,6 @@ namespace TEN::Entities::TR4
|
|||
|
||||
auto* item = &g_Level.Items[itemNumber];
|
||||
auto* creature = GetCreatureInfo(item);
|
||||
auto* object = &Objects[item->ObjectNumber];
|
||||
|
||||
int x = item->Pose.Position.x + 614 * phd_sin(item->Pose.Orientation.y);
|
||||
int y = item->Pose.Position.y;
|
||||
|
|
|
@ -152,7 +152,6 @@ namespace TEN::Entities::TR4
|
|||
return;
|
||||
|
||||
auto* creature = GetCreatureInfo(item);
|
||||
auto* object = &Objects[item->ObjectNumber];
|
||||
|
||||
short angle = 0;
|
||||
short tilt = 0;
|
||||
|
|
|
@ -62,9 +62,7 @@ namespace TEN::Entities::TR4
|
|||
auto* creature = GetCreatureInfo(item);
|
||||
|
||||
short angle = 0;
|
||||
short tilt = 0;
|
||||
short head = 0;
|
||||
short neck = 0;
|
||||
short joint0 = 0;
|
||||
short joint1 = 0;
|
||||
short joint2 = 0;
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace TEN::Entities::TR4
|
|||
spark->zVel = (GetRandomControl() & 0x3FF) - 512;
|
||||
spark->friction = 4;
|
||||
spark->scalar = 2;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 16;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 16;
|
||||
spark->dSize = (GetRandomControl() & 1) + 3;
|
||||
spark->maxYvel = 0;
|
||||
spark->gravity = (GetRandomControl() & 0x1F) + 32;
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace TEN::Entities::Creatures::TR5
|
|||
spark->gravity = 0;
|
||||
spark->maxYvel = 0;
|
||||
spark->scalar = 1;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 96;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 96;
|
||||
spark->dSize = spark->size / 4;
|
||||
}
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace TEN::Entities::Creatures::TR5
|
|||
spark->rotAdd = (GetRandomControl() & 0x3F) - 32;
|
||||
spark->fxObj = fxObject;
|
||||
spark->scalar = 2;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 96;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 96;
|
||||
spark->dSize = spark->size / 4;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace TEN::Entities::Creatures::TR5
|
|||
spark->flags = SP_EXPDEF | SP_ROTATE | SP_SCALE;
|
||||
spark->rotAng = GetRandomControl() & 0xFFF;
|
||||
spark->rotAdd = (GetRandomControl() & 0x3F) - 32;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0xF) + 32;
|
||||
spark->sSize = spark->size = (GetRandomControl() & 0x0F) + 32;
|
||||
spark->dSize = spark->size * 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,6 @@ namespace TEN::Entities::Vehicles
|
|||
TestEnvironment(ENV_FLAG_SWAMP, vehicleItem))
|
||||
{
|
||||
auto waterDepth = (float)GetWaterDepth(vehicleItem);
|
||||
auto waterHeight = vehicleItem->Pose.Position.y - GetWaterHeight(vehicleItem);
|
||||
|
||||
// HACK: Sometimes quadbike test position may end up under non-portal ceiling block.
|
||||
// GetWaterDepth returns DEEP_WATER constant in that case, which is too large for our needs.
|
||||
|
@ -252,6 +251,8 @@ namespace TEN::Entities::Vehicles
|
|||
}
|
||||
else
|
||||
{
|
||||
int waterHeight = vehicleItem->Pose.Position.y - GetWaterHeight(vehicleItem);
|
||||
|
||||
if (waterDepth > VEHICLE_WATER_HEIGHT_MAX && waterHeight > VEHICLE_WATER_HEIGHT_MAX)
|
||||
{
|
||||
ExplodeVehicle(laraItem, vehicleItem);
|
||||
|
|
|
@ -69,7 +69,7 @@ void Frustum::Update(const Matrix& view, const Matrix& projection)
|
|||
|
||||
bool Frustum::PointInFrustum(const Vector3& position) const
|
||||
{
|
||||
for (uint32_t i = 0; i < 6; i++)
|
||||
for (unsigned int i = 0; i < 6; i++)
|
||||
{
|
||||
if (m_frustum[i][0] * position.x + m_frustum[i][1] * position.y + m_frustum[i][2] * position.z + m_frustum[i][3] <= 0.0f)
|
||||
return false;
|
||||
|
@ -80,7 +80,7 @@ bool Frustum::PointInFrustum(const Vector3& position) const
|
|||
|
||||
bool Frustum::SphereInFrustum(const Vector3& position, float radius) const
|
||||
{
|
||||
for (uint32_t i = 0; i < 6; i++)
|
||||
for (unsigned int i = 0; i < 6; i++)
|
||||
{
|
||||
if (m_frustum[i][0] * position.x + m_frustum[i][1] * position.y + m_frustum[i][2] * position.z + m_frustum[i][3] <= -radius)
|
||||
return false;
|
||||
|
@ -91,7 +91,7 @@ bool Frustum::SphereInFrustum(const Vector3& position, float radius) const
|
|||
|
||||
bool Frustum::AABBInFrustum(const Vector3& min, const Vector3& max) const
|
||||
{
|
||||
for (uint32_t i = 0; i < 6; i++)
|
||||
for (unsigned int i = 0; i < 6; i++)
|
||||
{
|
||||
if (m_frustum[i][0] * min.x + m_frustum[i][1] * min.y + m_frustum[i][2] * min.z + m_frustum[i][3] <= 0.0f &&
|
||||
m_frustum[i][0] * max.x + m_frustum[i][1] * min.y + m_frustum[i][2] * min.z + m_frustum[i][3] <= 0.0f &&
|
||||
|
@ -108,7 +108,7 @@ bool Frustum::AABBInFrustum(const Vector3& min, const Vector3& max) const
|
|||
return true;
|
||||
}
|
||||
|
||||
void Frustum::NormalizePlane(int32_t side)
|
||||
void Frustum::NormalizePlane(int side)
|
||||
{
|
||||
float magnitude = sqrt(m_frustum[side][0] * m_frustum[side][0] + m_frustum[side][1] * m_frustum[side][1] + m_frustum[side][2] * m_frustum[side][2]);
|
||||
m_frustum[side][0] /= magnitude;
|
||||
|
|
|
@ -13,6 +13,6 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
void NormalizePlane(int32_t side);
|
||||
void NormalizePlane(int side);
|
||||
std::array<std::array<float, 4>, 6> m_frustum = {};
|
||||
};
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "Specific/level.h"
|
||||
#include "Specific/winmain.h"
|
||||
|
||||
using namespace std::chrono;
|
||||
using namespace TEN::Entities::Generic;
|
||||
using namespace TEN::Hud;
|
||||
|
||||
|
@ -37,8 +38,6 @@ extern GUNSHELL_STRUCT Gunshells[MAX_GUNSHELL];
|
|||
|
||||
namespace TEN::Renderer
|
||||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
void Renderer11::RenderBlobShadows(RenderView& renderView)
|
||||
{
|
||||
auto nearestSpheres = std::vector<Sphere>{};
|
||||
|
@ -283,7 +282,6 @@ namespace TEN::Renderer
|
|||
|
||||
if (gunShellsCount > 0)
|
||||
{
|
||||
auto* object = &Objects[objectNumber];
|
||||
auto& moveableObject = *m_moveableObjects[objectNumber];
|
||||
|
||||
m_context->VSSetShader(m_vsInstancedStaticMeshes.Get(), nullptr, 0);
|
||||
|
@ -498,7 +496,6 @@ namespace TEN::Renderer
|
|||
|
||||
if (Objects[ID_RATS_EMITTER].loaded)
|
||||
{
|
||||
ObjectInfo* obj = &Objects[ID_RATS_EMITTER];
|
||||
RendererObject& moveableObj = *m_moveableObjects[ID_RATS_EMITTER];
|
||||
|
||||
m_stStatic.LightMode = moveableObj.ObjectMeshes[0]->LightMode;
|
||||
|
@ -545,8 +542,6 @@ namespace TEN::Renderer
|
|||
return;
|
||||
}
|
||||
|
||||
ObjectInfo* obj = &Objects[ID_BATS_EMITTER];
|
||||
RendererObject& moveableObj = *m_moveableObjects[ID_BATS_EMITTER];
|
||||
RendererMesh* mesh = GetMesh(Objects[ID_BATS_EMITTER].meshIndex + (GlobalCounter & 3));
|
||||
|
||||
int batsCount = 0;
|
||||
|
@ -619,8 +614,6 @@ namespace TEN::Renderer
|
|||
return;
|
||||
}
|
||||
|
||||
ObjectInfo* obj = &Objects[ID_LITTLE_BEETLE];
|
||||
RendererObject& moveableObj = *m_moveableObjects[ID_LITTLE_BEETLE];
|
||||
RendererMesh* mesh = GetMesh(Objects[ID_LITTLE_BEETLE].meshIndex + ((Wibble >> 2) % 2));
|
||||
|
||||
int littleBeetlesCount = 0;
|
||||
|
@ -1564,8 +1557,6 @@ namespace TEN::Renderer
|
|||
void Renderer11::RenderSimpleScene(ID3D11RenderTargetView* target, ID3D11DepthStencilView* depthTarget,
|
||||
RenderView& view)
|
||||
{
|
||||
ScriptInterfaceLevel* level = g_GameFlow->GetLevel(CurrentLevel);
|
||||
|
||||
CollectRooms(view, true);
|
||||
// Draw shadow map
|
||||
|
||||
|
@ -1741,7 +1732,6 @@ namespace TEN::Renderer
|
|||
ItemInfo* nativeItem = &g_Level.Items[info->item->ItemNumber];
|
||||
RendererRoom& room = m_rooms[nativeItem->RoomNumber];
|
||||
RendererObject& moveableObj = *m_moveableObjects[nativeItem->ObjectNumber];
|
||||
ObjectInfo* obj = &Objects[nativeItem->ObjectNumber];
|
||||
|
||||
// Set shaders
|
||||
m_context->VSSetShader(m_vsItems.Get(), nullptr, 0);
|
||||
|
@ -1819,7 +1809,6 @@ namespace TEN::Renderer
|
|||
|
||||
for (auto it = view.SortedStaticsToDraw.begin(); it != view.SortedStaticsToDraw.end(); it++)
|
||||
{
|
||||
int staticObjectNumber = it->first;
|
||||
std::vector<RendererStatic*> statics = it->second;
|
||||
|
||||
RendererStatic* refStatic = statics[0];
|
||||
|
@ -2129,7 +2118,6 @@ namespace TEN::Renderer
|
|||
break;
|
||||
}
|
||||
|
||||
auto& tex = set.Textures[j];
|
||||
m_stAnimated.Textures[j].topLeft = set.Textures[j].UV[0];
|
||||
m_stAnimated.Textures[j].topRight = set.Textures[j].UV[1];
|
||||
m_stAnimated.Textures[j].bottomRight = set.Textures[j].UV[2];
|
||||
|
|
|
@ -1465,7 +1465,6 @@ namespace TEN::Renderer
|
|||
m_context->VSSetShader(m_vsStatics.Get(), NULL, 0);
|
||||
m_context->PSSetShader(m_psStatics.Get(), NULL, 0);
|
||||
|
||||
extern std::vector<DebrisFragment> DebrisFragments;
|
||||
std::vector<RendererVertex> vertices;
|
||||
|
||||
BLEND_MODES lastBlendMode = BLEND_MODES::BLENDMODE_UNSET;
|
||||
|
|
|
@ -106,7 +106,6 @@ namespace TEN::Renderer
|
|||
m_numCheckPortalCalls++;
|
||||
|
||||
RendererRoom* room = &m_rooms[parentRoomNumber];
|
||||
ROOM_INFO* nativeRoom = &g_Level.Rooms[parentRoomNumber];
|
||||
|
||||
int zClip = 0;
|
||||
Vector4 p[4];
|
||||
|
@ -228,7 +227,6 @@ namespace TEN::Renderer
|
|||
m_numGetVisibleRoomsCalls++;
|
||||
|
||||
RendererRoom* room = &m_rooms[to];
|
||||
ROOM_INFO* nativeRoom = &g_Level.Rooms[to];
|
||||
|
||||
if (!room->Visited)
|
||||
{
|
||||
|
@ -478,7 +476,6 @@ namespace TEN::Renderer
|
|||
tempLights.reserve(MAX_LIGHTS_DRAW);
|
||||
|
||||
RendererRoom& room = m_rooms[roomNumber];
|
||||
ROOM_INFO* nativeRoom = &g_Level.Rooms[room.RoomNumber];
|
||||
|
||||
RendererLight* brightestLight = nullptr;
|
||||
float brightest = 0.0f;
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef DWORD D3DCOLOR;
|
|||
|
||||
using CallbackDrawString = std::function<void(const std::string&, D3DCOLOR, int, int, int)>;
|
||||
using VarSaveType = std::variant<bool, double, std::string>;
|
||||
using IndexTable = std::vector<std::pair<uint32_t, uint32_t>>;
|
||||
using IndexTable = std::vector<std::pair<unsigned int, unsigned int>>;
|
||||
|
||||
struct FuncName
|
||||
{
|
||||
|
|
|
@ -68,16 +68,6 @@ namespace InventoryHandler
|
|||
SetInventoryCount(slot, count);
|
||||
}
|
||||
|
||||
static void InventoryCombine(int slot1, int slot2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void InventorySeparate(int slot)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Register(sol::state* state, sol::table& parent)
|
||||
{
|
||||
sol::table table_inventory{ state->lua_state(), sol::create };
|
||||
|
|
|
@ -377,7 +377,7 @@ void LogicHandler::SetVariables(const std::vector<SavedVar>& vars)
|
|||
ResetGameTables();
|
||||
ResetLevelTables();
|
||||
|
||||
std::unordered_map<uint32_t, sol::table> solTables;
|
||||
std::unordered_map<unsigned int, sol::table> solTables;
|
||||
|
||||
for(int i = 0; i < vars.size(); ++i)
|
||||
{
|
||||
|
@ -457,7 +457,7 @@ void LogicHandler::SetVariables(const std::vector<SavedVar>& vars)
|
|||
(*m_handler.GetState())[ScriptReserved_GameVars][first] = second;
|
||||
}
|
||||
|
||||
template<SavedVarType TypeEnum, typename TypeTo, typename TypeFrom, typename MapType> int32_t Handle(TypeFrom& var, MapType& varsMap, size_t& numVars, std::vector<SavedVar>& vars)
|
||||
template<SavedVarType TypeEnum, typename TypeTo, typename TypeFrom, typename MapType> int Handle(TypeFrom& var, MapType& varsMap, size_t& numVars, std::vector<SavedVar>& vars)
|
||||
{
|
||||
auto [first, second] = varsMap.insert(std::make_pair(&var, (int)numVars));
|
||||
|
||||
|
@ -476,12 +476,12 @@ template<SavedVarType TypeEnum, typename TypeTo, typename TypeFrom, typename Map
|
|||
std::string LogicHandler::GetRequestedPath() const
|
||||
{
|
||||
std::string path;
|
||||
for (uint32_t i = 0; i < m_savedVarPath.size(); ++i)
|
||||
for (unsigned int i = 0; i < m_savedVarPath.size(); ++i)
|
||||
{
|
||||
auto key = m_savedVarPath[i];
|
||||
if (std::holds_alternative<uint32_t>(key))
|
||||
if (std::holds_alternative<unsigned int>(key))
|
||||
{
|
||||
path += "[" + std::to_string(std::get<uint32_t>(key)) + "]";
|
||||
path += "[" + std::to_string(std::get<unsigned int>(key)) + "]";
|
||||
}
|
||||
else if (std::holds_alternative<std::string>(key))
|
||||
{
|
||||
|
@ -503,9 +503,9 @@ void LogicHandler::GetVariables(std::vector<SavedVar>& vars)
|
|||
tab[ScriptReserved_LevelVars] = (*m_handler.GetState())[ScriptReserved_LevelVars];
|
||||
tab[ScriptReserved_GameVars] = (*m_handler.GetState())[ScriptReserved_GameVars];
|
||||
|
||||
std::unordered_map<void const*, uint32_t> varsMap;
|
||||
std::unordered_map<double, uint32_t> numMap;
|
||||
std::unordered_map<bool, uint32_t> boolMap;
|
||||
std::unordered_map<void const*, unsigned int> varsMap;
|
||||
std::unordered_map<double, unsigned int> numMap;
|
||||
std::unordered_map<bool, unsigned int> boolMap;
|
||||
|
||||
size_t numVars = 0;
|
||||
|
||||
|
@ -557,7 +557,7 @@ void LogicHandler::GetVariables(std::vector<SavedVar>& vars)
|
|||
return first->second;
|
||||
};
|
||||
|
||||
std::function<uint32_t(const sol::table&)> populate = [&](const sol::table& obj)
|
||||
std::function<unsigned int(const sol::table&)> populate = [&](const sol::table& obj)
|
||||
{
|
||||
auto [first, second] = varsMap.insert(std::make_pair(obj.pointer(), (int)numVars));
|
||||
|
||||
|
@ -571,8 +571,8 @@ void LogicHandler::GetVariables(std::vector<SavedVar>& vars)
|
|||
for (auto& [first, second] : obj)
|
||||
{
|
||||
bool validKey = true;
|
||||
uint32_t keyIndex = 0;
|
||||
std::variant<std::string, uint32_t> key{uint32_t(0)};
|
||||
unsigned int keyIndex = 0;
|
||||
std::variant<std::string, unsigned int> key{unsigned int(0)};
|
||||
|
||||
// Strings and numbers can be keys AND values.
|
||||
switch (first.get_type())
|
||||
|
@ -595,7 +595,7 @@ void LogicHandler::GetVariables(std::vector<SavedVar>& vars)
|
|||
else
|
||||
{
|
||||
keyIndex = handleNum(data, numMap);
|
||||
key = static_cast<uint32_t>(data);
|
||||
key = static_cast<unsigned int>(data);
|
||||
m_savedVarPath.push_back(key);
|
||||
}
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ void LogicHandler::GetVariables(std::vector<SavedVar>& vars)
|
|||
if (!validKey)
|
||||
continue;
|
||||
|
||||
auto putInVars = [&vars, id, keyIndex](uint32_t valIndex)
|
||||
auto putInVars = [&vars, id, keyIndex](unsigned int valIndex)
|
||||
{
|
||||
std::get<IndexTable>(vars[id]).push_back(std::make_pair(keyIndex, valIndex));
|
||||
};
|
||||
|
|
|
@ -68,7 +68,7 @@ private:
|
|||
|
||||
std::unordered_map<CallbackPoint, std::unordered_set<std::string> *> m_callbacks;
|
||||
|
||||
std::vector<std::variant<std::string, uint32_t>> m_savedVarPath;
|
||||
std::vector<std::variant<std::string, unsigned int>> m_savedVarPath;
|
||||
|
||||
bool m_shortenedCalls = false;
|
||||
|
||||
|
|
|
@ -767,7 +767,7 @@ aiBitsType Moveable::GetAIBits() const
|
|||
aiBitsArray ret{};
|
||||
for (size_t i = 0; i < ret.size(); ++i)
|
||||
{
|
||||
uint8_t isSet = m_item->AIBits & (1 << i);
|
||||
unsigned char isSet = m_item->AIBits & (1 << i);
|
||||
ret[i] = static_cast<int>( isSet > 0);
|
||||
}
|
||||
|
||||
|
@ -787,7 +787,7 @@ void Moveable::SetAIBits(aiBitsType const & bits)
|
|||
for (size_t i = 0; i < bits.value().size(); ++i)
|
||||
{
|
||||
m_item->AIBits &= ~(1 << i);
|
||||
uint8_t isSet = bits.value()[i] > 0;
|
||||
unsigned char isSet = bits.value()[i] > 0;
|
||||
m_item->AIBits |= isSet << i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -935,7 +935,7 @@ bool Sound_CheckBASSError(const char* message, bool verbose, ...)
|
|||
if (verbose || bassError)
|
||||
{
|
||||
va_start(argptr, verbose);
|
||||
int32_t written = vsprintf(data, (char*)message, argptr); // @TODO: replace with debug/console/message output later...
|
||||
int written = vsprintf(data, (char*)message, argptr); // @TODO: replace with debug/console/message output later...
|
||||
va_end(argptr);
|
||||
snprintf(data + written, sizeof(data) - written, bassError ? ": error #%d" : ": success", bassError);
|
||||
TENLog(data, bassError ? LogLevel::Error : LogLevel::Info);
|
||||
|
|
|
@ -232,7 +232,6 @@ FileStream::FileStream(char* fileName, bool read, bool write)
|
|||
mode |= ofstream::binary | fstream::out | fstream::trunc;
|
||||
|
||||
m_stream.open(fileName, mode);
|
||||
bool opened = m_stream.is_open();
|
||||
}
|
||||
|
||||
FileStream::~FileStream()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue