Fixed warnings.

This commit is contained in:
Leonardo Zide
2025-12-18 16:18:45 -03:00
parent 6984b53990
commit 4e49d4d0cc
6 changed files with 81 additions and 69 deletions
+2 -2
View File
@@ -363,11 +363,11 @@ bool lcCamera::FileLoad(lcFile& file)
if (version < 5)
{
n = file.ReadS32();
file.ReadS32();
}
else
{
ch = file.ReadU8();
file.ReadU8();
file.ReadU8();
}
}
+4
View File
@@ -649,7 +649,11 @@ void lcInstructionsDialog::Print(QPrinter* Printer)
for (int PageCopy = 0; PageCopy < PageCopies; PageCopy++)
{
if (Printer->printerState() == QPrinter::Aborted || Printer->printerState() == QPrinter::Error)
{
delete Scene;
return;
}
if (!FirstPage)
Printer->newPage();
+4 -2
View File
@@ -1324,8 +1324,10 @@ void lcPropertiesWidget::SetPiece(const std::vector<lcObject*>& Selection, lcObj
lcMatrix33 RelativeRotation;
lcModel* Model = gMainWindow->GetActiveModel();
if (Model)
Model->GetMoveRotateTransform(Position, RelativeRotation);
if (!Model)
return;
Model->GetMoveRotateTransform(Position, RelativeRotation);
UpdateFloat(lcObjectPropertyId::ObjectPositionX, Position[0]);
UpdateFloat(lcObjectPropertyId::ObjectPositionY, Position[1]);
+70 -63
View File
@@ -1518,70 +1518,77 @@ void lcView::DrawGrid()
if (Preferences.mDrawGridLines)
VertexBufferSize += 2 * (MaxX - MinX + MaxY - MinY + 2) * 3 * sizeof(float);
float* Verts = (float*)malloc(VertexBufferSize);
if (!Verts)
return;
float* CurVert = Verts;
if (Preferences.mDrawGridStuds)
float* Verts = nullptr;
if (VertexBufferSize)
{
float Left = MinX * 20.0f * Spacing;
float Right = MaxX * 20.0f * Spacing;
float Top = MinY * 20.0f * Spacing;
float Bottom = MaxY * 20.0f * Spacing;
float Z = 0;
float U = (MaxX - MinX) * Spacing;
float V = (MaxY - MinY) * Spacing;
*CurVert++ = Left;
*CurVert++ = Top;
*CurVert++ = Z;
*CurVert++ = 0.0f;
*CurVert++ = V;
*CurVert++ = Right;
*CurVert++ = Top;
*CurVert++ = Z;
*CurVert++ = U;
*CurVert++ = V;
*CurVert++ = Left;
*CurVert++ = Bottom;
*CurVert++ = Z;
*CurVert++ = 0.0f;
*CurVert++ = 0.0f;
*CurVert++ = Right;
*CurVert++ = Bottom;
*CurVert++ = Z;
*CurVert++ = U;
*CurVert++ = 0.0f;
}
if (Preferences.mDrawGridLines)
{
float LineSpacing = Spacing * 20.0f;
for (int Step = MinX; Step < MaxX + 1; Step++)
{
*CurVert++ = Step * LineSpacing;
*CurVert++ = MinY * LineSpacing;
*CurVert++ = 0.0f;
*CurVert++ = Step * LineSpacing;
*CurVert++ = MaxY * LineSpacing;
*CurVert++ = 0.0f;
}
for (int Step = MinY; Step < MaxY + 1; Step++)
{
*CurVert++ = MinX * LineSpacing;
*CurVert++ = Step * LineSpacing;
*CurVert++ = 0.0f;
*CurVert++ = MaxX * LineSpacing;
*CurVert++ = Step * LineSpacing;
*CurVert++ = 0.0f;
}
Verts = static_cast<float*>(malloc(VertexBufferSize));
if (!Verts)
return;
float* CurVert = Verts;
if (Preferences.mDrawGridStuds)
{
float Left = MinX * 20.0f * Spacing;
float Right = MaxX * 20.0f * Spacing;
float Top = MinY * 20.0f * Spacing;
float Bottom = MaxY * 20.0f * Spacing;
float Z = 0;
float U = (MaxX - MinX) * Spacing;
float V = (MaxY - MinY) * Spacing;
*CurVert++ = Left;
*CurVert++ = Top;
*CurVert++ = Z;
*CurVert++ = 0.0f;
*CurVert++ = V;
*CurVert++ = Right;
*CurVert++ = Top;
*CurVert++ = Z;
*CurVert++ = U;
*CurVert++ = V;
*CurVert++ = Left;
*CurVert++ = Bottom;
*CurVert++ = Z;
*CurVert++ = 0.0f;
*CurVert++ = 0.0f;
*CurVert++ = Right;
*CurVert++ = Bottom;
*CurVert++ = Z;
*CurVert++ = U;
*CurVert++ = 0.0f;
}
if (Preferences.mDrawGridLines)
{
float LineSpacing = Spacing * 20.0f;
for (int Step = MinX; Step < MaxX + 1; Step++)
{
*CurVert++ = Step * LineSpacing;
*CurVert++ = MinY * LineSpacing;
*CurVert++ = 0.0f;
*CurVert++ = Step * LineSpacing;
*CurVert++ = MaxY * LineSpacing;
*CurVert++ = 0.0f;
}
for (int Step = MinY; Step < MaxY + 1; Step++)
{
*CurVert++ = MinX * LineSpacing;
*CurVert++ = Step * LineSpacing;
*CurVert++ = 0.0f;
*CurVert++ = MaxX * LineSpacing;
*CurVert++ = Step * LineSpacing;
*CurVert++ = 0.0f;
}
}
}
mGridSettings[0] = MinX;
-1
View File
@@ -1165,7 +1165,6 @@ std::pair<lcTrackTool, quint32> lcViewManipulator::UpdateSelectMove(lcTrackButto
{
NewTrackTool = TrainTrackTool;
NewTrackSection = TrainTrackSection;
ClosestIntersectionDistance = TrainDistance;
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ lcLight::lcLight(const lcVector3& Position, lcLightType LightType)
mPosition.SetValue(Position);
UpdatePosition(1);
lcLight::UpdatePosition(1);
}
void lcLight::CopyProperties(const lcLight& Other)