abandoned some ideas that were complicating the design

This commit is contained in:
Andre Leiradella 2015-05-18 01:02:18 -03:00
parent d6d2def2f4
commit 0e85456476
3 changed files with 4 additions and 22 deletions

View File

@ -7,9 +7,6 @@ static uint16_t* pixels;
static int width, height;
static uint16_t* fb;
static uint16_t saved_backgrnd[ RL_BG_SAVE_SIZE ];
static uint16_t* saved_ptr;
int rl_backgrnd_create( int w, int h )
{
pixels = (uint16_t*)rl_malloc( ( ( w + RL_BACKGRND_MARGIN ) * h + RL_BACKGRND_MARGIN ) * sizeof( uint16_t ) );
@ -20,8 +17,6 @@ int rl_backgrnd_create( int w, int h )
height = h;
fb = (uint16_t*)pixels + RL_BACKGRND_MARGIN;
saved_ptr = saved_backgrnd;
return 0;
}
@ -99,13 +94,3 @@ uint16_t* rl_backgrnd_fb( int* w, int* h )
return fb;
}
uint16_t* rl_backgrnd_get_bgptr( void )
{
return saved_ptr;
}
void rl_backgrnd_set_bgptr( uint16_t* bg_ptr )
{
saved_ptr = bg_ptr;
}

View File

@ -10,7 +10,4 @@ void rl_backgrnd_clear( uint16_t color );
void rl_backgrnd_scroll( int dx, int dy );
uint16_t* rl_backgrnd_fb( int* width, int* height );
uint16_t* rl_backgrnd_get_bgptr( void );
void rl_backgrnd_set_bgptr( uint16_t* bg_ptr );
#endif /* RL_BACKGRND_H */

View File

@ -15,6 +15,9 @@ static spt_t sprites[ RL_MAX_SPRITES + 1 ];
static int num_sprites, num_visible;
static int x0, y0;
static uint16_t saved_backgrnd[ RL_BG_SAVE_SIZE ];
static uint16_t* saved_ptr;
void rl_sprite_init( void )
{
num_sprites = num_visible = 0;
@ -137,7 +140,7 @@ void rl_sprites_blit( void )
sprites[ num_sprites ].sprite = &guard; /* guard */
sptptr = sprites;
uint16_t* saved_ptr = rl_backgrnd_get_bgptr();
saved_ptr = saved_backgrnd;
/* Iterate over active and visible sprites and blit them */
/* flags & 0x0007U == 0 */
@ -166,7 +169,6 @@ void rl_sprites_blit( void )
}
num_sprites = sptptr - sprites;
rl_backgrnd_set_bgptr( saved_ptr );
}
void rl_sprites_unblit( void )
@ -182,7 +184,5 @@ void rl_sprites_unblit( void )
sptptr--;
}
while ( sptptr >= sprites );
rl_backgrnd_set_bgptr( sptptr[ 1 ].bg );
}
}