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

@ -436,7 +436,7 @@ void D_DoomLoop (void)
S_UpdateSounds (players[consoleplayer].mo);// move positional sounds S_UpdateSounds (players[consoleplayer].mo);// move positional sounds
D_Display (); D_Display ();
// I_UpdateSound(); // I_UpdateSound();
XXX(105); XXX(105);
} }
} }
@ -1120,8 +1120,8 @@ void D_DoomMain (void)
printf ("D_CheckNetGame: Checking network game status.\n\r"); printf ("D_CheckNetGame: Checking network game status.\n\r");
D_CheckNetGame (); D_CheckNetGame ();
// printf ("S_Init: Setting up sound.\n\r"); printf ("S_Init: Setting up sound.\n\r");
// S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ ); S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
printf ("HU_Init: Setting up heads up display.\n\r"); printf ("HU_Init: Setting up heads up display.\n\r");
HU_Init (); HU_Init ();

View File

@ -42,25 +42,25 @@
// to provide a complete scene geometry description. // to provide a complete scene geometry description.
enum enum
{ {
ML_LABEL, // A separator, name, ExMx or MAPxx ML_LABEL, // A separator, name, ExMx or MAPxx
ML_THINGS, // Monsters, items.. ML_THINGS, // Monsters, items..
ML_LINEDEFS, // LineDefs, from editing ML_LINEDEFS, // LineDefs, from editing
ML_SIDEDEFS, // SideDefs, from editing ML_SIDEDEFS, // SideDefs, from editing
ML_VERTEXES, // Vertices, edited and BSP splits generated ML_VERTEXES, // Vertices, edited and BSP splits generated
ML_SEGS, // LineSegs, from LineDefs split by BSP ML_SEGS, // LineSegs, from LineDefs split by BSP
ML_SSECTORS, // SubSectors, list of LineSegs ML_SSECTORS, // SubSectors, list of LineSegs
ML_NODES, // BSP nodes ML_NODES, // BSP nodes
ML_SECTORS, // Sectors, from editing ML_SECTORS, // Sectors, from editing
ML_REJECT, // LUT, sector-sector visibility ML_REJECT, // LUT, sector-sector visibility
ML_BLOCKMAP // LUT, motion clipping, walls/grid element ML_BLOCKMAP // LUT, motion clipping, walls/grid element
}; };
// A single Vertex. // A single Vertex.
typedef struct typedef struct
{ {
short x; short x;
short y; short y;
} mapvertex_t; } mapvertex_t;
@ -68,13 +68,13 @@ typedef struct
// by setting textures and offsets. // by setting textures and offsets.
typedef struct typedef struct
{ {
short textureoffset; short textureoffset;
short rowoffset; short rowoffset;
char toptexture[8]; char toptexture[8];
char bottomtexture[8]; char bottomtexture[8];
char midtexture[8]; char midtexture[8];
// Front sector, towards viewer. // Front sector, towards viewer.
short sector; short sector;
} mapsidedef_t; } mapsidedef_t;
@ -83,13 +83,13 @@ typedef struct
// to the BSP builder. // to the BSP builder.
typedef struct typedef struct
{ {
short v1; short v1;
short v2; short v2;
short flags; short flags;
short special; short special;
short tag; short tag;
// sidenum[1] will be -1 if one sided // sidenum[1] will be -1 if one sided
short sidenum[2]; short sidenum[2];
} maplinedef_t; } maplinedef_t;
@ -98,14 +98,14 @@ typedef struct
// //
// Solid, is an obstacle. // Solid, is an obstacle.
#define ML_BLOCKING 1 #define ML_BLOCKING 1
// Blocks monsters only. // Blocks monsters only.
#define ML_BLOCKMONSTERS 2 #define ML_BLOCKMONSTERS 2
// Backside will not be present at all // Backside will not be present at all
// if not two sided. // if not two sided.
#define ML_TWOSIDED 4 #define ML_TWOSIDED 4
// If a texture is pegged, the texture will have // If a texture is pegged, the texture will have
// the end exposed to air held constant at the // the end exposed to air held constant at the
@ -117,44 +117,44 @@ typedef struct
// top and bottom textures (use next to windows). // top and bottom textures (use next to windows).
// upper texture unpegged // upper texture unpegged
#define ML_DONTPEGTOP 8 #define ML_DONTPEGTOP 8
// lower texture unpegged // lower texture unpegged
#define ML_DONTPEGBOTTOM 16 #define ML_DONTPEGBOTTOM 16
// In AutoMap: don't map as two sided: IT'S A SECRET! // In AutoMap: don't map as two sided: IT'S A SECRET!
#define ML_SECRET 32 #define ML_SECRET 32
// Sound rendering: don't let sound cross two of these. // Sound rendering: don't let sound cross two of these.
#define ML_SOUNDBLOCK 64 #define ML_SOUNDBLOCK 64
// Don't draw on the automap at all. // Don't draw on the automap at all.
#define ML_DONTDRAW 128 #define ML_DONTDRAW 128
// Set if already seen, thus drawn in automap. // Set if already seen, thus drawn in automap.
#define ML_MAPPED 256 #define ML_MAPPED 256
// Sector definition, from editing. // Sector definition, from editing.
typedef struct typedef struct
{ {
short floorheight; short floorheight;
short ceilingheight; short ceilingheight;
char floorpic[8]; char floorpic[8];
char ceilingpic[8]; char ceilingpic[8];
short lightlevel; short lightlevel;
short special; short special;
short tag; short tag;
} mapsector_t; } mapsector_t;
// SubSector, as generated by BSP. // SubSector, as generated by BSP.
typedef struct typedef struct
{ {
short numsegs; short numsegs;
// Index of first one, segs are stored sequentially. // Index of first one, segs are stored sequentially.
short firstseg; short firstseg;
} mapsubsector_t; } mapsubsector_t;
@ -162,12 +162,12 @@ typedef struct
// using partition lines selected by BSP builder. // using partition lines selected by BSP builder.
typedef struct typedef struct
{ {
short v1; short v1;
short v2; short v2;
short angle; short angle;
short linedef; short linedef;
short side; short side;
short offset; short offset;
} mapseg_t; } mapseg_t;
@ -175,23 +175,23 @@ typedef struct
// BSP node structure. // BSP node structure.
// Indicate a leaf. // Indicate a leaf.
#define NF_SUBSECTOR 0x8000 #define NF_SUBSECTOR 0x8000
typedef struct typedef struct
{ {
// Partition line from (x,y) to x+dx,y+dy) // Partition line from (x,y) to x+dx,y+dy)
short x; short x;
short y; short y;
short dx; short dx;
short dy; short dy;
// Bounding box for each child, // Bounding box for each child,
// clip against view frustum. // clip against view frustum.
short bbox[2][4]; short bbox[2][4];
// If NF_SUBSECTOR its a subsector, // If NF_SUBSECTOR its a subsector,
// else it's a node of another subtree. // else it's a node of another subtree.
unsigned short children[2]; unsigned short children[2];
} mapnode_t; } mapnode_t;
@ -202,18 +202,18 @@ typedef struct
// plus skill/visibility flags and attributes. // plus skill/visibility flags and attributes.
typedef struct typedef struct
{ {
short x; short x;
short y; short y;
short angle; short angle;
short type; short type;
short options; short options;
} mapthing_t; } mapthing_t;
#endif // __DOOMDATA__ #endif // __DOOMDATA__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log:$ // $Log:$

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -17,7 +17,7 @@
// $Log:$ // $Log:$
// //
// DESCRIPTION: // DESCRIPTION:
// Fixed point implementation. // Fixed point implementation.
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -42,8 +42,8 @@ rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
fixed_t fixed_t
FixedMul FixedMul
( fixed_t a, ( fixed_t a,
fixed_t b ) fixed_t b )
{ {
return ((long long) a * (long long) b) >> FRACBITS; return ((long long) a * (long long) b) >> FRACBITS;
} }
@ -56,11 +56,11 @@ FixedMul
fixed_t fixed_t
FixedDiv FixedDiv
( fixed_t a, ( fixed_t a,
fixed_t b ) fixed_t b )
{ {
if ( (abs(a)>>14) >= abs(b)) if ( (abs(a)>>14) >= abs(b))
return (a^b)<0 ? MININT : MAXINT; return (a^b)<0 ? MININT : MAXINT;
return FixedDiv2 (a,b); return FixedDiv2 (a,b);
} }
@ -68,8 +68,8 @@ FixedDiv
fixed_t fixed_t
FixedDiv2 FixedDiv2
( fixed_t a, ( fixed_t a,
fixed_t b ) fixed_t b )
{ {
#if 0 #if 0
long long c; long long c;
@ -82,6 +82,6 @@ FixedDiv2
c = ((double)a) / ((double)b) * FRACUNIT; c = ((double)a) / ((double)b) * FRACUNIT;
if (c >= 2147483648.0 || c < -2147483648.0) if (c >= 2147483648.0 || c < -2147483648.0)
I_Error("FixedDiv: divide by zero"); I_Error("FixedDiv: divide by zero");
return (fixed_t) c; return (fixed_t) c;
} }

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
// $Log:$ // $Log:$
// //
// DESCRIPTION: // DESCRIPTION:
// Teleportation. // Teleportation.
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -25,7 +25,7 @@ static const char
rcsid[] = "$Id: p_telept.c,v 1.3 1997/01/28 22:08:29 b1 Exp $"; rcsid[] = "$Id: p_telept.c,v 1.3 1997/01/28 22:08:29 b1 Exp $";
#include "doomtype.h"
#include "doomdef.h" #include "doomdef.h"
#include "s_sound.h" #include "s_sound.h"
@ -46,86 +46,86 @@ rcsid[] = "$Id: p_telept.c,v 1.3 1997/01/28 22:08:29 b1 Exp $";
// //
int int
EV_Teleport EV_Teleport
( line_t* line, ( line_t* line,
int side, int side,
mobj_t* thing ) mobj_t* thing )
{ {
int i; int i;
int tag; int tag;
mobj_t* m; mobj_t* m;
mobj_t* fog; mobj_t* fog;
unsigned an; unsigned an;
thinker_t* thinker; thinker_t* thinker;
sector_t* sector; sector_t* sector;
fixed_t oldx; fixed_t oldx;
fixed_t oldy; fixed_t oldy;
fixed_t oldz; fixed_t oldz;
// don't teleport missiles // don't teleport missiles
if (thing->flags & MF_MISSILE) if (thing->flags & MF_MISSILE)
return 0; return 0;
// Don't teleport if hit back of line, // Don't teleport if hit back of line,
// so you can get out of teleporter. // so you can get out of teleporter.
if (side == 1) if (side == 1)
return 0; return 0;
tag = line->tag; tag = line->tag;
for (i = 0; i < numsectors; i++) for (i = 0; i < numsectors; i++)
{ {
if (sectors[ i ].tag == tag ) if (sectors[ i ].tag == tag )
{ {
thinker = thinkercap.next; thinker = thinkercap.next;
for (thinker = thinkercap.next; for (thinker = thinkercap.next;
thinker != &thinkercap; thinker != &thinkercap;
thinker = thinker->next) thinker = thinker->next)
{ {
// not a mobj // not a mobj
if (thinker->function.acp1 != (actionf_p1)P_MobjThinker) if (thinker->function.acp1 != (actionf_p1)P_MobjThinker)
continue; continue;
m = (mobj_t *)thinker; m = (mobj_t *)thinker;
// not a teleportman // not a teleportman
if (m->type != MT_TELEPORTMAN ) if (m->type != MT_TELEPORTMAN )
continue; continue;
sector = m->subsector->sector; sector = m->subsector->sector;
// wrong sector // wrong sector
if (sector-sectors != i ) if (sector-sectors != i )
continue; continue;
oldx = thing->x; oldx = thing->x;
oldy = thing->y; oldy = thing->y;
oldz = thing->z; oldz = thing->z;
if (!P_TeleportMove (thing, m->x, m->y)) if (!P_TeleportMove (thing, m->x, m->y))
return 0; return 0;
thing->z = thing->floorz; //fixme: not needed? thing->z = thing->floorz; //fixme: not needed?
if (thing->player) if (thing->player)
thing->player->viewz = thing->z+thing->player->viewheight; thing->player->viewz = thing->z+thing->player->viewheight;
// spawn teleport fog at source and destination // spawn teleport fog at source and destination
fog = P_SpawnMobj (oldx, oldy, oldz, MT_TFOG); fog = P_SpawnMobj (oldx, oldy, oldz, MT_TFOG);
S_StartSound (fog, sfx_telept); S_StartSound (fog, sfx_telept);
an = m->angle >> ANGLETOFINESHIFT; an = m->angle >> ANGLETOFINESHIFT;
fog = P_SpawnMobj (m->x+20*finecosine[an], m->y+20*finesine[an] fog = P_SpawnMobj (m->x+20*finecosine[an], m->y+20*finesine[an]
, thing->z, MT_TFOG); , thing->z, MT_TFOG);
// emit sound, where? // emit sound, where?
S_StartSound (fog, sfx_telept); S_StartSound (fog, sfx_telept);
// don't move for a bit // don't move for a bit
if (thing->player) if (thing->player)
thing->reactiontime = 18; thing->reactiontime = 18;
thing->angle = m->angle; thing->angle = m->angle;
thing->momx = thing->momy = thing->momz = 0; thing->momx = thing->momy = thing->momz = 0;
return 1; return 1;
} }
} }
} }
return 0; return 0;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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 "qmus2mid.h"
#include "kolibri.h"
void WriteDebug(char *); void WriteDebug(char *);
// Purpose? // Purpose?
@ -112,10 +115,10 @@ static channel_t* channels;
// These are not used, but should be (menu). // These are not used, but should be (menu).
// Maximum volume of a sound effect. // Maximum volume of a sound effect.
// Internal default is max out of 0-15. // Internal default is max out of 0-15.
int snd_SfxVolume = 80; int snd_SfxVolume = 15;
// Maximum volume of music. Useless so far. // 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, // Sets channels, SFX and music volume,
// allocates channel buffer, sets S_sfx lookup. // allocates channel buffer, sets S_sfx lookup.
// //
DWORD hMixBuff[4];
int mix_ptr;
void S_Init void S_Init
( int sfxVolume, ( int sfxVolume,
int musicVolume ) int musicVolume )
@ -169,7 +176,13 @@ void S_Init
printf("S_Init: default sfx volume %d\n", sfxVolume); 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; numChannels = NUM_CHANNELS;
// Whatever these did with DMX, these are rather dummies now. // Whatever these did with DMX, these are rather dummies now.

View File

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