#include <acknex.h>
#include <strio.c>
var skinnum = 0;
PANEL * show_pan =
{
flags = SHOW | FILTER;
}
PANEL * text_pan =
{
digits(10, 722, "skin #%.0f
key up / down: change skin
enter: save skin
esc: exit", "Calibri#14", 1, skinnum);
layer = 2;
flags = SHOW | OUTLINE;
}
void main()
{
STRING * temp_str = str_create(" ");
video_set(800, 800, 0, 2);
vec_fill(sky_color, 1);
level_load(NULL);
wait(1);
temp_str = file_dialog("open file", "*.mdl");
if(!temp_str) sys_exit(NULL);
you = ent_create(temp_str, nullvector, NULL);
int i_max;
i_max = ent_status(you, 8);
if(!i_max) sys_exit(NULL);
BMAP ** save_bmap = sys_malloc(sizeof(BMAP*) * i_max);
for(skinnum = 1; skinnum <= i_max; skinnum++)
save_bmap[skinnum - 1] = ent_getskin(you, skinnum);
skinnum = 1;
while(!key_esc)
{
skinnum = clamp(skinnum + key_cud - key_cuu, 1, i_max);
show_pan.bmap = save_bmap[skinnum - 1];
while(key_cuu || key_cud) wait(1);
show_pan.scale_x = 800 / bmap_width(save_bmap[skinnum - 1]);
show_pan.scale_y = 800 / bmap_height(save_bmap[skinnum - 1]);
if(bmap_width(save_bmap[skinnum - 1]) < bmap_height(save_bmap[skinnum - 1]))
show_pan.scale_x = show_pan.scale_y;
else
show_pan.scale_y = show_pan.scale_x;
if(key_enter)
{
while(key_enter) wait(1);
temp_str = file_dialog_save("save file", "*.dds;*.png;*.bmp;*.jpg");
if(temp_str)
bmap_save(save_bmap[skinnum - 1], temp_str);
}
wait(1);
}
wait(1);
sys_exit(NULL);
}