diff --git a/src/draw.cpp b/src/draw.cpp index 831602d..f364b28 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -186,7 +186,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) { if(stog->entity.v != 0 && SK.GetEntity(stog->entity)->IsFace()) { // In the interest of speed for the triangle drawing code, // only MAX_SELECTABLE_FACES faces may be selected at a time. - int c = 0; + unsigned int c = 0; Selection *s; selection.ClearTags(); for(s = selection.First(); s; s = selection.NextAfter(s)) { diff --git a/src/mouse.cpp b/src/mouse.cpp index d183f58..1ee3d33 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -824,7 +824,7 @@ Vector GraphicsWindow::SnapToEntityByScreenPoint(Point2d pp, hEntity he) { SEdgeList *edges = e->GetOrGenerateEdges(); double minD = -1.0f; - double k; + double k = 0.0; const SEdge *edge = NULL; for(const auto &e : edges->l) { Point2d p0 = ProjectPoint(e.a); diff --git a/src/resource.cpp b/src/resource.cpp index d3fa4ca..8921d7a 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -273,8 +273,8 @@ std::shared_ptr Pixmap::ReadPng(const Platform::Path &filename, bool fli } bool Pixmap::WritePng(FILE *f, bool flip) { - int colorType = 0; - bool bgr = false; + colorType = 0; + bgr = false; switch(format) { case Format::RGBA: colorType = PNG_COLOR_TYPE_RGBA; bgr = false; break; case Format::BGRA: colorType = PNG_COLOR_TYPE_RGBA; bgr = true; break; diff --git a/src/resource.h b/src/resource.h index d5c2e3f..35ed289 100644 --- a/src/resource.h +++ b/src/resource.h @@ -38,6 +38,8 @@ public: size_t height; size_t stride; std::vector data; + int colorType; + bool bgr; static std::shared_ptr Create(Format format, size_t width, size_t height); static std::shared_ptr FromPng(const uint8_t *data, size_t size, bool flip = false);