Commit 7289833d authored by Steven Fuller's avatar Steven Fuller

No idea...

Although sounds sound correct in openal now...
parent 88291afa
...@@ -5,19 +5,19 @@ CC = gcc ...@@ -5,19 +5,19 @@ CC = gcc
#CFLAGS = -g -Wall #CFLAGS = -g -Wall
CFLAGS = -g CFLAGS = -g
#CFLAGS = -Os #CFLAGS = -Os
#CFLAGS = -g -Wall -I/home/relnev/cvs/oal/include CFLAGS = -g -Wall -I/home/relnev/cvs/oal/include
OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_act1.o wl_act2.o wl_agent.o wl_game.o \ wl_act1.o wl_act2.o wl_agent.o wl_game.o \
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \ wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o gfxsave.o sd_null.o # sd_oal.o # sd_null.o wl_debug.o gfxsave.o sd_oal.o # sd_null.o
ROBJS = wl_draw.o wl_scale.o ROBJS = wl_draw.o wl_scale.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
GOBJS = $(OBJS) vi_ogl.o vi_glx.o GOBJS = $(OBJS) vi_ogl.o vi_glx.o
#LFLAGS = -lm #LFLAGS = -lm
LFLAGS = -lm -L/home/relnev/cvs/oal/linux/src -lopenal -lpthread -ldl LFLAGS = -lm /home/relnev/cvs/oal/linux/src/libopenal.a -lpthread -ldl
SLFLAGS = $(LFLAGS) -lvga SLFLAGS = $(LFLAGS) -lvga
XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga
......
...@@ -90,6 +90,13 @@ either that or use extern "C" { ... } in the header files ...@@ -90,6 +90,13 @@ either that or use extern "C" { ... } in the header files
wall drawing is done, just needed to fix sprite code wall drawing is done, just needed to fix sprite code
* check in wolftools and add mac wolftools (currently the res dumping stuff) * check in wolftools and add mac wolftools (currently the res dumping stuff)
* have vi_xlib.c compile without the extensions * have vi_xlib.c compile without the extensions
* cat file.c | perl -e 'while($in = <STDIN>)
{$in =~ s/\/\/(.*)$/\/\* \1\ *\//gm;print $in;}'
or
cat foo.txt |sed -e "s/\/\/\(.*\)$/\/\*\1\*\//g"
* oal version locks up at end of level (hit switch but before the ratios)
the api is a bit unstable at the moment so wait for 1.0 of linux version to
be released before fixing it, although that lame sampling bug got fixed
Things to try: Things to try:
* Any speed gain with comparing values in screen before writing? * Any speed gain with comparing values in screen before writing?
......
...@@ -145,9 +145,9 @@ void SD_Startup(void) ...@@ -145,9 +145,9 @@ void SD_Startup(void)
} }
buffers = (ALuint *)malloc(sizeof(ALuint) * x); buffers = (ALuint *)malloc(sizeof(ALuint) * x);
if (alGenBuffers(x, buffers) != x) //if (alGenBuffers(x, buffers) != x)
printf("OpenAL buffer allocation problem\n"); // printf("OpenAL buffer allocation problem\n");
alGenBuffers(x, buffers);
x = 0; x = 0;
for (i = 0; i < p / 2; i += 2) { for (i = 0; i < p / 2; i += 2) {
...@@ -174,9 +174,7 @@ void SD_Startup(void) ...@@ -174,9 +174,7 @@ void SD_Startup(void)
memcpy(dat+z, PM_GetPage(w + PMSoundStart), page->length); memcpy(dat+z, PM_GetPage(w + PMSoundStart), page->length);
z += page->length; z += page->length;
} }
/* TODO: openal bug! */ alBufferData(buffers[x], AL_FORMAT_MONO8, dat, y, 6896);
//alBufferData(buffers[x], AL_FORMAT_MONO8, dat, y, 6896);
alBufferData(buffers[x], AL_FORMAT_MONO8, dat, y, 22050/4);
if(alGetError() != AL_NO_ERROR) { if(alGetError() != AL_NO_ERROR) {
printf("AL error\n"); printf("AL error\n");
...@@ -232,8 +230,9 @@ void SD_PlaySound(soundnames sound) ...@@ -232,8 +230,9 @@ void SD_PlaySound(soundnames sound)
if (DigiMap[sound] != -1) { if (DigiMap[sound] != -1) {
/* TODO: openal bug? (need to stop before play) */ /* TODO: openal bug? (need to stop before play) */
/* what is there to replayce SourceIsPlaying (was removed from AL)? */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (alSourceIsPlaying(sources[i]) == AL_FALSE) { /* if (alSourceIsPlaying(sources[i]) == AL_FALSE) */ {
//alSourceStop(*sources); //alSourceStop(*sources);
alSourcefv(sources[i], AL_POSITION, gval); alSourcefv(sources[i], AL_POSITION, gval);
alSource3f(sources[i], AL_DIRECTION, -pval[0], 0.0f, -pval[2]); alSource3f(sources[i], AL_DIRECTION, -pval[0], 0.0f, -pval[2]);
...@@ -273,7 +272,7 @@ void PlaySoundLocGlobal(word sound, fixed x, fixed y) ...@@ -273,7 +272,7 @@ void PlaySoundLocGlobal(word sound, fixed x, fixed y)
if (DigiMap[sound] != -1) { if (DigiMap[sound] != -1) {
/* TODO: openal bug? (need to stop before play) */ /* TODO: openal bug? (need to stop before play) */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (alSourceIsPlaying(sources[i]) == AL_FALSE) { /* if (alSourceIsPlaying(sources[i]) == AL_FALSE) */ {
//alSourceStop(*sources); //alSourceStop(*sources);
val[0] = x >> 15; val[0] = x >> 15;
val[1] = 0.0f; val[1] = 0.0f;
...@@ -300,10 +299,10 @@ word SD_SoundPlaying(void) ...@@ -300,10 +299,10 @@ word SD_SoundPlaying(void)
/* Watch out for any looped sounds */ /* Watch out for any looped sounds */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (alSourceIsPlaying(sources[i]) == AL_TRUE) { /* if (alSourceIsPlaying(sources[i]) == AL_TRUE) */ {
ALint ret; ALint ret;
alGetSourcei(sources[i], AL_LOOPING, &ret); alGetSourcei(sources[i], AL_SOURCE_LOOPING, &ret);
if (ret == AL_FALSE) if (ret == AL_FALSE)
return true; return true;
} }
......
...@@ -234,8 +234,6 @@ void ScalePost(byte *wall, int texture) ...@@ -234,8 +234,6 @@ void ScalePost(byte *wall, int texture)
byte *source; byte *source;
height = (wallheight [postx] & 0xfff8) >> 1; height = (wallheight [postx] & 0xfff8) >> 1;
if (height > maxscaleshl2)
height = maxscaleshl2;
source = wall+texture; source = wall+texture;
xBuildCompScale (height/2, source, postx); xBuildCompScale (height/2, source, postx);
......
...@@ -951,7 +951,7 @@ typedef struct ...@@ -951,7 +951,7 @@ typedef struct
/* table data after dataofs[rightpix-leftpix+1] */ /* table data after dataofs[rightpix-leftpix+1] */
} PACKED t_compshape; } PACKED t_compshape;
extern int maxscale,maxscaleshl2; extern int maxscale;
void SetupScaling (int maxscaleheight); void SetupScaling (int maxscaleheight);
void ScaleShape (int xcenter, int shapenum, unsigned height); void ScaleShape (int xcenter, int shapenum, unsigned height);
......
...@@ -227,31 +227,12 @@ int CalcHeight (void) ...@@ -227,31 +227,12 @@ int CalcHeight (void)
unsigned postx; unsigned postx;
#if 0
void ScalePost(byte *wall, int texture) void ScalePost(byte *wall, int texture)
{ {
int height; int height;
byte *source; byte *source;
height = (wallheight [postx] & 0xfff8) >> 1; height = (wallheight [postx] & 0xfff8) >> 1;
if (height > maxscaleshl2)
height = maxscaleshl2;
source = wall+texture;
xBuildCompScale (height/2, source, postx);
}
#endif
/* TODO: this is new ScalePost for new scaling routine */
void ScalePost(byte *wall, int texture)
{
int height;
byte *source;
height = (wallheight [postx] & 0xfff8) >> 1;
/* TODO: i can remove maxscaleshl2 now */
//if (height > maxscaleshl2)
// height = maxscaleshl2;
source = wall+texture; source = wall+texture;
xBuildCompScale (height/2, source, postx); xBuildCompScale (height/2, source, postx);
......
...@@ -22,7 +22,7 @@ typedef struct { ...@@ -22,7 +22,7 @@ typedef struct {
t_scaledata scaledata [MAXSCALEHEIGHT+1]; t_scaledata scaledata [MAXSCALEHEIGHT+1];
int maxscale,maxscaleshl2; int maxscale;
void BuildCompScale(int height) void BuildCompScale(int height)
{ {
...@@ -74,8 +74,6 @@ void SetupScaling(int maxscaleheight) ...@@ -74,8 +74,6 @@ void SetupScaling(int maxscaleheight)
int i; int i;
maxscale = maxscaleheight-1; maxscale = maxscaleheight-1;
maxscaleshl2 = maxscale<<2;
// //
// build the compiled scalers // build the compiled scalers
// //
...@@ -143,9 +141,9 @@ void xBuildCompScale(int height, byte *source, int x) ...@@ -143,9 +141,9 @@ void xBuildCompScale(int height, byte *source, int x)
#endif #endif
/* TODO: this accesses gfxbuf directly! */ /* TODO: this accesses gfxbuf directly! */
void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, unsigned long tint, unsigned long delta) static void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, unsigned long tint, unsigned long delta)
{ {
fixed OldDelta; unsigned long OldDelta;
while (scale--) { while (scale--) {
*vid = *gfx; *vid = *gfx;
...@@ -262,6 +260,8 @@ void ScaleShape(int xcenter, int shapenum, unsigned height) ...@@ -262,6 +260,8 @@ void ScaleShape(int xcenter, int shapenum, unsigned height)
shape = PM_GetSpritePage (shapenum); shape = PM_GetSpritePage (shapenum);
scale = height>>2; // low three bits are fractional scale = height>>2; // low three bits are fractional
scale += 4; /* sprites look a bit better pulled up some */
if (!scale || scale>maxscale) if (!scale || scale>maxscale)
return; // too close or far away return; // too close or far away
......
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