return 0;
}
- fprintf( fp, "static enum %s_index\n{\n", argv[3] );
+ fprintf( fp, "enum %s_index\n{\n", argv[3] );
// Load images
// -----------
u8 *dest = (u8 *)malloc( 1024*1024*4 );
- // Clear (temp)
for( int i = 0; i < 1024*1024; i ++ )
{
dest[ i*4 + 0 ] = 0;
dest[ i*4 + 1 ] = 0;
- dest[ i*4 + 2 ] = 128;
- dest[ i*4 + 3 ] = 255;
+ dest[ i*4 + 2 ] = 0;
+ dest[ i*4 + 3 ] = 0;
}
struct region
};
int stack_h = 0;
- int sf = 64;
-
for( int i = 0; i < num_images; i ++ )
{
struct image_src *psrc = &source_images[ i ];
if( (pregion->p0[ 0 ] + psrc->x <= pregion->p1[0]) && (pregion->p0[ 1 ] + psrc->y <= pregion->p1[1]) )
{
// Passed, add image and create subdivisions
- fprintf( fp, "\t{ %hu, %hu, %hu, %hu },\n",
- (u16)(sf * pregion->p0[0]),
- (u16)(sf * pregion->p0[1]),
- (u16)(sf * psrc->x),
- (u16)(sf * psrc->y)
+ fprintf( fp, "\t{{ %f, %f, %f, %f }}",
+ (float)pregion->p0[0] / 1024.0f,
+ (float)pregion->p0[1] / 1024.0f,
+ (float)psrc->x / 1024.0f,
+ (float)psrc->y / 1024.0f
);
+ if( i != num_images-1 )
+ fputs( ",\n", fp );
+ else
+ fputc( '\n', fp );
+
// Write image
for( int y = 0; y < psrc->y; y ++ )
{