GRAPHICS: Enable drawing of bitmaps/tiles with just one sub-image

Instead of using the number of sub-images to decide whether bitmaps
should be drawn using TIL information, better use the existance
of texture coordinates which are distinctive for tiles.
This commit is contained in:
Christian Krause 2015-05-05 02:06:21 +02:00
parent 11ca8cca47
commit d7e7ee214d
3 changed files with 4 additions and 4 deletions

View File

@ -1137,8 +1137,8 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
void GfxOpenGL::drawBitmap(const Bitmap *bitmap, int dx, int dy, uint32 layer) {
// The PS2 version of EMI uses a TGA for it's splash-screen
// avoid using the TIL-code below for that, by checking
// numImages here:
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data->_numImages > 1) {
// for texture coordinates set by BitmapData::loadTile
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data && bitmap->_data->_texc) {
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

View File

@ -1339,7 +1339,7 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
}
void GfxOpenGLS::drawBitmap(const Bitmap *bitmap, int dx, int dy, uint32 layer) {
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data->_numImages > 1) {
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data && bitmap->_data->_texc) {
BitmapData *data = bitmap->_data;
Graphics::Shader *shader = (Graphics::Shader *)data->_userData;
GLuint *textures = (GLuint *)bitmap->getTexIds();

View File

@ -986,7 +986,7 @@ void GfxTinyGL::createBitmap(BitmapData *bitmap) {
void GfxTinyGL::drawBitmap(const Bitmap *bitmap, int x, int y, uint32 layer) {
// PS2 EMI uses a TGA for it's splash-screen, avoid using the following
// code for drawing that (as it has no tiles).
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data->_numImages > 1) {
if (g_grim->getGameType() == GType_MONKEY4 && bitmap->_data && bitmap->_data->_texc) {
tglEnable(TGL_BLEND);
tglBlendFunc(TGL_SRC_ALPHA, TGL_ONE_MINUS_SRC_ALPHA);
tglColor3f(1.0f, 1.0f, 1.0f);