Skip to content
Browse files

Qt frontend: Fix cursor loading (really).

Previous commit didn't compile, must have used the wrong backend when testing.
  • Loading branch information...
1 parent 32e6335 commit 8ef668f3305789e67c42386163b2683ec80be79c @Cyp Cyp committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/qtgame/wzapp_qt.cpp
View
6 lib/qtgame/wzapp_qt.cpp
@@ -119,17 +119,17 @@ static QImage loadQImage(char const *fileName, char const *format = nullptr)
}
int64_t fileSizeGuess = PHYSFS_fileLength(fileHandle); // PHYSFS_fileLength may return -1.
int64_t lengthRead = 0;
- std::vector<char> data(fileSizeGuess != -1? fileSizeGuess : 16384);
+ std::vector<unsigned char> data(fileSizeGuess != -1? fileSizeGuess : 16384);
while (true)
{
int64_t moreRead = PHYSFS_read(fileHandle, &data[lengthRead], 1, data.size() - lengthRead);
- lengthRead += std::max(moreRead, 0);
+ lengthRead += std::max<int64_t>(moreRead, 0);
if (lengthRead < data.size())
{
PHYSFS_close(fileHandle);
data.resize(lengthRead);
QImage image;
- image.loadFromData(&data[0], data.size(), "PNG");
+ image.loadFromData(&data[0], data.size(), format);
return std::move(image);
}
data.resize(data.size() + 16384);

0 comments on commit 8ef668f

Please sign in to comment.
Something went wrong with that request. Please try again.