2020-03-08 19:32:07 +00:00
|
|
|
// SONIC ROBO BLAST 2
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
2023-03-31 12:53:31 +00:00
|
|
|
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
2020-03-08 19:32:07 +00:00
|
|
|
//
|
|
|
|
// This program is free software distributed under the
|
|
|
|
// terms of the GNU General Public License, version 2.
|
|
|
|
// See the 'LICENSE' file for more details.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
/// \file r_skins.h
|
|
|
|
/// \brief Skins stuff
|
|
|
|
|
|
|
|
#ifndef __R_SKINS__
|
|
|
|
#define __R_SKINS__
|
|
|
|
|
|
|
|
#include "info.h"
|
|
|
|
#include "sounds.h"
|
2020-03-09 13:54:56 +00:00
|
|
|
#include "d_player.h" // skinflags
|
2020-08-15 23:48:28 +00:00
|
|
|
#include "r_patch.h"
|
2020-05-15 04:34:54 +00:00
|
|
|
#include "r_picformats.h" // spriteinfo_t
|
2020-03-08 19:32:07 +00:00
|
|
|
#include "r_defs.h" // spritedef_t
|
|
|
|
|
|
|
|
/// Defaults
|
|
|
|
#define SKINNAMESIZE 16
|
|
|
|
// should be all lowercase!! S_SKIN processing does a strlwr
|
|
|
|
#define DEFAULTSKIN "sonic"
|
|
|
|
#define DEFAULTSKIN2 "tails" // secondary player
|
|
|
|
#define DEFAULTNIGHTSSKIN 0
|
|
|
|
|
|
|
|
/// The skin_t struct
|
|
|
|
typedef struct
|
|
|
|
{
|
2021-08-10 18:17:22 +00:00
|
|
|
char name[SKINNAMESIZE+1]; // name of the skin
|
|
|
|
UINT8 skinnum;
|
2020-03-08 19:32:07 +00:00
|
|
|
UINT16 wadnum;
|
|
|
|
skinflags_t flags;
|
|
|
|
|
2023-08-20 17:29:03 +00:00
|
|
|
char realname[SKINNAMESIZE+1]; // Display name for level completion
|
2020-03-08 19:32:07 +00:00
|
|
|
char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long)
|
2023-08-20 17:29:03 +00:00
|
|
|
char supername[SKINNAMESIZE+7]; // Super name to display when collecting all emeralds
|
2020-03-08 19:32:07 +00:00
|
|
|
|
|
|
|
UINT8 ability; // ability definition
|
|
|
|
UINT8 ability2; // secondary ability definition
|
|
|
|
INT32 thokitem;
|
|
|
|
INT32 spinitem;
|
|
|
|
INT32 revitem;
|
|
|
|
INT32 followitem;
|
|
|
|
fixed_t actionspd;
|
|
|
|
fixed_t mindash;
|
|
|
|
fixed_t maxdash;
|
|
|
|
|
|
|
|
fixed_t normalspeed; // Normal ground
|
|
|
|
fixed_t runspeed; // Speed that you break into your run animation
|
|
|
|
|
|
|
|
UINT8 thrustfactor; // Thrust = thrustfactor * acceleration
|
|
|
|
UINT8 accelstart; // Acceleration if speed = 0
|
|
|
|
UINT8 acceleration; // Acceleration
|
|
|
|
|
|
|
|
fixed_t jumpfactor; // multiple of standard jump height
|
|
|
|
|
|
|
|
fixed_t radius; // Bounding box changes.
|
|
|
|
fixed_t height;
|
|
|
|
fixed_t spinheight;
|
|
|
|
|
|
|
|
fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size
|
|
|
|
fixed_t camerascale;
|
|
|
|
|
|
|
|
// Definable color translation table
|
|
|
|
UINT8 starttranscolor;
|
2020-05-24 00:29:07 +00:00
|
|
|
UINT16 prefcolor;
|
|
|
|
UINT16 supercolor;
|
|
|
|
UINT16 prefoppositecolor; // if 0 use tables instead
|
2024-01-11 12:11:54 +00:00
|
|
|
UINT16 natkcolor; //Color for Nights Attack Menu
|
2020-03-08 19:32:07 +00:00
|
|
|
|
|
|
|
fixed_t highresscale; // scale of highres, default is 0.5
|
|
|
|
UINT8 contspeed; // continue screen animation speed
|
|
|
|
UINT8 contangle; // initial angle on continue screen
|
|
|
|
|
|
|
|
// specific sounds per skin
|
|
|
|
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
|
|
|
|
|
2023-11-13 00:46:49 +00:00
|
|
|
spritedef_t sprites[NUMPLAYERSPRITES];
|
|
|
|
spriteinfo_t sprinfo[NUMPLAYERSPRITES];
|
|
|
|
|
2020-03-08 19:32:07 +00:00
|
|
|
// contains super versions too
|
2023-11-13 00:46:49 +00:00
|
|
|
struct {
|
|
|
|
spritedef_t sprites[NUMPLAYERSPRITES];
|
|
|
|
spriteinfo_t sprinfo[NUMPLAYERSPRITES];
|
|
|
|
} super;
|
2024-06-03 00:40:14 +00:00
|
|
|
|
|
|
|
// TODO: 2.3: Delete
|
|
|
|
spritedef_t sprites_compat[NUMPLAYERSPRITES * 2];
|
2020-03-08 19:32:07 +00:00
|
|
|
} skin_t;
|
|
|
|
|
|
|
|
/// Externs
|
|
|
|
extern INT32 numskins;
|
2021-08-09 18:57:07 +00:00
|
|
|
extern skin_t **skins;
|
2020-03-08 19:32:07 +00:00
|
|
|
|
|
|
|
/// Function prototypes
|
|
|
|
void R_InitSkins(void);
|
|
|
|
|
2021-04-25 21:54:47 +00:00
|
|
|
INT32 GetPlayerDefaultSkin(INT32 playernum);
|
2020-03-08 19:32:07 +00:00
|
|
|
void SetPlayerSkin(INT32 playernum,const char *skinname);
|
|
|
|
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
|
|
|
boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
|
|
|
|
UINT32 R_GetSkinAvailabilities(void);
|
|
|
|
INT32 R_SkinAvailable(const char *name);
|
2023-08-15 16:51:12 +00:00
|
|
|
INT32 R_GetForcedSkin(INT32 playernum);
|
2021-04-25 11:18:32 +00:00
|
|
|
void R_AddSkins(UINT16 wadnum, boolean mainfile);
|
|
|
|
void R_PatchSkins(UINT16 wadnum, boolean mainfile);
|
2023-07-28 00:21:46 +00:00
|
|
|
void R_DelSkins(void);
|
2020-03-08 19:32:07 +00:00
|
|
|
|
2023-11-13 00:46:49 +00:00
|
|
|
UINT16 P_GetStateSprite2(state_t *state);
|
|
|
|
UINT16 P_GetSprite2StateFrame(state_t *state);
|
|
|
|
UINT16 P_GetSkinSprite2(skin_t *skin, UINT16 spr2, player_t *player);
|
2023-11-13 16:24:18 +00:00
|
|
|
UINT16 P_ApplySuperFlagToSprite2(UINT16 spr2, mobj_t *mobj);
|
2023-11-13 00:46:49 +00:00
|
|
|
spritedef_t *P_GetSkinSpritedef(skin_t *skin, UINT16 spr2);
|
|
|
|
spriteinfo_t *P_GetSkinSpriteInfo(skin_t *skin, UINT16 spr2);
|
|
|
|
boolean P_IsValidSprite2(skin_t *skin, UINT16 spr2);
|
|
|
|
boolean P_IsStateSprite2Super(state_t *state);
|
2020-03-08 19:32:07 +00:00
|
|
|
|
2022-02-27 12:56:45 +00:00
|
|
|
void R_RefreshSprite2(void);
|
|
|
|
|
2020-03-08 19:32:07 +00:00
|
|
|
#endif //__R_SKINS__
|