make the terrifying sign-compare warnings go away

This commit is contained in:
Struma 2022-01-23 09:31:27 -05:00
parent ac9f56c41c
commit 5855266dab
2 changed files with 6 additions and 6 deletions

View file

@ -169,12 +169,12 @@ struct BitmapPrivate
unsigned long long startTime;
unsigned long long playTime;
inline int currentFrameIRaw() {
inline unsigned int currentFrameIRaw() {
if (fps <= 0) return lastFrame;
return floor(lastFrame + (playTime / ((1 / fps) * 1000000)));
}
int currentFrameI() {
unsigned int currentFrameI() {
if (!playing || needsReset) return lastFrame;
int i = currentFrameIRaw();
return (loop) ? fmod(i, frames.size()) : (i > (int)frames.size() - 1) ? (int)frames.size() - 1 : i;
@ -480,7 +480,7 @@ Bitmap::Bitmap(const char *filename)
if (handler.gif) {
p = new BitmapPrivate(this);
if (handler.gif->width >= glState.caps.maxTexSize || handler.gif->height > glState.caps.maxTexSize)
if ((uint32_t)handler.gif->width >= glState.caps.maxTexSize || (uint32_t)handler.gif->height > glState.caps.maxTexSize)
{
throw new Exception(Exception::MKXPError, "Animation too large (%ix%i, max %ix%i)",
handler.gif->width, handler.gif->height, glState.caps.maxTexSize, glState.caps.maxTexSize);

View file

@ -1256,7 +1256,7 @@ void Graphics::playMovie(const char *filename, int volume, bool skippable) {
letterbox.fillRect(0, 0, width(), height(), Vec4(0,0,0,255));
letterboxSprite.setBitmap(&letterbox);
letterboxSprite.setZ(-999);
letterboxSprite.setZ(-1000);
movieSprite.setZ(-998);
movie->play();
@ -1366,10 +1366,10 @@ void Graphics::repaintWait(const AtomicFlag &exitCond, bool checkReset) {
GLMeta::blitSource(lastFrame);
while (!exitCond) {
0;//shState->checkShutdown();
shState->checkShutdown();
if (checkReset)
0;//shState->checkReset();
shState->checkReset();
FBO::clear();
p->metaBlitBufferFlippedScaled();