Browse Source

dun_render: Remove unused argument from RenderTile

Now that we pass the mask into `RenderTile`, we no longer need to pass
`levelPieceId`.
pull/5554/head
Gleb Mazovetskiy 3 years ago committed by Anders Jenbo
parent
commit
e06ca9a016
  1. 3
      Source/engine/render/dun_render.cpp
  2. 4
      Source/engine/render/dun_render.hpp
  3. 12
      Source/engine/render/scrollrt.cpp

3
Source/engine/render/dun_render.cpp

@ -1082,8 +1082,7 @@ string_view MaskTypeToString(MaskType maskType)
#endif
void RenderTile(const Surface &out, Point position,
uint16_t levelPieceId, LevelCelBlock levelCelBlock,
MaskType maskType, uint8_t lightTableIndex)
LevelCelBlock levelCelBlock, MaskType maskType, uint8_t lightTableIndex)
{
const TileType tile = levelCelBlock.type();

4
Source/engine/render/dun_render.hpp

@ -261,13 +261,11 @@ string_view MaskTypeToString(MaskType maskType);
* @param out Target buffer
* @param position Target buffer coordinates
* @param levelCelBlock The MIN block of the level CEL file.
* @param levelPieceId The piece ID (index into SOLData and DPieceMicros).
* @param maskType The mask to use,
* @param lightTableIndex The light level to use for rendering (index into LightTables / 256).
*/
void RenderTile(const Surface &out, Point position,
uint16_t levelPieceId, LevelCelBlock levelCelBlock,
MaskType maskType, uint8_t lightTableIndex);
LevelCelBlock levelCelBlock, MaskType maskType, uint8_t lightTableIndex);
/**
* @brief Render a black 64x31 tile

12
Source/engine/render/scrollrt.cpp

@ -560,7 +560,7 @@ void DrawCell(const Surface &out, Point tilePosition, Point targetBufferPosition
if (levelCelBlock.hasValue()) {
if (maskType != MaskType::LeftFoliage || tileType == TileType::TransparentSquare) {
RenderTile(out, targetBufferPosition,
levelPieceId, levelCelBlock, maskType, LightTableIndex);
levelCelBlock, maskType, LightTableIndex);
}
}
}
@ -572,7 +572,7 @@ void DrawCell(const Surface &out, Point tilePosition, Point targetBufferPosition
if (transparency || !foliage || levelCelBlock.type() == TileType::TransparentSquare) {
if (maskType != MaskType::RightFoliage || tileType == TileType::TransparentSquare) {
RenderTile(out, targetBufferPosition + Displacement { TILE_WIDTH / 2, 0 },
levelPieceId, levelCelBlock, maskType, LightTableIndex);
levelCelBlock, maskType, LightTableIndex);
}
}
}
@ -585,7 +585,7 @@ void DrawCell(const Surface &out, Point tilePosition, Point targetBufferPosition
const LevelCelBlock levelCelBlock { pMap->mt[i] };
if (levelCelBlock.hasValue()) {
RenderTile(out, targetBufferPosition,
levelPieceId, levelCelBlock,
levelCelBlock,
transparency ? MaskType::Transparent : MaskType::Solid, LightTableIndex);
}
}
@ -593,7 +593,7 @@ void DrawCell(const Surface &out, Point tilePosition, Point targetBufferPosition
const LevelCelBlock levelCelBlock { pMap->mt[i + 1] };
if (levelCelBlock.hasValue()) {
RenderTile(out, targetBufferPosition + Displacement { TILE_WIDTH / 2, 0 },
levelPieceId, levelCelBlock,
levelCelBlock,
transparency ? MaskType::Transparent : MaskType::Solid, LightTableIndex);
}
}
@ -616,14 +616,14 @@ void DrawFloor(const Surface &out, Point tilePosition, Point targetBufferPositio
const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt[0] };
if (levelCelBlock.hasValue()) {
RenderTile(out, targetBufferPosition,
levelPieceId, levelCelBlock, MaskType::Solid, LightTableIndex);
levelCelBlock, MaskType::Solid, LightTableIndex);
}
}
{
const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt[1] };
if (levelCelBlock.hasValue()) {
RenderTile(out, targetBufferPosition + Displacement { TILE_WIDTH / 2, 0 },
levelPieceId, levelCelBlock, MaskType::Solid, LightTableIndex);
levelCelBlock, MaskType::Solid, LightTableIndex);
}
}
}

Loading…
Cancel
Save