mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2024-11-14 00:21:18 +00:00
More 64-bit portability fixes.
This commit is contained in:
parent
a523e11915
commit
8f43c6bf9f
16 changed files with 84 additions and 81 deletions
|
@ -108,7 +108,7 @@ LClampDone2:
|
|||
#endif
|
||||
#endif
|
||||
|
||||
void S_TransferStereo16 (unsigned long *pbuf, int endtime)
|
||||
void S_TransferStereo16 (unsigned int /*long*/ *pbuf, int endtime)
|
||||
{
|
||||
int lpos;
|
||||
int lpaintedtime;
|
||||
|
@ -151,9 +151,9 @@ void S_TransferPaintBuffer(int endtime)
|
|||
int *p;
|
||||
int step;
|
||||
int val;
|
||||
unsigned long *pbuf;
|
||||
unsigned int /*long*/ *pbuf;
|
||||
|
||||
pbuf = (unsigned long *)dma.buffer;
|
||||
pbuf = (unsigned int /*long*/ *)dma.buffer;
|
||||
|
||||
if (s_testsound->value)
|
||||
{
|
||||
|
|
|
@ -110,7 +110,7 @@ static int ovc_close (void *datasource)
|
|||
}
|
||||
|
||||
|
||||
static long ovc_tell (void *datasource)
|
||||
static int /*long*/ ovc_tell (void *datasource)
|
||||
{
|
||||
bgTrack_t *track = (bgTrack_t *)datasource;
|
||||
|
||||
|
|
|
@ -2147,7 +2147,7 @@ unsigned int Com_HashFileName (const char *fname, int hashSize, qboolean sized)
|
|||
letter = tolower(fname[i]);
|
||||
// if (letter == '.') break;
|
||||
if (letter == '\\') letter = '/'; // fix filepaths
|
||||
hash += (long)(letter)*(i+119);
|
||||
hash += (int)(letter)*(i+119);
|
||||
i++;
|
||||
}
|
||||
hash = (hash ^ (hash >> 10) ^ (hash >> 20));
|
||||
|
|
|
@ -606,7 +606,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
|
|||
Window root;
|
||||
XVisualInfo *visinfo;
|
||||
XSetWindowAttributes attr;
|
||||
unsigned long mask;
|
||||
unsigned int /*long*/ mask;
|
||||
int MajorVersion, MinorVersion;
|
||||
int actualWidth, actualHeight;
|
||||
int i;
|
||||
|
|
|
@ -313,11 +313,11 @@ void SWimp_AppActivate( qboolean active )
|
|||
Sys_MakeCodeWriteable
|
||||
================
|
||||
*/
|
||||
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
||||
void Sys_MakeCodeWriteable (unsigned int startaddr, unsigned int length)
|
||||
{
|
||||
|
||||
int r;
|
||||
unsigned long addr;
|
||||
unsigned int addr;
|
||||
int psize = getpagesize();
|
||||
|
||||
addr = (startaddr & ~(psize-1)) - psize;
|
||||
|
|
|
@ -93,12 +93,12 @@ int config_notify_width;
|
|||
int config_notify_height;
|
||||
|
||||
typedef unsigned short PIXEL16;
|
||||
typedef unsigned long PIXEL24;
|
||||
typedef unsigned int PIXEL24;
|
||||
static PIXEL16 st2d_8to16table[256];
|
||||
static PIXEL24 st2d_8to24table[256];
|
||||
static int shiftmask_fl=0;
|
||||
static long r_shift,g_shift,b_shift;
|
||||
static unsigned long r_mask,g_mask,b_mask;
|
||||
static int r_shift,g_shift,b_shift;
|
||||
static unsigned int r_mask,g_mask,b_mask;
|
||||
|
||||
void shiftmask_init(void)
|
||||
{
|
||||
|
@ -588,7 +588,7 @@ void ResetSharedFrameBuffers(void)
|
|||
(void *) shmat(x_shminfo[frm].shmid, 0, 0);
|
||||
|
||||
ri.Con_Printf(PRINT_DEVELOPER, "MITSHM shared memory (id=%d, addr=0x%lx)\n",
|
||||
x_shminfo[frm].shmid, (long) x_shminfo[frm].shmaddr);
|
||||
x_shminfo[frm].shmid, (int) x_shminfo[frm].shmaddr);
|
||||
|
||||
x_framebuffer[frm]->data = x_shminfo[frm].shmaddr;
|
||||
|
||||
|
@ -1233,11 +1233,11 @@ void SWimp_AppActivate( qboolean active )
|
|||
Sys_MakeCodeWriteable
|
||||
================
|
||||
*/
|
||||
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
||||
void Sys_MakeCodeWriteable (unsigned int startaddr, unsigned int length)
|
||||
{
|
||||
|
||||
int r;
|
||||
unsigned long addr;
|
||||
unsigned int addr;
|
||||
int psize = getpagesize();
|
||||
|
||||
addr = (startaddr & ~(psize-1)) - psize;
|
||||
|
|
|
@ -501,11 +501,11 @@ void Sys_CopyProtect(void)
|
|||
Sys_MakeCodeWriteable
|
||||
================
|
||||
*/
|
||||
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
||||
void Sys_MakeCodeWriteable (unsigned int startaddr, unsigned int length)
|
||||
{
|
||||
|
||||
int r;
|
||||
unsigned long addr;
|
||||
unsigned int addr;
|
||||
int psize = getpagesize();
|
||||
|
||||
addr = (startaddr & ~(psize-1)) - psize;
|
||||
|
|
|
@ -86,7 +86,7 @@ instruct clients to write files over areas they shouldn't.
|
|||
|
||||
typedef struct {
|
||||
char name[MAX_QPATH];
|
||||
long hash; // To speed up searching
|
||||
unsigned int hash; // To speed up searching
|
||||
int size;
|
||||
int offset; // This is ignored in PK3 files
|
||||
qboolean ignore; // Whether this file should be ignored
|
||||
|
@ -500,7 +500,7 @@ Performs a binary search by hashed filename
|
|||
to find pack items in a sorted pack
|
||||
=================
|
||||
*/
|
||||
int FS_FindPackItem (fsPack_t *pack, char *itemName, long itemHash)
|
||||
int FS_FindPackItem (fsPack_t *pack, char *itemName, unsigned int itemHash)
|
||||
{
|
||||
int smax, smin, smidpt; //, counter = 0;
|
||||
int i; //, matchStart, matchEnd;
|
||||
|
@ -628,7 +628,7 @@ int FS_FOpenFileRead (fsHandle_t *handle)
|
|||
fsSearchPath_t *search;
|
||||
fsPack_t *pack;
|
||||
char path[MAX_OSPATH];
|
||||
long hash;
|
||||
unsigned int hash;
|
||||
int i;
|
||||
unsigned int typeFlag;
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ int FS_FTell (fileHandle_t f)
|
|||
handle = FS_GetFileByHandle(f);
|
||||
|
||||
if (handle->pakFile) { // inside .pak file uses offset/size
|
||||
long pos = ftell(handle->file);
|
||||
int pos = ftell(handle->file);
|
||||
if (pos != -1)
|
||||
pos -= handle->pakFile->offset;
|
||||
return pos;
|
||||
|
@ -1589,7 +1589,7 @@ int FS_Tell (fileHandle_t f)
|
|||
handle = FS_GetFileByHandle(f);
|
||||
|
||||
if (handle->pakFile) { // inside .pak file uses offset/size
|
||||
long pos = ftell(handle->file);
|
||||
int pos = ftell(handle->file);
|
||||
if (pos != -1)
|
||||
pos -= handle->pakFile->offset;
|
||||
return pos;
|
||||
|
@ -1867,7 +1867,7 @@ FS_PakFileCompare
|
|||
Used for sorting pak entries by hash
|
||||
=================
|
||||
*/
|
||||
long *nameHashes = NULL;
|
||||
unsigned int *nameHashes = NULL;
|
||||
int FS_PakFileCompare (const void *f1, const void *f2)
|
||||
{
|
||||
if (!nameHashes)
|
||||
|
@ -1899,7 +1899,7 @@ fsPack_t *FS_LoadPAK (const char *packPath)
|
|||
unsigned contentFlags = 0;
|
||||
#ifdef BINARY_PACK_SEARCH
|
||||
int *sortIndices;
|
||||
long *sortHashes;
|
||||
unsigned int *sortHashes;
|
||||
#endif // BINARY_PACK_SEARCH
|
||||
|
||||
handle = fopen(packPath, "rb");
|
||||
|
@ -2030,7 +2030,7 @@ fsPack_t *FS_LoadPK3 (const char *packPath)
|
|||
#ifdef BINARY_PACK_SEARCH
|
||||
fsPackFile_t *tmpFiles;
|
||||
int *sortIndices;
|
||||
long *sortHashes;
|
||||
unsigned int *sortHashes;
|
||||
#endif // BINARY_PACK_SEARCH
|
||||
|
||||
handle = unzOpen(packPath);
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef unsigned short int UINT2;
|
|||
#ifdef __alpha__
|
||||
typedef unsigned int UINT4;
|
||||
#else
|
||||
typedef unsigned long int UINT4;
|
||||
typedef unsigned /*long*/ int UINT4;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@ cinematics_t *cin;
|
|||
|
||||
//=============================================================
|
||||
|
||||
long GetInteger (byte *data)
|
||||
int GetInteger (byte *data)
|
||||
{
|
||||
long b0, b1, b2, b3;
|
||||
int b0, b1, b2, b3;
|
||||
|
||||
b0 = (data[0] & 0xFF);
|
||||
b1 = (data[1] & 0xFF) << 8;
|
||||
|
|
|
@ -1057,9 +1057,9 @@ typedef struct png_handle_s
|
|||
{
|
||||
char *tmpBuf;
|
||||
int tmpi;
|
||||
long fBgColor; // DL Background color Added 30/05/2000
|
||||
int /*long*/ fBgColor; // DL Background color Added 30/05/2000
|
||||
int fTransparent; // DL Is this Image Transparent? Added 30/05/2000
|
||||
long fRowBytes; // DL Added 30/05/2000
|
||||
int /*long*/ fRowBytes; // DL Added 30/05/2000
|
||||
double fGamma; // DL Added 07/06/2000
|
||||
double fScreenGamma; // DL Added 07/06/2000
|
||||
char *fRowPtrs; // DL Changed for consistancy 30/05/2000
|
||||
|
@ -1082,8 +1082,8 @@ png_handle_t *r_png_handle = 0;
|
|||
|
||||
void R_InitializePNGData (void)
|
||||
{
|
||||
long* cvaluep; //ub
|
||||
long y;
|
||||
size_t /*long*/ *cvaluep; //ub
|
||||
int /*long*/ y;
|
||||
|
||||
// Initialize Data and RowPtrs
|
||||
if (r_png_handle->data)
|
||||
|
@ -1101,10 +1101,10 @@ void R_InitializePNGData (void)
|
|||
|
||||
if ((r_png_handle->data)&&(r_png_handle->fRowPtrs))
|
||||
{
|
||||
cvaluep = (long*)r_png_handle->fRowPtrs;
|
||||
cvaluep = (size_t /*long*/*)r_png_handle->fRowPtrs;
|
||||
for (y=0; y<r_png_handle->height; y++)
|
||||
{
|
||||
cvaluep[y] = (long)r_png_handle->data + ( y * (long)r_png_handle->fRowBytes ); //DL Added 08/07/2000
|
||||
cvaluep[y] = (size_t /*long*/)r_png_handle->data + ( y * (size_t /*long*/)r_png_handle->fRowBytes ); //DL Added 08/07/2000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1264,17 +1264,17 @@ By Robert 'Heffo' Heffernan
|
|||
=================================================================
|
||||
*/
|
||||
|
||||
void jpg_null(j_decompress_ptr cinfo)
|
||||
void jpg_null (j_decompress_ptr cinfo)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned char jpg_fill_input_buffer(j_decompress_ptr cinfo)
|
||||
unsigned char jpg_fill_input_buffer (j_decompress_ptr cinfo)
|
||||
{
|
||||
VID_Printf(PRINT_ALL, "Premature end of JPEG data\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
||||
void jpg_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||
{
|
||||
|
||||
cinfo->src->next_input_byte += (size_t) num_bytes;
|
||||
|
@ -1285,7 +1285,7 @@ void jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
|||
}
|
||||
|
||||
//void jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
|
||||
void jpeg_mem_src(j_decompress_ptr cinfo, const byte *mem, unsigned long len)
|
||||
void jpeg_mem_src (j_decompress_ptr cinfo, const byte *mem, unsigned long len)
|
||||
{
|
||||
cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr));
|
||||
cinfo->src->init_source = jpg_null;
|
||||
|
@ -2221,7 +2221,7 @@ nonscrap:
|
|||
// store the names of last images that failed to load
|
||||
#define NUM_FAIL_IMAGES 1024
|
||||
char lastFailedImage[NUM_FAIL_IMAGES][MAX_OSPATH];
|
||||
long lastFailedImageHash[NUM_FAIL_IMAGES];
|
||||
unsigned int lastFailedImageHash[NUM_FAIL_IMAGES];
|
||||
static unsigned failedImgListIndex;
|
||||
|
||||
/*
|
||||
|
@ -2248,8 +2248,8 @@ R_CheckImgFailed
|
|||
*/
|
||||
qboolean R_CheckImgFailed (char *name)
|
||||
{
|
||||
int i;
|
||||
long hash;
|
||||
int i;
|
||||
unsigned int hash;
|
||||
|
||||
hash = Com_HashFileName(name, 0, false);
|
||||
for (i=0; i<NUM_FAIL_IMAGES; i++)
|
||||
|
|
|
@ -86,7 +86,7 @@ typedef enum
|
|||
typedef struct image_s
|
||||
{
|
||||
char name[MAX_QPATH]; // game path, including extension
|
||||
long hash; // to speed up searching
|
||||
unsigned int hash; // to speed up searching
|
||||
imagetype_t type;
|
||||
int width, height; // source image
|
||||
int upload_width, upload_height; // after power of two and picmip
|
||||
|
|
|
@ -485,7 +485,7 @@ void Mod_LoadEdges (lump_t *l)
|
|||
// store the names of last textures that failed to load
|
||||
#define NUM_FAIL_TEXTURES 256
|
||||
char lastFailedTexture[NUM_FAIL_TEXTURES][MAX_OSPATH];
|
||||
long lastFailedTextureHash[NUM_FAIL_TEXTURES];
|
||||
unsigned int lastFailedTextureHash[NUM_FAIL_TEXTURES];
|
||||
static unsigned failedTexListIndex;
|
||||
|
||||
/*
|
||||
|
@ -512,8 +512,8 @@ Mod_CheckTexFailed
|
|||
*/
|
||||
qboolean Mod_CheckTexFailed (char *name)
|
||||
{
|
||||
int i;
|
||||
long hash;
|
||||
int i;
|
||||
unsigned int hash;
|
||||
|
||||
hash = Com_HashFileName(name, 0, false);
|
||||
for (i=0; i<NUM_FAIL_TEXTURES; i++)
|
||||
|
@ -573,10 +573,10 @@ image_t *Mod_FindTexture (char *name, imagetype_t type)
|
|||
// store the names and sizes of size reference .wal files
|
||||
typedef struct walsize_s
|
||||
{
|
||||
char name[MAX_OSPATH];
|
||||
long hash;
|
||||
int width;
|
||||
int height;
|
||||
char name[MAX_OSPATH];
|
||||
unsigned int hash;
|
||||
int width;
|
||||
int height;
|
||||
} walsize_t;
|
||||
|
||||
#define NUM_WALSIZES 1024
|
||||
|
@ -608,8 +608,8 @@ Mod_CheckWalSizeList
|
|||
*/
|
||||
qboolean Mod_CheckWalSizeList (const char *name, int *width, int *height)
|
||||
{
|
||||
int i;
|
||||
long hash;
|
||||
int i;
|
||||
unsigned int hash;
|
||||
|
||||
hash = Com_HashFileName(name, 0, false);
|
||||
for (i=0; i<NUM_WALSIZES; i++)
|
||||
|
|
|
@ -503,7 +503,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
|
|||
Window root;
|
||||
XVisualInfo *visinfo;
|
||||
XSetWindowAttributes attr;
|
||||
unsigned long mask;
|
||||
unsigned int mask;
|
||||
int MajorVersion, MinorVersion;
|
||||
int actualWidth, actualHeight;
|
||||
XSizeHints *sizehints;
|
||||
|
@ -641,7 +641,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
|
|||
#include "q2icon.xbm"
|
||||
|
||||
Pixmap icon_pixmap, icon_mask;
|
||||
unsigned long fg, bg;
|
||||
unsigned int fg, bg;
|
||||
int i;
|
||||
|
||||
fg = BlackPixel(dpy, visinfo->screen);
|
||||
|
@ -829,7 +829,7 @@ char *Sys_GetClipboardData()
|
|||
{
|
||||
Window sowner;
|
||||
Atom type, property;
|
||||
unsigned long len, bytes_left, tmp;
|
||||
unsigned int len, bytes_left, tmp;
|
||||
unsigned char *data;
|
||||
int format, result;
|
||||
char *ret = NULL;
|
||||
|
|
|
@ -27,6 +27,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include <windows.h>
|
||||
#include <process.h> // Knightmare added
|
||||
|
||||
// defines for MSVC6
|
||||
#if (_MSC_VER < 1300)
|
||||
#ifndef LONG_PTR
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#endif // _MSC_VER
|
||||
|
||||
extern HWND cl_hwnd;
|
||||
|
||||
static qboolean cdValid = false;
|
||||
|
@ -55,7 +62,7 @@ static void CDAudio_EjectThread (void)
|
|||
{
|
||||
DWORD dwReturn;
|
||||
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (LONG_PTR)NULL))
|
||||
Com_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
|
||||
_endthread();
|
||||
}
|
||||
|
@ -65,7 +72,7 @@ static void CDAudio_Eject (void)
|
|||
//_beginthread(CDAudio_EjectThread, 0, NULL);
|
||||
DWORD dwReturn;
|
||||
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (LONG_PTR)NULL))
|
||||
Com_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
|
||||
}
|
||||
|
||||
|
@ -74,7 +81,7 @@ static void CDAudio_CloseDoorThread (void)
|
|||
{
|
||||
DWORD dwReturn;
|
||||
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (LONG_PTR)NULL))
|
||||
Com_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
|
||||
_endthread();
|
||||
}
|
||||
|
@ -84,7 +91,7 @@ static void CDAudio_CloseDoor (void)
|
|||
//_beginthread(CDAudio_CloseDoorThread, 0, NULL);
|
||||
DWORD dwReturn;
|
||||
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (LONG_PTR)NULL))
|
||||
Com_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
|
||||
}
|
||||
|
||||
|
@ -98,7 +105,7 @@ static int CDAudio_GetAudioDiskInfo (void)
|
|||
cdValid = false;
|
||||
|
||||
mciStatusParms.dwItem = MCI_STATUS_READY;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (LONG_PTR) (LPVOID) &mciStatusParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("CDAudio: drive ready test - get status failed\n");
|
||||
|
@ -111,7 +118,7 @@ static int CDAudio_GetAudioDiskInfo (void)
|
|||
}
|
||||
|
||||
mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (LONG_PTR) (LPVOID) &mciStatusParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("CDAudio: get tracks - status failed\n");
|
||||
|
@ -158,7 +165,7 @@ void CDAudio_Play2 (int track, qboolean looping)
|
|||
// don't try to play a non-audio track
|
||||
mciStatusParms.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
|
||||
mciStatusParms.dwTrack = track;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (LONG_PTR) (LPVOID) &mciStatusParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);
|
||||
|
@ -173,7 +180,7 @@ void CDAudio_Play2 (int track, qboolean looping)
|
|||
// get the length of the track to be played
|
||||
mciStatusParms.dwItem = MCI_STATUS_LENGTH;
|
||||
mciStatusParms.dwTrack = track;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (LONG_PTR) (LPVOID) &mciStatusParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);
|
||||
|
@ -189,8 +196,8 @@ void CDAudio_Play2 (int track, qboolean looping)
|
|||
|
||||
mciPlayParms.dwFrom = MCI_MAKE_TMSF(track, 0, 0, 0);
|
||||
mciPlayParms.dwTo = (mciStatusParms.dwReturn << 8) | track;
|
||||
mciPlayParms.dwCallback = (DWORD)cl_hwnd;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD)(LPVOID) &mciPlayParms);
|
||||
mciPlayParms.dwCallback = (LONG_PTR)cl_hwnd;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (LONG_PTR)(LPVOID) &mciPlayParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
|
||||
|
@ -225,7 +232,7 @@ void CDAudio_Stop (void)
|
|||
if (!playing)
|
||||
return;
|
||||
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (LONG_PTR)NULL))
|
||||
Com_DPrintf("MCI_STOP failed (%i)", dwReturn);
|
||||
|
||||
wasPlaying = false;
|
||||
|
@ -244,8 +251,8 @@ void CDAudio_Pause (void)
|
|||
if (!playing)
|
||||
return;
|
||||
|
||||
mciGenericParms.dwCallback = (DWORD)cl_hwnd;
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms))
|
||||
mciGenericParms.dwCallback = (LONG_PTR)cl_hwnd;
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (LONG_PTR)(LPVOID) &mciGenericParms))
|
||||
Com_DPrintf("MCI_PAUSE failed (%i)", dwReturn);
|
||||
|
||||
wasPlaying = playing;
|
||||
|
@ -269,8 +276,8 @@ void CDAudio_Resume (void)
|
|||
|
||||
mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);
|
||||
mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);
|
||||
mciPlayParms.dwCallback = (DWORD)cl_hwnd;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms);
|
||||
mciPlayParms.dwCallback = (LONG_PTR)cl_hwnd;
|
||||
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (LONG_PTR)(LPVOID) &mciPlayParms);
|
||||
if (dwReturn)
|
||||
{
|
||||
Com_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
|
||||
|
@ -487,7 +494,7 @@ int CDAudio_Init (void)
|
|||
return -1;
|
||||
|
||||
mciOpenParms.lpstrDeviceType = "cdaudio";
|
||||
if (dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms))
|
||||
if (dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (LONG_PTR) (LPVOID) &mciOpenParms))
|
||||
{
|
||||
Com_Printf("CDAudio_Init: MCI_OPEN failed (%i)\n", dwReturn);
|
||||
return -1;
|
||||
|
@ -496,10 +503,10 @@ int CDAudio_Init (void)
|
|||
|
||||
// Set the time format to track/minute/second/frame (TMSF).
|
||||
mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms))
|
||||
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (LONG_PTR)(LPVOID) &mciSetParms))
|
||||
{
|
||||
Com_Printf("MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);
|
||||
mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD)NULL);
|
||||
mciSendCommand(wDeviceID, MCI_CLOSE, 0, (LONG_PTR)NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -528,7 +535,7 @@ void CDAudio_Shutdown(void)
|
|||
if (!initialized)
|
||||
return;
|
||||
CDAudio_Stop();
|
||||
if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD)NULL))
|
||||
if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (LONG_PTR)NULL))
|
||||
Com_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ void Sys_ShowConsole (qboolean show)
|
|||
Sys_ConsoleProc
|
||||
=================
|
||||
*/
|
||||
static LONG WINAPI Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
static LRESULT WINAPI Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
|
@ -269,14 +269,14 @@ static LONG WINAPI Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
SetBkMode((HDC)wParam, TRANSPARENT);
|
||||
SetBkColor((HDC)wParam, RGB(39, 115, 102));
|
||||
SetTextColor((HDC)wParam, RGB(255, 255, 255));
|
||||
return (LONG)sys_console.hBrushOutput;
|
||||
return (LRESULT)sys_console.hBrushOutput;
|
||||
}
|
||||
else if ((HWND)lParam == sys_console.hWndInput)
|
||||
{
|
||||
SetBkMode((HDC)wParam, TRANSPARENT);
|
||||
SetBkColor((HDC)wParam, RGB(255, 255, 255));
|
||||
SetTextColor((HDC)wParam, RGB(0, 0, 0));
|
||||
return (LONG)sys_console.hBrushInput;
|
||||
return (LRESULT)sys_console.hBrushInput;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -291,7 +291,7 @@ static LONG WINAPI Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
else
|
||||
SetTextColor((HDC)wParam, RGB(0, 0, 0));
|
||||
|
||||
return (LONG)sys_console.hBrushMsg;
|
||||
return (LRESULT)sys_console.hBrushMsg;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -311,7 +311,7 @@ static LONG WINAPI Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
Sys_ConsoleEditProc
|
||||
=================
|
||||
*/
|
||||
static LONG WINAPI Sys_ConsoleEditProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
static LRESULT WINAPI Sys_ConsoleEditProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
|
@ -379,11 +379,9 @@ void Sys_ShutdownConsole (void)
|
|||
}
|
||||
|
||||
if (sys_console.defOutputProc) {
|
||||
// SetWindowLong(sys_console.hWndOutput, GWL_WNDPROC, (LONG)sys_console.defOutputProc);
|
||||
SetWindowLongPtr(sys_console.hWndOutput, GWLP_WNDPROC, (LONG_PTR)sys_console.defOutputProc);
|
||||
}
|
||||
if (sys_console.defInputProc) {
|
||||
// SetWindowLong(sys_console.hWndInput, GWL_WNDPROC, (LONG)sys_console.defInputProc);
|
||||
SetWindowLongPtr(sys_console.hWndInput, GWLP_WNDPROC, (LONG_PTR)sys_console.defInputProc);
|
||||
}
|
||||
|
||||
|
@ -480,8 +478,6 @@ void Sys_InitDedConsole (void)
|
|||
sys_console.hBrushInput = CreateSolidBrush(RGB(255, 255, 255));
|
||||
|
||||
// Subclass edit boxes
|
||||
// sys_console.defOutputProc = (WNDPROC)SetWindowLong(sys_console.hWndOutput, GWL_WNDPROC, (LONG)Sys_ConsoleEditProc);
|
||||
// sys_console.defInputProc = (WNDPROC)SetWindowLong(sys_console.hWndInput, GWL_WNDPROC, (LONG)Sys_ConsoleEditProc);
|
||||
sys_console.defOutputProc = (WNDPROC)SetWindowLongPtr(sys_console.hWndOutput, GWLP_WNDPROC, (LONG_PTR)Sys_ConsoleEditProc);
|
||||
sys_console.defInputProc = (WNDPROC)SetWindowLongPtr(sys_console.hWndInput, GWLP_WNDPROC, (LONG_PTR)Sys_ConsoleEditProc);
|
||||
|
||||
|
|
Loading…
Reference in a new issue