diff --git a/src/CAVE.mpsrc b/src/CAVE.mpsrc
index 4f61a7db150db7a01614a4bdc5f285d6244b66b3..0d305849e358ef1108de30fb24a68376cf90e8e9 100644 (file)
--- a/src/CAVE.mpsrc
+++ b/src/CAVE.mpsrc
drop,\r
invui,\r
vars,\r
- particles_store,\r
randoms,\r
memory,\r
worldgen,\r
\r
for ix := 0 to 15 do\r
light[ix] := no;\r
- for ix := 0 to 7 do\r
- begin\r
- pr_1[ix] := no;\r
- pr_2[ix] := no;\r
- pr_3[ix] := no;\r
- pr_4[ix] := no;\r
- pr_5[ix] := no;\r
- end;\r
-\r
- bubble := no;\r
- for ix := 0 to 15 do\r
- pr_boom[ix] := no;\r
\r
+ Particles.FreeTextures;\r
Mobs.FreeTextures;\r
\r
sky := no;\r
\r
console.exec('textures.cfg', 'AUTO');\r
\r
- player.loadSkin('char_ani.png', path);\r
+ Player.LoadSkin('char_ani.png', path);\r
Mobs.LoadTextures(path);\r
\r
im:=ld_tex('gui.png',path,'gui/');\r
for ix:=0 to 15 do light[ix]:=rotate_image_from_image(im,16*ix,0,16,16,0);\r
end;\r
\r
- if load_particles_tex then\r
- begin\r
- im:=ld_tex('particles.png',path,'terrain/');\r
- for ix:=0 to 7 do\r
- begin\r
- pr_1[ix]:=rotate_image_from_image(im,8*ix,0,8,8,0);\r
- pr_2[ix]:=rotate_image_from_image(im,8*ix,8,8,8,0);\r
- pr_3[ix]:=rotate_image_from_image(im,8*ix,16,8,8,0);\r
- pr_4[ix]:=rotate_image_from_image(im,8*ix,24,8,8,0);\r
- pr_5[ix]:=rotate_image_from_image(im,8*ix,32,8,8,0);\r
- end;\r
- bubble:=rotate_image_from_image(im,0,40,8,8,0);\r
- im:=ld_tex('explosion.png',path,'terrain/');\r
- for ix:=0 to 15 do\r
- pr_boom[ix]:=rotate_image_from_image(im,32*ix,0,32,32,0);\r
- end;\r
+ Particles.LoadTextures(path);\r
\r
im:=ld_tex('partition.png',path,'gui/');\r
gui[18]:=rotate_image_from_image(im,0,0,84,42,0);\r
\r
//anim_del2:=0;\r
\r
- inv.resetData;\r
-\r
- chest.resetData;\r
-\r
- furnace.resetData;\r
-\r
- drop.resetData;\r
-\r
+ Inv.ResetData;\r
+ Chest.ResetData;\r
+ Furnace.ResetData;\r
+ Drop.ResetData;\r
Mobs.ResetData;\r
-\r
- //gb_up_pa:=0;\r
- reset_particles(max_particles+1);\r
+ Particles.ResetData;\r
\r
for ix:=0 to 255 do\r
begin\r
write_byte(getBackMap(ix));\r
write_byte(getBiomMap(ix));\r
end;\r
- drw_load_line('Chests',55);\r
- //Chests\r
- chest.saveData;\r
- drw_load_line('Furnaces',60);\r
- //Furnaces\r
- furnace.saveData;\r
- drw_load_line('Mobs',70);\r
- //Mobs\r
+\r
+ drw_load_line('Chests', 55);\r
+ Chest.SaveData;\r
+ drw_load_line('Furnaces', 60);\r
+ Furnace.SaveData;\r
+ drw_load_line('Mobs', 70);\r
Mobs.SaveData;\r
- drw_load_line('Drop',80);\r
- //Drop\r
- drop.saveData;\r
- drw_load_line('Particles',85);\r
- //Particles\r
- writeint(max_particles);\r
- write_byte(gb_up_pa);\r
- for ix:=0 to max_particles do\r
- begin\r
- write_byte(get_particle_type(ix));\r
- write_byte(get_particle_ani(ix));\r
- writeint(get_particle_x(ix));\r
- writeint(get_particle_y(ix));\r
- end;\r
- drw_load_line('Other',90);\r
- //Other\r
+ drw_load_line('Drop', 80);\r
+ Drop.SaveData;\r
+ drw_load_line('Particles', 85);\r
+ Particles.SaveData;\r
+\r
+ drw_load_line('Other', 90);\r
write_byte(updx);\r
write_byte(updy);\r
writebool(osadki);\r
setBackMap(read_byte, ix);\r
setBiomMap(read_byte, ix);\r
end;\r
- drw_load_line('Chests',55);\r
- //Chests\r
- chest.loadData;\r
- drw_load_line('Furnaces',60);\r
- //Furnaces\r
- furnace.loadData;\r
- //Mobs\r
+ drw_load_line('Chests', 55);\r
+ Chest.LoadData;\r
+ drw_load_line('Furnaces', 60);\r
+ Furnace.LoadData;\r
Mobs.LoadData;\r
- drw_load_line('Drop',80);\r
- //Drop\r
- drop.loadData;\r
- drw_load_line('Particles',85);\r
- //Particles\r
- max_particles:=readint;\r
- reset_particles(max_particles+1);\r
- gb_up_pa:=read_byte;\r
- for ix:=0 to max_particles do\r
- begin\r
- set_particle_type(ix,read_byte);\r
- set_particle_ani(ix,read_byte);\r
- set_particle_x(ix,readint);\r
- set_particle_y(ix,readint);\r
- end;\r
- drw_load_line('Other',90);\r
- //Other\r
+ drw_load_line('Drop', 80);\r
+ Drop.LoadData;\r
+ drw_load_line('Particles', 85);\r
+ Particles.LoadData;\r
+\r
+ drw_load_line('Other',90);\r
updx:=read_byte;\r
updy:=read_byte;\r
osadki:=readbool;\r
end; else\r
if m_cur=-1 then\r
begin\r
- s_particles:=not s_particles;\r
+ Particles.enabled := not Particles.enabled;\r
end; else\r
if m_cur=0 then\r
begin\r
\r
drw_btn('Light:'+light_type,-3,m_cur,0,1);\r
drw_btn('Weather:'+ifosad,-2,m_cur,0,1);\r
- drw_btn('Particles:'+s_particles,-1,m_cur,0,1);\r
+ drw_btn('Particles:' + Particles.enabled, -1, m_cur, 0, 1);\r
drw_btn('Hide GUI:'+not drawgui,0,m_cur,0,1);\r
drw_btn('Touch:'+(load_key_tex>0),1,m_cur,0,1);\r
drw_btn('JPEG:'+s_jpeg_quality,2,m_cur,0,1);\r
draw_block(ix,iy);\r
end;\r
{===================[drop]===================}\r
- drop.draw(camx, camy);\r
+ Drop.Draw(camx, camy);\r
{===================[particles]===================}\r
- if s_particles then draw_particle;\r
+ Particles.Draw(camx, camy);\r
{===================[player]===================}\r
- if hp>0 then\r
- begin\r
- player.draw(camx, camy);\r
- end;\r
-\r
+ Player.Draw(camx, camy);\r
{===================[mobs]===================}\r
Mobs.Draw(camx, camy);\r
{===================[draw_blocks]===================}\r
osadki_ani:=osadki_ani+1;\r
if osadki_ani>7 then osadki_ani:=0;\r
\r
- if random(20)=random(20) then create_particle(6,x,y);\r
+ if Random(20) = Random(20) then Particles.Create(Particles.bubble, x, y);\r
\r
if gamemode=1 then begin hp:=666; hunger:=666; end;\r
\r
//if s_spawn_mob then if random(4096)=1547 then megaspawn;\r
\r
Mobs.Update;\r
-\r
- if particle_upd then update_particle;\r
+ Particles.Update;\r
\r
if light_type>0 then\r
begin\r