extern cvar_t r_fog_clear;
#define WANT_SCREENSHOT_HWGAMMA (scr_screenshot_hwgamma.integer && vid_usinghwgamma)
-int jpeg_supported = false;
-
qboolean scr_initialized; // ready to draw
float scr_con_current;
struct scr_screenshots_thread_s
{
/* SCR_ScreenShot_Async added by Izy (izy from http://www.izysoftware.com/) */
- struct scr_screenshots_thread_s *next, *back;
+ struct scr_screenshots_thread_s *next;
void *thread;
int ended;
height = it->height;
keep_alpha = it->keep_alpha;
buffer1 = (unsigned char *)(it+1);
- buffer2 = (unsigned char *)Mem_Alloc(scr_screenshots_mempool, width * height * (keep_alpha ? 4 : 3));
+ buffer2 = (unsigned char *)malloc(width * height * (keep_alpha ? 4 : 3));
ret = SCR_ScreenShot_Sync(it->filename, buffer1, buffer2, it->x, it->y, width, height, it->flipx, it->flipy, it->flipdiagonal, it->jpeg, it->png, it->gammacorrect, keep_alpha, Dummy_ReadPixelsBGRA);
- Mem_Free(buffer2);
+ free(buffer2);
it->ended = 1; // don't care about mutex sync objects...
return ret;
}
if (!it->thread)
goto failure2;
it->next = NULL;
- it->back = scr_screenshots_thread_last;
if(scr_screenshots_thread_last)
scr_screenshots_thread_last->next = it;
scr_screenshots_thread_last = it;
#OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS)
#OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
#OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
-OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
+#OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
+OPTIM_RELEASE=-O3 -flto -fno-strict-aliasing $(CPUOPTIMIZATIONS)
# NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
DO_CC=$(CC) $(CFLAGS) -c $< -o $@
##### Linux specific variables #####
# Link
-LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXCL)
-LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl
-LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXSDL)
+LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -Wl,-z,now -Wl,-z,relro $(LDFLAGS_UNIXCL)
+LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -Wl,-z,now -Wl,-z,relro
+LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -Wl,-z,now -Wl,-z,relro $(LDFLAGS_UNIXSDL)
##### Mac OS X specific variables #####
out->numsurfaces = (unsigned short)MSG_ReadLittleShort(sb);
if (out->firstsurface + out->numsurfaces > (unsigned int)loadmodel->num_surfaces)
{
- Con_Printf("Mod_Q2BSP_LoadNodes: invalid surface index range %i+%i (file has only %i surfaces)\n", p, out->firstsurface, out->numsurfaces, loadmodel->num_surfaces);
+ Con_Printf("Mod_Q2BSP_LoadNodes: invalid surface index range %i+%i (file has only %i surfaces)\n", out->firstsurface, out->numsurfaces, loadmodel->num_surfaces);
out->firstsurface = 0;
out->numsurfaces = 0;
}
{
prvm_edict_t *e;
- VM_SAFEPARMCOUNT(2, VM_setorigin);
+ VM_SAFEPARMCOUNT(2, VM_SV_setorigin);
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
prvm_edict_t *e;
vec3_t mins, maxs;
- VM_SAFEPARMCOUNT(3, VM_setsize);
+ VM_SAFEPARMCOUNT(3, VM_SV_setsize);
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
dp_model_t *mod;
int i;
- VM_SAFEPARMCOUNT(2, VM_setmodel);
+ VM_SAFEPARMCOUNT(2, VM_SV_setmodel);
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
# endif
#endif
+#if defined(__GNUC__) && defined(__FAST_MATH__) // Izy's Patch
+#error "__FAST_MATH__ was defined by the GCC compiler. You are using -ffast-math"
+#endif
+
#include "quakedef.h"
#include "thread.h"
" movl %%edi,%%ebx\n"
: "=m" (features)
:
- : "%eax", "%ecx", "%edx", "%edi"
+ : "%eax", "%ecx", "%edx", "%edi", "cc" // fix, izy's
);
# elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
__asm {