Fix a couple of minor issues

git-svn-id: https://svn.eduke32.com/eduke32@1488 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-08-09 05:32:17 +00:00
parent 0358aee38e
commit dbd9e63d00
13 changed files with 63 additions and 30 deletions

View file

@ -287,7 +287,7 @@ $(OBJ)/%.$o: $(SRC)/jmact/%.c
$(OBJ)/%.$o: $(SRC)/misc/%.rc $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(COMPILE_STATUS) $(COMPILE_STATUS)
if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DPOLYMER=$(POLYMER); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/util/%.c $(OBJ)/%.$o: $(SRC)/util/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)

View file

@ -1,6 +1,8 @@
#ifndef _mdsprite_h_ #ifndef _mdsprite_h_
# define _mdsprite_h_ # define _mdsprite_h_
#include "hightile.h"
#ifdef __POWERPC__ #ifdef __POWERPC__
#define SHIFTMOD32(a) ((a)&31) #define SHIFTMOD32(a) ((a)&31)
#else #else

View file

@ -3,6 +3,8 @@
#ifdef POLYMOST #ifdef POLYMOST
#include "hightile.h"
#define CULL_OFFSET 384 #define CULL_OFFSET 384
#define CULL_DELAY 2 #define CULL_DELAY 2
#define MAXCULLCHECKS 1024 #define MAXCULLCHECKS 1024

View file

@ -7,6 +7,8 @@
#include "winlayer.h" #include "winlayer.h"
#endif #endif
#include "polymost.h"
char scantoasc[128] = char scantoasc[128] =
{ {
0,0,'1','2','3','4','5','6','7','8','9','0','-','=',0,0, 0,0,'1','2','3','4','5','6','7','8','9','0','-','=',0,0,

View file

@ -9907,8 +9907,10 @@ void setbrightness(char dabrightness, uint8_t *dapal, char noapply)
gltexinvalidateall(); gltexinvalidateall();
if (!(noapply&8) && (newpalettesum != lastpalettesum)) if (!(noapply&8) && (newpalettesum != lastpalettesum))
gltexinvalidate8(); gltexinvalidate8();
#ifdef POLYMER
if ((rendmode == 4) && (newpalettesum != lastpalettesum)) if ((rendmode == 4) && (newpalettesum != lastpalettesum))
polymer_texinvalidate(); polymer_texinvalidate();
#endif
lastpalettesum = newpalettesum; lastpalettesum = newpalettesum;
} }
#endif #endif
@ -11937,13 +11939,13 @@ int32_t setrendermode(int32_t renderer)
UNREFERENCED_PARAMETER(renderer); UNREFERENCED_PARAMETER(renderer);
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
if (bpp == 8) renderer = 0; if (bpp == 8) renderer = 0;
else renderer = min(4,max(3,renderer));
# ifdef POLYMER # ifdef POLYMER
else renderer = min(4,max(3,renderer));
if (renderer == 4) if (renderer == 4)
polymer_init(); polymer_init();
# else # else
if (renderer == 4) else renderer = 3;
renderer = 3;
# endif # endif
rendmode = renderer; rendmode = renderer;

View file

@ -812,12 +812,15 @@ int32_t initinput(void)
joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0; joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0;
{ {
TCHAR layoutname[KL_NAMELENGTH]; char layoutname[KL_NAMELENGTH];
// GetKeyboardLayoutName(layoutname);
// initprintf(" * Keyboard layout: %s\n",layoutname);
LoadKeyboardLayout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_SUBSTITUTE_OK);
GetKeyboardLayoutName(layoutname); GetKeyboardLayoutName(layoutname);
initprintf("Using keyboard layout %s\n",layoutname); if (Bstrcmp(layoutname, "00000409"))
{
initprintf("Switching kb layout from %s ",layoutname);
i = LoadKeyboardLayout("00000409", KLF_ACTIVATE|KLF_SETFORPROCESS|KLF_SUBSTITUTE_OK);
GetKeyboardLayoutName(layoutname);
initprintf("to %s\n",layoutname);
}
} }
if (InitDirectInput()) if (InitDirectInput())

View file

@ -697,10 +697,8 @@ inline void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, i
#else #else
UNREFERENCED_PARAMETER(radius); UNREFERENCED_PARAMETER(radius);
UNREFERENCED_PARAMETER(sector); UNREFERENCED_PARAMETER(srcsprite);
UNREFERENCED_PARAMETER(x); UNREFERENCED_PARAMETER(zoffset);
UNREFERENCED_PARAMETER(y);
UNREFERENCED_PARAMETER(z);
UNREFERENCED_PARAMETER(range); UNREFERENCED_PARAMETER(range);
UNREFERENCED_PARAMETER(color); UNREFERENCED_PARAMETER(color);
UNREFERENCED_PARAMETER(priority); UNREFERENCED_PARAMETER(priority);

View file

@ -52,7 +52,7 @@ extern "C" {
#include "macros.h" #include "macros.h"
#define APPNAME "EDuke32" #define APPNAME "EDuke32"
#define VERSION " 2.0.0unstable" #define VERSION " 1.5.0unstable"
// this is checked against http://eduke32.com/VERSION // this is checked against http://eduke32.com/VERSION
extern const char *s_buildDate; extern const char *s_buildDate;
#define HEAD2 APPNAME VERSION #define HEAD2 APPNAME VERSION

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 = "20090708"; const char *s_buildDate = "20090807";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int32_t g_musicSize; int32_t g_musicSize;

View file

@ -25,8 +25,9 @@ BEGIN
CONTROL "&Video mode:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 6, 50, 8 CONTROL "&Video mode:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 6, 50, 8
CONTROL "", IDCVMODE, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 4, 86, 56 CONTROL "", IDCVMODE, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 4, 86, 56
CONTROL "&Fullscreen", IDCFULLSCREEN, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 154, 6, 46, 10 CONTROL "&Fullscreen", IDCFULLSCREEN, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 154, 6, 46, 10
#ifdef POLYMER
CONTROL "&Polymer", IDCPOLYMER, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 203, 6, 40, 10 CONTROL "&Polymer", IDCPOLYMER, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 203, 6, 40, 10
#endif
CONTROL "Input devices:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 20, 50, 8 CONTROL "Input devices:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 20, 50, 8
CONTROL "", IDCINPUT, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 19, 86, 56 CONTROL "", IDCINPUT, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 19, 86, 56
CONTROL "&Game:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 35, 100, 8 CONTROL "&Game:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 35, 100, 8

View file

@ -172,8 +172,10 @@ static void A_HitscanProjTrail(const vec3_t *sv, const vec3_t *dv, int32_t ang,
srcvect.y += destvect.y; srcvect.y += destvect.y;
srcvect.z += destvect.z; srcvect.z += destvect.z;
updatesector(srcvect.x,srcvect.y,&sect); updatesector(srcvect.x,srcvect.y,&sect);
if (sect < 0)
break;
getzsofslope(sect,srcvect.x,srcvect.y,&n,&j); getzsofslope(sect,srcvect.x,srcvect.y,&n,&j);
if (sect < 0 || srcvect.z > j || srcvect.z < n) if (srcvect.z > j || srcvect.z < n)
break; break;
j = A_InsertSprite(sect,srcvect.x,srcvect.y,srcvect.z,ProjectileData[atwith].trail,-32,ProjectileData[atwith].txrepeat,ProjectileData[atwith].tyrepeat,ang,0,0,g_player[0].ps->i,0); j = A_InsertSprite(sect,srcvect.x,srcvect.y,srcvect.z,ProjectileData[atwith].trail,-32,ProjectileData[atwith].txrepeat,ProjectileData[atwith].tyrepeat,ang,0,0,g_player[0].ps->i,0);
changespritestat(j,1); changespritestat(j,1);
@ -4068,7 +4070,7 @@ void P_ProcessInput(int32_t snum)
if (p->scream_voice >= FX_Ok) if (p->scream_voice >= FX_Ok)
{ {
FX_StopSound(p->scream_voice); FX_StopSound(p->scream_voice);
S_TestSoundCallback(DUKE_SCREAM); // S_TestSoundCallback(DUKE_SCREAM);
p->scream_voice = -1; p->scream_voice = -1;
} }

View file

@ -2959,7 +2959,7 @@ CHECKINV1:
if (p->scream_voice >= FX_Ok) if (p->scream_voice >= FX_Ok)
{ {
FX_StopSound(p->scream_voice); FX_StopSound(p->scream_voice);
S_TestSoundCallback(DUKE_SCREAM); // S_TestSoundCallback(DUKE_SCREAM);
p->scream_voice = -1; p->scream_voice = -1;
} }
@ -3106,7 +3106,6 @@ void P_CheckSectors(int32_t snum)
if (!TEST_SYNC_KEY(g_player[snum].sync->bits, SK_OPEN) && !TEST_SYNC_KEY(g_player[snum].sync->bits, SK_ESCAPE)) if (!TEST_SYNC_KEY(g_player[snum].sync->bits, SK_OPEN) && !TEST_SYNC_KEY(g_player[snum].sync->bits, SK_ESCAPE))
p->toggle_key_flag = 0; p->toggle_key_flag = 0;
else if (!p->toggle_key_flag) else if (!p->toggle_key_flag)
{ {

View file

@ -338,13 +338,25 @@ int32_t S_PlayMusic(const char *fn, const int32_t sel)
} }
while (0); while (0);
if (fp < 0) return 0; if (fp < 0)
{
OSD_Printf(OSD_ERROR "S_PlayMusic(): error: can't open '%s' for playback!",fn);
return 0;
}
S_StopMusic(); S_StopMusic();
g_musicSize = MusicLen = kfilelength(fp); MusicLen = kfilelength(fp);
MusicPtr = (char *) Bmalloc(MusicLen); MusicPtr = (char *) Bmalloc(MusicLen);
kread(fp, MusicPtr, MusicLen);
if ((g_musicSize = kread(fp, (char *)MusicPtr, MusicLen)) != MusicLen)
{
OSD_Printf(OSD_ERROR "S_PlayMusic(): error: read %d bytes from '%s', needed %d\n",g_musicSize, fn, MusicLen);
kclose(fp);
g_musicSize = 0;
return 0;
}
kclose(fp); kclose(fp);
if (!Bmemcmp(MusicPtr, "MThd", 4)) if (!Bmemcmp(MusicPtr, "MThd", 4))
@ -354,9 +366,9 @@ int32_t S_PlayMusic(const char *fn, const int32_t sel)
} }
else else
{ {
MusicVoice = FX_PlayLoopedAuto(MusicPtr, MusicLen, 0, 0, 0, ud.config.MusicVolume, if ((MusicVoice = FX_PlayLoopedAuto(MusicPtr, MusicLen, 0, 0, 0, ud.config.MusicVolume,
ud.config.MusicVolume, ud.config.MusicVolume, ud.config.MusicVolume, ud.config.MusicVolume,
FX_MUSIC_PRIORITY, MUSIC_ID); FX_MUSIC_PRIORITY, MUSIC_ID)) >= FX_Ok)
MusicIsWaveform = 1; MusicIsWaveform = 1;
} }
return (alt != 0); return (alt != 0);
@ -364,10 +376,13 @@ int32_t S_PlayMusic(const char *fn, const int32_t sel)
void S_StopMusic(void) void S_StopMusic(void)
{ {
MusicPaused = 0;
if (MusicIsWaveform && MusicVoice >= 0) if (MusicIsWaveform && MusicVoice >= 0)
{ {
FX_StopSound(MusicVoice); FX_StopSound(MusicVoice);
MusicVoice = -1; MusicVoice = -1;
MusicIsWaveform = 0;
} }
MUSIC_StopSong(); MUSIC_StopSong();
@ -437,7 +452,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
{ {
voice = S_PlaySound(num); voice = S_PlaySound(num);
if (voice >= FX_Ok && g_sounds[num].num < SOUNDMAX) if (voice >= FX_Ok && g_sounds[num].num < SOUNDMAX && i >= 0 && i < MAXSPRITES)
{ {
g_sounds[num].SoundOwner[g_sounds[num].num].i = i; g_sounds[num].SoundOwner[g_sounds[num].num].i = i;
g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice; g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice;
@ -640,7 +655,7 @@ void S_StopSound(int32_t num)
if (num >= 0 && num < MAXSOUNDS && g_sounds[num].num > 0) if (num >= 0 && num < MAXSOUNDS && g_sounds[num].num > 0)
{ {
FX_StopSound(g_sounds[num].SoundOwner[g_sounds[num].num-1].voice); FX_StopSound(g_sounds[num].SoundOwner[g_sounds[num].num-1].voice);
S_TestSoundCallback(num); // S_TestSoundCallback(num);
} }
} }
@ -657,7 +672,7 @@ void S_StopEnvSound(int32_t num,int32_t i)
if (g_sounds[num].SoundOwner[j].i == i) if (g_sounds[num].SoundOwner[j].i == i)
{ {
FX_StopSound(g_sounds[num].SoundOwner[j].voice); FX_StopSound(g_sounds[num].SoundOwner[j].voice);
S_TestSoundCallback(num); // S_TestSoundCallback(num);
return; return;
} }
} }
@ -694,6 +709,13 @@ void S_Pan3D(void)
{ {
i = g_sounds[j].SoundOwner[k].i; i = g_sounds[j].SoundOwner[k].i;
if (i < 0 || i >= MAXSPRITES)
{
OSD_Printf(OSD_ERROR "S_Pan3D(): INTERNAL ERROR: invalid id %d!\n",i);
k--;
continue;
}
Bmemcpy(&s, &sprite[i], sizeof(vec3_t)); Bmemcpy(&s, &sprite[i], sizeof(vec3_t));
if (PN == APLAYER && sprite[i].yvel == screenpeek) if (PN == APLAYER && sprite[i].yvel == screenpeek)