Commit 4c8935b5 authored by Steven Fuller's avatar Steven Fuller

I forget.. (has been several days since last checkin; nothing signifigant)

parent 2d34f001
CC = gcc CC = gcc
#CC = g++
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro #CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall #CFLAGS = -g -Wall
......
...@@ -83,3 +83,8 @@ draw loop.. start by cp wl_draw.c vi_ogl.c and just take out the actual ...@@ -83,3 +83,8 @@ draw loop.. start by cp wl_draw.c vi_ogl.c and just take out the actual
drawing bits and replace with opengl. drawing bits and replace with opengl.
* rename visable to visible * rename visable to visible
* fix up windows port * fix up windows port
* create 'sound channels' with priority.. ie a door can only make one sound
at a time
* beos is c++ (and uses gcc as a compiler i think) but wolf3d will need many
cleanups for c++
either that or use extern "C" { ... } in the header files
...@@ -73,7 +73,7 @@ void SavePCX256ToFile(unsigned char *buf, int width, int height, unsigned char * ...@@ -73,7 +73,7 @@ void SavePCX256ToFile(unsigned char *buf, int width, int height, unsigned char *
} }
#endif #endif
fp = fopen(name, "w"); fp = fopen(name, "wb");
fwrite(&ph, sizeof(ph), 1, fp); fwrite(&ph, sizeof(ph), 1, fp);
fwrite(dat, 1, z, fp); fwrite(dat, 1, z, fp);
fputc(12, fp); fputc(12, fp);
...@@ -115,7 +115,7 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name) ...@@ -115,7 +115,7 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name)
} }
} }
fp = fopen(name, "w"); fp = fopen(name, "wb");
fwrite(&ph, sizeof(ph), 1, fp); fwrite(&ph, sizeof(ph), 1, fp);
fwrite(dat, 1, width * height * 2 * 3, fp); fwrite(dat, 1, width * height * 2 * 3, fp);
fclose(fp); fclose(fp);
......
...@@ -179,9 +179,9 @@ boolean CA_ReadFile(char *filename, memptr *ptr) ...@@ -179,9 +179,9 @@ boolean CA_ReadFile(char *filename, memptr *ptr)
if ((handle = open(filename, O_RDONLY | O_BINARY, S_IREAD)) == -1) if ((handle = open(filename, O_RDONLY | O_BINARY, S_IREAD)) == -1)
return false; return false;
size = filelength(handle); size = filelength(handle);
if (!CA_FarRead (handle, *ptr, size)) {
if (!CA_FarRead(handle, *ptr, size)) {
close(handle); close(handle);
return false; return false;
} }
......
...@@ -13,9 +13,13 @@ ...@@ -13,9 +13,13 @@
#include <io.h> #include <io.h>
#include <dos.h> #include <dos.h>
#ifdef __cplusplus
typedef bool boolean;
#else
#define boolean BOOLEAN #define boolean BOOLEAN
#define false FALSE #define false FALSE
#define true TRUE #define true TRUE
#endif
#define PACKED #define PACKED
#pragma pack(1) /* TODO: this unfortunately packs every struct... */ #pragma pack(1) /* TODO: this unfortunately packs every struct... */
...@@ -34,7 +38,12 @@ ...@@ -34,7 +38,12 @@
#define LONGLONG long long #define LONGLONG long long
#define O_BINARY 0 #define O_BINARY 0
typedef enum {false,true} boolean;
#ifdef __cplusplus
typedef bool boolean;
#else
typedef enum {false,true} boolean;
#endif
#endif #endif
......
...@@ -63,7 +63,7 @@ void Quit(char *error) ...@@ -63,7 +63,7 @@ void Quit(char *error)
} }
if (error && *error) { if (error && *error) {
fprintf(stderr, "Quit: %s", error); fprintf(stderr, "Quit: %s\n", error);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
......
...@@ -36,7 +36,7 @@ void Quit(char *error) ...@@ -36,7 +36,7 @@ void Quit(char *error)
} }
if (error && *error) { if (error && *error) {
fprintf(stderr, "Quit: %s", error); fprintf(stderr, "Quit: %s\n", error);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
......
...@@ -76,7 +76,7 @@ void Quit(char *error) ...@@ -76,7 +76,7 @@ void Quit(char *error)
} }
if (error && *error) { if (error && *error) {
fprintf(stderr, "Quit: %s", error); fprintf(stderr, "Quit: %s\n", error);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
......
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