forked from KolibriOS/kolibrios
1)patched teleport bug; 2)waveout sound
git-svn-id: svn://kolibrios.org@342 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
579829b9f9
commit
3ea0750ebe
@ -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 ();
|
||||||
|
@ -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:$
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
|
|||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
|
||||||
|
#include "kolibri.h"
|
||||||
|
|
||||||
// The number of internal mixing channels,
|
// The number of internal mixing channels,
|
||||||
// the samples calculated for each mixing step,
|
// the samples calculated for each mixing step,
|
||||||
// the size of the 16bit, 2 hardware channel (stereo)
|
// the size of the 16bit, 2 hardware channel (stereo)
|
||||||
@ -55,14 +57,14 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
|
|||||||
|
|
||||||
|
|
||||||
// Needed for calling the actual sound output.
|
// Needed for calling the actual sound output.
|
||||||
#define SAMPLECOUNT 512
|
#define SAMPLECOUNT 8192
|
||||||
#define NUM_CHANNELS 16
|
#define NUM_CHANNELS 16
|
||||||
// It is 2 for 16bit, and 2 for two channels.
|
// It is 2 for 16bit, and 2 for two channels.
|
||||||
#define BUFMUL 4
|
#define BUFMUL 4
|
||||||
#define MIXBUFFERSIZE (SAMPLECOUNT*BUFMUL)
|
#define MIXBUFFERSIZE (SAMPLECOUNT*BUFMUL)
|
||||||
|
|
||||||
#define SAMPLERATE 11025 // Hz
|
#define SAMPLERATE 11025 // Hz
|
||||||
#define SAMPLESIZE 2 // 16bit
|
#define SAMPLESIZE 2 // 16bit
|
||||||
|
|
||||||
// The actual lengths of all sound effects.
|
// The actual lengths of all sound effects.
|
||||||
int lengths[NUMSFX];
|
int lengths[NUMSFX];
|
||||||
@ -332,8 +334,8 @@ void I_SetChannels()
|
|||||||
channels[i] = 0;
|
channels[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (i=-128 ; i<128 ; i++)
|
for (i=-128 ; i<128 ; i++)
|
||||||
// steptablemid[i] = (int)(pow(2.0, (i/64.0))*65536.0);
|
steptablemid[i] = (int)(pow(2.0, (i/64.0))*65536.0);
|
||||||
|
|
||||||
// Generates volume lookup tables
|
// Generates volume lookup tables
|
||||||
// which also turn the unsigned samples
|
// which also turn the unsigned samples
|
||||||
@ -423,6 +425,10 @@ int I_SoundIsPlaying(int handle)
|
|||||||
//
|
//
|
||||||
// This function currently supports only 16bit.
|
// This function currently supports only 16bit.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
extern DWORD hMixBuff[4];
|
||||||
|
extern int mix_ptr;
|
||||||
|
|
||||||
void I_UpdateSound( void )
|
void I_UpdateSound( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -441,6 +447,9 @@ void I_UpdateSound( void )
|
|||||||
|
|
||||||
// Mixing channel index.
|
// Mixing channel index.
|
||||||
int chan;
|
int chan;
|
||||||
|
int i;
|
||||||
|
int flags;
|
||||||
|
flags = 0;
|
||||||
|
|
||||||
// Left and right channel
|
// Left and right channel
|
||||||
// are in global mixbuffer, alternating.
|
// are in global mixbuffer, alternating.
|
||||||
@ -455,7 +464,7 @@ void I_UpdateSound( void )
|
|||||||
// Mix sounds into the mixing buffer.
|
// Mix sounds into the mixing buffer.
|
||||||
// Loop over step*SAMPLECOUNT,
|
// Loop over step*SAMPLECOUNT,
|
||||||
// that is 512 values for two channels.
|
// that is 512 values for two channels.
|
||||||
while (leftout != leftend)
|
for (i=0; i < 8192; i++)
|
||||||
{
|
{
|
||||||
// Reset left/right value.
|
// Reset left/right value.
|
||||||
dl = 0;
|
dl = 0;
|
||||||
@ -469,6 +478,8 @@ void I_UpdateSound( void )
|
|||||||
// Check channel, if active.
|
// Check channel, if active.
|
||||||
if (channels[ chan ])
|
if (channels[ chan ])
|
||||||
{
|
{
|
||||||
|
flags=1;
|
||||||
|
|
||||||
// Get the raw data from the channel.
|
// Get the raw data from the channel.
|
||||||
sample = *channels[ chan ];
|
sample = *channels[ chan ];
|
||||||
// Add left and right part
|
// Add left and right part
|
||||||
@ -515,7 +526,10 @@ void I_UpdateSound( void )
|
|||||||
leftout += step;
|
leftout += step;
|
||||||
rightout += step;
|
rightout += step;
|
||||||
}
|
}
|
||||||
// I_SubmitSound(mixbuffer);
|
if(flags)
|
||||||
|
{ WaveOut(hMixBuff[mix_ptr],(char*)&mixbuffer[0],32768);
|
||||||
|
mix_ptr= (mix_ptr+1)&3;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ int I_GetTime (void)
|
|||||||
void I_Init (void)
|
void I_Init (void)
|
||||||
{
|
{
|
||||||
I_InitGraphics();
|
I_InitGraphics();
|
||||||
// I_InitSound();
|
I_InitSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -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
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
// $Log:$
|
// $Log:$
|
||||||
//
|
//
|
||||||
// DESCRIPTION:
|
// DESCRIPTION:
|
||||||
// The actual span/column drawing functions.
|
// The actual span/column drawing functions.
|
||||||
// Here find the main potential for optimization,
|
// Here find the main potential for optimization,
|
||||||
// e.g. inline assembly, different algorithms.
|
// e.g. inline assembly, different algorithms.
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
static const char
|
static const char
|
||||||
rcsid[] = "$Id: r_draw.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
|
rcsid[] = "$Id: r_draw.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
|
||||||
|
|
||||||
|
#include "doomtype.h"
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
@ -44,11 +44,11 @@ rcsid[] = "$Id: r_draw.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
|
|||||||
|
|
||||||
|
|
||||||
// ?
|
// ?
|
||||||
#define MAXWIDTH 1120
|
#define MAXWIDTH 1120
|
||||||
#define MAXHEIGHT 832
|
#define MAXHEIGHT 832
|
||||||
|
|
||||||
// status bar height at bottom of screen
|
// status bar height at bottom of screen
|
||||||
#define SBARHEIGHT 32
|
#define SBARHEIGHT 32
|
||||||
|
|
||||||
//
|
//
|
||||||
// All drawing to the view buffer is accomplished in this file.
|
// All drawing to the view buffer is accomplished in this file.
|
||||||
@ -60,20 +60,20 @@ rcsid[] = "$Id: r_draw.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
byte* viewimage;
|
byte* viewimage;
|
||||||
int viewwidth;
|
int viewwidth;
|
||||||
int scaledviewwidth;
|
int scaledviewwidth;
|
||||||
int viewheight;
|
int viewheight;
|
||||||
int viewwindowx;
|
int viewwindowx;
|
||||||
int viewwindowy;
|
int viewwindowy;
|
||||||
byte* ylookup[MAXHEIGHT];
|
byte* ylookup[MAXHEIGHT];
|
||||||
int columnofs[MAXWIDTH];
|
int columnofs[MAXWIDTH];
|
||||||
|
|
||||||
// Color tables for different players,
|
// Color tables for different players,
|
||||||
// translate a limited part to another
|
// translate a limited part to another
|
||||||
// (color ramps used for suit colors).
|
// (color ramps used for suit colors).
|
||||||
//
|
//
|
||||||
byte translations[3][256];
|
byte translations[3][256];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -82,18 +82,18 @@ byte translations[3][256];
|
|||||||
// R_DrawColumn
|
// R_DrawColumn
|
||||||
// Source is the top of the column to scale.
|
// Source is the top of the column to scale.
|
||||||
//
|
//
|
||||||
lighttable_t* dc_colormap;
|
lighttable_t* dc_colormap;
|
||||||
int dc_x;
|
int dc_x;
|
||||||
int dc_yl;
|
int dc_yl;
|
||||||
int dc_yh;
|
int dc_yh;
|
||||||
fixed_t dc_iscale;
|
fixed_t dc_iscale;
|
||||||
fixed_t dc_texturemid;
|
fixed_t dc_texturemid;
|
||||||
|
|
||||||
// first pixel in a column (possibly virtual)
|
// first pixel in a column (possibly virtual)
|
||||||
byte* dc_source;
|
byte* dc_source;
|
||||||
|
|
||||||
// just for profiling
|
// just for profiling
|
||||||
int dccount;
|
int dccount;
|
||||||
|
|
||||||
//
|
//
|
||||||
// A column is a vertical slice/span from a wall texture that,
|
// A column is a vertical slice/span from a wall texture that,
|
||||||
@ -104,22 +104,22 @@ int dccount;
|
|||||||
//
|
//
|
||||||
void R_DrawColumn (void)
|
void R_DrawColumn (void)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
fixed_t frac;
|
fixed_t frac;
|
||||||
fixed_t fracstep;
|
fixed_t fracstep;
|
||||||
|
|
||||||
count = dc_yh - dc_yl;
|
count = dc_yh - dc_yl;
|
||||||
|
|
||||||
// Zero length, column does not exceed a pixel.
|
// Zero length, column does not exceed a pixel.
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if ((unsigned)dc_x >= SCREENWIDTH
|
if ((unsigned)dc_x >= SCREENWIDTH
|
||||||
|| dc_yl < 0
|
|| dc_yl < 0
|
||||||
|| dc_yh >= SCREENHEIGHT)
|
|| dc_yh >= SCREENHEIGHT)
|
||||||
I_Error ("R_DrawColumn: %i to %i at %i", dc_yl, dc_yh, dc_x);
|
I_Error ("R_DrawColumn: %i to %i at %i", dc_yl, dc_yh, dc_x);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Framebuffer destination address.
|
// Framebuffer destination address.
|
||||||
@ -137,12 +137,12 @@ void R_DrawColumn (void)
|
|||||||
// This is as fast as it gets.
|
// This is as fast as it gets.
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Re-map color indices from wall texture column
|
// Re-map color indices from wall texture column
|
||||||
// using a lighting/special effects LUT.
|
// using a lighting/special effects LUT.
|
||||||
*dest = dc_colormap[dc_source[(frac>>FRACBITS)&127]];
|
*dest = dc_colormap[dc_source[(frac>>FRACBITS)&127]];
|
||||||
|
|
||||||
dest += SCREENWIDTH;
|
dest += SCREENWIDTH;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
|
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
@ -154,16 +154,16 @@ void R_DrawColumn (void)
|
|||||||
#if 0
|
#if 0
|
||||||
void R_DrawColumn (void)
|
void R_DrawColumn (void)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
byte* source;
|
byte* source;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
byte* colormap;
|
byte* colormap;
|
||||||
|
|
||||||
unsigned frac;
|
unsigned frac;
|
||||||
unsigned fracstep;
|
unsigned fracstep;
|
||||||
unsigned fracstep2;
|
unsigned fracstep2;
|
||||||
unsigned fracstep3;
|
unsigned fracstep3;
|
||||||
unsigned fracstep4;
|
unsigned fracstep4;
|
||||||
|
|
||||||
count = dc_yh - dc_yl + 1;
|
count = dc_yh - dc_yl + 1;
|
||||||
|
|
||||||
@ -180,29 +180,29 @@ void R_DrawColumn (void)
|
|||||||
|
|
||||||
while (count >= 8)
|
while (count >= 8)
|
||||||
{
|
{
|
||||||
dest[0] = colormap[source[frac>>25]];
|
dest[0] = colormap[source[frac>>25]];
|
||||||
dest[SCREENWIDTH] = colormap[source[(frac+fracstep)>>25]];
|
dest[SCREENWIDTH] = colormap[source[(frac+fracstep)>>25]];
|
||||||
dest[SCREENWIDTH*2] = colormap[source[(frac+fracstep2)>>25]];
|
dest[SCREENWIDTH*2] = colormap[source[(frac+fracstep2)>>25]];
|
||||||
dest[SCREENWIDTH*3] = colormap[source[(frac+fracstep3)>>25]];
|
dest[SCREENWIDTH*3] = colormap[source[(frac+fracstep3)>>25]];
|
||||||
|
|
||||||
frac += fracstep4;
|
frac += fracstep4;
|
||||||
|
|
||||||
dest[SCREENWIDTH*4] = colormap[source[frac>>25]];
|
dest[SCREENWIDTH*4] = colormap[source[frac>>25]];
|
||||||
dest[SCREENWIDTH*5] = colormap[source[(frac+fracstep)>>25]];
|
dest[SCREENWIDTH*5] = colormap[source[(frac+fracstep)>>25]];
|
||||||
dest[SCREENWIDTH*6] = colormap[source[(frac+fracstep2)>>25]];
|
dest[SCREENWIDTH*6] = colormap[source[(frac+fracstep2)>>25]];
|
||||||
dest[SCREENWIDTH*7] = colormap[source[(frac+fracstep3)>>25]];
|
dest[SCREENWIDTH*7] = colormap[source[(frac+fracstep3)>>25]];
|
||||||
|
|
||||||
frac += fracstep4;
|
frac += fracstep4;
|
||||||
dest += SCREENWIDTH*8;
|
dest += SCREENWIDTH*8;
|
||||||
count -= 8;
|
count -= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (count > 0)
|
while (count > 0)
|
||||||
{
|
{
|
||||||
*dest = colormap[source[frac>>25]];
|
*dest = colormap[source[frac>>25]];
|
||||||
dest += SCREENWIDTH;
|
dest += SCREENWIDTH;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -210,27 +210,27 @@ void R_DrawColumn (void)
|
|||||||
|
|
||||||
void R_DrawColumnLow (void)
|
void R_DrawColumnLow (void)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
byte* dest2;
|
byte* dest2;
|
||||||
fixed_t frac;
|
fixed_t frac;
|
||||||
fixed_t fracstep;
|
fixed_t fracstep;
|
||||||
|
|
||||||
count = dc_yh - dc_yl;
|
count = dc_yh - dc_yl;
|
||||||
|
|
||||||
// Zero length.
|
// Zero length.
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if ((unsigned)dc_x >= SCREENWIDTH
|
if ((unsigned)dc_x >= SCREENWIDTH
|
||||||
|| dc_yl < 0
|
|| dc_yl < 0
|
||||||
|| dc_yh >= SCREENHEIGHT)
|
|| dc_yh >= SCREENHEIGHT)
|
||||||
{
|
{
|
||||||
|
|
||||||
I_Error ("R_DrawColumn: %i to %i at %i", dc_yl, dc_yh, dc_x);
|
I_Error ("R_DrawColumn: %i to %i at %i", dc_yl, dc_yh, dc_x);
|
||||||
}
|
}
|
||||||
// dccount++;
|
// dccount++;
|
||||||
#endif
|
#endif
|
||||||
// Blocky mode, need to multiply by 2.
|
// Blocky mode, need to multiply by 2.
|
||||||
dc_x <<= 1;
|
dc_x <<= 1;
|
||||||
@ -243,11 +243,11 @@ void R_DrawColumnLow (void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Hack. Does not work corretly.
|
// Hack. Does not work corretly.
|
||||||
*dest2 = *dest = dc_colormap[dc_source[(frac>>FRACBITS)&127]];
|
*dest2 = *dest = dc_colormap[dc_source[(frac>>FRACBITS)&127]];
|
||||||
dest += SCREENWIDTH;
|
dest += SCREENWIDTH;
|
||||||
dest2 += SCREENWIDTH;
|
dest2 += SCREENWIDTH;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
|
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
@ -256,11 +256,11 @@ void R_DrawColumnLow (void)
|
|||||||
//
|
//
|
||||||
// Spectre/Invisibility.
|
// Spectre/Invisibility.
|
||||||
//
|
//
|
||||||
#define FUZZTABLE 50
|
#define FUZZTABLE 50
|
||||||
#define FUZZOFF (SCREENWIDTH)
|
#define FUZZOFF (SCREENWIDTH)
|
||||||
|
|
||||||
|
|
||||||
int fuzzoffset[FUZZTABLE] =
|
int fuzzoffset[FUZZTABLE] =
|
||||||
{
|
{
|
||||||
FUZZOFF,-FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,
|
FUZZOFF,-FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,
|
||||||
FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,
|
FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,
|
||||||
@ -271,7 +271,7 @@ int fuzzoffset[FUZZTABLE] =
|
|||||||
FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF
|
FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF,FUZZOFF,-FUZZOFF,FUZZOFF
|
||||||
};
|
};
|
||||||
|
|
||||||
int fuzzpos = 0;
|
int fuzzpos = 0;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -284,32 +284,32 @@ int fuzzpos = 0;
|
|||||||
//
|
//
|
||||||
void R_DrawFuzzColumn (void)
|
void R_DrawFuzzColumn (void)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
fixed_t frac;
|
fixed_t frac;
|
||||||
fixed_t fracstep;
|
fixed_t fracstep;
|
||||||
|
|
||||||
// Adjust borders. Low...
|
// Adjust borders. Low...
|
||||||
if (!dc_yl)
|
if (!dc_yl)
|
||||||
dc_yl = 1;
|
dc_yl = 1;
|
||||||
|
|
||||||
// .. and high.
|
// .. and high.
|
||||||
if (dc_yh == viewheight-1)
|
if (dc_yh == viewheight-1)
|
||||||
dc_yh = viewheight - 2;
|
dc_yh = viewheight - 2;
|
||||||
|
|
||||||
count = dc_yh - dc_yl;
|
count = dc_yh - dc_yl;
|
||||||
|
|
||||||
// Zero length.
|
// Zero length.
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if ((unsigned)dc_x >= SCREENWIDTH
|
if ((unsigned)dc_x >= SCREENWIDTH
|
||||||
|| dc_yl < 0 || dc_yh >= SCREENHEIGHT)
|
|| dc_yl < 0 || dc_yh >= SCREENHEIGHT)
|
||||||
{
|
{
|
||||||
I_Error ("R_DrawFuzzColumn: %i to %i at %i",
|
I_Error ("R_DrawFuzzColumn: %i to %i at %i",
|
||||||
dc_yl, dc_yh, dc_x);
|
dc_yl, dc_yh, dc_x);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -319,23 +319,23 @@ void R_DrawFuzzColumn (void)
|
|||||||
/* WATCOM code
|
/* WATCOM code
|
||||||
if (detailshift)
|
if (detailshift)
|
||||||
{
|
{
|
||||||
if (dc_x & 1)
|
if (dc_x & 1)
|
||||||
{
|
{
|
||||||
outpw (GC_INDEX,GC_READMAP+(2<<8) );
|
outpw (GC_INDEX,GC_READMAP+(2<<8) );
|
||||||
outp (SC_INDEX+1,12);
|
outp (SC_INDEX+1,12);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outpw (GC_INDEX,GC_READMAP);
|
outpw (GC_INDEX,GC_READMAP);
|
||||||
outp (SC_INDEX+1,3);
|
outp (SC_INDEX+1,3);
|
||||||
}
|
}
|
||||||
dest = destview + dc_yl*80 + (dc_x>>1);
|
dest = destview + dc_yl*80 + (dc_x>>1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outpw (GC_INDEX,GC_READMAP+((dc_x&3)<<8) );
|
outpw (GC_INDEX,GC_READMAP+((dc_x&3)<<8) );
|
||||||
outp (SC_INDEX+1,1<<(dc_x&3));
|
outp (SC_INDEX+1,1<<(dc_x&3));
|
||||||
dest = destview + dc_yl*80 + (dc_x>>2);
|
dest = destview + dc_yl*80 + (dc_x>>2);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
@ -351,19 +351,19 @@ void R_DrawFuzzColumn (void)
|
|||||||
// brighter than average).
|
// brighter than average).
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Lookup framebuffer, and retrieve
|
// Lookup framebuffer, and retrieve
|
||||||
// a pixel that is either one column
|
// a pixel that is either one column
|
||||||
// left or right of the current one.
|
// left or right of the current one.
|
||||||
// Add index from colormap to index.
|
// Add index from colormap to index.
|
||||||
*dest = colormaps[6*256+dest[fuzzoffset[fuzzpos]]];
|
*dest = colormaps[6*256+dest[fuzzoffset[fuzzpos]]];
|
||||||
|
|
||||||
// Clamp table lookup index.
|
// Clamp table lookup index.
|
||||||
if (++fuzzpos == FUZZTABLE)
|
if (++fuzzpos == FUZZTABLE)
|
||||||
fuzzpos = 0;
|
fuzzpos = 0;
|
||||||
|
|
||||||
dest += SCREENWIDTH;
|
dest += SCREENWIDTH;
|
||||||
|
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,27 +379,27 @@ void R_DrawFuzzColumn (void)
|
|||||||
// of the BaronOfHell, the HellKnight, uses
|
// of the BaronOfHell, the HellKnight, uses
|
||||||
// identical sprites, kinda brightened up.
|
// identical sprites, kinda brightened up.
|
||||||
//
|
//
|
||||||
byte* dc_translation;
|
byte* dc_translation;
|
||||||
byte* translationtables;
|
byte* translationtables;
|
||||||
|
|
||||||
void R_DrawTranslatedColumn (void)
|
void R_DrawTranslatedColumn (void)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
fixed_t frac;
|
fixed_t frac;
|
||||||
fixed_t fracstep;
|
fixed_t fracstep;
|
||||||
|
|
||||||
count = dc_yh - dc_yl;
|
count = dc_yh - dc_yl;
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if ((unsigned)dc_x >= SCREENWIDTH
|
if ((unsigned)dc_x >= SCREENWIDTH
|
||||||
|| dc_yl < 0
|
|| dc_yl < 0
|
||||||
|| dc_yh >= SCREENHEIGHT)
|
|| dc_yh >= SCREENHEIGHT)
|
||||||
{
|
{
|
||||||
I_Error ( "R_DrawColumn: %i to %i at %i",
|
I_Error ( "R_DrawColumn: %i to %i at %i",
|
||||||
dc_yl, dc_yh, dc_x);
|
dc_yl, dc_yh, dc_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -409,18 +409,18 @@ void R_DrawTranslatedColumn (void)
|
|||||||
/* Keep for fixing.
|
/* Keep for fixing.
|
||||||
if (detailshift)
|
if (detailshift)
|
||||||
{
|
{
|
||||||
if (dc_x & 1)
|
if (dc_x & 1)
|
||||||
outp (SC_INDEX+1,12);
|
outp (SC_INDEX+1,12);
|
||||||
else
|
else
|
||||||
outp (SC_INDEX+1,3);
|
outp (SC_INDEX+1,3);
|
||||||
|
|
||||||
dest = destview + dc_yl*80 + (dc_x>>1);
|
dest = destview + dc_yl*80 + (dc_x>>1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outp (SC_INDEX+1,1<<(dc_x&3));
|
outp (SC_INDEX+1,1<<(dc_x&3));
|
||||||
|
|
||||||
dest = destview + dc_yl*80 + (dc_x>>2);
|
dest = destview + dc_yl*80 + (dc_x>>2);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
@ -434,15 +434,15 @@ void R_DrawTranslatedColumn (void)
|
|||||||
// Here we do an additional index re-mapping.
|
// Here we do an additional index re-mapping.
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Translation tables are used
|
// Translation tables are used
|
||||||
// to map certain colorramps to other ones,
|
// to map certain colorramps to other ones,
|
||||||
// used with PLAY sprites.
|
// used with PLAY sprites.
|
||||||
// Thus the "green" ramp of the player 0 sprite
|
// Thus the "green" ramp of the player 0 sprite
|
||||||
// is mapped to gray, red, black/indigo.
|
// is mapped to gray, red, black/indigo.
|
||||||
*dest = dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]];
|
*dest = dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]];
|
||||||
dest += SCREENWIDTH;
|
dest += SCREENWIDTH;
|
||||||
|
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ void R_DrawTranslatedColumn (void)
|
|||||||
//
|
//
|
||||||
void R_InitTranslationTables (void)
|
void R_InitTranslationTables (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
translationtables = Z_Malloc (256*3+255, PU_STATIC, 0);
|
translationtables = Z_Malloc (256*3+255, PU_STATIC, 0);
|
||||||
translationtables = (byte *)(( (int)translationtables + 255 )& ~255);
|
translationtables = (byte *)(( (int)translationtables + 255 )& ~255);
|
||||||
@ -466,19 +466,19 @@ void R_InitTranslationTables (void)
|
|||||||
// translate just the 16 green colors
|
// translate just the 16 green colors
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++)
|
||||||
{
|
{
|
||||||
if (i >= 0x70 && i<= 0x7f)
|
if (i >= 0x70 && i<= 0x7f)
|
||||||
{
|
{
|
||||||
// map green ramp to gray, brown, red
|
// map green ramp to gray, brown, red
|
||||||
translationtables[i] = 0x60 + (i&0xf);
|
translationtables[i] = 0x60 + (i&0xf);
|
||||||
translationtables [i+256] = 0x40 + (i&0xf);
|
translationtables [i+256] = 0x40 + (i&0xf);
|
||||||
translationtables [i+512] = 0x20 + (i&0xf);
|
translationtables [i+512] = 0x20 + (i&0xf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Keep all other colors as is.
|
// Keep all other colors as is.
|
||||||
translationtables[i] = translationtables[i+256]
|
translationtables[i] = translationtables[i+256]
|
||||||
= translationtables[i+512] = i;
|
= translationtables[i+512] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,44 +497,44 @@ void R_InitTranslationTables (void)
|
|||||||
// In consequence, flats are not stored by column (like walls),
|
// In consequence, flats are not stored by column (like walls),
|
||||||
// and the inner loop has to step in texture space u and v.
|
// and the inner loop has to step in texture space u and v.
|
||||||
//
|
//
|
||||||
int ds_y;
|
int ds_y;
|
||||||
int ds_x1;
|
int ds_x1;
|
||||||
int ds_x2;
|
int ds_x2;
|
||||||
|
|
||||||
lighttable_t* ds_colormap;
|
lighttable_t* ds_colormap;
|
||||||
|
|
||||||
fixed_t ds_xfrac;
|
fixed_t ds_xfrac;
|
||||||
fixed_t ds_yfrac;
|
fixed_t ds_yfrac;
|
||||||
fixed_t ds_xstep;
|
fixed_t ds_xstep;
|
||||||
fixed_t ds_ystep;
|
fixed_t ds_ystep;
|
||||||
|
|
||||||
// start of a 64*64 tile image
|
// start of a 64*64 tile image
|
||||||
byte* ds_source;
|
byte* ds_source;
|
||||||
|
|
||||||
// just for profiling
|
// just for profiling
|
||||||
int dscount;
|
int dscount;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draws the actual span.
|
// Draws the actual span.
|
||||||
void R_DrawSpan (void)
|
void R_DrawSpan (void)
|
||||||
{
|
{
|
||||||
fixed_t xfrac;
|
fixed_t xfrac;
|
||||||
fixed_t yfrac;
|
fixed_t yfrac;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
int count;
|
int count;
|
||||||
int spot;
|
int spot;
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if (ds_x2 < ds_x1
|
if (ds_x2 < ds_x1
|
||||||
|| ds_x1<0
|
|| ds_x1<0
|
||||||
|| ds_x2>=SCREENWIDTH
|
|| ds_x2>=SCREENWIDTH
|
||||||
|| (unsigned)ds_y>SCREENHEIGHT)
|
|| (unsigned)ds_y>SCREENHEIGHT)
|
||||||
{
|
{
|
||||||
I_Error( "R_DrawSpan: %i to %i at %i",
|
I_Error( "R_DrawSpan: %i to %i at %i",
|
||||||
ds_x1,ds_x2,ds_y);
|
ds_x1,ds_x2,ds_y);
|
||||||
}
|
}
|
||||||
// dscount++;
|
// dscount++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -548,16 +548,16 @@ void R_DrawSpan (void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Current texture index in u,v.
|
// Current texture index in u,v.
|
||||||
spot = ((yfrac>>(16-6))&(63*64)) + ((xfrac>>16)&63);
|
spot = ((yfrac>>(16-6))&(63*64)) + ((xfrac>>16)&63);
|
||||||
|
|
||||||
// Lookup pixel from flat texture tile,
|
// Lookup pixel from flat texture tile,
|
||||||
// re-index using light/colormap.
|
// re-index using light/colormap.
|
||||||
*dest++ = ds_colormap[ds_source[spot]];
|
*dest++ = ds_colormap[ds_source[spot]];
|
||||||
|
|
||||||
// Next step in u,v.
|
// Next step in u,v.
|
||||||
xfrac += ds_xstep;
|
xfrac += ds_xstep;
|
||||||
yfrac += ds_ystep;
|
yfrac += ds_ystep;
|
||||||
|
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
@ -569,18 +569,18 @@ void R_DrawSpan (void)
|
|||||||
#if 0
|
#if 0
|
||||||
void R_DrawSpan (void)
|
void R_DrawSpan (void)
|
||||||
{
|
{
|
||||||
unsigned position, step;
|
unsigned position, step;
|
||||||
|
|
||||||
byte* source;
|
byte* source;
|
||||||
byte* colormap;
|
byte* colormap;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
|
|
||||||
unsigned count;
|
unsigned count;
|
||||||
usingned spot;
|
usingned spot;
|
||||||
unsigned value;
|
unsigned value;
|
||||||
unsigned temp;
|
unsigned temp;
|
||||||
unsigned xtemp;
|
unsigned xtemp;
|
||||||
unsigned ytemp;
|
unsigned ytemp;
|
||||||
|
|
||||||
position = ((ds_xfrac<<10)&0xffff0000) | ((ds_yfrac>>6)&0xffff);
|
position = ((ds_xfrac<<10)&0xffff0000) | ((ds_yfrac>>6)&0xffff);
|
||||||
step = ((ds_xstep<<10)&0xffff0000) | ((ds_ystep>>6)&0xffff);
|
step = ((ds_xstep<<10)&0xffff0000) | ((ds_ystep>>6)&0xffff);
|
||||||
@ -592,46 +592,46 @@ void R_DrawSpan (void)
|
|||||||
|
|
||||||
while (count >= 4)
|
while (count >= 4)
|
||||||
{
|
{
|
||||||
ytemp = position>>4;
|
ytemp = position>>4;
|
||||||
ytemp = ytemp & 4032;
|
ytemp = ytemp & 4032;
|
||||||
xtemp = position>>26;
|
xtemp = position>>26;
|
||||||
spot = xtemp | ytemp;
|
spot = xtemp | ytemp;
|
||||||
position += step;
|
position += step;
|
||||||
dest[0] = colormap[source[spot]];
|
dest[0] = colormap[source[spot]];
|
||||||
|
|
||||||
ytemp = position>>4;
|
ytemp = position>>4;
|
||||||
ytemp = ytemp & 4032;
|
ytemp = ytemp & 4032;
|
||||||
xtemp = position>>26;
|
xtemp = position>>26;
|
||||||
spot = xtemp | ytemp;
|
spot = xtemp | ytemp;
|
||||||
position += step;
|
position += step;
|
||||||
dest[1] = colormap[source[spot]];
|
dest[1] = colormap[source[spot]];
|
||||||
|
|
||||||
ytemp = position>>4;
|
ytemp = position>>4;
|
||||||
ytemp = ytemp & 4032;
|
ytemp = ytemp & 4032;
|
||||||
xtemp = position>>26;
|
xtemp = position>>26;
|
||||||
spot = xtemp | ytemp;
|
spot = xtemp | ytemp;
|
||||||
position += step;
|
position += step;
|
||||||
dest[2] = colormap[source[spot]];
|
dest[2] = colormap[source[spot]];
|
||||||
|
|
||||||
ytemp = position>>4;
|
ytemp = position>>4;
|
||||||
ytemp = ytemp & 4032;
|
ytemp = ytemp & 4032;
|
||||||
xtemp = position>>26;
|
xtemp = position>>26;
|
||||||
spot = xtemp | ytemp;
|
spot = xtemp | ytemp;
|
||||||
position += step;
|
position += step;
|
||||||
dest[3] = colormap[source[spot]];
|
dest[3] = colormap[source[spot]];
|
||||||
|
|
||||||
count -= 4;
|
count -= 4;
|
||||||
dest += 4;
|
dest += 4;
|
||||||
}
|
}
|
||||||
while (count > 0)
|
while (count > 0)
|
||||||
{
|
{
|
||||||
ytemp = position>>4;
|
ytemp = position>>4;
|
||||||
ytemp = ytemp & 4032;
|
ytemp = ytemp & 4032;
|
||||||
xtemp = position>>26;
|
xtemp = position>>26;
|
||||||
spot = xtemp | ytemp;
|
spot = xtemp | ytemp;
|
||||||
position += step;
|
position += step;
|
||||||
*dest++ = colormap[source[spot]];
|
*dest++ = colormap[source[spot]];
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -642,22 +642,22 @@ void R_DrawSpan (void)
|
|||||||
//
|
//
|
||||||
void R_DrawSpanLow (void)
|
void R_DrawSpanLow (void)
|
||||||
{
|
{
|
||||||
fixed_t xfrac;
|
fixed_t xfrac;
|
||||||
fixed_t yfrac;
|
fixed_t yfrac;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
int count;
|
int count;
|
||||||
int spot;
|
int spot;
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if (ds_x2 < ds_x1
|
if (ds_x2 < ds_x1
|
||||||
|| ds_x1<0
|
|| ds_x1<0
|
||||||
|| ds_x2>=SCREENWIDTH
|
|| ds_x2>=SCREENWIDTH
|
||||||
|| (unsigned)ds_y>SCREENHEIGHT)
|
|| (unsigned)ds_y>SCREENHEIGHT)
|
||||||
{
|
{
|
||||||
I_Error( "R_DrawSpan: %i to %i at %i",
|
I_Error( "R_DrawSpan: %i to %i at %i",
|
||||||
ds_x1,ds_x2,ds_y);
|
ds_x1,ds_x2,ds_y);
|
||||||
}
|
}
|
||||||
// dscount++;
|
// dscount++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xfrac = ds_xfrac;
|
xfrac = ds_xfrac;
|
||||||
@ -673,14 +673,14 @@ void R_DrawSpanLow (void)
|
|||||||
count = ds_x2 - ds_x1;
|
count = ds_x2 - ds_x1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
spot = ((yfrac>>(16-6))&(63*64)) + ((xfrac>>16)&63);
|
spot = ((yfrac>>(16-6))&(63*64)) + ((xfrac>>16)&63);
|
||||||
// Lowres/blocky mode does it twice,
|
// Lowres/blocky mode does it twice,
|
||||||
// while scale is adjusted appropriately.
|
// while scale is adjusted appropriately.
|
||||||
*dest++ = ds_colormap[ds_source[spot]];
|
*dest++ = ds_colormap[ds_source[spot]];
|
||||||
*dest++ = ds_colormap[ds_source[spot]];
|
*dest++ = ds_colormap[ds_source[spot]];
|
||||||
|
|
||||||
xfrac += ds_xstep;
|
xfrac += ds_xstep;
|
||||||
yfrac += ds_ystep;
|
yfrac += ds_ystep;
|
||||||
|
|
||||||
} while (count--);
|
} while (count--);
|
||||||
}
|
}
|
||||||
@ -694,10 +694,10 @@ void R_DrawSpanLow (void)
|
|||||||
//
|
//
|
||||||
void
|
void
|
||||||
R_InitBuffer
|
R_InitBuffer
|
||||||
( int width,
|
( int width,
|
||||||
int height )
|
int height )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Handle resize,
|
// Handle resize,
|
||||||
// e.g. smaller view windows
|
// e.g. smaller view windows
|
||||||
@ -706,17 +706,17 @@ R_InitBuffer
|
|||||||
|
|
||||||
// Column offset. For windows.
|
// Column offset. For windows.
|
||||||
for (i=0 ; i<width ; i++)
|
for (i=0 ; i<width ; i++)
|
||||||
columnofs[i] = viewwindowx + i;
|
columnofs[i] = viewwindowx + i;
|
||||||
|
|
||||||
// Samw with base row offset.
|
// Samw with base row offset.
|
||||||
if (width == SCREENWIDTH)
|
if (width == SCREENWIDTH)
|
||||||
viewwindowy = 0;
|
viewwindowy = 0;
|
||||||
else
|
else
|
||||||
viewwindowy = (SCREENHEIGHT-SBARHEIGHT-height) >> 1;
|
viewwindowy = (SCREENHEIGHT-SBARHEIGHT-height) >> 1;
|
||||||
|
|
||||||
// Preclaculate all row offsets.
|
// Preclaculate all row offsets.
|
||||||
for (i=0 ; i<height ; i++)
|
for (i=0 ; i<height ; i++)
|
||||||
ylookup[i] = screens[0] + (i+viewwindowy)*SCREENWIDTH;
|
ylookup[i] = screens[0] + (i+viewwindowy)*SCREENWIDTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -730,84 +730,84 @@ R_InitBuffer
|
|||||||
//
|
//
|
||||||
void R_FillBackScreen (void)
|
void R_FillBackScreen (void)
|
||||||
{
|
{
|
||||||
byte* src;
|
byte* src;
|
||||||
byte* dest;
|
byte* dest;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
patch_t* patch;
|
patch_t* patch;
|
||||||
|
|
||||||
// DOOM border patch.
|
// DOOM border patch.
|
||||||
char name1[] = "FLOOR7_2";
|
char name1[] = "FLOOR7_2";
|
||||||
|
|
||||||
// DOOM II border patch.
|
// DOOM II border patch.
|
||||||
char name2[] = "GRNROCK";
|
char name2[] = "GRNROCK";
|
||||||
|
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
if (scaledviewwidth == 320)
|
if (scaledviewwidth == 320)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( gamemode == commercial)
|
if ( gamemode == commercial)
|
||||||
name = name2;
|
name = name2;
|
||||||
else
|
else
|
||||||
name = name1;
|
name = name1;
|
||||||
|
|
||||||
src = W_CacheLumpName (name, PU_CACHE);
|
src = W_CacheLumpName (name, PU_CACHE);
|
||||||
dest = screens[1];
|
dest = screens[1];
|
||||||
|
|
||||||
for (y=0 ; y<SCREENHEIGHT-SBARHEIGHT ; y++)
|
for (y=0 ; y<SCREENHEIGHT-SBARHEIGHT ; y++)
|
||||||
{
|
{
|
||||||
for (x=0 ; x<SCREENWIDTH/64 ; x++)
|
for (x=0 ; x<SCREENWIDTH/64 ; x++)
|
||||||
{
|
{
|
||||||
memcpy (dest, src+((y&63)<<6), 64);
|
memcpy (dest, src+((y&63)<<6), 64);
|
||||||
dest += 64;
|
dest += 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SCREENWIDTH&63)
|
if (SCREENWIDTH&63)
|
||||||
{
|
{
|
||||||
memcpy (dest, src+((y&63)<<6), SCREENWIDTH&63);
|
memcpy (dest, src+((y&63)<<6), SCREENWIDTH&63);
|
||||||
dest += (SCREENWIDTH&63);
|
dest += (SCREENWIDTH&63);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
patch = W_CacheLumpName ("brdr_t",PU_CACHE);
|
patch = W_CacheLumpName ("brdr_t",PU_CACHE);
|
||||||
|
|
||||||
for (x=0 ; x<scaledviewwidth ; x+=8)
|
for (x=0 ; x<scaledviewwidth ; x+=8)
|
||||||
V_DrawPatch (viewwindowx+x,viewwindowy-8,1,patch);
|
V_DrawPatch (viewwindowx+x,viewwindowy-8,1,patch);
|
||||||
patch = W_CacheLumpName ("brdr_b",PU_CACHE);
|
patch = W_CacheLumpName ("brdr_b",PU_CACHE);
|
||||||
|
|
||||||
for (x=0 ; x<scaledviewwidth ; x+=8)
|
for (x=0 ; x<scaledviewwidth ; x+=8)
|
||||||
V_DrawPatch (viewwindowx+x,viewwindowy+viewheight,1,patch);
|
V_DrawPatch (viewwindowx+x,viewwindowy+viewheight,1,patch);
|
||||||
patch = W_CacheLumpName ("brdr_l",PU_CACHE);
|
patch = W_CacheLumpName ("brdr_l",PU_CACHE);
|
||||||
|
|
||||||
for (y=0 ; y<viewheight ; y+=8)
|
for (y=0 ; y<viewheight ; y+=8)
|
||||||
V_DrawPatch (viewwindowx-8,viewwindowy+y,1,patch);
|
V_DrawPatch (viewwindowx-8,viewwindowy+y,1,patch);
|
||||||
patch = W_CacheLumpName ("brdr_r",PU_CACHE);
|
patch = W_CacheLumpName ("brdr_r",PU_CACHE);
|
||||||
|
|
||||||
for (y=0 ; y<viewheight ; y+=8)
|
for (y=0 ; y<viewheight ; y+=8)
|
||||||
V_DrawPatch (viewwindowx+scaledviewwidth,viewwindowy+y,1,patch);
|
V_DrawPatch (viewwindowx+scaledviewwidth,viewwindowy+y,1,patch);
|
||||||
|
|
||||||
|
|
||||||
// Draw beveled edge.
|
// Draw beveled edge.
|
||||||
V_DrawPatch (viewwindowx-8,
|
V_DrawPatch (viewwindowx-8,
|
||||||
viewwindowy-8,
|
viewwindowy-8,
|
||||||
1,
|
1,
|
||||||
W_CacheLumpName ("brdr_tl",PU_CACHE));
|
W_CacheLumpName ("brdr_tl",PU_CACHE));
|
||||||
|
|
||||||
V_DrawPatch (viewwindowx+scaledviewwidth,
|
V_DrawPatch (viewwindowx+scaledviewwidth,
|
||||||
viewwindowy-8,
|
viewwindowy-8,
|
||||||
1,
|
1,
|
||||||
W_CacheLumpName ("brdr_tr",PU_CACHE));
|
W_CacheLumpName ("brdr_tr",PU_CACHE));
|
||||||
|
|
||||||
V_DrawPatch (viewwindowx-8,
|
V_DrawPatch (viewwindowx-8,
|
||||||
viewwindowy+viewheight,
|
viewwindowy+viewheight,
|
||||||
1,
|
1,
|
||||||
W_CacheLumpName ("brdr_bl",PU_CACHE));
|
W_CacheLumpName ("brdr_bl",PU_CACHE));
|
||||||
|
|
||||||
V_DrawPatch (viewwindowx+scaledviewwidth,
|
V_DrawPatch (viewwindowx+scaledviewwidth,
|
||||||
viewwindowy+viewheight,
|
viewwindowy+viewheight,
|
||||||
1,
|
1,
|
||||||
W_CacheLumpName ("brdr_br",PU_CACHE));
|
W_CacheLumpName ("brdr_br",PU_CACHE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -816,8 +816,8 @@ void R_FillBackScreen (void)
|
|||||||
//
|
//
|
||||||
void
|
void
|
||||||
R_VideoErase
|
R_VideoErase
|
||||||
( unsigned ofs,
|
( unsigned ofs,
|
||||||
int count )
|
int count )
|
||||||
{
|
{
|
||||||
// LFB copy.
|
// LFB copy.
|
||||||
// This might not be a good idea if memcpy
|
// This might not be a good idea if memcpy
|
||||||
@ -835,20 +835,20 @@ R_VideoErase
|
|||||||
//
|
//
|
||||||
void
|
void
|
||||||
V_MarkRect
|
V_MarkRect
|
||||||
( int x,
|
( int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height );
|
int height );
|
||||||
|
|
||||||
void R_DrawViewBorder (void)
|
void R_DrawViewBorder (void)
|
||||||
{
|
{
|
||||||
int top;
|
int top;
|
||||||
int side;
|
int side;
|
||||||
int ofs;
|
int ofs;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (scaledviewwidth == SCREENWIDTH)
|
if (scaledviewwidth == SCREENWIDTH)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
top = ((SCREENHEIGHT-SBARHEIGHT)-viewheight)/2;
|
top = ((SCREENHEIGHT-SBARHEIGHT)-viewheight)/2;
|
||||||
side = (SCREENWIDTH-scaledviewwidth)/2;
|
side = (SCREENWIDTH-scaledviewwidth)/2;
|
||||||
@ -866,8 +866,8 @@ void R_DrawViewBorder (void)
|
|||||||
|
|
||||||
for (i=1 ; i<viewheight ; i++)
|
for (i=1 ; i<viewheight ; i++)
|
||||||
{
|
{
|
||||||
R_VideoErase (ofs, side);
|
R_VideoErase (ofs, side);
|
||||||
ofs += SCREENWIDTH;
|
ofs += SCREENWIDTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?
|
// ?
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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.
|
||||||
|
@ -152,6 +152,8 @@ void W_AddFile (char *filename)
|
|||||||
reloadlump = numlumps;
|
reloadlump = numlumps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("open file %s\n\r",filename);
|
||||||
|
|
||||||
if ( (handle = fopen (filename,"rb")) == NULL)
|
if ( (handle = fopen (filename,"rb")) == NULL)
|
||||||
{
|
{
|
||||||
printf (" couldn't open %s\n",filename);
|
printf (" couldn't open %s\n",filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user