X-Git-Url: https://deadsoftware.ru/gitweb?p=cavecraft.git;a=blobdiff_plain;f=src%2Fconsole.pas;h=99c78d037d2ec3a05c2889f7469befe5d4d439f2;hp=d239081938d95dfe1b38c054877edd2d8ca483f9;hb=4983aa70fea163453968255c36b0689cfb412463;hpb=e1395893ec7223a8a86c66cdc49e4a9fb48b15c2 diff --git a/src/console.pas b/src/console.pas index d239081..99c78d0 100644 --- a/src/console.pas +++ b/src/console.pas @@ -8,7 +8,6 @@ interface osadki:boolean; bl_upd:integer; s_get_drp:boolean; - particle_upd:boolean; drw_back:boolean; drw_sm:boolean; s_max_fps:integer; @@ -17,13 +16,11 @@ interface light_type:integer; ifosad:boolean; - //s_particles:boolean; - module load_sm:integer; load_sky_siz:integer; load_back_tex:boolean; load_weather_tex:boolean; - load_particles_tex:boolean; load_light_tex:boolean; load_gui_tex:boolean; @@ -40,7 +37,6 @@ interface sd:string; EOFstr, ENDstr:boolean; - //max_particles:integer; - module procedure save_settings; procedure load_settings; @@ -49,11 +45,30 @@ interface procedure addToLog(str:string); implementation -uses keyboard,particles_store,vars,maps,items,canvas,mob,worldgen,jsr75i,particles,func, player,sensor, drop, inv, furnace, items_store, video; + + uses + keyboard, + vars, + maps, + canvas, + mobs, + worldgen, + jsr75i, + particles, + func, + player, + sensor, + drop, + inv, + furnace, + items_store, + video; + const CON_LOG_SIZE=9; PARSER_MAX_STR=15; MAX_IMGREG=2; + var logSTR: array [0..CON_LOG_SIZE] of string; lastCommand:string; @@ -151,7 +166,7 @@ procedure save_settings; t:=addRecordStoreEntry(rs,version); t:=addRecordStoreEntry(rs,''+light_type); t:=addRecordStoreEntry(rs,''+ifosad); - t:=addRecordStoreEntry(rs,''+s_particles); + t:=addRecordStoreEntry(rs, '' + Particles.enabled); t:=addRecordStoreEntry(rs,''+drawgui); t:=addRecordStoreEntry(rs,''+s_jpeg_quality); t:=addRecordStoreEntry(rs,''+load_key_tex); @@ -176,7 +191,7 @@ procedure load_settings; end; light_type:=stringtointeger(readRecordStoreEntry(rs,2)); ifosad:=sett_ld_bool(readRecordStoreEntry(rs,3)); - s_particles:=sett_ld_bool(readRecordStoreEntry(rs,4)); + Particles.enabled := sett_ld_bool(readRecordStoreEntry(rs, 4)); drawgui:=sett_ld_bool(readRecordStoreEntry(rs,5)); s_jpeg_quality:=stringtointeger(readRecordStoreEntry(rs,6)); load_key_tex:=stringtointeger(readRecordStoreEntry(rs,7)); @@ -473,13 +488,6 @@ procedure exeCommand(str:string); fly:=false; end; else - {if com='KILL_MOBS' then - for i:=0 to 31 do - begin - mob[i].m_type:=0; - mob[i].m_hp:=0; - end; - else} if com='SPAWN' then begin player.setX(get_spawn_x*16+4); @@ -536,12 +544,6 @@ procedure exeCommand(str:string); if com='GET_DRP' then s_get_drp:=strToBool(nextWord); else - {if com='AI_UPD' then - ai_upd:=strToBool(nextWord); - else} - if com='PRT_UPD' then - particle_upd:=strToBool(nextWord); - else if com='MAX_FPS' then s_max_fps:=decodeInt(nextWord); else if com='DRW_BACK' then @@ -578,7 +580,7 @@ procedure exeCommand(str:string); light_type:=decodeInt(nextWord); else if com='S_PARTICLES' then - s_particles:=strToBool(nextWord); + Particles.enabled := strToBool(nextWord); else if com='LOAD_SKY' then load_sky_siz:=decodeInt(nextWord); @@ -592,9 +594,6 @@ procedure exeCommand(str:string); if com='LOAD_WEATHER_TEX' then load_weather_tex:=strToBool(nextWord); else - if com='LOAD_PARTICLES_TEX' then - load_particles_tex:=strToBool(nextWord); - else if com='LOAD_LIGHT_TEX' then load_light_tex:=strToBool(nextWord); else @@ -619,68 +618,12 @@ procedure exeCommand(str:string); if com='LOAD_MINIMAP_TEX' then load_minimap_tex:=strToBool(nextWord); else - if com='MAX_PARTICLES' then - begin - max_particles:=decodeInt(nextWord); - reset_particles(max_particles+1); - end; - else if com='EXEC' then begin tmp:=nextWord; exec(nextWord, tmp); end; else - if com='RESET_ITEMS' then - begin - resetItems(decodeInt(nextWord)+1); - //addToLog('Max items: '+decodeInt(parsed_str[1])); - end; - else - if com='SET_ITEM' then - begin - setItemData(decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord)); - end; - else - if com='RESET_BLOCKS' then - begin - resetBlocks(decodeInt(nextWord)+1); - //addToLog('Max blocks: '+decodeInt(parsed_str[1])); - end; - else - if com='SET_BLOCK' then - begin - setBlockData(decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord)); - end; - else - if com='RESET_TOOLS' then - begin - resetTools(decodeInt(nextWord)+1); - //addToLog('Max tools: '+decodeInt(parsed_str[1])); - end; - else - if com='SET_TOOL' then - begin - setToolData(decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord), - decodeInt(nextWord)); - end; - else if com='RESET_FUELS' then begin furnace.setMaxFuel(decodeInt(nextWord)); @@ -765,13 +708,6 @@ procedure exeCommand(str:string); decodeInt(tmp2)); end; else - if com='SET_MAX_ITEM_LIST' then - setMaxItemList(decodeInt(nextWord)); - else - if com='SET_ITEM_LIST' then - setItemList(decodeInt(nextWord), - decodeInt(nextWord)); - else if com='BIND_KEY' then begin tmp:=nextWord;