diff --git a/AdvMan/StdAfx.h b/AdvMan/StdAfx.h index c87af4f..3541103 100644 --- a/AdvMan/StdAfx.h +++ b/AdvMan/StdAfx.h @@ -21,8 +21,8 @@ extern "C" { -#include -#include +#include +#include } #include "Pathname.h" #include diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ff1b64..add59de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ else() set(STANDARD_LIBRARIES "pthread") endif() -include_directories(platform libs) +include_directories(.) include_directories( ${SDL2_INCLUDE_DIRS}) diff --git a/INST/SETUP.C b/INST/SETUP.C index 35738b1..a3fb442 100644 --- a/INST/SETUP.C +++ b/INST/SETUP.C @@ -1,29 +1,29 @@ #include -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include "setup.h" #include "setvideo.h" #include "setuplib.h" diff --git a/INST/SETUPCPY.C b/INST/SETUPCPY.C index eebedaf..993be65 100644 --- a/INST/SETUPCPY.C +++ b/INST/SETUPCPY.C @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "setupcpy.h" diff --git a/INST/SETUPLIB.C b/INST/SETUPLIB.C index f91ad07..334acaa 100644 --- a/INST/SETUPLIB.C +++ b/INST/SETUPLIB.C @@ -1,20 +1,20 @@ -#include +#include #include #include #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include "setuplib.h" #include "setupcpy.h" #include "setup.h" diff --git a/INST/SETVIDEO.C b/INST/SETVIDEO.C index 838638a..3898652 100644 --- a/INST/SETVIDEO.C +++ b/INST/SETVIDEO.C @@ -1,13 +1,13 @@ -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "setup.h" diff --git a/MAPS/DLGPRINT.C b/MAPS/DLGPRINT.C index eba8230..6519372 100644 --- a/MAPS/DLGPRINT.C +++ b/MAPS/DLGPRINT.C @@ -1,5 +1,5 @@ #include -#include + #include #include #include @@ -100,7 +100,7 @@ static char *transfer_text(char *source,char *target) if (source==NULL) { puts(orgn); - error("Chybn˜ rod nebo mal˜ po‡et tvar– od jednoho slova"); + error("Chybn� rod nebo mal� po�et tvar� od jednoho slova"); } source++; } @@ -111,7 +111,7 @@ static char *transfer_text(char *source,char *target) if (source==NULL) { puts(orgn); - error("O‡ek v  se ']'"); + error("O�ek�v� se ']'"); } } source++; @@ -151,22 +151,22 @@ void read_names() do { - fprintf(stderr,"Budes zad vat mu‘sk  jm‚na, nebo ‘ensk : (M/Z)");gets(buff); + fprintf(stderr,"Budes zad�vat mu�sk� jm�na, nebo �ensk�: (M/Z)");gets(buff); fm=toupper(buff[0]); } while (fm!='M'&& fm!='Z') ; - fprintf(stderr,"Nyn¡ je t©eba zadat nˆkolik jmen, posledn¡ odklepni ENTREM\n"); + fprintf(stderr,"Nyn� je t�eba zadat n�kolik jmen, posledn� odklepni ENTREM\n"); i=0; do { - fprintf(stderr,"%d.jm‚no:",i+1);gets(buff); + fprintf(stderr,"%d.jm�no:",i+1);gets(buff); if (buff[0]) strncpy(sn_nams[i],buff,31); i++; } while(i #include -#include +#include #include -#include +#include static int latest_version(char *wild,int numpos) { diff --git a/MAPS/EDIT_MAP.C b/MAPS/EDIT_MAP.C index 0277625..83ad37e 100644 --- a/MAPS/EDIT_MAP.C +++ b/MAPS/EDIT_MAP.C @@ -1,20 +1,20 @@ #include -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include #include #include "mapy.h" -#include -#include +#include +#include #include "globals.h" #include "edit_map.h" #include "steny.h" diff --git a/MAPS/ITEMS.C b/MAPS/ITEMS.C index 7abc56e..d80a771 100644 --- a/MAPS/ITEMS.C +++ b/MAPS/ITEMS.C @@ -1,16 +1,16 @@ -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include "mapy.h" #include "globals.h" #include "edit_map.h" diff --git a/MAPS/ITEMS2.C b/MAPS/ITEMS2.C index d40b841..890730f 100644 --- a/MAPS/ITEMS2.C +++ b/MAPS/ITEMS2.C @@ -1,21 +1,21 @@ #include -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include "mapy.h" #include "globals.h" #include "edit_map.h" diff --git a/MAPS/MAPEDIT.C b/MAPS/MAPEDIT.C index 5e04fea..64b3741 100644 --- a/MAPS/MAPEDIT.C +++ b/MAPS/MAPEDIT.C @@ -3,19 +3,19 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include -#include +#include #include "dump.h" #include "mapy.h" #include "edit_map.h" diff --git a/MAPS/MAPY.C b/MAPS/MAPY.C index 42c18f3..5724500 100644 --- a/MAPS/MAPY.C +++ b/MAPS/MAPY.C @@ -1,17 +1,17 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "mapy.h" -#include +#include #include "steny.h" #include "globals.h" #include "edit_map.h" diff --git a/MAPS/MOB_EDIT.C b/MAPS/MOB_EDIT.C index 2d4617e..26285cd 100644 --- a/MAPS/MOB_EDIT.C +++ b/MAPS/MOB_EDIT.C @@ -1,27 +1,27 @@ #include #include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include "mapy.h" -#include +#include #include "globals.h" #include "edit_map.h" #include "save_map.h" #include "steny.h" #include "mob_edit.h" -#include +#include diff --git a/MAPS/PCXVIEW.C b/MAPS/PCXVIEW.C index e3905fc..c861077 100644 --- a/MAPS/PCXVIEW.C +++ b/MAPS/PCXVIEW.C @@ -1,20 +1,20 @@ #include -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "mapy.h" #include "globals.h" diff --git a/MAPS/SAVE_MAP.C b/MAPS/SAVE_MAP.C index f3c0f91..da54ee3 100644 --- a/MAPS/SAVE_MAP.C +++ b/MAPS/SAVE_MAP.C @@ -4,15 +4,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -39,7 +39,7 @@ #define A_MAPITEM 0x800C //itemy #define A_MAPMACR 0x800D //Makra multiakce #define A_MAPFLY 0x800E //Letajici predmety -#define A_MAPMOBS 0x800F //Potvory v bludi¨ti +#define A_MAPMOBS 0x800F //Potvory v bludi�ti #define A_MAPVYK 0x8010 //Vyklenky #define A_MOBS 0x8011 //Potvory definice #define A_MOBSND 0x8012 //Potvory zvuky @@ -179,7 +179,7 @@ int load_map(char *filename) if (las) { if (check_sound_map()) - msg_box("Upozornˆn¡!",'\x1',"Verze souboru SOUND.DAT neodpovid  verz¡m ostatn¡ch soubor–. To m–‘e zp–sobit poru¨en¡ integrity ukazatel– na zvukov‚ soubory!","Pokra‡ovat",NULL); + msg_box("Upozorn�n�!",'\x1',"Verze souboru SOUND.DAT neodpovid� verz�m ostatn�ch soubor�. To m��e zp�sobit poru�en� integrity ukazatel� na zvukov� soubory!","Pokra�ovat",NULL); load_all_shops(); las=0; } @@ -332,7 +332,7 @@ void backup_info(EVENT_MSG *msg) return; } c=(char *)msg->data; - strcpy(c,"Star˜ soubor byl ulo‘en v adres ©i backup\\..."); + strcpy(c,"Star� soubor byl ulo�en v adres��i backup\\..."); c=strchr(c,'\0'); msg->data=(void *)c; msg->msg=-1; @@ -633,10 +633,10 @@ int save_all_map(void) sprintf(info,"Chyba %02d na pozici %d:%d",-z,x,y); switch (z) { - case -1:msg_box(info,'\01',"Chyb¡ definice stˆny!","OK",NULL);break; - case -2:msg_box(info,'\01',"Chodba vede do neexistuj¡c¡ho sektoru!","OK",NULL);break; - case -3:msg_box(info,'\01',"Schody jsou ¨patnˆ spojen‚ se sousedn¡m¡ sektory!","OK",NULL);break; - case -4:msg_box(info,'\01',"Ud lost v neexistuj¡c¡m sektoru!","OK",NULL);break; + case -1:msg_box(info,'\01',"Chyb� definice st�ny!","OK",NULL);break; + case -2:msg_box(info,'\01',"Chodba vede do neexistuj�c�ho sektoru!","OK",NULL);break; + case -3:msg_box(info,'\01',"Schody jsou �patn� spojen� se sousedn�m� sektory!","OK",NULL);break; + case -4:msg_box(info,'\01',"Ud�lost v neexistuj�c�m sektoru!","OK",NULL);break; } if (!backup) { @@ -649,7 +649,7 @@ int save_all_map(void) } if (save_map(filename)) { - sprintf(info,"Nedok ‘u ulo‘it soubor %s.",filename); + sprintf(info,"Nedok��u ulo�it soubor %s.",filename); msg_box("Chyba I/O",'\01',info,"!Panika!",NULL); } else txt=pripona(filename,TXT); diff --git a/MAPS/STENY.C b/MAPS/STENY.C index 46739a0..429cefe 100644 --- a/MAPS/STENY.C +++ b/MAPS/STENY.C @@ -3,17 +3,17 @@ #include #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include "steny.h" #include "globals.h" diff --git a/MAPS/WIZ_TOOL.C b/MAPS/WIZ_TOOL.C index 296e4de..4d37609 100644 --- a/MAPS/WIZ_TOOL.C +++ b/MAPS/WIZ_TOOL.C @@ -1,23 +1,23 @@ #include #include -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include "mapy.h" -#include +#include #include #include "globals.h" #include "edit_map.h" diff --git a/PCX/PCX.C b/PCX/PCX.C index 0675890..13c38b0 100644 --- a/PCX/PCX.C +++ b/PCX/PCX.C @@ -4,7 +4,7 @@ #include /*#include "..\types.h"*/ #include "pcx.h" -#include +#include /*#include "..\bgraph.h"*/ diff --git a/PCX/PODLAHY.C b/PCX/PODLAHY.C index 84c1672..98e9e9e 100644 --- a/PCX/PODLAHY.C +++ b/PCX/PODLAHY.C @@ -3,9 +3,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "..\game\engine1.h" #include "pcx.h" @@ -254,7 +254,7 @@ void help() { printf("ONS Podlahar (C)1997 \n" "\n" - "Pou‘it¡: PODLAHY \n" + "Pou�it�: PODLAHY \n" "\n" " \n" " soubory s texturami ve formatu pcx. Textura musi mit velikost 500x320\n\n" diff --git a/UTILS/ITEMLIST.C b/UTILS/ITEMLIST.C index 4145839..c06e6b0 100644 --- a/UTILS/ITEMLIST.C +++ b/UTILS/ITEMLIST.C @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -47,44 +47,44 @@ char pr_name=0,pr_type=0,pr_sound=0,pr_umist=0,pr_zbran=0,pr_hmotn=0,pr_popis=0; char grp_sort=0,pr_number=0,pr_cena=0; char _typy_zbrani[]= - "Me‡\0" + "Me�\0" "Sekera\0" "Kladivo\0" - "H–l\0" - "D˜ka\0" - "St©eln \0" - "Ostatn¡\0"; + "H�l\0" + "D�ka\0" + "St�eln�\0" + "Ostatn�\0"; char _typy_veci[]= - "Nespecifikov no\0" - "Zbra¤ tv ©¡ v tv ©\0" - "Vrhac¡ zbra¤\0" - "St©eln  zbra¤\0" + "Nespecifikov�no\0" + "Zbra� tv��� v tv��\0" + "Vrhac� zbra�\0" + "St�eln� zbra�\0" "Zbroj\0" - "Svitek / H–lka\0" + "Svitek / H�lka\0" "Lektvar\0" "Voda\0" - "J¡dlo\0" - "Speci ln¡\0" + "J�dlo\0" + "Speci�ln�\0" "Runa\0" - "Pen¡ze\0" + "Pen�ze\0" "Svitek s textem\0" "Prach\0" - "Ostatn¡\0"; + "Ostatn�\0"; char _umisteni_veci[]= "Nikam\0" "Zavazadlo\0" - "Na tˆlo (naho©e)\0" - "Na tˆlo (dole)\0" + "Na t�lo (naho�e)\0" + "Na t�lo (dole)\0" "Na hlavu\0" "Na nohy\0" "Kutna\0" "Na krk\0" "Do ruky\0" - "Obouru‡\0" + "Obouru�\0" "Prsten\0" - "›¡p\0"; + "��p\0"; long load_section(FILE *f,void **section, int *sct_type,long *sect_size) @@ -149,14 +149,14 @@ char *find_str(char *sound,int number,long listsize) void print_polozka(int num,TITEM *t) { - if (pr_number) printf("%3d³",num); - if (pr_name) printf("%-32s³",t->jmeno); - if (pr_type) printf("%-20s³",find_str(_typy_veci,t->druh+1,sizeof(_typy_veci))); - if (pr_umist) printf("%-20s³",find_str(_umisteni_veci,t->umisteni+1,sizeof(_umisteni_veci))); - if (pr_zbran) printf("%-10s³",isweapon(t->druh)?find_str(_typy_zbrani,t->typ_zbrane+1,sizeof(_typy_zbrani)):" "); - if (pr_hmotn) printf("%6d³",t->hmotnost); - if (pr_cena) printf("%6d³",t->cena); - if (pr_sound) printf("%-12s³",find_str(sound,t->sound,listsize)); + if (pr_number) printf("%3d�",num); + if (pr_name) printf("%-32s�",t->jmeno); + if (pr_type) printf("%-20s�",find_str(_typy_veci,t->druh+1,sizeof(_typy_veci))); + if (pr_umist) printf("%-20s�",find_str(_umisteni_veci,t->umisteni+1,sizeof(_umisteni_veci))); + if (pr_zbran) printf("%-10s�",isweapon(t->druh)?find_str(_typy_zbrani,t->typ_zbrane+1,sizeof(_typy_zbrani)):" "); + if (pr_hmotn) printf("%6d�",t->hmotnost); + if (pr_cena) printf("%6d�",t->cena); + if (pr_sound) printf("%-12s�",find_str(sound,t->sound,listsize)); if (pr_popis) printf("%s",t->popis); puts(""); } diff --git a/VIDEO/CNMBUILD.C b/VIDEO/CNMBUILD.C index e39a81b..2cee36b 100644 --- a/VIDEO/CNMBUILD.C +++ b/VIDEO/CNMBUILD.C @@ -1,10 +1,10 @@ -#include +#include #include #include #include #include -#include -#include +#include +#include #include "flc.h" #include "anipack.h" #include diff --git a/VIDEO/CNMCONTR.C b/VIDEO/CNMCONTR.C index 25baf5d..479fac1 100644 --- a/VIDEO/CNMCONTR.C +++ b/VIDEO/CNMCONTR.C @@ -1,7 +1,7 @@ #include #include #include -#include +#include #define ERR_PARM 1 #define ERR_STR 2 diff --git a/VIDEO/FLC2MGIF.C b/VIDEO/FLC2MGIF.C index 47b07d4..1bdc571 100644 --- a/VIDEO/FLC2MGIF.C +++ b/VIDEO/FLC2MGIF.C @@ -63,9 +63,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include "flc.h" #include "lzw.h" diff --git a/VIDEO/JPEGMGIF.C b/VIDEO/JPEGMGIF.C index b291071..dc2590e 100644 --- a/VIDEO/JPEGMGIF.C +++ b/VIDEO/JPEGMGIF.C @@ -1,4 +1,4 @@ -#include +#include #include #include #include "jpegmgif.h" diff --git a/VIDEO/JPEG_SIM.C b/VIDEO/JPEG_SIM.C index 5827584..ecf4178 100644 --- a/VIDEO/JPEG_SIM.C +++ b/VIDEO/JPEG_SIM.C @@ -1,7 +1,7 @@ -#include +#include #include #include -#include +#include #include #include #include "flc.h" diff --git a/VIDEO/LZW.C b/VIDEO/LZW.C index 822becd..05fe405 100644 --- a/VIDEO/LZW.C +++ b/VIDEO/LZW.C @@ -1,7 +1,7 @@ #include #include #include -#include +#include #define LZW_MAX_CODES 4096 diff --git a/VIDEO/MGFSOUND.C b/VIDEO/MGFSOUND.C index b851bef..5709892 100644 --- a/VIDEO/MGFSOUND.C +++ b/VIDEO/MGFSOUND.C @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -75,7 +75,7 @@ int find_free_channel() { int i; for(i=0;i<256;i++) if (chaninfo[i].snd==NULL) return i; - printf("Nemohu pridat zvuk. Jiz je zaplneno vsech %d kanal–\n",CHANNELS); + printf("Nemohu pridat zvuk. Jiz je zaplneno vsech %d kanal�\n",CHANNELS); return -1; } @@ -194,7 +194,7 @@ void open_wav(char *wav) wavinf=(struct t_wave *)malloc(get_chunk_size(snd)); if (wavinf==NULL) { - puts("Nedostatek pamˆti."); + puts("Nedostatek pam�ti."); return; } read_chunk(snd,wavinf); @@ -480,7 +480,7 @@ void call_script(char *script_name) else strcpy(c,SND_NAME); if (scr==NULL) { - printf("Nemohu otev©¡t script: %s\n",script_name); + printf("Nemohu otev��t script: %s\n",script_name); exit(1); } snf=fopen(snd_name,"r"); @@ -488,7 +488,7 @@ void call_script(char *script_name) open_files(name); if (i!=1) { - printf("Chyba ve script souboru: %s. Prvni mus¡ b˜t jm‚no c¡lov‚ho souboru.\n",scr); + printf("Chyba ve script souboru: %s. Prvni mus� b�t jm�no c�lov�ho souboru.\n",scr); exit(1); } while ((i=fgetc(scr))!=EOF && i!='\n'); diff --git a/VIDEO/MGIF.C b/VIDEO/MGIF.C index 8c0f296..4ffa318 100644 --- a/VIDEO/MGIF.C +++ b/VIDEO/MGIF.C @@ -63,9 +63,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include "flc.h" #include "lzw.h" @@ -624,7 +624,7 @@ main(int argc,char *argv[]) "Nula udava ze se nezapisuji jen ty body, ktere se nemeni.\n\n" "Pozn: Bezne neni nutne uvadet parametr colorq protoze stupen ztraty se \n" "voli podle vysledku predchoziho frame. Je dobre ho uvest pri velkych\n" - "vykyvech velikosti frame. Tak zhruba pri ñ10KB. Hodnoty parametru se \n" + "vykyvech velikosti frame. Tak zhruba pri �10KB. Hodnoty parametru se \n" "voli od 25000-35000, cim vyssi, tim vyssi stupen ztraty"); exit(0); } diff --git a/VIDEO/MGIF98.C b/VIDEO/MGIF98.C index b5f4ab5..ee41077 100644 --- a/VIDEO/MGIF98.C +++ b/VIDEO/MGIF98.C @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/VIDEO/MGIFCAT.C b/VIDEO/MGIFCAT.C index 97c8eab..70ac756 100644 --- a/VIDEO/MGIFCAT.C +++ b/VIDEO/MGIFCAT.C @@ -1,6 +1,6 @@ -#include +#include #include -#include +#include #include #include #include diff --git a/VIDEO/MGIFEACT.C b/VIDEO/MGIFEACT.C index b2eff89..ff94cad 100644 --- a/VIDEO/MGIFEACT.C +++ b/VIDEO/MGIFEACT.C @@ -1,17 +1,17 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "lzw.h" #include "mgifeobj.h" @@ -172,7 +172,7 @@ void build_sample_list(void *list) } str_add(&ls,c); } - if (samples_total==0) str_add(&ls,"<‘ dn˜ zvuk>"); + if (samples_total==0) str_add(&ls,"<��dn� zvuk>"); memcpy(list,&ls,sizeof(void **)); } @@ -831,15 +831,15 @@ void warn_size_mistmach(void) } if (sizetotal_frames) { - msg_box(PRG_HEADER,'\x1',"MGIFEDIT zjistil,‘e film je krat¨¡, ne‘ stopy " - "ulo‘en‚ v souboru PRJ. Ke spr vn‚mu um¡stˆn¡ pou‘ij funkci GDelete","Ok",NULL); + msg_box(PRG_HEADER,'\x1',"MGIFEDIT zjistil,�e film je krat��, ne� stopy " + "ulo�en� v souboru PRJ. Ke spr�vn�mu um�st�n� pou�ij funkci GDelete","Ok",NULL); } } diff --git a/VIDEO/MGIFEACT.H b/VIDEO/MGIFEACT.H index aedf876..05bd62e 100644 --- a/VIDEO/MGIFEACT.H +++ b/VIDEO/MGIFEACT.H @@ -1,5 +1,5 @@ #ifndef _MGIFEACT_H -#include +#include #define _MGIFEACT_H diff --git a/VIDEO/MGIFEBLD.C b/VIDEO/MGIFEBLD.C index 1013e97..ddfafba 100644 --- a/VIDEO/MGIFEBLD.C +++ b/VIDEO/MGIFEBLD.C @@ -1,24 +1,24 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "lzw.h" #include "mgifeobj.h" #include "mgifedit.h" #include "mgifeact.h" #include "mgifebld.h" -#include +#include #include @@ -360,7 +360,7 @@ char build_solo(int smp) static void error_message(int smp) { char *c; - char *msg="Nastala chyba p©i pr ci se stopou:"; + char *msg="Nastala chyba p�i pr�ci se stopou:"; if (smp_prg[smp].user_name!=NULL) { concat(c,msg,smp_prg[smp].user_name); @@ -369,7 +369,7 @@ static void error_message(int smp) { concat(c,msg,smp_prg[smp].sample_name); } - msg_box(PRG_HEADER,'\x1',msg,"Pokra‡ovat",NULL); + msg_box(PRG_HEADER,'\x1',msg,"Pokra�ovat",NULL); } char build_all_samples() @@ -393,7 +393,7 @@ char build_all_samples() return 0; } } - set_value(0,20,"Ukl d m zvukovou stopu..."); + set_value(0,20,"Ukl�d�m zvukovou stopu..."); save_all(); destroy_all(); exit_wait=0; diff --git a/VIDEO/MGIFEDIT.C b/VIDEO/MGIFEDIT.C index a0caa7f..ce62348 100644 --- a/VIDEO/MGIFEDIT.C +++ b/VIDEO/MGIFEDIT.C @@ -1,25 +1,25 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "lzw.h" #include "mgifeobj.h" #include "mgifeact.h" #include "mgifedit.h" #include "mgifebld.h" #include -#include +#include #include -#include -#include +#include +#include void *vga_font=&boldcz; void *icones=&ikones; diff --git a/VIDEO/MGIFEOBJ.C b/VIDEO/MGIFEOBJ.C index 53a1c89..90de54f 100644 --- a/VIDEO/MGIFEOBJ.C +++ b/VIDEO/MGIFEOBJ.C @@ -2,13 +2,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "mgifeobj.h" #include "mgifedit.h" #include "mgifeact.h" diff --git a/VIDEO/MGIFPLAY.C b/VIDEO/MGIFPLAY.C index 2a82d21..f10f3d9 100644 --- a/VIDEO/MGIFPLAY.C +++ b/VIDEO/MGIFPLAY.C @@ -64,13 +64,13 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include "lzw.h" -#include -#include +#include + #include #include #include diff --git a/VIDEO/OLD/MGIFMEM.C b/VIDEO/OLD/MGIFMEM.C index 39a937f..919c974 100644 --- a/VIDEO/OLD/MGIFMEM.C +++ b/VIDEO/OLD/MGIFMEM.C @@ -1,5 +1,5 @@ #include -#include +#include #include #define MGIF "MGIF" diff --git a/VIDEO/PCX2MGIF.C b/VIDEO/PCX2MGIF.C index a0cd1bd..216ab83 100644 --- a/VIDEO/PCX2MGIF.C +++ b/VIDEO/PCX2MGIF.C @@ -63,11 +63,11 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include "lzw.h" #include #include @@ -782,14 +782,14 @@ void script_compress(char *script_name) else strcpy(c,SND_NAME); if (scr==NULL) { - printf("Nemohu otev©¡t script: %s\n",script_name); + printf("Nemohu otev��t script: %s\n",script_name); exit(1); } snf=fopen(snd_name,"w"); i=fscanf(scr,"%255s",name); if (i!=1) { - printf("Chyba ve script souboru: %s. Prvni mus¡ b˜t jm‚no c¡lov‚ho souboru.\n",scr); + printf("Chyba ve script souboru: %s. Prvni mus� b�t jm�no c�lov�ho souboru.\n",scr); exit(1); } i=fscanf(scr,"%d",&speed); @@ -860,7 +860,7 @@ main(int argc,char *argv[]) "Nula udava ze se nezapisuji jen ty body, ktere se nemeni.\n\n" "Pozn1: Bezne neni nutne uvadet parametr colorq protoze stupen ztraty se \n" "voli podle vysledku predchoziho frame. Je dobre ho uvest pri velkych\n" - "vykyvech velikosti frame. Tak zhruba pri ñ10KB. Hodnoty parametru se \n" + "vykyvech velikosti frame. Tak zhruba pri �10KB. Hodnoty parametru se \n" "voli od 25000-35000, cim vyssi, tim vyssi stupen ztraty\n\n" "Pozn2: Pokud nektere parametry vynechas (treba znakem '-', nebo je na konci\n" "neuvedes, dosadi se default hodnoty. Ty jsou zvoleny tak, aby program\n" diff --git a/VIDEO/PLAYCNM.C b/VIDEO/PLAYCNM.C index 4460e46..591be36 100644 --- a/VIDEO/PLAYCNM.C +++ b/VIDEO/PLAYCNM.C @@ -1,13 +1,13 @@ -#include +#include #include #include #include -#include +#include #include -#include + #include "anipack.h" #include "cinema.h" -#include +#include #define CINEMA ".cnm" diff --git a/VIDEO/VIDEO.C b/VIDEO/VIDEO.C index 52b5d2f..d74a6a4 100644 --- a/VIDEO/VIDEO.C +++ b/VIDEO/VIDEO.C @@ -1,8 +1,8 @@ -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include "bitline.h" diff --git a/Windows/FCS_Tasker.c b/Windows/FCS_Tasker.c index 4f8c168..fb163f4 100644 --- a/Windows/FCS_Tasker.c +++ b/Windows/FCS_Tasker.c @@ -1,5 +1,5 @@ #include -#include +#include #include "types.h" #include "event.h" #include diff --git a/Windows/Music.cpp b/Windows/Music.cpp index d4673a7..b144364 100644 --- a/Windows/Music.cpp +++ b/Windows/Music.cpp @@ -9,7 +9,7 @@ #include #include extern "C" { -#include +#include } #include "Music.h" diff --git a/Windows/install.cpp b/Windows/install.cpp index 4f26a39..dd4cc6a 100644 --- a/Windows/install.cpp +++ b/Windows/install.cpp @@ -6,8 +6,8 @@ #include extern "C" { -#include -#include +#include +#include } #include #include diff --git a/Windows/konfig.cpp b/Windows/konfig.cpp index 55ae166..4ea14b4 100644 --- a/Windows/konfig.cpp +++ b/Windows/konfig.cpp @@ -12,8 +12,8 @@ extern "C" { -#include -#include +#include +#include } static HWND handles[5]; diff --git a/Windows/skeldal_win.c b/Windows/skeldal_win.c index ee5c51a..03f41fd 100644 --- a/Windows/skeldal_win.c +++ b/Windows/skeldal_win.c @@ -1,7 +1,7 @@ #include "skeldal_win.h" #include "debug.h" #include "resource.h" -#include +#include void DXMouseTransform(unsigned short *x, unsigned short *y); void DxLockBuffers(BOOL lock); diff --git a/Windows/zvuk_win.cpp b/Windows/zvuk_win.cpp index d74dbfb..ceacd50 100644 --- a/Windows/zvuk_win.cpp +++ b/Windows/zvuk_win.cpp @@ -1,5 +1,5 @@ #include -#include +#include extern "C" { diff --git a/ZVUK/TRACK.C b/ZVUK/TRACK.C index ef8493a..1dfaab5 100644 --- a/ZVUK/TRACK.C +++ b/ZVUK/TRACK.C @@ -1,13 +1,13 @@ #include -#include +#include #include #include #include -#include + #include #include -#include -#include +#include +#include #define SCRADR 0xb8000 #define SCRSIZE (80*25*2) @@ -124,41 +124,41 @@ char pause=0; unsigned short *screen; TDIGIT digits[15]= - { "ÛßÛ" - "Û Û" - "ßßß", - " Û" - " Û" - " ß", - "ßßÛ" - "Ûßß" - "ßßß", - "ßßÛ" - "ßßÛ" - "ßßß", - "Û Û" - "ßßÛ" - " ß", - "Ûßß" - "ßßÛ" - "ßßß", - "Ûßß" - "ÛßÛ" - "ßßß", - "ÛßÛ" - "ß Û" - " ß", - "ÛßÛ" - "ÛßÛ" - "ßßß", - "ÛßÛ" - "ßßÛ" - "ßßß", - " Ü " - " Ü " + { "���" + "� �" + "���", + " �" + " �" + " �", + "���" + "���" + "���", + "���" + "���" + "���", + "� �" + "���" + " �", + "���" + "���" + "���", + "���" + "���" + "���", + "���" + "� �" + " �", + "���" + "���" + "���", + "���" + "���" + "���", + " � " + " � " " ", " " - "ßßß" + "���" " " }; @@ -567,8 +567,8 @@ void show_dir(int sel_file,int playing) color=3+(playing==sel_file?2:0); disp_str(1,17," ",color); disp_str(21,17," ",color); - disp_str(0,17,"È",color); - disp_str(23,17,"É",color); + disp_str(0,17,"�",color); + disp_str(23,17,"�",color); } void play_next(char **next) { diff --git a/ZVUK/ZVUK1.C b/ZVUK/ZVUK1.C index 74132ca..d8d604c 100644 --- a/ZVUK/ZVUK1.C +++ b/ZVUK/ZVUK1.C @@ -4,7 +4,7 @@ #include #include #include -#include + #include diff --git a/game/advconfig.c b/game/advconfig.c index b7c5e35..d51ee12 100644 --- a/game/advconfig.c +++ b/game/advconfig.c @@ -1,4 +1,4 @@ -#include +#include #include "advconfig.h" diff --git a/game/advconfig.h b/game/advconfig.h index c2589b5..66e0235 100644 --- a/game/advconfig.h +++ b/game/advconfig.h @@ -3,8 +3,8 @@ #define SKELDAL_GAME_ADVCONFIG_H_ -#include -#include +#include +#include void adv_patch_config(INI_CONFIG *srcconfig, TSTR_LIST lst); diff --git a/game/automap.c b/game/automap.c index 8820bd1..45cf88c 100644 --- a/game/automap.c +++ b/game/automap.c @@ -1,22 +1,23 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" +#include #define AUTOMAP_BACK RGB555(8,4,0) #define AUTOMAP_VODA RGB555(0,15,31) #define AUTOMAP_LAVA RGB555(31,16,0) diff --git a/game/builder.c b/game/builder.c index 79a3c4d..46d6a8d 100644 --- a/game/builder.c +++ b/game/builder.c @@ -1,23 +1,24 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include "version.h" +#include #define ZIVOTY_S 60 #define ZIVOTY_E 62 #define KONDIC_S 64 diff --git a/game/chargen.c b/game/chargen.c index 498aedc..8b7ce58 100644 --- a/game/chargen.c +++ b/game/chargen.c @@ -1,22 +1,22 @@ //CHARACTER GENERATOR -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include diff --git a/game/chargen2.c b/game/chargen2.c index 4346f38..069bd93 100644 --- a/game/chargen2.c +++ b/game/chargen2.c @@ -4,19 +4,19 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include diff --git a/game/clk_map.c b/game/clk_map.c index 7129d0a..f6d28f7 100644 --- a/game/clk_map.c +++ b/game/clk_map.c @@ -1,11 +1,11 @@ -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "globals.h" #include "engine1.h" diff --git a/game/crc.c b/game/crc.c index f7c01f3..d179a2d 100644 --- a/game/crc.c +++ b/game/crc.c @@ -1,5 +1,5 @@ #include -#include + uint32_t l; diff --git a/game/dialogy.c b/game/dialogy.c index 545f7bf..1709ef9 100644 --- a/game/dialogy.c +++ b/game/dialogy.c @@ -1,22 +1,22 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include + + +#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include @@ -156,14 +156,13 @@ static void dialog_anim(va_list args) void *anm; void *aptr; - char *ch; char hid; int spdc=0,cntr=rep,tm,tm2; int32_t scr_linelen2 = GetScreenPitch(); loc_anim_render_buffer=PIC_Y*scr_linelen2+PIC_X; mgif_install_proc(animace_kouzla); - concat(ch,pathtable[SR_DIALOGS],block); + const char *ch = build_pathname(2,gpathtable[SR_DIALOGS], block); free(block); aptr=load_file(ch); do diff --git a/game/dlglib.c b/game/dlglib.c index 45e6b59..496a87a 100644 --- a/game/dlglib.c +++ b/game/dlglib.c @@ -15,15 +15,15 @@ */ -#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include FILE *dlg; int32_t *odstavce=NULL; diff --git a/game/dump.cpp b/game/dump.cpp index 600162a..cb7294c 100644 --- a/game/dump.cpp +++ b/game/dump.cpp @@ -1,10 +1,10 @@ -#include +#include #include #include #include #include #include -#include +#include int findMaxDumpNumber(const std::string &directoryPath) { namespace fs = std::filesystem; diff --git a/game/encrypt.c b/game/encrypt.c index 770a82c..f5444dc 100644 --- a/game/encrypt.c +++ b/game/encrypt.c @@ -1,7 +1,7 @@ -#include +#include #include #include -#include + #include #include diff --git a/game/enemy.c b/game/enemy.c index b9db33f..376930d 100644 --- a/game/enemy.c +++ b/game/enemy.c @@ -1,18 +1,19 @@ -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include #include "engine1.h" #include "globals.h" #include "specproc.h" +#include #define MOB_ZNAKY "FLBLCH" #define MOB_START 1 diff --git a/game/engine1.c b/game/engine1.c index 65b1c91..f8271af 100644 --- a/game/engine1.c +++ b/game/engine1.c @@ -1,17 +1,18 @@ -#include -#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include #include "math.h" #include "globals.h" #include "engine1.h" +#include #define CTVR 128 t_points points; diff --git a/game/engine2.c b/game/engine2.c index 31357f6..544ff48 100644 --- a/game/engine2.c +++ b/game/engine2.c @@ -1,7 +1,7 @@ -#include -#include "types.h" +#include +#include #include "engine1.h" -#include +#include #include diff --git a/game/gamesave.c b/game/gamesave.c index dd65045..506854c 100644 --- a/game/gamesave.c +++ b/game/gamesave.c @@ -1,20 +1,20 @@ -#include -#include +#include + #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include "globals.h" #include "temp_storage.h" @@ -107,10 +107,10 @@ int load_org_map(char *filename,TSTENA **sides,TSECTOR **sectors,TMAP_EDIT_INFO int sect; int32_t size,r; char nmapend=1; - char *c; - c=find_map_path(filename); - f=fopen_icase(c,"rb");free(c); + + const char *c=build_pathname(2, gpathtable[SR_MAP],filename); + f=fopen_icase(c,"rb"); if (f==NULL) return -1; do { @@ -722,13 +722,6 @@ int load_basic_info() return res; } -static void MakeSaveGameDir(const char *name) -{ - char *p=(char *)alloca(strlen(name)+1); - strcpy(p,name); - p[strlen(p)-1]=0; - mkdir(p,0666); -} static int save_global_events() { @@ -754,14 +747,14 @@ static int load_global_events() int save_game(int slotnum,char *gamename) { - char *sn,*ssn,*gn; + char *ssn,*gn; FILE *svf; int r; SEND_LOG("(SAVELOAD) Saving game slot %d",slotnum); save_map_state(); - concat(sn,pathtable[SR_SAVES],_SLOT_SAV); - MakeSaveGameDir(pathtable[SR_SAVES]); + const char *sn = build_pathname(2,gpathtable[SR_SAVES],_SLOT_SAV); + create_directories(gpathtable[SR_SAVES]); ssn=alloca(strlen(sn)+3); sprintf(ssn,sn,slotnum); gn=alloca(SAVE_NAME_SIZE); @@ -794,7 +787,7 @@ extern char running_battle; int load_game(int slotnum) { - char *sn,*ssn; + char *ssn; FILE *svf; int r,t; @@ -803,7 +796,7 @@ int load_game(int slotnum) battle=0; close_story_file(); purge_temps(0); - concat(sn,pathtable[SR_SAVES],_SLOT_SAV); + const char *sn = build_pathname(2, gpathtable[SR_SAVES], _SLOT_SAV); ssn=alloca(strlen(sn)+3); sprintf(ssn,sn,slotnum); svf=fopen_icase(ssn,"rb"); @@ -862,10 +855,10 @@ static ENUM_ALL_STATUS_CALLBACK_RESULT load_specific_file_callback(FILE *f, cons static void load_specific_file(int slot_num,char *filename,void **out,int32_t *size) //call it in task! { FILE *slot; - char *c,*d; + char *d; - concat(c,pathtable[SR_SAVES],_SLOT_SAV); - d=alloca(strlen(c)+2); + const char *c = build_pathname(2, gpathtable[SR_SAVES], _SLOT_SAV); + d=alloca(strlen(c)+6); sprintf(d,c,slot_num); slot=fopen_icase(d,"rb"); if (slot==NULL) @@ -908,10 +901,10 @@ static char load_mode; void read_slot_list() { int i; - char *mask,*name; + char *name; char slotname[SAVE_NAME_SIZE]; if (slot_list==NULL) slot_list=create_list(SLOTS_MAX); - concat(mask,pathtable[SR_SAVES],_SLOT_SAV); + const char *mask = build_pathname(2, gpathtable[SR_SAVES],_SLOT_SAV); name=alloca(strlen(mask)+1); for(i=0;i #include "engine1.h" #include "temp_storage.h" - +#include +#include #include #include @@ -267,7 +268,11 @@ static __inline int rangrnd(int a, int b) {return rnd(b-a+1)+a;} #define concat(c,s1,s2) c=strcat(strcpy((char *)alloca(strlen(s1)+strlen(s2)+1),s1),s2) -#define concat_r(c,s1,s2) strcat(strcpy((char *)alloca(strlen(s1)+strlen(s2)+1),s1),s2) +#define local_strdup(c) strcpy((char *)strlen(c)+1, c) +#define concat2(s1,s2) strcat(strcpy((char *)alloca(strlen(s1)+strlen(s2)+1),s1),s2) +#define concat3(s1,s2,s3) strcat(strcat(strcpy((char *)alloca(strlen(s1)+strlen(s2)+strlen(s3)+1),s1),s2),s3) +#define concat4(s1,s2,s3,s4) strcat(strcat(strcat(strcpy((char *)alloca(strlen(s1)+strlen(s2)+strlen(s3)+strlen(s4)+1),s1),s2),s3),s4) +#define countof(array) (sizeof(array)/sizeof(array[0])) #define get_ap(vls) (((vls[VLS_POHYB])>0 && (vls[VLS_POHYB])<15)?1:(vls[VLS_POHYB])/15) @@ -319,7 +324,26 @@ static __inline int rangrnd(int a, int b) {return rnd(b-a+1)+a;} #define MC_NOAUTOMAP 0x800 //nelze najit automapingem #define MC_NOSUMMON 0x1000 //nelze privolat hrace -//adresare + +typedef enum skeldal_folders_tag { + SR_DATA, + SR_GRAFIKA, + SR_ZVUKY, + SR_FONT, + SR_MAP, + SR_MUSIC, + SR_BGRAFIKA, + SR_ITEMS, + SR_ENEMIES, + SR_VIDEO, + SR_DIALOGS, + SR_SAVES, + SR_WORK, + SR_CD, + + +SR_COUNT} SKELDAL_FOLDERS_TAG; +#if 0 //adresare #define SR_DATA 0 #define SR_GRAFIKA 1 #define SR_ZVUKY 2 @@ -336,6 +360,8 @@ static __inline int rangrnd(int a, int b) {return rnd(b-a+1)+a;} #define SR_CD 14 #define SR_MAP2 15 #define SR_ORGMUSIC 16 +#define SR_COUNT 17 +#endif //globalni cisla k casovacum #define TM_BACK_MUSIC 1 @@ -529,7 +555,7 @@ extern int viewsector; //aktualni sektor vyhledu extern int viewdir; //aktualni smer vyhledu extern THE_TIMER timer_tree; //strom casovych udalosti extern D_ACTION *d_action; //spojovy seznam zpozdenych akci -extern char *pathtable[]; //tabulka adresaru +extern char *gpathtable[SR_COUNT]; //tabulka adresaru extern char level_preload; //informace o preloadingu extern char **texty; //globalni tabulka textu extern char **level_texts; //lokalni tabulka textu @@ -665,7 +691,7 @@ void build_player_map(void); //je nutne volat po presunem postav int postavy_propadnout(int sector); void postavy_teleport_effect(int sector,int dir,int postava,char eff); void reg_grafiku_postav(void); -void play_movie_seq(char *s,int y); +void play_movie_seq(const char *s,int y); void check_postavy_teleport(void); //je-li viewsector=teleport pak presune postavy //builder @@ -1664,11 +1690,9 @@ void check_global_fletna(THE_TIMER *t); void fletna_glob_add_note(uint8_t note); - char *find_map_path(const char *filename); //vyhledava jmeno mapy v alternativnich cestach. - //Vysledny retezec je nutne uvolnit (free) ! -TMPFILE_RD *enc_open(char *filename); //dekoduje a otevira TXT soubor (ENC) +TMPFILE_RD *enc_open(const char *filename); //dekoduje a otevira TXT soubor (ENC) void enc_close(TMPFILE_RD *fil); -int load_string_list_ex(char ***list,char *filename); +int load_string_list_ex(char ***list,const char *filename); int smlouvat_nakup(int cena,int ponuka,int posledni,int puvod,int pocet); int smlouvat_prodej(int cena,int ponuka,int posledni,int puvod,int pocet); @@ -1694,7 +1718,7 @@ char enter_generator(void); //kniha #define add_to_book(odst) add_text_to_book(texty_knihy,odst) -void add_text_to_book(char *filename,int odst); +void add_text_to_book(const char *filename,int odst); void write_book(int page); int count_pages(void); void save_book(void); diff --git a/game/globmap.c b/game/globmap.c index 9a02d92..7b30d8e 100644 --- a/game/globmap.c +++ b/game/globmap.c @@ -1,23 +1,24 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include + + +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" +#include #include #define GLOBMAP "GLOBMAP.DAT" @@ -164,7 +165,7 @@ static int cti_retezec(int znaku,char *text,char mezera,char upcase) return 0; } -static void error(char *text) +static void error(const char *text) { char popis[300]; @@ -325,12 +326,10 @@ static char proved_prikaz() break; case OP_ESCAPE: { - char *s; cti_retezec(20,prikaz,1,1); fclose(glbm); - s=find_map_path(prikaz); + const char *s = build_pathname(2, gpathtable[SR_MAP], prikaz); if ((glbm=fopen_icase(s,"r"))==NULL) error(s); - free(s); return 0; } default:error(prikaz); @@ -370,13 +369,12 @@ static void preskoc_prikaz(void) static void do_script(void) { - char *s; + char vysledek; - s=find_map_path(GLOBMAP); + const char *s=build_pathname(2,gpathtable[SR_MAP], GLOBMAP); linecounter=0; glbm=fopen_icase(s,"r"); - free(s); if (glbm==NULL) error("Chyb� uveden� soubor..."); ODD=cti_oddelovac(); do diff --git a/game/interfac.c b/game/interfac.c index 3442f66..b7b9bca 100644 --- a/game/interfac.c +++ b/game/interfac.c @@ -1,26 +1,26 @@ -#include -#include +#include + #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include "globals.h" #include "engine1.h" @@ -1318,21 +1318,6 @@ void check_global_fletna(THE_TIMER *t) //--------------------------------------- -char *find_map_path(const char *filename) - { - char *p1,*p; - - if (pathtable[SR_MAP2]!=NULL) - { - concat(p1,pathtable[SR_MAP2],filename); - if (check_file_exists(p1)) goto found; - } - concat(p1,pathtable[SR_MAP],filename); - found: - p=NewArr(char,strlen(p1)+1); - strcpy(p,p1); - return p; - } static char *load_file_to_string(FILE *f, int *size) { fseek(f,0, SEEK_END); @@ -1345,7 +1330,7 @@ static char *load_file_to_string(FILE *f, int *size) { return c; } -TMPFILE_RD *enc_open(char *filename) +TMPFILE_RD *enc_open(const char *filename) { FILE *f; char *c,*enc; @@ -1384,7 +1369,7 @@ void enc_close(TMPFILE_RD *fil) } -int load_string_list_ex(TSTR_LIST *list,char *filename) +int load_string_list_ex(TSTR_LIST *list,const char *filename) { char c[1024],*p; int i,j,lin=0; @@ -1564,7 +1549,6 @@ typedef struct _hicolpal void show_jrc_logo(char *filename) { - char *s; char *pcx;word *pcxw; char bnk=1; int xp,yp,i; @@ -1574,7 +1558,7 @@ void show_jrc_logo(char *filename) change_music("?"); curcolor=0;bar32(0,0,639,479); showview(0,0,0,0);sleep_ms(1000); - concat(s,pathtable[SR_VIDEO],filename); + const char *s = build_pathname(2, gpathtable[SR_VIDEO],filename); if (open_pcx(s,A_8BIT,&pcx)) return; pcxw=(word *)pcx; xp=pcxw[0]; diff --git a/game/inv.c b/game/inv.c index 88e6f67..53e2e0d 100644 --- a/game/inv.c +++ b/game/inv.c @@ -1,25 +1,26 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include #include +#include #define neprezbrojit() (battle && (battle_mode!=MD_PREZBROJIT || select_player!=human_selected-postavy)) @@ -162,7 +163,7 @@ static void items_15to16_correct(void **p,int32_t *s) void load_items() { - char *name; + const char *name; FILE *f; int sect,i,hs; int32_t size; @@ -180,8 +181,8 @@ void load_items() break; } } while (1); - name=find_map_path(ITEM_FILE); - f=fopen_icase(name,"rb");free(name); + name=build_pathname(2, gpathtable[SR_MAP],ITEM_FILE); + f=fopen_icase(name,"rb"); if (f==NULL) { closemode(); @@ -589,10 +590,8 @@ void do_items_specs(void) if (p->popis[0]==0) add_to_book(p->user_value); else { - char *s; - s=find_map_path(p->popis); + const char *s = build_pathname(2, gpathtable[SR_MAP], p->popis); add_text_to_book(s,p->user_value); - free(s); } play_fx_at(FX_BOOK); if (game_extras & EX_AUTOOPENBOOK) autoopenaction=1; @@ -1767,7 +1766,6 @@ char uloz_sip(int id,int xa,int ya,int xr,int yr) static char MakeItemCombinations(short *itm1, short *itm2) { short i1=*itm1-1,i2=*itm2-1; - char *fname; int src1; int src2; int trg1; @@ -1777,14 +1775,9 @@ static char MakeItemCombinations(short *itm1, short *itm2) FILE *table; - concat(fname,pathtable[SR_MAP],"COMBITEM.DAT"); + const char *fname = build_pathname(2,gpathtable[SR_MAP],"COMBITEM.DAT"); table=fopen_icase(fname,"r"); - if (table==0 && pathtable[SR_MAP2][0]) - { - concat(fname,pathtable[SR_MAP2],fname); - table=fopen_icase(fname,"r"); - } - if (table==0) return 0; + if (table==NULL) return 0; cnt=fscanf(table,"%d %d -> %d %d",&src1,&src2,&trg1,&trg2); while(cnt>=3) { diff --git a/game/kniha.c b/game/kniha.c index 09435b6..afe630b 100644 --- a/game/kniha.c +++ b/game/kniha.c @@ -1,4 +1,4 @@ -#include +#include /* Popis jazyka pro psani textu do knihy @@ -43,10 +43,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "globals.h" #define XMAX 254 @@ -550,7 +550,7 @@ static void seek_section(TMPFILE_RD *txt,int sect_number) exit(1); } -void add_text_to_book(char *filename,int odst) +void add_text_to_book(const char *filename,int odst) { TMPFILE_RD *fl; diff --git a/game/kouzla.c b/game/kouzla.c index 503cfe6..061f65e 100644 --- a/game/kouzla.c +++ b/game/kouzla.c @@ -1,19 +1,19 @@ -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -//#include +#include + +#include +#include #include -#include +#include #include #include "engine1.h" #include "globals.h" +#include #define S_jmeno 128 #define S_kouzlo 129 diff --git a/game/macros.c b/game/macros.c index 9e5101d..84e7e7a 100644 --- a/game/macros.c +++ b/game/macros.c @@ -1,25 +1,26 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include #include "engine1.h" -#include +#include #include "globals.h" #include "specproc.h" #include "temp_storage.h" #include +#include TMULTI_ACTION_RECORD *macros; //tabulka make TMULTI_ACTION_STATE macro_state_block; static const TMULTI_ACTION *first_macro; @@ -566,11 +567,9 @@ static int ma_picki(const TMA_TWOP *i,int abs_pos) static void ma_wbook(const TMA_LOADLEV *l) { - char *s; - s=find_map_path(l->name); + const char *s = build_pathname(2, gpathtable[SR_MAP], l->name); add_text_to_book(s,l->start_pos); play_fx_at(FX_BOOK); - free(s); } static void ma_send_experience(int32_t what) @@ -634,10 +633,10 @@ static void build_trig_group(char mode,int side) static int ma_play_anim(const char *filename,char cls) { - char *a; + unwire_main_functs(); - concat(a,pathtable[SR_VIDEO],filename); + const char *a = build_pathname(2, gpathtable[SR_VIDEO],filename); curcolor=0; if (cls) { diff --git a/game/menu.c b/game/menu.c index 1490791..c1c4c56 100644 --- a/game/menu.c +++ b/game/menu.c @@ -1,21 +1,21 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + + +#include +#include +#include +#include +#include +#include +#include +#include #include #include "engine1.h" -#include +#include #include "globals.h" @@ -368,21 +368,23 @@ char *get_next_title(signed char control,char *filename) static TMPFILE_RD *titles=NULL; static char buffer[81]; - char *path,*c; + char *c; + const char *path; switch(control) { - case 1:concat(path,pathtable[SR_MAP],filename); + case 1: + path = local_strdup(build_pathname(2, gpathtable[SR_MAP],filename)); titles=enc_open(path); if (titles==NULL) { - concat(path,pathtable[SR_DATA],filename); - titles=enc_open(path); + const char *path2 = local_strdup(build_pathname(2, gpathtable[SR_DATA],filename)); + titles=enc_open(path2); if (titles==NULL) { char popis[300]; closemode(); - sprintf(popis,"Soubor nenalezen: %s%s nebo %s%s\n",pathtable[SR_MAP],filename,pathtable[SR_DATA],filename); + sprintf(popis,"Soubor nenalezen: %s nebo %s\n",path,path2); display_error(popis); exit(1); } diff --git a/game/realgame.c b/game/realgame.c index d1cdc8a..9dc3208 100644 --- a/game/realgame.c +++ b/game/realgame.c @@ -1,24 +1,25 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "engine1.h" -#include -#include "globals.h" -#include "inicfg.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "engine1.h" +#include +#include "globals.h" +#include + +#include + #define A_OPEN_DOOR 1 #define A_CLOSE_DOOR 2 @@ -141,16 +142,15 @@ void preload_objects(int ofsts) { int i; char lodka=1; - char c[200]; for(i=1;i +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "engine1.h" -#include -#include "globals.h" -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "engine1.h" +#include +#include "globals.h" +#include +#include + +#include extern char enable_sort; extern char autoattack; diff --git a/game/skeldal.c b/game/skeldal.c index 3e7ca87..0497ddd 100644 --- a/game/skeldal.c +++ b/game/skeldal.c @@ -1,34 +1,34 @@ -#include +#include #include #include -#include + #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include #include "globals.h" #include "engine1.h" #include "wizard.h" #include "version.h" #include "default_font.h" +#include "advconfig.h" #include #define CONFIG_NAME SKELDALINI @@ -36,25 +36,7 @@ #define INI_INT 2 #define ERR_GENERAL 1 -char def_path[]=""; -char graph_path[]="graphics" PATH_SEPARATOR; -char basc_graph[]="graphics" PATH_SEPARATOR "basic" PATH_SEPARATOR; -char item_graph[]="graphics" PATH_SEPARATOR "items" PATH_SEPARATOR; -char sample_path[]="samples" PATH_SEPARATOR; -char font_path[]="font" PATH_SEPARATOR; -char map_path[]="maps" PATH_SEPARATOR; -char music_path[]="music" PATH_SEPARATOR; -char org_music_path[]="music" PATH_SEPARATOR; -char temp_path[]="?"; -char enemies_path[]="graphics" PATH_SEPARATOR "enemies" PATH_SEPARATOR; -char video_path[]="video" PATH_SEPARATOR; -char dialogs_path[]="graphics" PATH_SEPARATOR "dialogs" PATH_SEPARATOR; -char saves_path[]=""; -char work_path[]=""; -char cd_path[]=""; -char map2_path[]=""; -char plugins_path[]=""; -char *pathtable[]={def_path,graph_path,sample_path,font_path,map_path,music_path,temp_path,basc_graph,item_graph,enemies_path,video_path,dialogs_path,saves_path,work_path,cd_path,map2_path,plugins_path,org_music_path}; +char *gpathtable[SR_COUNT]; /* char *pathtable[]= @@ -868,9 +850,9 @@ void reg_grafiku_postav(void) void cti_texty(void) { - char path[80];int err; + int err; texty=(TSTR_LIST)create_list(4); - sprintf(path,"%s%s",pathtable[SR_DATA],TEXTY); + const char *path = build_pathname(2,gpathtable[SR_DATA], TEXTY); if ((err=load_string_list_ex(&texty,path))!=0) { char buff[256]; @@ -1005,9 +987,8 @@ static void patch_error(int err) showview(0,460,640,20); } -void init_skeldal(void) +void init_skeldal(const INI_CONFIG *cfg) { - char c[MAX_FILESYSTEM_PATH],d[MAX_FILESYSTEM_PATH]; int verr; boldcz=LoadDefaultFont(); @@ -1032,11 +1013,11 @@ void init_skeldal(void) /* install_dos_error(device_error,(char *)getmem(4096)+4096);*/ swap_error=swap_error_exception; - snprintf(d,sizeof(d),"%s%s",pathtable[SR_DATA],"SKELDAL.DDL"); + const char *ddlfile = local_strdup(build_pathname(2, gpathtable[SR_DATA],"SKELDAL.DDL")); - init_manager(d,c); -SEND_LOG("(GAME) Memory manager initialized. Using DDL: '%s' Temp dir: '%s'",d,c); - texty_knihy=find_map_path("kniha.txt"); + init_manager(ddlfile, NULL); + SEND_LOG("(GAME) Memory manager initialized. Using DDL: '%s'",ddlfile); + texty_knihy=strdup(build_pathname(2,gpathtable[SR_MAP],"kniha.txt")); install_gui(); @@ -1202,6 +1183,7 @@ void enter_game(void) parm[ebx] value [eax] */ +/* static int do_config_skeldal(int num,int numdata,char *txt) { switch (num) @@ -1241,16 +1223,15 @@ static int do_config_skeldal(int num,int numdata,char *txt) break; case 26:refresh=numdata;break; default:num-=CESTY_POS; - mman_pathlist[num]=(char *)getmem(strlen(txt)+1); - strcpy(mman_pathlist[num],txt); + gpathtable[num] = strdup(txt); SEND_LOG("(GAME) Directory '%s' has been assigned to group nb. %d",txt,num); break; } return 0; } - - +*/ +/* static void config_skeldal(const char *line) { int ndata=0,i,maxi; @@ -1289,7 +1270,8 @@ static void config_skeldal(const char *line) do_config_skeldal(i,ndata,data); } } - +*/ +/* static void configure(char *filename) { SEND_LOG("(GAME) Reading config. file '%s'",filename); @@ -1307,7 +1289,7 @@ static void configure(char *filename) process_ini(cur_config,config_skeldal); } - +*/ static int update_config(void) { SEND_LOG("(GAME) Updating config. file '%s'",CONFIG_NAME); @@ -1339,7 +1321,7 @@ void set_verify(char state); "mov ah,2eh"\ "int 21h" */ -void play_movie_seq(char *s,int y) +void play_movie_seq(const char *s,int y) { int hic=full_video?SMD_HICOLOR+128:SMD_HICOLOR,cc=full_video?SMD_256+128:SMD_256; word *lbuffer=GetScreenAdr(); @@ -1364,10 +1346,9 @@ void play_movie_seq(char *s,int y) void play_anim(int anim_num) { - char *s; char *t,*z; TSTR_LIST titl=NULL; - concat(s,pathtable[SR_VIDEO],texty[anim_num]); + const char *s = build_pathname(2,gpathtable[SR_VIDEO], texty[anim_num]); if (snd_devnum==DEV_NOSOUND || titles_on) { concat(t,s," "); @@ -1663,6 +1644,7 @@ static void start(va_list args) while (!exit_wait); } +#if 0 static void start_from_mapedit(va_list args) //#pragma aux start_from_mapedit parm[] { @@ -1671,6 +1653,7 @@ static void start_from_mapedit(va_list args) new_game(argc-1,argv+1); exit_wait=1; } +#endif void disable_intro(void) { @@ -1679,64 +1662,42 @@ void disable_intro(void) } +void new_configure(const INI_CONFIG *) { + +} int main(int argc,char *argv[]) { - char *c,rm; - - - - if (argc>=3) rm=!strcmp(argv[1],"12345678");else rm=0; - - - argv; - c=getcwd(NULL,0); - pathtable[SR_SAVES]=getmem(strlen(c)+2); - strcpy(pathtable[SR_SAVES],c); - strcat(pathtable[SR_SAVES],PATH_SEPARATOR); - free(c); - -// set_verify(0); - mman_pathlist=pathtable; + def_mman_group_table(gpathtable); zoom_speed(1); turn_speed(1); - configure(CONFIG_NAME); - if ((argc>=2 ) && !rm ) - { - char *adventure; - char **config=cur_config; - const char *music = mman_pathlist[SR_MUSIC]; - mman_pathlist[SR_ORGMUSIC]=(char *)getmem(strlen(music)+1); - strcpy(mman_pathlist[SR_ORGMUSIC],music); + INI_CONFIG *cfg = ini_open(CONFIG_NAME); + if (cfg == NULL) { + fprintf(stderr, "Failed to open configuration file: %s\n", CONFIG_NAME); + return 1; + } + + if (argc >= 2) { + TSTR_LIST adv_config=read_config(argv[1]);; + adv_patch_config(cfg, adv_config); + release_list(adv_config); + } + + new_configure(cfg); - adventure=argv[1]; - cur_config=NULL; - configure(adventure); - release_list(cur_config); - cur_config=config; - } -#ifdef LOGFILE - { - int i; - for(i=0;i<(int)(sizeof(pathtable)/sizeof(*pathtable));i++) SEND_LOG("(GAME) LOG: Using directory '%s' as '%s'",pathtable[i],sinit[i+CESTY_POS].heslo); - } -#endif start_check(); purge_temps(1); // textmode_effekt(); clrscr(); - init_skeldal(); + init_skeldal(cfg); + //add_task(32768,check_number_1phase,argv[0]); - if (argc>=3 && rm) - { - add_task(65536,start_from_mapedit,argc,argv); - } - else + add_task(65536,start); /* position(200,200); @@ -1744,8 +1705,10 @@ int main(int argc,char *argv[]) outtext("Ahoj lidi"); showview(0,0,0,0);*/ escape(); - update_config(); closemode(); + + ini_close(cfg); + return 0; } diff --git a/game/sndandmus.c b/game/sndandmus.c index 56edbe7..5f9144e 100644 --- a/game/sndandmus.c +++ b/game/sndandmus.c @@ -1,15 +1,16 @@ -#include +#include #include #include -#include -#include -#include -#include -#include + +#include +#include +#include +#include #include "globals.h" #include -#include +#include +#include #include #define PL_RANDOM 1 #define PL_FORWARD 2 @@ -379,8 +380,6 @@ const char * end_of_song_callback(void *ctx) { const char *get_next_music_from_playlist() { int i,step; - static char d[MAX_FILESYSTEM_PATH]; - if (cur_playlist==NULL) return NULL; if (!remain_play) for(i=0;cur_playlist[i]!=NULL;remain_play++,i++) cur_playlist[i][0]=32; @@ -397,12 +396,9 @@ const char *get_next_music_from_playlist() } while (step); playing_track=i; - snprintf(d,sizeof(d),"%s%s",pathtable[SR_MUSIC],cur_playlist[i]+1); + const char *d = build_pathname(2, gpathtable[SR_MUSIC], cur_playlist[i]+1); if (!check_file_exists(d)) { - snprintf(d,sizeof(d),"%s%s",pathtable[SR_ORGMUSIC],cur_playlist[i]+1); - if (!check_file_exists(d)) { - return NULL; - } + return NULL; } cur_playlist[i][0]=33; remain_play--; diff --git a/game/souboje.c b/game/souboje.c index bb526a5..1480d6f 100644 --- a/game/souboje.c +++ b/game/souboje.c @@ -1,17 +1,18 @@ -#include -#include +#include + #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include + #include -#include +#include #include #include "globals.h" +#include #define PRG_COLOR RGB555(0,31,31) #define PRG_HELP_COLOR RGB555(31,31,0) diff --git a/game/specproc.c b/game/specproc.c index d21fe35..b99e131 100644 --- a/game/specproc.c +++ b/game/specproc.c @@ -1,13 +1,13 @@ //Toto je hlavni soubor specialnich procedur pro hru BRANY SKELDALU -#include +#include #include #include -#include -#include -#include "bgraph.h" +#include +#include +#include #include "globals.h" #include "specproc.h" -#include "bmouse.h" +#include #include //#include "i86.h" diff --git a/game/transav.c b/game/transav.c index cef9598..bf8ac18 100644 --- a/game/transav.c +++ b/game/transav.c @@ -1,9 +1,9 @@ #include #include #include -#include + #include -#include + #define EVENT_MSG int32_t #include "globals.h" #include diff --git a/game/wizard.c b/game/wizard.c index 59ebe3e..b126279 100644 --- a/game/wizard.c +++ b/game/wizard.c @@ -1,21 +1,21 @@ -#include -#include +#include + #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include "globals.h" diff --git a/insteng/SETUP.C b/insteng/SETUP.C index b0ce098..e15408c 100644 --- a/insteng/SETUP.C +++ b/insteng/SETUP.C @@ -1,29 +1,29 @@ #include -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include "setup.h" #include "setvideo.h" #include "setuplib.h" diff --git a/insteng/SETUPCPY.C b/insteng/SETUPCPY.C index eebedaf..993be65 100644 --- a/insteng/SETUPCPY.C +++ b/insteng/SETUPCPY.C @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "setupcpy.h" diff --git a/insteng/SETUPLIB.C b/insteng/SETUPLIB.C index 2748535..e8e56c6 100644 --- a/insteng/SETUPLIB.C +++ b/insteng/SETUPLIB.C @@ -1,20 +1,20 @@ -#include +#include #include #include #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include "setuplib.h" #include "setupcpy.h" #include "setup.h" diff --git a/insteng/SETVIDEO.C b/insteng/SETVIDEO.C index 359c20e..f04bf9c 100644 --- a/insteng/SETVIDEO.C +++ b/insteng/SETVIDEO.C @@ -1,14 +1,14 @@ -#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "setup.h" diff --git a/libs/basicobj.c b/libs/basicobj.c index 180f69d..9de93e1 100644 --- a/libs/basicobj.c +++ b/libs/basicobj.c @@ -1,9 +1,8 @@ -#include +#include // toto je include soubor, jenz je pouzit v knihovne GUI.C #include "types.h" #include -#include #include #include #include "memman.h" @@ -14,6 +13,7 @@ #include "gui.h" #include "basicobj.h" #include +#include #define MEMTEXT "Pam�t: " diff --git a/libs/bgraph.c b/libs/bgraph.c index 766b6c2..616755a 100644 --- a/libs/bgraph.c +++ b/libs/bgraph.c @@ -2,7 +2,7 @@ //#include #include #include -#include + #include #include #include @@ -35,7 +35,7 @@ void position(word x,word y) writepos=getadr32(x,y); } -void outtext(char *text) +void outtext(const char *text) { byte pos; diff --git a/libs/bgraph.h b/libs/bgraph.h index d958aa8..e2a04b1 100644 --- a/libs/bgraph.h +++ b/libs/bgraph.h @@ -97,7 +97,7 @@ void redrawbox16(word xs,word ys,void *screen,void *lbuffer,byte *xlat); void showview32(word x,word y,word xs,word ys); void showview256(word x,word y,word xs,word ys); void showview_lo(word x,word y,word xs,word ys); -void outtext(char *text); +void outtext(const char *text); int initmode_dx(char inwindow, char zoom, char monitor, int refresh); int initmode32(void); int initmode32b(void); @@ -111,7 +111,6 @@ void *create_hixlat(void); void closemode(void); void line32(word x1,word y1, word x2, word y2); void position(word x,word y); -void outtext(char *text); void show_ms_cursor(integer x,integer y); void *register_ms_cursor(void *cursor); void move_ms_cursor(integer newx,integer newy,char nodraw); diff --git a/libs/bgraph2.c b/libs/bgraph2.c index 8261077..9ca240c 100644 --- a/libs/bgraph2.c +++ b/libs/bgraph2.c @@ -1,13 +1,8 @@ -#include +#include #include "types.h" -//#include -//#include -//#include -#include #include #include #include -//#include #include "bgraph.h" #include "memman.h" @@ -55,7 +50,7 @@ void rel_position_x(word x) } -void outtext(char *text) +void outtext(const char *text) { byte pos; diff --git a/libs/bgraph2a.c b/libs/bgraph2a.c index 63fe478..8f96ec1 100644 --- a/libs/bgraph2a.c +++ b/libs/bgraph2a.c @@ -1,4 +1,4 @@ -#include +#include #include "types.h" #include "bgraph.h" diff --git a/libs/bgraph2a.cpp b/libs/bgraph2a.cpp index b9e0001..f5eff44 100644 --- a/libs/bgraph2a.cpp +++ b/libs/bgraph2a.cpp @@ -1,4 +1,4 @@ -#include +#include #include "types.h" #include "bgraph.h" #include diff --git a/libs/bldicons.c b/libs/bldicons.c index 84e8a26..c3930c8 100644 --- a/libs/bldicons.c +++ b/libs/bldicons.c @@ -1,6 +1,6 @@ #include #include -#include + #include "memman.h" #include "pcx.h" diff --git a/libs/bmouse.c b/libs/bmouse.c index 80d6396..b269ca3 100644 --- a/libs/bmouse.c +++ b/libs/bmouse.c @@ -1,4 +1,4 @@ -#include +#include #include "types.h" #include "bgraph.h" #include "event.h" diff --git a/libs/devices.c b/libs/devices.c index ae6ee8e..1479c81 100644 --- a/libs/devices.c +++ b/libs/devices.c @@ -1,7 +1,6 @@ -#include +#include #include "types.h" #include -#include #include "event.h" #include "devices.h" #include diff --git a/libs/engine1.c b/libs/engine1.c index a288c77..64b81cb 100644 --- a/libs/engine1.c +++ b/libs/engine1.c @@ -1,8 +1,8 @@ #include "types.h" #include #include -#include -#include + + #include "memman.h" #include "bgraph.h" diff --git a/libs/errtest.c b/libs/errtest.c index ce138cc..704feef 100644 --- a/libs/errtest.c +++ b/libs/errtest.c @@ -1,5 +1,5 @@ #include -#include + #include #include #include diff --git a/libs/event.c b/libs/event.c index 9187c75..5290ef7 100644 --- a/libs/event.c +++ b/libs/event.c @@ -1,19 +1,16 @@ -#include +#include #include #include #include "types.h" #include "event.h" #include "devices.h" -#include -//#include #include -#include -//#include #include #include "memman.h" #include #include #include +#include #define find_event_msg(where,what,res) \ diff --git a/libs/event.h b/libs/event.h index 5e28750..5efedad 100644 --- a/libs/event.h +++ b/libs/event.h @@ -133,7 +133,7 @@ static __inline void shift_message(EVENT_MSG *msg) { void do_events(void); void escape(void); -#include +#include /* void *task_sleep(void *param); //#pragma aux task_sleep parm [eax] value [eax] diff --git a/libs/expand.c b/libs/expand.c index 12572e9..0b9c729 100644 --- a/libs/expand.c +++ b/libs/expand.c @@ -1,6 +1,6 @@ #include #include -#include + #include "memman.h" void help() diff --git a/libs/fastload.c b/libs/fastload.c index 4b29fd7..8e9983c 100644 --- a/libs/fastload.c +++ b/libs/fastload.c @@ -1,5 +1,5 @@ #include -#include +#include #define LOAD_BUFFER 4096 diff --git a/libs/gui.c b/libs/gui.c index 5a36107..e1d17c9 100644 --- a/libs/gui.c +++ b/libs/gui.c @@ -1,8 +1,7 @@ -#include +#include //Gui system - object system + graphic #include "types.h" #include -#include #include #include "memman.h" #include "event.h" @@ -11,6 +10,7 @@ #include "bgraph.h" #include "gui.h" +#include #define E_REDRAW_DESKTOP 2010 #define E_REDRAW_WINDOW 2000 diff --git a/libs/inicfg.c b/libs/inicfg.c index 0d51eed..eec88f4 100644 --- a/libs/inicfg.c +++ b/libs/inicfg.c @@ -1,11 +1,11 @@ -#include +#include #include #include #include #include #include -#include -#include +#include +#include TSTR_LIST read_config(const char *filename) { diff --git a/libs/memman.c b/libs/memman.c index 3849178..0237079 100644 --- a/libs/memman.c +++ b/libs/memman.c @@ -1,6 +1,5 @@ -#include +#include #include "types.h" -#include #include #include #include @@ -9,6 +8,7 @@ //#include #include "swaper.c" #include +#include #include #include @@ -20,7 +20,7 @@ void bonz_table(); #define NON_GETMEM_RESERVED (4*1024) -char **mman_pathlist=NULL; +char *const* mman_pathlist=NULL; static char swap_status=0; static FILE *swap = NULL; @@ -34,6 +34,9 @@ void (*mman_action)(int action)=NULL; int32_t last_load_size; +void def_mman_group_table(char *const * p) { + mman_pathlist = p; +} void standard_mem_error(size_t size) { @@ -45,7 +48,7 @@ void standard_mem_error(size_t size) exit(1); } -void load_error(char *filename) +void load_error(const char *filename) { char buff[256]; SEND_LOG("(ERROR) Load error detected, system can't load file: %s",filename); @@ -93,7 +96,7 @@ void *getmem(int32_t size) } -void *load_file(char *filename) +void *load_file(const char *filename) { FILE *f; int32_t *p; @@ -372,7 +375,7 @@ THANDLE_DATA *zneplatnit_block(int handle) return h; } -void init_manager(char *filename,char *swap_is_not_supported) // filename= Jmeno datoveho souboru nebo NULL pak +void init_manager(const char *filename,const char *swap_is_not_supported) // filename= Jmeno datoveho souboru nebo NULL pak // se pouzije DOS // swp je cesta do TEMP adresare { diff --git a/libs/memman.h b/libs/memman.h index 4b28529..2875144 100644 --- a/libs/memman.h +++ b/libs/memman.h @@ -66,15 +66,16 @@ typedef handle_list *handle_groups[BK_MAJOR_HANDLES]; #define BK_PRELOAD 8 #define BK_HSWAP 16 -extern char **mman_pathlist; //tento pointer musi byt naplnen ukazatelem na tabulku cest +extern char *const * mman_pathlist; //tento pointer musi byt naplnen ukazatelem na tabulku cest extern void (*mem_error)(size_t); //pokud neni NULL je tato funkce volana vzdy kdyz dojde pamet a system si s tim nevi rady extern void (*swap_error)(void); extern int memman_handle; //cislo handle naposled zpracovavaneho prikazem ablock extern char mman_patch; //jednicka zapina moznost pouziti patchu void *getmem(int32_t size); //alokace pameti pres memman. alokovat pomoci malloc lze ale hrozi nebezpeci ze vrati NULL void *grealloc(void *m,int32_t size); //realokace pameti pres memman -void *load_file(char *filename); //obycejne natahne soubor do pameti a vrati ukazatel. -void init_manager(char *filename,char *swp); //inicializuje manager. Jmeno filename i swapname nejsou povinne (musi byt NULL kdyz nejsou pouzity) +void *load_file(const char *filename); //obycejne natahne soubor do pameti a vrati ukazatel. +void init_manager(const char *filename,const char *swp); //inicializuje manager. Jmeno filename i swapname nejsou povinne (musi byt NULL kdyz nejsou pouzity) +void def_mman_group_table( char *const * ); //define pointer to table of paths, for each group there is path THANDLE_DATA *def_handle(int handle,const char *filename,void *decompress,char path); //deklaruje rukojet. promenna decompress je ukazatel na funkci ktera upravi data pred vracenim ukazatele void *ablock(int handle); //vraci ukazatel bloku spojeneho s handlem void alock(int handle); //zamyka blok diff --git a/libs/mgfplay.c b/libs/mgfplay.c index 901e844..e8d6107 100644 --- a/libs/mgfplay.c +++ b/libs/mgfplay.c @@ -1,4 +1,4 @@ -#include +#include // MOTION GIF - LZW komprimovana animace v rozliseni 320x180 256 barev avsak // upravena pro prehravani v HICOLOR pro konkretni rezim (32768 barev) @@ -65,17 +65,17 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include + +#include + //#include //#include #include -#include -#include +#include +#include //#include //#include #include diff --git a/libs/mgfplay.h b/libs/mgfplay.h index 76a2d48..9f5b218 100644 --- a/libs/mgfplay.h +++ b/libs/mgfplay.h @@ -2,6 +2,6 @@ #define SMD_HICOLOR 2 #define SMD_256_FULL (1+128) #define SMD_HICOLOR_FULL (2+128) -void play_animation(char *filename,char mode,int posy,char sound); +void play_animation(const char *filename,char mode,int posy,char sound); void set_title_list(char **titles); void set_play_attribs(void *screen,char rdraw,char bm,char colr64); diff --git a/libs/mgifmapmem.c b/libs/mgifmapmem.c index 4cab8ba..499c485 100644 --- a/libs/mgifmapmem.c +++ b/libs/mgifmapmem.c @@ -1,11 +1,11 @@ -#include -#include +#include +#include #include #include "types.h" #include "memman.h" #include "mem.h" #include "mgifmem.h" -#include +#include static MGIF_HEADER_T *mgif_header; @@ -186,7 +186,7 @@ void BigPlayProc(int act,void *data,int csize) } } -void play_animation(char *filename,char mode,int posy,char sound) +void play_animation(const char *filename,char mode,int posy,char sound) { size_t sz; void *mgf=map_file_to_memory(filename, &sz); diff --git a/libs/mgifmem.c b/libs/mgifmem.c index 67dc03f..84bd6d2 100644 --- a/libs/mgifmem.c +++ b/libs/mgifmem.c @@ -1,4 +1,4 @@ -#include +#include #include #include "types.h" #include "memman.h" diff --git a/libs/mgifplaya.c b/libs/mgifplaya.c index ffd8d26..78a9efa 100644 --- a/libs/mgifplaya.c +++ b/libs/mgifplaya.c @@ -1,7 +1,7 @@ -#include +#include #include "types.h" -#include -#include +#include +#include #include diff --git a/libs/pcx.c b/libs/pcx.c index 44e8add..c1822ad 100644 --- a/libs/pcx.c +++ b/libs/pcx.c @@ -1,13 +1,11 @@ -#include +#include #include -#include #include -/*#include "..\types.h"*/ #include "pcx.h" #include "memman.h" #include -/*#include "..\bgraph.h"*/ +#include #define SHADE_STEPS 5 #define SHADE_PAL (SHADE_STEPS*512*2) @@ -179,7 +177,7 @@ int load_pcx(char *pcx,int32_t fsize,int conv_type,char **buffer, ... ) } -int open_pcx(char *filename,int type,char **buffer,...) +int open_pcx(const char *filename,int type,char **buffer,...) { FILE *pcx; char *src; diff --git a/libs/pcx.h b/libs/pcx.h index 2e5f815..5776b67 100644 --- a/libs/pcx.h +++ b/libs/pcx.h @@ -32,7 +32,7 @@ extern "C" { //returns <0 error, >0 allocated size int load_pcx(char *pcx,int32_t fsize,int conv_type,char **buffer, ... ); -int open_pcx(char *filename,int type,char **buffer,...); +int open_pcx(const char *filename,int type,char **buffer,...); void palette_shadow(char *pal1,unsigned short pal2[][256],int tr,int tg,int tb); extern void *get_palette_ptr; diff --git a/libs/readfont.c b/libs/readfont.c index 5707f50..d25fcd6 100644 --- a/libs/readfont.c +++ b/libs/readfont.c @@ -1,6 +1,6 @@ -#include +#include #include -#include + #include "types.h" #include "pcx.h" #include "memman.h" diff --git a/libs/strlists.c b/libs/strlists.c index e2742e1..f1fb0d5 100644 --- a/libs/strlists.c +++ b/libs/strlists.c @@ -1,4 +1,4 @@ -#include +#include #include "strlite.c" #include "devices.h" diff --git a/libs/strlite.c b/libs/strlite.c index 58530ab..70dc25c 100644 --- a/libs/strlite.c +++ b/libs/strlite.c @@ -1,12 +1,12 @@ -#include +#include #include "strlite.h" #include #include -#include #include #include "types.h" #include "memman.h" +#include TSTR_LIST create_list(int count) { TSTR_LIST p; diff --git a/libs/wav.c b/libs/wav.c index 80dd086..a50ca63 100644 --- a/libs/wav.c +++ b/libs/wav.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/libs/zvuk.c b/libs/zvuk.c index 126d065..bd4e72b 100644 --- a/libs/zvuk.c +++ b/libs/zvuk.c @@ -3,8 +3,8 @@ //#include //#include -#include -#include + + #include "zvuk.h" //#include "pcspeak.h" diff --git a/libs/zvuk_dx.cpp b/libs/zvuk_dx.cpp index fe73453..d44ce79 100644 --- a/libs/zvuk_dx.cpp +++ b/libs/zvuk_dx.cpp @@ -1,5 +1,5 @@ #define INITGUID -#include +#include #include #include #include @@ -9,7 +9,7 @@ #include "zvuk.h" #include extern "C" { -#include +#include } #define MAXCHANNELS 32 #define TIMEIDLESTOPCHANNEL 250 diff --git a/platform/bios.h b/platform/bios.h deleted file mode 100644 index 8b13789..0000000 --- a/platform/bios.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/platform/config.cpp b/platform/config.cpp index b6fda2a..9b459d0 100644 --- a/platform/config.cpp +++ b/platform/config.cpp @@ -66,7 +66,7 @@ INI_CONFIG* ini_open(const char *filename) { return c; } -void ini_close(const INI_CONFIG *config) { +void ini_close(INI_CONFIG *config) { delete config; } diff --git a/platform/file_access.cpp b/platform/file_access.cpp index 8820751..b4d531b 100644 --- a/platform/file_access.cpp +++ b/platform/file_access.cpp @@ -1,4 +1,6 @@ #include "platform.h" + +#include #include @@ -62,3 +64,23 @@ FILE *fopen_icase(const char *pathname, const char *mode) { std::filesystem::path path = try_to_find_file(convert_pathname_to_path(pathname)); return fopen(path.c_str(), mode); } + +static thread_local std::string build_pathname_buffer; + +const char * build_pathname(size_t nparts, const char *part1, ...) { + va_list lst; + va_start(lst, part1); + + std::filesystem::path p = part1; + for (size_t i = 1; i < nparts; ++i) { + p = p / va_arg(lst, const char *); + } + build_pathname_buffer = p; + return build_pathname_buffer.c_str(); +} + +char create_directories(const char *path) { + std::filesystem::path p(path); + std::error_code ec; + return std::filesystem::create_directories(p, ec)?1:0; +} diff --git a/platform/legacy_coroutines.h b/platform/legacy_coroutines.h index 8336f66..ae42145 100644 --- a/platform/legacy_coroutines.h +++ b/platform/legacy_coroutines.h @@ -8,7 +8,7 @@ extern "C" { #endif -#include +#include typedef void (*TaskerFunctionName)(va_list); diff --git a/platform/platform.h b/platform/platform.h index 7e05ee9..c7a3865 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -7,7 +7,7 @@ #define BGSWITCHBIT 0x0020 -#define SKELDALINI "wskeldal.ini" +#define SKELDALINI "skeldal.ini" #ifdef __cplusplus extern "C" @@ -27,6 +27,21 @@ uint32_t _bios_keybrd(int mode); #define RGB555(r,g,b) ((unsigned short)(((r)<<11) | ((g)<<6) | (b))) +///build pathname from parts +/** + * @param nparts count of parts (must be > 0) + * @param part first part + * @return complete path - statically allocated buffer + */ +const char * build_pathname(size_t nparts, const char *part1, ...); +///creates directories recursively +/** + * @param path path + * @retval 1 success + * @retval 0 failure + */ +char create_directories(const char *path); + void *map_file_to_memory(const char *name, size_t *sz); diff --git a/platform/sdl/input.h b/platform/sdl/input.h index f2d1cd8..7538c0d 100644 --- a/platform/sdl/input.h +++ b/platform/sdl/input.h @@ -13,7 +13,7 @@ extern "C" { #endif -#include +#include char get_control_key_state(void); diff --git a/platform/sdl/sdl_context.h b/platform/sdl/sdl_context.h index 6af3f0d..bce774e 100644 --- a/platform/sdl/sdl_context.h +++ b/platform/sdl/sdl_context.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include diff --git a/platform/sdl/sound.cpp b/platform/sdl/sound.cpp index 367e815..8056cc2 100644 --- a/platform/sdl/sound.cpp +++ b/platform/sdl/sound.cpp @@ -1,5 +1,5 @@ #include "../platform.h" -#include +#include #include void set_mixing_device(int mix_dev,int mix_freq,...) {