#include "forward.h"
#include "vector.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <windows.h>
#include "extgl.h"
#include <GL/glu.h>
Go to the source code of this file.
Data Structures | |
| class | engine_interface_c |
| User supplied functions. | |
| struct | gvar_s |
| global stuff More... | |
| struct | initvars_s |
| Initialization variables struct. More... | |
Defines | |
| #define | SafeDelete(a) { if (a) { delete a; a = NULL; }} |
| safely delete a pointer, and set it to NULL | |
| #define | SafeArrayDelete(a) { if (a) { delete [] a; a = NULL; }} |
| safely delete an array pointer, and set it to NULL | |
| #define | StructElem(type, member) (ulong)(((type*)(0))->member) |
| get offset of the element in a struct or class | |
| #define | DBGSTAMP |
| write a debugstamp | |
| #define | ASTSTAMP(ex) |
| write an assertion | |
| #define | DebugReturn { DBGSTAMP; return; }; |
| Writes a debugstamp and returns. | |
| #define | DebugReturnValue(a) { DBGSTAMP; return a; }; |
| Writes a debugstamp and returns value a. | |
| #define | AssertReturn(ex) { ASTSTAMP(ex); assertions++; return; }; |
| Writes a failed assertion and returns. | |
| #define | AssertReturnValue(ex, a) { ASTSTAMP(ex); assertions++; return a; }; |
| Writes a failed assertion and returns a. | |
| #define | INVALID_INDEX -1 |
| indicates an error for functions that return an index | |
| #define | PI 3.1415926535897932384626433832795f |
| pi | |
| #define | PI2 6.2831853071795864769252867665590f |
| pi * 2 | |
| #define | SQRT2 1.4142135623730950488016887242097f |
| sqrt(2) | |
| #define | SIN45 0.7071067811865475244008443621048f |
| sin(45 deg) | |
| #define | DEG2RAD 0.0174532925199432957692369076848f |
| degrees * DEG2RAD = radians | |
| #define | RAD2DEG 57.295779513082320876798154814105f |
| radians * DEG2RAD = degrees | |
| #define | EQUAL_EPSILON 0.01f |
| equality distance for vector elements | |
| #define | TRUE_STRING "1yYtT" |
| all characters interpreted as true | |
| #define | FALSE_STRING "0nNfF" |
| all characters interpreted as false | |
| #define | frand(a, b) (((float)rand())/((float)RAND_MAX)*((b)-(a))+(a)) |
| get a random number between a and b | |
| #define | CLAMP(a, min, max) ((a>max)?(max):(a<min?min:a)) |
| clamp a value to the interval min - max | |
| #define | GETFRACTION(pos, a, b) ((pos-(a))/(b-(a))) |
| get the fraction pos is between a and b | |
Typedefs | |
| typedef initvars_s | initvars_t |
| Initialization variables struct. | |
| typedef gvar_s | gvar_t |
| global stuff | |
Functions | |
| void | _log_printf (sshort level, char *fmt,...) |
| void | _convert_file_path (char *path) |
| void | _convert_pak_path (char *path) |
| char * | _strtrm (char *string, char *trimchrs) |
| schar | _sgn (float f) |
| float | _interpolate_float_linear (float a, float b, float frac) |
| Interpolate two floats linearly. | |
| void | _swap_long (ulong &l) |
Variables | |
| gvar_t | gv |
| global variables _main.cpp | |
Definition in file omicron.h.
|
|
Value: { \
if (!(a)) AssertReturn(a);\
}; |
|
|
Value: { \
if (!(a)) AssertReturn(a);\
if (!(b)) AssertReturn(b);\
}; |
|
|
Value: { \
if (!(a)) AssertReturn(a);\
if (!(b)) AssertReturn(b);\
if (!(c)) AssertReturn(c);\
}; |
|
|
Value: { \
if (!(a)) AssertReturn(a);\
if (!(b)) AssertReturn(b);\
if (!(c)) AssertReturn(c);\
if (!(d)) AssertReturn(d);\
}; |
|
|
Value: { \
if (!(a)) AssertReturnValue(a,v);\
}; |
|
|
Value: { \
if (!(a)) AssertReturnValue(a,v);\
if (!(b)) AssertReturnValue(b,v);\
}; |
|
|
Value: { \
if (!(a)) AssertReturnValue(a,v);\
if (!(b)) AssertReturnValue(b,v);\
if (!(c)) AssertReturnValue(c,v);\
}; |
|
|
Value: { \
if (!(a)) AssertReturnValue(a,v);\
if (!(b)) AssertReturnValue(b,v);\
if (!(c)) AssertReturnValue(c,v);\
if (!(d)) AssertReturnValue(d,v);\
}; |
|
|
Value: _log_printf(MSG_DEBUG, "* ASSERTION ******************"); \ _log_printf(MSG_DEBUG, "Assertion '" #ex "' failed in" \ "%s - at or near line %u", __FILE__, __LINE__); |
|
|
Value: _log_printf(MSG_DEBUG, "* DEBUG **********************"); \ _log_printf(MSG_DEBUG, "%s - at or near line %u", __FILE__, __LINE__); |
|
|
Global variable type Keeps all global variables (or better: it should [TODO] :) There is a global variable of this type called gv. Use it to access this information. |
|
|
In this struct all initialization stuff is stored. |
|
|
Convert a path for a file on disk Converts all '/' in a string into an '\' when running under windows. And '\' into '/' under *nixen.
Definition at line 73 of file o_shared.cpp. Referenced by file_manager_c::load_pak(). |
|
|
Convert a path for a file in a pak Converts '\' into '/' as used in pak files.
Definition at line 88 of file o_shared.cpp. |
|
||||||||||||||||
|
Definition at line 209 of file o_shared.cpp. Referenced by vec3_c::linear(), vec2_c::linear(), and vec4_c::linear(). |
|
||||||||||||||||
|
Writes to the log file Writes a line into the log file. Syntax is the same as for printf.
Definition at line 91 of file o_logging.cpp. Referenced by net_manager_c::cl_sendmessage(), file_manager_c::close_paks(), file_manager_c::file_manager_c(), file_manager_c::load(), file_manager_c::load_from_disk(), file_manager_c::load_from_pak(), file_manager_c::load_pak(), sound_manager_c::load_wav(), net_client_c::receive_message(), net_client_c::send_message(), shader_load(), net_manager_c::start_listen(), net_manager_c::stop_listen(), and file_manager_c::unload_pak(). |
|
|
Get the sign of a float Returns -1 if negative, 0 if zero and 1 if positive Definition at line 224 of file o_shared.cpp. Referenced by brushface_c::cut(), and plane_pointside(). |
|
||||||||||||
|
Trim a string Removes any char from beginning and end of a string that is given in trimchrs. Returns a pointer to the first char that was not trimmed.
Definition at line 143 of file o_shared.cpp. Referenced by gui_c::load(). |
|
|
Swap a long Swaps the hi and lo word of a long. Definition at line 236 of file o_shared.cpp. |
1.2.18