mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2025-01-30 23:00:16 -05:00
Fix sgfault
This commit is contained in:
parent
211c32b415
commit
9e154867f4
5
TODO.txt
5
TODO.txt
@ -12,6 +12,11 @@
|
||||
- replace textures in distace with constant color for performance (setting)?
|
||||
- add time slowdown constant
|
||||
|
||||
bugs:
|
||||
|
||||
- sprite positioning inccuracy
|
||||
|
||||
|
||||
done:
|
||||
|
||||
- texture coords of floor walls should start from the floor? NO, CAUSES ISSUES
|
||||
|
10
levels.h
10
levels.h
@ -232,11 +232,11 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level0 =
|
||||
10, // floorColor
|
||||
32, // ceilingColor
|
||||
{ // elements
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {12, 3}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {12, 3}}, {SFG_LEVEL_ELEMENT_BARREL, {13, 3}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {12, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {15, 4}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {24, 10}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {13, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {12, 6}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {13, 6}}, {SFG_LEVEL_ELEMENT_BARREL, {12,66}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
|
13
main.c
13
main.c
@ -446,8 +446,8 @@ void SFG_drawScaledImage(
|
||||
if (y1 >= SFG_GAME_RESOLUTION_Y)
|
||||
y1 = SFG_GAME_RESOLUTION_Y - 1;
|
||||
|
||||
if ((x0 > x1) || (y0 > y1)) // completely outside screen?
|
||||
return;
|
||||
if ((x0 > x1) || (y0 > y1) || (u0 >= size) || (v0 >= size))
|
||||
return; // outside screen?
|
||||
|
||||
int16_t u1 = u0 + (x1 - x0);
|
||||
int16_t v1 = v0 + (y1 - y0);
|
||||
@ -462,6 +462,9 @@ void SFG_drawScaledImage(
|
||||
int16_t precompFrom = RCL_min(uMin,vMin);
|
||||
int16_t precompTo = RCL_max(uMax,vMax);
|
||||
|
||||
precompFrom = RCL_max(0,precompFrom);
|
||||
precompTo = RCL_min(SFG_MAX_SPRITE_SIZE - 1,precompTo);
|
||||
|
||||
#define PRECOMP_SCALE 2048
|
||||
|
||||
int16_t precompStepScaled = (SFG_TEXTURE_SIZE * PRECOMP_SCALE) / size;
|
||||
@ -649,6 +652,12 @@ void SFG_setAndInitLevel(const SFG_Level *level)
|
||||
SFG_currentLevel.frameStart = SFG_gameFrame;
|
||||
|
||||
SFG_initPlayer();
|
||||
|
||||
SFG_player.camera.position.x = 13185;
|
||||
SFG_player.camera.position.y = 4395;
|
||||
SFG_player.camera.direction = 846;
|
||||
SFG_player.camera.height = 3360;
|
||||
|
||||
}
|
||||
|
||||
void SFG_init()
|
||||
|
Loading…
Reference in New Issue
Block a user