- Fixed Translucent tables in 8 bits
- Fixed blend operations in 8 bits
- Fixed Translucent+Blend in 8 bits
sample
Program Pruebas;
#ifdef __VERSION__
import "mod_screen";
import "mod_video";
import "mod_map";
import "mod_say";
import "mod_text";
import "mod_rand";
import "mod_mouse";
#endif
import "mod_file";
import "mod_key";
import "mod_draw";
import "mod_proc";
import "mod_math";
#define GR_DEPTH depth
//#define GR_DEPTH 16
global
int recta;
int cubo;
int fondo;
int depth = 32;
int gflags = 0;
int gangle = 0;
int gsize = 100;
int galpha = 255;
int sw = 0;
begin
set_fps(0,0);
action();
While (NOT key(_esc))
if (key(_TAB))
let_me_alone();
depth /= 2;
if (depth<8) depth = 32; end
delete_text(all_text);
unload_map(0,fondo);
unload_map(0,cubo);
unload_map(0,recta);
unload_map(0,mouse.graph);
action();
while (key(_TAB)) frame; end;
end
frame;
end
end
process action()
private
map;
count ;
Begin
// scale_mode = scale_normal2x;
/*
dump_type=1;
restore_type=1;
*/
set_mode(640,480,GR_DEPTH|WAITVSYNC); // For rgb for graphs
cubo=new_map(100,100,GR_DEPTH);
drawing_map(0,cubo);
drawing_color(rgb(0,0,200));
draw_box(50,0,100,100);
drawing_color(rgb(0,100,200));
draw_box(0,0,50,100);
drawing_color(rgba(100,0,200,50));
draw_box(25,0,75,25);
/* Hole */
drawing_color(rgba(255,255,0,200));
draw_box(35,35,65,65);
drawing_color(rgba(255,0,255,64));
draw_box(45,45,55,55);
/*
cubo=new_map(100,100,GR_DEPTH);
drawing_map(0,cubo);
drawing_color(rgb(0,0,200));
draw_fcircle(50,50,50);
drawing_color(rgb(0,100,200));
draw_fcircle(50,25,20);
*/
recta=new_map(5,100,GR_DEPTH);
drawing_map(0,recta);
drawing_color(rgb(200,0,0));
draw_box(0,0,5,100);
drawing_color(rgb(0,200,0));
draw_box(0,0,5,5);
drawing_color(rgb(0,0,200));
draw_box(5,0,5,100);
set_mode(640,480,depth);
mouse.graph=png_load("pngtest.png");
fondo=new_map(640,480,depth);
for (y=0;y<480;y++)
for (x=0;x<640;x++)
//((y*100/256)<<(((y>>2)%3)<<3))
// map_put_pixel(0,fondo,x,y,rgb(y*256/480,y*256/480,y*256/480));
map_put_pixel(0,fondo,x,y,rgb((y&1)?x*256/640:0,(x&1)?x*256/640:0,(y&1)?y*256/480:0));
end
end
put_screen(0,fondo);
write_int (0,100,10,1,&fps);
write_int (0,200,10,1,&depth);
write_int (0,300,10,1,&gangle);
write_int (0,400,10,1,&gsize);
write_int (0,500,10,1,&galpha);
jugador(120,180,cubo,-180000,0);
jugador(240,180,cubo,-180000,B_HMIRROR);
jugador(120,300,cubo,-180000,B_VMIRROR);
jugador(240,300,cubo,-180000,B_HMIRROR|B_VMIRROR);
jugador(440,180,recta,-180000,0);
jugador(560,180,recta,-180000,B_HMIRROR);
jugador(440,300,recta,-180000,B_VMIRROR);
jugador(560,300,recta,-180000,B_HMIRROR|B_VMIRROR);
While (NOT key(_esc))
gangle+=100;
If (key(_F1)) gflags |= B_TRANSLUCENT; end
If (key(_F2)) gflags = gflags & ~B_TRANSLUCENT; end
If (key(_F3)) gflags |= B_ABLEND; end
If (key(_F4)) gflags = gflags & ~B_ABLEND; end
If (key(_F5)) gflags |= B_SBLEND; end
If (key(_F6)) gflags = gflags & ~B_SBLEND; end
If (key(_minus)) gsize-=10; if (shift_status) while(key(_minus)) frame; end ;end; end
If (key(_plus)) gsize+=10; if (shift_status) while(key(_plus)) frame; end ;end; end
If (key(_1) && galpha > 0) galpha--; if (shift_status) while(key(_1)) frame; end ;end; end
If (key(_2) && galpha < 255) galpha++; if (shift_status) while(key(_2)) frame; end ;end; end
If (key(_q)) gangle-=1000; if (shift_status) while(key(_q)) frame; end ;end; end
If (key(_w)) gangle+=1000; if (shift_status) while(key(_w)) frame; end ;end; end
If (key(_a)) gangle-=100; if (shift_status) while(key(_a)) frame; end ;end; end
If (key(_s)) gangle+=100; if (shift_status) while(key(_s)) frame; end ;end; end
If (key(_z)) gangle-=10; if (shift_status) while(key(_z)) frame; end ;end; end
If (key(_x)) gangle+=10; if (shift_status) while(key(_x)) frame; end ;end; end
If (key(_9) && !fading) fade_off(); while(key(_9)) frame; end; end
If (key(_0) && !fading) fade_on() ; while(key(_0)) frame; end; end
if ( key( _H ) ) gflags ^= B_HMIRROR; while ( key( _H ) ) frame; end; end
if ( key( _V ) ) gflags ^= B_VMIRROR; while ( key( _V ) ) frame; end; end
if ( key(_F10)) map = get_screen(); while(file_exists("capture"+count+".png"));count++;end;save_png(0,map,"capture"+count+".png"); unload_map(0,map);while ( key(_F10)) frame; end; end
if ( key( _SPACE ) ) gangle = 0; end
Frame;
End
let_me_alone();
End
Process jugador(x,y,graph,angle,iflags)
Private
int mapa;
Begin
While (NOT key(_esc))
alpha = galpha;
size = gsize;
angle = gangle;
flags = gflags ^ iflags;
Frame;
End
End