X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ffiles.c;h=e470830be662a62216d3daac74cda57eec157d4a;hb=6b61ca69e4085875215d30ef75df7703edb0ddd2;hp=f8543ff7924cc5189353f19828c5386d81320b07;hpb=efb17348438f10c929e2e9807013969f71802661;p=flatwaifu.git diff --git a/src/files.c b/src/files.c index f8543ff..e470830 100644 --- a/src/files.c +++ b/src/files.c @@ -1,30 +1,27 @@ -/* - Copyright (C) Prikol Software 1996-1997 - Copyright (C) Aleksey Volynskov 1996-1997 - Copyright (C) 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 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 . + */ #include "glob.h" #include #include #include -#include +#ifdef UNIX +# include +#endif #include "files.h" #include "map.h" #include "my.h" @@ -67,7 +64,7 @@ static char f_name[__MAX_FNAME]; static char f_ext[__MAX_EXT]; void F_startup (void) { - logo("F_startup: настройка файловой системы\n"); + logo("F_startup: setup file system\n"); memset(wads,0,sizeof(wads)); } @@ -77,7 +74,7 @@ void F_addwad (const char *fn) { for(i=0;i= MAX_WAD) { - ERR_failinit("Слишком много элементов WAD'а"); + ERR_failinit("Too many entries in the WAD"); } wad[p].o = w.o; wad[p].l = w.l; @@ -134,9 +131,9 @@ void F_initwads (void) { for (i = 1; i < MAX_WADS; ++i) { if (wads[i][0] != 0) { - logo(" подключается %s\n", wads[i]); + logo(" add %s\n", wads[i]); if ((wadh[i] = h = fopen(wads[i], "rb")) == NULL) { - ERR_failinit("Не могу открыть файл2: %s", wads[i]); + ERR_failinit("Unable to open file (2): %s", wads[i]); } mysplitpath(wads[i], f_drive, f_dir, f_name, f_ext); if (cp866_strcasecmp(f_ext, ".lmp") == 0) { @@ -149,7 +146,7 @@ void F_initwads (void) { } if (k >= MAX_WAD) { if (p >= MAX_WAD) { - ERR_failinit("Слишком много элементов WAD'а"); + ERR_failinit("Too many entries in the WAD"); } memset(wad[p].n, 0, 8); strncpy(wad[p].n, f_name, 8); @@ -163,7 +160,7 @@ void F_initwads (void) { s[0] = '\0'; myfread(s, 1, 4, h); if (strncmp(s, "IWAD", 4) != 0 && strncmp(s, "PWAD", 4) != 0) { - ERR_failinit("Нет подписи IWAD или PWAD (2)"); + ERR_failinit("Not IWAD or PWAD (2)"); } n = myfread32(h); // num o = myfread32(h); // offset @@ -181,7 +178,7 @@ void F_initwads (void) { } if (k >= MAX_WAD) { if (p >= MAX_WAD) { - ERR_failinit("Слишком много элементов WAD'а"); + ERR_failinit("Too many entries in the WAD"); } memcpy(wad[p].n, w.n, 8); wad[p].o = w.o; @@ -219,10 +216,10 @@ void F_loadres (int r, void *p, dword o, dword l) { oo=ftell(fh=wadh[wad[r].f]); if(fseek(fh,wad[r].o+o,SEEK_SET)!=0) - ERR_fatal("Ошибка при чтении файла"); + ERR_fatal("Error while file reading"); if((dword)myfreadc(p,1,l,fh)!=l) - ERR_fatal("Ошибка при загрузке ресурса %.8s",wad[r].n); + ERR_fatal("Error while loading resource %.8s", wad[r].n); fseek(fh,oo,SEEK_SET); @@ -234,7 +231,7 @@ void F_saveres(int r, void *p, dword o, dword l) { FILE* fh = wadh[wad[r].f]; int oo = ftell(fh); if (fseek(fh, wad[r].o + o, SEEK_SET) != 0) { - ERR_fatal("Ошибка при чтении файла"); + ERR_fatal("Error while reading file"); } myfwrite(p, l, 1, fh); fseek(fh, oo, SEEK_SET); @@ -256,7 +253,7 @@ int F_findres (const char n[8]) { int F_getresid (const char n[8]) { int i = F_findres(n); if (i == -1) { - ERR_fatal("F_getresid: ресурс %.8s не найден", n); + ERR_fatal("F_getresid: resource %.8s not found", n); } return i; }