#if WORKINGLQUAKE
pointfile = COM_LoadTempFile (name);
#else
- pointfile = FS_LoadFile(name, tempmempool, true);
+ pointfile = (char *)FS_LoadFile(name, tempmempool, true);
#endif
if (!pointfile)
{
}
Con_Printf("Reading %s...\n", name);
+ VectorClear(leakorg);
c = 0;
s = 0;
pointfilepos = pointfile;
void SHOWLMP_decodehide(void)
{
int i;
- qbyte *lmplabel;
+ char *lmplabel;
lmplabel = MSG_ReadString();
for (i = 0;i < SHOWLMP_MAXLABELS;i++)
if (showlmp[i].isactive && strcmp(showlmp[i].label, lmplabel) == 0)
void SHOWLMP_decodeshow(void)
{
int i, k;
- qbyte lmplabel[256], picname[256];
+ char lmplabel[256], picname[256];
float x, y;
strlcpy (lmplabel,MSG_ReadString(), sizeof (lmplabel));
strlcpy (picname, MSG_ReadString(), sizeof (picname));
float enterfrac, leavefrac, d1, d2, f, imove, newimpactnormal[3], enterfrac2;
const colplanef_t *startplane, *endplane;
+ VectorClear(newimpactnormal);
enterfrac = -1;
enterfrac2 = -1;
leavefrac = 1;
float enterfrac, leavefrac, d1, d2, f, imove, newimpactnormal[3], enterfrac2;
const colplanef_t *startplane, *endplane;
+ VectorClear(newimpactnormal);
enterfrac = -1;
enterfrac2 = -1;
leavefrac = 1;
if (gl_support_fragment_shader)
{
CHECKGLERROR
- qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &backendimageunits);
+ qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, (int *)&backendimageunits);
CHECKGLERROR
- qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &backendarrayunits);
+ qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&backendarrayunits);
CHECKGLERROR
Con_Printf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits);
}
// must match NUMCROSSHAIRS in r_crosshairs.c
#define NUMCROSSHAIRS 6
-static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
+static qbyte crosshairtexdata[NUMCROSSHAIRS][16*16] =
{
+ {
"................"
"................"
"................"
"................"
"................"
"................"
- ,
+ },
+ {
"................"
"................"
"................"
"................"
"................"
"................"
- ,
+ },
+ {
"................"
".......77......."
".......77......."
".......77......."
".......77......."
"................"
- ,
+ },
+ {
"................"
"................"
"................"
"........7......."
"........7......."
"................"
- ,
+ },
+ {
"................"
"................"
"................"
"................"
"................"
"................"
- ,
+ },
+ {
"................"
"................"
"................"
"................"
"................"
"................"
+ }
};
static rtexture_t *draw_generatecrosshair(int num)
return &video->cpif;
}
- crc = CRC_Block(path, strlen(path));
+ crc = CRC_Block((qbyte *)path, strlen(path));
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (path, pic->name))
int crc, hashkey;
cachepic_t *pic;
- crc = CRC_Block(picname, strlen(picname));
+ crc = CRC_Block((qbyte *)picname, strlen(picname));
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (picname, pic->name))
int hashkey;
cachepic_t *pic;
// this doesn't really free the pic, but does free it's texture
- crc = CRC_Block(picname, strlen(picname));
+ crc = CRC_Block((qbyte *)picname, strlen(picname));
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
{
t = (y + 0.5f) * (2.0f / NORMSIZE) - 1.0f;
switch(side)
{
+ default:
case 0:
v[0] = 1;
v[1] = -t;
if (l >= 0 && !strcmp(entname + l, ".bsp"))
{
strcpy(entname + l, ".ent");
- if ((entities = FS_LoadFile(entname, tempmempool, true)))
+ if ((entities = (char *)FS_LoadFile(entname, tempmempool, true)))
{
CL_ParseEntityLump(entities);
Mem_Free(entities);
else
Host_Error("R_FreeTexture: image not linked in pool\n");
if (image->texnum)
- qglDeleteTextures(1, &image->texnum);
+ qglDeleteTextures(1, (GLuint *)&image->texnum);
if (image->blockallocation)
Mem_Free(image->blockallocation);
Mem_Free(image);
image->bytesperpixel = texinfo->internalbytesperpixel;
image->sides = image->texturetype == GLTEXTURETYPE_CUBEMAP ? 6 : 1;
// get a texture number to use
- qglGenTextures(1, &image->texnum);
+ qglGenTextures(1, (GLuint *)&image->texnum);
*imagechainpointer = image;
image->texturecount++;
{
int i, count;
sizebuf_t buf;
- char message[4];
+ qbyte message[4];
Con_DPrintf("Host_ShutdownServer\n");
cls.demonum = -1; // stop demo loop in case this fails
- t = text = FS_LoadFile (filename, tempmempool, false);
+ t = text = (char *)FS_LoadFile (filename, tempmempool, false);
if (!text)
{
Con_Print("ERROR: couldn't open.\n");
const char *p1;
char *p2;
// LordHavoc: 256 char say messages
- unsigned char text[256];
+ char text[256];
qboolean fromServer = false;
if (cmd_source == src_command)
}
else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET4)
{
- int inetaddresslength;
+ unsigned int inetaddresslength;
address->addresstype = LHNETADDRESSTYPE_NONE;
inetaddresslength = sizeof(address->addressdata.inet4);
value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, (struct sockaddr *)&address->addressdata.inet4, &inetaddresslength);
}
else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET6)
{
- int inetaddresslength;
+ unsigned int inetaddresslength;
address->addresstype = LHNETADDRESSTYPE_NONE;
inetaddresslength = sizeof(address->addressdata.inet6);
value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, (struct sockaddr *)&address->addressdata.inet6, &inetaddresslength);
{
for (i = 0;i < search->numfilenames;i++)
{
- if ((f = FS_LoadFile(search->filenames[i], tempmempool, false)))
+ if ((f = (char *)FS_LoadFile(search->filenames[i], tempmempool, false)))
{
text = f;
while (COM_ParseToken(&text, false))
shadowmesh_t *mesh;
vec3_t nmins, nmaxs, ncenter, temp;
float nradius2, dist2, *v;
+ VectorClear(nmins);
+ VectorClear(nmaxs);
// calculate bbox
for (mesh = firstmesh;mesh;mesh = mesh->next)
{
*/
memset(tagsets, 0, sizeof(tagsets));
memset(word, 0, sizeof(word));
- for (i = 0;i < MAX_SKINS && (data = text = FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true));i++)
+ for (i = 0;i < MAX_SKINS && (data = text = (char *)FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true));i++)
{
numtags = 0;
}
static int alphaonlytable[4] = {255 | 0x80000000, 255 | 0x80000000, 255 | 0x80000000, 3};
-static void Mod_Sprite_SharedSetup(const qbyte *datapointer, int version, const int *palette, const int *alphapalette)
+static void Mod_Sprite_SharedSetup(const qbyte *datapointer, int version, const unsigned int *palette, const unsigned int *alphapalette)
{
int i, j, groupframes, realframes, x, y, origin[2], width, height;
dspriteframetype_t *pinframetype;
alphapalette[i][3] = palette[i][3];
}
- Mod_Sprite_SharedSetup(datapointer, LittleLong (pinhlsprite->version), (int *)(&palette[0][0]), (int *)(&alphapalette[0][0]));
+ Mod_Sprite_SharedSetup(datapointer, LittleLong (pinhlsprite->version), (unsigned int *)(&palette[0][0]), (unsigned int *)(&alphapalette[0][0]));
}
else
Host_Error("Mod_IDSP_Load: %s has wrong version number (%i). Only %i (quake), %i (HalfLife), and %i (sprite32) supported",
if (developer.integer)
Con_Printf("Datagram_ParseConnectionless: received CCREP_REJECT from %s.\n", addressstring2);
cls.connect_trying = false;
- M_Update_Return_Reason(data);
+ M_Update_Return_Reason((char *)data);
break;
#if 0
case CCREP_SERVER_INFO:
outpoints[11] = planedist * planenormalz - quadsize * quadright[2] - quadsize * quadup[2];
}
-void PolygonF_Divide(unsigned int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, unsigned int outfrontmaxpoints, float *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, float *outbackpoints, unsigned int *neededbackpoints)
+void PolygonF_Divide(int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, int outfrontmaxpoints, float *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, float *outbackpoints, int *neededbackpoints)
{
- unsigned int i, frontcount, backcount;
+ int i, frontcount, backcount;
const float *n, *p;
float frac, pdist, ndist;
frontcount = 0;
*neededbackpoints = backcount;
}
-void PolygonD_Divide(unsigned int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, unsigned int outfrontmaxpoints, double *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, double *outbackpoints, unsigned int *neededbackpoints)
+void PolygonD_Divide(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, double *outbackpoints, int *neededbackpoints)
{
- unsigned int i, frontcount, backcount;
+ int i, frontcount, backcount;
const double *n, *p;
double frac, pdist, ndist;
frontcount = 0;
void PolygonF_QuadForPlane(float *outpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float quadsize);
void PolygonD_QuadForPlane(double *outpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double quadsize);
-void PolygonF_Divide(unsigned int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, unsigned int outfrontmaxpoints, float *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, float *outbackpoints, unsigned int *neededbackpoints);
-void PolygonD_Divide(unsigned int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, unsigned int outfrontmaxpoints, double *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, double *outbackpoints, unsigned int *neededbackpoints);
+void PolygonF_Divide(int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, int outfrontmaxpoints, float *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, float *outbackpoints, int *neededbackpoints);
+void PolygonD_Divide(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, double *outbackpoints, int *neededbackpoints);
#endif
void VM_loadfromfile(void)
{
const char *filename;
- qbyte *data;
+ char *data;
VM_SAFEPARMCOUNT(1,VM_loadfromfile);
}
// not conform with VM_fopen
- data = FS_LoadFile(filename, tempmempool, false);
+ data = (char *)FS_LoadFile(filename, tempmempool, false);
if (data == NULL)
PRVM_G_FLOAT(OFS_RETURN) = -1;
unsigned int sampleIndex;
float *outBuffer;
float scale;
-
+
offset = (s_chunkCount * submissionChunk) % maxMixedSamples;
samples = s_mixedSamples + offset;
-
+
outBuffer = (float *)outOutputData->mBuffers[0].mData;
-
+
// If we have run out of samples, return silence
if (s_chunkCount * submissionChunk > shm->format.channels * paintedtime)
{
s_chunkCount++; // this is the next buffer we will submit
}
-
+
return 0;
}
Con_Printf("AudioHardwareGetProperty returned %d\n", status);
return false;
}
-
+
if (outputDeviceID == kAudioDeviceUnknown)
{
Con_Printf("AudioHardwareGetProperty: outputDeviceID is kAudioDeviceUnknown\n");
return false;
}
- // Configure the output device
+ // Configure the output device
// TODO: support "-sndspeed", "-sndmono" and "-sndstereo"
propertySize = sizeof(bufferByteCount);
bufferByteCount = CHUNK_SIZE * sizeof(float);
Con_Printf("AudioDeviceSetProperty: returned %d when setting kAudioDevicePropertyBufferSize to %d\n", status, CHUNK_SIZE);
return false;
}
-
+
propertySize = sizeof(bufferByteCount);
status = AudioDeviceGetProperty(outputDeviceID, 0, false, kAudioDevicePropertyBufferSize, &propertySize, &bufferByteCount);
if (status)
Con_Printf("Default Audio Device doesn't support Linear PCM!\n");
return false;
}
-
+
// Start sound running
status = AudioDeviceAddIOProc(outputDeviceID, audioDeviceIOProc, NULL);
if (status)
s_isRunning = true;
Con_Printf(" Initialization successful\n");
-
+
return true;
}
void SNDDMA_Shutdown(void)
{
OSStatus status;
-
+
if (!s_isRunning)
return;
-
+
status = AudioDeviceStop(outputDeviceID, audioDeviceIOProc);
if (status)
{
Con_Printf("AudioDeviceStop: returned %d\n", status);
return;
}
-
+
s_isRunning = false;
-
+
status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc);
if (status)
{
Con_Printf("AudioDeviceRemoveIOProc: returned %d\n", status);
return;
}
-
+
Mem_Free(s_mixedSamples);
s_mixedSamples = NULL;
- shm->samples = NULL;
+ shm->buffer = NULL;
}
/*
// Stereo sound support
if (ch->sfx->format.channels == 2)
{
- sfx = sb->data + (ch->pos - sb->offset) * 2;
+ sfx = (signed char *)sb->data + (ch->pos - sb->offset) * 2;
for (i = 0;i < count;i++)
{
paintbuffer[i].left += (*sfx++ * leftvol) >> 8;
}
else
{
- sfx = sb->data + ch->pos - sb->offset;
+ sfx = (signed char *)sb->data + ch->pos - sb->offset;
for (i = 0;i < count;i++)
{
paintbuffer[i].left += (*sfx * leftvol) >> 8;
paintbuffer[i].right += (*sfx++ * rightvol) >> 8;
}
-
}
ch->pos += count;
return true;
bigendian = 0;
#endif
done = 0;
- while ((ret = qov_read (&per_ch->vf, &resampling_buffer[done], (int)(newlength - done), bigendian, 2, 1, &per_ch->bs)) > 0)
+ while ((ret = qov_read (&per_ch->vf, (char *)&resampling_buffer[done], (int)(newlength - done), bigendian, 2, 1, &per_ch->bs)) > 0)
done += ret;
// Resample in the sfxbuffer
Mem_Free (per_ch);
ch->fetcher_data = NULL;
-
+
format = &ch->sfx->format;
buff_len = STREAM_BUFFER_SIZE(format);
ch->sfx->memsize -= sizeof (*per_ch) - sizeof (per_ch->sb.data) + buff_len;
s->loopstart = -1;
s->flags &= ~SFXFLAG_STREAMED;
- sb->length = (unsigned int)ResampleSfx (buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name);
+ sb->length = (unsigned int)ResampleSfx ((qbyte *)buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name);
s->format.speed = shm->format.speed;
s->total_length = sb->length;
sb->offset = 0;
}
data_p -= 8;
last_chunk = data_p + 8 + ( (iff_chunk_len + 1) & ~1 );
- if (!strncmp(data_p, name, 4))
+ if (!strncmp((const char *)data_p, name, 4))
return;
}
}
// find "RIFF" chunk
FindChunk("RIFF");
- if (!(data_p && !strncmp(data_p+8, "WAVE", 4)))
+ if (!(data_p && !strncmp((const char *)data_p+8, "WAVE", 4)))
{
Con_Print("Missing RIFF/WAVE chunks\n");
return info;
FindNextChunk ("LIST");
if (data_p)
{
- if (!strncmp (data_p + 28, "mark", 4))
+ if (!strncmp ((const char *)data_p + 28, "mark", 4))
{ // this is not a proper parse, but it works with cooledit...
data_p += 24;
i = GetLittleLong (); // samples in loop
*/
void SV_SendReconnect (void)
{
- char data[128];
- sizebuf_t msg;
+ qbyte data[128];
+ sizebuf_t msg;
msg.data = data;
msg.cursize = 0;
{
prvm_edict_t *ent;
int i;
- qbyte *entities;
+ char *entities;
model_t *worldmodel;
char modelname[sizeof(sv.modelname)];
// load replacement entity file if found
entities = NULL;
if (sv_entpatch.integer)
- entities = FS_LoadFile(va("maps/%s.ent", sv.name), tempmempool, true);
+ entities = (char *)FS_LoadFile(va("maps/%s.ent", sv.name), tempmempool, true);
if (entities)
{
Con_Printf("Loaded maps/%s.ent\n", sv.name);
{
if (context == NULL || window == NULL)
return;
-
+
IN_Activate(false);
VID_RestoreSystemGamma();
-
+
if (context != NULL)
{
qaglDestroyContext(context);
context = NULL;
}
-
+
if (window != NULL)
{
DisposeWindow(window);
static OSStatus MainWindowEventHandler (EventHandlerCallRef nextHandler, EventRef event, void *userData)
{
OSStatus err = noErr;
-
+
switch (GetEventKind (event))
{
case kEventWindowClosed:
vid_activewindow = false;
VID_RestoreSystemGamma();
}
-
+
// Closed
if (AsyncEvent_Quitting)
{
Con_Printf("Unable to create window (error %d)\n", carbonError);
return false;
}
-
+
// Set the window title
CFStringRef windowTitle = CFSTR("DarkPlaces AGL");
SetWindowTitleWithCFString(window, windowTitle);
// Install the callback function for the window events we can't get
// through ReceiveNextEvent (i.e. close, collapse, and expand)
InstallWindowEventHandler (window, NewEventHandlerUPP (MainWindowEventHandler),
- GetEventTypeCount(winEvents), winEvents, window, NULL);
+ GetEventTypeCount(winEvents), winEvents, window, NULL);
screen = GetGWorldDevice(GetWindowPort(window));
if (screen == NULL)
Sys_Error ("aglSetDrawable failed\n");
if (!qaglSetCurrentContext(context))
Sys_Error ("aglSetCurrentContext failed\n");
-
+
scr_width = width;
scr_height = height;
vid_isfullscreen = true;
}
- gl_renderer = qglGetString(GL_RENDERER);
- gl_vendor = qglGetString(GL_VENDOR);
- gl_version = qglGetString(GL_VERSION);
- gl_extensions = qglGetString(GL_EXTENSIONS);
+ gl_renderer = (const char *)qglGetString(GL_RENDERER);
+ gl_vendor = (const char *)qglGetString(GL_VENDOR);
+ gl_version = (const char *)qglGetString(GL_VERSION);
+ gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
gl_platform = "AGL";
gl_videosyncavailable = false;
{
EventRef theEvent;
EventTargetRef theTarget;
-
- // Start by processing the asynchronous events we received since the previous frame
+
+ // Start by processing the asynchronous events we received since the previous frame
VID_ProcessPendingAsyncEvents();
theTarget = GetEventDispatcherTarget();
case kEventMouseMoved:
{
HIPoint deltaPos;
-
+
GetEventParameter(theEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(deltaPos), NULL, &deltaPos);
//Con_Printf(">> kEventMouseMoved (%f, %f) <<\n", deltaPos.x, deltaPos.y);
Handle_Key(keycode, false);
//Con_Printf(">> kEventRawKeyUp (%d) <<\n", keycode);
break;
-
+
case kEventRawKeyModifiersChanged:
{
UInt32 keymod = 0;
// enable key repeat since everyone expects it
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
- gl_renderer = qglGetString(GL_RENDERER);
- gl_vendor = qglGetString(GL_VENDOR);
- gl_version = qglGetString(GL_VERSION);
- gl_extensions = qglGetString(GL_EXTENSIONS);
+ gl_renderer = (const char *)qglGetString(GL_RENDERER);
+ gl_vendor = (const char *)qglGetString(GL_VENDOR);
+ gl_version = (const char *)qglGetString(GL_VERSION);
+ gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
gl_platform = "SDL";
// Knghtbrd: should assign platform-specific extensions here
//TODO: maybe ;)
entity_t *ent;
float vieworg[3], gunorg[3], viewangles[3];
trace_t trace;
+ VectorClear(gunorg);
Matrix4x4_CreateIdentity(&viewmodelmatrix);
Matrix4x4_CreateIdentity(&r_refdef.viewentitymatrix);
if (cls.state == ca_connected && cls.signon == SIGNONS)