Very few actual changes... mostly formatting fixes from astyle

git-svn-id: https://svn.eduke32.com/eduke32@1593 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2010-01-23 22:12:02 +00:00
parent addf597188
commit e65891aad6
33 changed files with 1541 additions and 1655 deletions

View file

@ -265,7 +265,7 @@ $(JAUDIOLIBDIR)/$(JAUDIOLIB):
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n" printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n"
endif endif
$(MAKE) -C $(JAUDIOLIBDIR) PRETTY_OUTPUT=$(PRETTY_OUTPUT) EROOT=$(EROOT) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) $(MAKE) -C $(JAUDIOLIBDIR) PRETTY_OUTPUT=$(PRETTY_OUTPUT) EROOT=$(EROOT) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) DEBUGANYWAY=$(DEBUGANYWAY)
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n" printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
endif endif

View file

@ -1,5 +1,6 @@
#ifndef __osxbits_h__ #ifndef __osxbits_h__
#define __osxbits_h__ #define __osxbits_h__
#include <sys/types.h>
int32_t osx_msgbox(char *name, char *msg); int32_t osx_msgbox(char *name, char *msg);
int32_t osx_ynbox(char *name, char *msg); int32_t osx_ynbox(char *name, char *msg);

View file

@ -54,6 +54,9 @@ extern float pr_specularpower;
extern float pr_specularfactor; extern float pr_specularfactor;
extern int32_t pr_ati_fboworkaround; extern int32_t pr_ati_fboworkaround;
extern int32_t pr_ati_nodepthoffset; extern int32_t pr_ati_nodepthoffset;
#ifdef __APPLE__
extern int32_t pr_ati_textureformat_one;
#endif
extern int32_t r_pr_maxlightpasses; extern int32_t r_pr_maxlightpasses;

View file

@ -2639,7 +2639,7 @@ static int32_t kzcheckhash(const char *filnam, char **zipnam, int32_t *fileoffs,
(*zipnam) = &kzhashbuf[*(int32_t *)&kzhashbuf[i+8]]; (*zipnam) = &kzhashbuf[*(int32_t *)&kzhashbuf[i+8]];
(*fileoffs) = *(int32_t *)&kzhashbuf[i+12]; (*fileoffs) = *(int32_t *)&kzhashbuf[i+12];
(*fileleng) = *(int32_t *)&kzhashbuf[i+16]; (*fileleng) = *(int32_t *)&kzhashbuf[i+16];
(*iscomp) = kzhashbuf[i+20]; (*iscomp) = *(int32_t *)&kzhashbuf[i+20];
return(1); return(1);
} }
return(0); return(0);

View file

@ -1050,6 +1050,20 @@ static md2model_t *md2load(int32_t fil, const char *filnam)
{ {
m->glcmds[i] = B_LITTLE32(m->glcmds[i]); m->glcmds[i] = B_LITTLE32(m->glcmds[i]);
} }
for (i = head.numtris-1; i>=0; i--)
{
m->tris[i].v[0] = B_LITTLE16(m->tris[i].v[0]);
m->tris[i].v[1] = B_LITTLE16(m->tris[i].v[1]);
m->tris[i].v[2] = B_LITTLE16(m->tris[i].v[2]);
m->tris[i].u[0] = B_LITTLE16(m->tris[i].u[0]);
m->tris[i].u[1] = B_LITTLE16(m->tris[i].u[1]);
m->tris[i].u[2] = B_LITTLE16(m->tris[i].u[2]);
}
for(i = head.numuv-1; i>=0; i--)
{
m->uv[i].u = B_LITTLE16(m->uv[i].u);
m->uv[i].v = B_LITTLE16(m->uv[i].v);
}
} }
#endif #endif

View file

@ -56,9 +56,8 @@ DEALINGS IN THE SOFTWARE.
// #define NOINLINE // #define NOINLINE
#endif #endif
#include "nedmalloc.h" #include "nedmalloc.h"
#if defined(WIN32) #if defined(_WIN32)
#include <malloc.h> #include <malloc.h>
#endif #endif
#ifdef __linux__ #ifdef __linux__

View file

@ -82,6 +82,7 @@ Low priority:
#include "engine_priv.h" #include "engine_priv.h"
#include "hightile.h" #include "hightile.h"
#include "polymost.h" #include "polymost.h"
#include "polymer.h"
#include "scriptfile.h" #include "scriptfile.h"
#include "cache1d.h" #include "cache1d.h"
#include "kplib.h" #include "kplib.h"
@ -1378,6 +1379,9 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea
if (gi != GL_TRUE) goto failure; // an uncompressed mipmap if (gi != GL_TRUE) goto failure; // an uncompressed mipmap
bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, (GLint *)&gi); bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, (GLint *)&gi);
if (bglGetError() != GL_NO_ERROR) goto failure; if (bglGetError() != GL_NO_ERROR) goto failure;
#ifdef __APPLE__
if(pr_ati_textureformat_one && gi == 1 ) gi = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
#endif
pict.format = B_LITTLE32(gi); pict.format = B_LITTLE32(gi);
bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_WIDTH, (GLint *)&gi); bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_WIDTH, (GLint *)&gi);
if (bglGetError() != GL_NO_ERROR) goto failure; if (bglGetError() != GL_NO_ERROR) goto failure;
@ -1523,7 +1527,7 @@ int32_t gloadtile_cached(int32_t fil, texcacheheader *head, int32_t *doalloc, pt
GLint format; GLint format;
bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &format); bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &format);
if (bglGetError() != GL_NO_ERROR) goto failure; if (bglGetError() != GL_NO_ERROR) goto failure;
format = B_LITTLE32(format); // format = B_LITTLE32(format);
if (pict.format != format) if (pict.format != format)
{ {
OSD_Printf("invalid texture cache file format %d %d\n",pict.format, format); OSD_Printf("invalid texture cache file format %d %d\n",pict.format, format);
@ -6234,15 +6238,15 @@ int32_t dedxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf,
void *inbuf; void *inbuf;
#if (USEKENFILTER == 0) #if (USEKENFILTER == 0)
uint32_t cleng; uint32_t cleng;
if (kread(fil, &cleng, sizeof(uint32_t)) != sizeof(uint32_t)) return -1; cleng = B_LITTLE32(cleng); if (Bread(fil, &cleng, sizeof(uint32_t)) != sizeof(uint32_t)) return -1; cleng = B_LITTLE32(cleng);
#ifdef USELZF #ifdef USELZF
if (ispacked && cleng < pict->size) inbuf = packbuf; else inbuf = pic; if (ispacked && cleng < pict->size) inbuf = packbuf; else inbuf = pic;
if (kread(fil, inbuf, cleng) != cleng) return -1; if (Bread(fil, inbuf, cleng) != cleng) return -1;
if (ispacked && cleng < pict->size) if (ispacked && cleng < pict->size)
if (qlz_decompress(packbuf, pic, state_decompress) == 0) return -1; if (qlz_decompress(packbuf, pic, state_decompress) == 0) return -1;
#else #else
if (ispacked) inbuf = packbuf; else inbuf = pic; if (ispacked) inbuf = packbuf; else inbuf = pic;
if (kread(fil, inbuf, cleng) != cleng) return -1; if (Bread(fil, inbuf, cleng) != cleng) return -1;
if (ispacked && lzwuncompress(packbuf, cleng, pic, pict->size) != pict->size) return -1; if (ispacked && lzwuncompress(packbuf, cleng, pic, pict->size) != pict->size) return -1;
#endif #endif
#else #else

View file

@ -1147,6 +1147,14 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs)
initprintf("Enabling ATI R520 polygon offset workaround.\n"); initprintf("Enabling ATI R520 polygon offset workaround.\n");
} else } else
pr_ati_nodepthoffset = 0; pr_ati_nodepthoffset = 0;
#ifdef __APPLE__
//See bug description at http://lists.apple.com/archives/mac-opengl/2005/Oct/msg00169.html
if (!Bstrncmp(glinfo.renderer,"ATI Radeon 9600", 15)) {
pr_ati_textureformat_one = 1;
initprintf("Enabling ATI Radeon 9600 texture format workaround.\n");
} else
pr_ati_textureformat_one = 0;
#endif
} else } else
pr_ati_fboworkaround = 0; pr_ati_fboworkaround = 0;
#endif #endif
@ -1530,20 +1538,24 @@ static SDL_Surface * loadappicon(void)
// handleevents() -- process the SDL message queue // handleevents() -- process the SDL message queue
// returns !0 if there was an important event worth checking (like quitting) // returns !0 if there was an important event worth checking (like quitting)
// //
static inline void SetKey(int32_t key, int32_t state)
{
keystatus[remap[key]] = state;
if (state)
{
keyfifo[keyfifoend] = remap[key];
keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state;
keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1));
}
}
int32_t handleevents(void) int32_t handleevents(void)
{ {
int32_t code, rv=0, j; int32_t code, rv=0, j;
SDL_Event ev; SDL_Event ev;
#define SetKey(key,state) { \
keystatus[remap[key]] = state; \
if (state) { \
keyfifo[keyfifoend] = remap[key]; \
keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state; \
keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1)); \
} \
}
while (SDL_PollEvent(&ev)) while (SDL_PollEvent(&ev))
{ {
switch (ev.type) switch (ev.type)
@ -2087,7 +2099,7 @@ static int32_t buildkeytranslationtable(void)
#if defined _WIN32 #if defined _WIN32
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ #elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__
# include <sys/mman.h> # include <sys/mman.h>
#endif #endif
@ -2102,7 +2114,7 @@ void makeasmwriteable(void)
initprint("Error making code writeable\n"); initprint("Error making code writeable\n");
return; return;
} }
# elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ # elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__
int32_t pagesize; int32_t pagesize;
size_t dep_begin_page; size_t dep_begin_page;
pagesize = sysconf(_SC_PAGE_SIZE); pagesize = sysconf(_SC_PAGE_SIZE);

View file

@ -788,13 +788,16 @@ static struct _joydevicedefn *thisjoydef = NULL, joyfeatures[] =
#undef featurecount #undef featurecount
// I don't see any pressing need to store the key-up events yet // I don't see any pressing need to store the key-up events yet
#define SetKey(key,state) { \ static inline void SetKey(int32_t key, int32_t state)
keystatus[remap[key]] = state; \ {
if (state) { \ keystatus[remap[key]] = state;
keyfifo[keyfifoend] = remap[key]; \
keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state; \ if (state)
keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1)); \ {
} \ keyfifo[keyfifoend] = remap[key];
keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state;
keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1));
}
} }
char map_dik_code(int32_t scanCode) char map_dik_code(int32_t scanCode)
@ -883,7 +886,7 @@ void setkeypresscallback(void (*callback)(int32_t, int32_t)) { keypresscallback
void setmousepresscallback(void (*callback)(int32_t, int32_t)) { mousepresscallback = callback; } void setmousepresscallback(void (*callback)(int32_t, int32_t)) { mousepresscallback = callback; }
void setjoypresscallback(void (*callback)(int32_t, int32_t)) { joypresscallback = callback; } void setjoypresscallback(void (*callback)(int32_t, int32_t)) { joypresscallback = callback; }
#define DINPUT_EVENTS 4 #define DINPUT_EVENTS 16
DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter) DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
{ {
@ -909,11 +912,13 @@ DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
result = IDirectInputDevice7_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA), result = IDirectInputDevice7_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA),
(LPDIDEVICEOBJECTDATA)&didod[0], &dwElements, 0); (LPDIDEVICEOBJECTDATA)&didod[0], &dwElements, 0);
if (!dwElements || result != DI_OK) if (!dwElements || (result != DI_OK && result != DI_BUFFEROVERFLOW))
continue; continue;
do do
{ {
int32_t bit = 1<<(didod[dwElements-1].dwOfs - DIMOFS_BUTTON0);
switch (didod[dwElements-1].dwOfs) switch (didod[dwElements-1].dwOfs)
{ {
case DIMOFS_X: case DIMOFS_X:
@ -941,73 +946,20 @@ DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
} }
break; break;
case DIMOFS_BUTTON0:
{
if (didod[dwElements-1].dwData & 0x80) mouseb |= 1;
else mouseb &= ~1;
if (mousepresscallback)
mousepresscallback(1, mouseb & 1);
}
break;
case DIMOFS_BUTTON1:
{
if (didod[dwElements-1].dwData & 0x80) mouseb |= 2;
else mouseb &= ~2;
if (mousepresscallback)
mousepresscallback(2, mouseb & 2);
}
break;
case DIMOFS_BUTTON2:
{
if (didod[dwElements-1].dwData & 0x80) mouseb |= 4;
else mouseb &= ~4;
if (mousepresscallback)
mousepresscallback(3, mouseb & 4);
}
break;
case DIMOFS_BUTTON3:
{
if (didod[dwElements-1].dwData & 0x80) mouseb |= 8;
else mouseb &= ~8;
if (mousepresscallback)
mousepresscallback(4, mouseb & 8);
}
break;
case DIMOFS_BUTTON4: case DIMOFS_BUTTON4:
{
OSD_Printf("got button4\n");
if (didod[dwElements-1].dwData & 0x80) mouseb |= 64;
else mouseb &= ~64;
if (mousepresscallback)
mousepresscallback(7, mouseb & 64);
}
break;
case DIMOFS_BUTTON5: case DIMOFS_BUTTON5:
{
OSD_Printf("got button5\n");
if (didod[dwElements-1].dwData & 0x80) mouseb |= 128;
else mouseb &= ~128;
if (mousepresscallback)
mousepresscallback(8, mouseb & 128);
}
break;
case DIMOFS_BUTTON6: case DIMOFS_BUTTON6:
{
OSD_Printf("got button6\n");
if (didod[dwElements-1].dwData & 0x80) mouseb |= 256;
else mouseb &= ~256;
if (mousepresscallback)
mousepresscallback(9, mouseb & 256);
}
break;
case DIMOFS_BUTTON7: case DIMOFS_BUTTON7:
{ didod[dwElements-1].dwOfs += 2; // skip mousewheel buttons
OSD_Printf("got button7\n"); bit = 1<<(didod[dwElements-1].dwOfs - DIMOFS_BUTTON0);
if (didod[dwElements-1].dwData & 0x80) mouseb |= 512; case DIMOFS_BUTTON0:
else mouseb &= ~512; case DIMOFS_BUTTON1:
case DIMOFS_BUTTON2:
case DIMOFS_BUTTON3:
if (didod[dwElements-1].dwData & 0x80) mouseb |= bit;
else mouseb &= ~bit;
if (mousepresscallback) if (mousepresscallback)
mousepresscallback(10, mouseb & 512); mousepresscallback(didod[dwElements-1].dwOfs - DIMOFS_BUTTON0 + 1, mouseb & bit);
}
break; break;
} }
} }

View file

@ -144,10 +144,6 @@
RelativePath=".\build\include\mmulti.h" RelativePath=".\build\include\mmulti.h"
> >
</File> </File>
<File
RelativePath=".\build\include\mmulti_unstable.h"
>
</File>
<File <File
RelativePath=".\build\include\nedmalloc.h" RelativePath=".\build\include\nedmalloc.h"
> >
@ -284,10 +280,6 @@
RelativePath=".\build\src\mdsprite.c" RelativePath=".\build\src\mdsprite.c"
> >
</File> </File>
<File
RelativePath=".\build\src\mmulti_unstable.c"
>
</File>
<File <File
RelativePath=".\build\src\nedmalloc.c" RelativePath=".\build\src\nedmalloc.c"
> >

View file

@ -460,7 +460,8 @@ inline int32_t A_SetSprite(int32_t i,uint32_t cliptype)
{ {
vec3_t davect = {(sprite[i].xvel*(sintable[(sprite[i].ang+512)&2047]))>>14, vec3_t davect = {(sprite[i].xvel*(sintable[(sprite[i].ang+512)&2047]))>>14,
(sprite[i].xvel*(sintable[sprite[i].ang&2047]))>>14, (sprite[i].xvel*(sintable[sprite[i].ang&2047]))>>14,
sprite[i].zvel }; sprite[i].zvel
};
return (A_MoveSprite(i,&davect,cliptype)==0); return (A_MoveSprite(i,&davect,cliptype)==0);
} }

View file

@ -65,7 +65,8 @@ ENetPeer * g_netClientPeer = NULL;
int32_t g_netPort = 23513; int32_t g_netPort = 23513;
int32_t g_netDisconnect = 0; int32_t g_netDisconnect = 0;
int8_t g_netStatnums[] = { STAT_PROJECTILE, STAT_STANDABLE, STAT_ACTIVATOR, STAT_TRANSPORT, int8_t g_netStatnums[] = { STAT_PROJECTILE, STAT_STANDABLE, STAT_ACTIVATOR, STAT_TRANSPORT,
STAT_EFFECTOR, STAT_ACTOR, STAT_ZOMBIEACTOR, STAT_MISC }; STAT_EFFECTOR, STAT_ACTOR, STAT_ZOMBIEACTOR, STAT_MISC
};
char g_netPassword[32]; char g_netPassword[32];
int32_t g_quitDeadline = 0; int32_t g_quitDeadline = 0;
@ -5163,7 +5164,8 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
{ {
vec3_t cam = { p->oposx+mulscale16((int32_t)(p->posx-p->oposx),smoothratio), vec3_t cam = { p->oposx+mulscale16((int32_t)(p->posx-p->oposx),smoothratio),
p->oposy+mulscale16((int32_t)(p->posy-p->oposy),smoothratio), p->oposy+mulscale16((int32_t)(p->posy-p->oposy),smoothratio),
p->oposz+mulscale16((int32_t)(p->posz-p->oposz),smoothratio) }; p->oposz+mulscale16((int32_t)(p->posz-p->oposz),smoothratio)
};
Bmemcpy(&ud.camera, &cam, sizeof(vec3_t)); Bmemcpy(&ud.camera, &cam, sizeof(vec3_t));
ud.cameraang = p->oang+mulscale16((int32_t)(((p->ang+1024-p->oang)&2047)-1024),smoothratio); ud.cameraang = p->oang+mulscale16((int32_t)(((p->ang+1024-p->oang)&2047)-1024),smoothratio);
@ -5413,7 +5415,8 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3
int32_t p, i = insertsprite(whatsect,s_ss); int32_t p, i = insertsprite(whatsect,s_ss);
spritetype *s = &sprite[i]; spritetype *s = &sprite[i];
spritetype spr_temp = { s_x, s_y, s_z, 0, s_pn, s_s, 0, 0, 0, s_xr, s_yr, 0, 0, spritetype spr_temp = { s_x, s_y, s_z, 0, s_pn, s_s, 0, 0, 0, s_xr, s_yr, 0, 0,
whatsect, s_ss, s_a, s_ow, s_ve, 0, s_zv, 0, 0, 0 }; whatsect, s_ss, s_a, s_ow, s_ve, 0, s_zv, 0, 0, 0
};
if (i < 0) if (i < 0)
{ {

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

View file

@ -107,7 +107,5 @@ int32_t FX_StopAllSounds( void );
int32_t FX_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ), int32_t FX_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ),
int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right,
int32_t priority, uint32_t callbackval ); int32_t priority, uint32_t callbackval );
int32_t FX_StartRecording( int32_t MixRate, void ( *function )( char *ptr, int32_t length ) );
void FX_StopRecord( void );
#endif #endif

View file

@ -24,7 +24,11 @@
#include <SDL/SDL.h> #include <SDL/SDL.h>
#if defined(SDL_FRAMEWORK)
# include <SDL_mixer/SDL_mixer.h>
#else
# include <SDL/SDL_mixer.h> # include <SDL/SDL_mixer.h>
#endif
#include <SDL/SDL_thread.h> #include <SDL/SDL_thread.h>
#include "driver_sdl.h" #include "driver_sdl.h"

View file

@ -36,6 +36,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "multivoc.h" #include "multivoc.h"
#include "fx_man.h" #include "fx_man.h"
#ifdef __POWERPC__
static inline uint16_t SWAP16(uint16_t s)
{
return (s >> 8) | (s << 8);
}
static inline uint32_t SWAP32(uint32_t s)
{
return (s >> 24) | (s << 24) | ((s&0xff00) << 8) | ((s & 0xff0000) >> 8);
}
#define LITTLE16 SWAP16
#define LITTLE32 SWAP32
#else
#define LITTLE16
#define LITTLE32
#endif
#define TRUE ( 1 == 1 ) #define TRUE ( 1 == 1 )
#define FALSE ( !TRUE ) #define FALSE ( !TRUE )
@ -930,43 +948,6 @@ int32_t FX_StartDemandFeedPlayback
} }
/*---------------------------------------------------------------------
Function: FX_StartRecording
Starts the sound recording engine.
---------------------------------------------------------------------*/
int32_t FX_StartRecording
(
int32_t MixRate,
void (*function)(char *ptr, int32_t length)
)
{
int32_t status;
FX_SetErrorCode(FX_InvalidCard);
status = FX_Warning;
return(status);
}
/*---------------------------------------------------------------------
Function: FX_StopRecord
Stops the sound record engine.
---------------------------------------------------------------------*/
void FX_StopRecord
(
void
)
{
}
/*--------------------------------------------------------------------- /*---------------------------------------------------------------------
Function: FX_PlayAuto Function: FX_PlayAuto
@ -1017,22 +998,22 @@ int32_t FX_PlayLoopedAuto(char *ptr, uint32_t length, int32_t loopstart, int32_t
uint32_t callbackval) uint32_t callbackval)
{ {
int32_t handle = -1; int32_t handle = -1;
printf("FX_PlayLoopedAuto %X\n",*(int32_t *)ptr);
switch (*(int32_t *)ptr) switch (*(int32_t *)ptr)
{ {
case 'C'+('r'<<8)+('e'<<16)+('a'<<24): case LITTLE32('C'+('r'<<8)+('e'<<16)+('a'<<24)):
handle = MV_PlayLoopedVOC(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); handle = MV_PlayLoopedVOC(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval);
break; break;
case 'R'+('I'<<8)+('F'<<16)+('F'<<24): case LITTLE32('R'+('I'<<8)+('F'<<16)+('F'<<24)):
handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval);
break; break;
case 'O'+('g'<<8)+('g'<<16)+('S'<<24): case LITTLE32('O'+('g'<<8)+('g'<<16)+('S'<<24)):
handle = MV_PlayLoopedVorbis(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); handle = MV_PlayLoopedVorbis(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval);
break; break;
default: default:
switch (*(int32_t *)(ptr + 8)) switch (*(int32_t *)(ptr + 8))
{ {
case 'W'+('A'<<8)+('V'<<16)+('E'<<24): case LITTLE32('W'+('A'<<8)+('V'<<16)+('E'<<24)):
handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval);
break; break;
} }
@ -1061,19 +1042,19 @@ int32_t FX_PlayAuto3D(char *ptr, uint32_t length, int32_t pitchoffset, int32_t a
switch (*(int32_t *)ptr) switch (*(int32_t *)ptr)
{ {
case 'C'+('r'<<8)+('e'<<16)+('a'<<24): // Crea case LITTLE32('C'+('r'<<8)+('e'<<16)+('a'<<24)): // Crea
handle = MV_PlayVOC3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); handle = MV_PlayVOC3D(ptr, length, pitchoffset, angle, distance, priority, callbackval);
break; break;
case 'R'+('I'<<8)+('F'<<16)+('F'<<24): // RIFF case LITTLE32('R'+('I'<<8)+('F'<<16)+('F'<<24)): // RIFF
handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval);
break; break;
case 'O'+('g'<<8)+('g'<<16)+('S'<<24): // OggS case LITTLE32('O'+('g'<<8)+('g'<<16)+('S'<<24)): // OggS
handle = MV_PlayVorbis3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); handle = MV_PlayVorbis3D(ptr, length, pitchoffset, angle, distance, priority, callbackval);
break; break;
default: default:
switch (*(int32_t *)(ptr + 8)) switch (*(int32_t *)(ptr + 8))
{ {
case 'W'+('A'<<8)+('V'<<16)+('E'<<24): // WAVE case LITTLE32('W'+('A'<<8)+('V'<<16)+('E'<<24)): // WAVE
handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval);
break; break;
} }

View file

@ -109,7 +109,6 @@ Pan MV_PanTable[ MV_NumPanPositions ][ 255 + 1 ];
int32_t MV_Installed = FALSE; int32_t MV_Installed = FALSE;
static int32_t MV_TotalVolume = MV_MaxTotalVolume; static int32_t MV_TotalVolume = MV_MaxTotalVolume;
static int32_t MV_MaxVoices = 1; static int32_t MV_MaxVoices = 1;
static int32_t MV_Recording;
static int32_t MV_BufferSize = MixBufferSize; static int32_t MV_BufferSize = MixBufferSize;
static int32_t MV_BufferLength; static int32_t MV_BufferLength;
@ -142,7 +141,6 @@ static int32_t MV_MixPage = 0;
static int32_t MV_VoiceHandle = MV_MinVoiceHandle; static int32_t MV_VoiceHandle = MV_MinVoiceHandle;
static void (*MV_CallBackFunc)(uint32_t) = NULL; static void (*MV_CallBackFunc)(uint32_t) = NULL;
static void (*MV_RecordFunc)(char *ptr, int32_t length) = NULL;
static void (*MV_MixFunction)(VoiceNode *voice, int32_t buffer); static void (*MV_MixFunction)(VoiceNode *voice, int32_t buffer);
int32_t MV_MaxVolume = 255; int32_t MV_MaxVolume = 255;
@ -241,10 +239,6 @@ const char *MV_ErrorString
ErrorString = "Invalid mix mode request in Multivoc."; ErrorString = "Invalid mix mode request in Multivoc.";
break; break;
case MV_NullRecordFunction :
ErrorString = "Null record function passed to MV_StartRecording.";
break;
default : default :
ErrorString = "Unknown Multivoc error code."; ErrorString = "Unknown Multivoc error code.";
break; break;
@ -914,35 +908,6 @@ playbackstatus MV_GetNextWAVBlock
} }
/*---------------------------------------------------------------------
Function: MV_ServiceRecord
Starts recording of the waiting buffer.
---------------------------------------------------------------------*/
/*
static void MV_ServiceRecord
(
void
)
{
if (MV_RecordFunc)
{
MV_RecordFunc(MV_MixBuffer[ 0 ] + MV_MixPage * MixBufferSize,
MixBufferSize);
}
// Toggle which buffer we'll mix next
MV_MixPage++;
if (MV_MixPage >= NumberOfBuffers)
{
MV_MixPage = 0;
}
}
*/
/*--------------------------------------------------------------------- /*---------------------------------------------------------------------
Function: MV_GetVoice Function: MV_GetVoice
@ -1150,11 +1115,6 @@ VoiceNode *MV_AllocVoice
VoiceNode *voice; VoiceNode *voice;
VoiceNode *node; VoiceNode *node;
if (MV_Recording)
{
return(NULL);
}
DisableInterrupts(); DisableInterrupts();
// Check if we have any free voices // Check if we have any free voices
@ -1987,39 +1947,6 @@ void MV_StopPlayback
} }
/*---------------------------------------------------------------------
Function: MV_StartRecording
Starts the sound recording engine.
---------------------------------------------------------------------*/
int32_t MV_StartRecording
(
int32_t MixRate,
void (*function)(char *ptr, int32_t length)
)
{
MV_SetErrorCode(MV_UnsupportedCard);
return(MV_Error);
}
/*---------------------------------------------------------------------
Function: MV_StopRecord
Stops the sound record engine.
---------------------------------------------------------------------*/
void MV_StopRecord
(
void
)
{
}
/*--------------------------------------------------------------------- /*---------------------------------------------------------------------
Function: MV_StartDemandFeedPlayback Function: MV_StartDemandFeedPlayback
@ -2839,8 +2766,6 @@ int32_t MV_Init
MV_Installed = TRUE; MV_Installed = TRUE;
MV_CallBackFunc = NULL; MV_CallBackFunc = NULL;
MV_RecordFunc = NULL;
MV_Recording = FALSE;
MV_ReverbLevel = 0; MV_ReverbLevel = 0;
MV_ReverbTable = NULL; MV_ReverbTable = NULL;
@ -2902,12 +2827,6 @@ int32_t MV_Shutdown
MV_Installed = FALSE; MV_Installed = FALSE;
// Stop the sound recording engine
if (MV_Recording)
{
MV_StopRecord();
}
// Stop the sound playback engine // Stop the sound playback engine
MV_StopPlayback(); MV_StopPlayback();

View file

@ -73,8 +73,6 @@ void MV_SetReverbDelay( int32_t delay );
int32_t MV_SetMixMode( int32_t numchannels, int32_t samplebits ); int32_t MV_SetMixMode( int32_t numchannels, int32_t samplebits );
int32_t MV_StartPlayback( void ); int32_t MV_StartPlayback( void );
void MV_StopPlayback( void ); void MV_StopPlayback( void );
int32_t MV_StartRecording( int32_t MixRate, void ( *function )( char *ptr, int32_t length ) );
void MV_StopRecord( void );
int32_t MV_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ), int32_t MV_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ),
int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right,
int32_t priority, uint32_t callbackval ); int32_t priority, uint32_t callbackval );

View file

@ -1251,7 +1251,8 @@ skip_check:
insptr = beg; insptr = beg;
X_DoExecute(1); X_DoExecute(1);
jj = wall[jj].point2; jj = wall[jj].point2;
} while (jj != parm2 && !vm.flags); }
while (jj != parm2 && !vm.flags);
break; break;
case ITER_RANGE: case ITER_RANGE:
for (jj=0; jj<parm2 && !vm.flags; jj++) for (jj=0; jj<parm2 && !vm.flags; jj++)

View file

@ -62,12 +62,12 @@ static int32_t _MIDI_Division;
static int32_t _MIDI_Tick = 0; static int32_t _MIDI_Tick = 0;
static int32_t _MIDI_Beat = 1; static int32_t _MIDI_Beat = 1;
static int32_t _MIDI_Measure = 1; static int32_t _MIDI_Measure = 1;
static unsigned _MIDI_Time; static uint32_t _MIDI_Time;
static int32_t _MIDI_BeatsPerMeasure; static int32_t _MIDI_BeatsPerMeasure;
static int32_t _MIDI_TicksPerBeat; static int32_t _MIDI_TicksPerBeat;
static int32_t _MIDI_TimeBase; static int32_t _MIDI_TimeBase;
static int32_t _MIDI_FPSecondsPerTick; static int32_t _MIDI_FPSecondsPerTick;
static unsigned _MIDI_TotalTime; static uint32_t _MIDI_TotalTime;
static int32_t _MIDI_TotalTicks; static int32_t _MIDI_TotalTicks;
static int32_t _MIDI_TotalBeats; static int32_t _MIDI_TotalBeats;
static int32_t _MIDI_TotalMeasures; static int32_t _MIDI_TotalMeasures;

View file

@ -12,7 +12,8 @@
#define RDR_POLYMOST 3 // sould be defined elsewhere #define RDR_POLYMOST 3 // sould be defined elsewhere
#define RDR_POLYMER 4 // sould be defined elsewhere #define RDR_POLYMER 4 // sould be defined elsewhere
enum { enum
{
NONE, NONE,
ALL, ALL,
POPULATE_VIDEO, POPULATE_VIDEO,
@ -20,13 +21,15 @@ enum {
POPULATE_GAME, POPULATE_GAME,
}; };
enum { enum
{
TAB_CONFIG, TAB_CONFIG,
TAB_GAME, TAB_GAME,
TAB_MESSAGES, TAB_MESSAGES,
}; };
enum { enum
{
INPUT_KB, INPUT_KB,
INPUT_MOUSE, INPUT_MOUSE,
INPUT_JOYSTICK, INPUT_JOYSTICK,
@ -332,7 +335,8 @@ static void PopulateForm(unsigned char pgs)
GtkTreePath *path; GtkTreePath *path;
char *value; char *value;
unsigned char i, r = 0; unsigned char i, r = 0;
const char *availabledev[] = { const char *availabledev[] =
{
"Keyboard only", "Keyboard only",
"Keyboard and mouse", "Keyboard and mouse",
"Keyboard and joystick", "Keyboard and joystick",