Replace "signed short" with "int16_t"

This commit is contained in:
GravisZro 2024-05-23 23:04:15 -04:00
parent 3dcd21b717
commit cc67b9230a
13 changed files with 27 additions and 27 deletions

View File

@ -1211,7 +1211,7 @@ object Objects[MAX_OBJECTS];
tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY];
ubyte Object_position_head;
signed short Object_map_position_history[MAX_OBJECTS];
int16_t Object_map_position_history[MAX_OBJECTS];
short Object_map_position_free_slots[MAX_OBJECT_POS_HISTORY];
uint16_t Num_free_object_position_history;

View File

@ -825,7 +825,7 @@ typedef struct {
} tPosHistory;
extern tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY];
extern ubyte Object_position_head;
extern signed short Object_map_position_history[MAX_OBJECTS];
extern int16_t Object_map_position_history[MAX_OBJECTS];
extern float Last_position_history_update[MAX_POSITION_HISTORY]; // last gametime the positions were updated
void ObjInitPositionHistory(object *obj);
void ObjFreePositionHistory(object *obj);

View File

@ -23,7 +23,7 @@ namespace AudioDecoder {
typedef uint32_t uint32_t;
typedef int32_t int32_t;
typedef uint16_t uint16;
typedef signed short sint16;
typedef int16_t sint16;
typedef uint8_t uint8_t;
typedef int8_t int8_t;

View File

@ -171,7 +171,7 @@ typedef int8_t FxI8;
typedef uint16_t FxU16;
typedef signed short FxI16;
typedef int16_t FxI16;
typedef int32_t FxI32;

View File

@ -26,7 +26,7 @@
typedef uint32_t uint32_t;
typedef int32_t int32_t;
typedef uint16_t uint16;
typedef signed short sint16;
typedef int16_t sint16;
typedef uint8_t uint8_t;
typedef int8_t int8_t;

View File

@ -522,7 +522,7 @@ static bool StartupSoundSystem(LnxSoundDevice *dev) {
static void ShutdownSoundSystem(void) { SDL_CloseAudio(); }
static inline void GetValues(const LnxSoundBuffer *dsb, uint8_t *buf, uint32_t *fl, uint32_t *fr) {
signed short *bufs = (signed short *)buf;
int16_t *bufs = (int16_t *)buf;
// 8 bit stereo
if ((dsb->wfx.wBitsPerSample == 8) && dsb->wfx.nChannels == 2) {
@ -555,7 +555,7 @@ static inline void GetValues(const LnxSoundBuffer *dsb, uint8_t *buf, uint32_t *
}
static inline void SetValues(uint8_t *buf, uint32_t fl, uint32_t fr) {
signed short *bufs = (signed short *)buf;
int16_t *bufs = (int16_t *)buf;
// 8 bit stereo
if ((LnxBuffers[0]->wfx.wBitsPerSample == 8) && (LnxBuffers[0]->wfx.nChannels == 2)) {
@ -588,7 +588,7 @@ static inline void SetValues(uint8_t *buf, uint32_t fl, uint32_t fr) {
static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, uint8_t *buf, uint32_t len) {
uint32_t i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3);
uint8_t *bpc = buf;
signed short *bps = (signed short *)buf;
int16_t *bps = (int16_t *)buf;
if ((!(dsb->lbdesc.dwFlags & LNXSND_CAPS_CTRLPAN) || (dsb->pan == 0)) &&
(!(dsb->lbdesc.dwFlags & LNXSND_CAPS_CTRLVOLUME) || (dsb->volume == 0)))
@ -680,7 +680,7 @@ static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) {
uint32_t i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3);
uint8_t *buf, *ibuf, *obuf;
int32_t temp, field;
signed short *ibufs, *obufs;
int16_t *ibufs, *obufs;
if (!(dsb->flags & LNXSND_LOOPING)) {
temp = DoMulDiv(LnxBuffers[0]->wfx.nAvgBytesPerSec, dsb->buffer_len, dsb->bps) -
@ -716,8 +716,8 @@ static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) {
obuf = LnxBuffers[0]->buffer + LnxBuffers[0]->play_cursor;
for (i = 0; i < len; i += advance) {
obufs = (signed short *)obuf;
ibufs = (signed short *)ibuf;
obufs = (int16_t *)obuf;
ibufs = (int16_t *)ibuf;
if (LnxBuffers[0]->wfx.wBitsPerSample == 16) {
field = *ibufs;
field += *obufs;

View File

@ -38,7 +38,7 @@ extern unsigned nf_hicolor;
extern uint16_t nf_trans16_lo[256];
extern uint16_t nf_trans16_hi[256];
extern signed short snd_8to16[256];
extern int16_t snd_8to16[256];
void PkDecompWorker(const bool hiColor, const uint8_t *ops, const uint8_t *comp, const unsigned x,
const unsigned y, const unsigned w, const unsigned h);
void nfHPkDecomp(uint8_t *ops, uint8_t *comp, int x, int y, int w, int h);
@ -154,8 +154,8 @@ int32_t nfpk_ShiftY[256];
// Constant tables
// 8-bit -8:7 x nf_width + -8:7
signed short nfpk_ShiftP1[256];
signed short nfpk_ShiftP2[256];
int16_t nfpk_ShiftP1[256];
int16_t nfpk_ShiftP2[256];
// Constant tables
// mov eax, ebx/ecx

View File

@ -32,7 +32,7 @@
*/
#define S short
signed short snd_8to16[256] = {
int16_t snd_8to16[256] = {
(S)0, (S)1, (S)2, (S)3, (S)4, (S)5,
(S)6, (S)7, (S)(S)8, (S)9, (S)10, (S)11,
(S)12, (S)13, (S)14, (S)15, (S)(S)16, (S)17,

View File

@ -506,7 +506,7 @@ static bool StartupSoundSystem(LnxSoundDevice *dev) {
static void ShutdownSoundSystem(void) { SDL_CloseAudio(); }
static inline void GetValues(const LnxSoundBuffer *dsb, uint8_t *buf, uint32_t *fl, uint32_t *fr) {
signed short *bufs = (signed short *)buf;
int16_t *bufs = (int16_t *)buf;
// 8 bit stereo
if ((dsb->wfx.wBitsPerSample == 8) && dsb->wfx.nChannels == 2) {
@ -539,7 +539,7 @@ static inline void GetValues(const LnxSoundBuffer *dsb, uint8_t *buf, uint32_t *
}
static inline void SetValues(uint8_t *buf, uint32_t fl, uint32_t fr) {
signed short *bufs = (signed short *)buf;
int16_t *bufs = (int16_t *)buf;
// 8 bit stereo
if ((LnxBuffers[0]->wfx.wBitsPerSample == 8) && (LnxBuffers[0]->wfx.nChannels == 2)) {
@ -572,7 +572,7 @@ static inline void SetValues(uint8_t *buf, uint32_t fl, uint32_t fr) {
static void LinuxSoundMixWithVolume(LnxSoundBuffer *dsb, uint8_t *buf, uint32_t len) {
uint32_t i, inc = (LnxBuffers[0]->wfx.wBitsPerSample >> 3);
uint8_t *bpc = buf;
signed short *bps = (signed short *)buf;
int16_t *bps = (int16_t *)buf;
if ((!(dsb->lbdesc.dwFlags & LNXSND_CAPS_CTRLPAN) || (dsb->pan == 0)) &&
(!(dsb->lbdesc.dwFlags & LNXSND_CAPS_CTRLVOLUME) || (dsb->volume == 0)))
@ -664,7 +664,7 @@ static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) {
uint32_t i, ilen, advance = (LnxBuffers[0]->wfx.wBitsPerSample >> 3);
uint8_t *buf, *ibuf, *obuf;
int32_t temp, field;
signed short *ibufs, *obufs;
int16_t *ibufs, *obufs;
if (!(dsb->flags & LNXSND_LOOPING)) {
temp = DoMulDiv(LnxBuffers[0]->wfx.nAvgBytesPerSec, dsb->buffer_len, dsb->bps) -
@ -700,8 +700,8 @@ static uint32_t LinuxSoundMixInMainBuffer(LnxSoundBuffer *dsb, int len) {
obuf = LnxBuffers[0]->buffer + LnxBuffers[0]->play_cursor;
for (i = 0; i < len; i += advance) {
obufs = (signed short *)obuf;
ibufs = (signed short *)ibuf;
obufs = (int16_t *)obuf;
ibufs = (int16_t *)ibuf;
if (LnxBuffers[0]->wfx.wBitsPerSample == 16) {
field = *ibufs;
field += *obufs;

View File

@ -38,7 +38,7 @@ extern unsigned nf_width; // wqty * SWIDTH
extern unsigned nf_new_line; // width - SWIDTH
extern unsigned nf_back_right; // (SHEIGHT-1)*width
extern signed short snd_8to16[256];
extern int16_t snd_8to16[256];
void nfHPkDecomp(uint8_t *ops, uint8_t *comp, int x, int y, int w, int h);
void nfPkConfig(void);
unsigned sndDecompM16(uint16_t *dst, const uint8_t *src, unsigned len, unsigned prev);
@ -152,8 +152,8 @@ int32_t nfpk_ShiftY[256];
// Constant tables
// 8-bit -8:7 x nf_width + -8:7
signed short nfpk_ShiftP1[256];
signed short nfpk_ShiftP2[256];
int16_t nfpk_ShiftP1[256];
int16_t nfpk_ShiftP2[256];
// Constant tables
// mov eax, ebx/ecx

View File

@ -32,7 +32,7 @@
*/
#pragma warning(disable : 4245)
signed short snd_8to16[256] = {
int16_t snd_8to16[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,

View File

@ -2114,7 +2114,7 @@ private:
int *Camera_view_mode;
char DatabaseRegisteredName[MAX_DBNAME_SIZE];
signed short players_in_game[MAX_PLAYER_RECORDS];
int16_t players_in_game[MAX_PLAYER_RECORDS];
// DMFCBase::InitializeForLevel
//

View File

@ -512,7 +512,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) {
#define FLASHRATE 700.0 // alphas per second
signed short a = m_Alpha;
int16_t a = m_Alpha;
int units = (int)FLASHRATE * (*basethis->Frametime);
// do alphaing effect