replace pointer table to textures by huge texture table

optimization
This commit is contained in:
util1 2019-07-25 09:38:25 +02:00
parent 8b8b2665bd
commit bf07238dc7
1 changed files with 8 additions and 6 deletions

View File

@ -4,10 +4,12 @@ static unsigned char const blanc[8]={0,0,0,0,0,0,0,0};
static unsigned char const noir[8]={255,255,255,255,255,255,255,255};
// textures address
unsigned char const * const FE_textures[2]={blanc,noir};
bool FE_get_pixel(int texture_num,int x, int y)
unsigned char const * const FE_textures[2][8]=
{
unsigned char* texture=FE_textures[texture_num];
return (1<<(7-x)&texture[y]);
}
{0,0,0,0,0,0,0,0}, // full white
{255,255,255,255,255,255,255,255}, // full black
};
bool FE_get_pixel(int num,int x, int y)
{return (1<<(7-x)FE_textures[num][y]);}