nothing special

git-svn-id: https://svn.eduke32.com/eduke32@1230 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-02-28 07:44:54 +00:00
parent 151189efab
commit 39607e84b1
17 changed files with 157 additions and 104 deletions

View file

@ -48,6 +48,7 @@ endif
CC=gcc CC=gcc
CXX=g++ CXX=g++
AS=nasm
GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1) GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1)
GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2) GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2)
@ -299,10 +300,10 @@ $(EOBJ)/$(EDITORLIB): editorlib
# RULES # RULES
$(OBJ)/%.$o: $(SRC)/%.nasm $(OBJ)/%.$o: $(SRC)/%.nasm
$(COMPILE_STATUS) $(COMPILE_STATUS)
nasm $(NASMFLAGS) $< -o $@ $(AS) $(NASMFLAGS) $< -o $@
$(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm $(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm
$(COMPILE_STATUS) $(COMPILE_STATUS)
nasm $(NASMFLAGS) $< -o $@ $(AS) $(NASMFLAGS) $< -o $@
$(OBJ)/%.$o: $(SRC)/%.c $(OBJ)/%.$o: $(SRC)/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)

View file

@ -3,8 +3,8 @@
ENGINELIB=libengine.a ENGINELIB=libengine.a
EDITORLIB=libbuild.a EDITORLIB=libbuild.a
SDLCONFIG = /usr/local/bin/sdl-config # SDLCONFIG = /usr/local/bin/sdl-config
# SDLCONFIG = sdl-config SDLCONFIG = sdl-config
ifeq ($(wildcard $(SDLCONFIG)),$(SDLCONFIG)) ifeq ($(wildcard $(SDLCONFIG)),$(SDLCONFIG))
SDLROOT = /usr/local SDLROOT = /usr/local

View file

@ -10,6 +10,7 @@
#define __build_h__ #define __build_h__
#include "compat.h" #include "compat.h"
#include "pragmas.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -478,7 +479,26 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall);
void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus); void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus);
int32_t krand(void); int32_t krand(void);
int32_t ksqrt(int32_t num); int32_t ksqrt(int32_t num);
int32_t getangle(int32_t xvect, int32_t yvect); // int32_t getangle(int32_t xvect, int32_t yvect);
//
// getangle
//
EXTERN int16_t radarang[1280];
static inline int32_t getangle(int32_t xvect, int32_t yvect)
{
if ((xvect|yvect) == 0) return(0);
if (xvect == 0) return(512+((yvect<0)<<10));
if (yvect == 0) return(((xvect<0)<<10));
if (xvect == yvect) return(256+((xvect<0)<<10));
if (xvect == -yvect) return(768+((xvect>0)<<10));
if (klabs(xvect) > klabs(yvect))
return(((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047);
return(((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047);
}
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang, int32_t *x2, int32_t *y2); void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang, int32_t *x2, int32_t *y2);
int32_t lastwall(int16_t point); int32_t lastwall(int16_t point);
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction); int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction);
@ -490,8 +510,33 @@ void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
int32_t sectorofwall(int16_t theline); int32_t sectorofwall(int16_t theline);
int32_t loopnumofsector(int16_t sectnum, int16_t wallnum); int32_t loopnumofsector(int16_t sectnum, int16_t wallnum);
int32_t insertsprite(int16_t sectnum, int16_t statnum); // int32_t insertsprite(int16_t sectnum, int16_t statnum);
int32_t deletesprite(int16_t spritenum); // int32_t deletesprite(int16_t spritenum);
//
// insertsprite
//
int32_t insertspritesect(int16_t sectnum);
int32_t insertspritestat(int16_t statnum);
int32_t deletespritesect(int16_t deleteme);
int32_t deletespritestat(int16_t deleteme);
static inline int32_t insertsprite(int16_t sectnum, int16_t statnum)
{
insertspritestat(statnum);
return(insertspritesect(sectnum));
}
//
// deletesprite
//
static inline int32_t deletesprite(int16_t spritenum)
{
deletespritestat(spritenum);
return(deletespritesect(spritenum));
}
int32_t changespritesect(int16_t spritenum, int16_t newsectnum); int32_t changespritesect(int16_t spritenum, int16_t newsectnum);
int32_t changespritestat(int16_t spritenum, int16_t newstatnum); int32_t changespritestat(int16_t spritenum, int16_t newstatnum);
int32_t setsprite(int16_t spritenum, const vec3_t *new); int32_t setsprite(int16_t spritenum, const vec3_t *new);
@ -585,7 +630,30 @@ int32_t hicclearsubst(int32_t picnum, int32_t palnum);
int32_t Ptile2tile(int32_t tile, int32_t pallet); int32_t Ptile2tile(int32_t tile, int32_t pallet);
int32_t md_loadmodel(const char *fn); int32_t md_loadmodel(const char *fn);
int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, int32_t flags); int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, int32_t flags);
int32_t md_tilehasmodel(int32_t tilenume, int32_t pal); // int32_t md_tilehasmodel(int32_t tilenume, int32_t pal);
typedef struct
{
// maps build tiles to particular animation frames of a model
int32_t modelid;
int32_t skinnum;
int32_t framenum; // calculate the number from the name when declaring
float smoothduration;
int32_t next;
char pal;
} tile2model_t;
#define EXTRATILES MAXTILES
EXTERN int32_t mdinited;
EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES];
static inline int32_t md_tilehasmodel(int32_t tilenume,int32_t pal)
{
if (!mdinited) return -1;
return tile2model[Ptile2tile(tilenume,pal)].modelid;
}
int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal); int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal);
int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *frameend, int32_t fps, int32_t flags); int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *frameend, int32_t fps, int32_t flags);
int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32_t skinnum, int32_t surfnum, float param); int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32_t skinnum, int32_t surfnum, float param);

View file

@ -204,6 +204,7 @@ typedef struct
int32_t is8bit; int32_t is8bit;
} voxmodel_t; } voxmodel_t;
/*
typedef struct typedef struct
{ {
// maps build tiles to particular animation frames of a model // maps build tiles to particular animation frames of a model
@ -217,6 +218,8 @@ typedef struct
#define EXTRATILES MAXTILES #define EXTRATILES MAXTILES
EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES]; EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES];
*/
EXTERN mdmodel_t **models; EXTERN mdmodel_t **models;
void updateanimation(md2model_t *m, spritetype *tspr); void updateanimation(md2model_t *m, spritetype *tspr);
@ -230,7 +233,6 @@ typedef struct { float xadd, yadd, zadd; int16_t angadd, flags; } hudtyp;
EXTERN hudtyp hudmem[2][MAXTILES]; //~320KB ... ok for now ... could replace with dynamic alloc EXTERN hudtyp hudmem[2][MAXTILES]; //~320KB ... ok for now ... could replace with dynamic alloc
EXTERN int32_t mdinited;
EXTERN int32_t mdpause; EXTERN int32_t mdpause;
EXTERN int32_t nummodelsalloced, nextmodelid; EXTERN int32_t nummodelsalloced, nextmodelid;
EXTERN voxmodel_t *voxmodels[MAXVOXELS]; EXTERN voxmodel_t *voxmodels[MAXVOXELS];

View file

@ -102,7 +102,7 @@ int32_t tilefileoffs[MAXTILES];
int32_t artsize = 0, cachesize = 0; int32_t artsize = 0, cachesize = 0;
static int16_t radarang[1280], radarang2[MAXXDIM]; static int16_t radarang2[MAXXDIM];
static uint16_t sqrtable[4096], shlookup[4096+256]; static uint16_t sqrtable[4096], shlookup[4096+256];
char pow2char[8] = {1,2,4,8,16,32,64,128}; char pow2char[8] = {1,2,4,8,16,32,64,128};
int32_t pow2long[32] = int32_t pow2long[32] =
@ -5278,7 +5278,7 @@ int32_t getclosestcol(int32_t r, int32_t g, int32_t b)
// //
// insertspritesect (internal) // insertspritesect (internal)
// //
static int32_t insertspritesect(int16_t sectnum) int32_t insertspritesect(int16_t sectnum)
{ {
int16_t blanktouse; int16_t blanktouse;
@ -5306,7 +5306,7 @@ static int32_t insertspritesect(int16_t sectnum)
// //
// insertspritestat (internal) // insertspritestat (internal)
// //
static int32_t insertspritestat(int16_t statnum) int32_t insertspritestat(int16_t statnum)
{ {
int16_t blanktouse; int16_t blanktouse;
@ -5334,7 +5334,7 @@ static int32_t insertspritestat(int16_t statnum)
// //
// deletespritesect (internal) // deletespritesect (internal)
// //
static int32_t deletespritesect(int16_t deleteme) int32_t deletespritesect(int16_t deleteme)
{ {
if (sprite[deleteme].sectnum == MAXSECTORS) if (sprite[deleteme].sectnum == MAXSECTORS)
return(-1); return(-1);
@ -5358,7 +5358,7 @@ static int32_t deletespritesect(int16_t deleteme)
// //
// deletespritestat (internal) // deletespritestat (internal)
// //
static int32_t deletespritestat(int16_t deleteme) int32_t deletespritestat(int16_t deleteme)
{ {
if (sprite[deleteme].statnum == MAXSTATUS) if (sprite[deleteme].statnum == MAXSTATUS)
return(-1); return(-1);
@ -8236,22 +8236,6 @@ int32_t inside(int32_t x, int32_t y, int16_t sectnum)
} }
//
// getangle
//
int32_t getangle(int32_t xvect, int32_t yvect)
{
if ((xvect|yvect) == 0) return(0);
if (xvect == 0) return(512+((yvect<0)<<10));
if (yvect == 0) return(((xvect<0)<<10));
if (xvect == yvect) return(256+((xvect<0)<<10));
if (xvect == -yvect) return(768+((xvect>0)<<10));
if (klabs(xvect) > klabs(yvect))
return(((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047);
return(((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047);
}
// //
// ksqrt // ksqrt
// //
@ -8306,26 +8290,6 @@ int32_t setspritez(int16_t spritenum, const vec3_t *new)
return(0); return(0);
} }
//
// insertsprite
//
int32_t insertsprite(int16_t sectnum, int16_t statnum)
{
insertspritestat(statnum);
return(insertspritesect(sectnum));
}
//
// deletesprite
//
int32_t deletesprite(int16_t spritenum)
{
deletespritestat(spritenum);
return(deletespritesect(spritenum));
}
// //
// changespritesect // changespritesect
// //

View file

@ -285,6 +285,8 @@ int32_t hicclearsubst(int32_t picnum, int32_t palnum)
#else /* POLYMOST */ #else /* POLYMOST */
#include "inttypes.h"
void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect) { } void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect) { }
int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, char *filen, float alphacut) { return 0; } int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, char *filen, float alphacut) { return 0; }
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]) { return 0; } int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]) { return 0; }

View file

@ -214,11 +214,13 @@ int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, i
return 0; return 0;
} }
/*
int32_t md_tilehasmodel(int32_t tilenume,int32_t pal) int32_t md_tilehasmodel(int32_t tilenume,int32_t pal)
{ {
if (!mdinited) return -1; if (!mdinited) return -1;
return tile2model[Ptile2tile(tilenume,pal)].modelid; return tile2model[Ptile2tile(tilenume,pal)].modelid;
} }
*/
static int32_t framename2index(mdmodel_t *vm, const char *nam) static int32_t framename2index(mdmodel_t *vm, const char *nam)
{ {

View file

@ -6764,6 +6764,7 @@ int32_t dedxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf,
#else /* POLYMOST */ #else /* POLYMOST */
#include "inttypes.h"
int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen) { return -1; } int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen) { return -1; }
#endif #endif

View file

@ -341,6 +341,7 @@ void initprintf(const char *f, ...)
va_end(va); va_end(va);
OSD_Printf(buf); OSD_Printf(buf);
Bprintf(buf);
if (Bstrlen(dabuf) + Bstrlen(buf) > 1022) if (Bstrlen(dabuf) + Bstrlen(buf) > 1022)
{ {

View file

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h> #include <shellapi.h>
#endif #endif
#define BUILDDATE " 20090131" #define BUILDDATE " 20090227"
#define VERSION " 1.2.0devel" #define VERSION " 1.2.0devel"
static int32_t floor_over_floor; static int32_t floor_over_floor;

View file

@ -48,7 +48,7 @@ extern void S_PlaySound(int32_t num);
extern int32_t A_PlaySound(uint32_t num,int32_t i); extern int32_t A_PlaySound(uint32_t num,int32_t i);
extern void S_StopSound(int32_t num); extern void S_StopSound(int32_t num);
extern void S_StopEnvSound(int32_t num,int32_t i); extern void S_StopEnvSound(int32_t num,int32_t i);
extern void pan3dsound(void); extern void S_Pan3D(void);
extern void S_TestSoundCallback(uint32_t num); extern void S_TestSoundCallback(uint32_t num);
extern void S_ClearSoundLocks(void); extern void S_ClearSoundLocks(void);
extern int32_t A_CallSound(int32_t sn,int32_t whatsprite); extern int32_t A_CallSound(int32_t sn,int32_t whatsprite);
@ -80,7 +80,7 @@ extern int32_t Sect_DamageCeiling(int32_t sn);
extern void A_DamageObject(int32_t i,int32_t sn); extern void A_DamageObject(int32_t i,int32_t sn);
extern void allignwarpelevators(void); extern void allignwarpelevators(void);
extern void G_HandleSharedKeys(int32_t snum); extern void G_HandleSharedKeys(int32_t snum);
extern void checksectors(int32_t snum); extern void P_CheckSectors(int32_t snum);
extern int32 RTS_AddFile(const char *filename); extern int32 RTS_AddFile(const char *filename);
extern void RTS_Init(const char *filename); extern void RTS_Init(const char *filename);
extern int32 RTS_NumSounds(void); extern int32 RTS_NumSounds(void);
@ -96,7 +96,7 @@ extern void P_ResetWeapons(int32_t snum);
extern void P_ResetInventory(int32_t snum); extern void P_ResetInventory(int32_t snum);
extern void G_NewGame(int32_t vn,int32_t ln,int32_t sk); extern void G_NewGame(int32_t vn,int32_t ln,int32_t sk);
extern void G_ResetTimers(void); extern void G_ResetTimers(void);
extern void waitforeverybody(void); extern void Net_WaitForEverybody(void);
extern void clearfifo(void); extern void clearfifo(void);
extern void Net_ResetPrediction(void); extern void Net_ResetPrediction(void);
extern int32_t G_EnterLevel(int32_t g); extern int32_t G_EnterLevel(int32_t g);
@ -257,17 +257,10 @@ extern void Net_NewGame(int32_t volume, int32_t level);
extern int32_t SpriteFlags[MAXTILES]; extern int32_t SpriteFlags[MAXTILES];
inline int32_t A_CheckSpriteFlags(int32_t iActor, int32_t iType) #define A_CheckSpriteFlags(iActor, iType) (((SpriteFlags[sprite[iActor].picnum]^ActorExtra[iActor].flags) & iType) != 0)
{ #define A_CheckSpriteTileFlags(iPicnum, iType) ((SpriteFlags[iPicnum] & iType) != 0)
return (((SpriteFlags[sprite[iActor].picnum]^ActorExtra[iActor].flags) & iType) != 0);
}
inline int32_t A_CheckSpriteTileFlags(int32_t iPicnum, int32_t iType) static inline int32_t G_GetTeamPalette(int32_t team)
{
return ((SpriteFlags[iPicnum] & iType) != 0);
}
inline int32_t G_GetTeamPalette(int32_t team)
{ {
switch (team) switch (team)
{ {

View file

@ -10090,7 +10090,7 @@ static void G_DisplayLogo(void)
MOUSE_ClearButton(LEFT_MOUSE); MOUSE_ClearButton(LEFT_MOUSE);
} }
waitforeverybody(); Net_WaitForEverybody();
flushperms(); flushperms();
clearview(0L); clearview(0L);
@ -10563,7 +10563,7 @@ static void Net_SendVersion(void)
if (i != myconnectindex) mmulti_sendpacket(i,&buf[0],5); if (i != myconnectindex) mmulti_sendpacket(i,&buf[0],5);
if ((!g_networkBroadcastMode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master if ((!g_networkBroadcastMode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
} }
waitforeverybody(); Net_WaitForEverybody();
} }
static void Net_SendPlayerOptions(void) static void Net_SendPlayerOptions(void)
@ -11263,7 +11263,7 @@ CLEAN_DIRECTORY:
Net_SendWeaponChoice(); Net_SendWeaponChoice();
Net_SendUserMapName(); Net_SendUserMapName();
Net_GetPackets(); Net_GetPackets();
waitforeverybody(); Net_WaitForEverybody();
} }
else if (boardfilename[0] != 0) else if (boardfilename[0] != 0)
{ {
@ -11436,7 +11436,7 @@ MAIN_LOOP_RESTART:
ud.m_respawn_monsters = 1; ud.m_respawn_monsters = 1;
else ud.m_respawn_monsters = 0; else ud.m_respawn_monsters = 0;
waitforeverybody(); Net_WaitForEverybody();
TRAVERSE_CONNECT(i) TRAVERSE_CONNECT(i)
{ {
@ -11515,7 +11515,7 @@ MAIN_LOOP_RESTART:
if (g_player[myconnectindex].ps->gm&MODE_EOL) if (g_player[myconnectindex].ps->gm&MODE_EOL)
{ {
G_CloseDemoWrite(); G_CloseDemoWrite();
waitforeverybody(); Net_WaitForEverybody();
ready2send = 0; ready2send = 0;
@ -11550,7 +11550,7 @@ MAIN_LOOP_RESTART:
} }
ud.display_bonus_screen = 1; ud.display_bonus_screen = 1;
ready2send = 0; ready2send = 0;
waitforeverybody(); Net_WaitForEverybody();
if (numplayers > 1) g_player[myconnectindex].ps->gm = MODE_GAME; if (numplayers > 1) g_player[myconnectindex].ps->gm = MODE_GAME;
if (G_EnterLevel(g_player[myconnectindex].ps->gm)) if (G_EnterLevel(g_player[myconnectindex].ps->gm))
{ {
@ -12732,7 +12732,7 @@ static int32_t G_DoMoveThings(void)
if (ud.pause_on == 0) if (ud.pause_on == 0)
{ {
P_ProcessInput(i); P_ProcessInput(i);
checksectors(i); P_CheckSectors(i);
} }
} }
@ -12745,7 +12745,7 @@ static int32_t G_DoMoveThings(void)
{ {
G_AnimateWalls(); G_AnimateWalls();
A_MoveCyclers(); A_MoveCyclers();
pan3dsound(); S_Pan3D();
} }
#ifdef POLYMER #ifdef POLYMER

View file

@ -2167,7 +2167,9 @@ static int32_t X_DoExecute(void)
int32_t x2=scale(Gv_GetVarX(*insptr++),xdim,320); int32_t x2=scale(Gv_GetVarX(*insptr++),xdim,320);
int32_t y2=scale(Gv_GetVarX(*insptr++),ydim,200); int32_t y2=scale(Gv_GetVarX(*insptr++),ydim,200);
int32_t smoothratio = min(max((totalclock - ototalclock) * (65536 / TICSPERFRAME),0),65536); int32_t smoothratio = min(max((totalclock - ototalclock) * (65536 / TICSPERFRAME),0),65536);
#if defined(USE_OPENGL) && defined(POLYMOST)
int32_t j; int32_t j;
#endif
if (x1 > x2) swaplong(&x1,&x2); if (x1 > x2) swaplong(&x1,&x2);
if (y1 > y2) swaplong(&y1,&y2); if (y1 > y2) swaplong(&y1,&y2);
@ -3769,7 +3771,7 @@ static int32_t X_DoExecute(void)
case CON_DISPLAYRANDVAR: case CON_DISPLAYRANDVAR:
insptr++; insptr++;
Gv_SetVarX(*insptr, mulscale15(rand(), *(insptr+1)+1)); Gv_SetVarX(*insptr, mulscale15((uint16_t)rand(), *(insptr+1)+1));
insptr += 2; insptr += 2;
break; break;
@ -3841,7 +3843,7 @@ static int32_t X_DoExecute(void)
insptr++; insptr++;
{ {
int32_t j=*insptr++; int32_t j=*insptr++;
Gv_SetVarX(j,mulscale(rand(), Gv_GetVarX(*insptr++)+1, 15)); Gv_SetVarX(j,mulscale((uint16_t)rand(), Gv_GetVarX(*insptr++)+1, 15));
} }
break; break;
@ -4883,7 +4885,7 @@ void G_RestoreMapState(mapstate_t *save)
Net_ResetPrediction(); Net_ResetPrediction();
waitforeverybody(); Net_WaitForEverybody();
mmulti_flushpackets(); mmulti_flushpackets();
clearfifo(); clearfifo();
G_ResetTimers(); G_ResetTimers();

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
const char *s_buildDate = "20090131"; const char *s_buildDate = "20090227";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int32_t g_musicSize; int32_t g_musicSize;

View file

@ -201,7 +201,7 @@ int32_t G_LoadPlayer(int32_t spot)
nextpage(); nextpage();
} }
waitforeverybody(); Net_WaitForEverybody();
FX_StopAllSounds(); FX_StopAllSounds();
S_ClearSoundLocks(); S_ClearSoundLocks();
@ -574,7 +574,7 @@ int32_t G_LoadPlayer(int32_t spot)
mmulti_flushpackets(); mmulti_flushpackets();
clearfifo(); clearfifo();
waitforeverybody(); Net_WaitForEverybody();
G_ResetTimers(); G_ResetTimers();
@ -606,7 +606,7 @@ int32_t G_SavePlayer(int32_t spot)
return -1; return -1;
} }
waitforeverybody(); Net_WaitForEverybody();
if (multiflag == 2 && multiwho != myconnectindex) if (multiflag == 2 && multiwho != myconnectindex)
{ {
@ -878,7 +878,7 @@ int32_t G_SavePlayer(int32_t spot)
ready2send = 1; ready2send = 1;
waitforeverybody(); Net_WaitForEverybody();
ototalclock = totalclock; ototalclock = totalclock;

View file

@ -3000,10 +3000,7 @@ CHECKINV1:
if (p->cursectnum > -1) if (p->cursectnum > -1)
{ {
p->holoduke_on = i = p->holoduke_on = i = A_InsertSprite(p->cursectnum,p->posx,p->posy,
A_InsertSprite(p->cursectnum,
p->posx,
p->posy,
p->posz+(30<<8),APLAYER,-64,0,0,p->ang,0,0,-1,10); p->posz+(30<<8),APLAYER,-64,0,0,p->ang,0,0,-1,10);
T4 = T5 = 0; T4 = T5 = 0;
SP = snum; SP = snum;
@ -3142,7 +3139,7 @@ static int32_t hitawall(DukePlayer_t *p,int16_t *hitw)
} }
void checksectors(int32_t snum) void P_CheckSectors(int32_t snum)
{ {
int32_t i = -1,oldz; int32_t i = -1,oldz;
DukePlayer_t *p = g_player[snum].ps; DukePlayer_t *p = g_player[snum].ps;

View file

@ -52,11 +52,12 @@ int32_t backflag,g_numEnvSoundsPlaying;
void S_SoundStartup(void) void S_SoundStartup(void)
{ {
int32_t status; int32_t status, err = 0;
// if they chose None lets return // if they chose None lets return
if (ud.config.FXDevice < 0) return; if (ud.config.FXDevice < 0) return;
RETRY:
status = FX_Init(ud.config.FXDevice, ud.config.NumVoices, ud.config.NumChannels, ud.config.NumBits, ud.config.MixRate); status = FX_Init(ud.config.FXDevice, ud.config.NumVoices, ud.config.NumChannels, ud.config.NumBits, ud.config.MixRate);
if (status == FX_Ok) if (status == FX_Ok)
{ {
@ -70,6 +71,20 @@ void S_SoundStartup(void)
if (status != FX_Ok) if (status != FX_Ok)
{ {
if (!err)
{
#if defined(_WIN32)
ud.config.MixRate = 44100;
#else
ud.config.MixRate = 48000;
#endif
ud.config.NumBits = 16;
ud.config.NumChannels = 2;
ud.config.NumVoices = 32;
ud.config.ReverseStereo = 0;
err = 1;
goto RETRY;
}
Bsprintf(tempbuf, "Sound startup error: %s", FX_ErrorString(FX_Error)); Bsprintf(tempbuf, "Sound startup error: %s", FX_ErrorString(FX_Error));
G_GameExit(tempbuf); G_GameExit(tempbuf);
} }
@ -123,17 +138,27 @@ void S_MusicStartup(void)
} }
else else
{ {
initprintf("Couldn't find selected sound card, or, error w/ sound card itself.\n"); ud.config.MusicDevice = 0;
S_SoundShutdown(); status = MUSIC_Init(ud.config.MusicDevice, 0);
uninittimer();
uninitengine(); if (status == MUSIC_Ok)
CONTROL_Shutdown(); {
CONFIG_WriteSetup(); MUSIC_SetVolume(ud.config.MusicVolume);
KB_Shutdown(); }
uninitgroupfile(); /*
//unlink("duke3d.tmp"); initprintf("Couldn't find selected sound card, or, error w/ sound card itself.\n");
exit(-1);
S_SoundShutdown();
uninittimer();
uninitengine();
CONTROL_Shutdown();
CONFIG_WriteSetup();
KB_Shutdown();
uninitgroupfile();
//unlink("duke3d.tmp");
exit(-1);
*/
} }
} }
@ -160,11 +185,6 @@ void S_MusicShutdown(void)
} }
} }
void MusicUpdate(void)
{
MUSIC_Update();
}
void S_MenuSound(void) void S_MenuSound(void)
{ {
static int32_t SoundNum=0; static int32_t SoundNum=0;
@ -189,7 +209,7 @@ void S_MenuSound(void)
SELECT_WEAPON SELECT_WEAPON
}; };
S_PlaySound(menusnds[SoundNum++]); S_PlaySound(menusnds[SoundNum++]);
SoundNum %= 17; SoundNum %= (sizeof(menusnds)/sizeof(menusnds[0]));
} }
void _playmusic(const char *fn) void _playmusic(const char *fn)
@ -246,7 +266,7 @@ int32_t S_LoadSound(uint32_t num)
return 0; return 0;
} }
if (g_sounds[num].filename1)fp = kopen4loadfrommod(g_sounds[num].filename1,g_loadFromGroupOnly); if (g_sounds[num].filename1) fp = kopen4loadfrommod(g_sounds[num].filename1,g_loadFromGroupOnly);
if (fp == -1)fp = kopen4loadfrommod(g_sounds[num].filename,g_loadFromGroupOnly); if (fp == -1)fp = kopen4loadfrommod(g_sounds[num].filename,g_loadFromGroupOnly);
if (fp == -1) if (fp == -1)
{ {
@ -550,7 +570,7 @@ void S_StopEnvSound(int32_t num,int32_t i)
} }
} }
void pan3dsound(void) void S_Pan3D(void)
{ {
int32_t sndist, sx, sy, sz, cx, cy, cz; int32_t sndist, sx, sy, sz, cx, cy, cz;
int32_t sndang,ca,j,k,i,cs; int32_t sndang,ca,j,k,i,cs;