diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-04-05 20:44:47 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-04-05 20:44:47 +0000 |
commit | a18e27d9df3934b82ab2ddec1dbf951c24fe4cb2 (patch) | |
tree | 7334d8d8fe9633cb1503d118fc3921ba033bf585 /source/sys_win.c | |
parent | 22fd6efeeb7ee918e0d1ffb75f6292077ce27816 (diff) |
Added `scr_showstats' variable.
Fixed drawing of transparent sprites.
Diffstat (limited to 'source/sys_win.c')
-rw-r--r-- | source/sys_win.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/sys_win.c b/source/sys_win.c index e5764f2..06d6ebd 100644 --- a/source/sys_win.c +++ b/source/sys_win.c @@ -574,19 +574,19 @@ HUNK =============================================================================== */ -void Hunk_Begin( mempool_t *pool, int maxsize ) { +void Hunk_Begin( mempool_t *pool, size_t maxsize ) { // reserve a huge chunk of memory, but don't commit any yet pool->cursize = 0; pool->maxsize = ( maxsize + 4095 ) & ~4095; pool->base = VirtualAlloc( NULL, pool->maxsize, MEM_RESERVE, PAGE_NOACCESS ); if( !pool->base ) { Com_Error( ERR_FATAL, - "VirtualAlloc reserve %d bytes failed. GetLastError() = %lu", + "VirtualAlloc reserve %"PRIz" bytes failed. GetLastError() = %lu", pool->maxsize, GetLastError() ); } } -void *Hunk_Alloc( mempool_t *pool, int size ) { +void *Hunk_Alloc( mempool_t *pool, size_t size ) { void *buf; // round to cacheline @@ -594,17 +594,17 @@ void *Hunk_Alloc( mempool_t *pool, int size ) { pool->cursize += size; if( pool->cursize > pool->maxsize ) - Com_Error( ERR_FATAL, "Hunk_Alloc: couldn't allocate %d bytes", size ); + Com_Error( ERR_FATAL, "%s: couldn't allocate %"PRIz" bytes", __func__, size ); // commit pages as needed buf = VirtualAlloc( pool->base, pool->cursize, MEM_COMMIT, PAGE_READWRITE ); if( !buf ) { Com_Error( ERR_FATAL, - "VirtualAlloc commit %d bytes failed. GetLastError() = %lu", + "VirtualAlloc commit %"PRIz" bytes failed. GetLastError() = %lu", pool->cursize, GetLastError() ); } - return ( void * )( pool->base + pool->cursize - size ); + return ( byte * )pool->base + pool->cursize - size; } void Hunk_End( mempool_t *pool ) { @@ -618,7 +618,7 @@ void Hunk_Free( mempool_t *pool ) { } } - memset( pool, 0, sizeof( pool ) ); + memset( pool, 0, sizeof( *pool ) ); } /* |