Commit 04cd0215 authored by Steven Fuller's avatar Steven Fuller

Fixed bug with CA_LoadFile (was missing a '*' for the ptr)

misc.c: changed the fileloading routines to use explicit swapping.

rest: cosmetic
parent b124f348
* One binary, any game type.
* A key to change viewsize while playing (note: max == 20, min == 5 or so...)
* A key to change viewsize while playing
* Game able to work with any resolution in software mode
* Audio support using OpenAL
* Add support for the Mac version, if possible
* Network support!
* Fully compile with no warnings/errors using -Wall -ansi -pedantic and with
other compilers (would need to turn off warnings about unused parameters)
* Port to: Linux/SVGAlib, Unix/X (Windowed and DGA), Unix/OpenGL?,
Linux/SDL, DOS/Allegro?, Win32/GDI?, Win32/DX?, Win32/D3D?, Win32/OpenGL,
BeOS?, MacOS?, QNX?
* Port to: Linux/SVGAlib, Unix/OpenGL?, Linux/SDL, DOS/Allegro?, Win32/GDI?,
Win32/DX?, Win32/D3D?, Win32/OpenGL?, BeOS?, MacOS?, QNX?
* Ease in using demos. Playing demos from files, recording to files, batch
playing, and so on.
* Make Wolf3D the game it was originally planned to be... More strategy...
* Empty TODO File (TODO states a list of things which need to/should be done
regardless of future plans [IDEAS]) and no TODOs in the source code
* Empty TODO File
* Test with other available mods (that were compatible with the original
game)
* Unified input handling
......
......@@ -118,7 +118,7 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
size = ReadLength(handle);
MM_GetPtr(ptr, size);
l = ReadBytes(handle, (byte *)ptr, size);
l = ReadBytes(handle, (byte *)(*ptr), size);
if (l == -1) {
perror("CA_FarRead");
......
......@@ -43,7 +43,7 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
byte *origptr, *newptr;
VL_GetPalette(&palette1[0][0]);
memcpy(palette2,palette1,768);
memcpy(palette2, palette1, 768);
/* fade through intermediate frames */
for (i = 0; i < steps; i++)
......
......@@ -284,33 +284,29 @@ int ReadLength(int fp)
int8_t ReadInt8(int fp)
{
int8_t d;
byte d[1];
read(fp, &d, 1);
read(fp, d, 1);
return d;
return d[0];
}
int16_t ReadInt16(int fp)
{
int16_t d;
byte d[2];
read(fp, &d, 2);
read(fp, d, 2);
d = SwapInt16L(d);
return d;
return (d[0]) | (d[1] << 8);
}
int32_t ReadInt32(int fp)
{
int32_t d;
read(fp, &d, 4);
byte d[4];
d = SwapInt32L(d);
read(fp, d, 4);
return d;
return (d[0]) | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);
}
int ReadBytes(int fp, byte *d, int len)
......
......@@ -851,14 +851,14 @@ int PlayDemoFromFile(char *demoname)
return 0;
}
MM_SetLock(&demobuffer,true);
MM_SetLock(&demobuffer, true);
demoptr = (byte *)demobuffer;
NewGame(1,0);
gamestate.mapon = *demoptr++;
gamestate.mapon = demoptr[0];
gamestate.difficulty = gd_hard;
length = demoptr[0] | (demoptr[1] << 8);
demoptr += 3;
length = demoptr[1] | (demoptr[2] << 8);
demoptr += 4;
lastdemoptr = demoptr-4+length;
VW_FadeOut();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment