git-svn-id: https://svn.eduke32.com/eduke32@680 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-04-01 09:06:29 +00:00
parent 67591ce3a3
commit 51fdffe93e
12 changed files with 1599 additions and 1564 deletions

View file

@ -801,10 +801,8 @@ enum events {
enum gamevarflags {
MAXGAMEVARS = 2048, // must be a power of two
MAXGAMEARRAYS = 256, // must be lower than MAXGAMEVARS
MAXGAMEVARS = 2048, // must be a power of two
MAXVARLABEL = 26,
MAXARRAYLABEL = 26,
GAMEVAR_FLAG_NORMAL = 0, // normal
GAMEVAR_FLAG_PERPLAYER = 1, // per-player variable
GAMEVAR_FLAG_PERACTOR = 2, // per-actor variable
@ -814,10 +812,17 @@ enum gamevarflags {
GAMEVAR_FLAG_NODEFAULT = 1024, // don't reset on actor spawn
GAMEVAR_FLAG_SYSTEM = 2048, // cannot change mode flags...(only default value)
GAMEVAR_FLAG_READONLY = 4096, // values are read-only (no setvar allowed)
GAMEVAR_FLAG_INTPTR = 8192, // plValue is a pointer to an int
GAMEVAR_FLAG_INTPTR = 8192, // plValue is a pointer to an int
GAMEVAR_FLAG_SYNCCHECK = 16384, // check event sync when translating
GAMEVAR_FLAG_SHORTPTR = 32768, // plValue is a pointer to a short
GAMEVAR_FLAG_CHARPTR = 65536 // plValue is a pointer to a char
GAMEVAR_FLAG_SHORTPTR = 32768, // plValue is a pointer to a short
GAMEVAR_FLAG_CHARPTR = 65536, // plValue is a pointer to a char
};
enum gamearrayflags {
MAXGAMEARRAYS = (MAXGAMEVARS>>2), // must be lower than MAXGAMEVARS
MAXARRAYLABEL = MAXVARLABEL,
GAMEARRAY_FLAG_NORMAL = 0,
GAMEARRAY_FLAG_NORESET = 1,
};
typedef struct {
@ -828,12 +833,14 @@ typedef struct {
char *szLabel;
char bReset;
} gamevar_t;
typedef struct {
char *szLabel;
int *plValues; // array of values
intptr_t *plValues; // array of values
int size;
char bReset;
} gamearray_t;
extern gamevar_t aGameVars[MAXGAMEVARS];
extern gamearray_t aGameArrays[MAXGAMEARRAYS];
extern int iGameVarCount;

View file

@ -31,7 +31,7 @@ extern void SoundShutdown(void);
extern void MusicStartup(void);
extern void MusicShutdown(void);
extern void intomenusounds(void);
extern int playmusicMAP(const char *fn, const int sel);
extern int playmusic(const char *fn, const int sel);
extern int loadsound(unsigned num);
extern int xyzsound(int num,int i,int x,int y,int z);
extern void sound(int num);

View file

@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <shellapi.h>
extern int getversionfromwebsite(char *buffer);
#define BUILDDATE 20080321
#define BUILDDATE 20080401
#define UPDATEINTERVAL 604800 // 1w
#endif
@ -7994,7 +7994,7 @@ static void nonsharedkeys(void)
music_select = 0;
if (map[(unsigned char)music_select].musicfn != NULL)
{
if (playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select))
if (playmusic(&map[(unsigned char)music_select].musicfn[0],music_select))
Bsprintf(fta_quotes[26],"PLAYING %s",&map[(unsigned char)music_select].musicfn1[0]);
else
Bsprintf(fta_quotes[26],"PLAYING %s",&map[(unsigned char)music_select].musicfn[0]);
@ -8695,7 +8695,7 @@ static int AL_DefineMusic(char *ID,char *name)
map[sel].musicfn1=makename(map[sel].musicfn1,name,ID);
// initprintf("%-15s | ",ID);
// initprintf("%3d %2d %2d | %s\n",sel,ep,lev,map[sel].musicfn1);
// playmusicMAP(ID,sel);
// playmusic(ID,sel);
return 0;
}
@ -9460,7 +9460,7 @@ static void Logo(void)
if (logoflags & LOGO_FLAG_PLAYMUSIC)
{
music_select = -1; // hack
playmusicMAP(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
playmusic(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
}
if (!NAM)

View file

@ -6996,7 +6996,7 @@ static int parse(void)
insptr++;
music_select=(ud.volume_number*MAXLEVELS)+(*(insptr++));
if (map[(unsigned char)music_select].musicfn != NULL)
playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select);
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
break;
case CON_GETTEXTURECEILING:

View file

@ -30,7 +30,7 @@ extern int g_i,g_p;
static void ResetPointerVars(void);
static void FreeGameVars(void)
static void FreeGameVars(void) /* called from ReadGameVars() and ResetGameVars() */
{
// call this function as many times as needed.
int i;
@ -323,7 +323,7 @@ void DumpGameVars(FILE *fp)
fprintf(fp,"\n// end of game definitions\n");
}
void ResetGameVars(void)
void ResetGameVars(void) /* this is called during a new game and nowhere else */
{
int i;

View file

@ -362,3 +362,32 @@ int FX_StopAllSounds
void AudioUpdate(void) { }
int FX_PlayLoopedOGG
(
char *ptr,
int loopstart,
int loopend,
int pitchoffset,
int vol,
int left,
int right,
int priority,
unsigned int callbackval
)
{
return(0);
}
int FX_PlayOGG3D
(
char *ptr,
int pitchoffset,
int angle,
int distance,
int priority,
unsigned int callbackval
)
{
return(0);
}

View file

@ -705,6 +705,7 @@ int FX_PlayWAV
Begin playback of sound data with the given volume and priority.
---------------------------------------------------------------------*/
int FX_PlayOGG
(
char *ptr,
@ -1159,18 +1160,3 @@ void FX_StopRecord
extern void MUSIC_Update(void);
void AudioUpdate(void) { MUSIC_Update(); }
void playmusic(const char *fn);
int playmusicMAP(const char *fn,const int sel)
{
Musicsize=0;
if(map[sel].musicfn1 != NULL)
playmusic(map[sel].musicfn1);
if(!Musicsize)
{
playmusic(fn);
return 0;
}
return 1;
}

View file

@ -4239,9 +4239,9 @@ cheat_for_port_credits:
if (ud.recstat != 2 && g_player[myconnectindex].ps->gm&MODE_GAME)
{
if (map[(unsigned char)music_select].musicfn != NULL)
playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select);
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
}
else playmusicMAP(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
else playmusic(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
MUSIC_Continue();
}

View file

@ -366,9 +366,9 @@ static int osdcmd_restartsound(const osdfuncparm_t *parm)
if (ud.recstat != 2 && g_player[myconnectindex].ps->gm&MODE_GAME)
{
if (map[(unsigned char)music_select].musicfn != NULL)
playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select);
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
}
else playmusicMAP(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
else playmusic(&env_music_fn[0][0],MAXVOLUMES*MAXLEVELS);
}
return OSDCMD_OK;

View file

@ -402,7 +402,7 @@ void cacheit(void)
return;
MUSIC_StopSong();
playmusicMAP(&env_music_fn[2][0],MAXVOLUMES*MAXLEVELS+2); // loadmus
playmusic(&env_music_fn[2][0],MAXVOLUMES*MAXLEVELS+2); // loadmus
starttime = getticks();
@ -1185,7 +1185,7 @@ void newgame(int vn,int ln,int sk)
if (ln == 0 && vn == 3 && ud.multimode < 2 && ud.lockout == 0)
{
playmusicMAP(&env_music_fn[1][0],MAXVOLUMES*MAXLEVELS+1);
playmusic(&env_music_fn[1][0],MAXVOLUMES*MAXLEVELS+1);
flushperms();
setview(0,0,xdim-1,ydim-1);
@ -1761,7 +1761,7 @@ int enterlevel(int g)
{
music_select = (ud.volume_number*MAXLEVELS) + ud.level_number;
if (map[(unsigned char)music_select].musicfn != NULL)
playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select);
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
}
if ((g&MODE_GAME) || (g&MODE_EOL))

View file

@ -415,7 +415,7 @@ int loadplayer(int spot)
if (map[(unsigned char)music_select].musicfn != NULL && (i != music_select || env_music_fn[2][0]))
{
MUSIC_StopSong();
playmusicMAP(&map[(unsigned char)music_select].musicfn[0],music_select);
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
}
g_player[myconnectindex].ps->gm = MODE_GAME;

View file

@ -193,7 +193,7 @@ void intomenusounds(void)
menunum %= 17;
}
void playmusic(const char *fn)
void _playmusic(const char *fn)
{
#if defined(_WIN32)
int fp, l;
@ -228,6 +228,19 @@ void playmusic(const char *fn)
#endif
}
int playmusic(const char *fn, const int sel)
{
Musicsize=0;
if(map[sel].musicfn1 != NULL)
_playmusic(map[sel].musicfn1);
if(!Musicsize)
{
_playmusic(fn);
return 0;
}
return 1;
}
int loadsound(unsigned int num)
{
int fp = -1, l;