1)patched teleport bug; 2)waveout sound

git-svn-id: svn://kolibrios.org@342 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-02-13 04:00:47 +00:00
parent 579829b9f9
commit 3ea0750ebe
12 changed files with 2701 additions and 2665 deletions

View File

@ -1120,8 +1120,8 @@ void D_DoomMain (void)
printf ("D_CheckNetGame: Checking network game status.\n\r");
D_CheckNetGame ();
// printf ("S_Init: Setting up sound.\n\r");
// S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
printf ("S_Init: Setting up sound.\n\r");
S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
printf ("HU_Init: Setting up heads up display.\n\r");
HU_Init ();

View File

@ -23,7 +23,7 @@
#ifndef __R_DEFS__
#define __R_DEFS__
#include "doomtype.h"
// Screenwidth.
#include "doomdef.h"

View File

@ -48,6 +48,8 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
#include "doomdef.h"
#include "kolibri.h"
// The number of internal mixing channels,
// the samples calculated for each mixing step,
// the size of the 16bit, 2 hardware channel (stereo)
@ -55,7 +57,7 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
// Needed for calling the actual sound output.
#define SAMPLECOUNT 512
#define SAMPLECOUNT 8192
#define NUM_CHANNELS 16
// It is 2 for 16bit, and 2 for two channels.
#define BUFMUL 4
@ -332,8 +334,8 @@ void I_SetChannels()
channels[i] = 0;
}
// for (i=-128 ; i<128 ; i++)
// steptablemid[i] = (int)(pow(2.0, (i/64.0))*65536.0);
for (i=-128 ; i<128 ; i++)
steptablemid[i] = (int)(pow(2.0, (i/64.0))*65536.0);
// Generates volume lookup tables
// which also turn the unsigned samples
@ -423,6 +425,10 @@ int I_SoundIsPlaying(int handle)
//
// This function currently supports only 16bit.
//
extern DWORD hMixBuff[4];
extern int mix_ptr;
void I_UpdateSound( void )
{
@ -441,6 +447,9 @@ void I_UpdateSound( void )
// Mixing channel index.
int chan;
int i;
int flags;
flags = 0;
// Left and right channel
// are in global mixbuffer, alternating.
@ -455,7 +464,7 @@ void I_UpdateSound( void )
// Mix sounds into the mixing buffer.
// Loop over step*SAMPLECOUNT,
// that is 512 values for two channels.
while (leftout != leftend)
for (i=0; i < 8192; i++)
{
// Reset left/right value.
dl = 0;
@ -469,6 +478,8 @@ void I_UpdateSound( void )
// Check channel, if active.
if (channels[ chan ])
{
flags=1;
// Get the raw data from the channel.
sample = *channels[ chan ];
// Add left and right part
@ -515,7 +526,10 @@ void I_UpdateSound( void )
leftout += step;
rightout += step;
}
// I_SubmitSound(mixbuffer);
if(flags)
{ WaveOut(hMixBuff[mix_ptr],(char*)&mixbuffer[0],32768);
mix_ptr= (mix_ptr+1)&3;
};
}

View File

@ -99,7 +99,7 @@ int I_GetTime (void)
void I_Init (void)
{
I_InitGraphics();
// I_InitSound();
I_InitSound();
}
//

View File

@ -27,6 +27,7 @@ rcsid[] = "$Id: p_map.c,v 1.5 1997/02/03 22:45:11 b1 Exp $";
#include <stdlib.h>
#include "doomtype.h"
#include "m_bbox.h"
#include "m_random.h"
#include "i_system.h"

View File

@ -25,7 +25,7 @@ static const char
rcsid[] = "$Id: p_telept.c,v 1.3 1997/01/28 22:08:29 b1 Exp $";
#include "doomtype.h"
#include "doomdef.h"
#include "s_sound.h"

View File

@ -27,7 +27,7 @@
static const char
rcsid[] = "$Id: r_draw.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
#include "doomtype.h"
#include "doomdef.h"
#include "i_system.h"

View File

@ -29,6 +29,7 @@ rcsid[] = "$Id: r_things.c,v 1.5 1997/02/03 16:47:56 b1 Exp $";
#include <stdio.h>
#include <stdlib.h>
#include "doomtype.h"
#include "doomdef.h"
#include "m_swap.h"
@ -432,7 +433,12 @@ R_DrawVisSprite
texturecolumn = frac>>FRACBITS;
#ifdef RANGECHECK
if (texturecolumn < 0 || texturecolumn >= SHORT(patch->width))
I_Error ("R_DrawSpriteRange: bad texturecolumn");
{
// I_Error ("R_DrawSpriteRange: bad texturecolumn");
printf( "texturecolumn= %d, width= %d\n\r",
texturecolumn,patch->width);
texturecolumn=patch->width-1;
}
#endif
column = (column_t *) ((byte *)patch +
LONG(patch->columnofs[texturecolumn]));

View File

@ -45,6 +45,9 @@ rcsid[] = "$Id: s_sound.c,v 1.6 1997/02/03 22:45:12 b1 Exp $";
//#include "qmus2mid.h"
#include "kolibri.h"
void WriteDebug(char *);
// Purpose?
@ -112,10 +115,10 @@ static channel_t* channels;
// These are not used, but should be (menu).
// Maximum volume of a sound effect.
// Internal default is max out of 0-15.
int snd_SfxVolume = 80;
int snd_SfxVolume = 15;
// Maximum volume of music. Useless so far.
int snd_MusicVolume = 80;
int snd_MusicVolume = 15;
@ -161,6 +164,10 @@ void S_StopChannel(int cnum);
// Sets channels, SFX and music volume,
// allocates channel buffer, sets S_sfx lookup.
//
DWORD hMixBuff[4];
int mix_ptr;
void S_Init
( int sfxVolume,
int musicVolume )
@ -169,7 +176,13 @@ void S_Init
printf("S_Init: default sfx volume %d\n", sfxVolume);
//I_CreateSound();
InitSound();
hMixBuff[0]= CreateBuffer(15);
hMixBuff[1]= CreateBuffer(15);
hMixBuff[2]= CreateBuffer(15);
hMixBuff[3]= CreateBuffer(15);
numChannels = NUM_CHANNELS;
// Whatever these did with DMX, these are rather dummies now.

View File

@ -152,6 +152,8 @@ void W_AddFile (char *filename)
reloadlump = numlumps;
}
printf("open file %s\n\r",filename);
if ( (handle = fopen (filename,"rb")) == NULL)
{
printf (" couldn't open %s\n",filename);