X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fdots.c;h=b9ca8ec7104913b821402546238821ead00226a9;hb=02f89a09888d2aab62c7bd92b8d3ac33fcd0c0ab;hp=4f52130d53b46eec45097304ad53a25c6b963373;hpb=da79be9b6a4134aa9cd19e6f5909fedb20d318cb;p=flatwaifu.git diff --git a/src/dots.c b/src/dots.c index 4f52130..b9ca8ec 100644 --- a/src/dots.c +++ b/src/dots.c @@ -21,11 +21,12 @@ */ #include "glob.h" +#include #include -#include "vga.h" #include "view.h" #include "dots.h" #include "misc.h" +#include "my.h" #define MAXINI 50 #define MAXSR 20 @@ -39,21 +40,13 @@ #define SP_MINT 5 #define SP_MAXT 7 -extern byte z_dot; - -#pragma pack(1) -typedef struct{ - obj_t o; - byte c,t; -}dot_t; -#pragma pack() - typedef struct{ int xv,yv; byte c,t; }init_t; -static dot_t dot[MAXDOT]; +dot_t dot[MAXDOT]; + static init_t bl_ini[MAXINI],sp_ini[MAXINI]; static int bl_r,sp_r,sr_r,sxr[MAXSR],syr[MAXSR]; static int ldot; @@ -84,18 +77,18 @@ void DOT_savegame (FILE *h) { void DOT_loadgame (FILE *h) { int i, n; - myfread32(&n, h); + n = myfread32(h); for (i = 0; i < n; i++) { - myfread32(&dot[i].o.x, h); - myfread32(&dot[i].o.y, h); - myfread32(&dot[i].o.xv, h); - myfread32(&dot[i].o.yv, h); - myfread32(&dot[i].o.vx, h); - myfread32(&dot[i].o.vy, h); - myfread32(&dot[i].o.r, h); - myfread32(&dot[i].o.h, h); - myfread8(&dot[i].c, h); - myfread8(&dot[i].t, h); + dot[i].o.x = myfread32(h); + dot[i].o.y = myfread32(h); + dot[i].o.xv = myfread32(h); + dot[i].o.yv = myfread32(h); + dot[i].o.vx = myfread32(h); + dot[i].o.vy = myfread32(h); + dot[i].o.r = myfread32(h); + dot[i].o.h = myfread32(h); + dot[i].c = myfread8(h); + dot[i].t = myfread8(h); } } @@ -163,13 +156,6 @@ void DOT_act(void) { z_dot=0; } -void DOT_draw(void) { - int i; - - for(i=0;i