Merge branch 'monster-cleaning-up-again' into 'next'

Monster cleaning up again

See merge request STJr/SRB2!1433
This commit is contained in:
Monster Iestyn 2021-05-07 17:33:00 -04:00
commit d00726cbe9
17 changed files with 113 additions and 231 deletions

View file

@ -98,7 +98,6 @@ ALL_SYSTEMS=\
MINGW64\
HAIKU\
DUMMY\
DJGPPDOS\
MINGW\
UNIX\
LINUX\
@ -622,8 +621,6 @@ asm:
$(REMOVE) $(OBJDIR)/tmp.exe
# executable
# NOTE: DJGPP's objcopy do not have --add-gnu-debuglink
$(BIN)/$(EXENAME): $(POS) $(OBJS)
-$(MKDIR) $(BIN)
$(call echo,Linking $(EXENAME)...)

View file

@ -15,7 +15,7 @@
/// plus functions to parse command line parameters, configure game
/// parameters, and call the startup functions.
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#include <sys/stat.h>
#include <sys/types.h>
#endif
@ -934,7 +934,7 @@ static void IdentifyVersion(void)
char *srb2wad;
const char *srb2waddir = NULL;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.pk3' is found
srb2waddir = I_LocateWad();
#endif
@ -1107,7 +1107,7 @@ void D_SRB2Main(void)
if (!userhome)
{
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
#if (defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
I_Error("Please set $HOME to your home directory\n");
#else
if (dedicated)
@ -1287,7 +1287,7 @@ void D_SRB2Main(void)
G_LoadGameData();
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
#endif
@ -1553,7 +1553,7 @@ const char *D_Home(void)
userhome = M_GetNextParm();
else
{
#if !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__)
#if !(defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON))
if (FIL_FileOK(CONFIGFILENAME))
usehome = false; // Let's NOT use home
else

View file

@ -40,10 +40,6 @@ void D_SRB2Main(void);
// Called by IO functions when input is detected.
void D_PostEvent(const event_t *ev);
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void); // delimiter for locking memory
#endif
void D_ProcessEvents(void);
const char *D_Home(void);

View file

@ -168,7 +168,7 @@ void SendWeaponPref(void);
void SendWeaponPref2(void);
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
static CV_PossibleValue_t mouse2port_cons_t[] = {{0, "/dev/gpmdata"}, {1, "/dev/ttyS0"},
{2, "/dev/ttyS1"}, {3, "/dev/ttyS2"}, {4, "/dev/ttyS3"}, {0, NULL}};
#else
@ -255,7 +255,7 @@ consvar_t cv_joyscale2 = CVAR_INIT ("padscale2", "1", CV_SAVE|CV_CALL, NULL, I_J
consvar_t cv_joyscale = CVAR_INIT ("padscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save
consvar_t cv_joyscale2 = CVAR_INIT ("padscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save
#endif
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
consvar_t cv_mouse2port = CVAR_INIT ("mouse2port", "/dev/gpmdata", CV_SAVE, mouse2port_cons_t, NULL);
consvar_t cv_mouse2opt = CVAR_INIT ("mouse2opt", "0", CV_SAVE, NULL, NULL);
#else
@ -788,7 +788,7 @@ void D_RegisterClientCommands(void)
// WARNING: the order is important when initialising mouse2
// we need the mouse2port
CV_RegisterVar(&cv_mouse2port);
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
CV_RegisterVar(&cv_mouse2opt);
#endif
CV_RegisterVar(&cv_controlperkey);

View file

@ -45,7 +45,7 @@ extern consvar_t cv_joyscale2;
// splitscreen with second mouse
extern consvar_t cv_mouse2port;
extern consvar_t cv_usemouse2;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
extern consvar_t cv_mouse2opt;
#endif

View file

@ -15,7 +15,7 @@
#include <time.h>
#if defined (_WIN32) || defined (__DJGPP__)
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#else
@ -30,10 +30,6 @@
#elif defined (_WIN32)
#include <sys/utime.h>
#endif
#ifdef __DJGPP__
#include <dir.h>
#include <utime.h>
#endif
#include "doomdef.h"
#include "doomstat.h"

View file

@ -100,7 +100,7 @@
#include <sys/stat.h>
#include <ctype.h>
#if defined (_WIN32) || defined (__DJGPP__)
#ifdef _WIN32
#include <io.h>
#endif
@ -112,7 +112,7 @@
//#define PARANOIA // do some tests that never fail but maybe
// turn this on by make etc.. DEBUGMODE = 1 or use the Debug profile in the VC++ projects
//#endif
#if defined (_WIN32) || (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (macintosh)
#if defined (_WIN32) || defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (macintosh)
#define LOGMESSAGES // write message in log.txt
#endif
@ -415,7 +415,7 @@ enum {
};
// Name of local directory for config files and savegames
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__)
#if (defined (__unix__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (__APPLE__)
#define DEFAULTDIR ".srb2"
#else
#define DEFAULTDIR "srb2"

View file

@ -54,17 +54,6 @@ typedef long ssize_t;
#define PDWORD_PTR PDWORD
#endif
#endif
#elif defined (__DJGPP__)
#define UINT8 unsigned char
#define SINT8 signed char
#define UINT16 unsigned short int
#define INT16 signed short int
#define INT32 signed long
#define UINT32 unsigned long
#define INT64 signed long long
#define UINT64 unsigned long long
#else
#define __STDC_LIMIT_MACROS
#include <stdint.h>
@ -108,7 +97,7 @@ typedef long ssize_t;
#define strncasecmp strnicmp
#define strcasecmp strcmpi
#endif
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#undef stricmp
#define stricmp(x,y) strcasecmp(x,y)
#undef strnicmp
@ -136,7 +125,7 @@ char *strcasestr(const char *in, const char *what);
#endif
#endif //macintosh
#if defined (PC_DOS) || defined (_WIN32) || defined (__HAIKU__)
#if defined (_WIN32) || defined (__HAIKU__)
#define HAVE_DOSSTR_FUNCS
#endif

View file

@ -20,7 +20,7 @@
#else
#include <winsock.h>
#endif
#elif !defined (__DJGPP__)
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>

View file

@ -64,7 +64,7 @@
#include <errno.h>
#include <time.h>
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#include <sys/time.h>
#endif // UNIXCOMMON
#endif
@ -107,15 +107,6 @@
#endif
#endif // USE_WINSOCK
#ifdef __DJGPP__
#ifdef WATTCP // Alam_GBC: Wattcp may need this
#include <tcp.h>
#define strerror strerror_s
#else // wattcp
#include <lsck/lsck.h>
#endif // libsocket
#endif // djgpp
typedef union
{
struct sockaddr any;
@ -149,32 +140,22 @@
#include "doomstat.h"
// win32 or djgpp
#if defined (USE_WINSOCK) || defined (__DJGPP__)
// win32
#ifdef USE_WINSOCK
// winsock stuff (in winsock a socket is not a file)
#define ioctl ioctlsocket
#define close closesocket
#endif
#include "i_addrinfo.h"
#ifdef __DJGPP__
#ifdef WATTCP
#define SELECTTEST
#endif
#else
#define SELECTTEST
#endif
#define DEFAULTPORT "5029"
#if defined (USE_WINSOCK) && !defined (NONET)
typedef SOCKET SOCKET_TYPE;
#define ERRSOCKET (SOCKET_ERROR)
#else
#if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__)
#if defined (__unix__) || defined (__APPLE__) || defined (__HAIKU__)
typedef int SOCKET_TYPE;
#else
typedef unsigned long SOCKET_TYPE;
@ -184,7 +165,7 @@
#ifndef NONET
// define socklen_t in DOS/Windows if it is not already defined
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (USE_WINSOCK1)
#ifdef USE_WINSOCK1
typedef int socklen_t;
#endif
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
@ -207,19 +188,6 @@ static const char *serverport_name = DEFAULTPORT;
static const char *clientport_name;/* any port */
#ifndef NONET
#ifdef WATTCP
static void wattcp_outch(char s)
{
static char old = '\0';
char pr[2] = {s,0};
if (s == old && old == ' ') return;
else old = s;
if (s == '\r') CONS_Printf("\n");
else if (s != '\n') CONS_Printf(pr);
}
#endif
#ifdef USE_WINSOCK
// stupid microsoft makes things complicated
static char *get_WSAErrorStr(int e)
@ -764,11 +732,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
int opt;
socklen_t opts;
#ifdef FIONBIO
#ifdef WATTCP
char trueval = true;
#else
unsigned long trueval = true;
#endif
#endif
mysockaddr_t straddr;
struct sockaddr_in sin;
@ -1138,61 +1102,7 @@ boolean I_InitTcpDriver(void)
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
#endif
#ifdef __DJGPP__
#ifdef WATTCP // Alam_GBC: survive bootp, dhcp, rarp and wattcp/pktdrv from failing to load
survive_eth = 1; // would be needed to not exit if pkt_eth_init() fails
survive_bootp = 1; // ditto for BOOTP
survive_dhcp = 1; // ditto for DHCP/RARP
survive_rarp = 1;
//_watt_do_exit = false;
//_watt_handle_cbreak = false;
//_watt_no_config = true;
_outch = wattcp_outch;
init_misc();
//#ifdef DEBUGFILE
dbug_init();
//#endif
switch (sock_init())
{
case 0:
init_tcp_driver = true;
break;
case 3:
CONS_Debug(DBG_NETPLAY, "No packet driver detected\n");
break;
case 4:
CONS_Debug(DBG_NETPLAY, "Error while talking to packet driver\n");
break;
case 5:
CONS_Debug(DBG_NETPLAY, "BOOTP failed\n");
break;
case 6:
CONS_Debug(DBG_NETPLAY, "DHCP failed\n");
break;
case 7:
CONS_Debug(DBG_NETPLAY, "RARP failed\n");
break;
case 8:
CONS_Debug(DBG_NETPLAY, "TCP/IP failed\n");
break;
case 9:
CONS_Debug(DBG_NETPLAY, "PPPoE login/discovery failed\n");
break;
default:
CONS_Debug(DBG_NETPLAY, "Unknown error with TCP/IP stack\n");
break;
}
hires_timer(0);
#else // wattcp
if (__lsck_init())
init_tcp_driver = true;
else
CONS_Debug(DBG_NETPLAY, "No TCP/IP driver detected\n");
#endif // libsocket
#endif // __DJGPP__
#ifndef __DJGPP__
init_tcp_driver = true;
#endif
}
#endif
if (!tcp_was_up && init_tcp_driver)
@ -1217,10 +1127,8 @@ static void SOCK_CloseSocket(void)
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
&& FD_ISSET(mysockets[i], &masterset))
{
#if !defined (__DJGPP__) || defined (WATTCP)
FD_CLR(mysockets[i], &masterset);
close(mysockets[i]);
#endif
}
mysockets[i] = ERRSOCKET;
}
@ -1237,14 +1145,6 @@ void I_ShutdownTcpDriver(void)
WS_addrinfocleanup();
WSACleanup();
#endif
#ifdef __DJGPP__
#ifdef WATTCP // wattcp
//_outch = NULL;
sock_exit();
#else
__lsck_uninit();
#endif // libsocket
#endif // __DJGPP__
CONS_Printf("shut down\n");
init_tcp_driver = false;
#endif

View file

@ -71,7 +71,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
value [eax] \
modify exact [eax edx]
#elif defined (__GNUC__) && defined (__i386__) && !defined (NOASM)
// DJGPP, i386 linux, cygwin or mingw
// i386 linux, cygwin or mingw
FUNCMATH FUNCINLINE static inline fixed_t FixedMul(fixed_t a, fixed_t b) // asm
{
fixed_t ret;

View file

@ -1322,7 +1322,7 @@ static menuitem_t OP_Camera2ExtendedOptionsMenu[] =
enum
{
op_video_resolution = 1,
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
op_video_fullscreen,
#endif
op_video_vsync,
@ -1334,7 +1334,7 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_HEADER, NULL, "Screen", NULL, 0},
{IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 6},
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 11},
#endif
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 16},
@ -1453,7 +1453,7 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
#ifdef ALAM_LIGHTING
{IT_SUBMENU|IT_STRING, NULL, "Lighting...", &OP_OpenGLLightingDef, 144},
#endif
#if defined (_WINDOWS) && (!((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)))
#if defined (_WINDOWS) && (!(defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)))
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 154},
#endif
};
@ -12923,7 +12923,7 @@ static void M_VideoModeMenu(INT32 choice)
memset(modedescs, 0, sizeof(modedescs));
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // FIXME: hack
#endif
vidm_nummodes = 0;

View file

@ -64,8 +64,6 @@ typedef off_t off64_t;
#define PRIdS "u"
#elif defined (_WIN32)
#define PRIdS "Iu"
#elif defined (DJGPP)
#define PRIdS "u"
#else
#define PRIdS "zu"
#endif

View file

@ -216,6 +216,85 @@ INT32 R_SkinAvailable(const char *name)
return -1;
}
// Auxillary function that actually sets the skin
static void SetSkin(player_t *player, INT32 skinnum)
{
skin_t *skin = &skins[skinnum];
UINT16 newcolor = 0;
player->skin = skinnum;
player->camerascale = skin->camerascale;
player->shieldscale = skin->shieldscale;
player->charability = (UINT8)skin->ability;
player->charability2 = (UINT8)skin->ability2;
player->charflags = (UINT32)skin->flags;
player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
player->followitem = skin->followitem;
if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff.
player->powers[pw_shield] &= SH_STACK;
player->actionspd = skin->actionspd;
player->mindash = skin->mindash;
player->maxdash = skin->maxdash;
player->normalspeed = skin->normalspeed;
player->runspeed = skin->runspeed;
player->thrustfactor = skin->thrustfactor;
player->accelstart = skin->accelstart;
player->acceleration = skin->acceleration;
player->jumpfactor = skin->jumpfactor;
player->height = skin->height;
player->spinheight = skin->spinheight;
if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
{
if (player == &players[consoleplayer])
CV_StealthSetValue(&cv_playercolor, skin->prefcolor);
else if (player == &players[secondarydisplayplayer])
CV_StealthSetValue(&cv_playercolor2, skin->prefcolor);
player->skincolor = newcolor = skin->prefcolor;
if (player->bot && botingame)
{
botskin = (UINT8)(skinnum + 1);
botcolor = skin->prefcolor;
}
}
if (player->followmobj)
{
P_RemoveMobj(player->followmobj);
P_SetTarget(&player->followmobj, NULL);
}
if (player->mo)
{
fixed_t radius = FixedMul(skin->radius, player->mo->scale);
if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
{
skin = &skins[DEFAULTNIGHTSSKIN];
player->followitem = skin->followitem;
if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
newcolor = skin->prefcolor; // will be updated in thinker to flashing
}
player->mo->skin = skin;
if (newcolor)
player->mo->color = newcolor;
P_SetScale(player->mo, player->mo->scale);
player->mo->radius = radius;
P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames
}
}
// network code calls this when a 'skin change' is received
void SetPlayerSkin(INT32 playernum, const char *skinname)
{
@ -224,7 +303,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
if ((i != -1) && R_SkinUsable(playernum, i))
{
SetPlayerSkinByNum(playernum, i);
SetSkin(player, i);
return;
}
@ -233,7 +312,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
else if(server || IsPlayerAdmin(consoleplayer))
CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
SetPlayerSkinByNum(playernum, 0);
SetSkin(player, 0);
}
// Same as SetPlayerSkin, but uses the skin #.
@ -241,82 +320,10 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
{
player_t *player = &players[playernum];
skin_t *skin = &skins[skinnum];
UINT16 newcolor = 0;
if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists!
{
player->skin = skinnum;
player->camerascale = skin->camerascale;
player->shieldscale = skin->shieldscale;
player->charability = (UINT8)skin->ability;
player->charability2 = (UINT8)skin->ability2;
player->charflags = (UINT32)skin->flags;
player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
player->followitem = skin->followitem;
if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff.
player->powers[pw_shield] &= SH_STACK;
player->actionspd = skin->actionspd;
player->mindash = skin->mindash;
player->maxdash = skin->maxdash;
player->normalspeed = skin->normalspeed;
player->runspeed = skin->runspeed;
player->thrustfactor = skin->thrustfactor;
player->accelstart = skin->accelstart;
player->acceleration = skin->acceleration;
player->jumpfactor = skin->jumpfactor;
player->height = skin->height;
player->spinheight = skin->spinheight;
if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
{
if (playernum == consoleplayer)
CV_StealthSetValue(&cv_playercolor, skin->prefcolor);
else if (playernum == secondarydisplayplayer)
CV_StealthSetValue(&cv_playercolor2, skin->prefcolor);
player->skincolor = newcolor = skin->prefcolor;
if (player->bot && botingame)
{
botskin = (UINT8)(skinnum + 1);
botcolor = skin->prefcolor;
}
}
if (player->followmobj)
{
P_RemoveMobj(player->followmobj);
P_SetTarget(&player->followmobj, NULL);
}
if (player->mo)
{
fixed_t radius = FixedMul(skin->radius, player->mo->scale);
if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
{
skin = &skins[DEFAULTNIGHTSSKIN];
player->followitem = skin->followitem;
if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
newcolor = skin->prefcolor; // will be updated in thinker to flashing
}
player->mo->skin = skin;
if (newcolor)
player->mo->color = newcolor;
P_SetScale(player->mo, player->mo->scale);
player->mo->radius = radius;
P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames
}
SetSkin(player, skinnum);
return;
}
@ -324,7 +331,8 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum);
else if(server || IsPlayerAdmin(consoleplayer))
CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin
SetSkin(player, 0); // not found put the sonic skin
}
//

View file

@ -1033,11 +1033,9 @@ void S_SetSfxVolume(INT32 volume)
void S_ClearSfx(void)
{
#ifndef DJGPPDOS
size_t i;
for (i = 1; i < NUMSFX; i++)
I_FreeSfx(S_sfx + i);
#endif
}
static void S_StopChannel(INT32 cnum)

View file

@ -102,7 +102,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif
#endif
#if (defined (__unix__) && !defined (_MSDOS)) || (defined (UNIXCOMMON) && !defined(__APPLE__))
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
#include <errno.h>
#include <sys/wait.h>
#define NEWSIGNALHANDLER

View file

@ -418,7 +418,7 @@ void V_SetPalette(INT32 palettenum)
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_SetPalette(&pLocalPalette[palettenum*256]);
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
else
#endif
#endif
@ -432,7 +432,7 @@ void V_SetPaletteLump(const char *pal)
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_SetPalette(pLocalPalette);
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
else
#endif
#endif