Add DRAWOPAQUE function to tilemap

This commit is contained in:
iq_132 2018-04-16 03:02:18 +00:00
parent ef2e41f667
commit 7d1e9496a6
2 changed files with 13 additions and 9 deletions

View File

@ -590,6 +590,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
INT32 opaque = priority & TMAP_FORCEOPAQUE;
INT32 opaque2 = priority & TMAP_DRAWOPAQUE;
INT32 tgroup = (priority >> 8) & 0xff;
priority &= 0xff;
@ -789,7 +790,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
if (sx < minx || sy < miny || sx >= (INT32)(maxx - cur_map->twidth - 1) || sy >= (INT32)(maxy - cur_map->theight - 1))
{
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -805,7 +806,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
}
}
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -840,7 +841,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
else
{
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -856,7 +857,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
}
}
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -978,7 +979,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
if (sx < minx || sy < miny || sx >= (INT32)(maxx - cur_map->twidth - 1) || sy >= (INT32)(maxy - cur_map->theight - 1))
{
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -994,7 +995,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
}
}
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -1029,7 +1030,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
else
{
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
if ((cur_map->flags & TMAP_TRANSPARENT) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {
@ -1045,7 +1046,7 @@ void GenericTilemapDraw(INT32 which, UINT16 *Bitmap, INT32 priority)
}
}
}
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0)
else if ((cur_map->flags & TMAP_TRANSMASK) && (flags & TILE_OPAQUE) == 0 && opaque == 0 && opaque2 == 0)
{
if (flipy) {
if (flipx) {

View File

@ -13,9 +13,12 @@
// flip the tilemap on the screen vertically and horizontally (used with GenericTilemapSetFlip )
#define TMAP_FLIPXY (TMAP_FLIPX | TMAP_FLIPY)
// force the tilemap to ignore any transparency settings
// force the tilemap to ignore any transparency settings and any tile skipping
#define TMAP_FORCEOPAQUE (1 << 24)
// for the tilemap to ignore transparency, but do not skip tiles
#define TMAP_DRAWOPAQUE (1 << 25)
// set tilemap to use transparent color (is set when using GenericTilemapSetTransparent)
#define TMAP_TRANSPARENT (1 << 9)