rpms/spear-demo/F-13 spear-demo.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/spear-demo/F-13
In directory se02.es.rpmfusion.net:/tmp/cvs-serv4429
Modified Files:
.cvsignore sources
Added Files:
spear-demo.spec
Log Message:
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1-1
- Initial rpmfusion package
--- NEW FILE spear-demo.spec ---
Name: spear-demo
Version: 1
Release: 1%{?dist}
Summary: Spear of Destiny Demo
Group: Amusements/Games
License: Distributable
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Source0: ftp://ftp.padua.org/pub/msdos/dos/games/local/soddemo.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: wolf4sdl-spear-demo
%description
This package contains the demo of id Software's first-person shooter
Wolfenstein 3D: Spear of Destiny.
%prep
%setup -q -c -T
unzip -L %{SOURCE0}
sed -i.orig 's|\r||g' sod.doc
touch -r sod.doc.orig sod.doc
%build
# nothing to build data files only
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/demo
install -p -m 644 *.sdm $RPM_BUILD_ROOT%{_datadir}/spear/demo
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc sod.doc
%{_datadir}/spear
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1-1
- Initial rpmfusion package
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/F-13/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 11:53:07 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:54:59 -0000 1.2
@@ -0,0 +1 @@
+soddemo.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/F-13/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 11:53:07 -0000 1.1
+++ sources 9 Jan 2011 12:54:59 -0000 1.2
@@ -0,0 +1 @@
+4a6d1caf4f7b4cbe2c0b01982f410fa2 soddemo.zip
14 years, 1 month
rpms/spear-demo/F-14 spear-demo.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/spear-demo/F-14
In directory se02.es.rpmfusion.net:/tmp/cvs-serv4261
Modified Files:
.cvsignore sources
Added Files:
spear-demo.spec
Log Message:
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1-1
- Initial rpmfusion package
--- NEW FILE spear-demo.spec ---
Name: spear-demo
Version: 1
Release: 1%{?dist}
Summary: Spear of Destiny Demo
Group: Amusements/Games
License: Distributable
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Source0: ftp://ftp.padua.org/pub/msdos/dos/games/local/soddemo.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: wolf4sdl-spear-demo
%description
This package contains the demo of id Software's first-person shooter
Wolfenstein 3D: Spear of Destiny.
%prep
%setup -q -c -T
unzip -L %{SOURCE0}
sed -i.orig 's|\r||g' sod.doc
touch -r sod.doc.orig sod.doc
%build
# nothing to build data files only
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/demo
install -p -m 644 *.sdm $RPM_BUILD_ROOT%{_datadir}/spear/demo
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc sod.doc
%{_datadir}/spear
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1-1
- Initial rpmfusion package
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/F-14/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 11:53:07 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:54:14 -0000 1.2
@@ -0,0 +1 @@
+soddemo.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/F-14/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 11:53:07 -0000 1.1
+++ sources 9 Jan 2011 12:54:14 -0000 1.2
@@ -0,0 +1 @@
+4a6d1caf4f7b4cbe2c0b01982f410fa2 soddemo.zip
14 years, 1 month
rpms/wolf3d-shareware/devel extract.c, NONE, 1.1 wolf3d-shareware.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/wolf3d-shareware/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv4134/devel
Modified Files:
.cvsignore sources
Added Files:
extract.c wolf3d-shareware.spec
Log Message:
Initial wolf3d-shareware rpmfusion import
--- NEW FILE extract.c ---
/* utility to extract the .SHR installer data files of early ID software
shareware games
Copyright (C) 2007 Hans de Goede <j.w.r.degoede(a)hhs.nl>
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; either version 2 of the License, or
(at your option) any later version.
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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <libdynamite.h>
struct cookie_s {
char *in_buffer;
int in_buffer_remaining;
int in_buffer_index;
int in_buffer_size;
FILE* out_file;
};
size_t reader(void* buffer, size_t size, void* cookie)
{
struct cookie_s *c = cookie;
if (size > c->in_buffer_remaining)
size = c->in_buffer_remaining;
memcpy (buffer, c->in_buffer + c->in_buffer_index, size);
c->in_buffer_index += size;
c->in_buffer_remaining -= size;
return size;
}
size_t writer(void* buffer, size_t size, void* cookie)
{
struct cookie_s *c = cookie;
return fwrite(buffer, 1, size, c->out_file);
}
int main(int argc, char *argv[])
{
struct cookie_s cookie;
FILE *in_file;
char filename[16];
unsigned char buf[4];
int i, compressed_size;
if (argc != 2) {
fprintf(stderr, "%s: Usage: %s <filename.CHR> %d\n", argv[0], argv[0], argc);
return 1;
}
in_file = fopen(argv[1], "r");
if (!in_file) {
fprintf(stderr, "error opening: %s", argv[1]);
perror(NULL);
return 1;
}
/* skip first 0x3A bytes header */
if (fseek(in_file, 0x3A, SEEK_CUR)) {
perror("error skipping initial file header");
return 1;
}
cookie.in_buffer = malloc(65536);
if (!cookie.in_buffer) {
fprintf(stderr, "Error: out of memory\n");
return 1;
}
cookie.in_buffer_size = 65536;
while (1)
{
/* get the name of the file */
if (fread(filename, 1, sizeof(filename), in_file) != sizeof(filename)) {
if (feof(in_file)) {
free(cookie.in_buffer);
fclose(in_file);
return 0; /* done */
}
perror("error getting output filename from file");
return 1;
}
/* verify the filename and convert to lower case */
for (i = 0 ; i < sizeof(filename); i++) {
if (filename[i] == 0)
break; /* done */
if (!isprint(filename[i])) {
fprintf(stderr, "error invalid output filename\n");
return 1;
}
filename[i] = tolower(filename[i]);
}
if (i == sizeof(filename)) {
fprintf(stderr, "error too long output filename\n");
return 1;
}
/* seek to compressed size */
if (fseek(in_file, 0x88 - sizeof(filename), SEEK_CUR)) {
perror("error skipping file header before file size");
return 1;
}
if (fread(buf, 1, 4, in_file) != 4) {
perror("error reading file size");
return 1;
}
compressed_size = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
if (compressed_size > cookie.in_buffer_size) {
cookie.in_buffer = realloc(cookie.in_buffer, compressed_size);
if (!cookie.in_buffer) {
fprintf(stderr, "Error: out of memory\n");
return 1;
}
cookie.in_buffer_size = compressed_size;
}
/* seek to begin of compressed data */
if (fseek(in_file, 0x1C, SEEK_CUR)) {
perror("error skipping file header before file size");
return 1;
}
/* read compressed data */
if (fread(cookie.in_buffer, 1, compressed_size, in_file) !=
compressed_size) {
perror("error reading compressed data");
return 1;
}
cookie.in_buffer_index = 0;
cookie.in_buffer_remaining = compressed_size;
cookie.out_file = fopen(filename, "w");
if (!cookie.out_file) {
fprintf(stderr, "Error creating: %s for writing", filename);
perror(NULL);
return 1;
}
printf("decompressing: %s, compressed size: %d\n", filename,
compressed_size);
if ((i = dynamite_explode(reader, writer, &cookie))) {
fprintf(stderr, "Error: %d while decompressing\n", i);
return i;
}
fclose(cookie.out_file);
}
/* never reached */
return 0;
}
--- NEW FILE wolf3d-shareware.spec ---
Name: wolf3d-shareware
Version: 1.4
Release: 1%{?dist}
Summary: Wolfenstein 3D shareware Episode
Group: Amusements/Games
License: Shareware
URL: http://www.3drealms.com/wolf3d/index.html
Source0: ftp://ftp.3drealms.com/share/1wolf14.zip
Source1: extract.c
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: dynamite-devel
Requires: wolf4sdl-shareware
%description
This package contains the shareware Episode of id Software's classic
first-person shooter Wolfenstein 3D.
%prep
%setup -q -c
%build
gcc -o extract %{SOURCE1} -ldynamite
./extract W3DSW14.SHR
iconv -f CP850 -t UTF-8 vendor.doc > tmp
cat tmp | sed 's|\r||g' > vendor.doc
touch -r W3DSW14.SHR vendor.doc *.wl1
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/shareware
install -p -m 644 *.wl1 $RPM_BUILD_ROOT%{_datadir}/wolf3d/shareware
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc vendor.doc
%{_datadir}/wolf3d
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.4-1
- Initial rpmfusion package
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/wolf3d-shareware/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 12:09:18 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:53:28 -0000 1.2
@@ -0,0 +1 @@
+1wolf14.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/wolf3d-shareware/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 12:09:18 -0000 1.1
+++ sources 9 Jan 2011 12:53:28 -0000 1.2
@@ -0,0 +1 @@
+a29432cd4a5184d552d8e5da8f80a531 1wolf14.zip
14 years, 1 month
rpms/spear-demo/devel spear-demo.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/spear-demo/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3957/devel
Modified Files:
.cvsignore sources
Added Files:
spear-demo.spec
Log Message:
Initial spear-demo rpmfusion import
--- NEW FILE spear-demo.spec ---
Name: spear-demo
Version: 1
Release: 1%{?dist}
Summary: Spear of Destiny Demo
Group: Amusements/Games
License: Distributable
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Source0: ftp://ftp.padua.org/pub/msdos/dos/games/local/soddemo.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: wolf4sdl-spear-demo
%description
This package contains the demo of id Software's first-person shooter
Wolfenstein 3D: Spear of Destiny.
%prep
%setup -q -c -T
unzip -L %{SOURCE0}
sed -i.orig 's|\r||g' sod.doc
touch -r sod.doc.orig sod.doc
%build
# nothing to build data files only
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/demo
install -p -m 644 *.sdm $RPM_BUILD_ROOT%{_datadir}/spear/demo
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc sod.doc
%{_datadir}/spear
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1-1
- Initial rpmfusion package
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 11:53:07 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:53:00 -0000 1.2
@@ -0,0 +1 @@
+soddemo.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/spear-demo/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 11:53:07 -0000 1.1
+++ sources 9 Jan 2011 12:53:00 -0000 1.2
@@ -0,0 +1 @@
+4a6d1caf4f7b4cbe2c0b01982f410fa2 soddemo.zip
14 years, 1 month
rpms/wolf4sdl/F-13 01-shareware-version.patch, NONE, 1.1 02-enable-shading.patch, NONE, 1.1 10-datadir.patch, NONE, 1.1 11-configdir.patch, NONE, 1.1 21-compiler-warnings.patch, NONE, 1.1 Wolf4SDL-1.6-compile-fixes.patch, NONE, 1.1 Wolf4SDL-1.6-registered-apogee.patch, NONE, 1.1 Wolf4SDL-1.6-spear.patch, NONE, 1.1 Wolf4SDL-1.6-speardemo.patch, NONE, 1.1 wolf4sdl.6, NONE, 1.1 wolf4sdl.desktop, NONE, 1.1 wolf4sdl.spec, NONE, 1.1 wolf4sdl.xpm, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/wolf4sdl/F-13
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3686
Modified Files:
.cvsignore sources
Added Files:
01-shareware-version.patch 02-enable-shading.patch
10-datadir.patch 11-configdir.patch 21-compiler-warnings.patch
Wolf4SDL-1.6-compile-fixes.patch
Wolf4SDL-1.6-registered-apogee.patch Wolf4SDL-1.6-spear.patch
Wolf4SDL-1.6-speardemo.patch wolf4sdl.6 wolf4sdl.desktop
wolf4sdl.spec wolf4sdl.xpm
Log Message:
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.6-1
- Initial rpmfusion package
01-shareware-version.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE 01-shareware-version.patch ---
Subject: Build for the Wolf3d Shareware v1.4 version.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
-//#define UPLOAD
+#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
02-enable-shading.patch:
Makefile | 1 +
version.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE 02-enable-shading.patch ---
Subject: Enable shading support (just because I like it).
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/Makefile
+++ wolf4sdl-1.6/Makefile
@@ -54,6 +54,7 @@ SRCS += wl_agent.cpp
SRCS += wl_atmos.cpp
SRCS += wl_cloudsky.cpp
SRCS += wl_debug.cpp
+SRCS += wl_shade.cpp
SRCS += wl_draw.cpp
SRCS += wl_floorceiling.cpp
SRCS += wl_game.cpp
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -30,7 +30,7 @@
#endif
//#define USE_FEATUREFLAGS // Enables the level feature flags (see bottom of wl_def.h)
-//#define USE_SHADING // Enables shading support (see wl_shade.cpp)
+#define USE_SHADING // Enables shading support (see wl_shade.cpp)
//#define USE_DIR3DSPR // Enables directional 3d sprites (see wl_dir3dspr.cpp)
//#define USE_FLOORCEILINGTEX // Enables floor and ceiling textures stored in the third mapplane (see wl_floorceiling.cpp)
//#define USE_HIRES // Enables high resolution textures/sprites (128x128)
10-datadir.patch:
id_ca.cpp | 22 +++++++++++-----------
id_pm.cpp | 2 +-
version.h | 4 ++++
wl_menu.cpp | 21 +++++++++++----------
4 files changed, 27 insertions(+), 22 deletions(-)
--- NEW FILE 10-datadir.patch ---
Subject: Use /usr/share/games/wolf3d for data files.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -81,13 +81,13 @@ int numEpisodesMissing = 0;
char extension[5]; // Need a string, not constant to change cache files
char graphext[5];
char audioext[5];
-static const char gheadname[] = "vgahead.";
-static const char gfilename[] = "vgagraph.";
-static const char gdictname[] = "vgadict.";
-static const char mheadname[] = "maphead.";
-static const char mfilename[] = "maptemp.";
-static const char aheadname[] = "audiohed.";
-static const char afilename[] = "audiot.";
+static const char gheadname[] = DATADIR "vgahead.";
+static const char gfilename[] = DATADIR "vgagraph.";
+static const char gdictname[] = DATADIR "vgadict.";
+static const char mheadname[] = DATADIR "maphead.";
+static const char mfilename[] = DATADIR "maptemp.";
+static const char aheadname[] = DATADIR "audiohed.";
+static const char afilename[] = DATADIR "audiot.";
void CA_CannotOpen(const char *string);
@@ -443,7 +443,7 @@ void CA_RLEWexpand (word *source, word *
void CAL_SetupGrFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
int handle;
byte *compseg;
@@ -539,7 +539,7 @@ void CAL_SetupMapFile (void)
int i;
int handle;
int32_t length,pos;
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load maphead.ext (offsets and tileinfo for map file)
@@ -563,7 +563,7 @@ void CAL_SetupMapFile (void)
// open the data file
//
#ifdef CARMACIZED
- strcpy(fname, "gamemaps.");
+ strcpy(fname, DATADIR "gamemaps.");
strcat(fname, extension);
maphandle = open(fname, O_RDONLY | O_BINARY);
@@ -619,7 +619,7 @@ void CAL_SetupMapFile (void)
void CAL_SetupAudioFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load audiohed.ext (offsets for audio file)
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -16,7 +16,7 @@ uint8_t **PMPages;
void PM_Startup()
{
- char fname[13] = "vswap.";
+ char fname[13 + sizeof(DATADIR)] = DATADIR "vswap.";
strcat(fname,extension);
FILE *file = fopen(fname,"rb");
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -3,6 +3,10 @@
#ifndef VERSIONALREADYCHOSEN // used for batch compiling
+#ifndef DATADIR
+#define DATADIR ""
+#endif
+
/* Defines used for different versions */
//#define SPEAR
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -3615,6 +3615,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -3998,12 +3999,12 @@ CheckForEpisodes (void)
//
#ifdef JAPAN
#ifdef JAPDEMO
- if(!stat("vswap.wj1", &statbuf))
+ if(!stat(DATADIR "vswap.wj1", &statbuf))
{
strcpy (extension, "wj1");
numEpisodesMissing = 5;
#else
- if(!stat("vswap.wj6", &statbuf))
+ if(!stat(DATADIR "vswap.wj6", &statbuf))
{
strcpy (extension, "wj6");
#endif
@@ -4021,7 +4022,7 @@ CheckForEpisodes (void)
// ENGLISH
//
#ifdef UPLOAD
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4030,7 +4031,7 @@ CheckForEpisodes (void)
Quit ("NO WOLFENSTEIN 3-D DATA FILES to be found!");
#else
#ifndef SPEAR
- if(!stat("vswap.wl6", &statbuf))
+ if(!stat(DATADIR "vswap.wl6", &statbuf))
{
strcpy (extension, "wl6");
NewEmenu[2].active =
@@ -4043,7 +4044,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl3", &statbuf))
+ if(!stat(DATADIR "vswap.wl3", &statbuf))
{
strcpy (extension, "wl3");
numEpisodesMissing = 3;
@@ -4051,7 +4052,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4068,21 +4069,21 @@ CheckForEpisodes (void)
#ifndef SPEARDEMO
if(param_mission == 1)
{
- if(!stat("vswap.sod", &statbuf))
+ if(!stat(DATADIR "vswap.sod", &statbuf))
strcpy (extension, "sod");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 2)
{
- if(!stat("vswap.sd2", &statbuf))
+ if(!stat(DATADIR "vswap.sd2", &statbuf))
strcpy (extension, "sd2");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 3)
{
- if(!stat("vswap.sd3", &statbuf))
+ if(!stat(DATADIR "vswap.sd3", &statbuf))
strcpy (extension, "sd3");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
@@ -4092,7 +4093,7 @@ CheckForEpisodes (void)
strcpy (graphext, "sod");
strcpy (audioext, "sod");
#else
- if(!stat("vswap.sdm", &statbuf))
+ if(!stat(DATADIR "vswap.sdm", &statbuf))
{
strcpy (extension, "sdm");
}
11-configdir.patch:
wl_def.h | 2 +-
wl_main.cpp | 15 ++++++++++++++-
wl_menu.cpp | 40 +++++++++++++++++++++-------------------
3 files changed, 36 insertions(+), 21 deletions(-)
--- NEW FILE 11-configdir.patch ---
Subject: Use ~/.wolf4sdl for config files and saved games.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/wl_def.h
+++ wolf4sdl-1.6/wl_def.h
@@ -915,7 +915,7 @@ extern unsigned screenofs;
extern boolean startgame;
extern char str[80];
-extern char configname[13];
+extern char configname[256];
//
// Command line parameter variables
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -10,6 +10,7 @@
#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
+#include <errno.h>
/*
@@ -73,7 +74,8 @@ boolean startgame;
boolean loadedgame;
int mouseadjustment;
-char configname[13]="config.";
+char configdir[256];
+char configname[256];
//
// Command line parameter variables
@@ -1871,6 +1873,17 @@ int main (int argc, char *argv[])
CheckParameters(argc, argv);
#endif
+#if defined (__unix__) && !defined(__MINGW32__)
+ /* Set up home directory */
+ int err;
+ snprintf(configdir, sizeof(configdir) - 1, "%s/.wolf4sdl/", getenv ("HOME"));
+ err = mkdir(configdir, S_IRWXU);
+ if (err == -1 && errno != EEXIST)
+ Quit ("Could not create directory \"%s\": %s\n", configdir, strerror (errno));
+#else
+ strcpy(configdir, "");
+#endif
+
CheckForEpisodes();
InitGame();
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -18,6 +18,7 @@
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
+extern char configdir[256];
//
// PRIVATE PROTOTYPES
@@ -277,8 +278,8 @@ static int SaveGamesAvail[10];
static int StartGame;
static int SoundStatus = 1;
static int pickquick;
-static char SaveGameNames[10][32];
-static char SaveName[13] = "savegam?.";
+static char SaveGameNames[10][256];
+static char SaveName[256] = "savegam?.";
////////////////////////////////////////////////////////////////////
@@ -1497,10 +1498,10 @@ CP_LoadGame (int quick)
{
FILE *file;
int which, exit = 0;
- char name[13];
+ char name[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKLOAD?
@@ -1511,7 +1512,7 @@ CP_LoadGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1549,8 +1550,7 @@ CP_LoadGame (int quick)
if (which >= 0 && SaveGamesAvail[which])
{
ShootSnd ();
- name[7] = which + '0';
-
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1676,11 +1676,11 @@ CP_SaveGame (int quick)
{
int which, exit = 0;
FILE *file;
- char name[13];
- char input[32];
+ char name[256];
+ char input[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKSAVE?
@@ -1691,7 +1691,7 @@ CP_SaveGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
unlink (name);
file = fopen (name, "wb");
@@ -1747,7 +1747,7 @@ CP_SaveGame (int quick)
ShootSnd ();
strcpy (input, &SaveGameNames[which][0]);
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
fontnumber = 0;
if (!SaveGamesAvail[which])
@@ -3142,7 +3142,7 @@ SetupControlPanel (void)
////////////////////////////////////////////////////////////////////
void SetupSaveGames()
{
- char name[13];
+ char name[256];
#ifdef _arch_dreamcast
file_t dir;
@@ -3152,12 +3152,13 @@ void SetupSaveGames()
dir = fs_open("/vmu/a1", O_RDONLY | O_DIR);
x = 0;
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
+
while((dirent = fs_readdir(dir)) && x < 10)
{
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
if(!strcmp(name, dirent->name))
{
if(DC_LoadFromVMU(name) != -1)
@@ -3181,10 +3182,10 @@ void SetupSaveGames()
fs_close(dir);
#else
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
const int handle = open(name, O_RDONLY | O_BINARY);
if (handle >= 0)
{
@@ -3616,6 +3617,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -4008,7 +4010,7 @@ CheckForEpisodes (void)
{
strcpy (extension, "wj6");
#endif
- strcat (configname, extension);
+ snprintf(configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
EpisodeSelect[1] =
@@ -4107,7 +4109,7 @@ CheckForEpisodes (void)
strcpy (audioext, extension);
#endif
- strcat (configname, extension);
+ snprintf (configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
21-compiler-warnings.patch:
fmopl.cpp | 6 ++++--
id_ca.cpp | 7 +++----
id_pm.cpp | 2 +-
id_sd.cpp | 8 ++++++--
id_us_1.cpp | 15 +++++++--------
id_vl.cpp | 1 -
wl_act1.cpp | 4 ++--
wl_act2.cpp | 3 +--
wl_agent.cpp | 1 -
wl_debug.cpp | 5 ++---
wl_draw.cpp | 49 ++++++++++++++++++++++++-------------------------
wl_game.cpp | 4 ++--
wl_inter.cpp | 3 +--
wl_main.cpp | 11 +++++------
wl_menu.cpp | 25 +++++++++++++------------
wl_play.cpp | 3 ---
wl_state.cpp | 1 -
wl_text.cpp | 1 -
18 files changed, 71 insertions(+), 78 deletions(-)
--- NEW FILE 21-compiler-warnings.patch ---
Subject: Fix some compiler warnings so the code compiles cleanly with
g++-4.5 and CFLAGS+="-Wall -Wno-sign-compare -Wno-switch".
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/fmopl.cpp
+++ wolf4sdl-1.6/fmopl.cpp
@@ -1955,19 +1955,21 @@ static void OPLSetUpdateHandler(FM_OPL *
OPL->UpdateParam = param;
}
+/*
static int OPLWrite(FM_OPL *OPL,int a,int v)
{
if( !(a&1) )
- { /* address port */
+ { // address port
OPL->address = v & 0xff;
}
else
- { /* data port */
+ { // data port
if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0);
OPLWriteReg(OPL,OPL->address,v);
}
return OPL->status>>7;
}
+*/
static unsigned char OPLRead(FM_OPL *OPL,int a)
{
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -23,7 +23,6 @@ loaded into the data segment
#endif
#include "wl_def.h"
-#pragma hdrstop
#define THREEBYTEGRSTARTS
@@ -685,7 +684,7 @@ void CA_Startup (void)
void CA_Shutdown (void)
{
- int i,start;
+ int i,start = STARTADLIBSOUNDS;
if(maphandle != -1)
close(maphandle);
@@ -795,7 +794,7 @@ void CA_CacheAdlibSoundChunk (int chunk)
void CA_LoadAllSounds (void)
{
- unsigned start,i;
+ unsigned start = STARTADLIBSOUNDS,i;
switch (oldsoundmode)
{
@@ -1031,7 +1030,7 @@ void CA_CacheMap (int mapnum)
int32_t pos,compressed;
int plane;
word *dest;
- memptr bigbufferseg;
+ memptr bigbufferseg = 0;
unsigned size;
word *source;
#ifdef CARMACIZED
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -82,7 +82,7 @@ void PM_Startup()
uint8_t *ptr = (uint8_t *) PMPageData;
for(i = 0; i < ChunksInFile; i++)
{
- if(i >= PMSpriteStart && i < PMSoundStart || i == ChunksInFile - 1)
+ if((i >= PMSpriteStart && i < PMSoundStart) || i == ChunksInFile - 1)
{
size_t offs = ptr - (uint8_t *) PMPageData;
--- wolf4sdl-1.6.orig/id_sd.cpp
+++ wolf4sdl-1.6/id_sd.cpp
@@ -31,7 +31,6 @@
#include "fmopl.h"
-#pragma hdrstop
#define ORIGSAMPLERATE 7042
@@ -95,7 +94,6 @@ static boolean DigiPlay
// PC Sound variables
static volatile byte pcLastSample;
static byte * volatile pcSound;
-static longword pcLengthLeft;
// AdLib variables
static byte * volatile alSound;
@@ -780,6 +778,7 @@ SDL_ShutAL(void)
// SDL_CleanAL() - Totally shuts down the AdLib card
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanAL(void)
{
@@ -789,6 +788,7 @@ SDL_CleanAL(void)
for (i = 1; i < 0xf5; i++)
alOut(i, 0);
}
+*/
///////////////////////////////////////////////////////////////////////////
//
@@ -808,6 +808,7 @@ SDL_StartAL(void)
// emulating an AdLib) present
//
///////////////////////////////////////////////////////////////////////////
+/*
static boolean
SDL_DetectAdLib(void)
{
@@ -819,6 +820,7 @@ SDL_DetectAdLib(void)
return true;
}
+*/
////////////////////////////////////////////////////////////////////////////
//
@@ -845,12 +847,14 @@ SDL_ShutDevice(void)
// SDL_CleanDevice() - totally shuts down all sound devices
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanDevice(void)
{
if ((SoundMode == sdm_AdLib) || (MusicMode == smm_AdLib))
SDL_CleanAL();
}
+*/
///////////////////////////////////////////////////////////////////////////
//
--- wolf4sdl-1.6.orig/id_us_1.cpp
+++ wolf4sdl-1.6/id_us_1.cpp
@@ -22,7 +22,6 @@
#include "wl_def.h"
-#pragma hdrstop
#if _MSC_VER == 1200 // Visual C++ 6
#define vsnprintf _vsnprintf
@@ -177,7 +176,7 @@ void
US_PrintUnsigned(longword n)
{
char buffer[32];
- sprintf(buffer, "%lu", n);
+ sprintf(buffer, "%lu", (long unsigned int) n);
US_Print(buffer);
}
@@ -488,11 +487,11 @@ US_LineInput(int x,int y,char *buf,const
{
boolean redraw,
cursorvis,cursormoved,
- done,result, checkkey;
+ done,result = false, checkkey;
ScanCode sc;
char c;
char s[MaxString],olds[MaxString];
- int cursor,len;
+ int cursor,len = 0;
word i,
w,h,
temp;
@@ -530,7 +529,7 @@ US_LineInput(int x,int y,char *buf,const
curtime = GetTimeCount();
// After each direction change accept the next change after 250 ms and then everz 125 ms
- if(ci.dir != lastdir || curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8)
+ if(ci.dir != lastdir || (curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8))
{
if(ci.dir != lastdir)
{
@@ -558,7 +557,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor] = ' ';
s[cursor + 1] = 0;
@@ -572,7 +571,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], 1);
@@ -584,7 +583,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], -1);
--- wolf4sdl-1.6.orig/id_vl.cpp
+++ wolf4sdl-1.6/id_vl.cpp
@@ -2,7 +2,6 @@
#include <string.h>
#include "wl_def.h"
-#pragma hdrstop
// Uncomment the following line, if you get destination out of bounds
// assertion errors and want to ignore them during debugging
--- wolf4sdl-1.6.orig/wl_act1.cpp
+++ wolf4sdl-1.6/wl_act1.cpp
@@ -1,7 +1,6 @@
// WL_ACT1.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -17,6 +16,7 @@ statobj_t *laststatobj;
struct
+statinfo_t
{
short picnum;
wl_stat_t type;
@@ -844,7 +844,7 @@ void MovePWalls (void)
pwally += dy;
if (actorat[pwallx+dx][pwally+dy]
- || xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh)
+ || (xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh))
{
pwallstate = 0;
tilemap[pwallx][pwally] = oldtile;
--- wolf4sdl-1.6.orig/wl_act2.cpp
+++ wolf4sdl-1.6/wl_act2.cpp
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <math.h>
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -307,7 +306,7 @@ boolean ProjectileTryMove (objtype *ob)
void T_Projectile (objtype *ob)
{
int32_t deltax,deltay;
- int damage;
+ int damage = 0;
int32_t speed;
speed = (int32_t)ob->speed*tics;
--- wolf4sdl-1.6.orig/wl_agent.cpp
+++ wolf4sdl-1.6/wl_agent.cpp
@@ -1,7 +1,6 @@
// WL_AGENT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_debug.cpp
+++ wolf4sdl-1.6/wl_debug.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#ifdef USE_CLOUDSKY
#include "wl_cloudsky.h"
@@ -52,7 +51,7 @@ void SimpleScaleShape (int xcenter, int
int maporgx;
int maporgy;
-enum {mapview,tilemapview,actoratview,visview} viewtype;
+enum viewtype_t {mapview,tilemapview,actoratview,visview} viewtype;
void ViewMap (void);
@@ -181,7 +180,7 @@ void BasicOverhead (void)
// left side (filtered)
uintptr_t tile;
- int color;
+ int color = 0;
offx -= 128;
for(x=0;x<MAPSIZE;x++)
--- wolf4sdl-1.6.orig/wl_draw.cpp
+++ wolf4sdl-1.6/wl_draw.cpp
@@ -1,7 +1,6 @@
// WL_DRAW.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_atmos.h"
@@ -484,7 +483,7 @@ void HitHorizWall (void)
void HitHorizDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL;
int doornum;
int texture;
@@ -549,7 +548,7 @@ void HitHorizDoor (void)
void HitVertDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL+1;
int doornum;
int texture;
@@ -1208,8 +1207,8 @@ void CalcTics (void)
void AsmRefresh()
{
- int32_t xstep,ystep;
- longword xpartial,ypartial;
+ int32_t xstep = 0,ystep = 0;
+ longword xpartial = 0,ypartial = 0;
boolean playerInPushwallBackTile = tilemap[focaltx][focalty] == 64;
for(pixx=0;pixx<viewwidth;pixx++)
@@ -1264,8 +1263,8 @@ void AsmRefresh()
// Special treatment when player is in back tile of pushwall
if(playerInPushwallBackTile)
{
- if( pwalldir == di_east && xtilestep == 1
- || pwalldir == di_west && xtilestep == -1)
+ if( (pwalldir == di_east && xtilestep == 1)
+ || (pwalldir == di_west && xtilestep == -1))
{
int32_t yintbuf = yintercept - ((ystep * (64 - pwallpos)) >> 6);
if((yintbuf >> 16) == focalty) // ray hits pushwall back?
@@ -1280,8 +1279,8 @@ void AsmRefresh()
continue;
}
}
- else if(pwalldir == di_south && ytilestep == 1
- || pwalldir == di_north && ytilestep == -1)
+ else if((pwalldir == di_south && ytilestep == 1)
+ || (pwalldir == di_north && ytilestep == -1))
{
int32_t xintbuf = xintercept - ((xstep * (64 - pwallpos)) >> 6);
if((xintbuf >> 16) == focaltx) // ray hits pushwall back?
@@ -1348,8 +1347,8 @@ vertentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally
- || pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally))
+ if((pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)
+ || (pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)))
{
yintbuf=yintercept+((ystep*pwallposnorm)>>6);
if((yintbuf>>16)!=(yintercept>>16))
@@ -1376,13 +1375,13 @@ vertentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_north) pwallposi = 64-pwallpos;
- if(pwalldir==di_south && (word)yintercept<(pwallposi<<10)
- || pwalldir==di_north && (word)yintercept>(pwallposi<<10))
+ if((pwalldir==di_south && (word)yintercept<(pwallposi<<10))
+ || (pwalldir==di_north && (word)yintercept>(pwallposi<<10)))
{
if(((uint32_t)yintercept>>16)==pwally && xtile==pwallx)
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1412,8 +1411,8 @@ vertentry:
}
else
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1494,8 +1493,8 @@ horizentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx
- || pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx))
+ if((pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)
+ || (pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)))
{
xintbuf=xintercept+((xstep*pwallposnorm)>>6);
if((xintbuf>>16)!=(xintercept>>16))
@@ -1522,13 +1521,13 @@ horizentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_west) pwallposi = 64-pwallpos;
- if(pwalldir==di_east && (word)xintercept<(pwallposi<<10)
- || pwalldir==di_west && (word)xintercept>(pwallposi<<10))
+ if((pwalldir==di_east && (word)xintercept<(pwallposi<<10))
+ || (pwalldir==di_west && (word)xintercept>(pwallposi<<10)))
{
if(((uint32_t)xintercept>>16)==pwallx && ytile==pwally)
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
@@ -1558,8 +1557,8 @@ horizentry:
}
else
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
--- wolf4sdl-1.6.orig/wl_game.cpp
+++ wolf4sdl-1.6/wl_game.cpp
@@ -3,7 +3,6 @@
#include <SDL_mixer.h>
#endif
-#pragma hdrstop
#ifdef MYPROFILE
#include <TIME.H>
@@ -1177,7 +1176,8 @@ void PlayDemo (int demonumber)
NewGame (1,0);
gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard;
- length = READWORD(*(uint8_t **)&demoptr);
+ length = demoptr[0] | demoptr[1] << 8;
+ demoptr+=2;
// TODO: Seems like the original demo format supports 16 MB demos
// But T_DEM00 and T_DEM01 of Wolf have a 0xd8 as third length size...
demoptr++;
--- wolf4sdl-1.6.orig/wl_inter.cpp
+++ wolf4sdl-1.6/wl_inter.cpp
@@ -1,7 +1,6 @@
// WL_INTER.C
#include "wl_def.h"
-#pragma hdrstop
LRstruct LevelRatios[LRpack];
int32_t lastBreathTime = 0;
@@ -386,7 +385,7 @@ Write (int x, int y, const char *string)
break;
default:
- VWB_DrawPic (nx, ny, alpha[ch]);
+ VWB_DrawPic (nx, ny, alpha[(int)ch]);
}
nx += 16;
}
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
#include <errno.h>
@@ -1420,7 +1419,7 @@ void Quit (const char *errorStr, ...)
if (!pictable) // don't try to display the red box before it's loaded
{
ShutdownId();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
SetTextCursor(0,0);
@@ -1434,7 +1433,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
- if (!error || !*error)
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1454,7 +1453,7 @@ void Quit (const char *errorStr, ...)
ShutdownId ();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
memcpy((byte *)0xb8000,screen+7,7*160);
@@ -1468,7 +1467,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
else
- if (!error || !(*error))
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1700,7 +1699,7 @@ void CheckParameters(int argc, char *arg
screenWidth = atoi(argv[++i]);
screenHeight = atoi(argv[++i]);
unsigned factor = screenWidth / 320;
- if(screenWidth % 320 || screenHeight != 200 * factor && screenHeight != 240 * factor)
+ if(screenWidth % 320 || (screenHeight != 200 * factor && screenHeight != 240 * factor))
printf("Screen size must be a multiple of 320x200 or 320x240!\n"), hasError = true;
}
}
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -14,7 +14,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
@@ -921,7 +920,7 @@ CP_CheckQuick (ScanCode scancode)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
{
@@ -1728,6 +1727,7 @@ CP_SaveGame (int quick)
// OVERWRITE EXISTING SAVEGAME?
//
if (SaveGamesAvail[which])
+ {
#ifdef JAPAN
if (!GetYorN (7, 8, C_JAPSAVEOVERPIC))
#else
@@ -1743,6 +1743,7 @@ CP_SaveGame (int quick)
PrintLSEntry (which, HIGHLIGHT);
VW_UpdateScreen ();
}
+ }
ShootSnd ();
@@ -2113,7 +2114,7 @@ CustomControls (int)
void
DefineMouseBtns (void)
{
- CustomCtrls mouseallowed = { 0, 1, 1, 1 };
+ CustomCtrls mouseallowed = {{ 0, 1, 1, 1 }};
EnterCtrlData (2, &mouseallowed, DrawCustMouse, PrintCustMouse, MOUSE);
}
@@ -2125,7 +2126,7 @@ DefineMouseBtns (void)
void
DefineJoyBtns (void)
{
- CustomCtrls joyallowed = { 1, 1, 1, 1 };
+ CustomCtrls joyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (5, &joyallowed, DrawCustJoy, PrintCustJoy, JOYSTICK);
}
@@ -2137,7 +2138,7 @@ DefineJoyBtns (void)
void
DefineKeyBtns (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (8, &keyallowed, DrawCustKeybd, PrintCustKeybd, KEYBOARDBTNS);
}
@@ -2149,7 +2150,7 @@ DefineKeyBtns (void)
void
DefineKeyMove (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (10, &keyallowed, DrawCustKeys, PrintCustKeys, KEYBOARDMOVE);
}
@@ -2166,7 +2167,7 @@ void
EnterCtrlData (int index, CustomCtrls * cust, void (*DrawRtn) (int), void (*PrintRtn) (int),
int type)
{
- int j, exit, tick, redraw, which, x, picked, lastFlashTime;
+ int j, exit, tick, redraw, which = 0, x = 0, picked, lastFlashTime;
ControlInfo ci;
@@ -2217,7 +2218,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// CHANGE BUTTON VALUE?
//
- if ((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3) ||
+ if (((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3)) ||
((type == KEYBOARDBTNS || type == KEYBOARDMOVE) && LastScan == sc_Enter))
{
lastFlashTime = GetTimeCount();
@@ -2338,7 +2339,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// EXIT INPUT?
//
- if (IN_KeyDown (sc_Escape) || type != JOYSTICK && ci.button1)
+ if (IN_KeyDown (sc_Escape) || (type != JOYSTICK && ci.button1))
{
picked = 1;
SD_PlaySound (ESCPRESSEDSND);
@@ -2918,7 +2919,7 @@ CP_Quit (int)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
@@ -3405,7 +3406,7 @@ HandleMenu (CP_iteminfo * item_i, CP_ite
if (ci.button0 || Keyboard[sc_Space] || Keyboard[sc_Enter])
exit = 1;
- if (ci.button1 && !Keyboard[sc_Alt] || Keyboard[sc_Escape])
+ if ((ci.button1 && !Keyboard[sc_Alt]) || Keyboard[sc_Escape])
exit = 2;
}
@@ -3854,7 +3855,7 @@ Message (const char *string)
h += font->height;
}
else
- w += font->width[string[i]];
+ w += font->width[(int8_t)string[i]];
}
if (w + 10 > mw)
--- wolf4sdl-1.6.orig/wl_play.cpp
+++ wolf4sdl-1.6/wl_play.cpp
@@ -1,7 +1,6 @@
// WL_PLAY.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_shade.h"
@@ -688,8 +687,6 @@ void CheckKeys (void)
#endif
scan == sc_F9 || scan == sc_F7 || scan == sc_F8) // pop up quit dialog
{
- short oldmapon = gamestate.mapon;
- short oldepisode = gamestate.episode;
ClearMemory ();
ClearSplitVWB ();
US_ControlPanel (scan);
--- wolf4sdl-1.6.orig/wl_state.cpp
+++ wolf4sdl-1.6/wl_state.cpp
@@ -1,7 +1,6 @@
// WL_STATE.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_text.cpp
+++ wolf4sdl-1.6/wl_text.cpp
@@ -1,7 +1,6 @@
// WL_TEXT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
Wolf4SDL-1.6-compile-fixes.patch:
id_ca.cpp | 2 +-
wl_main.cpp | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-compile-fixes.patch ---
diff -up Wolf4SDL-1.6-src/id_ca.cpp~ Wolf4SDL-1.6-src/id_ca.cpp
--- Wolf4SDL-1.6-src/id_ca.cpp~ 2010-12-25 11:51:36.000000000 +0100
+++ Wolf4SDL-1.6-src/id_ca.cpp 2010-12-25 11:54:16.675674203 +0100
@@ -153,7 +153,7 @@ void CAL_GetGrChunkLength (int chunk)
boolean CA_WriteFile (const char *filename, void *ptr, int32_t length)
{
- const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY);
+ const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
if (handle == -1)
return false;
diff -up Wolf4SDL-1.6-src/wl_main.cpp~ Wolf4SDL-1.6-src/wl_main.cpp
--- Wolf4SDL-1.6-src/wl_main.cpp~ 2010-12-25 11:55:08.000000000 +0100
+++ Wolf4SDL-1.6-src/wl_main.cpp 2010-12-25 11:56:19.345674374 +0100
@@ -4,6 +4,8 @@
#include <io.h>
#else
#include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
#endif
#include "wl_def.h"
Wolf4SDL-1.6-registered-apogee.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-registered-apogee.patch ---
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
//#define UPLOAD
-#define GOODTIMES
+//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
//#define APOGEE_1_1
Wolf4SDL-1.6-spear.patch:
version.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- NEW FILE Wolf4SDL-1.6-spear.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:18:52.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:32:35.785486971 +0100
@@ -9,9 +9,9 @@
/* Defines used for different versions */
-//#define SPEAR
+#define SPEAR
//#define SPEARDEMO
-#define UPLOAD
+//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
Wolf4SDL-1.6-speardemo.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-speardemo.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:32:35.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:33:08.986486882 +0100
@@ -10,7 +10,7 @@
/* Defines used for different versions */
#define SPEAR
-//#define SPEARDEMO
+#define SPEARDEMO
//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
***** Error reading new file: [Errno 2] No such file or directory: 'wolf4sdl.6'
--- NEW FILE wolf4sdl.desktop ---
[Desktop Entry]
Type=Application
Name=@NAME@
Comment=An open-source port of id Software's classic first-person shooter
Icon=wolf4sdl
Exec=wolf4sdl-@VARIANT@
Categories=Game;ActionGame;
--- NEW FILE wolf4sdl.spec ---
Name: wolf4sdl
Version: 1.6
Release: 1%{?dist}
Summary: SDL port of id Software's Wolfenstein 3D
Group: Amusements/Games
License: Distributable
# These url's are for a version targeted mainly at Mac OS X
# The original wolf4sdl site was:
# http://www.stud.uni-karlsruhe.de/~uvaue/chaos
# But this gives 403 errors now a days.
URL: http://chrisballinger.info/wolf4sdl/
Source0: http://chrisballinger.info/wolf4sdl/Wolf4SDL-1.6-src.zip
# All the below files and the package description are taken from the Debian
# package by Fabian Greffrath <fabian+debian(a)greffrath.com>
# License:
# Copying and distribution of the Debian packaging, with or without
# modification are permitted in any medium without royalty provided the
# copyright notice and this notice are preserved. The Debian packaging is
# offered as-is, without any warranty.
Source1: %{name}.6
Source2: %{name}.desktop
Source3: %{name}.xpm
Patch0: 01-shareware-version.patch
Patch1: 02-enable-shading.patch
Patch2: 10-datadir.patch
Patch3: 11-configdir.patch
Patch4: 21-compiler-warnings.patch
# end Debian files
Patch5: Wolf4SDL-1.6-compile-fixes.patch
Patch6: Wolf4SDL-1.6-registered-apogee.patch
Patch7: Wolf4SDL-1.6-spear.patch
Patch8: Wolf4SDL-1.6-speardemo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel SDL_mixer-devel desktop-file-utils
%global desc \
Maybe it was the fact that people got to blow away Nazis. Maybe it was the \
sheer challenge of it all. For whatever reason, Wolfenstein 3D and Spear of \
Destiny, pioneered the first-person shooter genre and brought its legendary \
creators, id Software, worldwide notoriety and numerous awards. In fact, The \
Computer Gaming World Hall of Fame recognized Wolfenstein 3D as helping to \
shape the overall direction of the computer gaming industry. \
\
Wolf4SDL is an open-source port of id Software's classic first-person shooter \
Wolfenstein 3D to the cross-platform multimedia library "Simple DirectMedia \
Layer (SDL)" (http://www.libsdl.org). It is meant to keep the original feel \
while taking advantage of some improvements.
%description
%{desc}
%package registered-id
Summary: SDL port of Wolfenstein 3D - id Software registered version
URL: http://www.idsoftware.com/games/wolfenstein/wolf3d/
%description registered-id
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by id Software:
http://www.idsoftware.com/games/wolfenstein/wolf3d/
You will need the original registered version's data files to play the
registered version. Place the data files under /usr/share/wolf3d/registered-id
before starting %{name}-registered-id. Note all file-names must be lowercase!
%{desc}
%package registered-apogee
Summary: SDL port of Wolfenstein 3D - Apogee registered version
URL: http://www.3drealms.com/wolf3d/index.html
%description registered-apogee
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by Apogee / 3Drealms here:
http://www.3drealms.com/wolf3d/index.html
You will need the original registered version's data files to play the
registered version. Place the data files under
/usr/share/wolf3d/registered-apogee before starting
%{name}-registered-apogee. Note all file-names must be lowercase!
%{desc}
%package shareware
Summary: SDL port of id Software's Wolfenstein 3D - shareware version
URL: http://www.3drealms.com/wolf3d/index.html
Requires: wolf3d-shareware
%description shareware
This package contains %{name} compiled for playing the shareware version of
Wolfenstein 3D.
%{desc}
%package spear
Summary: SDL port of Wolfenstein 3D - Spear of Destiny version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
%description spear
This package contains %{name} compiled for playing the Spear of Destiny
prequel to Wolfenstein 3D, sold by id Software:
http://www.idsoftware.com/games/wolfenstein/spear/
You will need the original Spear of Destiny data files to play.
Place the data files under /usr/share/spear/full before starting
%{name}-spear. Note all file-names must be lowercase!
%{desc}
%package spear-demo
Summary: SDL port of Wolfenstein 3D - Spear of Destiny demo version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Requires: spear-demo
%description spear-demo
This package contains %{name} compiled for playing the demo of the Spear of
Destiny prequel to Wolfenstein 3D.
%{desc}
%prep
%setup -q -c
pushd Wolf4SDL-1.6-src
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
chmod -x *.cpp *.h *.inc
mkdir ../doc
for i in Changes.txt README.txt license-*.txt; do
cat $i | sed 's|\r||g' > ../doc/$i
touch -r $i ../doc/$i
done
popd
%build
pushd Wolf4SDL-1.6-src
CFLAGS="$RPM_OPT_FLAGS -Wno-sign-compare -Wno-switch -Wno-unused-result"
CFLAGS="$CFLAGS $(sdl-config --cflags)"
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-id/\\\""
mv wolf3d %{name}-registered-id
cp %{SOURCE2} %{name}-registered-id.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (id)|g' \
%{name}-registered-id.desktop
sed -i 's|@VARIANT@|registered-id|g' %{name}-registered-id.desktop
make clean
patch -p1 < %{PATCH6}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-apogee/\\\""
mv wolf3d %{name}-registered-apogee
cp %{SOURCE2} %{name}-registered-apogee.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (Apogee)|g' \
%{name}-registered-apogee.desktop
sed -i 's|@VARIANT@|registered-apogee|g' %{name}-registered-apogee.desktop
make clean
patch -p1 < %{PATCH0}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/shareware/\\\""
mv wolf3d %{name}-shareware
cp %{SOURCE2} %{name}-shareware.desktop
sed -i 's|@NAME@|Wolfenstein 3D Shareware (Apogee)|g' %{name}-shareware.desktop
sed -i 's|@VARIANT@|shareware|g' %{name}-shareware.desktop
make clean
patch -p1 < %{PATCH7}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/full/\\\""
mv wolf3d %{name}-spear
cp %{SOURCE2} %{name}-spear.desktop
sed -i 's|@NAME@|Spear of Destiny|g' %{name}-spear.desktop
sed -i 's|@VARIANT@|spear|g' %{name}-spear.desktop
make clean
patch -p1 < %{PATCH8}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/demo/\\\""
mv wolf3d %{name}-spear-demo
cp %{SOURCE2} %{name}-spear-demo.desktop
sed -i 's|@NAME@|Spear of Destiny Demo|g' %{name}-spear-demo.desktop
sed -i 's|@VARIANT@|spear-demo|g' %{name}-spear-demo.desktop
popd
%install
pushd Wolf4SDL-1.6-src
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man6
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 755 %{name}-registered-id $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-id.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-id.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-id
install -m 755 %{name}-registered-apogee $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-apogee.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-apogee.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-apogee
install -m 755 %{name}-shareware $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-shareware.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-shareware.desktop
install -m 755 %{name}-spear $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/full
install -m 755 %{name}-spear-demo $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear-demo.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear-demo.desktop
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files registered-id
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-id
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-id.6*
%{_datadir}/applications/%{name}-registered-id.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-id
%files registered-apogee
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-apogee
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-apogee.6*
%{_datadir}/applications/%{name}-registered-apogee.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-apogee
%files shareware
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-shareware
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-shareware.6*
%{_datadir}/applications/%{name}-shareware.desktop
%{_datadir}/pixmaps/%{name}.xpm
%files spear
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear.6*
%{_datadir}/applications/%{name}-spear.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/spear
%dir %{_datadir}/spear/full
%files spear-demo
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear-demo
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear-demo.6*
%{_datadir}/applications/%{name}-spear-demo.desktop
%{_datadir}/pixmaps/%{name}.xpm
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.6-1
- Initial rpmfusion package
--- NEW FILE wolf4sdl.xpm ---
/* XPM */
static char * wolf4sdl_xpm[] = {
"32 32 83 1",
" c None",
". c #462E2E",
"+ c #5D4617",
"@ c #A25D00",
"# c #D15D00",
"$ c #E87400",
"% c #B95D00",
"& c #8B4600",
"* c #A25D17",
"= c #46462E",
"- c #744617",
"; c #8B4617",
"> c #5D462E",
", c #A24600",
"' c #FF7400",
") c #74462E",
"! c #2E2E2E",
"~ c #8B5D2E",
"{ c #8B462E",
"] c #5D2E17",
"^ c #A25D2E",
"/ c #171717",
"( c #B97446",
"_ c #D18B5D",
": c #B9742E",
"< c #A25D46",
"[ c #8B5D17",
"} c #8B5D46",
"| c #000000",
"1 c #2E2E46",
"2 c #A27446",
"3 c #D17446",
"4 c #E8A274",
"5 c #FFB98B",
"6 c #FFA274",
"7 c #E88B5D",
"8 c #745D2E",
"9 c #B95D17",
"0 c #5D2E00",
"a c #E8A25D",
"b c #B98B5D",
"c c #74745D",
"d c #FFB9A2",
"e c #B9A2A2",
"f c #5D4646",
"g c #745D46",
"h c #8B7446",
"i c #A28B74",
"j c #B98B8B",
"k c #8B5D5D",
"l c #5D5D5D",
"m c #744646",
"n c #2E2E17",
"o c #46465D",
"p c #745D74",
"q c #B9745D",
"r c #B95D2E",
"s c #8B8B8B",
"t c #1717A2",
"u c #2E2E8B",
"v c #A20000",
"w c #17178B",
"x c #2E2ED1",
"y c #8B74E8",
"z c #E8B9A2",
"A c #E8A28B",
"B c #E8B98B",
"C c #E8A2A2",
"D c #E8D1B9",
"E c #FFD1B9",
"F c #D18B46",
"G c #FFA28B",
"H c #B9A28B",
"I c #B98B74",
"J c #B9B9A2",
"K c #D1B9A2",
"L c #E8D1D1",
"M c #E8E8E8",
"N c #FFE8E8",
"O c #FFD1A2",
"P c #462E17",
"Q c #D1A274",
"R c #464617",
" .+@####$##$$$$$#%+ ",
" +&@%%%######$$$$#*+= ",
" =-@@@@@%%%%%%#$$$$#;> ",
" +;@@&&&,@@@*@##$''#*) ",
" !&@@,)++)~@;))@%$'$@@; ",
" !&,;{)+++>,-+]+%##%{;- ",
" !+&;~^^^~;;;)))*%@;~;+/ ",
" =/+;;~(___:<^~~)[@*~}~]| ",
" 1/))~2345567_328~**(390| ",
" !)~}(3a6555673<((b672>| ",
" !)~<2c345d56a3(3:2e6(>/ ",
" =;^<~fghij473~)}gki4:~>! ",
" ~*^2~>!1lm((^+n1opq_rr2/ ",
" f<~<3_stumv~}~~~wxyd5(2(/= ",
" ~~2_6zzzA774BBBCzDEdb^~/1 ",
" ~~(F7555G7a5d5555555_(}/ ",
" 8~(3F6664F74AA6556aa_(~! ",
" )~(F_7777(F__F7464_7F28 ",
" )(76F(3_______((366_} ",
" )(767HIFFFFFFFzA755qg ",
" n~_77eJKKzzzzzEBa55}= ",
" |)3_7HKLLMMMMNOB4d5)n ",
" |)(_6745OEEEEE46d55)! ",
" |]^365667__7a65d576)! ",
" |P)~_655647a65d56_a)! ",
" /P)+<_Q44_F_444Q_34)! ",
" !>)R)~2((^~^(3(<2F6g. ",
" =>)++++++)))~~^(_66c ",
" >)+)))~2^<222_4557k ",
" >))~^<(_3__F(7Gd5_c ",
" >))~2(_a7464_7654(g ",
" >)~^<(75765d6746_<f "};
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/F-13/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 12:05:06 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:51:49 -0000 1.2
@@ -0,0 +1 @@
+Wolf4SDL-1.6-src.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/F-13/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 12:05:06 -0000 1.1
+++ sources 9 Jan 2011 12:51:50 -0000 1.2
@@ -0,0 +1 @@
+8195dbb793b55bbc6ff3db30bbb87689 Wolf4SDL-1.6-src.zip
14 years, 1 month
rpms/wolf4sdl/F-14 01-shareware-version.patch, NONE, 1.1 02-enable-shading.patch, NONE, 1.1 10-datadir.patch, NONE, 1.1 11-configdir.patch, NONE, 1.1 21-compiler-warnings.patch, NONE, 1.1 Wolf4SDL-1.6-compile-fixes.patch, NONE, 1.1 Wolf4SDL-1.6-registered-apogee.patch, NONE, 1.1 Wolf4SDL-1.6-spear.patch, NONE, 1.1 Wolf4SDL-1.6-speardemo.patch, NONE, 1.1 wolf4sdl.6, NONE, 1.1 wolf4sdl.desktop, NONE, 1.1 wolf4sdl.spec, NONE, 1.1 wolf4sdl.xpm, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/wolf4sdl/F-14
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3254
Modified Files:
.cvsignore sources
Added Files:
01-shareware-version.patch 02-enable-shading.patch
10-datadir.patch 11-configdir.patch 21-compiler-warnings.patch
Wolf4SDL-1.6-compile-fixes.patch
Wolf4SDL-1.6-registered-apogee.patch Wolf4SDL-1.6-spear.patch
Wolf4SDL-1.6-speardemo.patch wolf4sdl.6 wolf4sdl.desktop
wolf4sdl.spec wolf4sdl.xpm
Log Message:
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.6-1
- Initial rpmfusion package
01-shareware-version.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE 01-shareware-version.patch ---
Subject: Build for the Wolf3d Shareware v1.4 version.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
-//#define UPLOAD
+#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
02-enable-shading.patch:
Makefile | 1 +
version.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE 02-enable-shading.patch ---
Subject: Enable shading support (just because I like it).
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/Makefile
+++ wolf4sdl-1.6/Makefile
@@ -54,6 +54,7 @@ SRCS += wl_agent.cpp
SRCS += wl_atmos.cpp
SRCS += wl_cloudsky.cpp
SRCS += wl_debug.cpp
+SRCS += wl_shade.cpp
SRCS += wl_draw.cpp
SRCS += wl_floorceiling.cpp
SRCS += wl_game.cpp
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -30,7 +30,7 @@
#endif
//#define USE_FEATUREFLAGS // Enables the level feature flags (see bottom of wl_def.h)
-//#define USE_SHADING // Enables shading support (see wl_shade.cpp)
+#define USE_SHADING // Enables shading support (see wl_shade.cpp)
//#define USE_DIR3DSPR // Enables directional 3d sprites (see wl_dir3dspr.cpp)
//#define USE_FLOORCEILINGTEX // Enables floor and ceiling textures stored in the third mapplane (see wl_floorceiling.cpp)
//#define USE_HIRES // Enables high resolution textures/sprites (128x128)
10-datadir.patch:
id_ca.cpp | 22 +++++++++++-----------
id_pm.cpp | 2 +-
version.h | 4 ++++
wl_menu.cpp | 21 +++++++++++----------
4 files changed, 27 insertions(+), 22 deletions(-)
--- NEW FILE 10-datadir.patch ---
Subject: Use /usr/share/games/wolf3d for data files.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -81,13 +81,13 @@ int numEpisodesMissing = 0;
char extension[5]; // Need a string, not constant to change cache files
char graphext[5];
char audioext[5];
-static const char gheadname[] = "vgahead.";
-static const char gfilename[] = "vgagraph.";
-static const char gdictname[] = "vgadict.";
-static const char mheadname[] = "maphead.";
-static const char mfilename[] = "maptemp.";
-static const char aheadname[] = "audiohed.";
-static const char afilename[] = "audiot.";
+static const char gheadname[] = DATADIR "vgahead.";
+static const char gfilename[] = DATADIR "vgagraph.";
+static const char gdictname[] = DATADIR "vgadict.";
+static const char mheadname[] = DATADIR "maphead.";
+static const char mfilename[] = DATADIR "maptemp.";
+static const char aheadname[] = DATADIR "audiohed.";
+static const char afilename[] = DATADIR "audiot.";
void CA_CannotOpen(const char *string);
@@ -443,7 +443,7 @@ void CA_RLEWexpand (word *source, word *
void CAL_SetupGrFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
int handle;
byte *compseg;
@@ -539,7 +539,7 @@ void CAL_SetupMapFile (void)
int i;
int handle;
int32_t length,pos;
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load maphead.ext (offsets and tileinfo for map file)
@@ -563,7 +563,7 @@ void CAL_SetupMapFile (void)
// open the data file
//
#ifdef CARMACIZED
- strcpy(fname, "gamemaps.");
+ strcpy(fname, DATADIR "gamemaps.");
strcat(fname, extension);
maphandle = open(fname, O_RDONLY | O_BINARY);
@@ -619,7 +619,7 @@ void CAL_SetupMapFile (void)
void CAL_SetupAudioFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load audiohed.ext (offsets for audio file)
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -16,7 +16,7 @@ uint8_t **PMPages;
void PM_Startup()
{
- char fname[13] = "vswap.";
+ char fname[13 + sizeof(DATADIR)] = DATADIR "vswap.";
strcat(fname,extension);
FILE *file = fopen(fname,"rb");
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -3,6 +3,10 @@
#ifndef VERSIONALREADYCHOSEN // used for batch compiling
+#ifndef DATADIR
+#define DATADIR ""
+#endif
+
/* Defines used for different versions */
//#define SPEAR
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -3615,6 +3615,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -3998,12 +3999,12 @@ CheckForEpisodes (void)
//
#ifdef JAPAN
#ifdef JAPDEMO
- if(!stat("vswap.wj1", &statbuf))
+ if(!stat(DATADIR "vswap.wj1", &statbuf))
{
strcpy (extension, "wj1");
numEpisodesMissing = 5;
#else
- if(!stat("vswap.wj6", &statbuf))
+ if(!stat(DATADIR "vswap.wj6", &statbuf))
{
strcpy (extension, "wj6");
#endif
@@ -4021,7 +4022,7 @@ CheckForEpisodes (void)
// ENGLISH
//
#ifdef UPLOAD
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4030,7 +4031,7 @@ CheckForEpisodes (void)
Quit ("NO WOLFENSTEIN 3-D DATA FILES to be found!");
#else
#ifndef SPEAR
- if(!stat("vswap.wl6", &statbuf))
+ if(!stat(DATADIR "vswap.wl6", &statbuf))
{
strcpy (extension, "wl6");
NewEmenu[2].active =
@@ -4043,7 +4044,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl3", &statbuf))
+ if(!stat(DATADIR "vswap.wl3", &statbuf))
{
strcpy (extension, "wl3");
numEpisodesMissing = 3;
@@ -4051,7 +4052,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4068,21 +4069,21 @@ CheckForEpisodes (void)
#ifndef SPEARDEMO
if(param_mission == 1)
{
- if(!stat("vswap.sod", &statbuf))
+ if(!stat(DATADIR "vswap.sod", &statbuf))
strcpy (extension, "sod");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 2)
{
- if(!stat("vswap.sd2", &statbuf))
+ if(!stat(DATADIR "vswap.sd2", &statbuf))
strcpy (extension, "sd2");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 3)
{
- if(!stat("vswap.sd3", &statbuf))
+ if(!stat(DATADIR "vswap.sd3", &statbuf))
strcpy (extension, "sd3");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
@@ -4092,7 +4093,7 @@ CheckForEpisodes (void)
strcpy (graphext, "sod");
strcpy (audioext, "sod");
#else
- if(!stat("vswap.sdm", &statbuf))
+ if(!stat(DATADIR "vswap.sdm", &statbuf))
{
strcpy (extension, "sdm");
}
11-configdir.patch:
wl_def.h | 2 +-
wl_main.cpp | 15 ++++++++++++++-
wl_menu.cpp | 40 +++++++++++++++++++++-------------------
3 files changed, 36 insertions(+), 21 deletions(-)
--- NEW FILE 11-configdir.patch ---
Subject: Use ~/.wolf4sdl for config files and saved games.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/wl_def.h
+++ wolf4sdl-1.6/wl_def.h
@@ -915,7 +915,7 @@ extern unsigned screenofs;
extern boolean startgame;
extern char str[80];
-extern char configname[13];
+extern char configname[256];
//
// Command line parameter variables
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -10,6 +10,7 @@
#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
+#include <errno.h>
/*
@@ -73,7 +74,8 @@ boolean startgame;
boolean loadedgame;
int mouseadjustment;
-char configname[13]="config.";
+char configdir[256];
+char configname[256];
//
// Command line parameter variables
@@ -1871,6 +1873,17 @@ int main (int argc, char *argv[])
CheckParameters(argc, argv);
#endif
+#if defined (__unix__) && !defined(__MINGW32__)
+ /* Set up home directory */
+ int err;
+ snprintf(configdir, sizeof(configdir) - 1, "%s/.wolf4sdl/", getenv ("HOME"));
+ err = mkdir(configdir, S_IRWXU);
+ if (err == -1 && errno != EEXIST)
+ Quit ("Could not create directory \"%s\": %s\n", configdir, strerror (errno));
+#else
+ strcpy(configdir, "");
+#endif
+
CheckForEpisodes();
InitGame();
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -18,6 +18,7 @@
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
+extern char configdir[256];
//
// PRIVATE PROTOTYPES
@@ -277,8 +278,8 @@ static int SaveGamesAvail[10];
static int StartGame;
static int SoundStatus = 1;
static int pickquick;
-static char SaveGameNames[10][32];
-static char SaveName[13] = "savegam?.";
+static char SaveGameNames[10][256];
+static char SaveName[256] = "savegam?.";
////////////////////////////////////////////////////////////////////
@@ -1497,10 +1498,10 @@ CP_LoadGame (int quick)
{
FILE *file;
int which, exit = 0;
- char name[13];
+ char name[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKLOAD?
@@ -1511,7 +1512,7 @@ CP_LoadGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1549,8 +1550,7 @@ CP_LoadGame (int quick)
if (which >= 0 && SaveGamesAvail[which])
{
ShootSnd ();
- name[7] = which + '0';
-
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1676,11 +1676,11 @@ CP_SaveGame (int quick)
{
int which, exit = 0;
FILE *file;
- char name[13];
- char input[32];
+ char name[256];
+ char input[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKSAVE?
@@ -1691,7 +1691,7 @@ CP_SaveGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
unlink (name);
file = fopen (name, "wb");
@@ -1747,7 +1747,7 @@ CP_SaveGame (int quick)
ShootSnd ();
strcpy (input, &SaveGameNames[which][0]);
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
fontnumber = 0;
if (!SaveGamesAvail[which])
@@ -3142,7 +3142,7 @@ SetupControlPanel (void)
////////////////////////////////////////////////////////////////////
void SetupSaveGames()
{
- char name[13];
+ char name[256];
#ifdef _arch_dreamcast
file_t dir;
@@ -3152,12 +3152,13 @@ void SetupSaveGames()
dir = fs_open("/vmu/a1", O_RDONLY | O_DIR);
x = 0;
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
+
while((dirent = fs_readdir(dir)) && x < 10)
{
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
if(!strcmp(name, dirent->name))
{
if(DC_LoadFromVMU(name) != -1)
@@ -3181,10 +3182,10 @@ void SetupSaveGames()
fs_close(dir);
#else
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
const int handle = open(name, O_RDONLY | O_BINARY);
if (handle >= 0)
{
@@ -3616,6 +3617,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -4008,7 +4010,7 @@ CheckForEpisodes (void)
{
strcpy (extension, "wj6");
#endif
- strcat (configname, extension);
+ snprintf(configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
EpisodeSelect[1] =
@@ -4107,7 +4109,7 @@ CheckForEpisodes (void)
strcpy (audioext, extension);
#endif
- strcat (configname, extension);
+ snprintf (configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
21-compiler-warnings.patch:
fmopl.cpp | 6 ++++--
id_ca.cpp | 7 +++----
id_pm.cpp | 2 +-
id_sd.cpp | 8 ++++++--
id_us_1.cpp | 15 +++++++--------
id_vl.cpp | 1 -
wl_act1.cpp | 4 ++--
wl_act2.cpp | 3 +--
wl_agent.cpp | 1 -
wl_debug.cpp | 5 ++---
wl_draw.cpp | 49 ++++++++++++++++++++++++-------------------------
wl_game.cpp | 4 ++--
wl_inter.cpp | 3 +--
wl_main.cpp | 11 +++++------
wl_menu.cpp | 25 +++++++++++++------------
wl_play.cpp | 3 ---
wl_state.cpp | 1 -
wl_text.cpp | 1 -
18 files changed, 71 insertions(+), 78 deletions(-)
--- NEW FILE 21-compiler-warnings.patch ---
Subject: Fix some compiler warnings so the code compiles cleanly with
g++-4.5 and CFLAGS+="-Wall -Wno-sign-compare -Wno-switch".
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/fmopl.cpp
+++ wolf4sdl-1.6/fmopl.cpp
@@ -1955,19 +1955,21 @@ static void OPLSetUpdateHandler(FM_OPL *
OPL->UpdateParam = param;
}
+/*
static int OPLWrite(FM_OPL *OPL,int a,int v)
{
if( !(a&1) )
- { /* address port */
+ { // address port
OPL->address = v & 0xff;
}
else
- { /* data port */
+ { // data port
if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0);
OPLWriteReg(OPL,OPL->address,v);
}
return OPL->status>>7;
}
+*/
static unsigned char OPLRead(FM_OPL *OPL,int a)
{
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -23,7 +23,6 @@ loaded into the data segment
#endif
#include "wl_def.h"
-#pragma hdrstop
#define THREEBYTEGRSTARTS
@@ -685,7 +684,7 @@ void CA_Startup (void)
void CA_Shutdown (void)
{
- int i,start;
+ int i,start = STARTADLIBSOUNDS;
if(maphandle != -1)
close(maphandle);
@@ -795,7 +794,7 @@ void CA_CacheAdlibSoundChunk (int chunk)
void CA_LoadAllSounds (void)
{
- unsigned start,i;
+ unsigned start = STARTADLIBSOUNDS,i;
switch (oldsoundmode)
{
@@ -1031,7 +1030,7 @@ void CA_CacheMap (int mapnum)
int32_t pos,compressed;
int plane;
word *dest;
- memptr bigbufferseg;
+ memptr bigbufferseg = 0;
unsigned size;
word *source;
#ifdef CARMACIZED
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -82,7 +82,7 @@ void PM_Startup()
uint8_t *ptr = (uint8_t *) PMPageData;
for(i = 0; i < ChunksInFile; i++)
{
- if(i >= PMSpriteStart && i < PMSoundStart || i == ChunksInFile - 1)
+ if((i >= PMSpriteStart && i < PMSoundStart) || i == ChunksInFile - 1)
{
size_t offs = ptr - (uint8_t *) PMPageData;
--- wolf4sdl-1.6.orig/id_sd.cpp
+++ wolf4sdl-1.6/id_sd.cpp
@@ -31,7 +31,6 @@
#include "fmopl.h"
-#pragma hdrstop
#define ORIGSAMPLERATE 7042
@@ -95,7 +94,6 @@ static boolean DigiPlay
// PC Sound variables
static volatile byte pcLastSample;
static byte * volatile pcSound;
-static longword pcLengthLeft;
// AdLib variables
static byte * volatile alSound;
@@ -780,6 +778,7 @@ SDL_ShutAL(void)
// SDL_CleanAL() - Totally shuts down the AdLib card
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanAL(void)
{
@@ -789,6 +788,7 @@ SDL_CleanAL(void)
for (i = 1; i < 0xf5; i++)
alOut(i, 0);
}
+*/
///////////////////////////////////////////////////////////////////////////
//
@@ -808,6 +808,7 @@ SDL_StartAL(void)
// emulating an AdLib) present
//
///////////////////////////////////////////////////////////////////////////
+/*
static boolean
SDL_DetectAdLib(void)
{
@@ -819,6 +820,7 @@ SDL_DetectAdLib(void)
return true;
}
+*/
////////////////////////////////////////////////////////////////////////////
//
@@ -845,12 +847,14 @@ SDL_ShutDevice(void)
// SDL_CleanDevice() - totally shuts down all sound devices
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanDevice(void)
{
if ((SoundMode == sdm_AdLib) || (MusicMode == smm_AdLib))
SDL_CleanAL();
}
+*/
///////////////////////////////////////////////////////////////////////////
//
--- wolf4sdl-1.6.orig/id_us_1.cpp
+++ wolf4sdl-1.6/id_us_1.cpp
@@ -22,7 +22,6 @@
#include "wl_def.h"
-#pragma hdrstop
#if _MSC_VER == 1200 // Visual C++ 6
#define vsnprintf _vsnprintf
@@ -177,7 +176,7 @@ void
US_PrintUnsigned(longword n)
{
char buffer[32];
- sprintf(buffer, "%lu", n);
+ sprintf(buffer, "%lu", (long unsigned int) n);
US_Print(buffer);
}
@@ -488,11 +487,11 @@ US_LineInput(int x,int y,char *buf,const
{
boolean redraw,
cursorvis,cursormoved,
- done,result, checkkey;
+ done,result = false, checkkey;
ScanCode sc;
char c;
char s[MaxString],olds[MaxString];
- int cursor,len;
+ int cursor,len = 0;
word i,
w,h,
temp;
@@ -530,7 +529,7 @@ US_LineInput(int x,int y,char *buf,const
curtime = GetTimeCount();
// After each direction change accept the next change after 250 ms and then everz 125 ms
- if(ci.dir != lastdir || curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8)
+ if(ci.dir != lastdir || (curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8))
{
if(ci.dir != lastdir)
{
@@ -558,7 +557,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor] = ' ';
s[cursor + 1] = 0;
@@ -572,7 +571,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], 1);
@@ -584,7 +583,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], -1);
--- wolf4sdl-1.6.orig/id_vl.cpp
+++ wolf4sdl-1.6/id_vl.cpp
@@ -2,7 +2,6 @@
#include <string.h>
#include "wl_def.h"
-#pragma hdrstop
// Uncomment the following line, if you get destination out of bounds
// assertion errors and want to ignore them during debugging
--- wolf4sdl-1.6.orig/wl_act1.cpp
+++ wolf4sdl-1.6/wl_act1.cpp
@@ -1,7 +1,6 @@
// WL_ACT1.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -17,6 +16,7 @@ statobj_t *laststatobj;
struct
+statinfo_t
{
short picnum;
wl_stat_t type;
@@ -844,7 +844,7 @@ void MovePWalls (void)
pwally += dy;
if (actorat[pwallx+dx][pwally+dy]
- || xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh)
+ || (xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh))
{
pwallstate = 0;
tilemap[pwallx][pwally] = oldtile;
--- wolf4sdl-1.6.orig/wl_act2.cpp
+++ wolf4sdl-1.6/wl_act2.cpp
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <math.h>
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -307,7 +306,7 @@ boolean ProjectileTryMove (objtype *ob)
void T_Projectile (objtype *ob)
{
int32_t deltax,deltay;
- int damage;
+ int damage = 0;
int32_t speed;
speed = (int32_t)ob->speed*tics;
--- wolf4sdl-1.6.orig/wl_agent.cpp
+++ wolf4sdl-1.6/wl_agent.cpp
@@ -1,7 +1,6 @@
// WL_AGENT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_debug.cpp
+++ wolf4sdl-1.6/wl_debug.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#ifdef USE_CLOUDSKY
#include "wl_cloudsky.h"
@@ -52,7 +51,7 @@ void SimpleScaleShape (int xcenter, int
int maporgx;
int maporgy;
-enum {mapview,tilemapview,actoratview,visview} viewtype;
+enum viewtype_t {mapview,tilemapview,actoratview,visview} viewtype;
void ViewMap (void);
@@ -181,7 +180,7 @@ void BasicOverhead (void)
// left side (filtered)
uintptr_t tile;
- int color;
+ int color = 0;
offx -= 128;
for(x=0;x<MAPSIZE;x++)
--- wolf4sdl-1.6.orig/wl_draw.cpp
+++ wolf4sdl-1.6/wl_draw.cpp
@@ -1,7 +1,6 @@
// WL_DRAW.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_atmos.h"
@@ -484,7 +483,7 @@ void HitHorizWall (void)
void HitHorizDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL;
int doornum;
int texture;
@@ -549,7 +548,7 @@ void HitHorizDoor (void)
void HitVertDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL+1;
int doornum;
int texture;
@@ -1208,8 +1207,8 @@ void CalcTics (void)
void AsmRefresh()
{
- int32_t xstep,ystep;
- longword xpartial,ypartial;
+ int32_t xstep = 0,ystep = 0;
+ longword xpartial = 0,ypartial = 0;
boolean playerInPushwallBackTile = tilemap[focaltx][focalty] == 64;
for(pixx=0;pixx<viewwidth;pixx++)
@@ -1264,8 +1263,8 @@ void AsmRefresh()
// Special treatment when player is in back tile of pushwall
if(playerInPushwallBackTile)
{
- if( pwalldir == di_east && xtilestep == 1
- || pwalldir == di_west && xtilestep == -1)
+ if( (pwalldir == di_east && xtilestep == 1)
+ || (pwalldir == di_west && xtilestep == -1))
{
int32_t yintbuf = yintercept - ((ystep * (64 - pwallpos)) >> 6);
if((yintbuf >> 16) == focalty) // ray hits pushwall back?
@@ -1280,8 +1279,8 @@ void AsmRefresh()
continue;
}
}
- else if(pwalldir == di_south && ytilestep == 1
- || pwalldir == di_north && ytilestep == -1)
+ else if((pwalldir == di_south && ytilestep == 1)
+ || (pwalldir == di_north && ytilestep == -1))
{
int32_t xintbuf = xintercept - ((xstep * (64 - pwallpos)) >> 6);
if((xintbuf >> 16) == focaltx) // ray hits pushwall back?
@@ -1348,8 +1347,8 @@ vertentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally
- || pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally))
+ if((pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)
+ || (pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)))
{
yintbuf=yintercept+((ystep*pwallposnorm)>>6);
if((yintbuf>>16)!=(yintercept>>16))
@@ -1376,13 +1375,13 @@ vertentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_north) pwallposi = 64-pwallpos;
- if(pwalldir==di_south && (word)yintercept<(pwallposi<<10)
- || pwalldir==di_north && (word)yintercept>(pwallposi<<10))
+ if((pwalldir==di_south && (word)yintercept<(pwallposi<<10))
+ || (pwalldir==di_north && (word)yintercept>(pwallposi<<10)))
{
if(((uint32_t)yintercept>>16)==pwally && xtile==pwallx)
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1412,8 +1411,8 @@ vertentry:
}
else
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1494,8 +1493,8 @@ horizentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx
- || pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx))
+ if((pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)
+ || (pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)))
{
xintbuf=xintercept+((xstep*pwallposnorm)>>6);
if((xintbuf>>16)!=(xintercept>>16))
@@ -1522,13 +1521,13 @@ horizentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_west) pwallposi = 64-pwallpos;
- if(pwalldir==di_east && (word)xintercept<(pwallposi<<10)
- || pwalldir==di_west && (word)xintercept>(pwallposi<<10))
+ if((pwalldir==di_east && (word)xintercept<(pwallposi<<10))
+ || (pwalldir==di_west && (word)xintercept>(pwallposi<<10)))
{
if(((uint32_t)xintercept>>16)==pwallx && ytile==pwally)
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
@@ -1558,8 +1557,8 @@ horizentry:
}
else
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
--- wolf4sdl-1.6.orig/wl_game.cpp
+++ wolf4sdl-1.6/wl_game.cpp
@@ -3,7 +3,6 @@
#include <SDL_mixer.h>
#endif
-#pragma hdrstop
#ifdef MYPROFILE
#include <TIME.H>
@@ -1177,7 +1176,8 @@ void PlayDemo (int demonumber)
NewGame (1,0);
gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard;
- length = READWORD(*(uint8_t **)&demoptr);
+ length = demoptr[0] | demoptr[1] << 8;
+ demoptr+=2;
// TODO: Seems like the original demo format supports 16 MB demos
// But T_DEM00 and T_DEM01 of Wolf have a 0xd8 as third length size...
demoptr++;
--- wolf4sdl-1.6.orig/wl_inter.cpp
+++ wolf4sdl-1.6/wl_inter.cpp
@@ -1,7 +1,6 @@
// WL_INTER.C
#include "wl_def.h"
-#pragma hdrstop
LRstruct LevelRatios[LRpack];
int32_t lastBreathTime = 0;
@@ -386,7 +385,7 @@ Write (int x, int y, const char *string)
break;
default:
- VWB_DrawPic (nx, ny, alpha[ch]);
+ VWB_DrawPic (nx, ny, alpha[(int)ch]);
}
nx += 16;
}
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
#include <errno.h>
@@ -1420,7 +1419,7 @@ void Quit (const char *errorStr, ...)
if (!pictable) // don't try to display the red box before it's loaded
{
ShutdownId();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
SetTextCursor(0,0);
@@ -1434,7 +1433,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
- if (!error || !*error)
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1454,7 +1453,7 @@ void Quit (const char *errorStr, ...)
ShutdownId ();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
memcpy((byte *)0xb8000,screen+7,7*160);
@@ -1468,7 +1467,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
else
- if (!error || !(*error))
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1700,7 +1699,7 @@ void CheckParameters(int argc, char *arg
screenWidth = atoi(argv[++i]);
screenHeight = atoi(argv[++i]);
unsigned factor = screenWidth / 320;
- if(screenWidth % 320 || screenHeight != 200 * factor && screenHeight != 240 * factor)
+ if(screenWidth % 320 || (screenHeight != 200 * factor && screenHeight != 240 * factor))
printf("Screen size must be a multiple of 320x200 or 320x240!\n"), hasError = true;
}
}
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -14,7 +14,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
@@ -921,7 +920,7 @@ CP_CheckQuick (ScanCode scancode)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
{
@@ -1728,6 +1727,7 @@ CP_SaveGame (int quick)
// OVERWRITE EXISTING SAVEGAME?
//
if (SaveGamesAvail[which])
+ {
#ifdef JAPAN
if (!GetYorN (7, 8, C_JAPSAVEOVERPIC))
#else
@@ -1743,6 +1743,7 @@ CP_SaveGame (int quick)
PrintLSEntry (which, HIGHLIGHT);
VW_UpdateScreen ();
}
+ }
ShootSnd ();
@@ -2113,7 +2114,7 @@ CustomControls (int)
void
DefineMouseBtns (void)
{
- CustomCtrls mouseallowed = { 0, 1, 1, 1 };
+ CustomCtrls mouseallowed = {{ 0, 1, 1, 1 }};
EnterCtrlData (2, &mouseallowed, DrawCustMouse, PrintCustMouse, MOUSE);
}
@@ -2125,7 +2126,7 @@ DefineMouseBtns (void)
void
DefineJoyBtns (void)
{
- CustomCtrls joyallowed = { 1, 1, 1, 1 };
+ CustomCtrls joyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (5, &joyallowed, DrawCustJoy, PrintCustJoy, JOYSTICK);
}
@@ -2137,7 +2138,7 @@ DefineJoyBtns (void)
void
DefineKeyBtns (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (8, &keyallowed, DrawCustKeybd, PrintCustKeybd, KEYBOARDBTNS);
}
@@ -2149,7 +2150,7 @@ DefineKeyBtns (void)
void
DefineKeyMove (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (10, &keyallowed, DrawCustKeys, PrintCustKeys, KEYBOARDMOVE);
}
@@ -2166,7 +2167,7 @@ void
EnterCtrlData (int index, CustomCtrls * cust, void (*DrawRtn) (int), void (*PrintRtn) (int),
int type)
{
- int j, exit, tick, redraw, which, x, picked, lastFlashTime;
+ int j, exit, tick, redraw, which = 0, x = 0, picked, lastFlashTime;
ControlInfo ci;
@@ -2217,7 +2218,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// CHANGE BUTTON VALUE?
//
- if ((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3) ||
+ if (((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3)) ||
((type == KEYBOARDBTNS || type == KEYBOARDMOVE) && LastScan == sc_Enter))
{
lastFlashTime = GetTimeCount();
@@ -2338,7 +2339,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// EXIT INPUT?
//
- if (IN_KeyDown (sc_Escape) || type != JOYSTICK && ci.button1)
+ if (IN_KeyDown (sc_Escape) || (type != JOYSTICK && ci.button1))
{
picked = 1;
SD_PlaySound (ESCPRESSEDSND);
@@ -2918,7 +2919,7 @@ CP_Quit (int)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
@@ -3405,7 +3406,7 @@ HandleMenu (CP_iteminfo * item_i, CP_ite
if (ci.button0 || Keyboard[sc_Space] || Keyboard[sc_Enter])
exit = 1;
- if (ci.button1 && !Keyboard[sc_Alt] || Keyboard[sc_Escape])
+ if ((ci.button1 && !Keyboard[sc_Alt]) || Keyboard[sc_Escape])
exit = 2;
}
@@ -3854,7 +3855,7 @@ Message (const char *string)
h += font->height;
}
else
- w += font->width[string[i]];
+ w += font->width[(int8_t)string[i]];
}
if (w + 10 > mw)
--- wolf4sdl-1.6.orig/wl_play.cpp
+++ wolf4sdl-1.6/wl_play.cpp
@@ -1,7 +1,6 @@
// WL_PLAY.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_shade.h"
@@ -688,8 +687,6 @@ void CheckKeys (void)
#endif
scan == sc_F9 || scan == sc_F7 || scan == sc_F8) // pop up quit dialog
{
- short oldmapon = gamestate.mapon;
- short oldepisode = gamestate.episode;
ClearMemory ();
ClearSplitVWB ();
US_ControlPanel (scan);
--- wolf4sdl-1.6.orig/wl_state.cpp
+++ wolf4sdl-1.6/wl_state.cpp
@@ -1,7 +1,6 @@
// WL_STATE.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_text.cpp
+++ wolf4sdl-1.6/wl_text.cpp
@@ -1,7 +1,6 @@
// WL_TEXT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
Wolf4SDL-1.6-compile-fixes.patch:
id_ca.cpp | 2 +-
wl_main.cpp | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-compile-fixes.patch ---
diff -up Wolf4SDL-1.6-src/id_ca.cpp~ Wolf4SDL-1.6-src/id_ca.cpp
--- Wolf4SDL-1.6-src/id_ca.cpp~ 2010-12-25 11:51:36.000000000 +0100
+++ Wolf4SDL-1.6-src/id_ca.cpp 2010-12-25 11:54:16.675674203 +0100
@@ -153,7 +153,7 @@ void CAL_GetGrChunkLength (int chunk)
boolean CA_WriteFile (const char *filename, void *ptr, int32_t length)
{
- const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY);
+ const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
if (handle == -1)
return false;
diff -up Wolf4SDL-1.6-src/wl_main.cpp~ Wolf4SDL-1.6-src/wl_main.cpp
--- Wolf4SDL-1.6-src/wl_main.cpp~ 2010-12-25 11:55:08.000000000 +0100
+++ Wolf4SDL-1.6-src/wl_main.cpp 2010-12-25 11:56:19.345674374 +0100
@@ -4,6 +4,8 @@
#include <io.h>
#else
#include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
#endif
#include "wl_def.h"
Wolf4SDL-1.6-registered-apogee.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-registered-apogee.patch ---
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
//#define UPLOAD
-#define GOODTIMES
+//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
//#define APOGEE_1_1
Wolf4SDL-1.6-spear.patch:
version.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- NEW FILE Wolf4SDL-1.6-spear.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:18:52.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:32:35.785486971 +0100
@@ -9,9 +9,9 @@
/* Defines used for different versions */
-//#define SPEAR
+#define SPEAR
//#define SPEARDEMO
-#define UPLOAD
+//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
Wolf4SDL-1.6-speardemo.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-speardemo.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:32:35.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:33:08.986486882 +0100
@@ -10,7 +10,7 @@
/* Defines used for different versions */
#define SPEAR
-//#define SPEARDEMO
+#define SPEARDEMO
//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
***** Error reading new file: [Errno 2] No such file or directory: 'wolf4sdl.6'
--- NEW FILE wolf4sdl.desktop ---
[Desktop Entry]
Type=Application
Name=@NAME@
Comment=An open-source port of id Software's classic first-person shooter
Icon=wolf4sdl
Exec=wolf4sdl-@VARIANT@
Categories=Game;ActionGame;
--- NEW FILE wolf4sdl.spec ---
Name: wolf4sdl
Version: 1.6
Release: 1%{?dist}
Summary: SDL port of id Software's Wolfenstein 3D
Group: Amusements/Games
License: Distributable
# These url's are for a version targeted mainly at Mac OS X
# The original wolf4sdl site was:
# http://www.stud.uni-karlsruhe.de/~uvaue/chaos
# But this gives 403 errors now a days.
URL: http://chrisballinger.info/wolf4sdl/
Source0: http://chrisballinger.info/wolf4sdl/Wolf4SDL-1.6-src.zip
# All the below files and the package description are taken from the Debian
# package by Fabian Greffrath <fabian+debian(a)greffrath.com>
# License:
# Copying and distribution of the Debian packaging, with or without
# modification are permitted in any medium without royalty provided the
# copyright notice and this notice are preserved. The Debian packaging is
# offered as-is, without any warranty.
Source1: %{name}.6
Source2: %{name}.desktop
Source3: %{name}.xpm
Patch0: 01-shareware-version.patch
Patch1: 02-enable-shading.patch
Patch2: 10-datadir.patch
Patch3: 11-configdir.patch
Patch4: 21-compiler-warnings.patch
# end Debian files
Patch5: Wolf4SDL-1.6-compile-fixes.patch
Patch6: Wolf4SDL-1.6-registered-apogee.patch
Patch7: Wolf4SDL-1.6-spear.patch
Patch8: Wolf4SDL-1.6-speardemo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel SDL_mixer-devel desktop-file-utils
%global desc \
Maybe it was the fact that people got to blow away Nazis. Maybe it was the \
sheer challenge of it all. For whatever reason, Wolfenstein 3D and Spear of \
Destiny, pioneered the first-person shooter genre and brought its legendary \
creators, id Software, worldwide notoriety and numerous awards. In fact, The \
Computer Gaming World Hall of Fame recognized Wolfenstein 3D as helping to \
shape the overall direction of the computer gaming industry. \
\
Wolf4SDL is an open-source port of id Software's classic first-person shooter \
Wolfenstein 3D to the cross-platform multimedia library "Simple DirectMedia \
Layer (SDL)" (http://www.libsdl.org). It is meant to keep the original feel \
while taking advantage of some improvements.
%description
%{desc}
%package registered-id
Summary: SDL port of Wolfenstein 3D - id Software registered version
URL: http://www.idsoftware.com/games/wolfenstein/wolf3d/
%description registered-id
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by id Software:
http://www.idsoftware.com/games/wolfenstein/wolf3d/
You will need the original registered version's data files to play the
registered version. Place the data files under /usr/share/wolf3d/registered-id
before starting %{name}-registered-id. Note all file-names must be lowercase!
%{desc}
%package registered-apogee
Summary: SDL port of Wolfenstein 3D - Apogee registered version
URL: http://www.3drealms.com/wolf3d/index.html
%description registered-apogee
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by Apogee / 3Drealms here:
http://www.3drealms.com/wolf3d/index.html
You will need the original registered version's data files to play the
registered version. Place the data files under
/usr/share/wolf3d/registered-apogee before starting
%{name}-registered-apogee. Note all file-names must be lowercase!
%{desc}
%package shareware
Summary: SDL port of id Software's Wolfenstein 3D - shareware version
URL: http://www.3drealms.com/wolf3d/index.html
Requires: wolf3d-shareware
%description shareware
This package contains %{name} compiled for playing the shareware version of
Wolfenstein 3D.
%{desc}
%package spear
Summary: SDL port of Wolfenstein 3D - Spear of Destiny version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
%description spear
This package contains %{name} compiled for playing the Spear of Destiny
prequel to Wolfenstein 3D, sold by id Software:
http://www.idsoftware.com/games/wolfenstein/spear/
You will need the original Spear of Destiny data files to play.
Place the data files under /usr/share/spear/full before starting
%{name}-spear. Note all file-names must be lowercase!
%{desc}
%package spear-demo
Summary: SDL port of Wolfenstein 3D - Spear of Destiny demo version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Requires: spear-demo
%description spear-demo
This package contains %{name} compiled for playing the demo of the Spear of
Destiny prequel to Wolfenstein 3D.
%{desc}
%prep
%setup -q -c
pushd Wolf4SDL-1.6-src
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
chmod -x *.cpp *.h *.inc
mkdir ../doc
for i in Changes.txt README.txt license-*.txt; do
cat $i | sed 's|\r||g' > ../doc/$i
touch -r $i ../doc/$i
done
popd
%build
pushd Wolf4SDL-1.6-src
CFLAGS="$RPM_OPT_FLAGS -Wno-sign-compare -Wno-switch -Wno-unused-result"
CFLAGS="$CFLAGS $(sdl-config --cflags)"
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-id/\\\""
mv wolf3d %{name}-registered-id
cp %{SOURCE2} %{name}-registered-id.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (id)|g' \
%{name}-registered-id.desktop
sed -i 's|@VARIANT@|registered-id|g' %{name}-registered-id.desktop
make clean
patch -p1 < %{PATCH6}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-apogee/\\\""
mv wolf3d %{name}-registered-apogee
cp %{SOURCE2} %{name}-registered-apogee.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (Apogee)|g' \
%{name}-registered-apogee.desktop
sed -i 's|@VARIANT@|registered-apogee|g' %{name}-registered-apogee.desktop
make clean
patch -p1 < %{PATCH0}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/shareware/\\\""
mv wolf3d %{name}-shareware
cp %{SOURCE2} %{name}-shareware.desktop
sed -i 's|@NAME@|Wolfenstein 3D Shareware (Apogee)|g' %{name}-shareware.desktop
sed -i 's|@VARIANT@|shareware|g' %{name}-shareware.desktop
make clean
patch -p1 < %{PATCH7}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/full/\\\""
mv wolf3d %{name}-spear
cp %{SOURCE2} %{name}-spear.desktop
sed -i 's|@NAME@|Spear of Destiny|g' %{name}-spear.desktop
sed -i 's|@VARIANT@|spear|g' %{name}-spear.desktop
make clean
patch -p1 < %{PATCH8}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/demo/\\\""
mv wolf3d %{name}-spear-demo
cp %{SOURCE2} %{name}-spear-demo.desktop
sed -i 's|@NAME@|Spear of Destiny Demo|g' %{name}-spear-demo.desktop
sed -i 's|@VARIANT@|spear-demo|g' %{name}-spear-demo.desktop
popd
%install
pushd Wolf4SDL-1.6-src
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man6
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 755 %{name}-registered-id $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-id.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-id.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-id
install -m 755 %{name}-registered-apogee $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-apogee.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-apogee.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-apogee
install -m 755 %{name}-shareware $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-shareware.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-shareware.desktop
install -m 755 %{name}-spear $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/full
install -m 755 %{name}-spear-demo $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear-demo.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear-demo.desktop
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files registered-id
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-id
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-id.6*
%{_datadir}/applications/%{name}-registered-id.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-id
%files registered-apogee
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-apogee
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-apogee.6*
%{_datadir}/applications/%{name}-registered-apogee.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-apogee
%files shareware
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-shareware
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-shareware.6*
%{_datadir}/applications/%{name}-shareware.desktop
%{_datadir}/pixmaps/%{name}.xpm
%files spear
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear.6*
%{_datadir}/applications/%{name}-spear.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/spear
%dir %{_datadir}/spear/full
%files spear-demo
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear-demo
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear-demo.6*
%{_datadir}/applications/%{name}-spear-demo.desktop
%{_datadir}/pixmaps/%{name}.xpm
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.6-1
- Initial rpmfusion package
--- NEW FILE wolf4sdl.xpm ---
/* XPM */
static char * wolf4sdl_xpm[] = {
"32 32 83 1",
" c None",
". c #462E2E",
"+ c #5D4617",
"@ c #A25D00",
"# c #D15D00",
"$ c #E87400",
"% c #B95D00",
"& c #8B4600",
"* c #A25D17",
"= c #46462E",
"- c #744617",
"; c #8B4617",
"> c #5D462E",
", c #A24600",
"' c #FF7400",
") c #74462E",
"! c #2E2E2E",
"~ c #8B5D2E",
"{ c #8B462E",
"] c #5D2E17",
"^ c #A25D2E",
"/ c #171717",
"( c #B97446",
"_ c #D18B5D",
": c #B9742E",
"< c #A25D46",
"[ c #8B5D17",
"} c #8B5D46",
"| c #000000",
"1 c #2E2E46",
"2 c #A27446",
"3 c #D17446",
"4 c #E8A274",
"5 c #FFB98B",
"6 c #FFA274",
"7 c #E88B5D",
"8 c #745D2E",
"9 c #B95D17",
"0 c #5D2E00",
"a c #E8A25D",
"b c #B98B5D",
"c c #74745D",
"d c #FFB9A2",
"e c #B9A2A2",
"f c #5D4646",
"g c #745D46",
"h c #8B7446",
"i c #A28B74",
"j c #B98B8B",
"k c #8B5D5D",
"l c #5D5D5D",
"m c #744646",
"n c #2E2E17",
"o c #46465D",
"p c #745D74",
"q c #B9745D",
"r c #B95D2E",
"s c #8B8B8B",
"t c #1717A2",
"u c #2E2E8B",
"v c #A20000",
"w c #17178B",
"x c #2E2ED1",
"y c #8B74E8",
"z c #E8B9A2",
"A c #E8A28B",
"B c #E8B98B",
"C c #E8A2A2",
"D c #E8D1B9",
"E c #FFD1B9",
"F c #D18B46",
"G c #FFA28B",
"H c #B9A28B",
"I c #B98B74",
"J c #B9B9A2",
"K c #D1B9A2",
"L c #E8D1D1",
"M c #E8E8E8",
"N c #FFE8E8",
"O c #FFD1A2",
"P c #462E17",
"Q c #D1A274",
"R c #464617",
" .+@####$##$$$$$#%+ ",
" +&@%%%######$$$$#*+= ",
" =-@@@@@%%%%%%#$$$$#;> ",
" +;@@&&&,@@@*@##$''#*) ",
" !&@@,)++)~@;))@%$'$@@; ",
" !&,;{)+++>,-+]+%##%{;- ",
" !+&;~^^^~;;;)))*%@;~;+/ ",
" =/+;;~(___:<^~~)[@*~}~]| ",
" 1/))~2345567_328~**(390| ",
" !)~}(3a6555673<((b672>| ",
" !)~<2c345d56a3(3:2e6(>/ ",
" =;^<~fghij473~)}gki4:~>! ",
" ~*^2~>!1lm((^+n1opq_rr2/ ",
" f<~<3_stumv~}~~~wxyd5(2(/= ",
" ~~2_6zzzA774BBBCzDEdb^~/1 ",
" ~~(F7555G7a5d5555555_(}/ ",
" 8~(3F6664F74AA6556aa_(~! ",
" )~(F_7777(F__F7464_7F28 ",
" )(76F(3_______((366_} ",
" )(767HIFFFFFFFzA755qg ",
" n~_77eJKKzzzzzEBa55}= ",
" |)3_7HKLLMMMMNOB4d5)n ",
" |)(_6745OEEEEE46d55)! ",
" |]^365667__7a65d576)! ",
" |P)~_655647a65d56_a)! ",
" /P)+<_Q44_F_444Q_34)! ",
" !>)R)~2((^~^(3(<2F6g. ",
" =>)++++++)))~~^(_66c ",
" >)+)))~2^<222_4557k ",
" >))~^<(_3__F(7Gd5_c ",
" >))~2(_a7464_7654(g ",
" >)~^<(75765d6746_<f "};
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/F-14/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 12:05:06 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:50:44 -0000 1.2
@@ -0,0 +1 @@
+Wolf4SDL-1.6-src.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/F-14/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 12:05:06 -0000 1.1
+++ sources 9 Jan 2011 12:50:44 -0000 1.2
@@ -0,0 +1 @@
+8195dbb793b55bbc6ff3db30bbb87689 Wolf4SDL-1.6-src.zip
14 years, 1 month
rpms/wolf4sdl/devel 01-shareware-version.patch, NONE, 1.1 02-enable-shading.patch, NONE, 1.1 10-datadir.patch, NONE, 1.1 11-configdir.patch, NONE, 1.1 21-compiler-warnings.patch, NONE, 1.1 Wolf4SDL-1.6-compile-fixes.patch, NONE, 1.1 Wolf4SDL-1.6-registered-apogee.patch, NONE, 1.1 Wolf4SDL-1.6-spear.patch, NONE, 1.1 Wolf4SDL-1.6-speardemo.patch, NONE, 1.1 wolf4sdl.6, NONE, 1.1 wolf4sdl.desktop, NONE, 1.1 wolf4sdl.spec, NONE, 1.1 wolf4sdl.xpm, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
by jwrdegoede
Author: jwrdegoede
Update of /cvs/nonfree/rpms/wolf4sdl/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3081/devel
Modified Files:
.cvsignore sources
Added Files:
01-shareware-version.patch 02-enable-shading.patch
10-datadir.patch 11-configdir.patch 21-compiler-warnings.patch
Wolf4SDL-1.6-compile-fixes.patch
Wolf4SDL-1.6-registered-apogee.patch Wolf4SDL-1.6-spear.patch
Wolf4SDL-1.6-speardemo.patch wolf4sdl.6 wolf4sdl.desktop
wolf4sdl.spec wolf4sdl.xpm
Log Message:
Initial rpmfusion wolf4sdl import
01-shareware-version.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE 01-shareware-version.patch ---
Subject: Build for the Wolf3d Shareware v1.4 version.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
-//#define UPLOAD
+#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
02-enable-shading.patch:
Makefile | 1 +
version.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE 02-enable-shading.patch ---
Subject: Enable shading support (just because I like it).
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/Makefile
+++ wolf4sdl-1.6/Makefile
@@ -54,6 +54,7 @@ SRCS += wl_agent.cpp
SRCS += wl_atmos.cpp
SRCS += wl_cloudsky.cpp
SRCS += wl_debug.cpp
+SRCS += wl_shade.cpp
SRCS += wl_draw.cpp
SRCS += wl_floorceiling.cpp
SRCS += wl_game.cpp
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -30,7 +30,7 @@
#endif
//#define USE_FEATUREFLAGS // Enables the level feature flags (see bottom of wl_def.h)
-//#define USE_SHADING // Enables shading support (see wl_shade.cpp)
+#define USE_SHADING // Enables shading support (see wl_shade.cpp)
//#define USE_DIR3DSPR // Enables directional 3d sprites (see wl_dir3dspr.cpp)
//#define USE_FLOORCEILINGTEX // Enables floor and ceiling textures stored in the third mapplane (see wl_floorceiling.cpp)
//#define USE_HIRES // Enables high resolution textures/sprites (128x128)
10-datadir.patch:
id_ca.cpp | 22 +++++++++++-----------
id_pm.cpp | 2 +-
version.h | 4 ++++
wl_menu.cpp | 21 +++++++++++----------
4 files changed, 27 insertions(+), 22 deletions(-)
--- NEW FILE 10-datadir.patch ---
Subject: Use /usr/share/games/wolf3d for data files.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -81,13 +81,13 @@ int numEpisodesMissing = 0;
char extension[5]; // Need a string, not constant to change cache files
char graphext[5];
char audioext[5];
-static const char gheadname[] = "vgahead.";
-static const char gfilename[] = "vgagraph.";
-static const char gdictname[] = "vgadict.";
-static const char mheadname[] = "maphead.";
-static const char mfilename[] = "maptemp.";
-static const char aheadname[] = "audiohed.";
-static const char afilename[] = "audiot.";
+static const char gheadname[] = DATADIR "vgahead.";
+static const char gfilename[] = DATADIR "vgagraph.";
+static const char gdictname[] = DATADIR "vgadict.";
+static const char mheadname[] = DATADIR "maphead.";
+static const char mfilename[] = DATADIR "maptemp.";
+static const char aheadname[] = DATADIR "audiohed.";
+static const char afilename[] = DATADIR "audiot.";
void CA_CannotOpen(const char *string);
@@ -443,7 +443,7 @@ void CA_RLEWexpand (word *source, word *
void CAL_SetupGrFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
int handle;
byte *compseg;
@@ -539,7 +539,7 @@ void CAL_SetupMapFile (void)
int i;
int handle;
int32_t length,pos;
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load maphead.ext (offsets and tileinfo for map file)
@@ -563,7 +563,7 @@ void CAL_SetupMapFile (void)
// open the data file
//
#ifdef CARMACIZED
- strcpy(fname, "gamemaps.");
+ strcpy(fname, DATADIR "gamemaps.");
strcat(fname, extension);
maphandle = open(fname, O_RDONLY | O_BINARY);
@@ -619,7 +619,7 @@ void CAL_SetupMapFile (void)
void CAL_SetupAudioFile (void)
{
- char fname[13];
+ char fname[13 + sizeof(DATADIR)];
//
// load audiohed.ext (offsets for audio file)
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -16,7 +16,7 @@ uint8_t **PMPages;
void PM_Startup()
{
- char fname[13] = "vswap.";
+ char fname[13 + sizeof(DATADIR)] = DATADIR "vswap.";
strcat(fname,extension);
FILE *file = fopen(fname,"rb");
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -3,6 +3,10 @@
#ifndef VERSIONALREADYCHOSEN // used for batch compiling
+#ifndef DATADIR
+#define DATADIR ""
+#endif
+
/* Defines used for different versions */
//#define SPEAR
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -3615,6 +3615,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -3998,12 +3999,12 @@ CheckForEpisodes (void)
//
#ifdef JAPAN
#ifdef JAPDEMO
- if(!stat("vswap.wj1", &statbuf))
+ if(!stat(DATADIR "vswap.wj1", &statbuf))
{
strcpy (extension, "wj1");
numEpisodesMissing = 5;
#else
- if(!stat("vswap.wj6", &statbuf))
+ if(!stat(DATADIR "vswap.wj6", &statbuf))
{
strcpy (extension, "wj6");
#endif
@@ -4021,7 +4022,7 @@ CheckForEpisodes (void)
// ENGLISH
//
#ifdef UPLOAD
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4030,7 +4031,7 @@ CheckForEpisodes (void)
Quit ("NO WOLFENSTEIN 3-D DATA FILES to be found!");
#else
#ifndef SPEAR
- if(!stat("vswap.wl6", &statbuf))
+ if(!stat(DATADIR "vswap.wl6", &statbuf))
{
strcpy (extension, "wl6");
NewEmenu[2].active =
@@ -4043,7 +4044,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl3", &statbuf))
+ if(!stat(DATADIR "vswap.wl3", &statbuf))
{
strcpy (extension, "wl3");
numEpisodesMissing = 3;
@@ -4051,7 +4052,7 @@ CheckForEpisodes (void)
}
else
{
- if(!stat("vswap.wl1", &statbuf))
+ if(!stat(DATADIR "vswap.wl1", &statbuf))
{
strcpy (extension, "wl1");
numEpisodesMissing = 5;
@@ -4068,21 +4069,21 @@ CheckForEpisodes (void)
#ifndef SPEARDEMO
if(param_mission == 1)
{
- if(!stat("vswap.sod", &statbuf))
+ if(!stat(DATADIR "vswap.sod", &statbuf))
strcpy (extension, "sod");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 2)
{
- if(!stat("vswap.sd2", &statbuf))
+ if(!stat(DATADIR "vswap.sd2", &statbuf))
strcpy (extension, "sd2");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
}
else if(param_mission == 3)
{
- if(!stat("vswap.sd3", &statbuf))
+ if(!stat(DATADIR "vswap.sd3", &statbuf))
strcpy (extension, "sd3");
else
Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
@@ -4092,7 +4093,7 @@ CheckForEpisodes (void)
strcpy (graphext, "sod");
strcpy (audioext, "sod");
#else
- if(!stat("vswap.sdm", &statbuf))
+ if(!stat(DATADIR "vswap.sdm", &statbuf))
{
strcpy (extension, "sdm");
}
11-configdir.patch:
wl_def.h | 2 +-
wl_main.cpp | 15 ++++++++++++++-
wl_menu.cpp | 40 +++++++++++++++++++++-------------------
3 files changed, 36 insertions(+), 21 deletions(-)
--- NEW FILE 11-configdir.patch ---
Subject: Use ~/.wolf4sdl for config files and saved games.
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/wl_def.h
+++ wolf4sdl-1.6/wl_def.h
@@ -915,7 +915,7 @@ extern unsigned screenofs;
extern boolean startgame;
extern char str[80];
-extern char configname[13];
+extern char configname[256];
//
// Command line parameter variables
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -10,6 +10,7 @@
#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
+#include <errno.h>
/*
@@ -73,7 +74,8 @@ boolean startgame;
boolean loadedgame;
int mouseadjustment;
-char configname[13]="config.";
+char configdir[256];
+char configname[256];
//
// Command line parameter variables
@@ -1871,6 +1873,17 @@ int main (int argc, char *argv[])
CheckParameters(argc, argv);
#endif
+#if defined (__unix__) && !defined(__MINGW32__)
+ /* Set up home directory */
+ int err;
+ snprintf(configdir, sizeof(configdir) - 1, "%s/.wolf4sdl/", getenv ("HOME"));
+ err = mkdir(configdir, S_IRWXU);
+ if (err == -1 && errno != EEXIST)
+ Quit ("Could not create directory \"%s\": %s\n", configdir, strerror (errno));
+#else
+ strcpy(configdir, "");
+#endif
+
CheckForEpisodes();
InitGame();
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -18,6 +18,7 @@
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
+extern char configdir[256];
//
// PRIVATE PROTOTYPES
@@ -277,8 +278,8 @@ static int SaveGamesAvail[10];
static int StartGame;
static int SoundStatus = 1;
static int pickquick;
-static char SaveGameNames[10][32];
-static char SaveName[13] = "savegam?.";
+static char SaveGameNames[10][256];
+static char SaveName[256] = "savegam?.";
////////////////////////////////////////////////////////////////////
@@ -1497,10 +1498,10 @@ CP_LoadGame (int quick)
{
FILE *file;
int which, exit = 0;
- char name[13];
+ char name[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKLOAD?
@@ -1511,7 +1512,7 @@ CP_LoadGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1549,8 +1550,7 @@ CP_LoadGame (int quick)
if (which >= 0 && SaveGamesAvail[which])
{
ShootSnd ();
- name[7] = which + '0';
-
+ name[strlen(configdir) + 7] = which + '0';
#ifdef _arch_dreamcast
DC_LoadFromVMU(name);
#endif
@@ -1676,11 +1676,11 @@ CP_SaveGame (int quick)
{
int which, exit = 0;
FILE *file;
- char name[13];
- char input[32];
+ char name[256];
+ char input[256];
- strcpy (name, SaveName);
+ snprintf (name, sizeof(name) - 1, "%s%s", configdir, SaveName);
//
// QUICKSAVE?
@@ -1691,7 +1691,7 @@ CP_SaveGame (int quick)
if (SaveGamesAvail[which])
{
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
unlink (name);
file = fopen (name, "wb");
@@ -1747,7 +1747,7 @@ CP_SaveGame (int quick)
ShootSnd ();
strcpy (input, &SaveGameNames[which][0]);
- name[7] = which + '0';
+ name[strlen(configdir) + 7] = which + '0';
fontnumber = 0;
if (!SaveGamesAvail[which])
@@ -3142,7 +3142,7 @@ SetupControlPanel (void)
////////////////////////////////////////////////////////////////////
void SetupSaveGames()
{
- char name[13];
+ char name[256];
#ifdef _arch_dreamcast
file_t dir;
@@ -3152,12 +3152,13 @@ void SetupSaveGames()
dir = fs_open("/vmu/a1", O_RDONLY | O_DIR);
x = 0;
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
+
while((dirent = fs_readdir(dir)) && x < 10)
{
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
if(!strcmp(name, dirent->name))
{
if(DC_LoadFromVMU(name) != -1)
@@ -3181,10 +3182,10 @@ void SetupSaveGames()
fs_close(dir);
#else
- strcpy(name, SaveName);
+ snprintf(name, sizeof(name) - 1, "%s%s", configdir, SaveName);
for(int i=0; i<10; i++)
{
- name[7] = '0' + i;
+ name[strlen(configdir) + 7] = '0' + i;
const int handle = open(name, O_RDONLY | O_BINARY);
if (handle >= 0)
{
@@ -3616,6 +3617,7 @@ ReadAnyControl (ControlInfo * ci)
IN_ReadControl (0, ci);
+
if (mouseenabled && IN_IsInputGrabbed())
{
int mousex, mousey, buttons;
@@ -4008,7 +4010,7 @@ CheckForEpisodes (void)
{
strcpy (extension, "wj6");
#endif
- strcat (configname, extension);
+ snprintf(configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
EpisodeSelect[1] =
@@ -4107,7 +4109,7 @@ CheckForEpisodes (void)
strcpy (audioext, extension);
#endif
- strcat (configname, extension);
+ snprintf (configname, sizeof(configname) - 1, "%sconfig.%s", configdir, extension);
strcat (SaveName, extension);
strcat (demoname, extension);
21-compiler-warnings.patch:
fmopl.cpp | 6 ++++--
id_ca.cpp | 7 +++----
id_pm.cpp | 2 +-
id_sd.cpp | 8 ++++++--
id_us_1.cpp | 15 +++++++--------
id_vl.cpp | 1 -
wl_act1.cpp | 4 ++--
wl_act2.cpp | 3 +--
wl_agent.cpp | 1 -
wl_debug.cpp | 5 ++---
wl_draw.cpp | 49 ++++++++++++++++++++++++-------------------------
wl_game.cpp | 4 ++--
wl_inter.cpp | 3 +--
wl_main.cpp | 11 +++++------
wl_menu.cpp | 25 +++++++++++++------------
wl_play.cpp | 3 ---
wl_state.cpp | 1 -
wl_text.cpp | 1 -
18 files changed, 71 insertions(+), 78 deletions(-)
--- NEW FILE 21-compiler-warnings.patch ---
Subject: Fix some compiler warnings so the code compiles cleanly with
g++-4.5 and CFLAGS+="-Wall -Wno-sign-compare -Wno-switch".
Author: Fabian Greffrath <fabian+debian(a)greffrath.com>
--- wolf4sdl-1.6.orig/fmopl.cpp
+++ wolf4sdl-1.6/fmopl.cpp
@@ -1955,19 +1955,21 @@ static void OPLSetUpdateHandler(FM_OPL *
OPL->UpdateParam = param;
}
+/*
static int OPLWrite(FM_OPL *OPL,int a,int v)
{
if( !(a&1) )
- { /* address port */
+ { // address port
OPL->address = v & 0xff;
}
else
- { /* data port */
+ { // data port
if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0);
OPLWriteReg(OPL,OPL->address,v);
}
return OPL->status>>7;
}
+*/
static unsigned char OPLRead(FM_OPL *OPL,int a)
{
--- wolf4sdl-1.6.orig/id_ca.cpp
+++ wolf4sdl-1.6/id_ca.cpp
@@ -23,7 +23,6 @@ loaded into the data segment
#endif
#include "wl_def.h"
-#pragma hdrstop
#define THREEBYTEGRSTARTS
@@ -685,7 +684,7 @@ void CA_Startup (void)
void CA_Shutdown (void)
{
- int i,start;
+ int i,start = STARTADLIBSOUNDS;
if(maphandle != -1)
close(maphandle);
@@ -795,7 +794,7 @@ void CA_CacheAdlibSoundChunk (int chunk)
void CA_LoadAllSounds (void)
{
- unsigned start,i;
+ unsigned start = STARTADLIBSOUNDS,i;
switch (oldsoundmode)
{
@@ -1031,7 +1030,7 @@ void CA_CacheMap (int mapnum)
int32_t pos,compressed;
int plane;
word *dest;
- memptr bigbufferseg;
+ memptr bigbufferseg = 0;
unsigned size;
word *source;
#ifdef CARMACIZED
--- wolf4sdl-1.6.orig/id_pm.cpp
+++ wolf4sdl-1.6/id_pm.cpp
@@ -82,7 +82,7 @@ void PM_Startup()
uint8_t *ptr = (uint8_t *) PMPageData;
for(i = 0; i < ChunksInFile; i++)
{
- if(i >= PMSpriteStart && i < PMSoundStart || i == ChunksInFile - 1)
+ if((i >= PMSpriteStart && i < PMSoundStart) || i == ChunksInFile - 1)
{
size_t offs = ptr - (uint8_t *) PMPageData;
--- wolf4sdl-1.6.orig/id_sd.cpp
+++ wolf4sdl-1.6/id_sd.cpp
@@ -31,7 +31,6 @@
#include "fmopl.h"
-#pragma hdrstop
#define ORIGSAMPLERATE 7042
@@ -95,7 +94,6 @@ static boolean DigiPlay
// PC Sound variables
static volatile byte pcLastSample;
static byte * volatile pcSound;
-static longword pcLengthLeft;
// AdLib variables
static byte * volatile alSound;
@@ -780,6 +778,7 @@ SDL_ShutAL(void)
// SDL_CleanAL() - Totally shuts down the AdLib card
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanAL(void)
{
@@ -789,6 +788,7 @@ SDL_CleanAL(void)
for (i = 1; i < 0xf5; i++)
alOut(i, 0);
}
+*/
///////////////////////////////////////////////////////////////////////////
//
@@ -808,6 +808,7 @@ SDL_StartAL(void)
// emulating an AdLib) present
//
///////////////////////////////////////////////////////////////////////////
+/*
static boolean
SDL_DetectAdLib(void)
{
@@ -819,6 +820,7 @@ SDL_DetectAdLib(void)
return true;
}
+*/
////////////////////////////////////////////////////////////////////////////
//
@@ -845,12 +847,14 @@ SDL_ShutDevice(void)
// SDL_CleanDevice() - totally shuts down all sound devices
//
///////////////////////////////////////////////////////////////////////////
+/*
static void
SDL_CleanDevice(void)
{
if ((SoundMode == sdm_AdLib) || (MusicMode == smm_AdLib))
SDL_CleanAL();
}
+*/
///////////////////////////////////////////////////////////////////////////
//
--- wolf4sdl-1.6.orig/id_us_1.cpp
+++ wolf4sdl-1.6/id_us_1.cpp
@@ -22,7 +22,6 @@
#include "wl_def.h"
-#pragma hdrstop
#if _MSC_VER == 1200 // Visual C++ 6
#define vsnprintf _vsnprintf
@@ -177,7 +176,7 @@ void
US_PrintUnsigned(longword n)
{
char buffer[32];
- sprintf(buffer, "%lu", n);
+ sprintf(buffer, "%lu", (long unsigned int) n);
US_Print(buffer);
}
@@ -488,11 +487,11 @@ US_LineInput(int x,int y,char *buf,const
{
boolean redraw,
cursorvis,cursormoved,
- done,result, checkkey;
+ done,result = false, checkkey;
ScanCode sc;
char c;
char s[MaxString],olds[MaxString];
- int cursor,len;
+ int cursor,len = 0;
word i,
w,h,
temp;
@@ -530,7 +529,7 @@ US_LineInput(int x,int y,char *buf,const
curtime = GetTimeCount();
// After each direction change accept the next change after 250 ms and then everz 125 ms
- if(ci.dir != lastdir || curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8)
+ if(ci.dir != lastdir || (curtime - lastdirtime > TickBase / 4 && curtime - lastdirmovetime > TickBase / 8))
{
if(ci.dir != lastdir)
{
@@ -558,7 +557,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor] = ' ';
s[cursor + 1] = 0;
@@ -572,7 +571,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], 1);
@@ -584,7 +583,7 @@ US_LineInput(int x,int y,char *buf,const
if(!s[cursor])
{
USL_MeasureString(s,&w,&h);
- if(len >= maxchars || maxwidth && w >= maxwidth) break;
+ if(len >= maxchars || (maxwidth && w >= maxwidth)) break;
s[cursor + 1] = 0;
}
s[cursor] = USL_RotateChar(s[cursor], -1);
--- wolf4sdl-1.6.orig/id_vl.cpp
+++ wolf4sdl-1.6/id_vl.cpp
@@ -2,7 +2,6 @@
#include <string.h>
#include "wl_def.h"
-#pragma hdrstop
// Uncomment the following line, if you get destination out of bounds
// assertion errors and want to ignore them during debugging
--- wolf4sdl-1.6.orig/wl_act1.cpp
+++ wolf4sdl-1.6/wl_act1.cpp
@@ -1,7 +1,6 @@
// WL_ACT1.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -17,6 +16,7 @@ statobj_t *laststatobj;
struct
+statinfo_t
{
short picnum;
wl_stat_t type;
@@ -844,7 +844,7 @@ void MovePWalls (void)
pwally += dy;
if (actorat[pwallx+dx][pwally+dy]
- || xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh)
+ || (xl<=pwallx+dx && pwallx+dx<=xh && yl<=pwally+dy && pwally+dy<=yh))
{
pwallstate = 0;
tilemap[pwallx][pwally] = oldtile;
--- wolf4sdl-1.6.orig/wl_act2.cpp
+++ wolf4sdl-1.6/wl_act2.cpp
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <math.h>
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
@@ -307,7 +306,7 @@ boolean ProjectileTryMove (objtype *ob)
void T_Projectile (objtype *ob)
{
int32_t deltax,deltay;
- int damage;
+ int damage = 0;
int32_t speed;
speed = (int32_t)ob->speed*tics;
--- wolf4sdl-1.6.orig/wl_agent.cpp
+++ wolf4sdl-1.6/wl_agent.cpp
@@ -1,7 +1,6 @@
// WL_AGENT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_debug.cpp
+++ wolf4sdl-1.6/wl_debug.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#ifdef USE_CLOUDSKY
#include "wl_cloudsky.h"
@@ -52,7 +51,7 @@ void SimpleScaleShape (int xcenter, int
int maporgx;
int maporgy;
-enum {mapview,tilemapview,actoratview,visview} viewtype;
+enum viewtype_t {mapview,tilemapview,actoratview,visview} viewtype;
void ViewMap (void);
@@ -181,7 +180,7 @@ void BasicOverhead (void)
// left side (filtered)
uintptr_t tile;
- int color;
+ int color = 0;
offx -= 128;
for(x=0;x<MAPSIZE;x++)
--- wolf4sdl-1.6.orig/wl_draw.cpp
+++ wolf4sdl-1.6/wl_draw.cpp
@@ -1,7 +1,6 @@
// WL_DRAW.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_atmos.h"
@@ -484,7 +483,7 @@ void HitHorizWall (void)
void HitHorizDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL;
int doornum;
int texture;
@@ -549,7 +548,7 @@ void HitHorizDoor (void)
void HitVertDoor (void)
{
- int doorpage;
+ int doorpage = DOORWALL+1;
int doornum;
int texture;
@@ -1208,8 +1207,8 @@ void CalcTics (void)
void AsmRefresh()
{
- int32_t xstep,ystep;
- longword xpartial,ypartial;
+ int32_t xstep = 0,ystep = 0;
+ longword xpartial = 0,ypartial = 0;
boolean playerInPushwallBackTile = tilemap[focaltx][focalty] == 64;
for(pixx=0;pixx<viewwidth;pixx++)
@@ -1264,8 +1263,8 @@ void AsmRefresh()
// Special treatment when player is in back tile of pushwall
if(playerInPushwallBackTile)
{
- if( pwalldir == di_east && xtilestep == 1
- || pwalldir == di_west && xtilestep == -1)
+ if( (pwalldir == di_east && xtilestep == 1)
+ || (pwalldir == di_west && xtilestep == -1))
{
int32_t yintbuf = yintercept - ((ystep * (64 - pwallpos)) >> 6);
if((yintbuf >> 16) == focalty) // ray hits pushwall back?
@@ -1280,8 +1279,8 @@ void AsmRefresh()
continue;
}
}
- else if(pwalldir == di_south && ytilestep == 1
- || pwalldir == di_north && ytilestep == -1)
+ else if((pwalldir == di_south && ytilestep == 1)
+ || (pwalldir == di_north && ytilestep == -1))
{
int32_t xintbuf = xintercept - ((xstep * (64 - pwallpos)) >> 6);
if((xintbuf >> 16) == focaltx) // ray hits pushwall back?
@@ -1348,8 +1347,8 @@ vertentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally
- || pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally))
+ if((pwalldir == di_east && xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)
+ || (pwalldir == di_west && !(xtile==pwallx && ((uint32_t)yintercept>>16)==pwally)))
{
yintbuf=yintercept+((ystep*pwallposnorm)>>6);
if((yintbuf>>16)!=(yintercept>>16))
@@ -1376,13 +1375,13 @@ vertentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_north) pwallposi = 64-pwallpos;
- if(pwalldir==di_south && (word)yintercept<(pwallposi<<10)
- || pwalldir==di_north && (word)yintercept>(pwallposi<<10))
+ if((pwalldir==di_south && (word)yintercept<(pwallposi<<10))
+ || (pwalldir==di_north && (word)yintercept>(pwallposi<<10)))
{
if(((uint32_t)yintercept>>16)==pwally && xtile==pwallx)
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1412,8 +1411,8 @@ vertentry:
}
else
{
- if(pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10)
- || pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10))
+ if((pwalldir==di_south && (int32_t)((word)yintercept)+ystep>(pwallposi<<10))
+ || (pwalldir==di_north && (int32_t)((word)yintercept)+ystep<(pwallposi<<10)))
goto passvert;
if(pwalldir==di_south)
@@ -1494,8 +1493,8 @@ horizentry:
pwallposnorm = pwallpos;
pwallposinv = 64-pwallpos;
}
- if(pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx
- || pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx))
+ if((pwalldir == di_south && ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)
+ || (pwalldir == di_north && !(ytile==pwally && ((uint32_t)xintercept>>16)==pwallx)))
{
xintbuf=xintercept+((xstep*pwallposnorm)>>6);
if((xintbuf>>16)!=(xintercept>>16))
@@ -1522,13 +1521,13 @@ horizentry:
{
int pwallposi = pwallpos;
if(pwalldir==di_west) pwallposi = 64-pwallpos;
- if(pwalldir==di_east && (word)xintercept<(pwallposi<<10)
- || pwalldir==di_west && (word)xintercept>(pwallposi<<10))
+ if((pwalldir==di_east && (word)xintercept<(pwallposi<<10))
+ || (pwalldir==di_west && (word)xintercept>(pwallposi<<10)))
{
if(((uint32_t)xintercept>>16)==pwallx && ytile==pwally)
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
@@ -1558,8 +1557,8 @@ horizentry:
}
else
{
- if(pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10)
- || pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10))
+ if((pwalldir==di_east && (int32_t)((word)xintercept)+xstep>(pwallposi<<10))
+ || (pwalldir==di_west && (int32_t)((word)xintercept)+xstep<(pwallposi<<10)))
goto passhoriz;
if(pwalldir==di_east)
--- wolf4sdl-1.6.orig/wl_game.cpp
+++ wolf4sdl-1.6/wl_game.cpp
@@ -3,7 +3,6 @@
#include <SDL_mixer.h>
#endif
-#pragma hdrstop
#ifdef MYPROFILE
#include <TIME.H>
@@ -1177,7 +1176,8 @@ void PlayDemo (int demonumber)
NewGame (1,0);
gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard;
- length = READWORD(*(uint8_t **)&demoptr);
+ length = demoptr[0] | demoptr[1] << 8;
+ demoptr+=2;
// TODO: Seems like the original demo format supports 16 MB demos
// But T_DEM00 and T_DEM01 of Wolf have a 0xd8 as third length size...
demoptr++;
--- wolf4sdl-1.6.orig/wl_inter.cpp
+++ wolf4sdl-1.6/wl_inter.cpp
@@ -1,7 +1,6 @@
// WL_INTER.C
#include "wl_def.h"
-#pragma hdrstop
LRstruct LevelRatios[LRpack];
int32_t lastBreathTime = 0;
@@ -386,7 +385,7 @@ Write (int x, int y, const char *string)
break;
default:
- VWB_DrawPic (nx, ny, alpha[ch]);
+ VWB_DrawPic (nx, ny, alpha[(int)ch]);
}
nx += 16;
}
--- wolf4sdl-1.6.orig/wl_main.cpp
+++ wolf4sdl-1.6/wl_main.cpp
@@ -7,7 +7,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
#include "wl_atmos.h"
#include <SDL_syswm.h>
#include <errno.h>
@@ -1420,7 +1419,7 @@ void Quit (const char *errorStr, ...)
if (!pictable) // don't try to display the red box before it's loaded
{
ShutdownId();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
SetTextCursor(0,0);
@@ -1434,7 +1433,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
- if (!error || !*error)
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1454,7 +1453,7 @@ void Quit (const char *errorStr, ...)
ShutdownId ();
- if (error && *error)
+ if (*error)
{
#ifdef NOTYET
memcpy((byte *)0xb8000,screen+7,7*160);
@@ -1468,7 +1467,7 @@ void Quit (const char *errorStr, ...)
exit(1);
}
else
- if (!error || !(*error))
+ if (!*error)
{
#ifdef NOTYET
#ifndef JAPAN
@@ -1700,7 +1699,7 @@ void CheckParameters(int argc, char *arg
screenWidth = atoi(argv[++i]);
screenHeight = atoi(argv[++i]);
unsigned factor = screenWidth / 320;
- if(screenWidth % 320 || screenHeight != 200 * factor && screenHeight != 240 * factor)
+ if(screenWidth % 320 || (screenHeight != 200 * factor && screenHeight != 240 * factor))
printf("Screen size must be a multiple of 320x200 or 320x240!\n"), hasError = true;
}
}
--- wolf4sdl-1.6.orig/wl_menu.cpp
+++ wolf4sdl-1.6/wl_menu.cpp
@@ -14,7 +14,6 @@
#endif
#include "wl_def.h"
-#pragma hdrstop
extern int lastgamemusicoffset;
extern int numEpisodesMissing;
@@ -921,7 +920,7 @@ CP_CheckQuick (ScanCode scancode)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
{
@@ -1728,6 +1727,7 @@ CP_SaveGame (int quick)
// OVERWRITE EXISTING SAVEGAME?
//
if (SaveGamesAvail[which])
+ {
#ifdef JAPAN
if (!GetYorN (7, 8, C_JAPSAVEOVERPIC))
#else
@@ -1743,6 +1743,7 @@ CP_SaveGame (int quick)
PrintLSEntry (which, HIGHLIGHT);
VW_UpdateScreen ();
}
+ }
ShootSnd ();
@@ -2113,7 +2114,7 @@ CustomControls (int)
void
DefineMouseBtns (void)
{
- CustomCtrls mouseallowed = { 0, 1, 1, 1 };
+ CustomCtrls mouseallowed = {{ 0, 1, 1, 1 }};
EnterCtrlData (2, &mouseallowed, DrawCustMouse, PrintCustMouse, MOUSE);
}
@@ -2125,7 +2126,7 @@ DefineMouseBtns (void)
void
DefineJoyBtns (void)
{
- CustomCtrls joyallowed = { 1, 1, 1, 1 };
+ CustomCtrls joyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (5, &joyallowed, DrawCustJoy, PrintCustJoy, JOYSTICK);
}
@@ -2137,7 +2138,7 @@ DefineJoyBtns (void)
void
DefineKeyBtns (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (8, &keyallowed, DrawCustKeybd, PrintCustKeybd, KEYBOARDBTNS);
}
@@ -2149,7 +2150,7 @@ DefineKeyBtns (void)
void
DefineKeyMove (void)
{
- CustomCtrls keyallowed = { 1, 1, 1, 1 };
+ CustomCtrls keyallowed = {{ 1, 1, 1, 1 }};
EnterCtrlData (10, &keyallowed, DrawCustKeys, PrintCustKeys, KEYBOARDMOVE);
}
@@ -2166,7 +2167,7 @@ void
EnterCtrlData (int index, CustomCtrls * cust, void (*DrawRtn) (int), void (*PrintRtn) (int),
int type)
{
- int j, exit, tick, redraw, which, x, picked, lastFlashTime;
+ int j, exit, tick, redraw, which = 0, x = 0, picked, lastFlashTime;
ControlInfo ci;
@@ -2217,7 +2218,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// CHANGE BUTTON VALUE?
//
- if ((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3) ||
+ if (((type != KEYBOARDBTNS && type != KEYBOARDMOVE) && (ci.button0 | ci.button1 | ci.button2 | ci.button3)) ||
((type == KEYBOARDBTNS || type == KEYBOARDMOVE) && LastScan == sc_Enter))
{
lastFlashTime = GetTimeCount();
@@ -2338,7 +2339,7 @@ EnterCtrlData (int index, CustomCtrls *
//
// EXIT INPUT?
//
- if (IN_KeyDown (sc_Escape) || type != JOYSTICK && ci.button1)
+ if (IN_KeyDown (sc_Escape) || (type != JOYSTICK && ci.button1))
{
picked = 1;
SD_PlaySound (ESCPRESSEDSND);
@@ -2918,7 +2919,7 @@ CP_Quit (int)
#ifdef SPANISH
if (Confirm (ENDGAMESTR))
#else
- if (Confirm (endStrings[US_RndT () & 0x7 + (US_RndT () & 1)]))
+ if (Confirm (endStrings[US_RndT () & (0x7 + (US_RndT () & 1))]))
#endif
#endif
@@ -3405,7 +3406,7 @@ HandleMenu (CP_iteminfo * item_i, CP_ite
if (ci.button0 || Keyboard[sc_Space] || Keyboard[sc_Enter])
exit = 1;
- if (ci.button1 && !Keyboard[sc_Alt] || Keyboard[sc_Escape])
+ if ((ci.button1 && !Keyboard[sc_Alt]) || Keyboard[sc_Escape])
exit = 2;
}
@@ -3854,7 +3855,7 @@ Message (const char *string)
h += font->height;
}
else
- w += font->width[string[i]];
+ w += font->width[(int8_t)string[i]];
}
if (w + 10 > mw)
--- wolf4sdl-1.6.orig/wl_play.cpp
+++ wolf4sdl-1.6/wl_play.cpp
@@ -1,7 +1,6 @@
// WL_PLAY.C
#include "wl_def.h"
-#pragma hdrstop
#include "wl_cloudsky.h"
#include "wl_shade.h"
@@ -688,8 +687,6 @@ void CheckKeys (void)
#endif
scan == sc_F9 || scan == sc_F7 || scan == sc_F8) // pop up quit dialog
{
- short oldmapon = gamestate.mapon;
- short oldepisode = gamestate.episode;
ClearMemory ();
ClearSplitVWB ();
US_ControlPanel (scan);
--- wolf4sdl-1.6.orig/wl_state.cpp
+++ wolf4sdl-1.6/wl_state.cpp
@@ -1,7 +1,6 @@
// WL_STATE.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
--- wolf4sdl-1.6.orig/wl_text.cpp
+++ wolf4sdl-1.6/wl_text.cpp
@@ -1,7 +1,6 @@
// WL_TEXT.C
#include "wl_def.h"
-#pragma hdrstop
/*
=============================================================================
Wolf4SDL-1.6-compile-fixes.patch:
id_ca.cpp | 2 +-
wl_main.cpp | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-compile-fixes.patch ---
diff -up Wolf4SDL-1.6-src/id_ca.cpp~ Wolf4SDL-1.6-src/id_ca.cpp
--- Wolf4SDL-1.6-src/id_ca.cpp~ 2010-12-25 11:51:36.000000000 +0100
+++ Wolf4SDL-1.6-src/id_ca.cpp 2010-12-25 11:54:16.675674203 +0100
@@ -153,7 +153,7 @@ void CAL_GetGrChunkLength (int chunk)
boolean CA_WriteFile (const char *filename, void *ptr, int32_t length)
{
- const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY);
+ const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
if (handle == -1)
return false;
diff -up Wolf4SDL-1.6-src/wl_main.cpp~ Wolf4SDL-1.6-src/wl_main.cpp
--- Wolf4SDL-1.6-src/wl_main.cpp~ 2010-12-25 11:55:08.000000000 +0100
+++ Wolf4SDL-1.6-src/wl_main.cpp 2010-12-25 11:56:19.345674374 +0100
@@ -4,6 +4,8 @@
#include <io.h>
#else
#include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
#endif
#include "wl_def.h"
Wolf4SDL-1.6-registered-apogee.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-registered-apogee.patch ---
--- wolf4sdl-1.6.orig/version.h
+++ wolf4sdl-1.6/version.h
@@ -7,7 +7,7 @@
//#define SPEAR
//#define SPEARDEMO
//#define UPLOAD
-#define GOODTIMES
+//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
//#define APOGEE_1_1
Wolf4SDL-1.6-spear.patch:
version.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- NEW FILE Wolf4SDL-1.6-spear.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:18:52.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:32:35.785486971 +0100
@@ -9,9 +9,9 @@
/* Defines used for different versions */
-//#define SPEAR
+#define SPEAR
//#define SPEARDEMO
-#define UPLOAD
+//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
//#define APOGEE_1_0
Wolf4SDL-1.6-speardemo.patch:
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE Wolf4SDL-1.6-speardemo.patch ---
diff -up Wolf4SDL-1.6-src/version.h~ Wolf4SDL-1.6-src/version.h
--- Wolf4SDL-1.6-src/version.h~ 2010-12-27 09:32:35.000000000 +0100
+++ Wolf4SDL-1.6-src/version.h 2010-12-27 09:33:08.986486882 +0100
@@ -10,7 +10,7 @@
/* Defines used for different versions */
#define SPEAR
-//#define SPEARDEMO
+#define SPEARDEMO
//#define UPLOAD
//#define GOODTIMES
#define CARMACIZED
--- NEW FILE wolf4sdl.6 ---
.TH WOLF4SDL 6 "December 2010" "1.6" "Wolf4SDL"
.SH NAME
wolf4sdl \- An open-source port of id Software's classic first-person shooter
.SH SYNOPSIS
.B wolf4sdl
.RI [ options ]
.SH DESCRIPTION
.B Wolf4SDL
is an open-source port of id Software's classic first-person shooter
.B Wolfenstein 3D
to the cross-plattform multimedia library
.B "Simple DirectMedia Layer (SDL)"
(http://www.libsdl.org). It is meant to keep the original feel while taking advantage of some improvements.
.SH OPTIONS
.TP
\fB\-\-help\fR
This help page
.TP
\fB\-\-tedlevel\fR <level>
Starts the game in the given level
.TP
\fB\-\-baby\fR
Sets the difficulty to baby for tedlevel
.TP
\fB\-\-easy\fR
Sets the difficulty to easy for tedlevel
.TP
\fB\-\-normal\fR
Sets the difficulty to normal for tedlevel
.TP
\fB\-\-hard\fR
Sets the difficulty to hard for tedlevel
.TP
\fB\-\-nowait\fR
Skips intro screens
.TP
\fB\-\-windowed\fR
Starts the game in a window
.TP
\fB\-\-res\fR <width> <height>
Sets the screen resolution
(must be multiple of 320x200 or 320x240)
.TP
\fB\-\-resf\fR <w> <h>
Sets any screen resolution >= 320x200
(which may result in graphic errors)
.TP
\fB\-\-bits\fR <b>
Sets the screen color depth
(use this when you have palette/fading problems
allowed: 8, 16, 24, 32, default: "best" depth)
.TP
\fB\-\-joystick\fR <index>
Use the index\-th joystick if available
(\-1 to disable joystick, default: 0)
.TP
\fB\-\-joystickhat\fR <index>
Enables movement with the given coolie hat
.TP
\fB\-\-samplerate\fR <rate>
Sets the sound sample rate (given in Hz, default: 44100)
.TP
\fB\-\-audiobuffer\fR <size>
Sets the size of the audio buffer (\-> sound latency)
(given in bytes, default: 2048 / (44100 / samplerate))
.TP
\fB\-\-ignorenumchunks\fR
Ignores the number of chunks in VGAHEAD.*
(may be useful for some broken mods)
.SH AUTHORS
Wolf4SDL v1.6 ($Revision: 232 $)
.PP
Ported by Chaos-Software (http://www.chaos-software.de.vu)
.PP
Original Wolfenstein 3D by id Software
.PP
This manual page was written by Fabian Greffrath <fabian+debian(a)greffrath.com>
for the Debian project (but may be used by others).
--- NEW FILE wolf4sdl.desktop ---
[Desktop Entry]
Type=Application
Name=@NAME@
Comment=An open-source port of id Software's classic first-person shooter
Icon=wolf4sdl
Exec=wolf4sdl-@VARIANT@
Categories=Game;ActionGame;
--- NEW FILE wolf4sdl.spec ---
Name: wolf4sdl
Version: 1.6
Release: 1%{?dist}
Summary: SDL port of id Software's Wolfenstein 3D
Group: Amusements/Games
License: Distributable
# These url's are for a version targeted mainly at Mac OS X
# The original wolf4sdl site was:
# http://www.stud.uni-karlsruhe.de/~uvaue/chaos
# But this gives 403 errors now a days.
URL: http://chrisballinger.info/wolf4sdl/
Source0: http://chrisballinger.info/wolf4sdl/Wolf4SDL-1.6-src.zip
# All the below files and the package description are taken from the Debian
# package by Fabian Greffrath <fabian+debian(a)greffrath.com>
# License:
# Copying and distribution of the Debian packaging, with or without
# modification are permitted in any medium without royalty provided the
# copyright notice and this notice are preserved. The Debian packaging is
# offered as-is, without any warranty.
Source1: %{name}.6
Source2: %{name}.desktop
Source3: %{name}.xpm
Patch0: 01-shareware-version.patch
Patch1: 02-enable-shading.patch
Patch2: 10-datadir.patch
Patch3: 11-configdir.patch
Patch4: 21-compiler-warnings.patch
# end Debian files
Patch5: Wolf4SDL-1.6-compile-fixes.patch
Patch6: Wolf4SDL-1.6-registered-apogee.patch
Patch7: Wolf4SDL-1.6-spear.patch
Patch8: Wolf4SDL-1.6-speardemo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel SDL_mixer-devel desktop-file-utils
%global desc \
Maybe it was the fact that people got to blow away Nazis. Maybe it was the \
sheer challenge of it all. For whatever reason, Wolfenstein 3D and Spear of \
Destiny, pioneered the first-person shooter genre and brought its legendary \
creators, id Software, worldwide notoriety and numerous awards. In fact, The \
Computer Gaming World Hall of Fame recognized Wolfenstein 3D as helping to \
shape the overall direction of the computer gaming industry. \
\
Wolf4SDL is an open-source port of id Software's classic first-person shooter \
Wolfenstein 3D to the cross-platform multimedia library "Simple DirectMedia \
Layer (SDL)" (http://www.libsdl.org). It is meant to keep the original feel \
while taking advantage of some improvements.
%description
%{desc}
%package registered-id
Summary: SDL port of Wolfenstein 3D - id Software registered version
URL: http://www.idsoftware.com/games/wolfenstein/wolf3d/
%description registered-id
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by id Software:
http://www.idsoftware.com/games/wolfenstein/wolf3d/
You will need the original registered version's data files to play the
registered version. Place the data files under /usr/share/wolf3d/registered-id
before starting %{name}-registered-id. Note all file-names must be lowercase!
%{desc}
%package registered-apogee
Summary: SDL port of Wolfenstein 3D - Apogee registered version
URL: http://www.3drealms.com/wolf3d/index.html
%description registered-apogee
This package contains %{name} compiled for playing the registered version of
Wolfenstein 3D as sold by Apogee / 3Drealms here:
http://www.3drealms.com/wolf3d/index.html
You will need the original registered version's data files to play the
registered version. Place the data files under
/usr/share/wolf3d/registered-apogee before starting
%{name}-registered-apogee. Note all file-names must be lowercase!
%{desc}
%package shareware
Summary: SDL port of id Software's Wolfenstein 3D - shareware version
URL: http://www.3drealms.com/wolf3d/index.html
Requires: wolf3d-shareware
%description shareware
This package contains %{name} compiled for playing the shareware version of
Wolfenstein 3D.
%{desc}
%package spear
Summary: SDL port of Wolfenstein 3D - Spear of Destiny version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
%description spear
This package contains %{name} compiled for playing the Spear of Destiny
prequel to Wolfenstein 3D, sold by id Software:
http://www.idsoftware.com/games/wolfenstein/spear/
You will need the original Spear of Destiny data files to play.
Place the data files under /usr/share/spear/full before starting
%{name}-spear. Note all file-names must be lowercase!
%{desc}
%package spear-demo
Summary: SDL port of Wolfenstein 3D - Spear of Destiny demo version
URL: http://www.idsoftware.com/games/wolfenstein/spear/
Requires: spear-demo
%description spear-demo
This package contains %{name} compiled for playing the demo of the Spear of
Destiny prequel to Wolfenstein 3D.
%{desc}
%prep
%setup -q -c
pushd Wolf4SDL-1.6-src
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
chmod -x *.cpp *.h *.inc
mkdir ../doc
for i in Changes.txt README.txt license-*.txt; do
cat $i | sed 's|\r||g' > ../doc/$i
touch -r $i ../doc/$i
done
popd
%build
pushd Wolf4SDL-1.6-src
CFLAGS="$RPM_OPT_FLAGS -Wno-sign-compare -Wno-switch -Wno-unused-result"
CFLAGS="$CFLAGS $(sdl-config --cflags)"
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-id/\\\""
mv wolf3d %{name}-registered-id
cp %{SOURCE2} %{name}-registered-id.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (id)|g' \
%{name}-registered-id.desktop
sed -i 's|@VARIANT@|registered-id|g' %{name}-registered-id.desktop
make clean
patch -p1 < %{PATCH6}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/registered-apogee/\\\""
mv wolf3d %{name}-registered-apogee
cp %{SOURCE2} %{name}-registered-apogee.desktop
sed -i 's|@NAME@|Wolfenstein 3D Registered (Apogee)|g' \
%{name}-registered-apogee.desktop
sed -i 's|@VARIANT@|registered-apogee|g' %{name}-registered-apogee.desktop
make clean
patch -p1 < %{PATCH0}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/wolf3d/shareware/\\\""
mv wolf3d %{name}-shareware
cp %{SOURCE2} %{name}-shareware.desktop
sed -i 's|@NAME@|Wolfenstein 3D Shareware (Apogee)|g' %{name}-shareware.desktop
sed -i 's|@VARIANT@|shareware|g' %{name}-shareware.desktop
make clean
patch -p1 < %{PATCH7}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/full/\\\""
mv wolf3d %{name}-spear
cp %{SOURCE2} %{name}-spear.desktop
sed -i 's|@NAME@|Spear of Destiny|g' %{name}-spear.desktop
sed -i 's|@VARIANT@|spear|g' %{name}-spear.desktop
make clean
patch -p1 < %{PATCH8}
make %{?_smp_mflags} \
CFLAGS="$CFLAGS -DDATADIR=\\\"/usr/share/spear/demo/\\\""
mv wolf3d %{name}-spear-demo
cp %{SOURCE2} %{name}-spear-demo.desktop
sed -i 's|@NAME@|Spear of Destiny Demo|g' %{name}-spear-demo.desktop
sed -i 's|@VARIANT@|spear-demo|g' %{name}-spear-demo.desktop
popd
%install
pushd Wolf4SDL-1.6-src
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man6
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 755 %{name}-registered-id $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-id.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-id.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-id
install -m 755 %{name}-registered-apogee $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-registered-apogee.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-registered-apogee.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/wolf3d/registered-apogee
install -m 755 %{name}-shareware $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-shareware.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-shareware.desktop
install -m 755 %{name}-spear $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spear/full
install -m 755 %{name}-spear-demo $RPM_BUILD_ROOT%{_bindir}
ln -s wolf4sdl.6 $RPM_BUILD_ROOT%{_mandir}/man6/wolf4sdl-spear-demo.6
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{name}-spear-demo.desktop
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files registered-id
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-id
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-id.6*
%{_datadir}/applications/%{name}-registered-id.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-id
%files registered-apogee
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-registered-apogee
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-registered-apogee.6*
%{_datadir}/applications/%{name}-registered-apogee.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/wolf3d
%dir %{_datadir}/wolf3d/registered-apogee
%files shareware
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-shareware
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-shareware.6*
%{_datadir}/applications/%{name}-shareware.desktop
%{_datadir}/pixmaps/%{name}.xpm
%files spear
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear.6*
%{_datadir}/applications/%{name}-spear.desktop
%{_datadir}/pixmaps/%{name}.xpm
%dir %{_datadir}/spear
%dir %{_datadir}/spear/full
%files spear-demo
%defattr(-,root,root,-)
%doc doc/*
%{_bindir}/%{name}-spear-demo
%{_mandir}/man6/%{name}.6*
%{_mandir}/man6/%{name}-spear-demo.6*
%{_datadir}/applications/%{name}-spear-demo.desktop
%{_datadir}/pixmaps/%{name}.xpm
%changelog
* Mon Dec 27 2010 Hans de Goede <hdegoede(a)redhat.com> 1.6-1
- Initial rpmfusion package
--- NEW FILE wolf4sdl.xpm ---
/* XPM */
static char * wolf4sdl_xpm[] = {
"32 32 83 1",
" c None",
". c #462E2E",
"+ c #5D4617",
"@ c #A25D00",
"# c #D15D00",
"$ c #E87400",
"% c #B95D00",
"& c #8B4600",
"* c #A25D17",
"= c #46462E",
"- c #744617",
"; c #8B4617",
"> c #5D462E",
", c #A24600",
"' c #FF7400",
") c #74462E",
"! c #2E2E2E",
"~ c #8B5D2E",
"{ c #8B462E",
"] c #5D2E17",
"^ c #A25D2E",
"/ c #171717",
"( c #B97446",
"_ c #D18B5D",
": c #B9742E",
"< c #A25D46",
"[ c #8B5D17",
"} c #8B5D46",
"| c #000000",
"1 c #2E2E46",
"2 c #A27446",
"3 c #D17446",
"4 c #E8A274",
"5 c #FFB98B",
"6 c #FFA274",
"7 c #E88B5D",
"8 c #745D2E",
"9 c #B95D17",
"0 c #5D2E00",
"a c #E8A25D",
"b c #B98B5D",
"c c #74745D",
"d c #FFB9A2",
"e c #B9A2A2",
"f c #5D4646",
"g c #745D46",
"h c #8B7446",
"i c #A28B74",
"j c #B98B8B",
"k c #8B5D5D",
"l c #5D5D5D",
"m c #744646",
"n c #2E2E17",
"o c #46465D",
"p c #745D74",
"q c #B9745D",
"r c #B95D2E",
"s c #8B8B8B",
"t c #1717A2",
"u c #2E2E8B",
"v c #A20000",
"w c #17178B",
"x c #2E2ED1",
"y c #8B74E8",
"z c #E8B9A2",
"A c #E8A28B",
"B c #E8B98B",
"C c #E8A2A2",
"D c #E8D1B9",
"E c #FFD1B9",
"F c #D18B46",
"G c #FFA28B",
"H c #B9A28B",
"I c #B98B74",
"J c #B9B9A2",
"K c #D1B9A2",
"L c #E8D1D1",
"M c #E8E8E8",
"N c #FFE8E8",
"O c #FFD1A2",
"P c #462E17",
"Q c #D1A274",
"R c #464617",
" .+@####$##$$$$$#%+ ",
" +&@%%%######$$$$#*+= ",
" =-@@@@@%%%%%%#$$$$#;> ",
" +;@@&&&,@@@*@##$''#*) ",
" !&@@,)++)~@;))@%$'$@@; ",
" !&,;{)+++>,-+]+%##%{;- ",
" !+&;~^^^~;;;)))*%@;~;+/ ",
" =/+;;~(___:<^~~)[@*~}~]| ",
" 1/))~2345567_328~**(390| ",
" !)~}(3a6555673<((b672>| ",
" !)~<2c345d56a3(3:2e6(>/ ",
" =;^<~fghij473~)}gki4:~>! ",
" ~*^2~>!1lm((^+n1opq_rr2/ ",
" f<~<3_stumv~}~~~wxyd5(2(/= ",
" ~~2_6zzzA774BBBCzDEdb^~/1 ",
" ~~(F7555G7a5d5555555_(}/ ",
" 8~(3F6664F74AA6556aa_(~! ",
" )~(F_7777(F__F7464_7F28 ",
" )(76F(3_______((366_} ",
" )(767HIFFFFFFFzA755qg ",
" n~_77eJKKzzzzzEBa55}= ",
" |)3_7HKLLMMMMNOB4d5)n ",
" |)(_6745OEEEEE46d55)! ",
" |]^365667__7a65d576)! ",
" |P)~_655647a65d56_a)! ",
" /P)+<_Q44_F_444Q_34)! ",
" !>)R)~2((^~^(3(<2F6g. ",
" =>)++++++)))~~^(_66c ",
" >)+)))~2^<222_4557k ",
" >))~^<(_3__F(7Gd5_c ",
" >))~2(_a7464_7654(g ",
" >)~^<(75765d6746_<f "};
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jan 2011 12:05:06 -0000 1.1
+++ .cvsignore 9 Jan 2011 12:47:32 -0000 1.2
@@ -0,0 +1 @@
+Wolf4SDL-1.6-src.zip
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/wolf4sdl/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jan 2011 12:05:06 -0000 1.1
+++ sources 9 Jan 2011 12:47:32 -0000 1.2
@@ -0,0 +1 @@
+8195dbb793b55bbc6ff3db30bbb87689 Wolf4SDL-1.6-src.zip
14 years, 1 month
rpms/wolf3d-shareware/devel .cvsignore, NONE, 1.1 Makefile, NONE, 1.1 sources, NONE, 1.1
by Nicolas Chauvet
Author: kwizart
Update of /cvs/nonfree/rpms/wolf3d-shareware/devel
In directory se02.es.rpmfusion.net:/home/rpmfusion/kwizart/nonfree/owners/tmpcvss32358/rpms/wolf3d-shareware/devel
Added Files:
.cvsignore Makefile sources
Log Message:
Setup of module wolf3d-shareware
--- NEW FILE .cvsignore ---
--- NEW FILE Makefile ---
# Makefile for source rpm: wolf3d-shareware
# $Id: Makefile,v 1.1 2011/01/09 12:09:18 kwizart Exp $
NAME := wolf3d-shareware
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)
--- NEW FILE sources ---
14 years, 1 month
rpms/wolf3d-shareware Makefile, NONE, 1.1 import.log, NONE, 1.1 pkg.acl, NONE, 1.1
by Nicolas Chauvet
Author: kwizart
Update of /cvs/nonfree/rpms/wolf3d-shareware
In directory se02.es.rpmfusion.net:/home/rpmfusion/kwizart/nonfree/owners/tmpcvss32358/rpms/wolf3d-shareware
Added Files:
Makefile import.log pkg.acl
Log Message:
Setup of module wolf3d-shareware
--- NEW FILE Makefile ---
# Top level Makefile for module wolf3d-shareware
all : CVS/Root common-update
@cvs update
common-update : common
@cd common && cvs update
common : CVS/Root
@cvs checkout common
CVS/Root :
@echo "ERROR: This does not look like a CVS checkout" && exit 1
clean :
@find . -type f -name *~ -exec rm -fv {} \;
--- NEW FILE import.log ---
--- NEW FILE pkg.acl ---
14 years, 1 month
rpms/wolf3d-shareware/devel - New directory
by Nicolas Chauvet
Author: kwizart
Update of /cvs/nonfree/rpms/wolf3d-shareware/devel
In directory se02.es.rpmfusion.net:/home/rpmfusion/kwizart/nonfree/owners/tmpcvss32358/rpms/wolf3d-shareware/devel
Log Message:
Directory /cvs/nonfree/rpms/wolf3d-shareware/devel added to the repository
14 years, 1 month