-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 \
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
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,
- 'RGB': NBVTF_IMAGE_FORMAT_RGB888
+ 'RGB': NBVTF_IMAGE_FORMAT_BGR888
}[ img.cxr_data.fmt ]
mipmap = img.cxr_data.mipmap
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;
}