Wrong uncompressed formats... oops
authorhgn <hgodden00@gmail.com>
Fri, 15 Apr 2022 01:31:23 +0000 (02:31 +0100)
committerhgn <hgodden00@gmail.com>
Fri, 15 Apr 2022 01:31:23 +0000 (02:31 +0100)
Makefile
__init__.py
nbvtf/vtf_cmd.c

index 8d62488fb15ae79798180dfaee2b5f1a863fdee3..dea01c8a1a88b923507133d354420f0fdf782166 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,10 @@ libcxr.so: cxr/cxr.h cxr/cxr_math.h cxr/cxr_mem.h
                -lm 
 
 tovtf: nbvtf/obj/librgbcx.o nbvtf/obj/tovtf.o
                -lm 
 
 tovtf: nbvtf/obj/librgbcx.o nbvtf/obj/tovtf.o
-       g++ -O3 nbvtf/obj/tovtf.o nbvtf/obj/librgbcx.o -o tovtf
+       g++ -O3 \
+               -Wno-unused-variable -Wno-unused-function -fsanitize=address -Werror=vla \
+               nbvtf/obj/tovtf.o nbvtf/obj/librgbcx.o \
+               -o tovtf
 
 nbvtf/obj/librgbcx.o: nbvtf/librgbcx.cc nbvtf/rgbcx.h
        g++ -O3 -c \
 
 nbvtf/obj/librgbcx.o: nbvtf/librgbcx.cc nbvtf/rgbcx.h
        g++ -O3 -c \
index b926763e356bd89ccd114311f854a9ecad3791ae..4fc3eed6250ca5afcc3c616a86d83ed40d42ff64 100644 (file)
@@ -470,8 +470,8 @@ def libcxr_line_callback( p0,p1,colour ):
 libnbvtf = None
 
 # Constants
 libnbvtf = None
 
 # Constants
-NBVTF_IMAGE_FORMAT_RGBA8888 = 0
-NBVTF_IMAGE_FORMAT_RGB888 = 2
+NBVTF_IMAGE_FORMAT_ABGR8888 = 1
+NBVTF_IMAGE_FORMAT_BGR888 = 3
 NBVTF_IMAGE_FORMAT_DXT1 = 13
 NBVTF_IMAGE_FORMAT_DXT5 = 15
 NBVTF_TEXTUREFLAGS_CLAMPS = 0x00000004
 NBVTF_IMAGE_FORMAT_DXT1 = 13
 NBVTF_IMAGE_FORMAT_DXT5 = 15
 NBVTF_TEXTUREFLAGS_CLAMPS = 0x00000004
@@ -1048,10 +1048,10 @@ def compile_image(img):
 
    dims = img.cxr_data.export_res
    fmt = { 
 
    dims = img.cxr_data.export_res
    fmt = { 
-      'RGBA': NBVTF_IMAGE_FORMAT_RGBA8888,
+      'RGBA': NBVTF_IMAGE_FORMAT_ABGR8888,
       'DXT1': NBVTF_IMAGE_FORMAT_DXT1,
       'DXT5': NBVTF_IMAGE_FORMAT_DXT5,
       'DXT1': NBVTF_IMAGE_FORMAT_DXT1,
       'DXT5': NBVTF_IMAGE_FORMAT_DXT5,
-      'RGB': NBVTF_IMAGE_FORMAT_RGB888
+      'RGB': NBVTF_IMAGE_FORMAT_BGR888
    }[ img.cxr_data.fmt ]
 
    mipmap = img.cxr_data.mipmap
    }[ img.cxr_data.fmt ]
 
    mipmap = img.cxr_data.mipmap
index 1fc553616ae34ed1d99dbca681b405544881b3c0..d5012791fea0192b11988ece056d3614a3328ca6 100644 (file)
@@ -126,7 +126,8 @@ int main( int argc, char *argv[] )
        printf( "tovtf: Creating vtf with format '%s'\n", vtf_format_strings[ format ] );
        
        auto_output( path_source, dest );
        printf( "tovtf: Creating vtf with format '%s'\n", vtf_format_strings[ format ] );
        
        auto_output( path_source, dest );
-       nbvtf_convert( path_source, 0, 0, 1, format, 0x00, dest );
+   nbvtf_init();
+       nbvtf_convert( path_source, 0, 0, 1, format, 16, 0x00, dest );
 
        return 0;
 }
 
        return 0;
 }