1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-06 00:10:15 +02:00

Fixed MSVC warnings, added Windows build script.

This commit is contained in:
Muzychenko Andrey 2023-09-05 10:51:19 +03:00
parent 6ab7b3e772
commit 350651dae6
7 changed files with 27 additions and 6 deletions

View file

@ -245,7 +245,7 @@ int DatFile::field_size(int groupIndex, FieldTypes targetEntryType)
int DatFile::record_labeled(LPCSTR targetGroupName)
{
auto targetLength = strlen(targetGroupName);
for (int groupIndex = Groups.size() - 1; groupIndex >= 0; --groupIndex)
for (int groupIndex = static_cast<int>(Groups.size()) - 1; groupIndex >= 0; --groupIndex)
{
auto groupName = field(groupIndex, FieldTypes::GroupName);
if (!groupName)

View file

@ -53,7 +53,7 @@ void Sound::PlaySound(Mix_Chunk* wavePtr, int time, TPinballComponent* soundSour
return a.TimeStamp < b.TimeStamp;
};
auto min = std::min_element(Channels.begin(), Channels.end(), cmp);
auto oldestChannel = std::distance(Channels.begin(), min);
auto oldestChannel = static_cast<int>(std::distance(Channels.begin(), min));
Mix_HaltChannel(oldestChannel);
}

View file

@ -89,7 +89,7 @@ void TFlagSpinner::NextFrame()
{
BmpIndex += SpinDirection;
int bmpIndex = BmpIndex;
int bmpCount = ListBitmap->size();
int bmpCount = static_cast<int>(ListBitmap->size());
if (bmpIndex >= bmpCount)
BmpIndex = 0;
else if (bmpIndex < 0)

View file

@ -115,8 +115,7 @@ void TFlipper::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
void TFlipper::UpdateSprite()
{
int bmpCountSub1 = ListBitmap->size() - 1;
auto bmpCountSub1 = static_cast<int>(ListBitmap->size()) - 1;
auto newBmpIndex = static_cast<int>(floor(FlipperEdge->CurrentAngle / FlipperEdge->AngleMax * bmpCountSub1 + 0.5f));
newBmpIndex = Clamp(newBmpIndex, 0, bmpCountSub1);
if (BmpIndex == newBmpIndex)

View file

@ -1366,7 +1366,7 @@ void winmain::RenderFrameTimeDialog()
sprintf(overlay, "avg %.3fms, dev %.3fms", average, dev);
auto region = ImGui::GetContentRegionAvail();
ImGui::PlotLines("Lines", gfrDisplay.data(), gfrDisplay.size(),
ImGui::PlotLines("Lines", gfrDisplay.data(), static_cast<int>(gfrDisplay.size()),
scrollPlot ? gfrOffset : 0, overlay, 0, yMax, region);
}
}