DEADSOFTWARE

kos32: efficiently implement main loop
[flatwaifu.git] / src / map.c
index 7071dd4fe5fd0dcc6583e7a6f89b4a7afc6a8a76..880abb479da44101744d7aa0b1cc23f3cc7ef427 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -1,3 +1,20 @@
+/* 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 "map.h"
 
 #include "game.h"
@@ -15,6 +32,7 @@
 #include <string.h>
 #include "my.h"
 #include "error.h"
+#include "cp866.h"
 
 enum {
   MB_COMMENT = -1, MB_END = 0,
@@ -83,7 +101,7 @@ static int IT_load (FILE *h) {
     }
          if (!g_dm) {
       if (j == -1) {
-        ERR_fatal("Предмет игрок_1 не найден");
+        ERR_fatal("Player 1 point not exists on the map");
       }
       dm_pos[0].x = it[j].o.x;
       dm_pos[0].y = it[j].o.y;
@@ -97,7 +115,7 @@ static int IT_load (FILE *h) {
     }
          if (!g_dm && _2pl) {
       if (j == -1) {
-        ERR_fatal("Предмет игрок_2 не найден");
+        ERR_fatal("Player 2 point not exists on the map");
       }
       dm_pos[1].x = it[j].o.x;
       dm_pos[1].y = it[j].o.y;
@@ -115,7 +133,7 @@ static int IT_load (FILE *h) {
       }
     }
          if (g_dm && j < 2) {
-      ERR_fatal("Меньше 2-ух точек DM");
+      ERR_fatal("Required at least two DM points on the map");
     }
          if (g_dm) {
            dm_pnum = j;
@@ -204,7 +222,7 @@ static int read_array (void *p, FILE *h) {
     case 1:
       buf = malloc(blk.sz);
       if (buf == NULL) {
-        ERR_fatal("Не хватает памяти");
+        ERR_fatal("Out of memory");
       }
       myfread(buf, blk.sz, 1, h);
       unpack(buf, blk.sz, p);
@@ -227,7 +245,7 @@ static int W_load (FILE *h) {
       myfread(s, 8, 1, h);
       walf[i] = myfread8(h) ? 1 : 0; // ???
       R_load(s);
-      if (strncasecmp(s, "VTRAP01", 8) == 0) {
+      if (cp866_strncasecmp(s, "VTRAP01", 8) == 0) {
         walf[i] |= 2;
       }
     }
@@ -258,7 +276,7 @@ void F_loadmap (char n[8]) {
   myfread(hdr.id, 8, 1, h);
   hdr.ver = myfread16(h);
   if (memcmp(hdr.id, "Doom2D\x1A", 8) != 0) {
-    ERR_fatal("%.8s не является уровнем", n);
+    ERR_fatal("%.8s not map", n);
   }
   for (;;) {
     blk.t = myfread16(h);
@@ -276,7 +294,7 @@ void F_loadmap (char n[8]) {
       if(!W_load(h)) {
         if(!IT_load(h)) {
           if(!SW_load(h)) {
-            ERR_fatal("Неизвестный блок %d(%d) в уровне %.8s", blk.t, blk.st, n);
+            ERR_fatal("Unknown block %d(%d) on map %.8s", blk.t, blk.st, n);
           }
         }
       }