diff --git a/src/bmp.cpp b/src/bmp.cpp index 6a2b317..30906bf 100644 --- a/src/bmp.cpp +++ b/src/bmp.cpp @@ -82,6 +82,9 @@ readBMP(const char *afilename) StreamMemory file; int i, x, y; + bool32 noalpha; + int pad; + filename = Image::getFilename(afilename); if(filename == nil) return nil; @@ -103,7 +106,7 @@ readBMP(const char *afilename) dib.paletteLen = 0; } - bool32 noalpha = true; + noalpha = true; // Recognize 32 bit formats if(dib.compression == 3){ @@ -138,7 +141,7 @@ readBMP(const char *afilename) file.seek(bmp.offset, 0); - int pad = image->width*image->bpp % 4; + pad = image->width*image->bpp % 4; uint8 *px, *line; line = image->pixels + (image->height-1)*image->stride; diff --git a/src/charset.cpp b/src/charset.cpp index e08d423..a16cb0c 100644 --- a/src/charset.cpp +++ b/src/charset.cpp @@ -143,7 +143,7 @@ Charset::printChar(uint32 c, int32 x, int32 y) RWDEVICE::Im2DVertex *vert; uint16 *ix; - if(c >= this->desc.count) + if((int32)c >= this->desc.count) return; if(this->raster != lastRaster || numChars >= NUMCHARS) diff --git a/src/d3d/rwxbox.h b/src/d3d/rwxbox.h index 848bfb9..92fd71c 100644 --- a/src/d3d/rwxbox.h +++ b/src/d3d/rwxbox.h @@ -96,7 +96,7 @@ Texture *readNativeTexture(Stream *stream); void writeNativeTexture(Texture *tex, Stream *stream); uint32 getSizeNativeTexture(Texture *tex); -enum { +enum : uint32 { D3DFMT_UNKNOWN = 0xFFFFFFFF, /* Swizzled formats */ diff --git a/src/geometry.cpp b/src/geometry.cpp index e5994c7..85a917b 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -497,7 +497,7 @@ Geometry::generateTriangles(int8 *adc) static void dumpMesh(Mesh *m) { - for(int32 i = 0; i < m->numIndices-2; i++) + for(uint32 i = 0; i < m->numIndices-2; i++) // if(i % 2) // printf("%3d %3d %3d\n", // m->indices[i+1], diff --git a/src/gl/gl3device.cpp b/src/gl/gl3device.cpp index 0bad8f6..328f171 100644 --- a/src/gl/gl3device.cpp +++ b/src/gl/gl3device.cpp @@ -25,13 +25,14 @@ namespace rw { namespace gl3 { - +#ifndef LIBRW_SDL2 struct DisplayMode { GLFWvidmode mode; int32 depth; uint32 flags; }; +#endif struct GlGlobals { @@ -48,13 +49,13 @@ struct GlGlobals DisplayMode *modes; int numModes; int currentMode; + GLFWwindow **pWindow; #endif int presentWidth, presentHeight; // for opening the window int winWidth, winHeight; const char *winTitle; - GLFWwindow **pWindow; } glGlobals; struct UniformState diff --git a/src/gl/rwgl3.h b/src/gl/rwgl3.h index 210d7cf..09772d7 100644 --- a/src/gl/rwgl3.h +++ b/src/gl/rwgl3.h @@ -14,6 +14,7 @@ struct EngineOpenParams { #ifdef LIBRW_SDL2 SDL_Window **window; + bool32 fullscreen; #else GLFWwindow **window; #endif diff --git a/src/image.cpp b/src/image.cpp index 7521595..6a350a4 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -475,7 +475,7 @@ static char* rwstrdup(const char *s) { char *t; - int32 len = strlen(s)+1; + size_t len = strlen(s)+1; t = (char*)rwMalloc(len, MEMDUR_EVENT); if(t) memcpy(t, s, len); diff --git a/src/rwobjects.h b/src/rwobjects.h index 8a33cc8..b8a1b5b 100644 --- a/src/rwobjects.h +++ b/src/rwobjects.h @@ -198,7 +198,7 @@ struct Raster void destroy(void); static bool32 imageFindRasterFormat(Image *image, int32 type, int32 *pWidth, int32 *pHeight, int32 *pDepth, int32 *pFormat, int32 platform = 0); - Raster *Raster::setFromImage(Image *image, int32 platform = 0); + Raster *setFromImage(Image *image, int32 platform = 0); static Raster *createFromImage(Image *image, int32 platform = 0); Image *toImage(void); uint8 *lock(int32 level, int32 lockMode); diff --git a/src/uvanim.cpp b/src/uvanim.cpp index 05e2fba..00fd8fd 100644 --- a/src/uvanim.cpp +++ b/src/uvanim.cpp @@ -240,8 +240,8 @@ uvAnimParamInterpCB(void *out, void *in1, void *in2, float32 t, void *custom) float32 f = (t - kf1->time) / (kf2->time - kf1->time); float32 a = kf2->uv[0] - kf1->uv[0]; - while(a < M_PI) a += 2*M_PI; - while(a > M_PI) a -= 2*M_PI; + while(a < (float)M_PI) a += 2 * (float)M_PI; + while(a > (float)M_PI) a -= 2 * (float)M_PI; intf->uv[0] = a*f + kf1->uv[0]; intf->uv[1] = (kf2->uv[1] - kf1->uv[1])*f + kf1->uv[1]; intf->uv[2] = (kf2->uv[2] - kf1->uv[2])*f + kf1->uv[2]; diff --git a/tools/clumpview/ras_test.cpp b/tools/clumpview/ras_test.cpp index d5c0435..6e17310 100644 --- a/tools/clumpview/ras_test.cpp +++ b/tools/clumpview/ras_test.cpp @@ -287,11 +287,11 @@ putpixel(Canvas *canvas, Point3 p, Color c) case DEPTHTEST_ALWAYS: break; case DEPTHTEST_GEQUAL: - if(p.z < *z) + if(p.z < (int)*z) return; break; case DEPTHTEST_GREATER: - if(p.z <= *z) + if(p.z <= (int)*z) return; break; }