X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fmiscc.c;h=1cea2b5f7b0246541f0173cfdf537e5dc286e508;hb=de05b18ef2a99168b0a1a8a921a4b18ec7023833;hp=7c69aeab6ac4e48e168747732a49982b4a17e05b;hpb=584adc9c1911a6941ef07443a6fc6ff922d7c8ea;p=flatwaifu.git diff --git a/src/miscc.c b/src/miscc.c index 7c69aea..1cea2b5 100644 --- a/src/miscc.c +++ b/src/miscc.c @@ -33,19 +33,17 @@ #include "dots.h" #include "monster.h" #include "misc.h" +#include "render.h" //#define WD 200 //#define HT 98 #define MAX_YV 30 -extern dword walf[256]; - -byte z_dot=0; - -extern void *walp[256]; - +byte z_dot; +byte z_mon; static void *bulsnd[2]; +static byte wfront; int Z_sign(int a) { if(a>0) return 1; @@ -110,7 +108,7 @@ int Z_canstand(int x,int y,int r) { return 0; } -int Z_hitceil(int x,int y,int r,int h) { +static int Z_hitceil(int x,int y,int r,int h) { int i; i=(x-r)/CELW; @@ -145,7 +143,7 @@ int Z_canfit(int x,int y,int r,int h) { return 1; } -int Z_inlift(int x,int y,int r,int h) { +static int Z_inlift(int x,int y,int r,int h) { int i,j,sx,sy; sx=(x-r)/CELW; @@ -162,7 +160,7 @@ int Z_inlift(int x,int y,int r,int h) { return 0; } -int Z_isblocked(int x,int y,int r,int h,int xv) { +static int Z_isblocked(int x,int y,int r,int h,int xv) { int i,j,sx,sy; sx=(x-r)/CELW; @@ -205,8 +203,6 @@ void Z_set_speed(obj_t *o,int s) { o->xv=o->xv*s/m;o->yv=o->yv*s/m; } -static byte wfront; - int Z_inwater(int x,int y,int r,int h) { int i,j,sx,sy; @@ -270,7 +266,7 @@ int Z_overlap(obj_t *a,obj_t *b) { return 1; } -void Z_kickobj(obj_t *o,int x,int y,int pwr) { +static void Z_kickobj(obj_t *o,int x,int y,int pwr) { int dx,dy,m; dx=o->x-x;dy=o->y-o->h/2-y; @@ -325,8 +321,6 @@ int Z_look(obj_t *a,obj_t *b,int d) { #define wvel(v) if((xv=abs(v)+1)>5) v=Z_dec(v,xv/2-2) -byte z_mon=0; - int Z_moveobj(obj_t *p) { static int x,y,xv,yv,r,h,lx,ly,st; static byte inw; @@ -389,10 +383,9 @@ int Z_moveobj(obj_t *p) { return st; } -void Z_splash(obj_t *p,int n) { - Z_sound(bulsnd[0],128); - DOT_water(p->x,p->y-p->h/2,p->xv+p->vx,p->yv+p->vy,n, - (intptr_t)walp[wfront]-1); +void Z_splash (obj_t *p, int n) { + Z_sound(bulsnd[0], 128); + DOT_water(p->x, p->y-p->h / 2, p->xv + p->vx, p->yv + p->vy, n, R_get_special_id(wfront) - 1); } void Z_calc_time(dword t,word *h,word *m,word *s) @@ -410,7 +403,7 @@ void Z_calc_time(dword t,word *h,word *m,word *s) #define SWAP_VAR(a, b) do { unsigned char t = a; a = b; b = t; } while(0) -int16_t short2swap (int16_t x) { +static int16_t short2swap (int16_t x) { union { uint8_t a[2]; int16_t x; @@ -420,7 +413,7 @@ int16_t short2swap (int16_t x) { return y.x; } -int32_t int2swap (int32_t x) { +static int32_t int2swap (int32_t x) { union { uint8_t a[4]; int32_t x;