diff --git a/src/dots.c b/src/dots.c
index 4f52130d53b46eec45097304ad53a25c6b963373..c529c818771d7c991a227ab4a2c60e477ca1ef1e 100644 (file)
--- a/src/dots.c
+++ b/src/dots.c
-/*
- Copyright (C) Prikol Software 1996-1997
- Copyright (C) Aleksey Volynskov 1996-1997
- Copyright (C) <ARembo@gmail.com> 2011
-
- This file is part of the Doom2D:Rembo project.
-
- Doom2D:Rembo is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
- published by the Free Software Foundation.
-
- Doom2D:Rembo is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/> or
- write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+/* Copyright (C) 1996-1997 Aleksey Volynskov
+ * Copyright (C) 2011 Rambo
+ * Copyright (C) 2020 SovietPony
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License ONLY.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include "glob.h"
+#include <stdio.h>
#include <stdlib.h>
-#include "vga.h"
#include "view.h"
#include "dots.h"
#include "misc.h"
#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;
-void DOT_savegame (FILE *h) {
- int i, n;
- for (i = n = 0; i < MAXDOT; ++i) {
- if (dot[i].t) {
- ++n;
- }
- }
- myfwrite32(n, h);
- for (i = 0; i < MAXDOT; ++i) {
- if (dot[i].t) {
- myfwrite32(dot[i].o.x, h);
- myfwrite32(dot[i].o.y, h);
- myfwrite32(dot[i].o.xv, h);
- myfwrite32(dot[i].o.yv, h);
- myfwrite32(dot[i].o.vx, h);
- myfwrite32(dot[i].o.vy, h);
- myfwrite32(dot[i].o.r, h);
- myfwrite32(dot[i].o.h, h);
- myfwrite8(dot[i].c, h);
- myfwrite8(dot[i].t, h);
- }
- }
-}
-
-void DOT_loadgame (FILE *h) {
- int i, n;
- myfread32(&n, 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);
- }
-}
-
void DOT_init(void) {
int i;
z_dot=0;
}
-void DOT_draw(void) {
- int i;
-
- for(i=0;i<MAXDOT;++i)
- if(dot[i].t) V_dot(dot[i].o.x-w_x+WD/2,dot[i].o.y-w_y+HT/2+1+w_o,dot[i].c);//if(dot[i].t) V_dot(dot[i].o.x-w_x+100,dot[i].o.y-w_y+50+w_o,dot[i].c);
-}
-
void DOT_add(int x,int y,char xv,char yv,byte c,byte t) {
int i;