mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-14 16:31:38 +00:00
8d5b217266
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines removed MAX_VISEDICTS limit. PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default. TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW. added android multitouch emulation for windows/rawinput (in_simulatemultitouch). split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature. now using utf-8 for windows consoles. qcc warnings/errors now give clickable console links for quick+easy editing. disabled menutint when the currently active item changes contrast or gamma (for OneManClan). Added support for drawfont/drawfontscale. tweaked the qcvm a little to reduce the number of pointers. .doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up. windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings. fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen. editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts. Added support for .framegroups files for psk(psa) and iqm formats. True support for ezquake's colour codes. Mutually exclusive with background colours. path command output slightly more readable. added support for digest_hex (MD4, SHA1, CRC16). skingroups now colourmap correctly. Fix terrain colour hints, and litdata from the wrong bsp. fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported). remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother. fix v *= v.x and similar opcodes. fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported. fteqcc: fixed '#if 1 == 3 && 4' parsing. fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable. fteqcc: copyright message now includes compile date instead. fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile. fteqccgui: the output window is now focused and scrolls down as compilation progresses. pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue. rewrote prespawn/modelist/soundlist code. server tracks progress now. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
152 lines
4.5 KiB
C
152 lines
4.5 KiB
C
/*
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
/*
|
|
memory allocation
|
|
|
|
|
|
H_??? The hunk manages the entire memory block given to quake. It must be
|
|
contiguous. Memory can be allocated from either the low or high end in a
|
|
stack fashion. The only way memory is released is by resetting one of the
|
|
pointers.
|
|
|
|
Hunk allocations should be given a name, so the Hunk_Print () function
|
|
can display usage.
|
|
|
|
Hunk allocations are guaranteed to be 16 byte aligned.
|
|
|
|
The video buffers are allocated high to avoid leaving a hole underneath
|
|
server allocations when changing to a higher video mode.
|
|
|
|
|
|
Z_??? Zone memory functions used for small, dynamic allocations like text
|
|
strings from command input. There is only about 48K for it, allocated at
|
|
the very bottom of the hunk.
|
|
|
|
Cache_??? Cache memory is for objects that can be dynamically loaded and
|
|
can usefully stay persistant between levels. The size of the cache
|
|
fluctuates from level to level.
|
|
|
|
To allocate a cachable object
|
|
|
|
|
|
Temp_??? Temp memory is used for file loading and surface caching. The size
|
|
of the cache memory is adjusted so that there is a minimum of 512k remaining
|
|
for temp memory.
|
|
|
|
|
|
------ Top of Memory -------
|
|
|
|
high hunk allocations
|
|
|
|
<--- high hunk reset point held by vid
|
|
|
|
video buffer
|
|
|
|
z buffer
|
|
|
|
surface cache
|
|
|
|
<--- high hunk used
|
|
|
|
cachable memory
|
|
|
|
<--- low hunk used
|
|
|
|
client and server low hunk allocations
|
|
|
|
<-- low hunk reset point held by host
|
|
|
|
startup hunk allocations
|
|
|
|
Zone block
|
|
|
|
----- Bottom of Memory -----
|
|
|
|
|
|
|
|
*/
|
|
|
|
void Memory_Init (void *buf, int size);
|
|
void Memory_DeInit(void);
|
|
|
|
void VARGS Z_Free (void *ptr);
|
|
void *Z_Malloc (int size); // returns 0 filled memory
|
|
void *ZF_Malloc (int size); // allowed to fail
|
|
void *Z_MallocNamed (int size, char *file, int line); // returns 0 filled memory
|
|
void *ZF_MallocNamed (int size, char *file, int line); // allowed to fail
|
|
//#define Z_Malloc(x) Z_MallocNamed2(x, __FILE__, __LINE__ )
|
|
void *VARGS Z_TagMalloc (int size, int tag);
|
|
void VARGS Z_TagFree(void *ptr);
|
|
void VARGS Z_FreeTags(int tag);
|
|
//void *Z_Realloc (void *ptr, int size);
|
|
|
|
//Big Zone: allowed to fail, doesn't clear. The expectation is a large file, rather than sensative data structures.
|
|
//(this is a nicer name for malloc)
|
|
void *BZ_Malloc(int size);
|
|
void *BZF_Malloc(int size);
|
|
void *BZ_MallocNamed (int size, char *file, int line); // returns 0 filled memory
|
|
void *BZF_MallocNamed (int size, char *file, int line); // allowed to fail
|
|
void *BZ_Realloc(void *ptr, int size);
|
|
void *BZ_ReallocNamed(void *data, int newsize, char *file, int line);
|
|
void *BZF_Realloc(void *data, int newsize);
|
|
void *BZF_ReallocNamed(void *data, int newsize, char *file, int line);
|
|
void BZ_Free(void *ptr);
|
|
|
|
#ifdef USE_MSVCRT_DEBUG
|
|
#define BZ_Malloc(size) BZ_MallocNamed(size, __FILE__, __LINE__)
|
|
#define Z_Malloc(size) Z_MallocNamed(size, __FILE__, __LINE__)
|
|
#define BZ_Realloc(ptr, size) BZ_ReallocNamed(ptr, size, __FILE__, __LINE__)
|
|
#define BZF_Malloc(size) BZF_MallocNamed(size, __FILE__, __LINE__)
|
|
#define ZF_Malloc(size) ZF_MallocNamed(size, __FILE__, __LINE__)
|
|
#define BZF_Realloc(ptr, size) BZF_ReallocNamed(ptr, size, __FILE__, __LINE__)
|
|
#endif
|
|
|
|
void *Hunk_Alloc (int size); // returns 0 filled memory
|
|
void *Hunk_AllocName (int size, char *name);
|
|
|
|
int Hunk_LowMark (void);
|
|
void Hunk_FreeToLowMark (int mark);
|
|
int Hunk_LowMemAvailable(void);
|
|
|
|
void *Hunk_TempAlloc (int size);
|
|
void *Hunk_TempAllocMore (int size); //Don't clear old temp
|
|
|
|
void Hunk_Check (void);
|
|
|
|
typedef struct cache_user_s
|
|
{
|
|
void *data;
|
|
qboolean fake;
|
|
} cache_user_t;
|
|
|
|
void Cache_Flush (void);
|
|
|
|
void *Cache_Check (cache_user_t *c);
|
|
// returns the cached data, and moves to the head of the LRU list
|
|
// if present, otherwise returns NULL
|
|
|
|
void Cache_Free (cache_user_t *c);
|
|
|
|
void *Cache_Alloc (cache_user_t *c, int size, char *name);
|
|
// Returns NULL if all purgable data was tossed and there still
|
|
// wasn't enough room.
|
|
|
|
void Cache_Report (void);
|
|
|