From bf07238dc77dbaeb413578539bba405663af05bc Mon Sep 17 00:00:00 2001 From: util1 Date: Thu, 25 Jul 2019 09:38:25 +0200 Subject: [PATCH] replace pointer table to textures by huge texture table optimization --- src/FxEngine/texture.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/FxEngine/texture.c b/src/FxEngine/texture.c index 5bed2c7..bdfde29 100644 --- a/src/FxEngine/texture.c +++ b/src/FxEngine/texture.c @@ -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]); -} \ No newline at end of file + {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]);} \ No newline at end of file