#ifndef PROGS_H
#define PROGS_H
#include "pr_comp.h" // defs shared with qcc
+#include "qtypes.h"
+
#define ENTITYGRIDAREAS 16
#define MAX_ENTITYCLUSTERS 16
+#ifdef PRVM_64
+#define PRVM_FLOAT_IS_TRUE_FOR_INT(x) DOUBLE_IS_TRUE_FOR_INT(x)
+#define PRVM_FLOAT_LOSSLESS_FORMAT DOUBLE_LOSSLESS_FORMAT
+#define PRVM_VECTOR_LOSSLESS_FORMAT DOUBLE_VECTOR_LOSSLESS_FORMAT
+#else
+#define PRVM_FLOAT_IS_TRUE_FOR_INT(x) FLOAT_IS_TRUE_FOR_INT(x)
+#define PRVM_FLOAT_LOSSLESS_FORMAT FLOAT_LOSSLESS_FORMAT
+#define PRVM_VECTOR_LOSSLESS_FORMAT FLOAT_VECTOR_LOSSLESS_FORMAT
+#endif
+
#ifdef USEODE
#define GEOMTYPE_NONE -1
#define GEOMTYPE_SOLID 0
break;
case ev_float:
// LadyHavoc: changed from %5.1f to %10.4f
- dpsnprintf (line, linelength, FLOAT_LOSSLESS_FORMAT, val->_float);
+ dpsnprintf (line, linelength, PRVM_FLOAT_LOSSLESS_FORMAT, val->_float);
break;
case ev_vector:
// LadyHavoc: changed from %5.1f to %10.4f
- dpsnprintf (line, linelength, "'" VECTOR_LOSSLESS_FORMAT "'", val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, linelength, "'" PRVM_VECTOR_LOSSLESS_FORMAT "'", val->vector[0], val->vector[1], val->vector[2]);
break;
case ev_pointer:
dpsnprintf (line, linelength, "pointer");
dpsnprintf (line, linelength, "void");
break;
case ev_float:
- dpsnprintf (line, linelength, FLOAT_LOSSLESS_FORMAT, val->_float);
+ dpsnprintf (line, linelength, PRVM_FLOAT_LOSSLESS_FORMAT, val->_float);
break;
case ev_vector:
- dpsnprintf (line, linelength, VECTOR_LOSSLESS_FORMAT, val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, linelength, PRVM_VECTOR_LOSSLESS_FORMAT, val->vector[0], val->vector[1], val->vector[2]);
break;
default:
dpsnprintf (line, linelength, "bad type %i", type);
OPC->_float = OPA->_float < OPB->_float;
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_AND):
- OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) && FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add AND_I to be used by fteqcc for anything not a float
+ OPC->_float = PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int) && PRVM_FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add AND_I to be used by fteqcc for anything not a float
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_OR):
- OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) || FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add OR_I to be used by fteqcc for anything not a float
+ OPC->_float = PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int) || PRVM_FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add OR_I to be used by fteqcc for anything not a float
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_NOT_F):
- OPC->_float = !FLOAT_IS_TRUE_FOR_INT(OPA->_int);
+ OPC->_float = !PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int);
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_NOT_V):
OPC->_float = !OPA->vector[0] && !OPA->vector[1] && !OPA->vector[2];
#define DOUBLE_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFFFFFFFFFF) // also match "negative zero" doubles of value 0x8000000000000000
#define DOUBLE_LOSSLESS_FORMAT "%.17g"
#define DOUBLE_VECTOR_LOSSLESS_FORMAT "%.17g %.17g %.17g"
+
#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFF) // also match "negative zero" floats of value 0x80000000
#define FLOAT_LOSSLESS_FORMAT "%.9g"
#define FLOAT_VECTOR_LOSSLESS_FORMAT "%.9g %.9g %.9g"
-#ifdef PRVM_64
-#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFFFFFFFFFF) // also match "negative zero" doubles of value 0x8000000000000000
-#define FLOAT_LOSSLESS_FORMAT "%.17g"
-#define VECTOR_LOSSLESS_FORMAT "%.17g %.17g %.17g"
-#else
-#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFF) // also match "negative zero" floats of value 0x80000000
-#define FLOAT_LOSSLESS_FORMAT "%.9g"
-#define VECTOR_LOSSLESS_FORMAT "%.9g %.9g %.9g"
-#endif
// originally this was _MSC_VER
// but here we want to test the system libc, which on win32 is borked, and NOT the compiler