mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-05 14:10:27 -04:00
fix many warnings (hope everything will work)
This commit is contained in:
parent
cddb569580
commit
858c4384e8
57 changed files with 911 additions and 807 deletions
|
@ -4,6 +4,13 @@ project(skeldal)
|
||||||
# Najít SDL2 knihovnu
|
# Najít SDL2 knihovnu
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
add_compile_options(/W4 /EHsc /DNOMINMAX)
|
||||||
|
set(STANDARD_LIBRARIES "")
|
||||||
|
else()
|
||||||
|
add_compile_options(-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-value)
|
||||||
|
set(STANDARD_LIBRARIES "pthread")
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories(platform libs)
|
include_directories(platform libs)
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ static char check_for_layer(int layer)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ukaz_vsechny_texty_v_mape()
|
void ukaz_vsechny_texty_v_mape(void)
|
||||||
{
|
{
|
||||||
int x,y,d,i,cn;
|
int x,y,d,i,cn;
|
||||||
char *c;
|
char *c;
|
||||||
|
@ -172,7 +172,7 @@ void ukaz_vsechny_texty_v_mape()
|
||||||
x=x-map_xr;
|
x=x-map_xr;
|
||||||
y=y-map_yr;
|
y=y-map_yr;
|
||||||
x+=320;y+=197;
|
x+=320;y+=197;
|
||||||
if (d==cur_depth)
|
if (d==cur_depth) {
|
||||||
if (testclip(x,y))
|
if (testclip(x,y))
|
||||||
{
|
{
|
||||||
int h;char *d,e;
|
int h;char *d,e;
|
||||||
|
@ -185,7 +185,7 @@ void ukaz_vsechny_texty_v_mape()
|
||||||
position(x,y);outtext(c);
|
position(x,y);outtext(c);
|
||||||
*d=e;
|
*d=e;
|
||||||
}
|
}
|
||||||
else if(x<8 && x+text_width(c)>10 && y>16 && y<376)
|
else if(x<8 && (x+text_width(c)>10) && y>16 && y<376)
|
||||||
{
|
{
|
||||||
char cd[2]=" ";
|
char cd[2]=" ";
|
||||||
while (x<10 && *c)
|
while (x<10 && *c)
|
||||||
|
@ -195,13 +195,14 @@ void ukaz_vsechny_texty_v_mape()
|
||||||
position(x,y);outtext(c);
|
position(x,y);outtext(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void psani_poznamek_event(EVENT_MSG *msg,void **data)
|
void psani_poznamek_event(EVENT_MSG *msg,void **data)
|
||||||
{
|
{
|
||||||
static int x,y;
|
static int x,y, index;
|
||||||
static char text[255],index;
|
static char text[255];
|
||||||
static char *save;
|
static char *save;
|
||||||
static void *save_pic=NULL;
|
static void *save_pic=NULL;
|
||||||
|
|
||||||
|
@ -515,8 +516,8 @@ void draw_automap(int xr,int yr)
|
||||||
{
|
{
|
||||||
int i,k,x,y,xp,yp;
|
int i,k,x,y,xp,yp;
|
||||||
int depth;
|
int depth;
|
||||||
TSTENA *q;
|
// TSTENA *q;
|
||||||
word *s;
|
//word *s;
|
||||||
|
|
||||||
update_mysky();
|
update_mysky();
|
||||||
schovej_mysku();
|
schovej_mysku();
|
||||||
|
@ -535,8 +536,8 @@ void draw_automap(int xr,int yr)
|
||||||
{
|
{
|
||||||
x=(map_coord[i].x*8+xr*8);
|
x=(map_coord[i].x*8+xr*8);
|
||||||
y=(map_coord[i].y*8+yr*8);
|
y=(map_coord[i].y*8+yr*8);
|
||||||
q=map_sides+(i*4);
|
// q=map_sides+(i*4);
|
||||||
s=map_sectors[i].step_next;
|
// s=map_sectors[i].step_next;
|
||||||
x-=xp;y-=yp;
|
x-=xp;y-=yp;
|
||||||
if (y>=-178 && y<170 && x>=-312 && x<310)
|
if (y>=-178 && y<170 && x>=-312 && x<310)
|
||||||
{
|
{
|
||||||
|
@ -550,9 +551,10 @@ void draw_automap(int xr,int yr)
|
||||||
for(j=0;j<POCET_POSTAV;j++)
|
for(j=0;j<POCET_POSTAV;j++)
|
||||||
{
|
{
|
||||||
if (postavy[j].used)
|
if (postavy[j].used)
|
||||||
if (postavy[j].sektor==i)
|
if (postavy[j].sektor==i) {
|
||||||
if (postavy[j].groupnum==cur_group) break;
|
if (postavy[j].groupnum==cur_group) break;
|
||||||
else l=j;
|
l=j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (j==POCET_POSTAV) j=l;
|
if (j==POCET_POSTAV) j=l;
|
||||||
if (j!=-1)
|
if (j!=-1)
|
||||||
|
@ -596,7 +598,7 @@ void disable_all_map(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void unwire_automap()
|
void unwire_automap(void)
|
||||||
{
|
{
|
||||||
send_message(E_DONE,E_KEYBOARD,map_keyboard);
|
send_message(E_DONE,E_KEYBOARD,map_keyboard);
|
||||||
send_message(E_DONE,E_AUTOMAP_REDRAW,map_keyboard);
|
send_message(E_DONE,E_AUTOMAP_REDRAW,map_keyboard);
|
||||||
|
@ -683,7 +685,7 @@ static char mob_not_invis(int sector)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_medium_map()
|
void draw_medium_map(void)
|
||||||
{
|
{
|
||||||
int xr, yr;
|
int xr, yr;
|
||||||
int xp, yp;
|
int xp, yp;
|
||||||
|
@ -721,8 +723,9 @@ void draw_medium_map()
|
||||||
{
|
{
|
||||||
int u=-1,z=-1;
|
int u=-1,z=-1;
|
||||||
for(k=0;k<POCET_POSTAV;k++)
|
for(k=0;k<POCET_POSTAV;k++)
|
||||||
if (postavy[k].sektor==i)
|
if (postavy[k].sektor==i) {
|
||||||
if (postavy[k].groupnum==cur_group) z=k;else u=k;
|
if (postavy[k].groupnum==cur_group) z=k;else u=k;
|
||||||
|
}
|
||||||
if (z!=-1) u=z;
|
if (z!=-1) u=z;
|
||||||
if (u!=-1)
|
if (u!=-1)
|
||||||
{
|
{
|
||||||
|
@ -753,7 +756,7 @@ char map_menu_glob_map(int id,int xa,int ya,int xr,int yr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void wire_glob_map_control()
|
static void wire_glob_map_control(void)
|
||||||
{
|
{
|
||||||
set_select_mode(0);
|
set_select_mode(0);
|
||||||
schovej_mysku();
|
schovej_mysku();
|
||||||
|
@ -849,14 +852,14 @@ T_CLK_MAP clk_kniha[]=
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void unwire_kniha()
|
void unwire_kniha(void)
|
||||||
{
|
{
|
||||||
hold_timer(TM_FAST_TIMER,0);
|
hold_timer(TM_FAST_TIMER,0);
|
||||||
GlobEvent(MAGLOB_AFTERBOOK,viewsector,viewdir);
|
GlobEvent(MAGLOB_AFTERBOOK,viewsector,viewdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wire_kniha()
|
void wire_kniha(void)
|
||||||
{
|
{
|
||||||
int xa;
|
int xa;
|
||||||
if (!GlobEvent(MAGLOB_BEFOREBOOK,viewsector,viewdir))
|
if (!GlobEvent(MAGLOB_BEFOREBOOK,viewsector,viewdir))
|
||||||
|
@ -935,7 +938,7 @@ char map_target_select(int id,int xa,int ya,int xr,int yr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int select_teleport_target()
|
int select_teleport_target(void)
|
||||||
{
|
{
|
||||||
*otevri_zavoru=1;
|
*otevri_zavoru=1;
|
||||||
unwire_proc();
|
unwire_proc();
|
||||||
|
|
218
game/builder.c
218
game/builder.c
|
@ -82,7 +82,7 @@ static int showruneitem=0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char dirs[10];
|
uint8_t dirs[10];
|
||||||
word minimap[VIEW3D_Z+1][VIEW3D_X*2+1];
|
word minimap[VIEW3D_Z+1][VIEW3D_X*2+1];
|
||||||
|
|
||||||
|
|
||||||
|
@ -468,11 +468,13 @@ static void MaskPutPicture(int x, int y, char mask, word color, char blend, void
|
||||||
if (blend) color=color & 0xF7DE;
|
if (blend) color=color & 0xF7DE;
|
||||||
for (y=0;y<info[1];y++,pos+=scr_linelen2,data+=info[0])
|
for (y=0;y<info[1];y++,pos+=scr_linelen2,data+=info[0])
|
||||||
for (x=0;x<info[0];x++)
|
for (x=0;x<info[0];x++)
|
||||||
if (data[x]==mask)
|
if (data[x]==mask) {
|
||||||
if (blend)
|
if (blend) {
|
||||||
pos[x]=((pos[x] & 0xF7DE)+color)>>1;
|
pos[x]=((pos[x] & 0xF7DE)+color)>>1;
|
||||||
else
|
} else {
|
||||||
pos[x]=color;
|
pos[x]=color;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -643,11 +645,11 @@ int fc_num(int anim_counter,int sector,char floor)
|
||||||
}
|
}
|
||||||
|
|
||||||
int enter_tab[VIEW3D_Z+1][VIEW3D_X*2+1]=
|
int enter_tab[VIEW3D_Z+1][VIEW3D_X*2+1]=
|
||||||
{4,3,3,3,3,3,3,3,4,
|
{{4,3,3,3,3,3,3,3,4},
|
||||||
4,3,3,2,3,2,3,3,4,
|
{4,3,3,2,3,2,3,3,4},
|
||||||
4,3,3,2,4,2,3,3,4,
|
{4,3,3,2,4,2,3,3,4},
|
||||||
4,3,1,1,4,1,1,3,4,
|
{4,3,1,1,4,1,1,3,4},
|
||||||
4,1,1,1,4,1,1,1,4};
|
{4,1,1,1,4,1,1,1,4}};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -708,7 +710,7 @@ void create_minimap(int sector, int smer)
|
||||||
crt_minimap_itr(sector,smer,VIEW3D_X,0,1);
|
crt_minimap_itr(sector,smer,VIEW3D_X,0,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const float Inv2=0.5;
|
|
||||||
static const float Snapper=3<<22;
|
static const float Snapper=3<<22;
|
||||||
|
|
||||||
static __inline int toInt( float fval )
|
static __inline int toInt( float fval )
|
||||||
|
@ -812,65 +814,109 @@ void draw_vyklenek(int celx,int cely,int sector,int dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int draw_basic_sector(int celx,int cely,int sector)
|
static int draw_basic_sector(int celx, int cely, int sector) {
|
||||||
{
|
TSTENA *w, *q;
|
||||||
TSTENA *w,*q;
|
int obl;
|
||||||
int obl;
|
|
||||||
|
|
||||||
w=&map_sides[sector*4];
|
w = &map_sides[sector * 4];
|
||||||
q=&w[dirs[1]];
|
q = &w[dirs[1]];
|
||||||
obl=GET_OBLOUK(q);
|
obl = GET_OBLOUK(q);
|
||||||
if (cely<VIEW3D_Z)
|
if (cely < VIEW3D_Z) {
|
||||||
{
|
if (q->flags & SD_LEFT_ARC && obl)
|
||||||
if (q->flags & SD_LEFT_ARC && obl)
|
show_cel2(celx, cely, ablock(num_ofsets[OBL_NUM] + obl), 0, 0, 1);
|
||||||
show_cel2(celx,cely,ablock(num_ofsets[OBL_NUM]+obl),0,0,1);
|
if (q->flags & SD_RIGHT_ARC && q->oblouk & 0x0f)
|
||||||
if (q->flags & SD_RIGHT_ARC && q->oblouk & 0x0f)
|
show_cel2(celx, cely, ablock(num_ofsets[OBL2_NUM] + obl), 0, 0, 2);
|
||||||
show_cel2(celx,cely,ablock(num_ofsets[OBL2_NUM]+obl),0,0,2);
|
if (q->flags & SD_PRIM_VIS && q->prim)
|
||||||
if (q->flags & SD_PRIM_VIS && q->prim)
|
show_cel2(celx, cely,
|
||||||
show_cel2(celx,cely,ablock(num_ofsets[MAIN_NUM]+q->prim+(q->prim_anim>>4)),0,0,1+(q->oblouk & SD_POSITION));
|
ablock(
|
||||||
if (q->flags & SD_SEC_VIS && q->sec)
|
num_ofsets[MAIN_NUM] + q->prim
|
||||||
if (q->side_tag & SD_SHIFTUP)
|
+ (q->prim_anim >> 4)), 0, 0,
|
||||||
{
|
1 + (q->oblouk & SD_POSITION));
|
||||||
if (cely!=0)
|
if (q->flags & SD_SEC_VIS && q->sec) {
|
||||||
show_cel2(celx,cely-1,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),0,0,1);
|
if (q->side_tag & SD_SHIFTUP) {
|
||||||
}
|
if (cely != 0) {
|
||||||
else
|
show_cel2(celx, cely - 1,
|
||||||
show_cel2(celx,cely,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),q->xsec<<1,q->ysec<<1,0);
|
ablock(
|
||||||
if (q->oblouk & 0x10)
|
num_ofsets[MAIN_NUM] + q->sec
|
||||||
draw_vyklenek(celx,cely,sector,dirs[1]);
|
+ (q->sec_anim >> 4)), 0, 0, 1);
|
||||||
}
|
}
|
||||||
if (celx<=0)
|
} else {
|
||||||
{
|
show_cel2(celx, cely,
|
||||||
q=&w[dirs[0]];
|
ablock(
|
||||||
if (left_shiftup)
|
num_ofsets[MAIN_NUM] + q->sec
|
||||||
show_cel(celx,cely,ablock(num_ofsets[LEFT_NUM]+left_shiftup),0,0,2),left_shiftup=0;
|
+ (q->sec_anim >> 4)), q->xsec << 1,
|
||||||
if (q->flags & SD_PRIM_VIS && q->prim)
|
q->ysec << 1, 0);
|
||||||
show_cel(-celx,cely,ablock(num_ofsets[LEFT_NUM]+q->prim+(q->prim_anim>>4)),0,0,2+(q->oblouk & SD_POSITION));
|
}
|
||||||
if (q->flags & SD_SEC_VIS && q->sec)
|
}
|
||||||
if (q->side_tag & SD_SHIFTUP)
|
if (q->oblouk & 0x10)
|
||||||
if (celx!=0) left_shiftup=q->sec+(q->sec_anim>>4);else left_shiftup=0;
|
draw_vyklenek(celx, cely, sector, dirs[1]);
|
||||||
else if (q->flags & SD_SPEC)
|
}
|
||||||
show_cel(celx,cely,ablock(num_ofsets[LEFT_NUM]+q->sec+(q->sec_anim>>4)),0,0,2);
|
if (celx <= 0) {
|
||||||
else
|
q = &w[dirs[0]];
|
||||||
show_cel(celx,cely,ablock(num_ofsets[LEFT_NUM]+q->sec+(q->sec_anim>>4)),q->xsec<<1,q->ysec<<1,0);
|
if (left_shiftup)
|
||||||
}
|
show_cel(celx, cely, ablock(num_ofsets[LEFT_NUM] + left_shiftup), 0,
|
||||||
if (celx>=0)
|
0, 2), left_shiftup = 0;
|
||||||
{
|
if (q->flags & SD_PRIM_VIS && q->prim)
|
||||||
q=&w[dirs[2]];
|
show_cel(-celx, cely,
|
||||||
if (right_shiftup)
|
ablock(
|
||||||
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+right_shiftup),0,0,3),right_shiftup=0;
|
num_ofsets[LEFT_NUM] + q->prim
|
||||||
if (q->flags & SD_PRIM_VIS && q->prim)
|
+ (q->prim_anim >> 4)), 0, 0,
|
||||||
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+q->prim+(q->prim_anim>>4)),0,0,3+(q->oblouk & SD_POSITION));
|
2 + (q->oblouk & SD_POSITION));
|
||||||
if (q->flags & SD_SEC_VIS && q->sec)
|
if (q->flags & SD_SEC_VIS && q->sec) {
|
||||||
if (q->side_tag & SD_SHIFTUP)
|
if (q->side_tag & SD_SHIFTUP) {
|
||||||
if (celx!=0) right_shiftup=q->sec+(q->sec_anim>>4);else right_shiftup=0;
|
if (celx != 0) {
|
||||||
else if (q->flags & SD_SPEC)
|
left_shiftup = q->sec + (q->sec_anim >> 4);
|
||||||
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+q->sec+(q->sec_anim>>4)),0,0,3);
|
} else {
|
||||||
else
|
left_shiftup = 0;
|
||||||
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+q->sec+(q->sec_anim>>4)),500-(q->xsec<<1),q->ysec<<1,1);
|
}
|
||||||
}
|
} else if (q->flags & SD_SPEC) {
|
||||||
return 0;
|
show_cel(celx, cely,
|
||||||
}
|
ablock(
|
||||||
|
num_ofsets[LEFT_NUM] + q->sec
|
||||||
|
+ (q->sec_anim >> 4)), 0, 0, 2);
|
||||||
|
} else {
|
||||||
|
show_cel(celx, cely,
|
||||||
|
ablock(
|
||||||
|
num_ofsets[LEFT_NUM] + q->sec
|
||||||
|
+ (q->sec_anim >> 4)), q->xsec << 1,
|
||||||
|
q->ysec << 1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (celx >= 0) {
|
||||||
|
q = &w[dirs[2]];
|
||||||
|
if (right_shiftup)
|
||||||
|
show_cel(celx, cely, ablock(num_ofsets[RIGHT_NUM] + right_shiftup),
|
||||||
|
0, 0, 3), right_shiftup = 0;
|
||||||
|
if (q->flags & SD_PRIM_VIS && q->prim)
|
||||||
|
show_cel(celx, cely,
|
||||||
|
ablock(
|
||||||
|
num_ofsets[RIGHT_NUM] + q->prim
|
||||||
|
+ (q->prim_anim >> 4)), 0, 0,
|
||||||
|
3 + (q->oblouk & SD_POSITION));
|
||||||
|
if (q->flags & SD_SEC_VIS && q->sec) {
|
||||||
|
if (q->side_tag & SD_SHIFTUP) {
|
||||||
|
if (celx != 0)
|
||||||
|
right_shiftup = q->sec + (q->sec_anim >> 4);
|
||||||
|
else
|
||||||
|
right_shiftup = 0;
|
||||||
|
} else if (q->flags & SD_SPEC) {
|
||||||
|
show_cel(celx, cely,
|
||||||
|
ablock(
|
||||||
|
num_ofsets[RIGHT_NUM] + q->sec
|
||||||
|
+ (q->sec_anim >> 4)), 0, 0, 3);
|
||||||
|
} else {
|
||||||
|
show_cel(celx, cely,
|
||||||
|
ablock(
|
||||||
|
num_ofsets[RIGHT_NUM] + q->sec
|
||||||
|
+ (q->sec_anim >> 4)),
|
||||||
|
500 - (q->xsec << 1), q->ysec << 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int draw_lodku(int celx,int cely)
|
static int draw_lodku(int celx,int cely)
|
||||||
{
|
{
|
||||||
|
@ -917,7 +963,7 @@ void draw_players(int sector,int dir,int celx,int cely)
|
||||||
if (pp==1 && freep[f] & 1)
|
if (pp==1 && freep[f] & 1)
|
||||||
{pp=f+1&3;freep[pp]=freep[f];freep[f]=0;}
|
{pp=f+1&3;freep[pp]=freep[f];freep[f]=0;}
|
||||||
for(i=0;i<5;i++)
|
for(i=0;i<5;i++)
|
||||||
if ((j=freep[d=p_place_table[0][i]])!=0)
|
if ((j=freep[d=p_place_table[0][i]])!=0) {
|
||||||
if (postavy[j-1].lives)
|
if (postavy[j-1].lives)
|
||||||
{
|
{
|
||||||
set_font(H_FLITT5,barvy_skupin[postavy[j-1].groupnum]);
|
set_font(H_FLITT5,barvy_skupin[postavy[j-1].groupnum]);
|
||||||
|
@ -925,6 +971,7 @@ void draw_players(int sector,int dir,int celx,int cely)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
draw_player(ablock(H_KOSTRA),celx,cely,p_positions_x[d],p_positions_y[d]-32,HUMAN_ADJUST,NULL);
|
draw_player(ablock(H_KOSTRA),celx,cely,p_positions_x[d],p_positions_y[d]-32,HUMAN_ADJUST,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -959,11 +1006,12 @@ int draw_sloup_sector(int celx,int cely,int sector)
|
||||||
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+q->prim+(q->prim_anim>>4)),0,0,3+(q->oblouk & SD_POSITION));
|
show_cel(celx,cely,ablock(num_ofsets[RIGHT_NUM]+q->prim+(q->prim_anim>>4)),0,0,3+(q->oblouk & SD_POSITION));
|
||||||
}
|
}
|
||||||
q=&w[dirs[1]];
|
q=&w[dirs[1]];
|
||||||
if (q->flags & SD_SEC_VIS && q->sec && cely!=0)
|
if (q->flags & SD_SEC_VIS && q->sec && cely!=0) {
|
||||||
if (q->flags & SD_SPEC)
|
if (q->flags & SD_SPEC)
|
||||||
show_cel2(celx,cely-1,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),0,0,2);
|
show_cel2(celx,cely-1,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),0,0,2);
|
||||||
else
|
else
|
||||||
show_cel2(celx,cely-1,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),(q->xsec<<1)+celx*(points[0][0][cely].x-points[0][0][cely-1].x)/2,q->ysec<<1,0);
|
show_cel2(celx,cely-1,ablock(num_ofsets[MAIN_NUM]+q->sec+(q->sec_anim>>4)),(q->xsec<<1)+celx*(points[0][0][cely].x-points[0][0][cely-1].x)/2,q->ysec<<1,0);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1026,18 +1074,22 @@ void back_clear(int celx,int color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char set_blind(void)
|
static char set_blind(void) {
|
||||||
{
|
int i;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (battle && postavy[select_player].sektor==viewsector) if (postavy[select_player].vlastnosti[VLS_KOUZLA] & SPL_BLIND) return 1;else return 0;
|
if (battle && postavy[select_player].sektor == viewsector) {
|
||||||
for(i=0;i<POCET_POSTAV;i++)
|
if (postavy[select_player].vlastnosti[VLS_KOUZLA] & SPL_BLIND)
|
||||||
{
|
return 1;
|
||||||
THUMAN *p=postavy+i;
|
else
|
||||||
if (p->sektor==viewsector && !(p->vlastnosti[VLS_KOUZLA] & SPL_BLIND)) return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
for (i = 0; i < POCET_POSTAV; i++) {
|
||||||
}
|
THUMAN *p = postavy + i;
|
||||||
|
if (p->sektor == viewsector && !(p->vlastnosti[VLS_KOUZLA] & SPL_BLIND))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
extern char folow_mode;
|
extern char folow_mode;
|
||||||
|
|
||||||
|
@ -1076,7 +1128,7 @@ skp: add edi,2h
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
static void trace_for_bgr(int dir)
|
static void trace_for_bgr(int dir)
|
||||||
{
|
{
|
||||||
int s,i;
|
int s,i;
|
||||||
|
@ -1112,7 +1164,7 @@ static void trace_for_bgr(int dir)
|
||||||
olddist=bgr_distance;
|
olddist=bgr_distance;
|
||||||
olddir=dir;
|
olddir=dir;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void render_scene(int sector, int smer)
|
void render_scene(int sector, int smer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,9 +97,9 @@ static T_VLASTS rohy[9]=
|
||||||
#define DIFF_RAND(x,y) ((x)+rnd((y)-(x)+1))
|
#define DIFF_RAND(x,y) ((x)+rnd((y)-(x)+1))
|
||||||
|
|
||||||
#define MAX_RACES 5
|
#define MAX_RACES 5
|
||||||
static char women[MAX_XICHTS]={0,0,0,0,1,1,1,1};
|
static uint8_t women[MAX_XICHTS]={0,0,0,0,1,1,1,1};
|
||||||
static char poradi[MAX_XICHTS]={0,2,3,4,1,5,6,7};
|
static uint8_t poradi[MAX_XICHTS]={0,2,3,4,1,5,6,7};
|
||||||
static char disable[MAX_XICHTS];
|
static uint8_t disable[MAX_XICHTS];
|
||||||
static int cur_edited=0;
|
static int cur_edited=0;
|
||||||
static int cur_angle=90;
|
static int cur_angle=90;
|
||||||
static int cur_polomer=0;
|
static int cur_polomer=0;
|
||||||
|
@ -303,7 +303,7 @@ static void zobraz_perlu(void)
|
||||||
scr=sss;
|
scr=sss;
|
||||||
for(xxs=0;xxs<xs;xxs++)
|
for(xxs=0;xxs<xs;xxs++)
|
||||||
if (!*p) scr++,p++;else
|
if (!*p) scr++,p++;else
|
||||||
if (*p<128) *scr++=b[*p++];else
|
if (*p<128) *scr++=b[(uint8_t)*p++];else
|
||||||
{
|
{
|
||||||
*scr=(*scr & RGB555(30,30,30))>>1;
|
*scr=(*scr & RGB555(30,30,30))>>1;
|
||||||
scr++;p++;
|
scr++;p++;
|
||||||
|
@ -325,13 +325,13 @@ static void vypocet_vlastnosti(int angle,T_VLASTS *vls)
|
||||||
{
|
{
|
||||||
T_VLASTS *low,*hi;
|
T_VLASTS *low,*hi;
|
||||||
div_t rm;
|
div_t rm;
|
||||||
int p,test;
|
int p;
|
||||||
|
|
||||||
rm=div(angle,45);
|
rm=div(angle,45);
|
||||||
p=rm.quot;
|
p=rm.quot;
|
||||||
low=rohy+p;p++;if (p>=8) p=0;
|
low=rohy+p;p++;if (p>=8) p=0;
|
||||||
hi=rohy+p;
|
hi=rohy+p;
|
||||||
test=CALC_DIFF(8,12,44);
|
// CALC_DIFF(8,12,44);
|
||||||
vls->sill=CALC_DIFF(low->sill,hi->sill,rm.rem);
|
vls->sill=CALC_DIFF(low->sill,hi->sill,rm.rem);
|
||||||
vls->silh=CALC_DIFF(low->silh,hi->silh,rm.rem);
|
vls->silh=CALC_DIFF(low->silh,hi->silh,rm.rem);
|
||||||
vls->smgl=CALC_DIFF(low->smgl,hi->smgl,rm.rem);
|
vls->smgl=CALC_DIFF(low->smgl,hi->smgl,rm.rem);
|
||||||
|
@ -475,13 +475,14 @@ static char vol_vlastnosti(int id,int xa,int ya,int xr,int yr)
|
||||||
cancel=1;
|
cancel=1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ms_last_event.event_type & 0x2)
|
if (ms_last_event.event_type & 0x2) {
|
||||||
if (xa<pod_perlou_x || ya<pod_perlou_y || xa>pod_perlou_x+pod_perlou[0] || ya>pod_perlou_y+pod_perlou[1] )
|
if (xa<pod_perlou_x || ya<pod_perlou_y || xa>pod_perlou_x+pod_perlou[0] || ya>pod_perlou_y+pod_perlou[1] )
|
||||||
{
|
{
|
||||||
cancel=1;
|
cancel=1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else cancel=0;
|
else cancel=0;
|
||||||
|
}
|
||||||
if (cancel) return 0;
|
if (cancel) return 0;
|
||||||
xr=xa-PERLA_STRED_X;
|
xr=xa-PERLA_STRED_X;
|
||||||
yr=-(ya-PERLA_STRED_Y);
|
yr=-(ya-PERLA_STRED_Y);
|
||||||
|
@ -629,7 +630,7 @@ void generuj_postavu(THUMAN *h)
|
||||||
//postava je vygenerovana
|
//postava je vygenerovana
|
||||||
}
|
}
|
||||||
|
|
||||||
static void redraw_page3(char)
|
static void redraw_page3(char _)
|
||||||
{
|
{
|
||||||
update_mysky();
|
update_mysky();
|
||||||
schovej_mysku();
|
schovej_mysku();
|
||||||
|
@ -645,7 +646,7 @@ static void redraw_page3(char)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void redraw_svitek(char)
|
static void redraw_svitek(char _)
|
||||||
{
|
{
|
||||||
if (postavy[cur_edited].bonus==0)
|
if (postavy[cur_edited].bonus==0)
|
||||||
{
|
{
|
||||||
|
@ -770,7 +771,7 @@ static void enter_reaction(EVENT_MSG *msg,void **unused)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void enter_reaction2(EVENT_MSG *msg,void **)
|
static void enter_reaction2(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
int c = va_arg(msg->data, int);
|
int c = va_arg(msg->data, int);
|
||||||
if (msg->msg==E_KEYBOARD && c==13 && !shut_downing_text && ~b_disables & 0x3)
|
if (msg->msg==E_KEYBOARD && c==13 && !shut_downing_text && ~b_disables & 0x3)
|
||||||
|
|
|
@ -53,7 +53,8 @@ char clk_touch_vyk(int sector,int side,int xr,int yr)
|
||||||
{
|
{
|
||||||
if (picked_item==NULL)
|
if (picked_item==NULL)
|
||||||
{
|
{
|
||||||
for(i=0;v->items[i];i++);if (!i) return 0;
|
for(i=0;v->items[i];i++);
|
||||||
|
if (!i) return 0;
|
||||||
i--;
|
i--;
|
||||||
picked_item=NewArr(short,2);
|
picked_item=NewArr(short,2);
|
||||||
picked_item[0]=v->items[i];picked_item[1]=0;
|
picked_item[0]=v->items[i];picked_item[1]=0;
|
||||||
|
@ -67,7 +68,8 @@ char clk_touch_vyk(int sector,int side,int xr,int yr)
|
||||||
{
|
{
|
||||||
int fc;
|
int fc;
|
||||||
word *w;
|
word *w;
|
||||||
for(i=0;v->items[i];i++);if (i==8)
|
for(i=0;v->items[i];i++);
|
||||||
|
if (i==8)
|
||||||
{
|
{
|
||||||
bott_disp_text(texty[36]);
|
bott_disp_text(texty[36]);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -92,7 +94,7 @@ char clk_touch_vyk(int sector,int side,int xr,int yr)
|
||||||
|
|
||||||
char clk_touch(int id,int xa,int ya,int xr,int yr)
|
char clk_touch(int id,int xa,int ya,int xr,int yr)
|
||||||
{
|
{
|
||||||
int x1,y1,x2,y2;
|
int x1=0,y1=0,x2=0,y2=0;
|
||||||
word *p;
|
word *p;
|
||||||
int ext=0;
|
int ext=0;
|
||||||
|
|
||||||
|
@ -107,7 +109,10 @@ char clk_touch(int id,int xa,int ya,int xr,int yr)
|
||||||
ya=320-(map_sides[id].ysec<<1);
|
ya=320-(map_sides[id].ysec<<1);
|
||||||
p=(word *)ablock(map_sides[id].sec+num_ofsets[MAIN_NUM]);
|
p=(word *)ablock(map_sides[id].sec+num_ofsets[MAIN_NUM]);
|
||||||
x1=*p++;y1=*p++;
|
x1=*p++;y1=*p++;
|
||||||
x2=xa+x1/2;y2=ya+y1/2;y1=y2-y1;x1=x2-x1;
|
x2=xa+x1/2;
|
||||||
|
y2=ya+y1/2;
|
||||||
|
y1=y2-y1;
|
||||||
|
x1=x2-x1;
|
||||||
x1+=MIDDLE_X-points[0][1][1].x;
|
x1+=MIDDLE_X-points[0][1][1].x;
|
||||||
x2+=MIDDLE_X-points[0][1][1].x;
|
x2+=MIDDLE_X-points[0][1][1].x;
|
||||||
y1+=MIDDLE_Y+points[0][1][1].y;
|
y1+=MIDDLE_Y+points[0][1][1].y;
|
||||||
|
@ -122,6 +127,7 @@ char clk_touch(int id,int xa,int ya,int xr,int yr)
|
||||||
y2=MIDDLE_Y+points[0][0][1].y;
|
y2=MIDDLE_Y+points[0][0][1].y;
|
||||||
ext=((map_sides[id].flags & SD_THING_IMPS) && !(map_sides[id].oblouk & SD_ITPUSH));
|
ext=((map_sides[id].flags & SD_THING_IMPS) && !(map_sides[id].oblouk & SD_ITPUSH));
|
||||||
}
|
}
|
||||||
|
else return 0;
|
||||||
if (x1<=xr && xr<=x2 && y1<=yr && yr<=y2)
|
if (x1<=xr && xr<=x2 && y1<=yr && yr<=y2)
|
||||||
{
|
{
|
||||||
a_touch(viewsector,viewdir);
|
a_touch(viewsector,viewdir);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
void *LoadDefaultFont();
|
void *LoadDefaultFont(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -561,7 +561,7 @@ static void nahodne(int vls,int omz,char check)
|
||||||
int i,l,m;
|
int i,l,m;
|
||||||
|
|
||||||
memset(chk,0,sizeof(chk));
|
memset(chk,0,sizeof(chk));
|
||||||
if (!check) for(i=0;i<SAVE_POSTS;i++) if (sn_nums[i]<POCET_POSTAV) chk[sn_nums[i]]|=1;
|
if (!check) for(i=0;i<SAVE_POSTS;i++) if (sn_nums[i]<POCET_POSTAV) chk[(uint8_t)sn_nums[i]]|=1;
|
||||||
for(i=0;i<POCET_POSTAV;i++) if (postavy[i].sektor!=viewsector || !postavy[i].lives || !postavy[i].used) chk[i]|=2;
|
for(i=0;i<POCET_POSTAV;i++) if (postavy[i].sektor!=viewsector || !postavy[i].lives || !postavy[i].used) chk[i]|=2;
|
||||||
m=0;l=-1;
|
m=0;l=-1;
|
||||||
for(i=0;i<POCET_POSTAV;i++)
|
for(i=0;i<POCET_POSTAV;i++)
|
||||||
|
@ -672,7 +672,7 @@ static void remove_all_cases();
|
||||||
|
|
||||||
static void dialog_cont()
|
static void dialog_cont()
|
||||||
{
|
{
|
||||||
save_jump=vol_n[vyb_volba];
|
save_jump=vol_n[(uint8_t)vyb_volba];
|
||||||
remove_all_cases();
|
remove_all_cases();
|
||||||
echo(" ");
|
echo(" ");
|
||||||
his_line=get_last_his_line();
|
his_line=get_last_his_line();
|
||||||
|
@ -684,7 +684,7 @@ static void dialog_cont()
|
||||||
|
|
||||||
static void key_check(EVENT_MSG *msg,void **unused)
|
static void key_check(EVENT_MSG *msg,void **unused)
|
||||||
{
|
{
|
||||||
char c,d;
|
char d;
|
||||||
|
|
||||||
unused;
|
unused;
|
||||||
if (msg->msg==E_KEYBOARD)
|
if (msg->msg==E_KEYBOARD)
|
||||||
|
@ -785,7 +785,7 @@ static void add_case(int num,char *text)
|
||||||
{
|
{
|
||||||
char *a;
|
char *a;
|
||||||
int xs,ys;
|
int xs,ys;
|
||||||
vol_n[pocet_voleb]=num;
|
vol_n[(uint8_t)pocet_voleb]=num;
|
||||||
if (pocet_voleb>MAX_VOLEB) {error("POZOR! Je priliz mnoho voleb");pocet_voleb=MAX_VOLEB;}
|
if (pocet_voleb>MAX_VOLEB) {error("POZOR! Je priliz mnoho voleb");pocet_voleb=MAX_VOLEB;}
|
||||||
a=alloca(strlen(text)+2);
|
a=alloca(strlen(text)+2);
|
||||||
set_font(H_FBOLD,RGB555(0,30,0));
|
set_font(H_FBOLD,RGB555(0,30,0));
|
||||||
|
@ -807,9 +807,17 @@ static void remove_all_cases()
|
||||||
int cf,i;
|
int cf,i;
|
||||||
pocet_voleb=0;
|
pocet_voleb=0;
|
||||||
cf=str_count(history);
|
cf=str_count(history);
|
||||||
for(i=end_text_line;i<cf;i++) if (history[i]!=NULL)
|
for (i = end_text_line; i < cf; i++) {
|
||||||
if (history[i][0]-48!=vyb_volba) str_replace(&history,i,NULL);else
|
if (history[i] != NULL) {
|
||||||
history[i][0]='M';else break;
|
if (history[i][0] - 48 != vyb_volba) {
|
||||||
|
str_replace(&history, i, NULL);
|
||||||
|
} else {
|
||||||
|
history[i][0] = 'M';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
str_delfreelines(&history);
|
str_delfreelines(&history);
|
||||||
vyb_volba=0;
|
vyb_volba=0;
|
||||||
}
|
}
|
||||||
|
@ -1226,7 +1234,7 @@ void do_dialog()
|
||||||
if (game_extras & EX_AUTOOPENBOOK) autoopenaction=1;
|
if (game_extras & EX_AUTOOPENBOOK) autoopenaction=1;
|
||||||
break;
|
break;
|
||||||
case 150:set_nvisited(Get_short());break;
|
case 150:set_nvisited(Get_short());break;
|
||||||
case 151:iff=rnd(100)<=Get_short();break;
|
case 151:iff=rnd(100)<=(unsigned int)Get_short();break;
|
||||||
case 152:iff=q_item(Get_short(),viewsector)!=NULL;break;
|
case 152:iff=q_item(Get_short(),viewsector)!=NULL;break;
|
||||||
case 153:create_item(Get_short());break;
|
case 153:create_item(Get_short());break;
|
||||||
case 154:destroy_item(Get_short());break;
|
case 154:destroy_item(Get_short());break;
|
||||||
|
@ -1323,7 +1331,7 @@ static void create_back_pic()
|
||||||
void call_dialog(int entr,int mob)
|
void call_dialog(int entr,int mob)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
void (*old_wire_proc)()=wire_proc;
|
// void (*old_wire_proc)()=wire_proc;
|
||||||
curcolor=0;
|
curcolor=0;
|
||||||
create_back_pic();
|
create_back_pic();
|
||||||
bar32(0,SCREEN_OFFLINE,639,SCREEN_OFFLINE+359);
|
bar32(0,SCREEN_OFFLINE,639,SCREEN_OFFLINE+359);
|
||||||
|
|
|
@ -78,7 +78,7 @@ void save_dump(const uint16_t *screen_addr,
|
||||||
for (y = height; y > 0; y--) {
|
for (y = height; y > 0; y--) {
|
||||||
const uint16_t *scr = screen_addr;
|
const uint16_t *scr = screen_addr;
|
||||||
a = scr + (y - 1) * linelen;
|
a = scr + (y - 1) * linelen;
|
||||||
for (x = 0; x < width; x++) {
|
for (x = 0; (unsigned int)x < width; x++) {
|
||||||
i = a[x];
|
i = a[x];
|
||||||
b = (i & 0x1f) << 3;
|
b = (i & 0x1f) << 3;
|
||||||
g = (i & 0x7ff) >> 3;
|
g = (i & 0x7ff) >> 3;
|
||||||
|
|
110
game/enemy.c
110
game/enemy.c
|
@ -142,10 +142,10 @@ int load_enemy_paths(TMPFILE_RD *f)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mob_reload(EVENT_MSG *msg,void **){
|
static void mob_reload(EVENT_MSG *msg,void **_){
|
||||||
static int counter=0;
|
static int counter=0;
|
||||||
|
|
||||||
if (msg->msg = E_KOUZLO_KOLO)
|
if (msg->msg == E_KOUZLO_KOLO) {
|
||||||
{
|
{
|
||||||
if (insleep) return;
|
if (insleep) return;
|
||||||
if (counter++==10)
|
if (counter++==10)
|
||||||
|
@ -188,7 +188,7 @@ static void mob_reload(EVENT_MSG *msg,void **){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void init_mobs()
|
void init_mobs()
|
||||||
{
|
{
|
||||||
|
@ -333,14 +333,21 @@ static char seber_predmet(TMOB *m)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mob_sound_event(TMOB *m,int event)
|
static void mob_sound_event(TMOB *m, int event) {
|
||||||
{
|
if (m->sounds[event] && m->vlajky & MOB_LIVE
|
||||||
if (m->sounds[event] && m->vlajky & MOB_LIVE && ~m->vlastnosti[VLS_KOUZLA] & SPL_STONED)
|
&& ~m->vlastnosti[VLS_KOUZLA] & SPL_STONED) {
|
||||||
if (event==MBS_WALK)
|
if (event == MBS_WALK) {
|
||||||
play_sample_at_sector(m->cislo_vzoru+16*6+event+monster_block,viewsector,m->sector,m-mobs+256,(m->vlajky & MOB_SAMPLE_LOOP)!=0);
|
play_sample_at_sector(
|
||||||
else
|
m->cislo_vzoru + 16 * 6 + event + monster_block, viewsector,
|
||||||
play_sample_at_sector(m->cislo_vzoru+16*6+event+monster_block,viewsector,m->sector,0,0);
|
m->sector, m - mobs + 256,
|
||||||
}
|
(m->vlajky & MOB_SAMPLE_LOOP) != 0);
|
||||||
|
} else {
|
||||||
|
play_sample_at_sector(
|
||||||
|
m->cislo_vzoru + 16 * 6 + event + monster_block, viewsector,
|
||||||
|
m->sector, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize)
|
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize)
|
||||||
{
|
{
|
||||||
|
@ -426,7 +433,7 @@ int mob_pocet_vychodu(int sector,int dir)
|
||||||
|
|
||||||
if (map_sides[(sect<<2)+dir].flags & SD_MONST_IMPS) return 1;
|
if (map_sides[(sect<<2)+dir].flags & SD_MONST_IMPS) return 1;
|
||||||
sect=map_sectors[sect].step_next[dir];
|
sect=map_sectors[sect].step_next[dir];
|
||||||
if (map_coord[sect].flags & MC_PLAYER && ~passable && MOB_PASSABLE) return 2;
|
if ((map_coord[sect].flags & MC_PLAYER) && (~passable & MOB_PASSABLE)) return 2;
|
||||||
i=mob_map[sect];
|
i=mob_map[sect];
|
||||||
if (i==0) return 0;
|
if (i==0) return 0;
|
||||||
if (alone & MOB_BIG) return 1;
|
if (alone & MOB_BIG) return 1;
|
||||||
|
@ -485,9 +492,9 @@ char je_mozne_videt(int sector1,int sector2,int flag)
|
||||||
ly--;
|
ly--;
|
||||||
}
|
}
|
||||||
else return 0;
|
else return 0;
|
||||||
if (x!=xs)
|
if (x!=xs) {
|
||||||
if ((map_sides[(s<<2)+3].flags & flag)!=(unsigned)flag) s=map_sectors[s].step_next[3];
|
if ((map_sides[(s<<2)+3].flags & flag)!=(unsigned)flag) s=map_sectors[s].step_next[3];
|
||||||
else return 0;
|
} else return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -510,9 +517,9 @@ char je_mozne_videt(int sector1,int sector2,int flag)
|
||||||
ly--;
|
ly--;
|
||||||
}
|
}
|
||||||
else return 0;
|
else return 0;
|
||||||
if (x!=xs)
|
if (x!=xs) {
|
||||||
if ((map_sides[(s<<2)+1].flags & flag)!=(unsigned)flag) s=map_sectors[s].step_next[1];
|
if ((map_sides[(s<<2)+1].flags & flag)!=(unsigned)flag) s=map_sectors[s].step_next[1];
|
||||||
else return 0;
|
} else return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return s==sector2;
|
return s==sector2;
|
||||||
|
@ -604,11 +611,13 @@ void stop_mob(TMOB *p)
|
||||||
p->mode=MBA_NONE;
|
p->mode=MBA_NONE;
|
||||||
num1=mob_map[p->sector];
|
num1=mob_map[p->sector];
|
||||||
if (num1) q=&mobs[num1-MOB_START];else q=p;
|
if (num1) q=&mobs[num1-MOB_START];else q=p;
|
||||||
if (p==q)
|
if (p==q) {
|
||||||
if (p->next)
|
if (p->next) {
|
||||||
q=mobs+p->next-MOB_START;
|
q=mobs+p->next-MOB_START;
|
||||||
else
|
} else {
|
||||||
q=NULL;
|
q=NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (p->stay_strategy & MOB_BIG)
|
if (p->stay_strategy & MOB_BIG)
|
||||||
{
|
{
|
||||||
p->headx=128;
|
p->headx=128;
|
||||||
|
@ -651,14 +660,16 @@ void stop_mob(TMOB *p)
|
||||||
switch (p->dir)
|
switch (p->dir)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case 2:if (q->headx==128)
|
case 2:if (q->headx==128) {
|
||||||
if (p->headx<128) q->headx=128+MOB_DIST;else q->headx=128-MOB_DIST;
|
if (p->headx<128) q->headx=128+MOB_DIST;else q->headx=128-MOB_DIST;
|
||||||
|
}
|
||||||
p->headx=-q->headx;
|
p->headx=-q->headx;
|
||||||
p->heady=mob_batt_y[p->dir];
|
p->heady=mob_batt_y[p->dir];
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 3:if (q->heady==128)
|
case 3:if (q->heady==128) {
|
||||||
if (p->heady<128) q->heady=128+MOB_DIST;else q->heady=128-MOB_DIST;
|
if (p->heady<128) q->heady=128+MOB_DIST;else q->heady=128-MOB_DIST;
|
||||||
|
}
|
||||||
p->heady=-q->heady;
|
p->heady=-q->heady;
|
||||||
p->headx=mob_batt_x[p->dir];break;
|
p->headx=mob_batt_x[p->dir];break;
|
||||||
}
|
}
|
||||||
|
@ -781,16 +792,15 @@ static int jdi_po_ceste(int old,TMOB *p)
|
||||||
|
|
||||||
void rozhodni_o_smeru(TMOB *p)
|
void rozhodni_o_smeru(TMOB *p)
|
||||||
{
|
{
|
||||||
int sect,dir,r,v,lv,c,alone,oldwalk,passable;
|
int sect,dir,r,v,c,alone,oldwalk,passable;
|
||||||
int vdir=-1;
|
int vdir=-1;
|
||||||
|
|
||||||
alone=p->stay_strategy & MOB_BIG;
|
alone=p->stay_strategy & MOB_BIG;
|
||||||
passable=p->vlajky & MOB_PASSABLE;
|
passable=p->vlajky & MOB_PASSABLE;
|
||||||
sect=p->sector;
|
sect=p->sector;
|
||||||
dir=p->dir;
|
dir=p->dir;
|
||||||
lv=p->walk_data;
|
|
||||||
if (mob_paths[p-mobs]!=NULL) c=jdi_po_ceste(-1,p);else c=-1;
|
if (mob_paths[p-mobs]!=NULL) c=jdi_po_ceste(-1,p);else c=-1;
|
||||||
if (c!=-1)
|
if (c!=-1) {
|
||||||
if (!mob_check_next_sector(sect,c,alone,passable))
|
if (!mob_check_next_sector(sect,c,alone,passable))
|
||||||
{
|
{
|
||||||
p->headx=mob_go_x[c];
|
p->headx=mob_go_x[c];
|
||||||
|
@ -802,6 +812,7 @@ void rozhodni_o_smeru(TMOB *p)
|
||||||
{
|
{
|
||||||
if (mob_path_ptr[p-mobs]-mob_paths[p-mobs]>1) mob_path_ptr[p-mobs]-=2;
|
if (mob_path_ptr[p-mobs]-mob_paths[p-mobs]>1) mob_path_ptr[p-mobs]-=2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (p->vlajky & MOB_IN_BATTLE)
|
if (p->vlajky & MOB_IN_BATTLE)
|
||||||
{
|
{
|
||||||
stop_mob(p);
|
stop_mob(p);
|
||||||
|
@ -896,8 +907,9 @@ int get_view(TMOB *p,int dirmob,int action,int curdir)
|
||||||
xs=p->headx-p->locx;
|
xs=p->headx-p->locx;
|
||||||
ys=p->heady-p->locy;
|
ys=p->heady-p->locy;
|
||||||
if (!(game_extras & EX_WALKDIAGONAL) || p->stay_strategy & MOB_BIG)
|
if (!(game_extras & EX_WALKDIAGONAL) || p->stay_strategy & MOB_BIG)
|
||||||
if (ys!=0 && xs!=0)
|
if (ys!=0 && xs!=0) {
|
||||||
if (p->dir==1 || p->dir==3) xs=0;else ys=0;
|
if (p->dir==1 || p->dir==3) xs=0;else ys=0;
|
||||||
|
}
|
||||||
if (xs) dirmob=(xs<0)?3:1;
|
if (xs) dirmob=(xs<0)?3:1;
|
||||||
if (ys) dirmob=(ys<0)?0:2;
|
if (ys) dirmob=(ys<0)?0:2;
|
||||||
pos=(2+dirmob-curdir)&0x3;
|
pos=(2+dirmob-curdir)&0x3;
|
||||||
|
@ -1144,18 +1156,19 @@ void mob_check(int num,TMOB *p)
|
||||||
sect=p->sector;
|
sect=p->sector;
|
||||||
q=p->stay_strategy & MOB_BIG;
|
q=p->stay_strategy & MOB_BIG;
|
||||||
z=p->vlajky & MOB_PASSABLE;
|
z=p->vlajky & MOB_PASSABLE;
|
||||||
if (p->locy<64)
|
if (p->locy<64) {
|
||||||
if (mob_check_next_sector(sect,0,q,z)) otoc_moba(p);
|
if (mob_check_next_sector(sect,0,q,z)) otoc_moba(p);
|
||||||
else mob_step_next(num,sect,0,&p->locy);
|
else mob_step_next(num,sect,0,&p->locy);
|
||||||
else if (p->locx>191)
|
} else if (p->locx>191) {
|
||||||
if (mob_check_next_sector(sect,1,q,z)) otoc_moba(p);
|
if (mob_check_next_sector(sect,1,q,z)) otoc_moba(p);
|
||||||
else mob_step_next(num,sect,1,&p->locx);
|
else mob_step_next(num,sect,1,&p->locx);
|
||||||
else if (p->locy>191)
|
} else if (p->locy>191) {
|
||||||
if (mob_check_next_sector(sect,2,q,z)) otoc_moba(p);
|
if (mob_check_next_sector(sect,2,q,z)) otoc_moba(p);
|
||||||
else mob_step_next(num,sect,2,&p->locy);
|
else mob_step_next(num,sect,2,&p->locy);
|
||||||
else if (p->locx<64)
|
} else if (p->locx<64) {
|
||||||
if (mob_check_next_sector(sect,3,q,z)) otoc_moba(p);
|
if (mob_check_next_sector(sect,3,q,z)) otoc_moba(p);
|
||||||
else mob_step_next(num,sect,3,&p->locx);
|
else mob_step_next(num,sect,3,&p->locx);
|
||||||
|
}
|
||||||
if (battle && p->mode!=MBA_FLEE)
|
if (battle && p->mode!=MBA_FLEE)
|
||||||
{
|
{
|
||||||
mob_sound_event(p,MBS_WALK);
|
mob_sound_event(p,MBS_WALK);
|
||||||
|
@ -1225,6 +1238,7 @@ static int drop_inventory(TMOB *p)
|
||||||
}
|
}
|
||||||
push_item(p->sector,pl,c);
|
push_item(p->sector,pl,c);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1551,9 +1565,9 @@ void mobs_live(int num)
|
||||||
ys=p->heady-p->locy;
|
ys=p->heady-p->locy;
|
||||||
if (!(game_extras & EX_WALKDIAGONAL) || p->stay_strategy & MOB_BIG)
|
if (!(game_extras & EX_WALKDIAGONAL) || p->stay_strategy & MOB_BIG)
|
||||||
{
|
{
|
||||||
if (ys!=0 && xs!=0)
|
if (ys!=0 && xs!=0) {
|
||||||
if (p->dir==1 || p->dir==3) xs=0;else ys=0;
|
if (p->dir==1 || p->dir==3) xs=0;else ys=0;
|
||||||
}
|
}}
|
||||||
if (xs>spd) xs=spd;
|
if (xs>spd) xs=spd;
|
||||||
else if (xs<-spd) xs=-spd;
|
else if (xs<-spd) xs=-spd;
|
||||||
if (ys>spd) ys=spd;
|
if (ys>spd) ys=spd;
|
||||||
|
@ -1605,8 +1619,8 @@ void calc_mobs()
|
||||||
for(i=0;i<MAX_MOBS;i++) if (mobs[i].vlajky & MOB_LIVE) mobs_live(i);
|
for(i=0;i<MAX_MOBS;i++) if (mobs[i].vlajky & MOB_LIVE) mobs_live(i);
|
||||||
if (folow_mode)
|
if (folow_mode)
|
||||||
{
|
{
|
||||||
viewsector=mobs[folow_mob].sector;
|
viewsector=mobs[(uint8_t)folow_mob].sector;
|
||||||
viewdir=mobs[folow_mob].dir;
|
viewdir=mobs[(uint8_t)folow_mob].dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1650,12 +1664,19 @@ void check_all_mobs_battle() //kontroluje zda je nekdo v battle
|
||||||
|
|
||||||
int q_kolik_je_potvor(int sector)
|
int q_kolik_je_potvor(int sector)
|
||||||
{
|
{
|
||||||
if (mob_map[sector])
|
if (mob_map[sector]) {
|
||||||
if (mobs[mob_map[sector]-MOB_START].next) return 2;
|
if (mobs[mob_map[sector] - MOB_START].next) {
|
||||||
else if (mobs[mob_map[sector]-MOB_START].stay_strategy & MOB_BIG) return 2;
|
return 2;
|
||||||
else return 1;
|
}
|
||||||
return 0;
|
else if (mobs[mob_map[sector] - MOB_START].stay_strategy & MOB_BIG) {
|
||||||
}
|
return 2;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void najdi_cestu(word start,word konec,int flag,word **cesta, int iamcnt)
|
void najdi_cestu(word start,word konec,int flag,word **cesta, int iamcnt)
|
||||||
{
|
{
|
||||||
|
@ -1670,7 +1691,7 @@ void najdi_cestu(word start,word konec,int flag,word **cesta, int iamcnt)
|
||||||
ok_flags[start>>3]|=1<<(start & 0x7);
|
ok_flags[start>>3]|=1<<(start & 0x7);
|
||||||
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
||||||
{
|
{
|
||||||
char i;word s,d=0xFFFF,ss;
|
uint8_t i;word s,d=0xFFFF,ss;
|
||||||
s=(ss=Lo(*stk_cur))<<2;
|
s=(ss=Lo(*stk_cur))<<2;
|
||||||
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & flag))
|
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & flag))
|
||||||
{
|
{
|
||||||
|
@ -1741,7 +1762,7 @@ void sirit_zvuk(word start)
|
||||||
ok_flags[start>>3]|=1<<(start & 0x7);
|
ok_flags[start>>3]|=1<<(start & 0x7);
|
||||||
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
||||||
{
|
{
|
||||||
char i;word s,d,ss;
|
uint8_t i;word s,d,ss;
|
||||||
s=(ss=Lo(*stk_cur))<<2;
|
s=(ss=Lo(*stk_cur))<<2;
|
||||||
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & SD_SOUND_IMPS))
|
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & SD_SOUND_IMPS))
|
||||||
{
|
{
|
||||||
|
@ -1895,13 +1916,13 @@ char akce_moba_zac(TMOB *m)
|
||||||
|
|
||||||
if (p->used && p->lives && p->sektor==sect)
|
if (p->used && p->lives && p->sektor==sect)
|
||||||
{
|
{
|
||||||
if ((m->vlajky & MOB_CASTING && get_spell_track(m->casting))|| m->stay_strategy & MOB_ROGUE)
|
if (((m->vlajky & MOB_CASTING) && get_spell_track(m->casting))|| m->stay_strategy & MOB_ROGUE)
|
||||||
{stop_all_mobs_on_sector(m->sector);smeruj_moba(m,0);}
|
{stop_all_mobs_on_sector(m->sector);smeruj_moba(m,0);}
|
||||||
else stop_mob(m);
|
else stop_mob(m);
|
||||||
viewsector=sect;
|
viewsector=sect;
|
||||||
viewdir=m->dir+2 &3;
|
viewdir=m->dir+2 &3;
|
||||||
m->csektor=sect;
|
m->csektor=sect;
|
||||||
if (m->vlajky & MOB_CASTING && rnd(100)<=m->vlastnosti[VLS_SMAGIE]) m->mode=MBA_SPELL;else m->mode=MBA_ATTACK;
|
if ((m->vlajky & MOB_CASTING)&& rnd(100)<=(unsigned int)m->vlastnosti[VLS_SMAGIE]) m->mode=MBA_SPELL;else m->mode=MBA_ATTACK;
|
||||||
bott_draw(1);
|
bott_draw(1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1927,7 +1948,7 @@ char akce_moba_zac(TMOB *m)
|
||||||
sect=m->sector;
|
sect=m->sector;
|
||||||
i=q_vidis_postavu(m->sector,m->dir,m,&j,1);
|
i=q_vidis_postavu(m->sector,m->dir,m,&j,1);
|
||||||
h=postavy+i;
|
h=postavy+i;
|
||||||
if (i>-1)
|
if (i>-1) {
|
||||||
if (((m->vlajky & MOB_CASTING && get_spell_track(m->casting))|| m->stay_strategy & MOB_ROGUE) &&
|
if (((m->vlajky & MOB_CASTING && get_spell_track(m->casting))|| m->stay_strategy & MOB_ROGUE) &&
|
||||||
(map_coord[m->sector].x==map_coord[h->sektor].x || map_coord[m->sector].y==map_coord[h->sektor].y)
|
(map_coord[m->sector].x==map_coord[h->sektor].x || map_coord[m->sector].y==map_coord[h->sektor].y)
|
||||||
&& track_mob(m->sector,m->dir))
|
&& track_mob(m->sector,m->dir))
|
||||||
|
@ -1960,6 +1981,7 @@ char akce_moba_zac(TMOB *m)
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rozhodni_o_smeru(m);
|
rozhodni_o_smeru(m);
|
||||||
if (m->dir & 1)m->headx=mob_go_x[m->dir];else m->heady=mob_go_y[m->dir];
|
if (m->dir & 1)m->headx=mob_go_x[m->dir];else m->heady=mob_go_y[m->dir];
|
||||||
// m->headx=mob_go_x[m->dir];
|
// m->headx=mob_go_x[m->dir];
|
||||||
|
|
|
@ -102,12 +102,7 @@ void (*turn)(int32_t lbuf,void *src1,void *src2,int size1);
|
||||||
word *GetBuffer2nd();
|
word *GetBuffer2nd();
|
||||||
word *background;
|
word *background;
|
||||||
char debug=0,nosides=0,nofloors=0,drwsit=0,show_names=0,show_lives=0;
|
char debug=0,nosides=0,nofloors=0,drwsit=0,show_names=0,show_lives=0;
|
||||||
static int32_t old_timer;
|
|
||||||
|
|
||||||
static void wait_timer()
|
|
||||||
{
|
|
||||||
sleep_ms(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*void zooming1(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
/*void zooming1(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +113,7 @@ static void wait_timer()
|
||||||
zooming_dx(source,GetScreenAdr()+target,background+3,xlat,xysize);
|
zooming_dx(source,GetScreenAdr()+target,background+3,xlat,xysize);
|
||||||
showview(0,0,0,0);
|
showview(0,0,0,0);
|
||||||
}
|
}
|
||||||
/*
|
/ *
|
||||||
void zooming2(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
void zooming2(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||||
{
|
{
|
||||||
word *lbuffer=LockDirectScreen();
|
word *lbuffer=LockDirectScreen();
|
||||||
|
@ -135,7 +130,7 @@ void zooming3(void *source,int32_t target,word *background,void *xlat,int32_t xy
|
||||||
source;target;background;xlat;xysize;
|
source;target;background;xlat;xysize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void zooming4(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
/ *void zooming4(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||||
{
|
{
|
||||||
word *lbuffer=LockDirectScreen();
|
word *lbuffer=LockDirectScreen();
|
||||||
wait_timer();
|
wait_timer();
|
||||||
|
@ -144,8 +139,8 @@ void zooming3(void *source,int32_t target,word *background,void *xlat,int32_t xy
|
||||||
else
|
else
|
||||||
zooming32b(source,(void *)(target*2),background+3,xlat,xysize);
|
zooming32b(source,(void *)(target*2),background+3,xlat,xysize);
|
||||||
UnlockDirectScreen();
|
UnlockDirectScreen();
|
||||||
}*/
|
}* /
|
||||||
/*
|
/ *
|
||||||
void zooming5(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
void zooming5(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||||
{
|
{
|
||||||
wait_timer();
|
wait_timer();
|
||||||
|
@ -165,7 +160,7 @@ void zooming6(void *source,int32_t target,word *background,void *xlat,int32_t xy
|
||||||
zooming_dx(source,lbuffer+(target),background+3,xlat,xysize);
|
zooming_dx(source,lbuffer+(target),background+3,xlat,xysize);
|
||||||
UnlockDirectScreen();
|
UnlockDirectScreen();
|
||||||
}
|
}
|
||||||
/*
|
/ *
|
||||||
void zooming7(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
void zooming7(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||||
{
|
{
|
||||||
wait_timer();
|
wait_timer();
|
||||||
|
@ -214,7 +209,7 @@ void turn6(int32_t lbuf,void *src1,void *src2,int size1)
|
||||||
scroll_support_dx((lbuf)+lbuffer,src1,src2,size1,xlatmem);
|
scroll_support_dx((lbuf)+lbuffer,src1,src2,size1,xlatmem);
|
||||||
UnlockDirectScreen();
|
UnlockDirectScreen();
|
||||||
}
|
}
|
||||||
/*
|
/ *
|
||||||
void turn7(int32_t lbuf,void *src1,void *src2,int size1)
|
void turn7(int32_t lbuf,void *src1,void *src2,int size1)
|
||||||
{
|
{
|
||||||
wait_timer();
|
wait_timer();
|
||||||
|
@ -371,6 +366,9 @@ void create_tables(void)
|
||||||
{
|
{
|
||||||
xl=+points[x-strd-1][0][0].x;xr=+points[x-strd][0][0].x;
|
xl=+points[x-strd-1][0][0].x;xr=+points[x-strd][0][0].x;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
y1=(VIEW_SIZE_Y-y)-MIDDLE_Y;
|
y1=(VIEW_SIZE_Y-y)-MIDDLE_Y;
|
||||||
xl=xl*(y1+1)/points[0][0][0].y+MIDDLE_X;
|
xl=xl*(y1+1)/points[0][0][0].y+MIDDLE_X;
|
||||||
xr=xr*(y1+1)/points[0][0][0].y+MIDDLE_X;
|
xr=xr*(y1+1)/points[0][0][0].y+MIDDLE_X;
|
||||||
|
@ -402,6 +400,9 @@ void create_tables(void)
|
||||||
{
|
{
|
||||||
xl=+points[x-strd-1][1][0].x;xr=+points[x-strd][1][0].x;
|
xl=+points[x-strd-1][1][0].x;xr=+points[x-strd][1][0].x;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
xl=xl*(y1-2)/points[0][1][0].y+MIDDLE_X;
|
xl=xl*(y1-2)/points[0][1][0].y+MIDDLE_X;
|
||||||
xr=xr*(y1-2)/points[0][1][0].y+MIDDLE_X;
|
xr=xr*(y1-2)/points[0][1][0].y+MIDDLE_X;
|
||||||
if (xl<0) xl=0;if (xr<0) xr=0;
|
if (xl<0) xl=0;if (xr<0) xr=0;
|
||||||
|
@ -520,7 +521,7 @@ static void turn_left_right(char right)
|
||||||
int maxtime=5*rot_phases;
|
int maxtime=5*rot_phases;
|
||||||
int curtime;
|
int curtime;
|
||||||
float phase;
|
float phase;
|
||||||
int last=90;
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -1107,10 +1108,21 @@ void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int pos
|
||||||
}
|
}
|
||||||
else clipl=0;
|
else clipl=0;
|
||||||
clipr=640-x;
|
clipr=640-x;
|
||||||
if (clipr>0)
|
if (clipr > 0) {
|
||||||
if (turn) enemy_draw_mirror(txtr,GetBuffer2nd()+x+(y+SCREEN_OFFLINE)*scr_linelen2,6+512*cely+(secnd_shade?SHADE_STEPS*512:0),last_scale,y,(clipr<<16)+clipl);
|
if (turn) {
|
||||||
else enemy_draw(txtr,GetBuffer2nd()+x+(y+SCREEN_OFFLINE)*scr_linelen2,6+512*cely+(secnd_shade?SHADE_STEPS*512:0),last_scale,y,(clipr<<16)+clipl);
|
enemy_draw_mirror(txtr,
|
||||||
}
|
GetBuffer2nd() + x + (y + SCREEN_OFFLINE) * scr_linelen2,
|
||||||
|
6 + 512 * cely + (secnd_shade ? SHADE_STEPS * 512 : 0),
|
||||||
|
last_scale, y, (clipr << 16) + clipl);
|
||||||
|
}else {
|
||||||
|
enemy_draw(txtr,
|
||||||
|
GetBuffer2nd() + x + (y + SCREEN_OFFLINE) * scr_linelen2,
|
||||||
|
6 + 512 * cely + (secnd_shade ? SHADE_STEPS * 512 : 0),
|
||||||
|
last_scale, y, (clipr << 16) + clipl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int posz,char turn)
|
/*void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int posz,char turn)
|
||||||
{
|
{
|
||||||
|
@ -1208,7 +1220,7 @@ void draw_enemy(DRW_ENEMY *drw)
|
||||||
int x,y,lx,sd;
|
int x,y,lx,sd;
|
||||||
int clipl,clipr;
|
int clipl,clipr;
|
||||||
int posx,posy,cely;
|
int posx,posy,cely;
|
||||||
short *ys,yss,*xs,xss;
|
short *xs,xss;
|
||||||
int grcel;
|
int grcel;
|
||||||
int32_t scr_linelen2 = GetScreenPitch();
|
int32_t scr_linelen2 = GetScreenPitch();
|
||||||
|
|
||||||
|
@ -1239,8 +1251,6 @@ void draw_enemy(DRW_ENEMY *drw)
|
||||||
xs=(short *)drw->txtr;
|
xs=(short *)drw->txtr;
|
||||||
xss=*xs*last_scale/320;
|
xss=*xs*last_scale/320;
|
||||||
if (xss>640) return;
|
if (xss>640) return;
|
||||||
ys=(short *)drw->txtr+1;
|
|
||||||
yss=*ys*last_scale/320;
|
|
||||||
lx=x;
|
lx=x;
|
||||||
grcel=cely;
|
grcel=cely;
|
||||||
if (posy>64) grcel++;
|
if (posy>64) grcel++;
|
||||||
|
@ -1254,25 +1264,34 @@ void draw_enemy(DRW_ENEMY *drw)
|
||||||
}
|
}
|
||||||
else clipl=0;
|
else clipl=0;
|
||||||
clipr=rclip-x;
|
clipr=rclip-x;
|
||||||
if (clipr>0)
|
if (clipr > 0) {
|
||||||
if (drw->mirror)enemy_draw_mirror_transp(drw->txtr,GetBuffer2nd()+x+(y+SCREEN_OFFLINE)*scr_linelen2,drw->palette+grcel+(secnd_shade?SHADE_STEPS:0),last_scale,y+1,(clipr<<16)+clipl);
|
if (drw->mirror) {
|
||||||
else enemy_draw_transp(drw->txtr,GetBuffer2nd()+x+(y+SCREEN_OFFLINE)*scr_linelen2,drw->palette+grcel+(secnd_shade?SHADE_STEPS:0),last_scale,y+1,(clipr<<16)+clipl);
|
enemy_draw_mirror_transp(drw->txtr,
|
||||||
if (show_lives)
|
GetBuffer2nd() + x + (y + SCREEN_OFFLINE) * scr_linelen2,
|
||||||
{
|
drw->palette + grcel + (secnd_shade ? SHADE_STEPS : 0),
|
||||||
char s[25];
|
last_scale, y + 1, (clipr << 16) + clipl);
|
||||||
|
} else {
|
||||||
RedirectScreenBufferSecond();
|
enemy_draw_transp(drw->txtr,
|
||||||
sprintf(s,"%d",drw->num);
|
GetBuffer2nd() + x + (y + SCREEN_OFFLINE) * scr_linelen2,
|
||||||
sd=text_width(s)/2;
|
drw->palette + grcel + (secnd_shade ? SHADE_STEPS : 0),
|
||||||
if (lx-sd>0 && lx+sd<639)
|
last_scale, y + 1, (clipr << 16) + clipl);
|
||||||
{
|
|
||||||
int ly=y+SCREEN_OFFLINE-last_scale*5/6;
|
|
||||||
trans_bar(lx-sd-5,ly-10,sd*2+10,10,0);
|
|
||||||
set_aligned_position(lx,ly,1,2,s);outtext(s);
|
|
||||||
}
|
}
|
||||||
RestoreScreen();
|
}
|
||||||
}
|
if (show_lives) {
|
||||||
}
|
char s[25];
|
||||||
|
|
||||||
|
RedirectScreenBufferSecond();
|
||||||
|
sprintf(s, "%d", drw->num);
|
||||||
|
sd = text_width(s) / 2;
|
||||||
|
if (lx - sd > 0 && lx + sd < 639) {
|
||||||
|
int ly = y + SCREEN_OFFLINE - last_scale * 5 / 6;
|
||||||
|
trans_bar(lx - sd - 5, ly - 10, sd * 2 + 10, 10, 0);
|
||||||
|
set_aligned_position(lx, ly, 1, 2, s);
|
||||||
|
outtext(s);
|
||||||
|
}
|
||||||
|
RestoreScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void draw_player(short *txtr,int celx,int cely,int posx,int posy,int adjust,char *name)
|
void draw_player(short *txtr,int celx,int cely,int posx,int posy,int adjust,char *name)
|
||||||
{
|
{
|
||||||
|
@ -1311,11 +1330,10 @@ void draw_player(short *txtr,int celx,int cely,int posx,int posy,int adjust,char
|
||||||
|
|
||||||
void draw_spectxtr(short *txtr,int celx,int cely,int xpos)
|
void draw_spectxtr(short *txtr,int celx,int cely,int xpos)
|
||||||
{
|
{
|
||||||
int x,y,lx,clipl,clipr;
|
int x,y,clipl,clipr;
|
||||||
int32_t scr_linelen2 = GetScreenPitch();
|
int32_t scr_linelen2 = GetScreenPitch();
|
||||||
|
|
||||||
map_pos(celx,cely,64,64,0,&x,&y);
|
map_pos(celx,cely,64,64,0,&x,&y);
|
||||||
lx=x;
|
|
||||||
x-=(((*txtr>>1)+xpos)*last_scale*2)/320;
|
x-=(((*txtr>>1)+xpos)*last_scale*2)/320;
|
||||||
if (x<0)
|
if (x<0)
|
||||||
{
|
{
|
||||||
|
@ -1331,7 +1349,7 @@ void draw_spectxtr(short *txtr,int celx,int cely,int xpos)
|
||||||
|
|
||||||
void draw_item2(int celx,int cely,int xpos,int ypos,void *txtr,int index)
|
void draw_item2(int celx,int cely,int xpos,int ypos,void *txtr,int index)
|
||||||
{
|
{
|
||||||
int x,y,xs,ys,ysc,abc,asc,clipl,clipr;
|
int x,y,xs,ys,abc,asc,clipl,clipr;
|
||||||
static int indextab[][2]={{0,0},{0,1},{1,0},{-1,0},{1,2},{-1,1},{-2,1},{2,1}};
|
static int indextab[][2]={{0,0},{0,1},{1,0},{-1,0},{1,2},{-1,1},{-2,1},{2,1}};
|
||||||
int32_t scr_linelen2 = GetScreenPitch();
|
int32_t scr_linelen2 = GetScreenPitch();
|
||||||
|
|
||||||
|
@ -1342,7 +1360,6 @@ void draw_item2(int celx,int cely,int xpos,int ypos,void *txtr,int index)
|
||||||
y=points[abc][0][cely+1].y;
|
y=points[abc][0][cely+1].y;
|
||||||
xs=showtabs.x_table[0][cely].max_x;
|
xs=showtabs.x_table[0][cely].max_x;
|
||||||
ys=showtabs.y_table[cely+1].vert_size;
|
ys=showtabs.y_table[cely+1].vert_size;
|
||||||
ysc=showtabs.y_table[cely].vert_size;
|
|
||||||
xpos+=indextab[7-index][0];
|
xpos+=indextab[7-index][0];
|
||||||
ypos+=indextab[7-index][1];
|
ypos+=indextab[7-index][1];
|
||||||
xpos-=*(word *)txtr/2;
|
xpos-=*(word *)txtr/2;
|
||||||
|
|
|
@ -32,8 +32,8 @@ void draw_floor_ceil(int celx,int cely,char f_c,void *txtr);
|
||||||
void show_cel2(int celx,int cely,void *stena,int xofs,int yofs,char rev);
|
void show_cel2(int celx,int cely,void *stena,int xofs,int yofs,char rev);
|
||||||
//zobrazi primou stenu ktera lezi pred nebo napravo od pozorovatele
|
//zobrazi primou stenu ktera lezi pred nebo napravo od pozorovatele
|
||||||
void show_cel(int celx,int cely,void *stena,int xofs,int yofs,char rev);
|
void show_cel(int celx,int cely,void *stena,int xofs,int yofs,char rev);
|
||||||
void turn_left();
|
void turn_left(void);
|
||||||
void turn_right();
|
void turn_right(void);
|
||||||
void zooming_backward(word *background);
|
void zooming_backward(word *background);
|
||||||
void zooming_forward(word *background);
|
void zooming_forward(word *background);
|
||||||
void OutBuffer2nd(void);
|
void OutBuffer2nd(void);
|
||||||
|
@ -41,7 +41,7 @@ void CopyBuffer2nd(void);
|
||||||
void report_mode(int);
|
void report_mode(int);
|
||||||
void draw_item(int celx,int cely,int posx,int posy,short *pic,int index);
|
void draw_item(int celx,int cely,int posx,int posy,short *pic,int index);
|
||||||
void draw_item2(int celx,int cely,int xpos,int ypos,void *texture,int index);
|
void draw_item2(int celx,int cely,int xpos,int ypos,void *texture,int index);
|
||||||
//void textmode_effekt();
|
//void textmode_effekt(void);
|
||||||
//#pragma aux textmode_effekt modify[eax ebx ecx edx edi];
|
//#pragma aux textmode_effekt modify[eax ebx ecx edx edi];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ void enemy_draw(void *src,void *trg,int shade,int scale,int maxspace,int clip)
|
||||||
int xtable[800];
|
int xtable[800];
|
||||||
int ytable[1200];
|
int ytable[1200];
|
||||||
int xcount;
|
int xcount;
|
||||||
int ycount;
|
|
||||||
word pcx = picinfo[0];
|
word pcx = picinfo[0];
|
||||||
word pcy = picinfo[1];
|
word pcy = picinfo[1];
|
||||||
unsigned char *picdata = (unsigned char *)src + pic_start;
|
unsigned char *picdata = (unsigned char *)src + pic_start;
|
||||||
|
@ -606,7 +606,6 @@ void enemy_draw(void *src,void *trg,int shade,int scale,int maxspace,int clip)
|
||||||
}
|
}
|
||||||
sp--;
|
sp--;
|
||||||
}
|
}
|
||||||
ycount = w - ytable;
|
|
||||||
*w++=-1;
|
*w++=-1;
|
||||||
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
||||||
}
|
}
|
||||||
|
@ -767,7 +766,6 @@ void enemy_draw_transp(void *src,void *trg,void *shade,int scale,int maxspace,in
|
||||||
int xtable[800];
|
int xtable[800];
|
||||||
int ytable[1200];
|
int ytable[1200];
|
||||||
int xcount;
|
int xcount;
|
||||||
int ycount;
|
|
||||||
word pcx = picinfo[0];
|
word pcx = picinfo[0];
|
||||||
word pcy = picinfo[1];
|
word pcy = picinfo[1];
|
||||||
word type = picinfo[2];
|
word type = picinfo[2];
|
||||||
|
@ -795,7 +793,6 @@ void enemy_draw_transp(void *src,void *trg,void *shade,int scale,int maxspace,in
|
||||||
}
|
}
|
||||||
sp--;
|
sp--;
|
||||||
}
|
}
|
||||||
ycount = w - ytable;
|
|
||||||
*w++=-1;
|
*w++=-1;
|
||||||
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
||||||
}
|
}
|
||||||
|
@ -958,7 +955,6 @@ void enemy_draw_mirror_transp(void *src,void *trg,void *shade,int scale,int maxs
|
||||||
int xtable[800];
|
int xtable[800];
|
||||||
int ytable[1200];
|
int ytable[1200];
|
||||||
int xcount;
|
int xcount;
|
||||||
int ycount;
|
|
||||||
word pcx = picinfo[0];
|
word pcx = picinfo[0];
|
||||||
word pcy = picinfo[1];
|
word pcy = picinfo[1];
|
||||||
word type = picinfo[2];
|
word type = picinfo[2];
|
||||||
|
@ -986,7 +982,6 @@ void enemy_draw_mirror_transp(void *src,void *trg,void *shade,int scale,int maxs
|
||||||
}
|
}
|
||||||
sp--;
|
sp--;
|
||||||
}
|
}
|
||||||
ycount = w - ytable;
|
|
||||||
*w++=-1;
|
*w++=-1;
|
||||||
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
||||||
}
|
}
|
||||||
|
@ -1147,7 +1142,6 @@ void enemy_draw_mirror(void *src,void *trg,int shade,int scale,int maxspace,int
|
||||||
int xtable[800];
|
int xtable[800];
|
||||||
int ytable[1200];
|
int ytable[1200];
|
||||||
int xcount;
|
int xcount;
|
||||||
int ycount;
|
|
||||||
word pcx = picinfo[0];
|
word pcx = picinfo[0];
|
||||||
word pcy = picinfo[1];
|
word pcy = picinfo[1];
|
||||||
unsigned char *picdata = (unsigned char *)src + pic_start;
|
unsigned char *picdata = (unsigned char *)src + pic_start;
|
||||||
|
@ -1174,7 +1168,6 @@ void enemy_draw_mirror(void *src,void *trg,int shade,int scale,int maxspace,int
|
||||||
}
|
}
|
||||||
sp--;
|
sp--;
|
||||||
}
|
}
|
||||||
ycount = w - ytable;
|
|
||||||
*w++=-1;
|
*w++=-1;
|
||||||
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
//ytable je hotova - obsahuje ofsety v obrazku pro kazdou radku a na konci je -1
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,22 +74,9 @@ typedef struct s_save
|
||||||
int game_flags;
|
int game_flags;
|
||||||
}S_SAVE;
|
}S_SAVE;
|
||||||
|
|
||||||
#define ZAKLAD_CRC 0xC005
|
|
||||||
|
|
||||||
static int get_list_count();
|
static int get_list_count();
|
||||||
|
|
||||||
static word vypocet_crc(char *data,int32_t delka)
|
|
||||||
{
|
|
||||||
uint32_t l=0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
l=(l<<8)|(delka>0?*data++:0);delka--;
|
|
||||||
l=(l<<8)|(delka>0?*data++:0);delka--;
|
|
||||||
l%=ZAKLAD_CRC;
|
|
||||||
}
|
|
||||||
while(delka>-1);
|
|
||||||
return l & 0xffff;
|
|
||||||
}
|
|
||||||
static int unable_open_temp(char *c)
|
static int unable_open_temp(char *c)
|
||||||
{
|
{
|
||||||
char d[]="Unable to open the file : ",*e;
|
char d[]="Unable to open the file : ",*e;
|
||||||
|
@ -349,7 +336,7 @@ int load_all_fly(TMPFILE_RD *fsta)
|
||||||
int save_map_state() //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
int save_map_state() //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
||||||
{
|
{
|
||||||
char sta[200];
|
char sta[200];
|
||||||
char *bf;
|
char *bf = NULL;
|
||||||
TMPFILE_WR *fsta;
|
TMPFILE_WR *fsta;
|
||||||
int i;
|
int i;
|
||||||
int32_t siz;
|
int32_t siz;
|
||||||
|
@ -429,7 +416,7 @@ int save_map_state() //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
||||||
int load_map_state() //obnovuje stav mapy; nutno volat po zavolani load_map;
|
int load_map_state() //obnovuje stav mapy; nutno volat po zavolani load_map;
|
||||||
{
|
{
|
||||||
char sta[200];
|
char sta[200];
|
||||||
char *bf;
|
char *bf = NULL;
|
||||||
TMPFILE_RD *fsta;
|
TMPFILE_RD *fsta;
|
||||||
int i;
|
int i;
|
||||||
int32_t siz;
|
int32_t siz;
|
||||||
|
@ -538,11 +525,9 @@ _inline unsigned char rotate(unsigned char c)
|
||||||
*/
|
*/
|
||||||
int pack_status_file(FILE *f,const char *status_name)
|
int pack_status_file(FILE *f,const char *status_name)
|
||||||
{
|
{
|
||||||
int stt;
|
|
||||||
char rcheck=0;
|
char rcheck=0;
|
||||||
uint32_t fsz;
|
uint32_t fsz;
|
||||||
char *buffer,*c,*fullnam;
|
char *buffer,*c;
|
||||||
word crc;
|
|
||||||
unsigned char name_len;
|
unsigned char name_len;
|
||||||
|
|
||||||
SEND_LOG("(SAVELOAD) Packing status file '%s'",status_name,0);
|
SEND_LOG("(SAVELOAD) Packing status file '%s'",status_name,0);
|
||||||
|
@ -562,12 +547,11 @@ int pack_status_file(FILE *f,const char *status_name)
|
||||||
fsz+=extra;
|
fsz+=extra;
|
||||||
rcheck=(fwrite(buffer,1,fsz,f)!=(unsigned)fsz);
|
rcheck=(fwrite(buffer,1,fsz,f)!=(unsigned)fsz);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return 0;
|
return rcheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unpack_status_file(FILE *f)
|
int unpack_status_file(FILE *f)
|
||||||
{
|
{
|
||||||
int stt;
|
|
||||||
char rcheck=0;
|
char rcheck=0;
|
||||||
uint32_t fsz;
|
uint32_t fsz;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
@ -612,7 +596,6 @@ int unpack_all_status(FILE *f)
|
||||||
int save_basic_info()
|
int save_basic_info()
|
||||||
{
|
{
|
||||||
TMPFILE_WR *f;
|
TMPFILE_WR *f;
|
||||||
char *c;
|
|
||||||
S_SAVE s;
|
S_SAVE s;
|
||||||
short *p;
|
short *p;
|
||||||
int i;
|
int i;
|
||||||
|
@ -670,7 +653,6 @@ int save_basic_info()
|
||||||
int load_basic_info()
|
int load_basic_info()
|
||||||
{
|
{
|
||||||
TMPFILE_RD *f;
|
TMPFILE_RD *f;
|
||||||
char *c;
|
|
||||||
S_SAVE s;
|
S_SAVE s;
|
||||||
int i;
|
int i;
|
||||||
char res=0;
|
char res=0;
|
||||||
|
@ -1107,7 +1089,7 @@ char updown_scroll(int id,int xa,int ya,int xr,int yr);
|
||||||
|
|
||||||
static char updown_noinst=0;
|
static char updown_noinst=0;
|
||||||
|
|
||||||
static void updown_scroll_hold(EVENT_MSG *msg,void **)
|
static void updown_scroll_hold(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
if (msg->msg == E_MOUSE)
|
if (msg->msg == E_MOUSE)
|
||||||
{
|
{
|
||||||
|
@ -1375,7 +1357,7 @@ T_CLK_MAP clk_save[]=
|
||||||
{-1,0,0,639,479,close_saveload,9,H_MS_DEFAULT},
|
{-1,0,0,639,479,close_saveload,9,H_MS_DEFAULT},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void saveload_keyboard(EVENT_MSG *msg,void **)
|
static void saveload_keyboard(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
if (msg->msg == E_KEYBOARD)
|
if (msg->msg == E_KEYBOARD)
|
||||||
{
|
{
|
||||||
|
@ -1460,8 +1442,7 @@ void close_story_file()
|
||||||
|
|
||||||
static int load_map_state_partial(char *level_fname,int mapsize) //obnovuje stav mapy; castecne
|
static int load_map_state_partial(char *level_fname,int mapsize) //obnovuje stav mapy; castecne
|
||||||
{
|
{
|
||||||
char sta[200];
|
char *bf = NULL;
|
||||||
char *bf;
|
|
||||||
TMPFILE_RD *fsta;
|
TMPFILE_RD *fsta;
|
||||||
int i;
|
int i;
|
||||||
int32_t siz;
|
int32_t siz;
|
||||||
|
|
225
game/globals.h
225
game/globals.h
|
@ -539,8 +539,8 @@ extern int end_ptr; //ukazatel na uplny konec tabulky registraci
|
||||||
extern short **map_items; //ukazatel na mapu predmetu
|
extern short **map_items; //ukazatel na mapu predmetu
|
||||||
extern int default_ms_cursor; //cislo zakladniho mysiho kurzoru
|
extern int default_ms_cursor; //cislo zakladniho mysiho kurzoru
|
||||||
extern void *cur_xlat; //aktualni tabulka pro 256 barev
|
extern void *cur_xlat; //aktualni tabulka pro 256 barev
|
||||||
extern void (*unwire_proc)(); //procedura zajistujici odpojeni prave ukoncovane interakce
|
extern void (*unwire_proc)(void); //procedura zajistujici odpojeni prave ukoncovane interakce
|
||||||
extern void (*wire_proc)(); //procedura zajistujici pripojeni drive ukoncene interakce
|
extern void (*wire_proc)(void); //procedura zajistujici pripojeni drive ukoncene interakce
|
||||||
extern char cur_mode; //cislo aktualni interakce
|
extern char cur_mode; //cislo aktualni interakce
|
||||||
extern word minimap[VIEW3D_Z+1][VIEW3D_X*2+1]; //minimalizovana mapa s informacemi pro sestaveni vyhledu
|
extern word minimap[VIEW3D_Z+1][VIEW3D_X*2+1]; //minimalizovana mapa s informacemi pro sestaveni vyhledu
|
||||||
extern char norefresh; //vypina refresh obrazovky
|
extern char norefresh; //vypina refresh obrazovky
|
||||||
|
@ -551,8 +551,8 @@ extern char gamespeed; //rychlost hry
|
||||||
extern char gamespeedbattle; //akcelerace rychlosti pro bitvy
|
extern char gamespeedbattle; //akcelerace rychlosti pro bitvy
|
||||||
extern int num_ofsets[]; //tabulka offsetu pro steny
|
extern int num_ofsets[]; //tabulka offsetu pro steny
|
||||||
extern int back_color; //cislo barvy pozadi
|
extern int back_color; //cislo barvy pozadi
|
||||||
extern char cur_group; //cislo aktualni skupiny
|
extern uint8_t cur_group; //cislo aktualni skupiny
|
||||||
extern char group_select; //1 = prave byla sestavena nova skupina
|
extern uint8_t group_select; //1 = prave byla sestavena nova skupina
|
||||||
extern unsigned short barvy_skupin[POCET_POSTAV+1]; //cisla barev skupin
|
extern unsigned short barvy_skupin[POCET_POSTAV+1]; //cisla barev skupin
|
||||||
extern char battle; //jednicka znaci ze bezi bitva
|
extern char battle; //jednicka znaci ze bezi bitva
|
||||||
extern char battle_mode; //rezim bitvy 0=programovani
|
extern char battle_mode; //rezim bitvy 0=programovani
|
||||||
|
@ -619,8 +619,8 @@ int set_video(int mode);
|
||||||
void *game_keyboard(EVENT_MSG *msg,void **usr);
|
void *game_keyboard(EVENT_MSG *msg,void **usr);
|
||||||
void calc_animations(void);
|
void calc_animations(void);
|
||||||
int load_map(char *filename);
|
int load_map(char *filename);
|
||||||
void other_draw();
|
void other_draw(void);
|
||||||
void refresh_scene();
|
void refresh_scene(void);
|
||||||
void pcx_fade_decomp(void **p,int32_t *s);
|
void pcx_fade_decomp(void **p,int32_t *s);
|
||||||
void pcx_15bit_decomp(void **p,int32_t *s);
|
void pcx_15bit_decomp(void **p,int32_t *s);
|
||||||
void pcx_15bit_autofade(void **p,int32_t *s);
|
void pcx_15bit_autofade(void **p,int32_t *s);
|
||||||
|
@ -630,19 +630,19 @@ void hi_8bit_correct(void **p,int32_t *s);
|
||||||
void pcx_8bit_nopal(void **p,int32_t *s);
|
void pcx_8bit_nopal(void **p,int32_t *s);
|
||||||
void set_background(void **p,int32_t *s);
|
void set_background(void **p,int32_t *s);
|
||||||
void wav_load(void **p,int32_t *s);
|
void wav_load(void **p,int32_t *s);
|
||||||
void wire_main_functs();
|
void wire_main_functs(void);
|
||||||
void ukaz_kompas(char mode);
|
void ukaz_kompas(char mode);
|
||||||
void *timming(EVENT_MSG *msg,void **data);
|
void *timming(EVENT_MSG *msg,void **data);
|
||||||
void do_timer();
|
void do_timer(void);
|
||||||
void hold_timer(int id,char hld);
|
void hold_timer(int id,char hld);
|
||||||
THE_TIMER *add_to_timer(int id,int delay,int maxcall,void *proc);
|
THE_TIMER *add_to_timer(int id,int delay,int maxcall,void *proc);
|
||||||
void delete_from_timer(int id);
|
void delete_from_timer(int id);
|
||||||
THE_TIMER *find_timer(int id);
|
THE_TIMER *find_timer(int id);
|
||||||
void objekty_mimo();
|
void objekty_mimo(void);
|
||||||
void mouse_set_cursor(int cursor);
|
void mouse_set_cursor(int cursor);
|
||||||
void set_font(int font,int c1,...);
|
void set_font(int font,int c1,...);
|
||||||
void bott_draw(char);
|
void bott_draw(char);
|
||||||
void bott_draw_proc();
|
void bott_draw_proc(void **p,int32_t *s);
|
||||||
THE_TIMER *add_to_timer(int id,int delay,int maxcall,void *proc);
|
THE_TIMER *add_to_timer(int id,int delay,int maxcall,void *proc);
|
||||||
void mouse_set_default(int cursor);
|
void mouse_set_default(int cursor);
|
||||||
void create_frame(int x,int y,int xs,int ys,char clear);
|
void create_frame(int x,int y,int xs,int ys,char clear);
|
||||||
|
@ -651,19 +651,19 @@ void save_dump(const uint16_t *screen_addr,
|
||||||
unsigned int height,
|
unsigned int height,
|
||||||
unsigned int linelen);
|
unsigned int linelen);
|
||||||
void bott_disp_text(const char *);
|
void bott_disp_text(const char *);
|
||||||
void bott_text_forever();
|
void bott_text_forever(void);
|
||||||
char chod_s_postavama(char sekupit);
|
char chod_s_postavama(char sekupit);
|
||||||
void hide_ms_at(int line); //schova mysku ktera je nad line
|
void hide_ms_at(int line); //schova mysku ktera je nad line
|
||||||
int cislovka(int i);
|
int cislovka(int i);
|
||||||
void wire_kniha();
|
void wire_kniha(void);
|
||||||
void purge_temps(char z); //z=1 vymaze i swapsoubor
|
void purge_temps(char z); //z=1 vymaze i swapsoubor
|
||||||
void destroy_player_map(); //je nutne volat pred presunem postav
|
void destroy_player_map(void); //je nutne volat pred presunem postav
|
||||||
void build_player_map(); //je nutne volat po presunem postav
|
void build_player_map(void); //je nutne volat po presunem postav
|
||||||
int postavy_propadnout(int sector);
|
int postavy_propadnout(int sector);
|
||||||
void postavy_teleport_effect(int sector,int dir,int postava,char eff);
|
void postavy_teleport_effect(int sector,int dir,int postava,char eff);
|
||||||
void reg_grafiku_postav();
|
void reg_grafiku_postav(void);
|
||||||
void play_movie_seq(char *s,int y);
|
void play_movie_seq(char *s,int y);
|
||||||
void check_postavy_teleport(); //je-li viewsector=teleport pak presune postavy
|
void check_postavy_teleport(void); //je-li viewsector=teleport pak presune postavy
|
||||||
|
|
||||||
//builder
|
//builder
|
||||||
#define MAIN_NUM 0
|
#define MAIN_NUM 0
|
||||||
|
@ -702,7 +702,7 @@ void add_spectxtr(word sector,word fhandle,word count,word repeat,integer xpos);
|
||||||
void calc_spectxtrs(void);
|
void calc_spectxtrs(void);
|
||||||
void init_spectxtrs(void);
|
void init_spectxtrs(void);
|
||||||
void play_fx(int x,int y);
|
void play_fx(int x,int y);
|
||||||
void draw_fx();
|
void draw_fx(void);
|
||||||
void play_fx_at(int where);
|
void play_fx_at(int where);
|
||||||
void draw_blood(char mode,int mob_dostal,int mob_dostal_pocet);
|
void draw_blood(char mode,int mob_dostal,int mob_dostal_pocet);
|
||||||
//kresli krev. mode=1 nasaveni, mode=0 kresleni, pri mode=0 se parametry ignoruji
|
//kresli krev. mode=1 nasaveni, mode=0 kresleni, pri mode=0 se parametry ignoruji
|
||||||
|
@ -728,19 +728,19 @@ void delay_action(int action_numb,int sector,int direct,int flags,int nosend,int
|
||||||
int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size);
|
int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size);
|
||||||
void prepare_graphics(int *ofs,char *names,int32_t size,void *decomp,int class);
|
void prepare_graphics(int *ofs,char *names,int32_t size,void *decomp,int class);
|
||||||
void show_automap(char full);
|
void show_automap(char full);
|
||||||
void draw_medium_map();
|
void draw_medium_map(void);
|
||||||
void anim_sipky(int h,int mode);
|
void anim_sipky(int h,int mode);
|
||||||
void redraw_scene();
|
void redraw_scene(void);
|
||||||
void calc_game();
|
void calc_game(void);
|
||||||
void do_delay_actions();
|
void do_delay_actions(void);
|
||||||
void real_krok(EVENT_MSG *msg,void **data);
|
void real_krok(EVENT_MSG *msg,void **data);
|
||||||
void sort_groups();
|
void sort_groups(void);
|
||||||
void recheck_button(int sector,char auto_action);
|
void recheck_button(int sector,char auto_action);
|
||||||
void start_dialog(int entr,int mob);
|
void start_dialog(int entr,int mob);
|
||||||
void show_money();
|
void show_money(void);
|
||||||
void chveni(int i);
|
void chveni(int i);
|
||||||
void render_scene(int,int);
|
void render_scene(int,int);
|
||||||
void bott_draw_fletna();
|
void bott_draw_fletna(void);
|
||||||
void bott_disp_rune(char rune, int item);
|
void bott_disp_rune(char rune, int item);
|
||||||
extern char noarrows;
|
extern char noarrows;
|
||||||
void display_ver(int x,int y,int ax,int ay);
|
void display_ver(int x,int y,int ax,int ay);
|
||||||
|
@ -882,7 +882,7 @@ typedef struct titem
|
||||||
short user_value; //146 uzivatelska hodnota
|
short user_value; //146 uzivatelska hodnota
|
||||||
short keynum; //148 cislo klice
|
short keynum; //148 cislo klice
|
||||||
short polohy[2][2]; //156 souradnice poloh pro zobrazeni v inv
|
short polohy[2][2]; //156 souradnice poloh pro zobrazeni v inv
|
||||||
char typ_zbrane; //160 Typ zbrane
|
uint8_t typ_zbrane; //160 Typ zbrane
|
||||||
char unused;
|
char unused;
|
||||||
short sound; //cislo zvuku
|
short sound; //cislo zvuku
|
||||||
short v_letu[16]; //192
|
short v_letu[16]; //192
|
||||||
|
@ -908,9 +908,9 @@ typedef struct thuman
|
||||||
{
|
{
|
||||||
char used; //1 kdyz je pozice pouzita
|
char used; //1 kdyz je pozice pouzita
|
||||||
char spell; //1 kdyz postava ma na sobe aspon 1 kouzlo.
|
char spell; //1 kdyz postava ma na sobe aspon 1 kouzlo.
|
||||||
char groupnum; //cislo skupiny 0-6
|
uint8_t groupnum; //cislo skupiny 0-6
|
||||||
signed char xicht; //cislo obliceje 0-5
|
int8_t xicht; //cislo obliceje 0-5
|
||||||
char direction; //smer otoceni
|
uint8_t direction; //smer otoceni
|
||||||
short sektor; //sektor postaveni
|
short sektor; //sektor postaveni
|
||||||
short vlastnosti[VLS_MAX]; //mapa aktualnich vlastnosti po korekcich
|
short vlastnosti[VLS_MAX]; //mapa aktualnich vlastnosti po korekcich
|
||||||
short bonus_zbrani[TPW_MAX]; //bonusy za zbrane
|
short bonus_zbrani[TPW_MAX]; //bonusy za zbrane
|
||||||
|
@ -954,19 +954,19 @@ extern int face_arr[IT_FACES];
|
||||||
char pick_item_(int id,int xa,int ya,int xr,int yr);
|
char pick_item_(int id,int xa,int ya,int xr,int yr);
|
||||||
void wire_inv_mode(THUMAN *select);
|
void wire_inv_mode(THUMAN *select);
|
||||||
void init_inventory(void);
|
void init_inventory(void);
|
||||||
void init_items();
|
void init_items(void);
|
||||||
void push_item(int sect,int pos,short *picked_item);
|
void push_item(int sect,int pos,short *picked_item);
|
||||||
void pop_item(int sect,int pos,int mask,short **picked_item);
|
void pop_item(int sect,int pos,int mask,short **picked_item);
|
||||||
int count_items_inside(short *place);
|
int count_items_inside(short *place);
|
||||||
int count_items_total(short *place);
|
int count_items_total(short *place);
|
||||||
char put_item_to_inv(THUMAN *p,short *picked_items); //funkce vklada predmet(y) do batohu postavy
|
char put_item_to_inv(THUMAN *p,short *picked_items); //funkce vklada predmet(y) do batohu postavy
|
||||||
void pick_set_cursor(); //nastavuje kurzor podle vlozeneho predmetu;
|
void pick_set_cursor(void); //nastavuje kurzor podle vlozeneho predmetu;
|
||||||
void calc_fly();
|
void calc_fly(void);
|
||||||
void zmen_skupinu(THUMAN *p);
|
void zmen_skupinu(THUMAN *p);
|
||||||
void add_to_group(int num);
|
void add_to_group(int num);
|
||||||
void group_all(void);
|
void group_all(void);
|
||||||
void build_items_called(void **p,int32_t *s);
|
void build_items_called(void **p,int32_t *s);
|
||||||
void real_regeneration(); //regenerace postav behem hry v realu (pouze kondice a mana)
|
void real_regeneration(void); //regenerace postav behem hry v realu (pouze kondice a mana)
|
||||||
char sleep_regenerace(THUMAN *p); //regenerace postav behem spani
|
char sleep_regenerace(THUMAN *p); //regenerace postav behem spani
|
||||||
char check_jidlo_voda(THUMAN *p);
|
char check_jidlo_voda(THUMAN *p);
|
||||||
void prepocitat_postavu(THUMAN *human_selected);
|
void prepocitat_postavu(THUMAN *human_selected);
|
||||||
|
@ -1015,9 +1015,9 @@ typedef struct tshop
|
||||||
|
|
||||||
void enter_shop(int shopid);
|
void enter_shop(int shopid);
|
||||||
void load_shops(void);
|
void load_shops(void);
|
||||||
void reroll_all_shops();
|
void reroll_all_shops(void);
|
||||||
char save_shops();
|
char save_shops(void);
|
||||||
char load_saved_shops();
|
char load_saved_shops(void);
|
||||||
|
|
||||||
//macros
|
//macros
|
||||||
|
|
||||||
|
@ -1146,10 +1146,10 @@ typedef struct tma_gen
|
||||||
|
|
||||||
typedef struct tma_sound
|
typedef struct tma_sound
|
||||||
{
|
{
|
||||||
char action,flags,eflags; //3
|
uint8_t action,flags,eflags; //3
|
||||||
char bit16;
|
uint8_t bit16;
|
||||||
char volume; //5
|
uint8_t volume; //5
|
||||||
char soundid; //6
|
uint8_t soundid; //6
|
||||||
unsigned short freq; //8
|
unsigned short freq; //8
|
||||||
int32_t start_loop,end_loop,offset;//20
|
int32_t start_loop,end_loop,offset;//20
|
||||||
char filename[12]; //32
|
char filename[12]; //32
|
||||||
|
@ -1158,26 +1158,26 @@ typedef struct tma_sound
|
||||||
|
|
||||||
typedef struct tma_text
|
typedef struct tma_text
|
||||||
{
|
{
|
||||||
char action,flags,eflags,pflags;
|
uint8_t action,flags,eflags,pflags;
|
||||||
int32_t textindex;
|
int32_t textindex;
|
||||||
}TMA_TEXT;
|
}TMA_TEXT;
|
||||||
|
|
||||||
typedef struct tma_send_action
|
typedef struct tma_send_action
|
||||||
{
|
{
|
||||||
char action,flags,eflags,change_bits;
|
uint8_t action,flags,eflags,change_bits;
|
||||||
unsigned short sector,side,s_action;
|
unsigned short sector,side,s_action;
|
||||||
char delay;
|
char delay;
|
||||||
}TMA_SEND_ACTION;
|
}TMA_SEND_ACTION;
|
||||||
|
|
||||||
typedef struct tma_fireball
|
typedef struct tma_fireball
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
short xpos,ypos,zpos,speed,item;
|
short xpos,ypos,zpos,speed,item;
|
||||||
}TMA_FIREBALL;
|
}TMA_FIREBALL;
|
||||||
|
|
||||||
typedef struct tma_loadlev
|
typedef struct tma_loadlev
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
short start_pos;
|
short start_pos;
|
||||||
char dir;
|
char dir;
|
||||||
char name[13];
|
char name[13];
|
||||||
|
@ -1187,13 +1187,13 @@ typedef struct tma_loadlev
|
||||||
|
|
||||||
typedef struct tma_dropitm
|
typedef struct tma_dropitm
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
short item;
|
short item;
|
||||||
}TMA_DROPITM;
|
}TMA_DROPITM;
|
||||||
|
|
||||||
typedef struct tma_codelock
|
typedef struct tma_codelock
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
char znak;
|
char znak;
|
||||||
char string[8];
|
char string[8];
|
||||||
char codenum;
|
char codenum;
|
||||||
|
@ -1201,19 +1201,19 @@ typedef struct tma_codelock
|
||||||
|
|
||||||
typedef struct tma_cancelaction
|
typedef struct tma_cancelaction
|
||||||
{
|
{
|
||||||
char action,flags,eflags,pflags;
|
uint8_t action,flags,eflags,pflags;
|
||||||
short sector,dir;
|
short sector,dir;
|
||||||
}TMA_ACTN;
|
}TMA_ACTN;
|
||||||
|
|
||||||
typedef struct tma_swapsectors
|
typedef struct tma_swapsectors
|
||||||
{
|
{
|
||||||
char action,flags,eflags,pflags;
|
uint8_t action,flags,eflags,pflags;
|
||||||
short sector1,sector2;
|
short sector1,sector2;
|
||||||
}TMA_SWAPS;
|
}TMA_SWAPS;
|
||||||
|
|
||||||
typedef struct tma_wound
|
typedef struct tma_wound
|
||||||
{
|
{
|
||||||
char action,flags,eflags,pflags;
|
uint8_t action,flags,eflags,pflags;
|
||||||
short minor,major;
|
short minor,major;
|
||||||
}TMA_WOUND;
|
}TMA_WOUND;
|
||||||
|
|
||||||
|
@ -1221,26 +1221,26 @@ typedef struct tma_wound
|
||||||
|
|
||||||
typedef struct tma_lock
|
typedef struct tma_lock
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
short key_id;
|
short key_id;
|
||||||
short thieflevel;
|
short thieflevel;
|
||||||
}TMA_LOCK;
|
}TMA_LOCK;
|
||||||
|
|
||||||
typedef struct tma_two_parms
|
typedef struct tma_two_parms
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
short parm1,parm2;
|
short parm1,parm2;
|
||||||
}TMA_TWOP;
|
}TMA_TWOP;
|
||||||
|
|
||||||
typedef struct tma_create_unique
|
typedef struct tma_create_unique
|
||||||
{
|
{
|
||||||
char action,flags,eflags;
|
uint8_t action,flags,eflags;
|
||||||
TITEM item;
|
TITEM item;
|
||||||
}TMA_UNIQUE;
|
}TMA_UNIQUE;
|
||||||
|
|
||||||
typedef struct tma_globe
|
typedef struct tma_globe
|
||||||
{
|
{
|
||||||
char action,flags,eflags,event; //event - MAGLOB_XXXX
|
uint8_t action,flags,eflags,event; //event - MAGLOB_XXXX
|
||||||
unsigned short sector; //sektor of action target, when event occured
|
unsigned short sector; //sektor of action target, when event occured
|
||||||
unsigned char side; //side of action target, when event occured
|
unsigned char side; //side of action target, when event occured
|
||||||
unsigned char cancel; //1 - cancel event
|
unsigned char cancel; //1 - cancel event
|
||||||
|
@ -1341,20 +1341,20 @@ system jistotu ze vsechny pripadne kopie fly jsou znicene a neukazuji
|
||||||
ji mohl uvolnit
|
ji mohl uvolnit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LETICI_VEC *create_fly(); //vytvari fly - optimalizuje tim ze hleda nevyuzity fly nosice, a teprve pokud neuspeje alokuje novy prostor.
|
LETICI_VEC *create_fly(void); //vytvari fly - optimalizuje tim ze hleda nevyuzity fly nosice, a teprve pokud neuspeje alokuje novy prostor.
|
||||||
void draw_fly_items(int celx,int cely,int sector,int side);
|
void draw_fly_items(int celx,int cely,int sector,int side);
|
||||||
void add_fly(LETICI_VEC *p);
|
void add_fly(LETICI_VEC *p);
|
||||||
void build_fly_map();
|
void build_fly_map(void);
|
||||||
void destroy_fly_map();
|
void destroy_fly_map(void);
|
||||||
void stop_fly(LETICI_VEC *p,char zvuk);
|
void stop_fly(LETICI_VEC *p,char zvuk);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//gamesaver
|
//gamesaver
|
||||||
void leave_current_map();
|
void leave_current_map(void);
|
||||||
int save_map_state(); //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
int save_map_state(void); //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
||||||
int load_map_state(); //obnovuje stav mapy; nutno volat po zavolani load_map;
|
int load_map_state(void); //obnovuje stav mapy; nutno volat po zavolani load_map;
|
||||||
void restore_current_map(); //pouze obnovuje ulozeny stav aktualni mapy
|
void restore_current_map(void); //pouze obnovuje ulozeny stav aktualni mapy
|
||||||
int load_game(int slotnum);
|
int load_game(int slotnum);
|
||||||
int save_game(int slotnum,char *gamename);
|
int save_game(int slotnum,char *gamename);
|
||||||
void wire_save_load(char save);
|
void wire_save_load(char save);
|
||||||
|
@ -1367,10 +1367,10 @@ int load_map_automap(char *mapfile);
|
||||||
|
|
||||||
//setup
|
//setup
|
||||||
char q_runsetup(char *);
|
char q_runsetup(char *);
|
||||||
void user_setup();
|
void user_setup(void);
|
||||||
void setup_dialoge();
|
void setup_dialoge(void);
|
||||||
char game_setup(int id,int xa,int ya,int xr,int yr);
|
char game_setup(int id,int xa,int ya,int xr,int yr);
|
||||||
void GamePause();
|
void GamePause(void);
|
||||||
typedef struct ctl3d CTL3D;
|
typedef struct ctl3d CTL3D;
|
||||||
void show_textured_button(int x,int y,int xs,int ys,int texture,CTL3D *border3d);
|
void show_textured_button(int x,int y,int xs,int ys,int texture,CTL3D *border3d);
|
||||||
|
|
||||||
|
@ -1379,29 +1379,29 @@ void show_textured_button(int x,int y,int xs,int ys,int texture,CTL3D *border3d)
|
||||||
extern short sample_volume; //hlastitost samplu
|
extern short sample_volume; //hlastitost samplu
|
||||||
extern char **sound_table;
|
extern char **sound_table;
|
||||||
|
|
||||||
void init_tracks();
|
void init_tracks(void);
|
||||||
void recalc_volumes(int sector,int side);
|
void recalc_volumes(int sector,int side);
|
||||||
void play_effekt(int x,int y,int xd,int yd,int side,int sided,TMA_SOUND *p);
|
void play_effekt(int x,int y,int xd,int yd,int side,int sided,TMA_SOUND *p);
|
||||||
void create_playlist(char *playlist);
|
void create_playlist(char *playlist);
|
||||||
const char *get_next_music_from_playlist();
|
const char *get_next_music_from_playlist(void);
|
||||||
const char * end_of_song_callback(void *ctx);
|
const char * end_of_song_callback(void *ctx);
|
||||||
void purge_playlist();
|
void purge_playlist(void);
|
||||||
void restore_sound_names();
|
void restore_sound_names(void);
|
||||||
void play_sample_at_sector(int sample,int sector1,int sector2,int track, char loop);
|
void play_sample_at_sector(int sample,int sector1,int sector2,int track, char loop);
|
||||||
void play_sample_at_channel(int sample,int channel,int vol);
|
void play_sample_at_channel(int sample,int channel,int vol);
|
||||||
void stop_track(int track);
|
void stop_track(int track);
|
||||||
char test_playing(int track);
|
char test_playing(int track);
|
||||||
void stop_track_free(int track);
|
void stop_track_free(int track);
|
||||||
void mute_all_tracks(char all);
|
void mute_all_tracks(char all);
|
||||||
void kill_all_sounds();
|
void kill_all_sounds(void);
|
||||||
void create_sound_table(char *template,int32_t size);
|
void create_sound_table(char *template,int32_t size);
|
||||||
void create_sound_table_old();
|
void create_sound_table_old(void);
|
||||||
void start_play_flute(char );
|
void start_play_flute(char );
|
||||||
void stop_play_flute();
|
void stop_play_flute(void);
|
||||||
void pc_speak_play_sample(char *sample,int size,char step,int freq);
|
void pc_speak_play_sample(char *sample,int size,char step,int freq);
|
||||||
char enable_sound(char enbl);
|
char enable_sound(char enbl);
|
||||||
void wire_main_functs();
|
void wire_main_functs(void);
|
||||||
void unwire_main_functs();
|
void unwire_main_functs(void);
|
||||||
|
|
||||||
//enemy
|
//enemy
|
||||||
#define MOBS_INV 16
|
#define MOBS_INV 16
|
||||||
|
@ -1480,23 +1480,23 @@ extern TMOB mobs[MAX_MOBS];
|
||||||
extern char *mob_map;
|
extern char *mob_map;
|
||||||
|
|
||||||
void draw_mob(int num,int curdir,int celx,int cely,char shiftup);
|
void draw_mob(int num,int curdir,int celx,int cely,char shiftup);
|
||||||
void calc_mobs();
|
void calc_mobs(void);
|
||||||
void najdi_cestu(word start,word konec,int flag,word **cesta, int aimbig);
|
void najdi_cestu(word start,word konec,int flag,word **cesta, int aimbig);
|
||||||
void sirit_zvuk(word start);
|
void sirit_zvuk(word start);
|
||||||
void check_all_mobs();
|
void check_all_mobs(void);
|
||||||
void build_all_players();
|
void build_all_players(void);
|
||||||
void init_mobs();
|
void init_mobs(void);
|
||||||
void refresh_mob_map();
|
void refresh_mob_map(void);
|
||||||
char akce_moba_zac(TMOB *m);
|
char akce_moba_zac(TMOB *m);
|
||||||
void mob_animuj(); //animuje prave bojovou akci potvor na sektoru
|
void mob_animuj(void); //animuje prave bojovou akci potvor na sektoru
|
||||||
void sleep_enemy(char regen);
|
void sleep_enemy(char regen);
|
||||||
int vyber_potvoru(int sect,int dir,int *z);
|
int vyber_potvoru(int sect,int dir,int *z);
|
||||||
void mob_hit(TMOB *mm,int dostal);
|
void mob_hit(TMOB *mm,int dostal);
|
||||||
int mob_alter(int sect);
|
int mob_alter(int sect);
|
||||||
void check_all_mobs_battle(); //kontroluje zda je nekdo v battle
|
void check_all_mobs_battle(void); //kontroluje zda je nekdo v battle
|
||||||
void manashield_check(short *vls,short *lives,short *mana,int dostal);
|
void manashield_check(short *vls,short *lives,short *mana,int dostal);
|
||||||
char track_mob(int sect,int dir);//trackuje pritomnost potvory v urcitem smeru
|
char track_mob(int sect,int dir);//trackuje pritomnost potvory v urcitem smeru
|
||||||
void stop_all_mobs();
|
void stop_all_mobs(void);
|
||||||
int utok_na_sektor(THUMAN *p,TMOB *m,int chaos,int bonus);
|
int utok_na_sektor(THUMAN *p,TMOB *m,int chaos,int bonus);
|
||||||
int vyber_potvoru(int sect,int dir,int *chaos); //vybere potvoru ze sektoru a smeru. Vraci take pocet potvor v promenne *chaos
|
int vyber_potvoru(int sect,int dir,int *chaos); //vybere potvoru ze sektoru a smeru. Vraci take pocet potvor v promenne *chaos
|
||||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize);
|
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize);
|
||||||
|
@ -1504,7 +1504,7 @@ char mob_test_na_bitvu(TMOB *p); //nastavi p->vlajky|MOB_INBATTLE pokud potvora
|
||||||
void send_mob_to(int m,word *path);
|
void send_mob_to(int m,word *path);
|
||||||
void save_enemy_paths(TMPFILE_WR *f);
|
void save_enemy_paths(TMPFILE_WR *f);
|
||||||
int load_enemy_paths(TMPFILE_RD *f);
|
int load_enemy_paths(TMPFILE_RD *f);
|
||||||
void regen_all_mobs();
|
void regen_all_mobs(void);
|
||||||
|
|
||||||
|
|
||||||
//souboje
|
//souboje
|
||||||
|
@ -1521,26 +1521,26 @@ extern char running_battle;
|
||||||
void zacni_souboj(TMOB *p,int delka,short sector);
|
void zacni_souboj(TMOB *p,int delka,short sector);
|
||||||
char q_zacit_souboj(TMOB *p,int d,short sector);
|
char q_zacit_souboj(TMOB *p,int d,short sector);
|
||||||
void stop_mob(TMOB *p);
|
void stop_mob(TMOB *p);
|
||||||
void start_battle();
|
void start_battle(void);
|
||||||
int vypocet_zasahu(short *utocnik,short *obrance, int chaos,int zbran,int bonusplus);
|
int vypocet_zasahu(short *utocnik,short *obrance, int chaos,int zbran,int bonusplus);
|
||||||
void rozhodni_o_smeru(TMOB *p);
|
void rozhodni_o_smeru(TMOB *p);
|
||||||
void krok_moba(TMOB *p);
|
void krok_moba(TMOB *p);
|
||||||
void pomala_regenerace_postavy(THUMAN *p);
|
void pomala_regenerace_postavy(THUMAN *p);
|
||||||
char zasah_veci(int sector,TFLY *fl);
|
char zasah_veci(int sector,TFLY *fl);
|
||||||
void vymaz_zasahy(THE_TIMER *q);
|
void vymaz_zasahy(THE_TIMER *q);
|
||||||
char check_end_game();
|
char check_end_game(void);
|
||||||
void wire_end_game();
|
void wire_end_game(void);
|
||||||
void auto_group();
|
void auto_group(void);
|
||||||
void wire_fly_casting(int i);
|
void wire_fly_casting(int i);
|
||||||
void konec_kola();
|
void konec_kola(void);
|
||||||
void send_experience(TMOB *p,int dostal);
|
void send_experience(TMOB *p,int dostal);
|
||||||
void send_weapon_skill(int druh);
|
void send_weapon_skill(int druh);
|
||||||
void check_player_new_level(THUMAN *p);
|
void check_player_new_level(THUMAN *p);
|
||||||
void poloz_vsechny_predmety();
|
void poloz_vsechny_predmety(void);
|
||||||
char player_check_death(THUMAN *p, char afterround); //pokud je battle, nezabije postavu, ale az po skonceni kola (afterround==1)
|
char player_check_death(THUMAN *p, char afterround); //pokud je battle, nezabije postavu, ale az po skonceni kola (afterround==1)
|
||||||
char player_hit(THUMAN *p,int zraneni,char manashield);
|
char player_hit(THUMAN *p,int zraneni,char manashield);
|
||||||
void enforce_start_battle();
|
void enforce_start_battle(void);
|
||||||
void pozdrz_akci();
|
void pozdrz_akci(void);
|
||||||
void uprav_podle_kondice(THUMAN *p,int *chaos); //upravi parametr chaos podle kondice pro obranu
|
void uprav_podle_kondice(THUMAN *p,int *chaos); //upravi parametr chaos podle kondice pro obranu
|
||||||
THUMAN *isplayer(int sector,THUMAN *h,char death);
|
THUMAN *isplayer(int sector,THUMAN *h,char death);
|
||||||
/* Vraci nasledujiciho hrace na sektoru. Pokud je h==NULL vraci prvniho.
|
/* Vraci nasledujiciho hrace na sektoru. Pokud je h==NULL vraci prvniho.
|
||||||
|
@ -1556,7 +1556,7 @@ TMOB *ismonster(int sector,TMOB *m);
|
||||||
/* Vraci dalsi nestvuru na sektoru, pokud je m==NULL vraci prvni.
|
/* Vraci dalsi nestvuru na sektoru, pokud je m==NULL vraci prvni.
|
||||||
Pokud je vysledek NULL neni nestvura na sektoru*/
|
Pokud je vysledek NULL neni nestvura na sektoru*/
|
||||||
|
|
||||||
void correct_level();
|
void correct_level(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1570,7 +1570,7 @@ extern char spell_cast; //0=neni rezim vyberu kouzla;
|
||||||
#define isdemon(p) ((p)->stare_vls[VLS_KOUZLA] & SPL_DEMON)
|
#define isdemon(p) ((p)->stare_vls[VLS_KOUZLA] & SPL_DEMON)
|
||||||
|
|
||||||
|
|
||||||
void kouzla_init();
|
void kouzla_init(void);
|
||||||
void test_play(int handle);
|
void test_play(int handle);
|
||||||
void cast(int num,THUMAN *p,int owner,char backfire);
|
void cast(int num,THUMAN *p,int owner,char backfire);
|
||||||
int add_spell(int num,int cil,int owner,char noanim);
|
int add_spell(int num,int cil,int owner,char noanim);
|
||||||
|
@ -1581,22 +1581,23 @@ int get_spell_mana(int num);
|
||||||
int get_spell_um(int num);
|
int get_spell_um(int num);
|
||||||
char ask_who(int num);
|
char ask_who(int num);
|
||||||
void display_spell_in_icone(int handle,int xicht);
|
void display_spell_in_icone(int handle,int xicht);
|
||||||
void reinit_kouzla_full();
|
void reinit_kouzla_full(void);
|
||||||
char get_rune_enable(THUMAN *p,int strnum);
|
char get_rune_enable(THUMAN *p,int strnum);
|
||||||
void remove_all_mob_spells();
|
void remove_all_mob_spells(void);
|
||||||
int save_spells(TMPFILE_WR *f);
|
int save_spells(TMPFILE_WR *f);
|
||||||
int load_spells(TMPFILE_RD *f);
|
int load_spells(TMPFILE_RD *f);
|
||||||
char get_spell_track(int num);
|
char get_spell_track(int num);
|
||||||
void mob_cast(int num,TMOB *m,int mob_num);
|
void mob_cast(int num,TMOB *m,int mob_num);
|
||||||
void thing_cast(int num,int postava,int sector,TMOB *victim,char noanim);//vyvolavaji veci
|
void thing_cast(int num,int postava,int sector,TMOB *victim,char noanim);//vyvolavaji veci
|
||||||
void area_cast(int num,int sector,int owner,char noanim);
|
void area_cast(int num,int sector,int owner,char noanim);
|
||||||
int select_teleport_target();
|
int select_teleport_target(void);
|
||||||
char get_spell_teleport(int num);
|
char get_spell_teleport(int num);
|
||||||
void spell_throw(int cil,int what); //to je procedura ktera umoznuje potvoram strilet
|
void spell_throw(int cil,int what); //to je procedura ktera umoznuje potvoram strilet
|
||||||
void play_big_mgif_animation(int block);
|
void play_big_mgif_animation(int block);
|
||||||
void unaffect_demon(int cil); //ukonci demona pri jeho smrti
|
void unaffect_demon(int cil); //ukonci demona pri jeho smrti
|
||||||
char *get_rune_name(int strnum);
|
char *get_rune_name(int strnum);
|
||||||
void spell_sound(char *name);
|
void spell_sound(char *name);
|
||||||
|
void spell_teleport(int cil,int owner, int teleport_target);
|
||||||
|
|
||||||
|
|
||||||
//interface
|
//interface
|
||||||
|
@ -1609,6 +1610,7 @@ void spell_sound(char *name);
|
||||||
#define S_WINPOS_XS 320
|
#define S_WINPOS_XS 320
|
||||||
#define S_WINPOS_YS 300
|
#define S_WINPOS_YS 300
|
||||||
|
|
||||||
|
typedef struct objrec OBJREC;
|
||||||
typedef struct enc_file
|
typedef struct enc_file
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
@ -1617,13 +1619,13 @@ typedef struct enc_file
|
||||||
|
|
||||||
void add_window(int x,int y,int xs,int ys,int texture,int border,int txtx,int txty);
|
void add_window(int x,int y,int xs,int ys,int texture,int border,int txtx,int txty);
|
||||||
int message(int butts,char def,char canc,char *keys,...);
|
int message(int butts,char def,char canc,char *keys,...);
|
||||||
void type_text(); //event procedura (parms: X,Y,TEXT,MAX_SPACE,MAX_CHARS);
|
void type_text(EVENT_MSG *msg,void **data); //event procedura (parms: X,Y,TEXT,MAX_SPACE,MAX_CHARS);
|
||||||
void type_text_v2(va_list args);//char *text_buffer,int x,int y,int max_size,int max_chars,int font,int color,void (*exit_proc)(char));
|
void type_text_v2(va_list args);//char *text_buffer,int x,int y,int max_size,int max_chars,int font,int color,void (*exit_proc)(char));
|
||||||
void zalamovani(char *source,char *target,int maxxs,int *xs,int *ys);
|
void zalamovani(char *source,char *target,int maxxs,int *xs,int *ys);
|
||||||
void col_load(void **data,int32_t *size);
|
void col_load(void **data,int32_t *size);
|
||||||
void open_story_file();
|
void open_story_file(void);
|
||||||
void write_story_text(char *text);
|
void write_story_text(char *text);
|
||||||
void close_story_file();
|
void close_story_file(void);
|
||||||
char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word **cesta);
|
char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word **cesta);
|
||||||
//tato procedura je obecne hledani cesty. Start - startovni cislo sektoru
|
//tato procedura je obecne hledani cesty. Start - startovni cislo sektoru
|
||||||
//Konec - cilove cislo sektoru
|
//Konec - cilove cislo sektoru
|
||||||
|
@ -1631,27 +1633,28 @@ char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word
|
||||||
//proc - je procedura volana pro kazdy sektor
|
//proc - je procedura volana pro kazdy sektor
|
||||||
//cesta - je ukazatel na ukazatel na vyslednou cestu
|
//cesta - je ukazatel na ukazatel na vyslednou cestu
|
||||||
//pokud je cesta=NULL pak vraci pouze zda cesta existuje ci nikoliv
|
//pokud je cesta=NULL pak vraci pouze zda cesta existuje ci nikoliv
|
||||||
void radio_butts_gr();
|
void radio_butts_gr(OBJREC *o);
|
||||||
void start_check(); //testuje stav pocitace a rozhodne zda lze program spustit
|
void start_check(void); //testuje stav pocitace a rozhodne zda lze program spustit
|
||||||
void check_number_1phase(char *exename); //check serial number! Task!//
|
void check_number_1phase(char *exename); //check serial number! Task!//
|
||||||
void animate_checkbox(int first_id,int last_id,int step);
|
void animate_checkbox(int first_id,int last_id,int step);
|
||||||
void fletna_pridej_notu(char note);
|
void fletna_pridej_notu(char note);
|
||||||
void check_fletna();
|
void check_fletna(THE_TIMER *t);
|
||||||
char fletna_get_buffer_pos();
|
char fletna_get_buffer_pos(void);
|
||||||
void check_global_fletna();
|
void check_global_fletna(THE_TIMER *t);
|
||||||
void fletna_glob_add_note(char note);
|
void fletna_glob_add_note(uint8_t note);
|
||||||
|
|
||||||
|
|
||||||
char *find_map_path(char *filename); //vyhledava jmeno mapy v alternativnich cestach.
|
char *find_map_path(char *filename); //vyhledava jmeno mapy v alternativnich cestach.
|
||||||
//Vysledny retezec je nutne uvolnit (free) !
|
//Vysledny retezec je nutne uvolnit (free) !
|
||||||
char *enc_open(char *filename); //dekoduje a otevira TXT soubor (ENC)
|
TMPFILE_RD *enc_open(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,char *filename);
|
||||||
|
|
||||||
int smlouvat_nakup(int cena,int ponuka,int posledni,int puvod,int pocet);
|
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);
|
int smlouvat_prodej(int cena,int ponuka,int posledni,int puvod,int pocet);
|
||||||
int smlouvat(int cena,int puvod,int pocet,int money,char mode);
|
int smlouvat(int cena,int puvod,int pocet,int money,char mode);
|
||||||
|
|
||||||
void disable_intro();
|
void disable_intro(void);
|
||||||
void show_jrc_logo(char *filename);
|
void show_jrc_logo(char *filename);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1667,15 +1670,15 @@ char test_flag(int flag); //vraci stav vlajky;
|
||||||
|
|
||||||
|
|
||||||
//generator
|
//generator
|
||||||
char enter_generator();
|
char enter_generator(void);
|
||||||
|
|
||||||
//kniha
|
//kniha
|
||||||
#define add_to_book(odst) add_text_to_book(texty_knihy,odst)
|
#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(char *filename,int odst);
|
||||||
void write_book(int page);
|
void write_book(int page);
|
||||||
int count_pages();
|
int count_pages(void);
|
||||||
void save_book();
|
void save_book(void);
|
||||||
void load_book();
|
void load_book(void);
|
||||||
void prekodovat(char *c);
|
void prekodovat(char *c);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1684,14 +1687,16 @@ int enter_menu(char open); //task!
|
||||||
void titles(va_list args); //task!
|
void titles(va_list args); //task!
|
||||||
void run_titles(va_list args); //task!
|
void run_titles(va_list args); //task!
|
||||||
void effect_show(va_list args); //effektni zobrazeni // task!
|
void effect_show(va_list args); //effektni zobrazeni // task!
|
||||||
void konec_hry();
|
void konec_hry(void);
|
||||||
|
|
||||||
|
|
||||||
//globmap
|
//globmap
|
||||||
void wire_global_map();
|
void wire_global_map(void);
|
||||||
void wire_automap_file(char *mapfile);
|
void wire_automap_file(char *mapfile);
|
||||||
char set_select_mode(char mode);
|
char set_select_mode(char mode);
|
||||||
|
|
||||||
|
void macro_load_another_map(TMA_LOADLEV *);
|
||||||
|
|
||||||
void PodporaStitu(THUMAN *h, short *vlastnosti);
|
void PodporaStitu(THUMAN *h, short *vlastnosti);
|
||||||
|
|
||||||
typedef struct _tag_globalEventDef
|
typedef struct _tag_globalEventDef
|
||||||
|
|
|
@ -41,7 +41,7 @@ typedef struct index_def
|
||||||
}INDEX_DEF;
|
}INDEX_DEF;
|
||||||
|
|
||||||
static INDEX_DEF *index_tab=NULL;
|
static INDEX_DEF *index_tab=NULL;
|
||||||
static char last_index=1;
|
static uint8_t last_index=1;
|
||||||
|
|
||||||
static int usemap;
|
static int usemap;
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ static int find_leave_place(int sector)
|
||||||
return found_place;
|
return found_place;
|
||||||
}
|
}
|
||||||
|
|
||||||
int macro_load_another_map();
|
|
||||||
|
|
||||||
static int select_mode = 0;
|
static int select_mode = 0;
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ static char *fly_text;
|
||||||
static int fly_x,fly_y,fly_xs,fly_ys;
|
static int fly_x,fly_y,fly_xs,fly_ys;
|
||||||
static void *fly_background;
|
static void *fly_background;
|
||||||
|
|
||||||
void global_map_point(EVENT_MSG *msg,void **)
|
void global_map_point(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
MS_EVENT *ms;
|
MS_EVENT *ms;
|
||||||
|
|
||||||
|
|
121
game/interfac.c
121
game/interfac.c
|
@ -30,7 +30,6 @@
|
||||||
#define MES_MAXSIZE 500
|
#define MES_MAXSIZE 500
|
||||||
#define CHECK_BOX_ANIM 6
|
#define CHECK_BOX_ANIM 6
|
||||||
|
|
||||||
static char *error_hack="....Source compiled.";
|
|
||||||
static char shadow_enabled=1;
|
static char shadow_enabled=1;
|
||||||
|
|
||||||
word color_topbar[7]={0,RGB555(22,14,4),RGB555(24,16,6),RGB555(25,17,7)};
|
word color_topbar[7]={0,RGB555(22,14,4),RGB555(24,16,6),RGB555(25,17,7)};
|
||||||
|
@ -301,14 +300,15 @@ int message(int butts,char def,char canc,char *keys,...)
|
||||||
void type_text(EVENT_MSG *msg,void **data)
|
void type_text(EVENT_MSG *msg,void **data)
|
||||||
{
|
{
|
||||||
static int x,y;
|
static int x,y;
|
||||||
static char text[255],index;
|
static char text[255];
|
||||||
|
static uint8_t index;
|
||||||
static char *source;
|
static char *source;
|
||||||
static int max_size,max_chars;
|
static int max_size,max_chars;
|
||||||
|
|
||||||
data;
|
data;
|
||||||
if (msg->msg==E_INIT)
|
if (msg->msg==E_INIT)
|
||||||
{
|
{
|
||||||
int *p;
|
// int *p;
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
set_font(H_FBOLD,RGB555(31,31,31));
|
set_font(H_FBOLD,RGB555(31,31,31));
|
||||||
|
@ -387,7 +387,8 @@ void type_text_v2(va_list args)
|
||||||
type_text_exit_proc exit_proc=va_arg(args,type_text_exit_proc);
|
type_text_exit_proc exit_proc=va_arg(args,type_text_exit_proc);
|
||||||
|
|
||||||
int xs,ys,tw;
|
int xs,ys,tw;
|
||||||
char *text,pos,len;
|
char *text;
|
||||||
|
uint8_t pos,len;
|
||||||
char wait_loop=1,ok=0,edit=0;
|
char wait_loop=1,ok=0,edit=0;
|
||||||
short *back_pic;
|
short *back_pic;
|
||||||
int i;
|
int i;
|
||||||
|
@ -533,7 +534,7 @@ char labyrinth_find_path(word start,word konec,int flag,char (*proc)(word),word
|
||||||
ok_flags[start>>3]|=1<<(start & 0x7);
|
ok_flags[start>>3]|=1<<(start & 0x7);
|
||||||
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
for(*stk_free++=start;stk_free!=stk_cur;stk_cur++)
|
||||||
{
|
{
|
||||||
char i;word s,d,ss;
|
uint8_t i;word s,d,ss;
|
||||||
s=(ss=Lo(*stk_cur))<<2;
|
s=(ss=Lo(*stk_cur))<<2;
|
||||||
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & flag))
|
for(i=0;i<4;i++) if (!(map_sides[s+i].flags & flag))
|
||||||
{
|
{
|
||||||
|
@ -1154,7 +1155,7 @@ void skeldal_soupak(OBJREC *o)
|
||||||
|
|
||||||
|
|
||||||
static char fletna_str[13];
|
static char fletna_str[13];
|
||||||
static char pos=0;
|
static uint8_t pos=0;
|
||||||
|
|
||||||
// C C# D D# E F F# G G# A A# B C
|
// C C# D D# E F F# G G# A A# B C
|
||||||
// A B C D E F G H I J K L M
|
// A B C D E F G H I J K L M
|
||||||
|
@ -1248,7 +1249,7 @@ char fletna_get_buffer_pos()
|
||||||
static char globFletnaStr[256]="";
|
static char globFletnaStr[256]="";
|
||||||
static char globNotes[][3]={"C","C#","D","D#","E","F","F#","G","G#","A","A#","H","C"};
|
static char globNotes[][3]={"C","C#","D","D#","E","F","F#","G","G#","A","A#","H","C"};
|
||||||
|
|
||||||
void fletna_glob_add_note(char note)
|
void fletna_glob_add_note(uint8_t note)
|
||||||
{
|
{
|
||||||
if (strlen(globFletnaStr)<250) strcat(globFletnaStr,globNotes[note]);
|
if (strlen(globFletnaStr)<250) strcat(globFletnaStr,globNotes[note]);
|
||||||
}
|
}
|
||||||
|
@ -1335,85 +1336,52 @@ static char *load_file_to_string(FILE *f, int *size) {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *enc_open(char *filename)
|
TMPFILE_RD *enc_open(char *filename)
|
||||||
{
|
{
|
||||||
FILE *f,*g;
|
FILE *f;
|
||||||
char *c,*d,*enc,*temp;
|
char *c,*enc;
|
||||||
int i,j,last=0;
|
int last=0;
|
||||||
int size;
|
int size;
|
||||||
|
char *encdata;
|
||||||
|
|
||||||
f=fopen(filename,"r");
|
f=fopen(filename,"r");
|
||||||
if (f!=NULL) {
|
if (f!=NULL) {
|
||||||
char *c = load_file_to_string(f, &size);
|
encdata = load_file_to_string(f, &size);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return c;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
enc=alloca(strlen(filename)+5);
|
enc=alloca(strlen(filename)+5);
|
||||||
strcpy(enc,filename);
|
strcpy(enc,filename);
|
||||||
c=strrchr(enc,'.');
|
c=strrchr(enc,'.');
|
||||||
if (c==NULL) c=strchr(enc,0);
|
if (c==NULL) c=strchr(enc,0);
|
||||||
strcpy(c,".ENC");
|
strcpy(c,".ENC");
|
||||||
f=fopen(enc,"rb");
|
f=fopen(enc,"rb");
|
||||||
if (f==NULL) return NULL;
|
if (f==NULL) return NULL;
|
||||||
char *encdata = load_file_to_string(f, &size);
|
encdata = load_file_to_string(f, &size);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
}
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
last = (last + encdata[i]) & 0xFF;
|
last = (last + encdata[i]) & 0xFF;
|
||||||
encdata[i] = last;
|
encdata[i] = last;
|
||||||
}
|
}
|
||||||
return encdata;
|
temp_storage_store("__enc_temp", encdata, size);
|
||||||
|
return temp_storage_open("__enc_temp");
|
||||||
}
|
}
|
||||||
|
|
||||||
void enc_close(ENCFILE *fil)
|
void enc_close(TMPFILE_RD *fil)
|
||||||
{
|
{
|
||||||
fclose(fil->f);
|
temp_storage_close_rd(fil);
|
||||||
if (fil->to_delete!=NULL) remove(fil->to_delete);
|
temp_storage_delete("__enc_temp");
|
||||||
free(fil->to_delete);
|
|
||||||
fil->f=NULL;
|
|
||||||
fil->to_delete=NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int load_string_list_ex(TSTR_LIST *list,char *filename)
|
int load_string_list_ex(TSTR_LIST *list,char *filename)
|
||||||
{
|
{
|
||||||
char *data = enc_open(filename);
|
|
||||||
if (data == NULL) return -1;
|
|
||||||
|
|
||||||
if (*list==NULL) *list=create_list(256);
|
|
||||||
char *d = data;
|
|
||||||
do {
|
|
||||||
while (*d && isspace(d)) ++d;
|
|
||||||
if (!*d) break;
|
|
||||||
if (*d && *d == ';') {
|
|
||||||
while (*d && *d != '\n') ++d;
|
|
||||||
} else {
|
|
||||||
int idx = 0;
|
|
||||||
int m = 1;
|
|
||||||
if (*d == '-') {m = -1;++d;}
|
|
||||||
while (*d >= '0' && *d <='9') {
|
|
||||||
idx = idx*10+(*d-'0');
|
|
||||||
++d;
|
|
||||||
}
|
|
||||||
if (idx == -1) break;
|
|
||||||
while (*d && isspace(d)) ++d;
|
|
||||||
char *b = d;
|
|
||||||
while (*d && *d != '\n' && *d != '\r') ++d;
|
|
||||||
if (*d) {*d = 0;++d;}
|
|
||||||
str_replace(list, idx, b);
|
|
||||||
}
|
|
||||||
} while (1);
|
|
||||||
free(data);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
char c[1024],*p;
|
char c[1024],*p;
|
||||||
int i,j,lin=0;
|
int i,j,lin=0;
|
||||||
FILE *f;
|
TMPFILE_RD *f;
|
||||||
ENCFILE fl;
|
|
||||||
|
|
||||||
|
f=enc_open(filename);
|
||||||
|
|
||||||
f=enc_open(filename,&fl);
|
|
||||||
if (*list==NULL) *list=create_list(256);
|
if (*list==NULL) *list=create_list(256);
|
||||||
if (f==NULL) return -1;
|
if (f==NULL) return -1;
|
||||||
do
|
do
|
||||||
|
@ -1421,44 +1389,43 @@ int load_string_list_ex(TSTR_LIST *list,char *filename)
|
||||||
lin++;
|
lin++;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
j=fgetc(f);
|
j=temp_storage_getc(f);
|
||||||
if (j==';') while ((j=fgetc(f))!='\n' && j!=EOF);
|
if (j==';') while ((j=temp_storage_getc(f))!='\n' && j!=EOF);
|
||||||
if (j=='\n') lin++;
|
if (j=='\n') lin++;
|
||||||
}
|
}
|
||||||
while (j=='\n');
|
while (j=='\n');
|
||||||
ungetc(j,f);
|
temp_storage_ungetc(f);
|
||||||
j=fscanf(f,"%d",&i);
|
j=temp_storage_scanf(f,"%d",&i);
|
||||||
if (j==EOF)
|
if (j==EOF)
|
||||||
{
|
{
|
||||||
enc_close(&fl);
|
enc_close(f);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
if (j!=1)
|
if (j!=1)
|
||||||
{
|
{
|
||||||
enc_close(&fl);
|
enc_close(f);
|
||||||
return lin;
|
return lin;
|
||||||
}
|
}
|
||||||
if (i==-1) break;
|
if (i==-1) break;
|
||||||
while ((j=fgetc(f))<33 && j!=EOF);
|
while ((j=temp_storage_getc(f))<33 && j!=EOF);
|
||||||
if (j!=EOF) ungetc(j,f);
|
if (j!=EOF) temp_storage_ungetc(f);
|
||||||
if (fgets(c,1022,f)==NULL)
|
if (temp_storage_gets(c,1022,f)==NULL)
|
||||||
{
|
{
|
||||||
enc_close(&fl);
|
enc_close(f);
|
||||||
return lin;
|
return lin;
|
||||||
}
|
}
|
||||||
p=strchr(c,'\n');if (p!=NULL) *p=0;
|
p=strchr(c,'\n');if (p!=NULL) *p=0;
|
||||||
for(p=c;*p;p++) *p=*p=='|'?'\n':*p;
|
for(p=c;*p;p++) *p=*p=='|'?'\n':*p;
|
||||||
if (str_replace(list,i,c)==NULL)
|
if (str_replace(list,i,c)==NULL)
|
||||||
{
|
{
|
||||||
enc_close(&fl);
|
enc_close(f);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (1);
|
while (1);
|
||||||
enc_close(&fl);
|
enc_close(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
int smlouvat_nakup(int cena,int ponuka,int posledni,int puvod,int pocet)
|
int smlouvat_nakup(int cena,int ponuka,int posledni,int puvod,int pocet)
|
||||||
|
|
41
game/inv.c
41
game/inv.c
|
@ -159,7 +159,7 @@ static void items_15to16_correct(void **p,int32_t *s)
|
||||||
void load_items()
|
void load_items()
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
FILE *f;THANDLE_DATA *h;
|
FILE *f;
|
||||||
int sect,i,hs;
|
int sect,i,hs;
|
||||||
int32_t size;
|
int32_t size;
|
||||||
void *p;
|
void *p;
|
||||||
|
@ -167,15 +167,15 @@ void load_items()
|
||||||
f=NULL;i=0;
|
f=NULL;i=0;
|
||||||
ikon_libs=hl_ptr;
|
ikon_libs=hl_ptr;
|
||||||
free(glob_items);
|
free(glob_items);
|
||||||
do
|
do {
|
||||||
{
|
char name[200];
|
||||||
char name[200];
|
sprintf(name, IT_LIB_NAME, i++);
|
||||||
sprintf(name,IT_LIB_NAME,i++);
|
if (test_file_exist(SR_ITEMS, name)) {
|
||||||
if (test_file_exist(SR_ITEMS,name))
|
def_handle(hl_ptr++, name, items_15to16_correct, SR_ITEMS);
|
||||||
h=def_handle(hl_ptr++,name,items_15to16_correct,SR_ITEMS);
|
} else {
|
||||||
else break;
|
break;
|
||||||
}
|
}
|
||||||
while (1);
|
} while (1);
|
||||||
name=find_map_path(ITEM_FILE);
|
name=find_map_path(ITEM_FILE);
|
||||||
f=fopen(name,"rb");free(name);
|
f=fopen(name,"rb");free(name);
|
||||||
if (f==NULL)
|
if (f==NULL)
|
||||||
|
@ -666,7 +666,7 @@ char pick_item_(int id,int xa,int ya,int xr,int yr)
|
||||||
{
|
{
|
||||||
int curinside=count_items_inside(picked_item);
|
int curinside=count_items_inside(picked_item);
|
||||||
int nosnost=(glob_items[*picked_item-1].nosnost);
|
int nosnost=(glob_items[*picked_item-1].nosnost);
|
||||||
short *batoh=(word *)getmem(nosnost*2+20);
|
short *batoh=(short *)getmem(nosnost*2+20);
|
||||||
short *cur=batoh;
|
short *cur=batoh;
|
||||||
memcpy(cur,picked_item,(curinside+1)*2);
|
memcpy(cur,picked_item,(curinside+1)*2);
|
||||||
cur+=curinside;
|
cur+=curinside;
|
||||||
|
@ -1115,7 +1115,7 @@ void init_inventory(void)
|
||||||
|
|
||||||
void display_items_in_inv(THUMAN *h)
|
void display_items_in_inv(THUMAN *h)
|
||||||
{
|
{
|
||||||
int i,x,y,xr,yr,it;
|
int i,x,xr,yr,it;
|
||||||
short *p;
|
short *p;
|
||||||
|
|
||||||
put_picture(266,TOP_OFS,ablock(H_IDESKA));
|
put_picture(266,TOP_OFS,ablock(H_IDESKA));
|
||||||
|
@ -1123,7 +1123,7 @@ void display_items_in_inv(THUMAN *h)
|
||||||
p[1]=INV_YS*((h->inv_size-1)/6)+58;
|
p[1]=INV_YS*((h->inv_size-1)/6)+58;
|
||||||
put_picture(INV_X,INV_Y,p);
|
put_picture(INV_X,INV_Y,p);
|
||||||
xr=INV_X;x=0;
|
xr=INV_X;x=0;
|
||||||
yr=INV_Y;y=0;
|
yr=INV_Y;
|
||||||
for(i=0;i<h->inv_size;i++)
|
for(i=0;i<h->inv_size;i++)
|
||||||
{
|
{
|
||||||
if ((it=h->inv[i])!=0)
|
if ((it=h->inv[i])!=0)
|
||||||
|
@ -1368,10 +1368,8 @@ static int calc_value(int parm,int lenght)
|
||||||
|
|
||||||
void inv_display_vlastnosti()
|
void inv_display_vlastnosti()
|
||||||
{
|
{
|
||||||
char b;
|
unsigned int i;
|
||||||
int i;
|
|
||||||
|
|
||||||
b=human_selected->bonus!=0;
|
|
||||||
put_picture(INV_DESK,TOP_OFS,ablock(H_SVITEK));
|
put_picture(INV_DESK,TOP_OFS,ablock(H_SVITEK));
|
||||||
for(i=0;i<sizeof(script)/sizeof(struct t_inv_script);i++)
|
for(i=0;i<sizeof(script)/sizeof(struct t_inv_script);i++)
|
||||||
{
|
{
|
||||||
|
@ -2064,7 +2062,7 @@ char human_click(int id,int xa,int ya,int xr,int yr)
|
||||||
|
|
||||||
|
|
||||||
xr;yr;id;
|
xr;yr;id;
|
||||||
if (battle && (battle_mode!=MD_PREZBROJIT || select_player!=human_selected-postavy) || human_selected->vlastnosti[VLS_KOUZLA] & SPL_STONED) return 0;
|
if ((battle && ((battle_mode!=MD_PREZBROJIT) || (select_player!=human_selected-postavy))) || (human_selected->vlastnosti[VLS_KOUZLA] & SPL_STONED)) return 0;
|
||||||
if (isdemon(human_selected)) return 0;
|
if (isdemon(human_selected)) return 0;
|
||||||
if (picked_item!=NULL)
|
if (picked_item!=NULL)
|
||||||
if (muze_nosit(*picked_item))
|
if (muze_nosit(*picked_item))
|
||||||
|
@ -2442,7 +2440,7 @@ static void rebuild_shops(void)
|
||||||
|
|
||||||
void load_shops(void)
|
void load_shops(void)
|
||||||
{
|
{
|
||||||
char *c;
|
|
||||||
int *d;
|
int *d;
|
||||||
if (!test_file_exist(SR_MAP,SHOP_NAME))
|
if (!test_file_exist(SR_MAP,SHOP_NAME))
|
||||||
{
|
{
|
||||||
|
@ -2451,7 +2449,7 @@ void load_shops(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
shop_hacek=afile(SHOP_NAME,SR_MAP,&shop_hacek_size);
|
shop_hacek=afile(SHOP_NAME,SR_MAP,&shop_hacek_size);
|
||||||
d=shop_hacek;c=shop_hacek;
|
d=shop_hacek;
|
||||||
max_shops=*d;
|
max_shops=*d;
|
||||||
if (!max_shops)
|
if (!max_shops)
|
||||||
{
|
{
|
||||||
|
@ -2887,7 +2885,7 @@ char shop_change_player(int id, int xa, int ya,int xr,int yr)
|
||||||
i=group_sort[i];
|
i=group_sort[i];
|
||||||
p=&postavy[i];
|
p=&postavy[i];
|
||||||
|
|
||||||
if (p->used && p->sektor==viewsector)
|
if (p->used && p->sektor==viewsector) {
|
||||||
if (ms_last_event.event_type & 0x2)
|
if (ms_last_event.event_type & 0x2)
|
||||||
{
|
{
|
||||||
int j=select_player;
|
int j=select_player;
|
||||||
|
@ -2915,6 +2913,7 @@ char shop_change_player(int id, int xa, int ya,int xr,int yr)
|
||||||
}
|
}
|
||||||
else if (picked_item==NULL) _exit_shop(id,xa,ya,xr,yr);
|
else if (picked_item==NULL) _exit_shop(id,xa,ya,xr,yr);
|
||||||
|
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2972,7 +2971,6 @@ void reroll_all_shops()
|
||||||
char save_shops()
|
char save_shops()
|
||||||
{
|
{
|
||||||
TMPFILE_WR *f;
|
TMPFILE_WR *f;
|
||||||
char *c;
|
|
||||||
int res=0;
|
int res=0;
|
||||||
|
|
||||||
SEND_LOG("(SHOP) Saving shops...",0,0);
|
SEND_LOG("(SHOP) Saving shops...",0,0);
|
||||||
|
@ -2990,7 +2988,6 @@ char save_shops()
|
||||||
char load_saved_shops()
|
char load_saved_shops()
|
||||||
{
|
{
|
||||||
TMPFILE_RD *f;
|
TMPFILE_RD *f;
|
||||||
char *c;
|
|
||||||
int res=0;
|
int res=0;
|
||||||
int i=0,j=0;
|
int i=0,j=0;
|
||||||
|
|
||||||
|
|
15
game/kniha.c
15
game/kniha.c
|
@ -552,22 +552,16 @@ static void seek_section(TMPFILE_RD *txt,int sect_number)
|
||||||
|
|
||||||
void add_text_to_book(char *filename,int odst)
|
void add_text_to_book(char *filename,int odst)
|
||||||
{
|
{
|
||||||
char *txt;
|
|
||||||
TMPFILE_RD *fl;
|
TMPFILE_RD *fl;
|
||||||
|
|
||||||
set_font(H_FKNIHA,NOSHADOW(0));
|
set_font(H_FKNIHA,NOSHADOW(0));
|
||||||
if (all_text==NULL) all_text=create_list(256);
|
if (all_text==NULL) all_text=create_list(256);
|
||||||
txt=enc_open(filename);
|
fl=enc_open(filename);
|
||||||
if (txt==NULL) return;
|
if (fl==NULL) return;
|
||||||
const char *bookenc = "__bookenc";
|
|
||||||
temp_storage_store(bookenc, txt, strlen(txt));
|
|
||||||
fl = temp_storage_open(bookenc);
|
|
||||||
seek_section(fl,odst);
|
seek_section(fl,odst);
|
||||||
read_text(fl);
|
read_text(fl);
|
||||||
next_line(1000);
|
next_line(1000);
|
||||||
free(txt);
|
enc_close(fl);
|
||||||
temp_storage_close_rd(fl);
|
|
||||||
temp_storage_delete(bookenc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *displ_picture(char *c)
|
static char *displ_picture(char *c)
|
||||||
|
@ -688,7 +682,6 @@ int count_pages()
|
||||||
|
|
||||||
void save_book()
|
void save_book()
|
||||||
{
|
{
|
||||||
char *c;
|
|
||||||
TMPFILE_WR *f;
|
TMPFILE_WR *f;
|
||||||
int i,ss;
|
int i,ss;
|
||||||
char *tx;
|
char *tx;
|
||||||
|
@ -708,8 +701,6 @@ void save_book()
|
||||||
|
|
||||||
void load_book()
|
void load_book()
|
||||||
{
|
{
|
||||||
char *c;
|
|
||||||
TMPFILE_RD *f;
|
|
||||||
|
|
||||||
if (all_text!=NULL) release_list(all_text);
|
if (all_text!=NULL) release_list(all_text);
|
||||||
all_text=NULL;
|
all_text=NULL;
|
||||||
|
|
|
@ -538,7 +538,7 @@ char hod_na_uspech(int cil,TKOUZLO *k)
|
||||||
cil=-cil-1;
|
cil=-cil-1;
|
||||||
p=mobs[cil].vlastnosti+VLS_OHEN;
|
p=mobs[cil].vlastnosti+VLS_OHEN;
|
||||||
}
|
}
|
||||||
else if(cil>0)
|
else
|
||||||
{
|
{
|
||||||
cil--;
|
cil--;
|
||||||
p=postavy[cil].vlastnosti+VLS_OHEN;
|
p=postavy[cil].vlastnosti+VLS_OHEN;
|
||||||
|
@ -698,7 +698,7 @@ static void spell_demon(int num,TKOUZLO *spl,int cil,int demon)
|
||||||
|
|
||||||
void spell_hit(int cil,int min,int max,int owner)
|
void spell_hit(int cil,int min,int max,int owner)
|
||||||
{
|
{
|
||||||
if (cil)
|
if (cil) {
|
||||||
if (cil<0)
|
if (cil<0)
|
||||||
{
|
{
|
||||||
TMOB *m;
|
TMOB *m;
|
||||||
|
@ -708,7 +708,7 @@ void spell_hit(int cil,int min,int max,int owner)
|
||||||
vybrana_zbran=-1;
|
vybrana_zbran=-1;
|
||||||
mob_hit(m,min+rnd(max-min));
|
mob_hit(m,min+rnd(max-min));
|
||||||
}
|
}
|
||||||
else if(cil>0)
|
else
|
||||||
{
|
{
|
||||||
THUMAN *h;
|
THUMAN *h;
|
||||||
int vysl;
|
int vysl;
|
||||||
|
@ -726,11 +726,12 @@ void spell_hit(int cil,int min,int max,int owner)
|
||||||
bott_draw(0);
|
bott_draw(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void spell_hit_zivel(int cil,int min,int max,int owner,int zivel)
|
void spell_hit_zivel(int cil,int min,int max,int owner,int zivel)
|
||||||
{
|
{
|
||||||
int ochrana;
|
int ochrana;
|
||||||
if (cil)
|
if (cil) {
|
||||||
if (cil<0)
|
if (cil<0)
|
||||||
{
|
{
|
||||||
TMOB *m;
|
TMOB *m;
|
||||||
|
@ -741,7 +742,7 @@ void spell_hit_zivel(int cil,int min,int max,int owner,int zivel)
|
||||||
vybrana_zbran=-1;
|
vybrana_zbran=-1;
|
||||||
mob_hit(m,(min+rnd(max-min))*ochrana/100);
|
mob_hit(m,(min+rnd(max-min))*ochrana/100);
|
||||||
}
|
}
|
||||||
else if(cil>0)
|
else
|
||||||
{
|
{
|
||||||
THUMAN *h;
|
THUMAN *h;
|
||||||
|
|
||||||
|
@ -752,6 +753,7 @@ void spell_hit_zivel(int cil,int min,int max,int owner,int zivel)
|
||||||
bott_draw(0);
|
bott_draw(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void set_flag(int num,int cil,int flag,int what)
|
void set_flag(int num,int cil,int flag,int what)
|
||||||
|
@ -893,13 +895,22 @@ void spell_teleport(int cil,int owner, int teleport_target)
|
||||||
{
|
{
|
||||||
int sektor;
|
int sektor;
|
||||||
int dir;
|
int dir;
|
||||||
int um;
|
int um = 255;
|
||||||
|
|
||||||
if (cil>0) {sektor=postavy[cil-1].sektor;dir=postavy[cil-1].direction;}
|
if (cil > 0) {
|
||||||
else if (cil<0) {sektor=mobs[-cil-1].sector;dir=mobs[-cil-1].dir;}
|
sektor = postavy[cil - 1].sektor;
|
||||||
if (owner>=0) um=postavy[owner].vlastnosti[VLS_SMAGIE];
|
dir = postavy[cil - 1].direction;
|
||||||
teleport_target=calculatePhaseDoor(sektor,dir,um);
|
} else if (cil < 0) {
|
||||||
}
|
sektor = mobs[-cil - 1].sector;
|
||||||
|
dir = mobs[-cil - 1].dir;
|
||||||
|
} else {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if (owner >= 0) {
|
||||||
|
um = postavy[owner].vlastnosti[VLS_SMAGIE];
|
||||||
|
}
|
||||||
|
teleport_target = calculatePhaseDoor(sektor, dir, um);
|
||||||
|
}
|
||||||
if (map_coord[teleport_target].flags & MC_NOSUMMON)
|
if (map_coord[teleport_target].flags & MC_NOSUMMON)
|
||||||
{
|
{
|
||||||
if (owner>=0) bott_disp_text(texty[88]);
|
if (owner>=0) bott_disp_text(texty[88]);
|
||||||
|
@ -955,7 +966,6 @@ void spell_teleport_sector(int cil,int owner)
|
||||||
destroy_player_map();
|
destroy_player_map();
|
||||||
if (stricmp(TelepLocation.map,level_fname)!=0)
|
if (stricmp(TelepLocation.map,level_fname)!=0)
|
||||||
{
|
{
|
||||||
int sector=postavy[cil].sektor;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (cil!=owner) return;
|
if (cil!=owner) return;
|
||||||
|
@ -1001,7 +1011,7 @@ void spell_teleport_sector(int cil,int owner)
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
int newx=x+TelepLocation.loc_x*stpx+TelepLocation.loc_y*diffx;
|
int newx=x+TelepLocation.loc_x*stpx+TelepLocation.loc_y*diffx;
|
||||||
int newy=y+TelepLocation.loc_x*stpx+TelepLocation.loc_y*diffy;
|
int newy=y+TelepLocation.loc_x*stpy+TelepLocation.loc_y*diffy;
|
||||||
int i;
|
int i;
|
||||||
int dist;
|
int dist;
|
||||||
int nearest=0;
|
int nearest=0;
|
||||||
|
@ -1040,7 +1050,7 @@ void spell_teleport_sector(int cil,int owner)
|
||||||
static void spell_summon(int cil)
|
static void spell_summon(int cil)
|
||||||
{
|
{
|
||||||
short sector,i,rn,rno,slc;
|
short sector,i,rn,rno,slc;
|
||||||
char stdir,p;
|
int stdir,p;
|
||||||
|
|
||||||
if (cil>0) sector=postavy[cil-1].sektor;
|
if (cil>0) sector=postavy[cil-1].sektor;
|
||||||
if (cil<0) sector=mobs[-cil-1].sector;
|
if (cil<0) sector=mobs[-cil-1].sector;
|
||||||
|
@ -1120,7 +1130,7 @@ static void spell_vahy_osudu(int zivel,char povaha)
|
||||||
for(i=0,h=postavy;i<POCET_POSTAV;i++,h++) if (h->used && h->lives)
|
for(i=0,h=postavy;i<POCET_POSTAV;i++,h++) if (h->used && h->lives)
|
||||||
{
|
{
|
||||||
int obr=mgochrana(h->vlastnosti[VLS_OHEN+zivel]);
|
int obr=mgochrana(h->vlastnosti[VLS_OHEN+zivel]);
|
||||||
if (!povaha || rnd(100)<=obr)
|
if (!povaha || (int)rnd(100)<=obr)
|
||||||
{
|
{
|
||||||
h->lives=min;
|
h->lives=min;
|
||||||
display_spell_in_icone(H_SPELLDEF,1<<i);
|
display_spell_in_icone(H_SPELLDEF,1<<i);
|
||||||
|
@ -1130,7 +1140,7 @@ static void spell_vahy_osudu(int zivel,char povaha)
|
||||||
if (m->vlajky & MOB_LIVE && m->vlajky & MOB_IN_BATTLE && m->lives<min)
|
if (m->vlajky & MOB_LIVE && m->vlajky & MOB_IN_BATTLE && m->lives<min)
|
||||||
{
|
{
|
||||||
int obr=mgochrana(m->vlastnosti[VLS_OHEN+zivel]);
|
int obr=mgochrana(m->vlastnosti[VLS_OHEN+zivel]);
|
||||||
if (!povaha || rnd(100)<=obr)
|
if (!povaha || (int)rnd(100)<=obr)
|
||||||
m->lives=min;
|
m->lives=min;
|
||||||
}
|
}
|
||||||
bott_draw(1);
|
bott_draw(1);
|
||||||
|
@ -1425,8 +1435,8 @@ void call_spell(int i)
|
||||||
case S_throw_item:z=GET_WORD(c);spell_throw(p->cil,z);break;
|
case S_throw_item:z=GET_WORD(c);spell_throw(p->cil,z);break;
|
||||||
case S_create_item:z=GET_WORD(c);spell_create(p->cil,z);break;
|
case S_create_item:z=GET_WORD(c);spell_create(p->cil,z);break;
|
||||||
case S_create_weapon:z=GET_WORD(c);spell_create_weapon(p->cil,z);break;
|
case S_create_weapon:z=GET_WORD(c);spell_create_weapon(p->cil,z);break;
|
||||||
case S_animace:if (p->owner>=0 && !p->traceon)spell_anim(c);c=strchr(c,0);c++;break;
|
case S_animace:if (p->owner>=0 && !p->traceon)spell_anim((char *)c);c=(unsigned char *)strchr((char *)c,0);c++;break;
|
||||||
case S_zvuk:if (p->owner>=0 && !p->traceon)spell_sound(c);c=strchr(c,0);c++;break;
|
case S_zvuk:if (p->owner>=0 && !p->traceon)spell_sound((char *)c);c=(unsigned char *)strchr((char *)c,0);c++;break;
|
||||||
case S_wait:p->wait=GET_WORD(c);if (p->owner>=0) ext=1;break;
|
case S_wait:p->wait=GET_WORD(c);if (p->owner>=0) ext=1;break;
|
||||||
case 0xff:spell_end(i,p->cil,p->owner);return;
|
case 0xff:spell_end(i,p->cil,p->owner);return;
|
||||||
case S_pvls:parm2=GET_WORD(c);twins|=2;
|
case S_pvls:parm2=GET_WORD(c);twins|=2;
|
||||||
|
@ -1447,14 +1457,14 @@ void call_spell(int i)
|
||||||
TelepLocation.loc_x=0;
|
TelepLocation.loc_x=0;
|
||||||
TelepLocation.loc_y=0;
|
TelepLocation.loc_y=0;
|
||||||
break;
|
break;
|
||||||
case S_location_map: TelepLocation.map=c;c=strchr(c,0);c++;break;
|
case S_location_map: TelepLocation.map=(char *)c;c=(unsigned char *)strchr((char *)c,0);c++;break;
|
||||||
case S_location_dir: parm1=GET_WORD(c);TelepLocation.dir=parm1;break;
|
case S_location_dir: parm1=GET_WORD(c);TelepLocation.dir=parm1;break;
|
||||||
case S_location_x: TelepLocation.loc_x=GET_WORD(c);TelepLocation.map=0;break;
|
case S_location_x: TelepLocation.loc_x=GET_WORD(c);TelepLocation.map=0;break;
|
||||||
case S_location_y: TelepLocation.loc_y=GET_WORD(c);TelepLocation.map=0;break;
|
case S_location_y: TelepLocation.loc_y=GET_WORD(c);TelepLocation.map=0;break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
char *d="Chyba v popisu kouzel: Program narazil na neznamou instrukci %d (%02X) pri zpracovani kouzla s cislem %d. Kouzlo bylo ukon<6F>eno";
|
char *d="Chyba v popisu kouzel: Program narazil na neznamou instrukci %d (%02X) pri zpracovani kouzla s cislem %d. Kouzlo bylo ukon<6F>eno";
|
||||||
c=alloca(strlen(d)+20);
|
char *c=alloca(strlen(d)+20);
|
||||||
sprintf(c,d,*(c-1),*(c-1),p->num);
|
sprintf(c,d,*(c-1),*(c-1),p->num);
|
||||||
bott_disp_text(c);
|
bott_disp_text(c);
|
||||||
spell_end(i,p->cil,p->owner);
|
spell_end(i,p->cil,p->owner);
|
||||||
|
@ -1609,7 +1619,7 @@ static char get_valid_sector(word sector)
|
||||||
|
|
||||||
void cast(int num,THUMAN *p,int owner, char backfire)
|
void cast(int num,THUMAN *p,int owner, char backfire)
|
||||||
{
|
{
|
||||||
int i,um,cil,num2;
|
int um,cil,num2;
|
||||||
TKOUZLO *k;
|
TKOUZLO *k;
|
||||||
|
|
||||||
if (num>511)
|
if (num>511)
|
||||||
|
@ -1680,8 +1690,9 @@ void cast(int num,THUMAN *p,int owner, char backfire)
|
||||||
if (!GlobEvent(MAGLOB_BEFOREMAGIC,p->sektor,p->direction)) return;
|
if (!GlobEvent(MAGLOB_BEFOREMAGIC,p->sektor,p->direction)) return;
|
||||||
if (!GlobEvents(MAGLOB_ONSPELLID1,MAGLOB_ONSPELLID9,p->sektor,p->direction,num2)) return;
|
if (!GlobEvents(MAGLOB_ONSPELLID1,MAGLOB_ONSPELLID9,p->sektor,p->direction,num2)) return;
|
||||||
|
|
||||||
if (cil && (k->cil==C_postava || k->cil==C_mrtva_postava || k->cil==C_postava_jinde)) i=add_spell(num2,cil,owner,0);
|
if (cil && (k->cil==C_postava || k->cil==C_mrtva_postava || k->cil==C_postava_jinde)) {
|
||||||
else
|
add_spell(num2,cil,owner,0);
|
||||||
|
} else
|
||||||
{
|
{
|
||||||
if (k->cil==C_policko) if (add_group_spell(num2,p->sektor,owner,C_policko,0)) goto end;
|
if (k->cil==C_policko) if (add_group_spell(num2,p->sektor,owner,C_policko,0)) goto end;
|
||||||
if (k->cil==C_kouzelnik) add_spell(num2,p-postavy+1,owner,0);
|
if (k->cil==C_kouzelnik) add_spell(num2,p-postavy+1,owner,0);
|
||||||
|
@ -1944,7 +1955,7 @@ void unaffect_demon(int cil)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
TKOUZLO *spl;
|
TKOUZLO *spl;
|
||||||
char a;
|
|
||||||
|
|
||||||
|
|
||||||
cil++;
|
cil++;
|
||||||
|
@ -1956,12 +1967,12 @@ void unaffect_demon(int cil)
|
||||||
if (spell_table[i]->wait)
|
if (spell_table[i]->wait)
|
||||||
{
|
{
|
||||||
spell_table[i]->wait=0;call_spell(i);
|
spell_table[i]->wait=0;call_spell(i);
|
||||||
a=1;
|
|
||||||
}
|
}
|
||||||
if (spell_table[i]->cil>0)
|
if (spell_table[i]->cil>0)
|
||||||
{
|
{
|
||||||
spell_table[i]->delay=0;call_spell(i);
|
spell_table[i]->delay=0;call_spell(i);
|
||||||
a=1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,11 +101,13 @@ void macro_sound(TMA_SOUND *p,int psect,int pdir,int sect,int dir)
|
||||||
{
|
{
|
||||||
char up=4;
|
char up=4;
|
||||||
if (sound_side_flags & SD_PRIM_FORV) up=2;
|
if (sound_side_flags & SD_PRIM_FORV) up=2;
|
||||||
if (~(p->bit16) & up)
|
if (~(p->bit16) & up) {
|
||||||
if (psect)
|
if (psect) {
|
||||||
play_effekt(map_coord[sect].x,map_coord[sect].y,map_coord[psect].x,map_coord[psect].y,dir,pdir,p);
|
play_effekt(map_coord[sect].x,map_coord[sect].y,map_coord[psect].x,map_coord[psect].y,dir,pdir,p);
|
||||||
else
|
} else {
|
||||||
play_effekt(0,0,0,0,-1,-1,p);
|
play_effekt(0,0,0,0,-1,-1,p);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void macro_send_act(TMA_SEND_ACTION *p)
|
void macro_send_act(TMA_SEND_ACTION *p)
|
||||||
|
@ -127,8 +129,9 @@ void macro_load_another_map(TMA_LOADLEV *z)
|
||||||
}
|
}
|
||||||
if (!GlobEvent(MAGLOB_LEAVEMAP,viewsector,viewdir)) return;
|
if (!GlobEvent(MAGLOB_LEAVEMAP,viewsector,viewdir)) return;
|
||||||
for(i=0;i<POCET_POSTAV;i++)
|
for(i=0;i<POCET_POSTAV;i++)
|
||||||
if (postavy[i].groupnum)
|
if (postavy[i].groupnum) {
|
||||||
if (i!=j)memcpy(&postavy[j++],&postavy[i],sizeof(postavy[i]));else j++;
|
if (i!=j)memcpy(&postavy[j++],&postavy[i],sizeof(postavy[i]));else j++;
|
||||||
|
}
|
||||||
if (j<POCET_POSTAV) memset(&postavy[j],0,sizeof(THUMAN)*(POCET_POSTAV-j));
|
if (j<POCET_POSTAV) memset(&postavy[j],0,sizeof(THUMAN)*(POCET_POSTAV-j));
|
||||||
loadlevel=*z;
|
loadlevel=*z;
|
||||||
send_message(E_CLOSE_MAP);
|
send_message(E_CLOSE_MAP);
|
||||||
|
@ -156,7 +159,7 @@ static void macro_create_item(short item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char decode_lock(char znak,char *string,char codenum)
|
static char decode_lock(char znak,char *string,uint8_t codenum)
|
||||||
{
|
{
|
||||||
char *memory;
|
char *memory;
|
||||||
char *endm;
|
char *endm;
|
||||||
|
@ -223,7 +226,7 @@ char if_lock(int side,int key_id,int level,TMA_LOCK *lk)
|
||||||
h=postavy+j;
|
h=postavy+j;
|
||||||
if (level==0) level=100;
|
if (level==0) level=100;
|
||||||
if (level>=min)
|
if (level>=min)
|
||||||
if (rnd(100)<=level-min)
|
if ((int)rnd(100)<=level-min)
|
||||||
{
|
{
|
||||||
sprintf(s,texty[158+h->female],h->jmeno);
|
sprintf(s,texty[158+h->female],h->jmeno);
|
||||||
bott_disp_text(s);
|
bott_disp_text(s);
|
||||||
|
@ -577,6 +580,7 @@ static int ma_play_anim(char *filename,char cls)
|
||||||
cancel_pass=0;
|
cancel_pass=0;
|
||||||
play_movie_seq(a,cls?60:SCREEN_OFFLINE);
|
play_movie_seq(a,cls?60:SCREEN_OFFLINE);
|
||||||
wire_main_functs();
|
wire_main_functs();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char ma_control_mob_control(word sector)
|
static char ma_control_mob_control(word sector)
|
||||||
|
@ -608,7 +612,6 @@ static void ma_drop_money(int sect,int side,TMULTI_ACTION *q)
|
||||||
void macro_change_music(int textindex)
|
void macro_change_music(int textindex)
|
||||||
{
|
{
|
||||||
char *trackdef=level_texts[textindex];
|
char *trackdef=level_texts[textindex];
|
||||||
char *nextTrack;
|
|
||||||
|
|
||||||
create_playlist(trackdef);
|
create_playlist(trackdef);
|
||||||
change_music(get_next_music_from_playlist());
|
change_music(get_next_music_from_playlist());
|
||||||
|
@ -742,13 +745,12 @@ void call_macro_ex(int side,int flags, int runatside)
|
||||||
SEND_LOG("(MULTIACTIONS) End: Side %.1f Call %X",(float)(runatside/4)+((float)(runatside & 3)/10),flags);
|
SEND_LOG("(MULTIACTIONS) End: Side %.1f Call %X",(float)(runatside/4)+((float)(runatside & 3)/10),flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char lock_saved=255;
|
|
||||||
static char lock_empty=254;
|
|
||||||
|
|
||||||
|
|
||||||
char save_codelocks(TMPFILE_WR *fsta)
|
char save_codelocks(TMPFILE_WR *fsta)
|
||||||
{
|
{
|
||||||
temp_storage_write(codelock_memory,sizeof(codelock_memory)*1,fsta);
|
temp_storage_write(codelock_memory,sizeof(codelock_memory)*1,fsta);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
10
game/menu.c
10
game/menu.c
|
@ -143,7 +143,7 @@ static void nahraj_rozdilovy_pcx(void **pp,int32_t *s)
|
||||||
org=(char *)origin+6+512;
|
org=(char *)origin+6+512;
|
||||||
pos=(char *)vysl+6+512;
|
pos=(char *)vysl+6+512;
|
||||||
paltab=(word *)vysl+3;
|
paltab=(word *)vysl+3;
|
||||||
rozdily(org,pos,hicolor+3,paltab,siz);
|
rozdily((uint8_t *)org,(uint8_t *)pos,hicolor+3,paltab,siz);
|
||||||
free(vysl);
|
free(vysl);
|
||||||
*pp=hicolor;
|
*pp=hicolor;
|
||||||
*s=siz*2+12;
|
*s=siz*2+12;
|
||||||
|
@ -232,7 +232,7 @@ static void zobraz_podle_masky(char barva,char anim)
|
||||||
data=ablock(H_MENU_ANIM+anim);
|
data=ablock(H_MENU_ANIM+anim);
|
||||||
xs=data[0];
|
xs=data[0];
|
||||||
ys=data[1];
|
ys=data[1];
|
||||||
zobraz_podle_masky_asm(barva,obr,data+3,maska+6+512,xs,ys,scr_linelen2);
|
zobraz_podle_masky_asm(barva,obr,data+3,(uint8_t *)maska+6+512,xs,ys,scr_linelen2);
|
||||||
aunlock(H_MENU_MASK);
|
aunlock(H_MENU_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,8 +330,8 @@ static void klavesnice(EVENT_MSG *msg,void **unused)
|
||||||
|
|
||||||
int enter_menu(char open)
|
int enter_menu(char open)
|
||||||
{
|
{
|
||||||
char c;
|
uint8_t c;
|
||||||
char *d;
|
|
||||||
init_menu_entries();
|
init_menu_entries();
|
||||||
add_task(2048,preload_anim);
|
add_task(2048,preload_anim);
|
||||||
load_ok=0;
|
load_ok=0;
|
||||||
|
@ -596,7 +596,7 @@ void konec_hry()
|
||||||
{
|
{
|
||||||
int task_id;
|
int task_id;
|
||||||
int timer;
|
int timer;
|
||||||
char *d;
|
|
||||||
|
|
||||||
schovej_mysku();
|
schovej_mysku();
|
||||||
curcolor=0;
|
curcolor=0;
|
||||||
|
|
|
@ -52,7 +52,7 @@ char pass_zavora=0;
|
||||||
char map_with_password=0;
|
char map_with_password=0;
|
||||||
|
|
||||||
MAPGLOBAL mglob={
|
MAPGLOBAL mglob={
|
||||||
"","","","",0,0,0,1
|
{"","","",""},0,0,0,1,0,"",0,0,0
|
||||||
};
|
};
|
||||||
TSTENA *map_sides;
|
TSTENA *map_sides;
|
||||||
TSECTOR *map_sectors;
|
TSECTOR *map_sectors;
|
||||||
|
@ -68,8 +68,8 @@ char sekceid[]="<BLOCK>";
|
||||||
char datapath;
|
char datapath;
|
||||||
D_ACTION *d_action={NULL};
|
D_ACTION *d_action={NULL};
|
||||||
int end_ptr;
|
int end_ptr;
|
||||||
char cur_group=1;
|
uint8_t cur_group=1;
|
||||||
char group_select=1;
|
uint8_t group_select=1;
|
||||||
char cancel_pass=0;
|
char cancel_pass=0;
|
||||||
char break_sleep=0;
|
char break_sleep=0;
|
||||||
char enable_sort=0;
|
char enable_sort=0;
|
||||||
|
@ -296,7 +296,7 @@ int load_map(char *filename)
|
||||||
case A_MAPGLOB:
|
case A_MAPGLOB:
|
||||||
num_ofsets[BACK_NUM]=ofsts;
|
num_ofsets[BACK_NUM]=ofsts;
|
||||||
memset(&mglob,0,sizeof(mglob));
|
memset(&mglob,0,sizeof(mglob));
|
||||||
memcpy(&mglob,temp,MIN(size,sizeof(mglob)));
|
memcpy(&mglob,temp,MIN((int)size,(int)sizeof(mglob)));
|
||||||
free(temp);
|
free(temp);
|
||||||
for(r=0;r<4;r++)
|
for(r=0;r<4;r++)
|
||||||
def_handle(ofsts++,mglob.back_fnames[r],pcx_fade_decomp,SR_GRAFIKA);
|
def_handle(ofsts++,mglob.back_fnames[r],pcx_fade_decomp,SR_GRAFIKA);
|
||||||
|
@ -586,7 +586,7 @@ void calc_fly()
|
||||||
for(p=letici_veci;p!=NULL;p=q)
|
for(p=letici_veci;p!=NULL;p=q)
|
||||||
{
|
{
|
||||||
p->xpos+=p->speed;
|
p->xpos+=p->speed;
|
||||||
if (p->flags & FLY_BURNT)
|
if (p->flags & FLY_BURNT) {
|
||||||
if (p->flags & FLY_UNUSED)
|
if (p->flags & FLY_UNUSED)
|
||||||
{
|
{
|
||||||
short ds[2];
|
short ds[2];
|
||||||
|
@ -609,6 +609,7 @@ void calc_fly()
|
||||||
q=p->next;
|
q=p->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
q=p->next;
|
q=p->next;
|
||||||
if (!(p->flags & FLY_NEHMOTNA))
|
if (!(p->flags & FLY_NEHMOTNA))
|
||||||
{
|
{
|
||||||
|
@ -1073,13 +1074,13 @@ void check_players_place(char mode)
|
||||||
if (sect>=mapsize) continue;
|
if (sect>=mapsize) continue;
|
||||||
switch (map_sectors[sect].sector_type)
|
switch (map_sectors[sect].sector_type)
|
||||||
{
|
{
|
||||||
case S_ACID:if (!levitat)
|
case S_ACID:if (!levitat) {
|
||||||
if (h->lives>3) {h->lives-=3;bott_draw(0);}
|
if (h->lives>3) {h->lives-=3;bott_draw(0);}
|
||||||
else
|
} else
|
||||||
player_hit(h,3+7*mode,0);
|
player_hit(h,3+7*mode,0);
|
||||||
break;
|
break;
|
||||||
case S_VIR:
|
case S_VIR:
|
||||||
if (!levitat)
|
if (!levitat) {
|
||||||
if (mode==0 && vir_zavora==0)
|
if (mode==0 && vir_zavora==0)
|
||||||
{
|
{
|
||||||
int i,smer;
|
int i,smer;
|
||||||
|
@ -1091,7 +1092,7 @@ void check_players_place(char mode)
|
||||||
vir_zavora=0;
|
vir_zavora=0;
|
||||||
cancel_pass=1;
|
cancel_pass=1;
|
||||||
}
|
}
|
||||||
else
|
} else
|
||||||
break;
|
break;
|
||||||
case S_LAVA: if (!levitat)
|
case S_LAVA: if (!levitat)
|
||||||
{
|
{
|
||||||
|
@ -1102,10 +1103,10 @@ void check_players_place(char mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (h->lives>3) {h->lives-=3;bott_draw(0);}
|
if (h->lives>3) {h->lives-=3;bott_draw(0);}
|
||||||
else
|
else player_hit(h,3+7*mode,0);
|
||||||
player_hit(h,3+7*mode,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case S_SSMRT:
|
case S_SSMRT:
|
||||||
u1=(h->lives);
|
u1=(h->lives);
|
||||||
|
@ -1113,8 +1114,9 @@ void check_players_place(char mode)
|
||||||
bott_draw(0);
|
bott_draw(0);
|
||||||
break;
|
break;
|
||||||
case S_VODA:
|
case S_VODA:
|
||||||
if (!levitat)
|
if (!levitat) {
|
||||||
akce_voda(h,mode);break;
|
akce_voda(h,mode);break;
|
||||||
|
}
|
||||||
case S_DIRA:if (!pass_zavora) postavy_propadnout(sect);break;
|
case S_DIRA:if (!pass_zavora) postavy_propadnout(sect);break;
|
||||||
case S_LODKA:if (lodka!=1 && mode)
|
case S_LODKA:if (lodka!=1 && mode)
|
||||||
{
|
{
|
||||||
|
@ -1152,8 +1154,9 @@ void calc_game()
|
||||||
call_dialog(start_dialog_number,start_dialog_mob);
|
call_dialog(start_dialog_number,start_dialog_mob);
|
||||||
}
|
}
|
||||||
check_players_place(0);
|
check_players_place(0);
|
||||||
if ((d=check_end_game())!=0)
|
if ((d=check_end_game())!=0) {
|
||||||
if (d==1) wire_end_game();else mrtva_skupina();
|
if (d==1) wire_end_game();else mrtva_skupina();
|
||||||
|
}
|
||||||
if (battle && cur_mode!=MD_INBATTLE)
|
if (battle && cur_mode!=MD_INBATTLE)
|
||||||
{
|
{
|
||||||
start_battle();
|
start_battle();
|
||||||
|
@ -1321,8 +1324,6 @@ char chod_s_postavama(char sekupit)
|
||||||
{
|
{
|
||||||
if (postavy[i].groupnum==cur_group)
|
if (postavy[i].groupnum==cur_group)
|
||||||
{
|
{
|
||||||
int wh;
|
|
||||||
int wf;
|
|
||||||
lastsec=postavy[i].sektor;
|
lastsec=postavy[i].sektor;
|
||||||
postavy[i].sektor=viewsector;
|
postavy[i].sektor=viewsector;
|
||||||
postavy[i].direction=viewdir;
|
postavy[i].direction=viewdir;
|
||||||
|
@ -1385,12 +1386,12 @@ void shift_zoom(char smer)
|
||||||
switch (smer & 3)
|
switch (smer & 3)
|
||||||
{
|
{
|
||||||
case 0:if (lodka)zooming_forward(ablock(H_LODKA));
|
case 0:if (lodka)zooming_forward(ablock(H_LODKA));
|
||||||
else
|
else zooming_forward(ablock(H_BGR_BUFF));
|
||||||
zooming_forward(ablock(H_BGR_BUFF));break;
|
break;
|
||||||
case 1:turn_left();break;
|
case 1:turn_left();break;
|
||||||
case 2:if (lodka)zooming_backward(ablock(H_LODKA));
|
case 2:if (lodka)zooming_backward(ablock(H_LODKA));
|
||||||
else
|
else zooming_backward(ablock(H_BGR_BUFF));
|
||||||
zooming_backward(ablock(H_BGR_BUFF));break;
|
break;
|
||||||
case 3:turn_right();break;
|
case 3:turn_right();break;
|
||||||
}
|
}
|
||||||
hold_timer(TM_BACK_MUSIC,0);
|
hold_timer(TM_BACK_MUSIC,0);
|
||||||
|
@ -1556,7 +1557,8 @@ static char test_can_walk(int grp)
|
||||||
|
|
||||||
void step_zoom(char smer)
|
void step_zoom(char smer)
|
||||||
{
|
{
|
||||||
char nopass,drs;
|
char nopass;
|
||||||
|
uint8_t drs;
|
||||||
int sid,nsect,sect;
|
int sid,nsect,sect;
|
||||||
char can_go=1;
|
char can_go=1;
|
||||||
|
|
||||||
|
@ -1599,9 +1601,10 @@ void step_zoom(char smer)
|
||||||
}
|
}
|
||||||
mob_map[nsect]=0;
|
mob_map[nsect]=0;
|
||||||
}
|
}
|
||||||
else if (mob_map[nsect] && !nopass)
|
else if (mob_map[nsect] && !nopass) {
|
||||||
if (!battle){ if (!mob_alter(nsect)) return; }
|
if (!battle){ if (!mob_alter(nsect)) return; }
|
||||||
else return;
|
else return;
|
||||||
|
}
|
||||||
if (map_sectors[nsect].sector_type==S_LODKA)
|
if (map_sectors[nsect].sector_type==S_LODKA)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1733,14 +1736,15 @@ int check_path(word **path,word tosect)
|
||||||
{
|
{
|
||||||
if (map_sectors[*n].sector_type!=S_DIRA && ISTELEPORTSECT(*n))
|
if (map_sectors[*n].sector_type!=S_DIRA && ISTELEPORTSECT(*n))
|
||||||
{
|
{
|
||||||
for(i=0;i<4 && map_sectors[*p].step_next[i]!=*n;i++)
|
for(i=0;i<4 && map_sectors[*p].step_next[i]!=*n;i++) {
|
||||||
if (i==4)
|
if (i==4)
|
||||||
{
|
{
|
||||||
ss=*p;
|
ss=*p;
|
||||||
free(*path);*path=NULL;
|
free(*path);*path=NULL;
|
||||||
return ss;
|
return ss;
|
||||||
}
|
}
|
||||||
if (!map_sides[(*p<<2)+i].flags & SD_PLAY_IMPS) ok=1;
|
}
|
||||||
|
if (!(map_sides[(*p<<2)+i].flags & SD_PLAY_IMPS)) ok=1;
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
|
@ -1768,7 +1772,8 @@ static unsigned int get_path_len(const word *w) {
|
||||||
void recall()
|
void recall()
|
||||||
{
|
{
|
||||||
int tosect;
|
int tosect;
|
||||||
unsigned int max,i,j;
|
unsigned int max,i;
|
||||||
|
int j;
|
||||||
word *paths[POCET_POSTAV];
|
word *paths[POCET_POSTAV];
|
||||||
|
|
||||||
for(i=0;i<POCET_POSTAV;i++)
|
for(i=0;i<POCET_POSTAV;i++)
|
||||||
|
@ -1884,7 +1889,7 @@ void sleep_players(va_list args)
|
||||||
|
|
||||||
void *game_keyboard(EVENT_MSG *msg,void **usr)
|
void *game_keyboard(EVENT_MSG *msg,void **usr)
|
||||||
{
|
{
|
||||||
char c;
|
uint8_t c;
|
||||||
|
|
||||||
usr;
|
usr;
|
||||||
if (pass_zavora) return NULL;
|
if (pass_zavora) return NULL;
|
||||||
|
|
10
game/setup.c
10
game/setup.c
|
@ -63,7 +63,7 @@ static void change_zoom()
|
||||||
int id=o_aktual->id;
|
int id=o_aktual->id;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=30;i<60;i+=10) c_set_value(0,i,f_get_value(0,i) & ~1 | (i==id));
|
for(i=30;i<60;i+=10) c_set_value(0,i,(f_get_value(0,i) & ~1) | (i==id));
|
||||||
zoom_speed((id-30)/10);
|
zoom_speed((id-30)/10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ static void change_turn()
|
||||||
int id=o_aktual->id;
|
int id=o_aktual->id;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=60;i<90;i+=10) c_set_value(0,i,f_get_value(0,i) & ~1 | (i==id));
|
for(i=60;i<90;i+=10) c_set_value(0,i,(f_get_value(0,i) & ~1) | (i==id));
|
||||||
turn_speed((id-60)/10);
|
turn_speed((id-60)/10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unwire_setup();
|
static void unwire_setup();
|
||||||
|
|
||||||
static void setup_keyboard(EVENT_MSG *msg,void **)
|
static void setup_keyboard(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
if (msg->msg == E_KEYBOARD)
|
if (msg->msg == E_KEYBOARD)
|
||||||
{
|
{
|
||||||
|
@ -184,10 +184,10 @@ void new_setup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0;i<sizeof(textc)/sizeof(int);i++)
|
for(i=0;i<(int)(sizeof(textc)/sizeof(int));i++)
|
||||||
define(-1,textxp[i],textyp[i]-1,1,1,0,label,texty[textc[i]]);
|
define(-1,textxp[i],textyp[i]-1,1,1,0,label,texty[textc[i]]);
|
||||||
|
|
||||||
for(i=0;i<sizeof(effects)/sizeof(int);i++)
|
for(i=0;i<(int)(sizeof(effects)/sizeof(int));i++)
|
||||||
if (check_snd_effect(effects[i]))
|
if (check_snd_effect(effects[i]))
|
||||||
{
|
{
|
||||||
define(200+i*10,50+i*60,30,30,200,0,skeldal_soupak,effects[i]==SND_MUSIC?127:255);c_default(get_snd_effect(effects[i]));
|
define(200+i*10,50+i*60,30,30,200,0,skeldal_soupak,effects[i]==SND_MUSIC?127:255);c_default(get_snd_effect(effects[i]));
|
||||||
|
|
|
@ -86,7 +86,7 @@ int autoopendata=0;
|
||||||
|
|
||||||
void *cur_xlat;
|
void *cur_xlat;
|
||||||
|
|
||||||
void redraw_desktop_call();
|
void redraw_desktop_call(void);
|
||||||
|
|
||||||
TMA_LOADLEV loadlevel;
|
TMA_LOADLEV loadlevel;
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ int game_extras=0;
|
||||||
char default_map[20]="LESPRED.MAP";
|
char default_map[20]="LESPRED.MAP";
|
||||||
|
|
||||||
THUMAN postavy[POCET_POSTAV],postavy_save[POCET_POSTAV];
|
THUMAN postavy[POCET_POSTAV],postavy_save[POCET_POSTAV];
|
||||||
void (*unwire_proc)();
|
void (*unwire_proc)(void);
|
||||||
void (*wire_proc)();
|
void (*wire_proc)(void);
|
||||||
char cur_mode,battle_mode;
|
char cur_mode,battle_mode;
|
||||||
static int init_music_vol=127;
|
static int init_music_vol=127;
|
||||||
static int init_gfx_vol=255;
|
static int init_gfx_vol=255;
|
||||||
|
@ -352,7 +352,7 @@ int set_video(int mode)
|
||||||
return er;
|
return er;
|
||||||
}
|
}
|
||||||
|
|
||||||
void purge_temps(char) {
|
void purge_temps(char _) {
|
||||||
temp_storage_clear();
|
temp_storage_clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ void set_background(void **p,int32_t *s)
|
||||||
pal=data+3+bgr_distance*256;
|
pal=data+3+bgr_distance*256;
|
||||||
pic=(char *)data+PIC_FADE_PAL_SIZE;
|
pic=(char *)data+PIC_FADE_PAL_SIZE;
|
||||||
do
|
do
|
||||||
*ptr++=pal[*pic++] | BGSWITCHBIT;
|
*ptr++=pal[(uint8_t)*pic++] | BGSWITCHBIT;
|
||||||
while (--counter);
|
while (--counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,9 +537,9 @@ void set_font(int font,int c1,...)
|
||||||
memcpy(f_default,charcolors,sizeof(charcolors));
|
memcpy(f_default,charcolors,sizeof(charcolors));
|
||||||
}
|
}
|
||||||
|
|
||||||
void music_init()
|
void music_init(void)
|
||||||
{
|
{
|
||||||
char *path;
|
// char *path;
|
||||||
/* if (sound_detection)
|
/* if (sound_detection)
|
||||||
{
|
{
|
||||||
SEND_LOG("(SOUND) SOUND_DETECT Detecting sound card",0,0);
|
SEND_LOG("(SOUND) SOUND_DETECT Detecting sound card",0,0);
|
||||||
|
@ -552,12 +552,12 @@ void music_init()
|
||||||
start_mixing();
|
start_mixing();
|
||||||
set_snd_effect(SND_GFX,init_gfx_vol);
|
set_snd_effect(SND_GFX,init_gfx_vol);
|
||||||
set_snd_effect(SND_MUSIC,init_music_vol);
|
set_snd_effect(SND_MUSIC,init_music_vol);
|
||||||
path=plugins_path;
|
// path=plugins_path;
|
||||||
SEND_LOG("(SOUND) SOUND_DONE Sound Engine should work now",0,0);
|
SEND_LOG("(SOUND) SOUND_DONE Sound Engine should work now",0,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clrscr()
|
void clrscr(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -566,7 +566,7 @@ void clrscr()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void back_music()
|
void back_music(void)
|
||||||
{
|
{
|
||||||
mix_back_sound(0);
|
mix_back_sound(0);
|
||||||
}
|
}
|
||||||
|
@ -578,7 +578,7 @@ void back_music()
|
||||||
return &anim_idle;
|
return &anim_idle;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/*void timer_error()
|
/*void timer_error(void)
|
||||||
{
|
{
|
||||||
puts("\x7");
|
puts("\x7");
|
||||||
}
|
}
|
||||||
|
@ -600,7 +600,7 @@ void *timming(EVENT_MSG *msg,void **data)
|
||||||
{
|
{
|
||||||
p=q->next;
|
p=q->next;
|
||||||
// if (p!=NULL && p->zero!=0) timer_error();
|
// if (p!=NULL && p->zero!=0) timer_error();
|
||||||
if (!(--q->counter))
|
if (!(--q->counter)) {
|
||||||
if (q->zavora && i==(j-1))
|
if (q->zavora && i==(j-1))
|
||||||
{
|
{
|
||||||
q->zavora=0;
|
q->zavora=0;
|
||||||
|
@ -625,8 +625,10 @@ void *timming(EVENT_MSG *msg,void **data)
|
||||||
//else
|
//else
|
||||||
// q->counter=1;
|
// q->counter=1;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
q->counter=1;
|
q->counter=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (q->next!=p && q!=p)
|
if (q->next!=p && q!=p)
|
||||||
{
|
{
|
||||||
THE_TIMER *z;
|
THE_TIMER *z;
|
||||||
|
@ -712,7 +714,7 @@ THE_TIMER *add_to_timer(int id,int delay,int maxcall,void *proc)
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kill_timer()
|
static void kill_timer(void)
|
||||||
{
|
{
|
||||||
THE_TIMER *t;
|
THE_TIMER *t;
|
||||||
|
|
||||||
|
@ -742,7 +744,7 @@ void *user_timer(EVENT_MSG *msg,void **usr)
|
||||||
return &user_timer;
|
return &user_timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_timer()
|
void do_timer(void)
|
||||||
{
|
{
|
||||||
EVENT_MSG msg;
|
EVENT_MSG msg;
|
||||||
char x;
|
char x;
|
||||||
|
@ -775,7 +777,7 @@ int cislovka(int i)
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void register_basic_data()
|
void register_basic_data(void)
|
||||||
{
|
{
|
||||||
int i,s;
|
int i,s;
|
||||||
TDREGISTERS *p;
|
TDREGISTERS *p;
|
||||||
|
@ -802,7 +804,7 @@ void register_basic_data()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reg_grafiku_postav()
|
void reg_grafiku_postav(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char xname[16];
|
char xname[16];
|
||||||
|
@ -823,7 +825,7 @@ void reg_grafiku_postav()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cti_texty()
|
void cti_texty(void)
|
||||||
{
|
{
|
||||||
char path[80];int err;
|
char path[80];int err;
|
||||||
texty=(TSTR_LIST)create_list(4);
|
texty=(TSTR_LIST)create_list(4);
|
||||||
|
@ -859,7 +861,7 @@ void global_kbd(EVENT_MSG *msg,void **usr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_game_window()
|
void add_game_window(void)
|
||||||
{
|
{
|
||||||
WINDOW *p;
|
WINDOW *p;
|
||||||
CTL3D *c;
|
CTL3D *c;
|
||||||
|
@ -894,7 +896,7 @@ void error_exception(EVENT_MSG *msg,void **unused)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void swap_error_exception()
|
void swap_error_exception(void)
|
||||||
{
|
{
|
||||||
closemode();
|
closemode();
|
||||||
SEND_LOG("(ERROR) Disk is full ...",0,0);
|
SEND_LOG("(ERROR) Disk is full ...",0,0);
|
||||||
|
@ -976,7 +978,7 @@ SEND_LOG("(INIT) Setting random seed.",0,0);
|
||||||
SEND_LOG("(INIT) Creating 256 color palette.",0,0);
|
SEND_LOG("(INIT) Creating 256 color palette.",0,0);
|
||||||
cur_xlat=create_special_palette();
|
cur_xlat=create_special_palette();
|
||||||
SEND_LOG("(INIT) Init message system - event handler",0,0);
|
SEND_LOG("(INIT) Init message system - event handler",0,0);
|
||||||
init_events(100);
|
init_events();
|
||||||
SEND_LOG("(INIT) Setting videomode.",0,0);
|
SEND_LOG("(INIT) Setting videomode.",0,0);
|
||||||
verr=set_video(vmode);
|
verr=set_video(vmode);
|
||||||
if (verr)
|
if (verr)
|
||||||
|
@ -1045,7 +1047,7 @@ SEND_LOG("(INIT) Loading shops.",0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wire_main_functs();
|
void wire_main_functs();
|
||||||
void unwire_main_functs()
|
void unwire_main_functs(void)
|
||||||
{
|
{
|
||||||
SEND_LOG("(SYS) Wire main functions",0,0);
|
SEND_LOG("(SYS) Wire main functions",0,0);
|
||||||
delete_from_timer(TM_FLY);
|
delete_from_timer(TM_FLY);
|
||||||
|
@ -1059,7 +1061,7 @@ void unwire_main_functs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wire_main_functs()
|
void wire_main_functs(void)
|
||||||
{
|
{
|
||||||
SEND_LOG("(SYS) unWire main functions",0,0);
|
SEND_LOG("(SYS) unWire main functions",0,0);
|
||||||
add_to_timer(TM_SCENE,gamespeed,-1,refresh_scene);
|
add_to_timer(TM_SCENE,gamespeed,-1,refresh_scene);
|
||||||
|
@ -1076,7 +1078,7 @@ void wire_main_functs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_game()
|
void init_game(void)
|
||||||
{
|
{
|
||||||
SEND_LOG("(INIT) Inventory.",0,0);
|
SEND_LOG("(INIT) Inventory.",0,0);
|
||||||
init_inventory();
|
init_inventory();
|
||||||
|
@ -1116,9 +1118,10 @@ extern char running_battle;
|
||||||
load_shops();
|
load_shops();
|
||||||
send_message(E_CLOSE_MAP);
|
send_message(E_CLOSE_MAP);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void enter_game()
|
void enter_game(void)
|
||||||
{
|
{
|
||||||
int end;
|
int end;
|
||||||
init_spectxtrs();
|
init_spectxtrs();
|
||||||
|
@ -1264,7 +1267,7 @@ static void configure(char *filename)
|
||||||
SEND_LOG("(GAME) Done config.",0,0);
|
SEND_LOG("(GAME) Done config.",0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int update_config()
|
static int update_config(void)
|
||||||
{
|
{
|
||||||
SEND_LOG("(GAME) Updating config. file '%s'",CONFIG_NAME,NULL);
|
SEND_LOG("(GAME) Updating config. file '%s'",CONFIG_NAME,NULL);
|
||||||
add_field_num(&cur_config,sinit[1].heslo,zoom_speed(-1));
|
add_field_num(&cur_config,sinit[1].heslo,zoom_speed(-1));
|
||||||
|
@ -1275,9 +1278,10 @@ static int update_config()
|
||||||
add_field_num(&cur_config,sinit[13].heslo,autosave_enabled);
|
add_field_num(&cur_config,sinit[13].heslo,autosave_enabled);
|
||||||
save_config(cur_config,CONFIG_NAME);
|
save_config(cur_config,CONFIG_NAME);
|
||||||
SEND_LOG("(GAME) Config. file was saved",0,0);
|
SEND_LOG("(GAME) Config. file was saved",0,0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void help()
|
void help(void)
|
||||||
{
|
{
|
||||||
printf("Pouziti:\n\n S <filename.MAP> <start_sector>\n\n"
|
printf("Pouziti:\n\n S <filename.MAP> <start_sector>\n\n"
|
||||||
"<filename.MAP> jmeno mapy\n"
|
"<filename.MAP> jmeno mapy\n"
|
||||||
|
@ -1512,14 +1516,14 @@ static void new_game(int argc, char *argv[])
|
||||||
game_big_circle(enforce);
|
game_big_circle(enforce);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void undef_menu()
|
static void undef_menu(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<255;i++) undef_handle(0x8000+i);
|
for(i=0;i<255;i++) undef_handle(0x8000+i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void load_error_report(EVENT_MSG *msg,void **)
|
static void load_error_report(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
if (msg->msg == E_IDLE)
|
if (msg->msg == E_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -1529,7 +1533,7 @@ static void load_error_report(EVENT_MSG *msg,void **)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wire_load_saved()
|
static void wire_load_saved(void)
|
||||||
{
|
{
|
||||||
send_message(E_CLOSE_MAP,-1);
|
send_message(E_CLOSE_MAP,-1);
|
||||||
}
|
}
|
||||||
|
@ -1626,7 +1630,7 @@ static void start_from_mapedit(va_list args)
|
||||||
exit_wait=1;
|
exit_wait=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void disable_intro()
|
void disable_intro(void)
|
||||||
{
|
{
|
||||||
add_field_num(&cur_config,sinit[12].heslo,1);
|
add_field_num(&cur_config,sinit[12].heslo,1);
|
||||||
update_config();
|
update_config();
|
||||||
|
@ -1634,7 +1638,7 @@ void disable_intro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
char *c,rm;
|
char *c,rm;
|
||||||
|
|
||||||
|
@ -1702,13 +1706,14 @@ void main(int argc,char *argv[])
|
||||||
escape();
|
escape();
|
||||||
update_config();
|
update_config();
|
||||||
closemode();
|
closemode();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
|
||||||
int GetExeVersion()
|
int GetExeVersion(void)
|
||||||
{
|
{
|
||||||
return VERSIONNUM;
|
return VERSIONNUM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void init_tracks()
|
||||||
memset(locks,0,sizeof(locks));
|
memset(locks,0,sizeof(locks));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char last_beep_lev;
|
|
||||||
|
|
||||||
/*void pcspeak_uroven(char value,int time);
|
/*void pcspeak_uroven(char value,int time);
|
||||||
#pragma aux pcspeak_uroven parm[bh][ecx]=\
|
#pragma aux pcspeak_uroven parm[bh][ecx]=\
|
||||||
|
@ -198,11 +198,8 @@ int calcul_volume(int chan,int x,int y,int side,int volume)
|
||||||
void wav_load(void **p,int32_t *s)
|
void wav_load(void **p,int32_t *s)
|
||||||
{
|
{
|
||||||
char *sr;
|
char *sr;
|
||||||
int32_t *d;
|
|
||||||
char *c;
|
|
||||||
char *tg;
|
char *tg;
|
||||||
void *tgr;
|
void *tgr;
|
||||||
size_t siz;
|
|
||||||
struct t_wave x[3];
|
struct t_wave x[3];
|
||||||
|
|
||||||
sr=*p;
|
sr=*p;
|
||||||
|
@ -219,7 +216,6 @@ void wav_load(void **p,int32_t *s)
|
||||||
read_chunk(sr,tg);
|
read_chunk(sr,tg);
|
||||||
free(*p);
|
free(*p);
|
||||||
*p=tgr;
|
*p=tgr;
|
||||||
siz=*s;
|
|
||||||
*s+=sizeof(struct t_wave)+4;
|
*s+=sizeof(struct t_wave)+4;
|
||||||
/* if (x[0].freq!=x[0].bps)
|
/* if (x[0].freq!=x[0].bps)
|
||||||
{
|
{
|
||||||
|
@ -250,7 +246,6 @@ void play_effekt(int x,int y,int xd,int yd,int side,int sided,TMA_SOUND *p)
|
||||||
int chan;
|
int chan;
|
||||||
int blockid;
|
int blockid;
|
||||||
SND_INFO *track;
|
SND_INFO *track;
|
||||||
THANDLE_DATA *z;
|
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (!sound_enabled) return;
|
if (!sound_enabled) return;
|
||||||
|
@ -277,7 +272,7 @@ void play_effekt(int x,int y,int xd,int yd,int side,int sided,TMA_SOUND *p)
|
||||||
blockid=find_handle(p->filename,wav_load);
|
blockid=find_handle(p->filename,wav_load);
|
||||||
if (blockid==-1)
|
if (blockid==-1)
|
||||||
{
|
{
|
||||||
z=def_handle(end_ptr,p->filename,wav_load,SR_ZVUKY);
|
def_handle(end_ptr,p->filename,wav_load,SR_ZVUKY);
|
||||||
blockid=end_ptr++;
|
blockid=end_ptr++;
|
||||||
if (level_preload) apreload(blockid);
|
if (level_preload) apreload(blockid);
|
||||||
}
|
}
|
||||||
|
@ -340,7 +335,7 @@ void restore_sound_names()
|
||||||
void recalc_volumes(int sector,int side)
|
void recalc_volumes(int sector,int side)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int newx,newy,layer;
|
int newx,newy;//,layer;
|
||||||
|
|
||||||
if (sector>=mapsize) return;
|
if (sector>=mapsize) return;
|
||||||
|
|
||||||
|
@ -348,7 +343,7 @@ void recalc_volumes(int sector,int side)
|
||||||
SEND_LOG("(SOUND) %s","Recalculating volumes",0);
|
SEND_LOG("(SOUND) %s","Recalculating volumes",0);
|
||||||
newx=map_coord[sector].x;
|
newx=map_coord[sector].x;
|
||||||
newy=map_coord[sector].y;
|
newy=map_coord[sector].y;
|
||||||
layer=map_coord[sector].layer;
|
// layer=map_coord[sector].layer;
|
||||||
for(i=0;i<CHANNELS;i++)
|
for(i=0;i<CHANNELS;i++)
|
||||||
if (chan_state[i]>=0 && playings[i].side>=0)
|
if (chan_state[i]>=0 && playings[i].side>=0)
|
||||||
{
|
{
|
||||||
|
@ -382,7 +377,7 @@ void create_playlist(char *playlist)
|
||||||
if (cur_playlist!=NULL) release_list(cur_playlist);
|
if (cur_playlist!=NULL) release_list(cur_playlist);
|
||||||
cur_playlist=NULL;
|
cur_playlist=NULL;
|
||||||
if (playlist==NULL) return;
|
if (playlist==NULL) return;
|
||||||
if (playlist=="") return;
|
if (!playlist[0]) return;
|
||||||
c=playlist;
|
c=playlist;
|
||||||
while (*c && *c==32) c++;
|
while (*c && *c==32) c++;
|
||||||
sscanf(c,"%s",mode);
|
sscanf(c,"%s",mode);
|
||||||
|
@ -395,7 +390,7 @@ void create_playlist(char *playlist)
|
||||||
if (shift) c+=strlen(mode);else play_list_mode=PL_RANDOM;
|
if (shift) c+=strlen(mode);else play_list_mode=PL_RANDOM;
|
||||||
while (*c && *c==32) c++;
|
while (*c && *c==32) c++;
|
||||||
playlist=c;
|
playlist=c;
|
||||||
if (playlist=="") return;
|
if (!playlist[0]) return;
|
||||||
for (c=playlist;c!=NULL;c=strchr(c+1,' ')) i++;
|
for (c=playlist;c!=NULL;c=strchr(c+1,' ')) i++;
|
||||||
playlist_size=i-1;
|
playlist_size=i-1;
|
||||||
cur_playlist=create_list(i);
|
cur_playlist=create_list(i);
|
||||||
|
|
112
game/souboje.c
112
game/souboje.c
|
@ -117,7 +117,7 @@ void unwire_programming();
|
||||||
void wire_jadro_souboje();
|
void wire_jadro_souboje();
|
||||||
void unwire_jadro_souboje();
|
void unwire_jadro_souboje();
|
||||||
|
|
||||||
char sel_zivel=0;
|
uint8_t sel_zivel=0;
|
||||||
static char prekvapeni=0;
|
static char prekvapeni=0;
|
||||||
char powers[3]={0,1,2};
|
char powers[3]={0,1,2};
|
||||||
HUM_ACTION *magic_data;
|
HUM_ACTION *magic_data;
|
||||||
|
@ -266,12 +266,13 @@ void poloz_vsechny_predmety()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=0;i<POCET_POSTAV && picked_item!=NULL;i++) //polozeni pripadne drzene veci v mysi.
|
for(i=0;i<POCET_POSTAV && picked_item!=NULL;i++) {//polozeni pripadne drzene veci v mysi.
|
||||||
if (postavy[i].used && postavy[i].sektor==viewsector && put_item_to_inv(&postavy[i],picked_item))
|
if (postavy[i].used && postavy[i].sektor==viewsector && put_item_to_inv(&postavy[i],picked_item))
|
||||||
{
|
{
|
||||||
free(picked_item);
|
free(picked_item);
|
||||||
picked_item=NULL;
|
picked_item=NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (picked_item!=NULL)
|
if (picked_item!=NULL)
|
||||||
{
|
{
|
||||||
push_item(viewsector,viewdir,picked_item);
|
push_item(viewsector,viewdir,picked_item);
|
||||||
|
@ -345,7 +346,7 @@ int vypocet_zasahu(short *utocnik,short *obrance, int chaos,int zbran,int bonus
|
||||||
zv=obrance[VLS_OHEN+utocnik[VLS_MGZIVEL]];
|
zv=obrance[VLS_OHEN+utocnik[VLS_MGZIVEL]];
|
||||||
zv=mgochrana(zv);
|
zv=mgochrana(zv);
|
||||||
mutok=zv*mutok/100;
|
mutok=zv*mutok/100;
|
||||||
if (rnd(obrance[VLS_OHEN+utocnik[VLS_MGZIVEL]]/2)>mutok) mutok=0;
|
if ((int)rnd(obrance[VLS_OHEN+utocnik[VLS_MGZIVEL]]/2)>mutok) mutok=0;
|
||||||
dmzhit=mutok;
|
dmzhit=mutok;
|
||||||
zasah=utok-obrana;
|
zasah=utok-obrana;
|
||||||
}
|
}
|
||||||
|
@ -645,7 +646,7 @@ T_CLK_MAP clk_end_game[]=
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void end_game_end_phase(EVENT_MSG *msg,void **)
|
void end_game_end_phase(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
static int wait=0;
|
static int wait=0;
|
||||||
if (msg->msg == E_TIMER) {
|
if (msg->msg == E_TIMER) {
|
||||||
|
@ -1065,7 +1066,7 @@ void pouzij_zbran(THUMAN *p,int ruka)
|
||||||
anim_mirror=ruka==0;
|
anim_mirror=ruka==0;
|
||||||
prejdi_na_pohled(p);
|
prejdi_na_pohled(p);
|
||||||
if (itm) play_weapon_anim(it->weapon_attack,it->hitpos);
|
if (itm) play_weapon_anim(it->weapon_attack,it->hitpos);
|
||||||
if (utok_na_sektor(p,m,chaos,bonus)>0 && itm && rnd(100)+1<it->magie)
|
if (utok_na_sektor(p,m,chaos,bonus)>0 && itm && (int)rnd(100)+1<it->magie)
|
||||||
thing_cast(it->spell,p-postavy,p->sektor,m,1);
|
thing_cast(it->spell,p-postavy,p->sektor,m,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1101,7 +1102,7 @@ static char StrachPostavy(THUMAN *p)
|
||||||
{
|
{
|
||||||
word *cesta;
|
word *cesta;
|
||||||
int i;
|
int i;
|
||||||
int ln;
|
|
||||||
int wf=weigth_defect(p)+1;
|
int wf=weigth_defect(p)+1;
|
||||||
|
|
||||||
prejdi_na_pohled(p);
|
prejdi_na_pohled(p);
|
||||||
|
@ -1109,7 +1110,7 @@ static char StrachPostavy(THUMAN *p)
|
||||||
for(select_player=0;select_player<6;select_player++) if (postavy+select_player==p) break;
|
for(select_player=0;select_player<6;select_player++) if (postavy+select_player==p) break;
|
||||||
bott_draw(0);
|
bott_draw(0);
|
||||||
labyrinth_find_path(p->sektor,65535,SD_PLAY_IMPS,valid_sectors,NULL);
|
labyrinth_find_path(p->sektor,65535,SD_PLAY_IMPS,valid_sectors,NULL);
|
||||||
ln=labyrinth_find_path(p->sektor,last_sector,SD_PLAY_IMPS,valid_sectors,&cesta);
|
labyrinth_find_path(p->sektor,last_sector,SD_PLAY_IMPS,valid_sectors,&cesta);
|
||||||
if (cesta[0]==0) {free(cesta);return 0;}
|
if (cesta[0]==0) {free(cesta);return 0;}
|
||||||
for (i=0;i<6 && cesta[i] && p->kondice ;i++)
|
for (i=0;i<6 && cesta[i] && p->kondice ;i++)
|
||||||
{
|
{
|
||||||
|
@ -1423,7 +1424,7 @@ char ask_who_proc(int id,int xa,int ya,int xr,int yr)
|
||||||
p=&postavy[i];
|
p=&postavy[i];
|
||||||
c=p->sektor!=viewsector;
|
c=p->sektor!=viewsector;
|
||||||
if (p->used)
|
if (p->used)
|
||||||
if ((!far_play && !c || !death_play && c) && death_play==(p->lives==0))
|
if (((!far_play && !c) || (!death_play && c)) && death_play==(p->lives==0))
|
||||||
{
|
{
|
||||||
if (get_spell_teleport(magic_data->data1))
|
if (get_spell_teleport(magic_data->data1))
|
||||||
if ((magic_data->data2=select_teleport_target())==0)
|
if ((magic_data->data2=select_teleport_target())==0)
|
||||||
|
@ -1495,9 +1496,10 @@ char runes_mask(int id,int xa,int ya,int xr,int yr)
|
||||||
d=ablock(H_RUNEMASK);
|
d=ablock(H_RUNEMASK);
|
||||||
c=((char *)d)+6+512+xr+yr*d[0];
|
c=((char *)d)+6+512+xr+yr*d[0];
|
||||||
cc=*c-6;
|
cc=*c-6;
|
||||||
if (*c)
|
if (*c) {
|
||||||
if (*c<6 && ms_last_event.event_type & 0x2) sel_zivel=*c-1;
|
if (*c<6 && ms_last_event.event_type & 0x2) {
|
||||||
else if (runes[sel_zivel] & (1<<cc))
|
sel_zivel=*c-1;
|
||||||
|
} else if (runes[sel_zivel] & (1<<cc))
|
||||||
{
|
{
|
||||||
int x=(sel_zivel*7+(cc))*3;
|
int x=(sel_zivel*7+(cc))*3;
|
||||||
if (ms_last_event.event_type & 0x2)
|
if (ms_last_event.event_type & 0x2)
|
||||||
|
@ -1516,6 +1518,7 @@ char runes_mask(int id,int xa,int ya,int xr,int yr)
|
||||||
rune_name=get_rune_name(x);
|
rune_name=get_rune_name(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (cc<0) rune_name=NULL;
|
if (cc<0) rune_name=NULL;
|
||||||
free(runebar);runebar=NULL;
|
free(runebar);runebar=NULL;
|
||||||
display_rune_bar();
|
display_rune_bar();
|
||||||
|
@ -1785,20 +1788,26 @@ static void zahajit_kolo(char prekvapeni)
|
||||||
sect=map_sectors[sect].step_next[dir];
|
sect=map_sectors[sect].step_next[dir];
|
||||||
if (numplayers(sect,0)>2) break;
|
if (numplayers(sect,0)>2) break;
|
||||||
m1=mob_map[sect]-1;if (m1>=0) m2=mobs[m1].next-1;else m2=-1;
|
m1=mob_map[sect]-1;if (m1>=0) m2=mobs[m1].next-1;else m2=-1;
|
||||||
if ((m1>=0 && mobs[m1].vlajky & MOB_IN_BATTLE) || (m2>=0 && mobs[m2].vlajky & MOB_IN_BATTLE))
|
if ((m1 >= 0 && (mobs[m1].vlajky & MOB_IN_BATTLE))
|
||||||
if (lnear) monster=1;else monster_far=1;
|
|| (m2 >= 0 && (mobs[m2].vlajky & MOB_IN_BATTLE))) {
|
||||||
|
if (lnear) {
|
||||||
|
monster = 1;
|
||||||
|
} else {
|
||||||
|
monster_far = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
lnear=0;counter--;if(!counter) break;
|
lnear=0;counter--;if(!counter) break;
|
||||||
}
|
}
|
||||||
w1=p->wearing[PO_RUKA_L];w2=p->wearing[PO_RUKA_R];
|
w1=p->wearing[PO_RUKA_L];w2=p->wearing[PO_RUKA_R];
|
||||||
if (w1) dw1=glob_items[w1-1].druh;else dw1=-1;
|
if (w1) dw1=glob_items[w1-1].druh;else dw1=-1;
|
||||||
if (w2) dw2=glob_items[w2-1].druh;else dw2=-1;
|
if (w2) dw2=glob_items[w2-1].druh;else dw2=-1;
|
||||||
w=0;
|
w=0;
|
||||||
if (dw1==TYP_STRELNA && p->sipy || dw1==TYP_VRHACI) w|=1;
|
if ((dw1==TYP_STRELNA && p->sipy) || dw1==TYP_VRHACI) w|=1;
|
||||||
if (dw2==TYP_STRELNA && p->sipy || dw2==TYP_VRHACI) w|=2;
|
if ((dw2==TYP_STRELNA && p->sipy) || dw2==TYP_VRHACI) w|=2;
|
||||||
if (w==0) w=select_weapon(p,0);
|
if (w==0) w=select_weapon(p,0);
|
||||||
else if (w==3) w=select_weapon(p,0),monster|=monster_far;
|
else if (w==3) w=select_weapon(p,0),monster|=monster_far;
|
||||||
else w--,monster|=monster_far;
|
else w--,monster|=monster_far;
|
||||||
if (p->used && !p->programovano && p->lives)
|
if (p->used && !p->programovano && p->lives) {
|
||||||
if (prekvapeni || !p->actions || !autoattack || !monster)
|
if (prekvapeni || !p->actions || !autoattack || !monster)
|
||||||
{
|
{
|
||||||
p->programovano++;p->zvolene_akce->action=AC_STAND;
|
p->programovano++;p->zvolene_akce->action=AC_STAND;
|
||||||
|
@ -1813,6 +1822,7 @@ static void zahajit_kolo(char prekvapeni)
|
||||||
p->programovano=(char)p->actions;
|
p->programovano=(char)p->actions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rozhodni_o_poradi();
|
rozhodni_o_poradi();
|
||||||
unwire_proc();
|
unwire_proc();
|
||||||
wire_jadro_souboje();
|
wire_jadro_souboje();
|
||||||
|
@ -1910,7 +1920,7 @@ void souboje_turn(char smer)
|
||||||
|
|
||||||
void programming_keyboard(EVENT_MSG *msg,void **unused)
|
void programming_keyboard(EVENT_MSG *msg,void **unused)
|
||||||
{
|
{
|
||||||
char c;
|
uint8_t c;
|
||||||
|
|
||||||
unused;
|
unused;
|
||||||
if (msg->msg==E_KEYBOARD)
|
if (msg->msg==E_KEYBOARD)
|
||||||
|
@ -2074,32 +2084,47 @@ char zasah_veci(int sector,TFLY *fl)
|
||||||
{
|
{
|
||||||
if (mob_map[sector] && fl->owner>=0)
|
if (mob_map[sector] && fl->owner>=0)
|
||||||
{
|
{
|
||||||
if (fl->owner>=0) select_player=fl->owner-1;
|
if (fl->owner >= 0)
|
||||||
if (it->druh!=TYP_VRHACI) return 1;
|
select_player = fl->owner - 1;
|
||||||
if (it->magie) area_cast(it->spell,sector,fl->owner,1);
|
if (it->druh != TYP_VRHACI)
|
||||||
mob1=mob_map[sector]-MOB_START;m1=&mobs[mob1];
|
return 1;
|
||||||
mob2=m1->next-MOB_START;
|
if (it->magie)
|
||||||
if (mob2>=0)
|
area_cast(it->spell, sector, fl->owner, 1);
|
||||||
{
|
mob1 = mob_map[sector] - MOB_START;
|
||||||
m2=&mobs[mob2];
|
m1 = &mobs[mob1];
|
||||||
if (m2->vlajky & MOB_PASSABLE) m2=NULL;//pruchozi nestvury nemaji affekt na hozenou vec
|
mob2 = m1->next - MOB_START;
|
||||||
}
|
if (mob2 >= 0) {
|
||||||
else m2=NULL;
|
m2 = &mobs[mob2];
|
||||||
if (m1->vlajky & MOB_PASSABLE) if (m2!=NULL) m1=m2;else return 0;
|
if (m2->vlajky & MOB_PASSABLE) {
|
||||||
if (m2==NULL)
|
m2 = NULL; //pruchozi nestvury nemaji affekt na hozenou vec
|
||||||
{
|
}
|
||||||
mob_hit(m1,vypocet_zasahu(it->zmeny,m1->vlastnosti,1,fl->damage,fl->hit_bonus));
|
} else {
|
||||||
m1->dir=fl->smer+2&3;
|
m2 = NULL;
|
||||||
|
}
|
||||||
|
if (m1->vlajky & MOB_PASSABLE) {
|
||||||
|
if (m2 != NULL) {
|
||||||
|
m1 = m2;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m2 == NULL) {
|
||||||
|
mob_hit(m1,
|
||||||
|
vypocet_zasahu(it->zmeny, m1->vlastnosti, 1, fl->damage,
|
||||||
|
fl->hit_bonus));
|
||||||
|
m1->dir = fl->smer + 2 & 3;
|
||||||
|
} else {
|
||||||
|
mob_hit(m1,
|
||||||
|
vypocet_zasahu(it->zmeny, m1->vlastnosti, 2, fl->damage,
|
||||||
|
fl->hit_bonus));
|
||||||
|
mob_hit(m2,
|
||||||
|
vypocet_zasahu(it->zmeny, m1->vlastnosti, 2, fl->damage,
|
||||||
|
fl->hit_bonus));
|
||||||
|
m1->dir = fl->smer + 2 & 3;
|
||||||
|
m2->dir = fl->smer + 2 & 3;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mob_hit(m1,vypocet_zasahu(it->zmeny,m1->vlastnosti,2,fl->damage,fl->hit_bonus));
|
|
||||||
mob_hit(m2,vypocet_zasahu(it->zmeny,m1->vlastnosti,2,fl->damage,fl->hit_bonus));
|
|
||||||
m1->dir=fl->smer+2&3;
|
|
||||||
m2->dir=fl->smer+2&3;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else if (map_coord[sector].flags & MC_PLAYER && (fl->owner<=0 || pocet_zivych(sector)>2))
|
else if (map_coord[sector].flags & MC_PLAYER && (fl->owner<=0 || pocet_zivych(sector)>2))
|
||||||
{
|
{
|
||||||
int kolik,i,c=0;
|
int kolik,i,c=0;
|
||||||
|
@ -2314,7 +2339,7 @@ void send_weapon_skill(int druh)
|
||||||
char player_check_death(THUMAN *p, char afterround)
|
char player_check_death(THUMAN *p, char afterround)
|
||||||
{
|
{
|
||||||
p->used&=~0x80;
|
p->used&=~0x80;
|
||||||
if (p->lives<=0 && p->groupnum)
|
if (p->lives<=0 && p->groupnum) {
|
||||||
if (!battle || afterround)
|
if (!battle || afterround)
|
||||||
{
|
{
|
||||||
int mp;
|
int mp;
|
||||||
|
@ -2356,6 +2381,7 @@ char player_check_death(THUMAN *p, char afterround)
|
||||||
if (p->lives<0) p->lives=0;
|
if (p->lives<0) p->lives=0;
|
||||||
p->used|=0x80;
|
p->used|=0x80;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (p->lives>p->vlastnosti[VLS_MAXHIT]) p->lives=p->vlastnosti[VLS_MAXHIT];
|
if (p->lives>p->vlastnosti[VLS_MAXHIT]) p->lives=p->vlastnosti[VLS_MAXHIT];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ MAP_PROC(map_test)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void spell_teleport();
|
|
||||||
MAP_PROC(map_teleport)
|
MAP_PROC(map_teleport)
|
||||||
{
|
{
|
||||||
side=0;event;
|
side=0;event;
|
||||||
|
@ -49,9 +49,9 @@ MAP_PROC(map_teleport)
|
||||||
if (mob_map[sector]!=0)
|
if (mob_map[sector]!=0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
spell_teleport(-mob_map[sector],-1);
|
spell_teleport(-mob_map[sector],-1,-1);
|
||||||
if ((i=mobs[mob_map[sector]-1].next)!=0)
|
if ((i=mobs[mob_map[sector]-1].next)!=0)
|
||||||
spell_teleport(-i,-1);
|
spell_teleport(-i,-1,-1);
|
||||||
side=1;
|
side=1;
|
||||||
}
|
}
|
||||||
if (map_coord[sector].flags & MC_DPLAYER)
|
if (map_coord[sector].flags & MC_DPLAYER)
|
||||||
|
@ -222,7 +222,7 @@ static void show_liane(THE_TIMER *t)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
static const float Inv2=0.5;
|
|
||||||
static const float Snapper=3<<22;
|
static const float Snapper=3<<22;
|
||||||
|
|
||||||
static __inline int toInt(float fval)
|
static __inline int toInt(float fval)
|
||||||
|
@ -317,7 +317,7 @@ MAP_PROC(map_liana)
|
||||||
|
|
||||||
MAP_PROC(map_identify)
|
MAP_PROC(map_identify)
|
||||||
{
|
{
|
||||||
int x,y,yp,xp,ys,yss;
|
int x,y,yp,xp,ys;
|
||||||
int i,cnt;char s[100];
|
int i,cnt;char s[100];
|
||||||
TITEM *it;
|
TITEM *it;
|
||||||
TSTR_LIST ls;
|
TSTR_LIST ls;
|
||||||
|
@ -354,19 +354,17 @@ MAP_PROC(map_identify)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x=320-ID_XS/2;
|
x=320-ID_XS/2;
|
||||||
y=y=240-ys/2;
|
y=240-ys/2;
|
||||||
create_frame(x,y,ID_XS,ys,1);
|
create_frame(x,y,ID_XS,ys,1);
|
||||||
xp=x+5;yp=y+5;ys=ID_YS-10;
|
xp=x+5;yp=y+5;ys=ID_YS-10;
|
||||||
set_font(H_FBOLD,NOSHADOW(0));
|
set_font(H_FBOLD,NOSHADOW(0));
|
||||||
yss=ys;
|
|
||||||
while(i<cnt)
|
while(i<cnt)
|
||||||
{
|
{
|
||||||
position(xp,yp);outtext(ls[i]);
|
position(xp,yp);outtext(ls[i]);
|
||||||
yp+=10;yss-=10;
|
yp+=10;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
showview(0,0,0,0);
|
showview(0,0,0,0);
|
||||||
getchar();
|
|
||||||
wire_proc();
|
wire_proc();
|
||||||
}
|
}
|
||||||
while (i<cnt);
|
while (i<cnt);
|
||||||
|
@ -389,7 +387,7 @@ static int get_dangerous_place(int sector)
|
||||||
|
|
||||||
MOB_PROC(mob_open_door)
|
MOB_PROC(mob_open_door)
|
||||||
{
|
{
|
||||||
if (event==SMPR_WALK)
|
if (event==SMPR_WALK) {
|
||||||
if (m->user_data<128 || m->user_data>192)
|
if (m->user_data<128 || m->user_data>192)
|
||||||
{
|
{
|
||||||
int sector=m->sector;
|
int sector=m->sector;
|
||||||
|
@ -427,6 +425,7 @@ MOB_PROC(mob_open_door)
|
||||||
}
|
}
|
||||||
return m->user_data<144;
|
return m->user_data<144;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,7 +682,7 @@ static t_map_proc sp_map_table[]=
|
||||||
char call_mob_event(int event_number,int event_type,TMOB *m)
|
char call_mob_event(int event_number,int event_type,TMOB *m)
|
||||||
{
|
{
|
||||||
if (!event_number) return 0;
|
if (!event_number) return 0;
|
||||||
if (event_number>=SP_MOB_TAB_SIZE)
|
if (event_number>=(int)SP_MOB_TAB_SIZE)
|
||||||
event_error("Nestv<EFBFBD>ra pou<6F><75>va neplatnou specproc.",event_number);
|
event_error("Nestv<EFBFBD>ra pou<6F><75>va neplatnou specproc.",event_number);
|
||||||
cur_event_number=event_number;
|
cur_event_number=event_number;
|
||||||
return sp_mob_table[event_number](event_type,m);
|
return sp_mob_table[event_number](event_type,m);
|
||||||
|
@ -692,7 +691,7 @@ char call_mob_event(int event_number,int event_type,TMOB *m)
|
||||||
char call_item_event(int event_number,int event_type,short *ptr,THUMAN *p)
|
char call_item_event(int event_number,int event_type,short *ptr,THUMAN *p)
|
||||||
{
|
{
|
||||||
if (!event_number) return 0;
|
if (!event_number) return 0;
|
||||||
if (event_number>=SP_ITEM_TAB_SIZE)
|
if (event_number>=(int)SP_ITEM_TAB_SIZE)
|
||||||
event_error("<EFBFBD><EFBFBD>slo ud<75>losti u v<>ci je neplatn<74>. Specproc nen<65> definov<6F>na.",event_number);
|
event_error("<EFBFBD><EFBFBD>slo ud<75>losti u v<>ci je neplatn<74>. Specproc nen<65> definov<6F>na.",event_number);
|
||||||
cur_event_number=event_number;
|
cur_event_number=event_number;
|
||||||
return sp_item_table[event_number](event_type,ptr,p);
|
return sp_item_table[event_number](event_type,ptr,p);
|
||||||
|
@ -701,7 +700,7 @@ char call_item_event(int event_number,int event_type,short *ptr,THUMAN *p)
|
||||||
char call_map_event(int event_number,int sector,int side,int value,int event)
|
char call_map_event(int event_number,int sector,int side,int value,int event)
|
||||||
{
|
{
|
||||||
if (!event_number) return 0;
|
if (!event_number) return 0;
|
||||||
if (event_number>=SP_MAP_TAB_SIZE)
|
if (event_number>=(int)SP_MAP_TAB_SIZE)
|
||||||
event_error("Neplatn<EFBFBD> <20><>slo ud<75>losti na st<73>n<EFBFBD>. Specproc s t<>mto <20><>slem nen<65> definov<6F>na.",event_number);
|
event_error("Neplatn<EFBFBD> <20><>slo ud<75>losti na st<73>n<EFBFBD>. Specproc s t<>mto <20><>slem nen<65> definov<6F>na.",event_number);
|
||||||
cur_event_number=event_number;
|
cur_event_number=event_number;
|
||||||
return sp_map_table[event_number](sector,side,value,event);
|
return sp_map_table[event_number](sector,side,value,event);
|
||||||
|
|
|
@ -111,6 +111,18 @@ int temp_storage_getc(TMPFILE_RD *f) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *temp_storage_gets(char *buff, size_t sz, TMPFILE_RD *f) {
|
||||||
|
auto &d =f->_data;
|
||||||
|
auto pos = d.find('\n');
|
||||||
|
if (pos > d.size()) pos = d.size();
|
||||||
|
if (pos == 0) return NULL;
|
||||||
|
if (pos > sz - 1) pos = sz - 1;
|
||||||
|
temp_storage_read(buff, pos, f);
|
||||||
|
buff[pos] = 0;
|
||||||
|
return buff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void temp_storage_internal_begin_scanf(TMPFILE_RD *f, const char *format, ...) {
|
void temp_storage_internal_begin_scanf(TMPFILE_RD *f, const char *format, ...) {
|
||||||
if (f->_data.empty()) {
|
if (f->_data.empty()) {
|
||||||
f->scan_ret = -1;
|
f->scan_ret = -1;
|
||||||
|
|
|
@ -9,7 +9,7 @@ int32_t temp_storage_retrieve(const char *name, void *data, int32_t size);
|
||||||
|
|
||||||
void temp_storage_list(void (*callback)(const char *, void *), void *context);
|
void temp_storage_list(void (*callback)(const char *, void *), void *context);
|
||||||
|
|
||||||
void temp_storage_clear();
|
void temp_storage_clear(void);
|
||||||
|
|
||||||
typedef struct _temp_storage_file_rd TMPFILE_RD;
|
typedef struct _temp_storage_file_rd TMPFILE_RD;
|
||||||
typedef struct _temp_storage_file_wr TMPFILE_WR;
|
typedef struct _temp_storage_file_wr TMPFILE_WR;
|
||||||
|
@ -21,6 +21,7 @@ void temp_storage_delete(const char *name);
|
||||||
void temp_storage_close_rd(TMPFILE_RD *f);
|
void temp_storage_close_rd(TMPFILE_RD *f);
|
||||||
void temp_storage_close_wr(TMPFILE_WR *f);
|
void temp_storage_close_wr(TMPFILE_WR *f);
|
||||||
int temp_storage_getc(TMPFILE_RD *f);
|
int temp_storage_getc(TMPFILE_RD *f);
|
||||||
|
char *temp_storage_gets(char *buff, size_t sz, TMPFILE_RD *f);
|
||||||
void temp_storage_ungetc(TMPFILE_RD *f);
|
void temp_storage_ungetc(TMPFILE_RD *f);
|
||||||
void temp_storage_write(const void *data, uint32_t size, TMPFILE_WR *f);
|
void temp_storage_write(const void *data, uint32_t size, TMPFILE_WR *f);
|
||||||
uint32_t temp_storage_read(void *data, uint32_t size, TMPFILE_RD *f);
|
uint32_t temp_storage_read(void *data, uint32_t size, TMPFILE_RD *f);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
void install_wizard();
|
void install_wizard(void);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "bgraph.h"
|
#include "bgraph.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "basicobj.h"
|
#include "basicobj.h"
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define MEMTEXT "Pam<61>t: "
|
#define MEMTEXT "Pam<61>t: "
|
||||||
|
|
||||||
|
@ -233,7 +234,7 @@ void draw_status_line(char *c)
|
||||||
|
|
||||||
p=strchr(c,'\0');
|
p=strchr(c,'\0');
|
||||||
*(--p)='\0';
|
*(--p)='\0';
|
||||||
if (p=c) break;
|
if (p==c) break;
|
||||||
}
|
}
|
||||||
position(5,y);outtext(c);
|
position(5,y);outtext(c);
|
||||||
ukaz_mysku();
|
ukaz_mysku();
|
||||||
|
@ -263,7 +264,7 @@ void status_line(EVENT_MSG *msg, T_EVENT_ROOT **user_data) {
|
||||||
static char st_line[256], oldline[256] = { "\0" };
|
static char st_line[256], oldline[256] = { "\0" };
|
||||||
static char recurse = 1;
|
static char recurse = 1;
|
||||||
|
|
||||||
if (msg->msg == E_INIT)
|
if (msg->msg == E_INIT) {
|
||||||
if (recurse) {
|
if (recurse) {
|
||||||
T_EVENT_ROOT *p;
|
T_EVENT_ROOT *p;
|
||||||
recurse = 0;
|
recurse = 0;
|
||||||
|
@ -274,8 +275,10 @@ void status_line(EVENT_MSG *msg, T_EVENT_ROOT **user_data) {
|
||||||
draw_status_line(NULL);
|
draw_status_line(NULL);
|
||||||
recurse = 1;
|
recurse = 1;
|
||||||
return;
|
return;
|
||||||
} else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg->msg = va_arg(msg->data, int);
|
msg->msg = va_arg(msg->data, int);
|
||||||
if (msg->msg == E_REDRAW) {
|
if (msg->msg == E_REDRAW) {
|
||||||
|
@ -364,23 +367,21 @@ void win_label_move(EVENT_MSG *msg,OBJREC *o)
|
||||||
static int drawed=0;
|
static int drawed=0;
|
||||||
|
|
||||||
o;
|
o;
|
||||||
if (msg->msg==E_INIT) return;
|
if (msg->msg == E_INIT)
|
||||||
if (msg->msg==E_TIMER)
|
return;
|
||||||
{
|
if (msg->msg == E_TIMER) {
|
||||||
send_message(E_TIMER);
|
send_message(E_TIMER);
|
||||||
if (!drawed)
|
if (!drawed) {
|
||||||
if (!moved)
|
if (!moved) {
|
||||||
{
|
drawed = 1;
|
||||||
drawed=1;
|
redraw_desktop();
|
||||||
redraw_desktop();
|
moved = 0;
|
||||||
moved=0;
|
} else {
|
||||||
}
|
drawed = 0;
|
||||||
else
|
moved = 0;
|
||||||
{
|
}
|
||||||
drawed=0;
|
}
|
||||||
moved=0;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if (msg->msg==E_MOUSE)
|
if (msg->msg==E_MOUSE)
|
||||||
{
|
{
|
||||||
ms=get_mouse(msg);
|
ms=get_mouse(msg);
|
||||||
|
@ -447,7 +448,7 @@ void check_box_draw(int x1,int y1, int x2, int y2,OBJREC *o)
|
||||||
{
|
{
|
||||||
int x3;
|
int x3;
|
||||||
|
|
||||||
x1+=1;y1+=1;x2-=1;y2-=1;
|
x1+=1;y1+=1;/*x2-=1*/;y2-=1;
|
||||||
x3=x1+(y2-y1);
|
x3=x1+(y2-y1);
|
||||||
draw_border(x1,y1,x3-x1,y2-y1,def_border(4,curcolor));
|
draw_border(x1,y1,x3-x1,y2-y1,def_border(4,curcolor));
|
||||||
bar32(x1,y1,x3,y2);
|
bar32(x1,y1,x3,y2);
|
||||||
|
@ -710,18 +711,21 @@ void input_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
||||||
void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
{
|
{
|
||||||
static int cursor=0;
|
static int cursor=0;
|
||||||
int *len,*start,slen;
|
int len;
|
||||||
|
int *start;
|
||||||
|
int slen;
|
||||||
char *c;
|
char *c;
|
||||||
static char *save;
|
static char *save;
|
||||||
static char clear_kontext;
|
static char clear_kontext;
|
||||||
|
|
||||||
input_line_state *st = o->userptr;
|
input_line_state *st = o->userptr;
|
||||||
|
len = st->len;
|
||||||
start=&st->start;
|
start=&st->start;
|
||||||
c=(char *)o->data;
|
c=(char *)o->data;
|
||||||
slen=strlen(c);
|
slen=strlen(c);
|
||||||
switch (msg->msg)
|
switch (msg->msg)
|
||||||
{
|
{
|
||||||
case E_GET_FOCUS:cursor=0;save=(char *)getmem(*len+1);
|
case E_GET_FOCUS:cursor=0;save=(char *)getmem(len+1);
|
||||||
strcpy(save,c);clear_kontext=1;break;
|
strcpy(save,c);clear_kontext=1;break;
|
||||||
case E_LOST_FOCUS:cursor=0;*start=0;free(save);redraw_object(o);break;
|
case E_LOST_FOCUS:cursor=0;*start=0;free(save);redraw_object(o);break;
|
||||||
case E_CURSOR_TICK:
|
case E_CURSOR_TICK:
|
||||||
|
@ -789,7 +793,7 @@ void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
case 0:break;
|
case 0:break;
|
||||||
case 13:break;
|
case 13:break;
|
||||||
case 27:strcpy(c,save);slen=strlen(c);if (cursor>slen) cursor=slen;break;
|
case 27:strcpy(c,save);slen=strlen(c);if (cursor>slen) cursor=slen;break;
|
||||||
default:if (key>=' ') if (slen<*len || clear_kontext)
|
default:if (key>=' ') if (slen<len || clear_kontext)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -895,13 +899,15 @@ void scroll_button_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg->msg==E_TIMER && *(char *)o->data )
|
if (msg->msg==E_TIMER && *(char *)o->data ) {
|
||||||
if (ms_last_event.tl1) set_change();
|
if (ms_last_event.tl1) {
|
||||||
else if (!ms_last_event.tl2)
|
set_change();
|
||||||
|
} else if (!ms_last_event.tl2)
|
||||||
{
|
{
|
||||||
*(char *)o->data=0;
|
*(char *)o->data=0;
|
||||||
redraw_object(o);
|
redraw_object(o);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (msg->msg==E_GET_FOCUS || msg->msg==E_LOST_FOCUS)
|
if (msg->msg==E_GET_FOCUS || msg->msg==E_LOST_FOCUS)
|
||||||
{
|
{
|
||||||
|
@ -1258,7 +1264,7 @@ void resizer_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
|
|
||||||
o;
|
o;
|
||||||
if (msg->msg==E_INIT) return;
|
if (msg->msg==E_INIT) return;
|
||||||
if (msg->msg==E_TIMER && !drawed)
|
if (msg->msg==E_TIMER && !drawed) {
|
||||||
if (!moved)
|
if (!moved)
|
||||||
{
|
{
|
||||||
drawed=1;
|
drawed=1;
|
||||||
|
@ -1270,6 +1276,7 @@ void resizer_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
drawed=0;
|
drawed=0;
|
||||||
moved=0;
|
moved=0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (msg->msg==E_MOUSE)
|
if (msg->msg==E_MOUSE)
|
||||||
{
|
{
|
||||||
ms=get_mouse(msg);
|
ms=get_mouse(msg);
|
||||||
|
|
|
@ -29,7 +29,7 @@ void label(OBJREC *o);
|
||||||
void mid_label(OBJREC *o);
|
void mid_label(OBJREC *o);
|
||||||
void scroll_bar_v(OBJREC *o);
|
void scroll_bar_v(OBJREC *o);
|
||||||
void scroll_button(OBJREC *o);
|
void scroll_button(OBJREC *o);
|
||||||
void scroll_support();
|
void scroll_support(void);
|
||||||
void scroll_bar_h(OBJREC *o);
|
void scroll_bar_h(OBJREC *o);
|
||||||
void button2(OBJREC *o);
|
void button2(OBJREC *o);
|
||||||
void resizer(OBJREC *o);
|
void resizer(OBJREC *o);
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
word *GetScreenAdr();
|
word *GetScreenAdr(void);
|
||||||
word *GetBuffer2nd();
|
word *GetBuffer2nd(void);
|
||||||
int32_t GetScreenPitch();
|
int32_t GetScreenPitch(void);
|
||||||
int32_t GetBuffer2ndPitch();
|
int32_t GetBuffer2ndPitch(void);
|
||||||
int32_t GetScreenSizeBytes();
|
int32_t GetScreenSizeBytes(void);
|
||||||
|
|
||||||
void RedirectScreen(word *newaddr);
|
void RedirectScreen(word *newaddr);
|
||||||
void RestoreScreen();
|
void RestoreScreen(void);
|
||||||
void RedirectScreenBufferSecond();
|
void RedirectScreenBufferSecond(void);
|
||||||
|
|
||||||
|
|
||||||
extern word curcolor,charcolors[7];
|
extern word curcolor,charcolors[7];
|
||||||
|
@ -99,35 +99,35 @@ void showview256(word x,word y,word xs,word ys);
|
||||||
void showview_lo(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(char *text);
|
||||||
int initmode_dx(char inwindow, char zoom, char monitor, int refresh);
|
int initmode_dx(char inwindow, char zoom, char monitor, int refresh);
|
||||||
int initmode32();
|
int initmode32(void);
|
||||||
int initmode32b();
|
int initmode32b(void);
|
||||||
int initmode256(void *paletefile);
|
int initmode256(void *paletefile);
|
||||||
int initmode256b(void *paletefile);
|
int initmode256b(void *paletefile);
|
||||||
int initmode_lo(void *paletefile);
|
int initmode_lo(void *paletefile);
|
||||||
int initmode16(void *paletefile);
|
int initmode16(void *paletefile);
|
||||||
int initmode64(void *paletefile);
|
int initmode64(void *paletefile);
|
||||||
int initmode64b(void *paletefile);
|
int initmode64b(void *paletefile);
|
||||||
void *create_hixlat();
|
void *create_hixlat(void);
|
||||||
void closemode();
|
void closemode(void);
|
||||||
void line32(word x1,word y1, word x2, word y2);
|
void line32(word x1,word y1, word x2, word y2);
|
||||||
void position(word x,word y);
|
void position(word x,word y);
|
||||||
void outtext(char *text);
|
void outtext(char *text);
|
||||||
void show_ms_cursor(integer x,integer y);
|
void show_ms_cursor(integer x,integer y);
|
||||||
void *register_ms_cursor(void *cursor);
|
void *register_ms_cursor(void *cursor);
|
||||||
void move_ms_cursor(integer newx,integer newy,char nodraw);
|
void move_ms_cursor(integer newx,integer newy,char nodraw);
|
||||||
void hide_ms_cursor();
|
void hide_ms_cursor(void);
|
||||||
int text_height(char *text);
|
int text_height(char *text);
|
||||||
int text_width(char *text);
|
int text_width(char *text);
|
||||||
void set_aligned_position(int x,int y,char alignx, char aligny,char *text);
|
void set_aligned_position(int x,int y,char alignx, char aligny,char *text);
|
||||||
void wait_retrace();
|
void wait_retrace(void);
|
||||||
void pal_optimize();
|
void pal_optimize(void);
|
||||||
void rectangle(int x1,int y1,int x2,int y2,int color);
|
void rectangle(int x1,int y1,int x2,int y2,int color);
|
||||||
word *mapvesaadr1(word *a);
|
word *mapvesaadr1(word *a);
|
||||||
void *create_special_palette();
|
void *create_special_palette(void);
|
||||||
void *create_special_palette2();
|
void *create_special_palette2(void);
|
||||||
void *create_blw_palette16();
|
void *create_blw_palette16(void);
|
||||||
void rel_position_x(word x);
|
void rel_position_x(word x);
|
||||||
int init_empty_mode();
|
int init_empty_mode(void);
|
||||||
|
|
||||||
void put_8bit_clipped(void *src,void *trg,int startline,int velx,int vely);
|
void put_8bit_clipped(void *src,void *trg,int startline,int velx,int vely);
|
||||||
//#pragma aux put_8bit_clipped parm [ESI][EDI][EAX][EBX][EDX] modify [ECX];
|
//#pragma aux put_8bit_clipped parm [ESI][EDI][EAX][EBX][EDX] modify [ECX];
|
||||||
|
|
|
@ -715,8 +715,8 @@ void *create_blw_palette16()
|
||||||
char *c;
|
char *c;
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
void *z;
|
void *z;
|
||||||
char pal_colors[]={0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63};
|
uint8_t pal_colors[]={0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63};
|
||||||
char carnat[]={0,1,3,2,4,5,7,6,12,13,15,14,8,9,11,10};
|
uint8_t carnat[]={0,1,3,2,4,5,7,6,12,13,15,14,8,9,11,10};
|
||||||
|
|
||||||
z=c=getmem(3*256+2*32768);
|
z=c=getmem(3*256+2*32768);
|
||||||
for(i=0;i<16;i++)
|
for(i=0;i<16;i++)
|
||||||
|
|
|
@ -352,7 +352,7 @@ void put_picture(word x,word y,void *p)
|
||||||
if (mode==8 || mode==264)
|
if (mode==8 || mode==264)
|
||||||
{
|
{
|
||||||
word *table=data;
|
word *table=data;
|
||||||
char *cdata=(char *)(data+(mode==264?10*256:256));
|
uint8_t *cdata=(uint8_t *)(data+(mode==264?10*256:256));
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ void put_picture(word x,word y,void *p)
|
||||||
else if (mode==512 )
|
else if (mode==512 )
|
||||||
{
|
{
|
||||||
word *table=data;
|
word *table=data;
|
||||||
char *cdata=(char *)(data+256);
|
uint8_t *cdata=(uint8_t *)(data+256);
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
@ -414,8 +414,6 @@ void put_image(word *image,word *target,int start_line,int sizex,int sizey)
|
||||||
int32_t scr_linelen2 = GetScreenPitch();
|
int32_t scr_linelen2 = GetScreenPitch();
|
||||||
word *esi = image;
|
word *esi = image;
|
||||||
word *edi = target;
|
word *edi = target;
|
||||||
int eax = start_line;
|
|
||||||
int ebx = sizex;
|
|
||||||
int edx = sizey;
|
int edx = sizey;
|
||||||
int ecx = esi[0];
|
int ecx = esi[0];
|
||||||
esi = esi + 3 + start_line * ecx;
|
esi = esi + 3 + start_line * ecx;
|
||||||
|
@ -718,7 +716,6 @@ void put_picture2picture(word *source,word *target,int xp,int yp)
|
||||||
word src_cx = srchdr[0];
|
word src_cx = srchdr[0];
|
||||||
word trg_cx = trghdr[0];
|
word trg_cx = trghdr[0];
|
||||||
word src_cy = srchdr[1];
|
word src_cy = srchdr[1];
|
||||||
word trg_cy = trghdr[1];
|
|
||||||
word y;
|
word y;
|
||||||
|
|
||||||
unsigned char *srcimagedata = (unsigned char *)source+pic_start;
|
unsigned char *srcimagedata = (unsigned char *)source+pic_start;
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
extern MS_EVENT ms_last_event;
|
extern MS_EVENT ms_last_event;
|
||||||
|
|
||||||
short init_mysky();
|
short init_mysky(void);
|
||||||
short done_mysky();
|
short done_mysky(void);
|
||||||
void ukaz_mysku();
|
void ukaz_mysku(void);
|
||||||
void schovej_mysku();
|
void schovej_mysku(void);
|
||||||
void zobraz_mysku();
|
void zobraz_mysku(void);
|
||||||
void set_ms_finger(int x,int y);
|
void set_ms_finger(int x,int y);
|
||||||
void update_mysky(void);
|
void update_mysky(void);
|
||||||
char je_myska_zobrazena();
|
char je_myska_zobrazena(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -56,7 +56,7 @@ char *cz_key_tabs[]={cz_table_1,cz_table_2,cz_table_3};
|
||||||
void keyboard(EVENT_MSG *msg,void *user_data)
|
void keyboard(EVENT_MSG *msg,void *user_data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static char cz_mode=0;
|
static uint8_t cz_mode=0;
|
||||||
char c,d;
|
char c,d;
|
||||||
|
|
||||||
msg;user_data;
|
msg;user_data;
|
||||||
|
|
|
@ -19,5 +19,5 @@ extern TMS_BASIC_INFO ms_basic_info;
|
||||||
|
|
||||||
int lock_region (void *address, unsigned length);
|
int lock_region (void *address, unsigned length);
|
||||||
void keyboard(EVENT_MSG *msg,void *user_data);
|
void keyboard(EVENT_MSG *msg,void *user_data);
|
||||||
char ms_get_keycount();
|
char ms_get_keycount(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static jmp_buf jmpenv;
|
|
||||||
|
|
||||||
#define find_event_msg(where,what,res) \
|
#define find_event_msg(where,what,res) \
|
||||||
{\
|
{\
|
||||||
|
@ -285,7 +284,6 @@ static int call_proc(EVENT_MSG *msg, void *ctx) {
|
||||||
T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata,char end)
|
T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata,char end)
|
||||||
//instaluje novou udalost;
|
//instaluje novou udalost;
|
||||||
{
|
{
|
||||||
EVENT_MSG x;
|
|
||||||
void *user=NULL;
|
void *user=NULL;
|
||||||
T_EVENT_POINT *p;
|
T_EVENT_POINT *p;
|
||||||
call_proc_context ctx = {proc, &user};
|
call_proc_context ctx = {proc, &user};
|
||||||
|
@ -299,7 +297,6 @@ T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,voi
|
||||||
void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata)
|
void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata)
|
||||||
//deinstaluje udalost;
|
//deinstaluje udalost;
|
||||||
{
|
{
|
||||||
EVENT_MSG x;
|
|
||||||
T_EVENT_ROOT *r;
|
T_EVENT_ROOT *r;
|
||||||
T_EVENT_POINT *p;
|
T_EVENT_POINT *p;
|
||||||
|
|
||||||
|
@ -317,9 +314,7 @@ void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procd
|
||||||
|
|
||||||
void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg)
|
void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg)
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
void (*q)();
|
void (*q)();
|
||||||
EVENT_MSG tg;
|
|
||||||
|
|
||||||
if (msg->msg==E_ADD || msg->msg==E_ADDEND)
|
if (msg->msg==E_ADD || msg->msg==E_ADDEND)
|
||||||
{
|
{
|
||||||
|
@ -394,6 +389,7 @@ int send_message_to(int (*cb)(EVENT_MSG *, void *), void *ctx, int message, ...)
|
||||||
va_start(x.data, message);
|
va_start(x.data, message);
|
||||||
int r = cb(&x, ctx);
|
int r = cb(&x, ctx);
|
||||||
va_end(x.data);
|
va_end(x.data);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_message_to_tree(EVENT_MSG *x) {
|
static void send_message_to_tree(EVENT_MSG *x) {
|
||||||
|
@ -430,7 +426,7 @@ void timer(EVENT_MSG *msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tasker(EVENT_MSG *msg,void **)
|
void tasker(EVENT_MSG *msg,void **_)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ extern char *otevri_zavoru;
|
||||||
//extern int curtask;
|
//extern int curtask;
|
||||||
//extern char *task_info;
|
//extern char *task_info;
|
||||||
|
|
||||||
void init_events();
|
void init_events(void);
|
||||||
// inicalizuje zakladni strom udalosto
|
// inicalizuje zakladni strom udalosto
|
||||||
void send_message(int message,...);
|
void send_message(int message,...);
|
||||||
|
|
||||||
|
@ -121,8 +121,8 @@ static __inline void shift_message(EVENT_MSG *msg) {
|
||||||
msg->msg = va_arg(msg->data, int);
|
msg->msg = va_arg(msg->data, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_events();
|
void do_events(void);
|
||||||
void escape();
|
void escape(void);
|
||||||
|
|
||||||
#include <legacy_coroutines.h>
|
#include <legacy_coroutines.h>
|
||||||
/*
|
/*
|
||||||
|
|
17
libs/gui.c
17
libs/gui.c
|
@ -36,7 +36,7 @@ void empty1(OBJREC *o)
|
||||||
o;
|
o;
|
||||||
}
|
}
|
||||||
|
|
||||||
void empty2_p(OBJREC *o, va_list)
|
void empty2_p(OBJREC *o, va_list _)
|
||||||
{
|
{
|
||||||
o;
|
o;
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ void add_to_idlist(OBJREC *o)
|
||||||
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...)
|
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...)
|
||||||
{
|
{
|
||||||
OBJREC *o;
|
OBJREC *o;
|
||||||
int32_t *p;
|
|
||||||
|
|
||||||
o=(OBJREC *)getmem(sizeof(OBJREC));
|
o=(OBJREC *)getmem(sizeof(OBJREC));
|
||||||
o->x=x;o->y=y;o->xs=xs;o->ys=ys;
|
o->x=x;o->y=y;o->xs=xs;o->ys=ys;
|
||||||
|
@ -341,8 +341,8 @@ void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC
|
||||||
o->autoresizey=0;
|
o->autoresizey=0;
|
||||||
o->on_event=empty;
|
o->on_event=empty;
|
||||||
o->on_enter=empty;
|
o->on_enter=empty;
|
||||||
o->on_exit=empty1;
|
o->on_exit=empty;
|
||||||
o->on_change=empty3;
|
o->on_change=empty;
|
||||||
o->enabled=1;
|
o->enabled=1;
|
||||||
o->draw_error=0;
|
o->draw_error=0;
|
||||||
o->color=waktual->color;memcpy(o->f_color,f_default,sizeof(f_default));
|
o->color=waktual->color;memcpy(o->f_color,f_default,sizeof(f_default));
|
||||||
|
@ -873,10 +873,11 @@ void set_enable(int win_id,int obj_id,int condition)
|
||||||
|
|
||||||
condition=(condition!=0);
|
condition=(condition!=0);
|
||||||
if ((o=find_object_desktop(win_id,obj_id,&w))==NULL) return;
|
if ((o=find_object_desktop(win_id,obj_id,&w))==NULL) return;
|
||||||
if (o==o_aktual)
|
if (o==o_aktual) {
|
||||||
if (send_lost()) return;
|
if (send_lost()) return;
|
||||||
else
|
} else {
|
||||||
o_aktual=NULL;
|
o_aktual=NULL;
|
||||||
|
}
|
||||||
if (o->enabled!=condition)
|
if (o->enabled!=condition)
|
||||||
{
|
{
|
||||||
o->enabled=condition;
|
o->enabled=condition;
|
||||||
|
@ -892,7 +893,7 @@ void close_current()
|
||||||
void background_runner(EVENT_MSG *msg,void **prog)
|
void background_runner(EVENT_MSG *msg,void **prog)
|
||||||
{
|
{
|
||||||
void (*p)();
|
void (*p)();
|
||||||
char i=1;
|
|
||||||
|
|
||||||
if (msg->msg==E_INIT)
|
if (msg->msg==E_INIT)
|
||||||
{
|
{
|
||||||
|
@ -906,7 +907,7 @@ void background_runner(EVENT_MSG *msg,void **prog)
|
||||||
}
|
}
|
||||||
p=*prog;
|
p=*prog;
|
||||||
p();
|
p();
|
||||||
i=0;
|
|
||||||
msg->msg=-2;
|
msg->msg=-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
libs/gui.h
24
libs/gui.h
|
@ -76,9 +76,9 @@ typedef struct objrec
|
||||||
void (*call_event)(EVENT_MSG *msg, struct objrec *);
|
void (*call_event)(EVENT_MSG *msg, struct objrec *);
|
||||||
void (*call_done)(struct objrec *);
|
void (*call_done)(struct objrec *);
|
||||||
void (*on_event)(EVENT_MSG *msg, struct objrec *);
|
void (*on_event)(EVENT_MSG *msg, struct objrec *);
|
||||||
void (*on_enter)();
|
void (*on_enter)(void);
|
||||||
void (*on_exit)();
|
void (*on_exit)(void);
|
||||||
void (*on_change)();
|
void (*on_change)(void);
|
||||||
char draw_error; //1 znamena ze objekt zpusobil chybu a nebude vykreslovan
|
char draw_error; //1 znamena ze objekt zpusobil chybu a nebude vykreslovan
|
||||||
struct objrec *next;
|
struct objrec *next;
|
||||||
}OBJREC;
|
}OBJREC;
|
||||||
|
@ -134,22 +134,22 @@ int32_t desktop_add_window(WINDOW *w);
|
||||||
void select_window(int32_t id);
|
void select_window(int32_t id);
|
||||||
WINDOW *find_window(int32_t id);
|
WINDOW *find_window(int32_t id);
|
||||||
void redraw_object(OBJREC *o);
|
void redraw_object(OBJREC *o);
|
||||||
void redraw_window();
|
void redraw_window(void);
|
||||||
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...);
|
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...);
|
||||||
CTL3D *border(word light,word shadow, word bsize, word btype);
|
CTL3D *border(word light,word shadow, word bsize, word btype);
|
||||||
void property(CTL3D *ctl,word *font,FC_TABLE *fcolor,word color);
|
void property(CTL3D *ctl,word *font,FC_TABLE *fcolor,word color);
|
||||||
FC_TABLE *flat_color(word color);
|
FC_TABLE *flat_color(word color);
|
||||||
void aktivate_window(MS_EVENT *ms);
|
void aktivate_window(MS_EVENT *ms);
|
||||||
void redraw_desktop();
|
void redraw_desktop(void);
|
||||||
void close_window(WINDOW *w);
|
void close_window(WINDOW *w);
|
||||||
void close_current();
|
void close_current(void);
|
||||||
void check_window(WINDOW *w);
|
void check_window(WINDOW *w);
|
||||||
void install_gui(void);
|
void install_gui(void);
|
||||||
void uninstall_gui(void);
|
void uninstall_gui(void);
|
||||||
void on_control_change(void (*proc)());
|
void on_control_change(void (*proc)(void));
|
||||||
void on_control_enter(void (*proc)());
|
void on_control_enter(void (*proc)(void));
|
||||||
void on_control_exit(void (*proc)());
|
void on_control_exit(void (*proc)(void));
|
||||||
void on_control_event(void (*proc)());
|
void on_control_event(void (*proc)(EVENT_MSG *, struct objrec *));
|
||||||
void terminate_gui(void);
|
void terminate_gui(void);
|
||||||
void set_change(void);
|
void set_change(void);
|
||||||
void set_value(int win_id,int obj_id,void *value);
|
void set_value(int win_id,int obj_id,void *value);
|
||||||
|
@ -158,11 +158,11 @@ void c_set_value(int win_id,int obj_id,int cnst);
|
||||||
void c_default(int cnst);
|
void c_default(int cnst);
|
||||||
int f_get_value(int win_id,int obj_id);
|
int f_get_value(int win_id,int obj_id);
|
||||||
void get_value(int win_id,int obj_id,void *buff);
|
void get_value(int win_id,int obj_id,void *buff);
|
||||||
void cancel_event();
|
void cancel_event(void);
|
||||||
OBJREC *find_object(WINDOW *w,int id);
|
OBJREC *find_object(WINDOW *w,int id);
|
||||||
void set_window_modal(void);
|
void set_window_modal(void);
|
||||||
void set_enable(int win_id,int obj_id,int condition);
|
void set_enable(int win_id,int obj_id,int condition);
|
||||||
void run_background(void (*p)());
|
void run_background(void (*p)(void));
|
||||||
void disable_bar(int x,int y,int xs,int ys,word color);
|
void disable_bar(int x,int y,int xs,int ys,word color);
|
||||||
void movesize_win(WINDOW *w, int newx,int newy, int newxs, int newys);
|
void movesize_win(WINDOW *w, int newx,int newy, int newxs, int newys);
|
||||||
void goto_control(int obj_id);
|
void goto_control(int obj_id);
|
||||||
|
|
|
@ -96,7 +96,8 @@ void *getmem(int32_t size)
|
||||||
void *load_file(char *filename)
|
void *load_file(char *filename)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int32_t size,*p;
|
int32_t *p;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
if (mman_action!=NULL) mman_action(MMA_READ);
|
if (mman_action!=NULL) mman_action(MMA_READ);
|
||||||
SEND_LOG("(LOAD) Loading file '%s'",filename,0);
|
SEND_LOG("(LOAD) Loading file '%s'",filename,0);
|
||||||
|
@ -268,7 +269,6 @@ THANDLE_DATA *get_handle(int handle)
|
||||||
void heap_error(size_t size) //heap system
|
void heap_error(size_t size) //heap system
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
char swaped=0;
|
|
||||||
uint32_t maxcounter=0;
|
uint32_t maxcounter=0;
|
||||||
THANDLE_DATA *sh;
|
THANDLE_DATA *sh;
|
||||||
char repeat=0,did=0;
|
char repeat=0,did=0;
|
||||||
|
@ -290,7 +290,7 @@ void heap_error(size_t size) //heap system
|
||||||
|
|
||||||
h=((THANDLE_DATA *)_handles[i]+j);
|
h=((THANDLE_DATA *)_handles[i]+j);
|
||||||
c=bk_global_counter-h->counter;
|
c=bk_global_counter-h->counter;
|
||||||
if (h->status==BK_PRESENT && ~h->flags & BK_LOCKED)
|
if (h->status==BK_PRESENT && ~h->flags & BK_LOCKED) {
|
||||||
if (last_free!=NULL)
|
if (last_free!=NULL)
|
||||||
{
|
{
|
||||||
d=(char *)h->blockdata-last_free;
|
d=(char *)h->blockdata-last_free;
|
||||||
|
@ -304,6 +304,7 @@ void heap_error(size_t size) //heap system
|
||||||
num=i*BK_MINOR_HANDLES+j;
|
num=i*BK_MINOR_HANDLES+j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (lastblock==sh)
|
if (lastblock==sh)
|
||||||
{
|
{
|
||||||
|
@ -324,7 +325,6 @@ void heap_error(size_t size) //heap system
|
||||||
{
|
{
|
||||||
free(sh->blockdata);
|
free(sh->blockdata);
|
||||||
sh->status=BK_SWAPED;
|
sh->status=BK_SWAPED;
|
||||||
swaped=1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -373,7 +373,7 @@ THANDLE_DATA *zneplatnit_block(int handle)
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_manager(char *filename,char */*swap is not supported*/) // filename= Jmeno datoveho souboru nebo NULL pak
|
void init_manager(char *filename,char *swap_is_not_supported) // filename= Jmeno datoveho souboru nebo NULL pak
|
||||||
// se pouzije DOS
|
// se pouzije DOS
|
||||||
// swp je cesta do TEMP adresare
|
// swp je cesta do TEMP adresare
|
||||||
{
|
{
|
||||||
|
@ -537,7 +537,8 @@ void *ablock(int handle)
|
||||||
if (h->src_file[0]!=0)
|
if (h->src_file[0]!=0)
|
||||||
{
|
{
|
||||||
if (mman_action!=NULL) mman_action(MMA_READ);
|
if (mman_action!=NULL) mman_action(MMA_READ);
|
||||||
strcpy(c,mman_pathlist[h->path]);strcat(c,h->src_file);
|
strcpy(c,mman_pathlist[h->path]);
|
||||||
|
strcat(c,h->src_file);
|
||||||
c[strlen(mman_pathlist[h->path])+12]='\0';
|
c[strlen(mman_pathlist[h->path])+12]='\0';
|
||||||
p=load_file(c);
|
p=load_file(c);
|
||||||
s=last_load_size;
|
s=last_load_size;
|
||||||
|
@ -668,12 +669,12 @@ int apreload_sort(const void *val1,const void *val2)
|
||||||
|
|
||||||
void apreload_start(void (*percent)(int cur,int max))
|
void apreload_start(void (*percent)(int cur,int max))
|
||||||
{
|
{
|
||||||
word *p;
|
short *p;
|
||||||
int i;
|
int i;
|
||||||
int c,z;
|
int c,z;
|
||||||
|
|
||||||
swap_status=0;
|
swap_status=0;
|
||||||
p=NewArr(word,max_sign);
|
p=NewArr(short,max_sign);
|
||||||
for(i=0;i<max_sign;i++) p[i]=i;
|
for(i=0;i<max_sign;i++) p[i]=i;
|
||||||
qsort(p,max_sign,sizeof(word),apreload_sort);
|
qsort(p,max_sign,sizeof(word),apreload_sort);
|
||||||
for(i=0,c=0;i<max_sign;i++) if (apr_sign[p[i]]==0x7f7f7f7f)p[i]=-1;else c++;
|
for(i=0,c=0;i<max_sign;i++) if (apr_sign[p[i]]==0x7f7f7f7f)p[i]=-1;else c++;
|
||||||
|
@ -733,7 +734,7 @@ void close_manager()
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
/*static void block()
|
/*static void block()
|
||||||
{
|
{
|
||||||
/* static MEMINFO inf;
|
static MEMINFO inf;
|
||||||
void *c;
|
void *c;
|
||||||
static counter=0;
|
static counter=0;
|
||||||
|
|
||||||
|
@ -801,7 +802,7 @@ void display_status()
|
||||||
void *grealloc(void *p,int32_t size)
|
void *grealloc(void *p,int32_t size)
|
||||||
{
|
{
|
||||||
void *q;
|
void *q;
|
||||||
int32_t scop;
|
|
||||||
|
|
||||||
if (!size)
|
if (!size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef struct thandle_data
|
||||||
int32_t seekpos; //16
|
int32_t seekpos; //16
|
||||||
void *blockdata; //20
|
void *blockdata; //20
|
||||||
char flags; //21
|
char flags; //21
|
||||||
char path; //22
|
uint8_t path; //22
|
||||||
short status;
|
short status;
|
||||||
void (*loadproc)(void **data,int32_t *size);//28
|
void (*loadproc)(void **data,int32_t *size);//28
|
||||||
unsigned short lockcount; //32
|
unsigned short lockcount; //32
|
||||||
|
@ -61,7 +61,7 @@ typedef handle_list *handle_groups[BK_MAJOR_HANDLES];
|
||||||
|
|
||||||
extern char **mman_pathlist; //tento pointer musi byt naplnen ukazatelem na tabulku cest
|
extern char **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 (*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)();
|
extern void (*swap_error)(void);
|
||||||
extern int memman_handle; //cislo handle naposled zpracovavaneho prikazem ablock
|
extern int memman_handle; //cislo handle naposled zpracovavaneho prikazem ablock
|
||||||
extern char mman_patch; //jednicka zapina moznost pouziti patchu
|
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 *getmem(int32_t size); //alokace pameti pres memman. alokovat pomoci malloc lze ale hrozi nebezpeci ze vrati NULL
|
||||||
|
@ -75,8 +75,8 @@ void aunlock(int handle); //odmyka blok
|
||||||
void aswap(int handle); //zapina swapovani pro blok
|
void aswap(int handle); //zapina swapovani pro blok
|
||||||
void aunswap(int handle); //vypina swapovani pro blok
|
void aunswap(int handle); //vypina swapovani pro blok
|
||||||
void apreload(int handle); //zapina preloading pro blok (preloading proved pomoci ablock)
|
void apreload(int handle); //zapina preloading pro blok (preloading proved pomoci ablock)
|
||||||
//void free(); //free
|
//void free(void); //free
|
||||||
void close_manager(); //uzavre manager a uvolni veskerou pamet
|
void close_manager(void); //uzavre manager a uvolni veskerou pamet
|
||||||
void undef_handle(int handle); //uvolni hadle k dalsimu pouziti
|
void undef_handle(int handle); //uvolni hadle k dalsimu pouziti
|
||||||
THANDLE_DATA *zneplatnit_block(int handle); //zneplatni data bloku
|
THANDLE_DATA *zneplatnit_block(int handle); //zneplatni data bloku
|
||||||
THANDLE_DATA *get_handle(int handle); //vraci informace o rukojeti
|
THANDLE_DATA *get_handle(int handle); //vraci informace o rukojeti
|
||||||
|
@ -105,17 +105,17 @@ FILE *afiletemp(char *filename, int group);
|
||||||
|
|
||||||
extern void (*mman_action)(int action); //udalost volajici se pri akci mmanagera.
|
extern void (*mman_action)(int action); //udalost volajici se pri akci mmanagera.
|
||||||
|
|
||||||
void display_status(); //zobrazi na display status memmanageru
|
void display_status(void); //zobrazi na display status memmanageru
|
||||||
|
|
||||||
#ifdef LOGFILE
|
#ifdef LOGFILE
|
||||||
char *get_time_str();
|
char *get_time_str(void);
|
||||||
int q_current_task();
|
int q_current_task(void);
|
||||||
#define OPEN_LOG(log) memcpy(stderr,fopen(log,"w"),sizeof(FILE));
|
#define OPEN_LOG(log) memcpy(stderr,fopen(log,"w"),sizeof(FILE));
|
||||||
#define SEND_LOG(format,parm1,parm2) fprintf(stderr,"%-2d %s "format"\n",q_current_task(),get_time_str(),parm1,parm2),fflush(stderr)
|
#define SEND_LOG(format,parm1,parm2) fprintf(stderr,"%-2d %s "format"\n",q_current_task(void),get_time_str(void),parm1,parm2),fflush(stderr)
|
||||||
#define CLOSE_LOG() fclose(logfile);
|
#define CLOSE_LOG(void) fclose(logfile);
|
||||||
#else
|
#else
|
||||||
#define OPEN_LOG(log)
|
#define OPEN_LOG(log)
|
||||||
#define SEND_LOG(format,parm1,parm2)
|
#define SEND_LOG(format,parm1,parm2)
|
||||||
#define CLOSE_LOG()
|
#define CLOSE_LOG(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,7 +30,7 @@ static int nextgroup;
|
||||||
static int bitsize,init_bitsize;
|
static int bitsize,init_bitsize;
|
||||||
char old_value=0;
|
char old_value=0;
|
||||||
|
|
||||||
void do_clear_code()
|
void do_clear_code(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ void do_clear_code()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reinit_lzw()
|
void reinit_lzw(void)
|
||||||
{
|
{
|
||||||
do_clear_code();
|
do_clear_code();
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ void init_lzw_compressor(int dic_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void done_lzw_compressor()
|
void done_lzw_compressor(void)
|
||||||
{
|
{
|
||||||
free(compress_dic);
|
free(compress_dic);
|
||||||
compress_dic=NULL;
|
compress_dic=NULL;
|
||||||
|
@ -90,7 +90,7 @@ void *open_mgif(void *mgif) //vraci ukazatel na prvni frame
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void close_mgif() //dealokuje buffery pro prehravani
|
void close_mgif(void) //dealokuje buffery pro prehravani
|
||||||
{
|
{
|
||||||
done_lzw_compressor();
|
done_lzw_compressor();
|
||||||
free(lzw_buffer);
|
free(lzw_buffer);
|
||||||
|
@ -180,8 +180,8 @@ int fast_expand_code(DOUBLE_S *compress_dic, int code,uint8_t **target, uint8_t
|
||||||
*old_value = w;
|
*old_value = w;
|
||||||
**target = out;
|
**target = out;
|
||||||
(*target)++;
|
(*target)++;
|
||||||
return code;
|
|
||||||
}
|
}
|
||||||
|
return out;
|
||||||
/*
|
/*
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
|
@ -237,16 +237,16 @@ void lzw_decode(void *source,char *target)
|
||||||
//int group,chr;
|
//int group,chr;
|
||||||
int old_first;
|
int old_first;
|
||||||
register int mask=0xff;
|
register int mask=0xff;
|
||||||
|
uint8_t old_value;
|
||||||
|
|
||||||
for(i=0;i<LZW_MAX_CODES;i++) compress_dic[i].first=0;
|
for(i=0;i<LZW_MAX_CODES;i++) compress_dic[i].first=0;
|
||||||
clear:
|
clear:
|
||||||
uint8_t old_value=0;
|
old_value=0;
|
||||||
nextgroup=free_code;
|
nextgroup=free_code;
|
||||||
bitsize=init_bitsize;
|
bitsize=init_bitsize;
|
||||||
mask=(1<<bitsize)-1;
|
mask=(1<<bitsize)-1;
|
||||||
code=input_code(source,&bitpos,bitsize,mask);
|
code=input_code(source,&bitpos,bitsize,mask);
|
||||||
uint8_t *t = target;
|
uint8_t *t = (uint8_t *)target;
|
||||||
old_first=fast_expand_code(compress_dic,code,&t,&old_value);
|
old_first=fast_expand_code(compress_dic,code,&t,&old_value);
|
||||||
old=code;
|
old=code;
|
||||||
while ((code=input_code(source,&bitpos,bitsize,mask))!=end_code)
|
while ((code=input_code(source,&bitpos,bitsize,mask))!=end_code)
|
||||||
|
|
|
@ -36,5 +36,5 @@ typedef struct mgif_header
|
||||||
void mgif_install_proc(MGIF_PROC proc);
|
void mgif_install_proc(MGIF_PROC proc);
|
||||||
void *open_mgif(void *mgif); //vraci ukazatel na prvni frame
|
void *open_mgif(void *mgif); //vraci ukazatel na prvni frame
|
||||||
void *mgif_play(void *mgif); //dekoduje a zobrazi frame
|
void *mgif_play(void *mgif); //dekoduje a zobrazi frame
|
||||||
void close_mgif(); //dealokuje buffery pro prehravani
|
void close_mgif(void); //dealokuje buffery pro prehravani
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -42,12 +42,12 @@ void decomprimate_line_hi(char *src,unsigned short *trg,unsigned short *paleta,i
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
i=(*src++) & 0x3f;
|
i=(*src++) & 0x3f;
|
||||||
for (j=0;j<i;j++) *trg++=paleta[*src];
|
for (j=0;j<i;j++) *trg++=paleta[(uint8_t)*src];
|
||||||
src++;
|
src++;
|
||||||
linelen-=i-1;
|
linelen-=i-1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*trg++=paleta[*src++];
|
*trg++=paleta[(uint8_t)*src++];
|
||||||
}
|
}
|
||||||
*srcstep=src-srcsave;
|
*srcstep=src-srcsave;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,13 +91,12 @@ static int set_line_back(TSTR_LIST ls,int line)
|
||||||
void string_list_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
void string_list_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
||||||
{
|
{
|
||||||
STRING_LIST_DATA *p;
|
STRING_LIST_DATA *p;
|
||||||
int xs,ys,y;
|
int y;
|
||||||
char savech[]=" ";
|
char savech[]=" ";
|
||||||
int znh,i,j,max;
|
int znh,i,j,max;
|
||||||
TSTR_LIST ls;
|
TSTR_LIST ls;
|
||||||
int savcolor=curcolor;
|
int savcolor=curcolor;
|
||||||
|
|
||||||
xs=x2-x1;ys=y2-y1;
|
|
||||||
p=o->userptr;
|
p=o->userptr;
|
||||||
ls=p->list;
|
ls=p->list;
|
||||||
bar32(x1,y1,x2,y2);
|
bar32(x1,y1,x2,y2);
|
||||||
|
@ -182,7 +181,7 @@ void string_list_event(EVENT_MSG *msg,OBJREC *o)
|
||||||
i=get_to_topline(ls,p->topline,NULL);
|
i=get_to_topline(ls,p->topline,NULL);
|
||||||
ms=get_mouse(msg);
|
ms=get_mouse(msg);
|
||||||
curfont=o->font;
|
curfont=o->font;
|
||||||
if (ms->tl1 && clicked || ms->event_type & 0x2)
|
if ((ms->tl1 && clicked) || (ms->event_type & 0x2))
|
||||||
{
|
{
|
||||||
if (ls)
|
if (ls)
|
||||||
do
|
do
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
|
|
||||||
TSTR_LIST create_list(int count)
|
TSTR_LIST create_list(int count)
|
||||||
{
|
{
|
||||||
TSTR_LIST p;int i,j;
|
TSTR_LIST p;
|
||||||
|
int i;
|
||||||
|
|
||||||
size_t *s=(size_t *)malloc(count*sizeof(*p)+sizeof(size_t));
|
size_t *s=(size_t *)malloc(count*sizeof(*p)+sizeof(size_t));
|
||||||
if (p==NULL) return NULL;
|
if (s==NULL) return NULL;
|
||||||
*s = count;
|
*s = count;
|
||||||
p = (TSTR_LIST)(s+1);
|
p = (TSTR_LIST)(s+1);
|
||||||
for(i=0;i<count;i++) p[i]=NULL;
|
for(i=0;i<count;i++) p[i]=NULL;
|
||||||
|
@ -28,8 +29,7 @@ int find_ptr(TSTR_LIST source,void *_ptr,int _size)
|
||||||
|
|
||||||
const char *str_replace(TSTR_LIST *list,int line,const char *text)
|
const char *str_replace(TSTR_LIST *list,int line,const char *text)
|
||||||
{
|
{
|
||||||
int count,i,j;
|
int count;
|
||||||
TSTR_LIST p;
|
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
count=str_count(*list);
|
count=str_count(*list);
|
||||||
|
@ -61,7 +61,7 @@ const char *str_replace(TSTR_LIST *list,int line,const char *text)
|
||||||
int str_add(TSTR_LIST *list,const char *text)
|
int str_add(TSTR_LIST *list,const char *text)
|
||||||
{
|
{
|
||||||
int count,i;
|
int count,i;
|
||||||
TSTR_LIST p;
|
|
||||||
|
|
||||||
count=str_count(*list);
|
count=str_count(*list);
|
||||||
i=find_ptr(*list,NULL,count);
|
i=find_ptr(*list,NULL,count);
|
||||||
|
@ -72,7 +72,7 @@ int str_add(TSTR_LIST *list,const char *text)
|
||||||
const char *str_insline(TSTR_LIST *list,int before,const char *text)
|
const char *str_insline(TSTR_LIST *list,int before,const char *text)
|
||||||
{
|
{
|
||||||
int i,count,punkt;
|
int i,count,punkt;
|
||||||
TSTR_LIST p;
|
|
||||||
|
|
||||||
count=str_count(*list);
|
count=str_count(*list);
|
||||||
punkt=find_ptr(*list,NULL,count);
|
punkt=find_ptr(*list,NULL,count);
|
||||||
|
@ -90,7 +90,6 @@ void str_remove(TSTR_LIST *list,int line)
|
||||||
void str_delfreelines(TSTR_LIST *list)
|
void str_delfreelines(TSTR_LIST *list)
|
||||||
{
|
{
|
||||||
int count,i,j;
|
int count,i,j;
|
||||||
TSTR_LIST p;
|
|
||||||
|
|
||||||
count=str_count(*list);
|
count=str_count(*list);
|
||||||
j=0;
|
j=0;
|
||||||
|
@ -101,7 +100,7 @@ void str_delfreelines(TSTR_LIST *list)
|
||||||
|
|
||||||
int str_count(TSTR_LIST p)
|
int str_count(TSTR_LIST p)
|
||||||
{
|
{
|
||||||
int count;
|
|
||||||
|
|
||||||
if (p==NULL) return 0;
|
if (p==NULL) return 0;
|
||||||
return *((size_t *)p-1);
|
return *((size_t *)p-1);
|
||||||
|
|
|
@ -23,17 +23,17 @@ extern int bvolume;
|
||||||
|
|
||||||
int sound_detect(int *dev,int *port,int *dma, int *irq);
|
int sound_detect(int *dev,int *port,int *dma, int *irq);
|
||||||
void set_mixing_device(int mix_dev,int mix_freq,...);
|
void set_mixing_device(int mix_dev,int mix_freq,...);
|
||||||
char start_mixing();
|
char start_mixing(void);
|
||||||
void stop_mixing();
|
void stop_mixing(void);
|
||||||
void play_sample(int channel,void *sample,int32_t size,int32_t lstart,int32_t sfreq,int type);
|
void play_sample(int channel,void *sample,int32_t size,int32_t lstart,int32_t sfreq,int type);
|
||||||
void set_channel_volume(int channel,int left,int right);
|
void set_channel_volume(int channel,int left,int right);
|
||||||
void set_end_of_song_callback(const char * (*cb)(void *), void *ctx);
|
void set_end_of_song_callback(const char * (*cb)(void *), void *ctx);
|
||||||
|
|
||||||
void fade_music();
|
void fade_music(void);
|
||||||
int mix_back_sound(int synchro);
|
int mix_back_sound(int synchro);
|
||||||
int open_backsound(char *filename);
|
int open_backsound(char *filename);
|
||||||
void change_music(const char *filename);
|
void change_music(const char *filename);
|
||||||
int get_timer_value();
|
int get_timer_value(void);
|
||||||
char *device_name(int device);
|
char *device_name(int device);
|
||||||
void force_music_volume(int volume);
|
void force_music_volume(int volume);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern "C" {
|
||||||
typedef void (*TaskerFunctionName)(va_list);
|
typedef void (*TaskerFunctionName)(va_list);
|
||||||
|
|
||||||
//void tasker(EVENT_MSG *msg,void **data);
|
//void tasker(EVENT_MSG *msg,void **data);
|
||||||
//int create_task();
|
//int create_task(void);
|
||||||
///start new task
|
///start new task
|
||||||
/**
|
/**
|
||||||
* @param stack stack size - ignored by some platforms
|
* @param stack stack size - ignored by some platforms
|
||||||
|
@ -29,7 +29,7 @@ int add_task(int stack,TaskerFunctionName fcname,...);
|
||||||
///terminate task
|
///terminate task
|
||||||
/**
|
/**
|
||||||
* request to terminate given task. The task can check this flag by
|
* request to terminate given task. The task can check this flag by
|
||||||
* task_quitmsg()
|
* task_quitmsg(void)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void term_task(int id_num);
|
void term_task(int id_num);
|
||||||
|
@ -52,13 +52,13 @@ void task_sleep_for(unsigned int time_ms);
|
||||||
*/
|
*/
|
||||||
EVENT_MSG *task_wait_event(int32_t event_number);
|
EVENT_MSG *task_wait_event(int32_t event_number);
|
||||||
///returns count of tasks
|
///returns count of tasks
|
||||||
int q_any_task();
|
int q_any_task(void);
|
||||||
///returns 1 if terminate is requested
|
///returns 1 if terminate is requested
|
||||||
char task_quitmsg();
|
char task_quitmsg(void);
|
||||||
//char task_quitmsg_by_id(int id);
|
//char task_quitmsg_by_id(int id);
|
||||||
char q_is_mastertask();
|
char q_is_mastertask(void);
|
||||||
///returns id of current task
|
///returns id of current task
|
||||||
int q_current_task();
|
int q_current_task(void);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -25,17 +25,17 @@ uint32_t _bios_keybrd(int mode);
|
||||||
#define RGB888(r,g,b) ((unsigned short)((((r)<<8)&0xF800) | (((g)<<3) & 0x7C0) | ((b)>>3)))
|
#define RGB888(r,g,b) ((unsigned short)((((r)<<8)&0xF800) | (((g)<<3) & 0x7C0) | ((b)>>3)))
|
||||||
#define RGB555(r,g,b) ((unsigned short)(((r)<<11) | ((g)<<6) | (b)))
|
#define RGB555(r,g,b) ((unsigned short)(((r)<<11) | ((g)<<6) | (b)))
|
||||||
|
|
||||||
#pragma warning (disable : 4244 4761 4133)
|
|
||||||
|
|
||||||
|
|
||||||
void *map_file_to_memory(const char *name, size_t *sz);
|
void *map_file_to_memory(const char *name, size_t *sz);
|
||||||
void unmap_file(void *ptr, size_t sz);
|
void unmap_file(void *ptr, size_t sz);
|
||||||
|
|
||||||
void ShareCPU();
|
void ShareCPU(void);
|
||||||
void SetWheelMapping(char up, char down);
|
void SetWheelMapping(char up, char down);
|
||||||
|
|
||||||
char get_control_key_state();
|
char get_control_key_state(void);
|
||||||
char get_shift_key_state();
|
char get_shift_key_state(void);
|
||||||
void display_error(const char *text);
|
void display_error(const char *text);
|
||||||
|
|
||||||
int stricmp(const char *a, const char *b);
|
int stricmp(const char *a, const char *b);
|
||||||
|
@ -44,7 +44,7 @@ int stricmp(const char *a, const char *b);
|
||||||
void strupr(char *c);
|
void strupr(char *c);
|
||||||
const char * int2ascii(int i, char *c, int radix);
|
const char * int2ascii(int i, char *c, int radix);
|
||||||
|
|
||||||
uint32_t get_game_tick_count();
|
uint32_t get_game_tick_count(void);
|
||||||
void sleep_ms(uint32_t);
|
void sleep_ms(uint32_t);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint16_t *GetScreenAdr();
|
uint16_t *GetScreenAdr(void);
|
||||||
uint16_t *GetBuffer2nd();
|
uint16_t *GetBuffer2nd(void);
|
||||||
int32_t GetScreenPitch();
|
int32_t GetScreenPitch(void);
|
||||||
int32_t GetBuffer2ndPitch();
|
int32_t GetBuffer2ndPitch(void);
|
||||||
int32_t GetScreenSizeBytes();
|
int32_t GetScreenSizeBytes(void);
|
||||||
|
|
||||||
void RedirectScreen(uint16_t *newaddr);
|
void RedirectScreen(uint16_t *newaddr);
|
||||||
void RestoreScreen();
|
void RestoreScreen(void);
|
||||||
void RedirectScreenBufferSecond();
|
void RedirectScreenBufferSecond(void);
|
||||||
|
|
||||||
|
|
||||||
//inicializuje a otevira rezim 640x480x16b v DX - otevre okno, pripravi vse pro beh hry
|
//inicializuje a otevira rezim 640x480x16b v DX - otevre okno, pripravi vse pro beh hry
|
||||||
|
@ -23,7 +23,7 @@ void RedirectScreenBufferSecond();
|
||||||
char DXInit64(char inwindow,int zoom,int monitor, int refresh);
|
char DXInit64(char inwindow,int zoom,int monitor, int refresh);
|
||||||
|
|
||||||
//uzavre rezim grafiky
|
//uzavre rezim grafiky
|
||||||
void DXCloseMode();
|
void DXCloseMode(void);
|
||||||
|
|
||||||
//void DXCopyRects32(unsigned short x,unsigned short y,unsigned short xs,unsigned short ys);
|
//void DXCopyRects32(unsigned short x,unsigned short y,unsigned short xs,unsigned short ys);
|
||||||
void DXCopyRects64(unsigned short x,unsigned short y,unsigned short xs,unsigned short ys);
|
void DXCopyRects64(unsigned short x,unsigned short y,unsigned short xs,unsigned short ys);
|
||||||
|
@ -44,8 +44,8 @@ void setvesa_displaystart(int x,int y);
|
||||||
|
|
||||||
|
|
||||||
void DxSetInitResolution(int x, int y);
|
void DxSetInitResolution(int x, int y);
|
||||||
int DxGetResX();
|
int DxGetResX(void);
|
||||||
int DxGetResY();
|
int DxGetResY(void);
|
||||||
|
|
||||||
void DXMouseTransform(unsigned short *x, unsigned short *y);
|
void DXMouseTransform(unsigned short *x, unsigned short *y);
|
||||||
|
|
||||||
|
|
|
@ -147,8 +147,6 @@ void SDLContext::pool_events() {
|
||||||
ms_event.x = (int16_t)(640*normalizedX);
|
ms_event.x = (int16_t)(640*normalizedX);
|
||||||
ms_event.y = (int16_t)(480*normalizedY);
|
ms_event.y = (int16_t)(480*normalizedY);
|
||||||
} else if (e.type == SDL_MOUSEBUTTONDOWN || e.type == SDL_MOUSEBUTTONUP) {
|
} else if (e.type == SDL_MOUSEBUTTONDOWN || e.type == SDL_MOUSEBUTTONUP) {
|
||||||
int mouseX = e.button.x;
|
|
||||||
int mouseY = e.button.y;
|
|
||||||
int button = e.button.button;
|
int button = e.button.button;
|
||||||
int up = e.type == SDL_MOUSEBUTTONUP?1:0;
|
int up = e.type == SDL_MOUSEBUTTONUP?1:0;
|
||||||
ms_event.event = 1;
|
ms_event.event = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue