mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-09-02 02:25:59 -04:00
improve communication with editor (windows side)
This commit is contained in:
parent
4ed39ec344
commit
b33fb43d78
11 changed files with 76 additions and 24 deletions
|
@ -756,7 +756,7 @@ void a_touch(int sector,int dir);
|
|||
int do_action(int action_numb,int sector,int direct,int flags,int nosend);
|
||||
void delay_action(int action_numb,int sector,int direct,int flags,int nosend,int delay);
|
||||
//int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size);
|
||||
uint32_t load_section_mem(TMPFILE_RD *f,const void **section, int *sct_type,uint32_t *sect_size);
|
||||
int32_t load_section_mem(TMPFILE_RD *f,const void **section, int *sct_type,uint32_t *sect_size);
|
||||
TMPFILE_RD *open_ddl_file(const char *name, int group);
|
||||
int prepare_graphics(int *ofs,const char *names,int32_t size,ABLOCK_DECODEPROC decomp,int cls);
|
||||
void show_automap(char full);
|
||||
|
@ -1229,7 +1229,7 @@ typedef struct tma_fireball
|
|||
|
||||
typedef struct tma_loadlev
|
||||
{
|
||||
uint8_t action,flags,eflags; //3+padding
|
||||
uint8_t action,flags,lflags; //3+padding
|
||||
short start_pos; //6
|
||||
char dir; //7
|
||||
char name[13];
|
||||
|
|
|
@ -118,7 +118,7 @@ int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size)
|
|||
}
|
||||
*/
|
||||
|
||||
uint32_t load_section_mem(TMPFILE_RD *f,const void **section, int *sct_type,uint32_t *sect_size) {
|
||||
int32_t load_section_mem(TMPFILE_RD *f,const void **section, int *sct_type,uint32_t *sect_size) {
|
||||
uint32_t s;
|
||||
char c[20];
|
||||
|
||||
|
@ -284,8 +284,8 @@ int load_map(const char *filename)
|
|||
if (f==NULL) return -1;
|
||||
do
|
||||
{
|
||||
uint32_t r=load_section_mem(f,&temp,§,&size);
|
||||
if (r==size)
|
||||
int32_t r=load_section_mem(f,&temp,§,&size);
|
||||
if (r==(int32_t)size)
|
||||
switch (sect)
|
||||
{
|
||||
case A_SIDEMAP:
|
||||
|
|
|
@ -898,7 +898,7 @@ void init_DDL_manager() {
|
|||
display_error("Can't open resource file (main): %s", ddlfile);
|
||||
abort();
|
||||
}
|
||||
for (size_t i = 0; i <= countof(patch_files); ++i) {
|
||||
for (size_t i = 0; i < countof(patch_files); ++i) {
|
||||
if (patch_files[i]) {
|
||||
if (!add_patch_file(patch_files[i])) {
|
||||
display_error("Can't open resource file (adv_patch): %s", patch_files[i]);
|
||||
|
@ -970,7 +970,12 @@ void sse_listener_watch(EVENT_MSG *msg, void **userdata) {
|
|||
if (msg->msg == E_WATCH) {
|
||||
const char *s = sse_receiver_receive(sse_receiver);
|
||||
if (s) {
|
||||
send_message(E_EXTERNAL_MSG, s);
|
||||
if (strcmp(s,"STOP") == 0) {
|
||||
closemode();
|
||||
exit(0);
|
||||
} else {
|
||||
send_message(E_EXTERNAL_MSG, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1072,8 +1077,6 @@ void init_skeldal(const INI_CONFIG *cfg)
|
|||
|
||||
load_shops();
|
||||
memset(&loadlevel,0,sizeof(loadlevel));
|
||||
loadlevel.eflags = 0xFF;
|
||||
|
||||
}
|
||||
|
||||
void wire_main_functs();
|
||||
|
@ -1130,29 +1133,35 @@ extern char running_battle;
|
|||
const char *m = va_arg(msg->data, const char *);
|
||||
char fname[13];
|
||||
int sector;
|
||||
int side;
|
||||
int i;
|
||||
|
||||
if (sscanf(m, "RELOAD %12s %d", fname, §or) == 2) {
|
||||
if (sscanf(m, "RELOAD %12s %d %d", fname, §or, &side) == 3) {
|
||||
|
||||
reload_ddls();
|
||||
strcopy_n(loadlevel.name,fname,sizeof(loadlevel.name));
|
||||
loadlevel.start_pos=sector;
|
||||
loadlevel.start_pos=sector;
|
||||
loadlevel.dir = side;
|
||||
for(i=0;i<POCET_POSTAV;i++) if (postavy[i].used) {
|
||||
postavy[i].sektor=loadlevel.start_pos;
|
||||
postavy[i].direction=loadlevel.dir;
|
||||
postavy[i].groupnum = 1;
|
||||
}
|
||||
SEND_LOG("(WIZARD) Load map '%s' %d",loadlevel.name,loadlevel.start_pos);
|
||||
SEND_LOG("(WIZARD) Load map '%s' %d %d",loadlevel.name,loadlevel.start_pos, loadlevel.dir);
|
||||
unwire_proc();
|
||||
if (battle) konec_kola();
|
||||
battle=0;
|
||||
running_battle=0;
|
||||
doNotLoadMapState=1;
|
||||
hl_ptr=ikon_libs;
|
||||
destroy_fly_map();
|
||||
load_items();
|
||||
zneplatnit_block(H_ENEMY);
|
||||
zneplatnit_block(H_SHOP_PIC);
|
||||
zneplatnit_block(H_DIALOGY_DAT);
|
||||
battle=0;
|
||||
running_battle=0;
|
||||
doNotLoadMapState=1;
|
||||
hl_ptr=ikon_libs;
|
||||
destroy_fly_map();
|
||||
load_items();
|
||||
zneplatnit_block(H_ENEMY);
|
||||
zneplatnit_block(H_SHOP_PIC);
|
||||
zneplatnit_block(H_DIALOGY_DAT);
|
||||
load_shops();
|
||||
autosave_on_enter = 0;
|
||||
game_display_focus();
|
||||
send_message(E_CLOSE_MAP);
|
||||
} else if (strncmp(m, "MESSAGE ", 8) == 0) {
|
||||
bott_disp_text(m+8);
|
||||
|
@ -1182,8 +1191,8 @@ void enter_game(void)
|
|||
|
||||
send_message(E_ADD,E_RELOADMAP,reload_map_handler);
|
||||
{
|
||||
EVENT_MSG *msg = task_wait_event(E_CLOSE_MAP);
|
||||
end = va_arg(msg->data, int);
|
||||
EVENT_MSG *msg = task_wait_event(E_CLOSE_MAP);
|
||||
end = msg != NULL?va_arg(msg->data, int):0;
|
||||
}
|
||||
send_message(E_DONE,E_RELOADMAP,reload_map_handler);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue