the asumptions were of course, incorrect
[convexer.git] / nbvtf / dds_cmd.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <stdint.h>
4 #include <math.h>
5
6 #define STB_IMAGE_IMPLEMENTATION
7 #define NBVTF_SHOW_STDERR
8 #include "nbvtf.h"
9
10 int main( int argc, char *argv[] )
11 {
12 if( argc < 3 )
13 {
14 printf( "Usage: todds input_file.png output.dds\n" );
15 return 0;
16 }
17
18 printf( "todds: converting to dds... " );
19
20 int x,y,n;
21 uint8_t *data = stbi_load( argv[1], &x, &y, &n, 4 );
22
23 if( data )
24 {
25 nbvtf_init();
26 nbvtf_write_dds_dxt1( data, x, y, 16, argv[2] );
27 free( data );
28
29 printf( "Success\n" );
30 }
31 else
32 printf( "Failed\n" );
33
34 return 0;
35 }