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
D_Display ();
// I_UpdateSound();
// I_UpdateSound();
XXX(105);
}
}
@ -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

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

View File

@ -23,7 +23,7 @@
#ifndef __R_DEFS__
#define __R_DEFS__
#include "doomtype.h"
// Screenwidth.
#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)
{
I_InitGraphics();
// I_InitSound();
I_InitSound();
}
//

View File

@ -17,7 +17,7 @@
// $Log:$
//
// 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
FixedMul
( fixed_t a,
fixed_t b )
( fixed_t a,
fixed_t b )
{
return ((long long) a * (long long) b) >> FRACBITS;
}
@ -56,11 +56,11 @@ FixedMul
fixed_t
FixedDiv
( fixed_t a,
fixed_t b )
( fixed_t a,
fixed_t b )
{
if ( (abs(a)>>14) >= abs(b))
return (a^b)<0 ? MININT : MAXINT;
return (a^b)<0 ? MININT : MAXINT;
return FixedDiv2 (a,b);
}
@ -68,8 +68,8 @@ FixedDiv
fixed_t
FixedDiv2
( fixed_t a,
fixed_t b )
( fixed_t a,
fixed_t b )
{
#if 0
long long c;
@ -82,6 +82,6 @@ FixedDiv2
c = ((double)a) / ((double)b) * FRACUNIT;
if (c >= 2147483648.0 || c < -2147483648.0)
I_Error("FixedDiv: divide by zero");
I_Error("FixedDiv: divide by zero");
return (fixed_t) c;
}

File diff suppressed because it is too large Load Diff

View File

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

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