Quote:

You can make Gamestudio write BMP images.




This proves my claim (fully tested too using pure C-script - it makes a palette much like a 16-bit palette, complete with details):

Code:

var temp_handle;

function write_bmp()
{
// max_loops = 100000;
var red_color = 0;
var green_color = 255;
var blue_color = 0;
var bit_depth;
var current_data_chunk = 0;
// var total_data_chunks;

temp_handle = file_open_write("16bitpalette.bmp");
// start file header data
file_str_write(temp_handle, "BM");
file_asc_write(temp_handle, 54); // *1 // file size (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 3); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 0); // *1 // reserved (2 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *1 // reserved (2 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 54); // *1 // offset to main bitmap data (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 40); // *1 // size of the information sector (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 0); // *1 // image width (4 bytes)
file_asc_write(temp_handle, 4); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 64); // *1 // image height (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 1); // *1 // number of planes (2 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 24); // *1 // number of bits per pixel (2 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *1 // type of compression - 0 if uncompressed (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 0); // *1 // size of image data (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 3); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 19); // *1 // X resolution - pixels per meter (4 bytes)
file_asc_write(temp_handle, 11); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 19); // *1 // Y resolution - pixels per meter (4 bytes)
file_asc_write(temp_handle, 11); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 0); // *1 // colors used - 0 if no pallete (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
file_asc_write(temp_handle, 0); // *1 // number of important colors - 0 if all are important (4 bytes)
file_asc_write(temp_handle, 0); // *256
file_asc_write(temp_handle, 0); // *65536
file_asc_write(temp_handle, 0); // *16777216
// end file header data

while(current_data_chunk < 65536) // all this creates a palette of 65,536 colors
{
current_data_chunk += 1;
file_asc_write(temp_handle, int(blue_color+0.5)); // BMP uses the BGR format
file_asc_write(temp_handle, int(green_color+0.5));
file_asc_write(temp_handle, int(red_color+0.5));

red_color += 8.226;

if (red_color >= 256)
{
red_color = 0;
blue_color += 8.226;

if (blue_color >= 256)
{
blue_color = 0;
green_color -= 4.048;
}
}
}

file_close(temp_handle);
}

on_v = write_bmp();



Given that it can write BMP files, I'm pretty sure it can write any type of file as well, openable in external programs (such as creating a pure sine WAV file or duplicating an MP3). This would be a decent enhancement for my benchmark tester - create BMP images instead of just numbers in a text file.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials