From fabbcc4aa79af8a88485e852cb965c52192f8847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 26 Mar 2024 21:14:42 +0100 Subject: [PATCH] gfx: TEXTURE_NO_SRGB --- bind/v4k.lua | 2 +- demos/01-demo2d.c | 4 ++-- demos/06-material.c | 4 ++-- demos/06-scene.c | 2 +- demos/08-video.c | 4 ++-- demos/99-pbr.c | 4 ++-- demos/99-sprite.c | 8 ++++---- engine/joint/v4k.h | 22 +++++++++++----------- engine/split/v4k_render.c | 14 +++++++------- engine/split/v4k_render.h | 2 +- engine/split/v4k_scene.c | 2 +- engine/split/v4k_sprite.c | 2 +- engine/split/v4k_video.c | 2 +- engine/v4k.c | 20 ++++++++++---------- engine/v4k.h | 2 +- 15 files changed, 47 insertions(+), 47 deletions(-) diff --git a/bind/v4k.lua b/bind/v4k.lua index 0fda08a..9319a63 100644 --- a/bind/v4k.lua +++ b/bind/v4k.lua @@ -1076,7 +1076,7 @@ enum TEXTURE_FLAGS { TEXTURE_RGB = IMAGE_RGB, TEXTURE_RGBA = IMAGE_RGBA, TEXTURE_FLIP = IMAGE_FLIP, - TEXTURE_SRGB = 1 << 24, + TEXTURE_NO_SRGB = 1 << 24, TEXTURE_BGR = 1 << 25, TEXTURE_BGRA = TEXTURE_BGR, TEXTURE_ARRAY = 1 << 26, diff --git a/demos/01-demo2d.c b/demos/01-demo2d.c index 7e37084..d474c66 100644 --- a/demos/01-demo2d.c +++ b/demos/01-demo2d.c @@ -9,7 +9,7 @@ void demo_kids(vec3 offs) { // init - static texture_t kids; do_once kids = texture( "spriteSheetExample.png", TEXTURE_LINEAR|TEXTURE_SRGB ); + static texture_t kids; do_once kids = texture( "spriteSheetExample.png", TEXTURE_LINEAR ); static vec3 pos[2] = {{490,362},{442,362}}, vel[2] = {0}; static int row[2] = {0,3}, frame[2] = {0}; static int inputs[2][4] = {{KEY_W,KEY_A,KEY_S,KEY_D},{KEY_UP,KEY_LEFT,KEY_DOWN,KEY_RIGHT}}; @@ -39,7 +39,7 @@ void demo_kids(vec3 offs) { void demo_hud() { // draw pixel-art hud, 16x16 ui element, scaled and positioned in resolution-independant way - static texture_t inputs; do_once inputs = texture( "prompts_tilemap_34x24_16x16x1.png", TEXTURE_LINEAR|TEXTURE_SRGB ); + static texture_t inputs; do_once inputs = texture( "prompts_tilemap_34x24_16x16x1.png", TEXTURE_LINEAR ); float spritesheet[3] = {17,34,24}, offset[2] = {0, - 2*absf(sin(window_time()*5))}; // sprite cell and animation float scale[2] = {3, 3}, tile_w = 16 * scale[0], tile_h = 16 * scale[1]; // scaling float position[3] = {window_width() - tile_w, window_height() - tile_h, window_height() }; // position in screen-coordinates (x,y,z-index) diff --git a/demos/06-material.c b/demos/06-material.c index 62ece85..5283354 100644 --- a/demos/06-material.c +++ b/demos/06-material.c @@ -32,8 +32,8 @@ int main() { // load video, RGB texture, no audio video_t *v = video( "pexels-pachon-in-motion-17486489.mp4", VIDEO_RGB | VIDEO_NO_AUDIO | VIDEO_LOOP ); video_seek(v, 30); // load texture - texture_t t1 = texture("kgirl/g01_texture.png", TEXTURE_SRGB); - texture_t t2 = texture("matcaps/material3", TEXTURE_SRGB); + texture_t t1 = texture("kgirl/g01_texture.png", 0); + texture_t t2 = texture("matcaps/material3", 0); // load model model_t m1 = model("suzanne.obj", MODEL_NO_ANIMATIONS); model_t m2 = model("suzanne.obj", MODEL_NO_ANIMATIONS|MODEL_MATCAPS); diff --git a/demos/06-scene.c b/demos/06-scene.c index 32467f7..b024f9f 100644 --- a/demos/06-scene.c +++ b/demos/06-scene.c @@ -51,7 +51,7 @@ int main() { // manual spawn & loading model_t m1 = model("kgirl/kgirls01.fbx", 0); //MODEL_NO_ANIMS); - texture_t t1 = texture("kgirl/g01_texture.png", TEXTURE_SRGB); + texture_t t1 = texture("kgirl/g01_texture.png", 0); object_t* obj3 = scene_spawn(); object_model(obj3, m1); object_diffuse(obj3, t1); diff --git a/demos/08-video.c b/demos/08-video.c index 2b96167..65babd1 100644 --- a/demos/08-video.c +++ b/demos/08-video.c @@ -20,8 +20,8 @@ int main() { // present decoded textures as a fullscreen composed quad profile( "Video quad" ) { - if(is_rgb) fullscreen_quad_rgb( textures[0], 2.2f ); - else fullscreen_quad_ycbcr( textures, 1.3f ); + if(is_rgb) fullscreen_quad_rgb( textures[0], 1.0 ); + else fullscreen_quad_ycbcr( textures, 1.0f/2.2f ); } // input controls diff --git a/demos/99-pbr.c b/demos/99-pbr.c index 3b93577..423e010 100644 --- a/demos/99-pbr.c +++ b/demos/99-pbr.c @@ -335,7 +335,7 @@ bool SkyboxLoad( Skybox *s, const char **slots ) { // hdr,env,ibl // Reflection map if( reflectionPath ) { - if( (s->reflection = LoadTextureRGBA8( reflectionPath, TEXTURE_SRGB )) != NULL ) { + if( (s->reflection = LoadTextureRGBA8( reflectionPath, 0 )) != NULL ) { glBindTexture( GL_TEXTURE_2D, s->reflection->id ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); @@ -345,7 +345,7 @@ bool SkyboxLoad( Skybox *s, const char **slots ) { // hdr,env,ibl // Irradiance map if( envPath ) { - if( (s->env = LoadTextureRGBA8( envPath, TEXTURE_SRGB )) != NULL ) { + if( (s->env = LoadTextureRGBA8( envPath, 0 )) != NULL ) { glBindTexture( GL_TEXTURE_2D, s->env->id ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); diff --git a/demos/99-sprite.c b/demos/99-sprite.c index 87d292b..65c1acc 100644 --- a/demos/99-sprite.c +++ b/demos/99-sprite.c @@ -150,10 +150,10 @@ int main(int argc, char **argv) { if(do_cats) NUM_SPRITES/=2; // cat-sprite+cat-shadow == 2 sprites // load sprites and sheets - kids = texture( "spriteSheetExample.png", TEXTURE_LINEAR|TEXTURE_SRGB ); - catImage = texture( "cat.png", TEXTURE_LINEAR|TEXTURE_SRGB ); // - shadowImage = texture( "cat-shadow.png", TEXTURE_LINEAR|TEXTURE_SRGB ); - inputs = texture( "prompts_tilemap_34x24_16x16x1.png", TEXTURE_LINEAR|TEXTURE_SRGB ); + kids = texture( "spriteSheetExample.png", TEXTURE_LINEAR ); + catImage = texture( "cat.png", TEXTURE_LINEAR ); // + shadowImage = texture( "cat-shadow.png", TEXTURE_LINEAR ); + inputs = texture( "prompts_tilemap_34x24_16x16x1.png", TEXTURE_LINEAR ); // load all fx files, including subdirs fx_load("fx**.fs"); diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index e80dae4..5253980 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -17130,7 +17130,7 @@ enum TEXTURE_FLAGS { TEXTURE_FLIP = IMAGE_FLIP, // @fixme - TEXTURE_SRGB = 1 << 24, + TEXTURE_NO_SRGB = 1 << 24, TEXTURE_BGR = 1 << 25, TEXTURE_BGRA = TEXTURE_BGR, TEXTURE_ARRAY = 1 << 26, @@ -370743,8 +370743,8 @@ unsigned texture_update(texture_t *t, unsigned w, unsigned h, unsigned n, const if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGB ) pixel_type = GL_BGR; if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGBA ) pixel_type = GL_BGRA; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? if( flags & TEXTURE_BC1 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; if( flags & TEXTURE_BC2 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; @@ -371749,10 +371749,10 @@ skybox_t skybox_pbr(const char *sky_map, const char *refl_map, const char *env_m } } if( refl_map ) { - sky.refl = load_env_tex(refl_map, TEXTURE_SRGB); + sky.refl = load_env_tex(refl_map, 0); } if( env_map ) { - sky.env = load_env_tex(env_map, TEXTURE_SRGB); + sky.env = load_env_tex(env_map, 0); } return sky; @@ -372584,7 +372584,7 @@ static void brdf_load() { filename = "Skyboxes/brdf_lut2k_512x512_32F.ktx"; brdf = texture_compressed( filename, - TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT | TEXTURE_SRGB + TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT ); unsigned texchecker = texture_checker().id; ASSERT(brdf.id != texchecker, "!Couldn't load BRDF lookup table '%s'!", filename ); @@ -372606,7 +372606,7 @@ bool colormap( colormap_t *cm, const char *texture_name, bool load_as_srgb ) { FREE(cm->texture), cm->texture = NULL; } - int srgb = load_as_srgb ? TEXTURE_SRGB : 0; + int srgb = !load_as_srgb ? TEXTURE_NO_SRGB : 0; int hdr = strendi(texture_name, ".hdr") ? TEXTURE_FLOAT | TEXTURE_RGBA : 0; texture_t t = texture_compressed(texture_name, TEXTURE_LINEAR | TEXTURE_MIPMAPS | TEXTURE_REPEAT | hdr | srgb); @@ -373345,7 +373345,7 @@ bool model_load_textures(iqm_t *q, const struct iqmheader *hdr, model_t *model, if( reused ) continue; // decode texture+material - int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY|TEXTURE_SRGB; // LINEAR, NEAREST + int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY; // LINEAR, NEAREST if (!(_flags & MODEL_NO_FILTERING)) flags |= TEXTURE_LINEAR; int invalid = texture_checker().id; @@ -375427,7 +375427,7 @@ int scene_merge(const char *source) { //char *a = archive_read(animation_file); object_t *o = scene_spawn(); object_model(o, m); - if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), TEXTURE_SRGB|(opt_flip_uv ? IMAGE_FLIP : 0)) ); + if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), (opt_flip_uv ? IMAGE_FLIP : 0)) ); object_scale(o, scale); object_teleport(o, position); object_pivot(o, rotation); // object_rotate(o, rotation); @@ -376948,7 +376948,7 @@ atlas_t atlas_create(const char *inifile, unsigned flags) { else if( strend(k, "bitmap") ) { const char *text = v; array(char) bin = base64_decode(text, strlen(text)); - a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? TEXTURE_SRGB : 0); + a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? 0 : TEXTURE_NO_SRGB); array_free(bin); } #if 0 @@ -379068,7 +379068,7 @@ video_t* video( const char *filename, int flags ) { } else { int w16 = (w+15) & ~15; int h16 = (h+15) & ~15; - v->texture = texture_create( w16, h16, 3, NULL, TEXTURE_SRGB ); + v->texture = texture_create( w16, h16, 3, NULL, 0 ); v->surface = REALLOC( v->surface, w16 * h16 * 3 ); } diff --git a/engine/split/v4k_render.c b/engine/split/v4k_render.c index b314009..da79a17 100644 --- a/engine/split/v4k_render.c +++ b/engine/split/v4k_render.c @@ -720,8 +720,8 @@ unsigned texture_update(texture_t *t, unsigned w, unsigned h, unsigned n, const if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGB ) pixel_type = GL_BGR; if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGBA ) pixel_type = GL_BGRA; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? if( flags & TEXTURE_BC1 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; if( flags & TEXTURE_BC2 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; @@ -1726,10 +1726,10 @@ skybox_t skybox_pbr(const char *sky_map, const char *refl_map, const char *env_m } } if( refl_map ) { - sky.refl = load_env_tex(refl_map, TEXTURE_SRGB); + sky.refl = load_env_tex(refl_map, 0); } if( env_map ) { - sky.env = load_env_tex(env_map, TEXTURE_SRGB); + sky.env = load_env_tex(env_map, 0); } return sky; @@ -2561,7 +2561,7 @@ static void brdf_load() { filename = "Skyboxes/brdf_lut2k_512x512_32F.ktx"; brdf = texture_compressed( filename, - TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT | TEXTURE_SRGB + TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT ); unsigned texchecker = texture_checker().id; ASSERT(brdf.id != texchecker, "!Couldn't load BRDF lookup table '%s'!", filename ); @@ -2583,7 +2583,7 @@ bool colormap( colormap_t *cm, const char *texture_name, bool load_as_srgb ) { FREE(cm->texture), cm->texture = NULL; } - int srgb = load_as_srgb ? TEXTURE_SRGB : 0; + int srgb = !load_as_srgb ? TEXTURE_NO_SRGB : 0; int hdr = strendi(texture_name, ".hdr") ? TEXTURE_FLOAT | TEXTURE_RGBA : 0; texture_t t = texture_compressed(texture_name, TEXTURE_LINEAR | TEXTURE_MIPMAPS | TEXTURE_REPEAT | hdr | srgb); @@ -3322,7 +3322,7 @@ bool model_load_textures(iqm_t *q, const struct iqmheader *hdr, model_t *model, if( reused ) continue; // decode texture+material - int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY|TEXTURE_SRGB; // LINEAR, NEAREST + int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY; // LINEAR, NEAREST if (!(_flags & MODEL_NO_FILTERING)) flags |= TEXTURE_LINEAR; int invalid = texture_checker().id; diff --git a/engine/split/v4k_render.h b/engine/split/v4k_render.h index 269e987..61536f9 100644 --- a/engine/split/v4k_render.h +++ b/engine/split/v4k_render.h @@ -108,7 +108,7 @@ enum TEXTURE_FLAGS { TEXTURE_FLIP = IMAGE_FLIP, // @fixme - TEXTURE_SRGB = 1 << 24, + TEXTURE_NO_SRGB = 1 << 24, TEXTURE_BGR = 1 << 25, TEXTURE_BGRA = TEXTURE_BGR, TEXTURE_ARRAY = 1 << 26, diff --git a/engine/split/v4k_scene.c b/engine/split/v4k_scene.c index b44925c..a5cbb3f 100644 --- a/engine/split/v4k_scene.c +++ b/engine/split/v4k_scene.c @@ -440,7 +440,7 @@ int scene_merge(const char *source) { //char *a = archive_read(animation_file); object_t *o = scene_spawn(); object_model(o, m); - if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), TEXTURE_SRGB|(opt_flip_uv ? IMAGE_FLIP : 0)) ); + if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), (opt_flip_uv ? IMAGE_FLIP : 0)) ); object_scale(o, scale); object_teleport(o, position); object_pivot(o, rotation); // object_rotate(o, rotation); diff --git a/engine/split/v4k_sprite.c b/engine/split/v4k_sprite.c index 9fc82fd..709e89d 100644 --- a/engine/split/v4k_sprite.c +++ b/engine/split/v4k_sprite.c @@ -1363,7 +1363,7 @@ atlas_t atlas_create(const char *inifile, unsigned flags) { else if( strend(k, "bitmap") ) { const char *text = v; array(char) bin = base64_decode(text, strlen(text)); - a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? TEXTURE_SRGB : 0); + a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? 0 : TEXTURE_NO_SRGB); array_free(bin); } #if 0 diff --git a/engine/split/v4k_video.c b/engine/split/v4k_video.c index 743ea87..75c8e28 100644 --- a/engine/split/v4k_video.c +++ b/engine/split/v4k_video.c @@ -74,7 +74,7 @@ video_t* video( const char *filename, int flags ) { } else { int w16 = (w+15) & ~15; int h16 = (h+15) & ~15; - v->texture = texture_create( w16, h16, 3, NULL, TEXTURE_SRGB ); + v->texture = texture_create( w16, h16, 3, NULL, 0 ); v->surface = REALLOC( v->surface, w16 * h16 * 3 ); } diff --git a/engine/v4k.c b/engine/v4k.c index 8c29aff..3bc31a4 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -17893,8 +17893,8 @@ unsigned texture_update(texture_t *t, unsigned w, unsigned h, unsigned n, const if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGB ) pixel_type = GL_BGR; if( flags & TEXTURE_BGR ) if( pixel_type == GL_RGBA ) pixel_type = GL_BGRA; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; - if( flags & TEXTURE_SRGB ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGB ) texel_type = GL_SRGB; + if( !(flags & TEXTURE_NO_SRGB) ) if( texel_type == GL_RGBA ) texel_type = GL_SRGB_ALPHA; // GL_SRGB8_ALPHA8 ? if( flags & TEXTURE_BC1 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; if( flags & TEXTURE_BC2 ) texel_type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; @@ -18899,10 +18899,10 @@ skybox_t skybox_pbr(const char *sky_map, const char *refl_map, const char *env_m } } if( refl_map ) { - sky.refl = load_env_tex(refl_map, TEXTURE_SRGB); + sky.refl = load_env_tex(refl_map, 0); } if( env_map ) { - sky.env = load_env_tex(env_map, TEXTURE_SRGB); + sky.env = load_env_tex(env_map, 0); } return sky; @@ -19734,7 +19734,7 @@ static void brdf_load() { filename = "Skyboxes/brdf_lut2k_512x512_32F.ktx"; brdf = texture_compressed( filename, - TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT | TEXTURE_SRGB + TEXTURE_CLAMP | TEXTURE_NEAREST | TEXTURE_RG | TEXTURE_FLOAT ); unsigned texchecker = texture_checker().id; ASSERT(brdf.id != texchecker, "!Couldn't load BRDF lookup table '%s'!", filename ); @@ -19756,7 +19756,7 @@ bool colormap( colormap_t *cm, const char *texture_name, bool load_as_srgb ) { FREE(cm->texture), cm->texture = NULL; } - int srgb = load_as_srgb ? TEXTURE_SRGB : 0; + int srgb = !load_as_srgb ? TEXTURE_NO_SRGB : 0; int hdr = strendi(texture_name, ".hdr") ? TEXTURE_FLOAT | TEXTURE_RGBA : 0; texture_t t = texture_compressed(texture_name, TEXTURE_LINEAR | TEXTURE_MIPMAPS | TEXTURE_REPEAT | hdr | srgb); @@ -20495,7 +20495,7 @@ bool model_load_textures(iqm_t *q, const struct iqmheader *hdr, model_t *model, if( reused ) continue; // decode texture+material - int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY|TEXTURE_SRGB; // LINEAR, NEAREST + int flags = TEXTURE_MIPMAPS|TEXTURE_REPEAT|TEXTURE_ANISOTROPY; // LINEAR, NEAREST if (!(_flags & MODEL_NO_FILTERING)) flags |= TEXTURE_LINEAR; int invalid = texture_checker().id; @@ -22577,7 +22577,7 @@ int scene_merge(const char *source) { //char *a = archive_read(animation_file); object_t *o = scene_spawn(); object_model(o, m); - if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), TEXTURE_SRGB|(opt_flip_uv ? IMAGE_FLIP : 0)) ); + if( texture_file[0] ) object_diffuse(o, texture_from_mem(vfs_read(texture_file), vfs_size(texture_file), (opt_flip_uv ? IMAGE_FLIP : 0)) ); object_scale(o, scale); object_teleport(o, position); object_pivot(o, rotation); // object_rotate(o, rotation); @@ -24098,7 +24098,7 @@ atlas_t atlas_create(const char *inifile, unsigned flags) { else if( strend(k, "bitmap") ) { const char *text = v; array(char) bin = base64_decode(text, strlen(text)); - a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? TEXTURE_SRGB : 0); + a.tex = texture_from_mem(bin, array_count(bin), flags&ATLAS_SRGB ? 0 : TEXTURE_NO_SRGB); array_free(bin); } #if 0 @@ -26218,7 +26218,7 @@ video_t* video( const char *filename, int flags ) { } else { int w16 = (w+15) & ~15; int h16 = (h+15) & ~15; - v->texture = texture_create( w16, h16, 3, NULL, TEXTURE_SRGB ); + v->texture = texture_create( w16, h16, 3, NULL, 0 ); v->surface = REALLOC( v->surface, w16 * h16 * 3 ); } diff --git a/engine/v4k.h b/engine/v4k.h index 8da0281..7f90fb5 100644 --- a/engine/v4k.h +++ b/engine/v4k.h @@ -3197,7 +3197,7 @@ enum TEXTURE_FLAGS { TEXTURE_FLIP = IMAGE_FLIP, // @fixme - TEXTURE_SRGB = 1 << 24, + TEXTURE_NO_SRGB = 1 << 24, TEXTURE_BGR = 1 << 25, TEXTURE_BGRA = TEXTURE_BGR, TEXTURE_ARRAY = 1 << 26,