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

This commit is contained in:
terminx 2008-11-23 03:09:34 +00:00
parent 0b858c5ef3
commit f2a2b491d6
7 changed files with 71 additions and 110 deletions

View file

@ -12311,7 +12311,8 @@ static void Net_DoPrediction(void)
}
if (myz < (fz-(i<<8)) && (G_CheckForSpaceFloor(psect)|G_CheckForSpaceCeiling(psect)) == 0) //falling
{
if (TEST_SYNC_KEY(sb_snum, SK_JUMP|SK_CROUCH) == 0 && myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8)))
if (!TEST_SYNC_KEY(sb_snum, SK_JUMP) && !TEST_SYNC_KEY(sb_snum, SK_CROUCH) &&
myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8)))
myz = fz-(i<<8);
else
{

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//-------------------------------------------------------------------------
#include "duke3d.h"
char *s_builddate = "20081121";
char *s_builddate = "20081122";
char *MusicPtr = NULL;
int g_musicSize;

View file

@ -70,7 +70,7 @@ static int music_initialized = 0;
static int music_context = 0;
static int music_loopflag = MUSIC_PlayOnce;
static Mix_Music *music_musicchunk = NULL;
static char *music_songdata = NULL;
// static char *music_songdata = NULL;
// This gets called all over the place for information and debugging messages.
// If the user set the DUKESND_DEBUG environment variable, the messages
@ -294,59 +294,28 @@ int MUSIC_StopSong(void)
if (music_musicchunk)
Mix_FreeMusic(music_musicchunk);
if (music_songdata)
Bfree(music_songdata);
// if (music_songdata)
// Bfree(music_songdata);
music_musicchunk = NULL;
music_songdata = NULL;
// music_songdata = NULL;
return(MUSIC_Ok);
} // MUSIC_StopSong
// Duke3D-specific. --ryan.
void MUSIC_PlayMusic(char *_filename)
// void MUSIC_PlayMusic(char *_filename)
int MUSIC_PlaySong(unsigned char *song, int loopflag)
{
int handle;
int size;
int rc;
MUSIC_StopSong();
handle = kopen4load(_filename, 0);
if (handle == -1)
return;
size = kfilelength(handle);
if (size == -1)
{
kclose(handle);
return;
} // if
music_songdata = Bcalloc(size,sizeof(char));
if (music_songdata == NULL)
{
kclose(handle);
return;
} // if
rc = kread(handle, music_songdata, size);
kclose(handle);
if (rc != size)
{
Bfree(music_songdata);
music_songdata = NULL;
return;
} // if
music_musicchunk = Mix_LoadMUS_RW(SDL_RWFromMem((char *) music_songdata, size));
music_musicchunk = Mix_LoadMUS_RW(SDL_RWFromMem((char *) song, g_musicSize));
if (music_musicchunk != NULL)
{
// !!! FIXME: I set the music to loop. Hope that's okay. --ryan.
g_musicSize = size;
Mix_PlayMusic(music_musicchunk, -1);
} // if
return MUSIC_Ok;
}

View file

@ -4080,7 +4080,7 @@ void P_ProcessInput(int snum)
// not jumping or crouching
if (!TEST_SYNC_KEY(sb_snum, SK_JUMP|SK_CROUCH) && p->on_ground && (sector[psect].floorstat&2) && p->posz >= (fz-(i<<8)-(16<<8)))
if (!TEST_SYNC_KEY(sb_snum, SK_JUMP) && !TEST_SYNC_KEY(sb_snum, SK_CROUCH) && p->on_ground && (sector[psect].floorstat&2) && p->posz >= (fz-(i<<8)-(16<<8)))
p->posz = fz-(i<<8);
else
{

View file

@ -2584,7 +2584,7 @@ void G_HandleSharedKeys(int snum)
}
// j = sb_snum & ((15<<8)|(1<<12)|(1<<15)|(1<<16)|(1<<22)|(1<<19)|(1<<20)|(1<<21)|(1<<24)|(1<<25)|(1<<27)|(1<<28)|(1<<29)|(1<<30)|(1<<31));
j = sb_snum & ((15<<8)|BIT(SK_STEROIDS)|BIT(SK_NIGHTVISION)|BIT(SK_MEDKIT)|BIT(SK_QUICK_KICK)| \
j = sb_snum & ((15<<SK_WEAPON_BITS)|BIT(SK_STEROIDS)|BIT(SK_NIGHTVISION)|BIT(SK_MEDKIT)|BIT(SK_QUICK_KICK)| \
BIT(SK_HOLSTER)|BIT(SK_INV_LEFT)|BIT(SK_PAUSE)|BIT(SK_HOLODUKE)|BIT(SK_JETPACK)|BIT(SK_INV_RIGHT)| \
BIT(SK_TURNAROUND)|BIT(SK_OPEN)|BIT(SK_INVENTORY)|BIT(SK_ESCAPE));
sb_snum = j & ~p->interface_toggle_flag;
@ -2681,7 +2681,7 @@ void G_HandleSharedKeys(int snum)
sb_snum |= BIT(SK_INV_LEFT); // emulate move left...
}
if (p->newowner == -1)
if (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT|SK_INV_RIGHT))
if (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT) || TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT))
{
p->invdisptime = 26*2;

View file

@ -194,37 +194,28 @@ void S_MenuSound(void)
void _playmusic(const char *fn)
{
#if defined(_WIN32)
int fp, l;
#else
extern void MUSIC_PlayMusic(char *_filename);
#endif
if (fn == NULL) return;
if (ud.config.MusicToggle == 0) return;
if (ud.config.MusicDevice < 0) return;
#if defined(_WIN32)
fp = kopen4loadfrommod((char *)fn,0);
if (fp == -1) return;
l = kfilelength(fp);
MUSIC_StopSong();
g_musicSize=0;
if (!MusicPtr)
MusicPtr=Bcalloc(1,l * sizeof(char));
if (!MusicPtr) MusicPtr=Bcalloc(1,l * sizeof(char));
else MusicPtr=Brealloc(MusicPtr,l * sizeof(char));
g_musicSize=l;
kread(fp, (unsigned char *)MusicPtr, l);
kclose(fp);
MUSIC_PlaySong((unsigned char *)MusicPtr, MUSIC_LoopSong);
#else
// FIXME: I need this to get the music volume initialized (not sure why) -- Jim Bentler
MUSIC_SetVolume(ud.config.MusicVolume);
MUSIC_PlayMusic((char *)fn);
#endif
MUSIC_PlaySong((unsigned char *)MusicPtr, MUSIC_LoopSong);
}
int S_PlayMusic(const char *fn, const int sel)