This commit is contained in:
Miloslav Číž 2019-10-23 20:06:07 +02:00
parent 780abe1d8b
commit 8b94b29388
12 changed files with 10 additions and 10 deletions

View File

@ -43,7 +43,7 @@ static inline uint8_t SFG_getTexel(const uint8_t *texture, uint8_t x, uint8_t y)
(texture[16 + (x * SFG_TEXTURE_SIZE + y) / 2] >> (4 * (y % 2 == 0))) & 0x0f];
}
SFG_PROGRAM_MEMORY uint8_t SFG_texturesWall[][SFG_TEXTURE_STORE_SIZE] =
SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
{
{ // 0: white wooden planks
4,21,5,3,20,0,2,26,6,18,57,65,1,16,17,49,0,1,0,3,32,1,33,0,161,64,1,16,64,3,3,
@ -320,7 +320,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_texturesWall[][SFG_TEXTURE_STORE_SIZE] =
}
};
SFG_PROGRAM_MEMORY uint8_t SFG_sprites[][SFG_TEXTURE_STORE_SIZE] =
SFG_PROGRAM_MEMORY uint8_t SFG_itemSprites[][SFG_TEXTURE_STORE_SIZE] =
{
{ // 0: barrel
175,6,84,15,11,19,13,7,176,22,2,0,5,20,83,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -347,7 +347,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_sprites[][SFG_TEXTURE_STORE_SIZE] =
}
};
SFG_PROGRAM_MEMORY uint8_t SFG_backgrounds[][SFG_TEXTURE_STORE_SIZE] =
SFG_PROGRAM_MEMORY uint8_t SFG_backgroundImages[][SFG_TEXTURE_STORE_SIZE] =
{
{ // 0, city
64,73,10,168,19,12,14,13,80,101,0,100,136,57,59,63,34,34,34,68,87,119,119,119,
@ -441,7 +441,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_weaponImages[][SFG_TEXTURE_STORE_SIZE] =
}
};
SFG_PROGRAM_MEMORY uint8_t SFG_effects[][SFG_TEXTURE_STORE_SIZE] =
SFG_PROGRAM_MEMORY uint8_t SFG_effectSprites[][SFG_TEXTURE_STORE_SIZE] =
{
{ // 0, explostion
175,183,174,15,103,111,191,7,31,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/item_health.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 750 B

View File

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 785 B

12
main.c
View File

@ -615,7 +615,7 @@ void SFG_pixelFunc(RCL_PixelInfo *pixel)
(SFG_getTexel(
textureIndex != 255 ?
SFG_currentLevel.textures[textureIndex]:
SFG_texturesWall[SFG_currentLevel.levelPointer->doorTextureIndex],
SFG_wallTextures[SFG_currentLevel.levelPointer->doorTextureIndex],
pixel->texCoords.x / 32,
textureV / 32)
) :
@ -655,7 +655,7 @@ void SFG_pixelFunc(RCL_PixelInfo *pixel)
}
else
{
color = SFG_getTexel(SFG_backgrounds[0],
color = SFG_getTexel(SFG_backgroundImages[0],
SFG_backgroundScaleMap[(pixel->position.x * SFG_RAYCASTING_SUBSAMPLE + SFG_backgroundScroll) % SFG_GAME_RESOLUTION_Y],
// ^ TODO: get rid of mod?
SFG_backgroundScaleMap[pixel->position.y]);
@ -971,7 +971,7 @@ void SFG_setAndInitLevel(const SFG_Level *level)
for (uint8_t i = 0; i < 7; ++i)
SFG_currentLevel.textures[i] =
SFG_texturesWall[level->textureIndices[i]];
SFG_wallTextures[level->textureIndices[i]];
SFG_LOG("initializing doors");
@ -2140,7 +2140,7 @@ void SFG_drawWeapon(int16_t bobOffset)
/ animationLength;
if (shotAnimationFrame < animationLength / 2)
SFG_blitImage(SFG_effects[0],
SFG_blitImage(SFG_effectSprites[0],
SFG_WEAPON_IMAGE_POSITION_X,
SFG_WEAPON_IMAGE_POSITION_Y - (SFG_TEXTURE_SIZE / 3) * SFG_WEAPON_IMAGE_SCALE + bobOffset,
SFG_WEAPON_IMAGE_SCALE);
@ -2250,7 +2250,7 @@ void SFG_draw()
SFG_player.camera);
if (p.depth > 0)
SFG_drawScaledSprite(SFG_sprites[0],
SFG_drawScaledSprite(SFG_itemSprites[0],
p.position.x * SFG_RAYCASTING_SUBSAMPLE,p.position.y,
RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y / 2,p.depth),
p.depth / (RCL_UNITS_PER_SQUARE * 2),p.depth);
@ -2270,7 +2270,7 @@ void SFG_draw()
RCL_mapToScreen(worldPosition,proj->position[2],SFG_player.camera);
const uint8_t *s =
SFG_effects[proj->type == SFG_PROJECTILE_FIREBALL ? 1 : 0];
SFG_effectSprites[proj->type == SFG_PROJECTILE_FIREBALL ? 1 : 0];
int16_t spriteSize = SFG_GAME_RESOLUTION_Y / 3;