Fix pokitto

This commit is contained in:
Miloslav Číž 2019-10-06 20:17:09 +02:00
parent 87b079630f
commit 91a7814193
2 changed files with 7 additions and 6 deletions

9
main.c
View File

@ -635,7 +635,7 @@ void SFG_setAndInitLevel(const SFG_Level *level)
for (uint8_t i = 0; i < SFG_MAX_LEVEL_ELEMENTS; ++i)
{
SFG_LevelElement *e = &(SFG_currentLevel.levelPointer->elements[i]);
const SFG_LevelElement *e = &(SFG_currentLevel.levelPointer->elements[i]);
if (e->elementType == SFG_LEVEL_ELEMENT_BARREL)
{
@ -885,9 +885,10 @@ void SFG_draw()
SFG_floorHeightAt(e.coords[0],e.coords[1]) + RCL_UNITS_PER_SQUARE / 2,
SFG_player.camera);
SFG_drawScaledImage(SFG_sprites[0],p.position.x,p.position.y,
RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y / 2,p.depth),
p.depth / (RCL_UNITS_PER_SQUARE * 2));
if (p.depth > 0)
SFG_drawScaledImage(SFG_sprites[0],p.position.x,p.position.y,
RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y / 2,p.depth),
p.depth / (RCL_UNITS_PER_SQUARE * 2));
}
}

View File

@ -1636,8 +1636,8 @@ RCL_PixelInfo RCL_mapToScreen(RCL_Vector2D worldPosition, RCL_Unit height,
result.position.y = camera.resolution.y / 2 -
(camera.resolution.y *
RCL_perspectiveScale(height - camera.height,result.depth)) / RCL_UNITS_PER_SQUARE
+ camera.shear;
RCL_perspectiveScale(height - camera.height,result.depth))
/ RCL_UNITS_PER_SQUARE + camera.shear;
RCL_Unit middleColumn = camera.resolution.x / 2;