cursor: fix definition of ALLOW_SYS_CURSOR and use DDS instead of PNG
ogl_tex: add ogl_tex_transform_to for convenience
tex: fix issue with transform code (might not flip image if it was DDS)
win: decompress cursor texture if it was DDS
renderer: use DDS instead of PNG for alpha maps
This was SVN commit r3148.
this is good in general (less dependence on compiler) and is intended to
work around a bug andrew has been seeing. apparently VC generates
invalid code for the parameters + ASSERT, which causes infinite
recursion on the <location> validation.
This was SVN commit r3142.
sysdep: remove round; document several functions; use ia32.h header
instead of a hack that extern-declared sysdep functions that are
implemented as macro-redirection
wsdl: add SDL_EnableKeyRepeat stub; group related functions in header
together; no longer need OS_WIN wrapper around that
This was SVN commit r3115.
minimap, PatchRData, renderer: fix ELOSState comparison vs & and use
SAFE_DELETE
ia32: add rounding control constants (for FISTP)
premake: set /QIfist compiler setting which causes float->int casts to
go through FISTP instruction instead of _ftol2() (much faster, but
requires CPU state to have been set)
LOSManager.cpp: cache m_TilesPerSize; use MIN/MAX; use
CTerrain::CalcFromPosition; clean up GetUnitState a bit. now runs at
203ns, down from 222
This was SVN commit r3099.
ia32: removing misleading and outdated comment
Player: add "LOS token" - speeds up LosManager by caching a temp result
LOSMAnager: speed up by about 9%, more to come. combined 2 DWORDs into
one u16; further optimization pending. old code remains (via #ifdef
frankenstein)
This was SVN commit r3097.
networkInternal - remove E* error codes; rely on system <errno.h> header
wposix: add all SUSv3 error codes; value = that of CRT (where
available), otherwise the linux value
This was SVN commit r3087.
reinstate g_keys - realized that atlas mode cannot call SDL_GetKeyState
main: use g_app_minimized etc. to use up less CPU time when app isn't
active (makes debugging more bearable)
This was SVN commit r3070.
-- this fixes "cursor keys require ctrl" bug reported by jason
wdbg_sym: fix warning
wsdl: as above and also better SDL_ACTIVEEVENT handling
mmgr: 500µs -> 500s -> 500us :)
This was SVN commit r3065.
Add an "instancing" model renderer to improve rendering of
non-transparent,
unanimated models. This renderer is used when the vertexshader path is
rendering path is used.
This was SVN commit r3052.
wdbg_sym: make sure symbol info is initialized even if *resolve() fails;
also fix warnings
renderer: make sure texture array is initialized
This was SVN commit r3049.
debug: add debug_is_code_ptr and debug_is_stack_ptr
config: add CONFIG_OMIT_FP (needed for ia32_stackwalk).
h_mgr: hyperparanoid overrun detection straightjacket for key2idx - now
safe to use at any time and any unexpected changes cause access
violation.
ia32: add ia32_get_call_target, which disassembles backwards and checks
for a valid CALL instruction + its target
wdbg_sym: add win-specific walk stack function. it's quite simple and
requires EBP frames (hence CONFIG_OMIT_FP). rationale: dbghelp requires
~30 seconds (!) to start up. recent changes (tracking malloc callers via
debug_get_nth_caller) made this happen on every run, so added a
fast-path stack walker to avoid this.
This was SVN commit r3043.
ia32.asm: move get_current_context code here
wdbg_sym: revised get_context code; moved it into walk_stack (fixes bug
on non-ia32)
wsdl: bring in line with real SDL SDL_BUTTON_* (sorry nicolai!)
interact now checks for expected values of SDL_BUTTON.
This was SVN commit r2991.
vfs_tree: move bucket allocator to allocators.cpp
allocators: add matrix self-test
zip: remove redundant timing code and add CHECK_ZFILE everywhere
ogl_tex: implement app hook for overriding gl upload caps
tex: add CHECK_TEX everywhere
TextureManager: only call LoadTextures once (instead of for each file
type)
debug: add hook for translating error messages; add filtering mechanism
to only show interesting debug_printfs (WIP). restructured code:
debug_puts is the sysdep part, while debug_printf does filtering and
then calls that
This was SVN commit r2990.
Fix: Unix symbol resolver ignores NULL parameters like Windows resolver
instead of crashing.
Fix: Bugs and crashes in the input system, caused by wrong use of
SDL_BUTTON_* constants.
This was SVN commit r2984.
vfs: move public functions into vfs.cpp to avoid confusion (except
vfs_mount in vfs_mount.cpp, but that's obvious)
h_mgr: fix bug in filename display causing dir names to be truncated
main/gamesetup: replace 2 bools with flags; remove Atlas trampoline
functions (clutters up main.cpp)
atlas: use GameSetup.h instead of extern ..
This was SVN commit r2983.
vfs: now always check filter in VDir (Not only in debug mode)
vfs_tree: free VFS nodes to avoid them appearing as "leaks". bugfix in
bucket allocator - wasn't coping with exactly filled buckets correctly
all Handle users: add to_string method that writes the interesting parts
of a resource's user data to string.
h_mgr: show this information when a handle is closed
ogl_tex: add ogl_tex_find
add 2 timer clients
mem: now record address of function that allocated memory
GameSetup: fix shutdown order
Renderer: allow freeing individual alpha map textures (we cache the
composite)
This was SVN commit r2981.
textureentry: add performance note
list, text: fix mousewheel direction
input: was going to add a deque to allow registering handlers in back
and front. obviated by minimap fix, though. cleaned up a bit and renamed
stuff (again, sigh).
loaderthunks: fixed weird alignment/padding warning
This was SVN commit r2979.
ia32, sysdep: add rint()
minimap: saw TODO on GetMapSpaceCoords and sped it up by 15% using rintf
and precalculating scaleX
timer: add indication of how often something was billed (helps measure
stuff called an indeterminate number of times)
This was SVN commit r2973.
terrain: made const-correct
lib: Add round_up_to_pow2
minimap: cleanup. split user input and DrawViewRect out of Draw; add
m_Camera; made pointers const; user local x,x2 variables instead of
writing out m_CachedActualSize
This was SVN commit r2970.
-move tex_codec stuff out of tex.cpp and into tex_codec.cpp
-tex_codec: use linked list of codecs instead of array (simplifies code
and removes limit)
-ogl_tex: add override mechanism for s3tc/automipmapgen extension detect
-tired of keeping of debug_warn text in sync with function name; now use
__func__ everywhere (and emulate that with __FUNCTION__ on MSC)
-add ONCE_NOT (opposite of ONCE)
-fix 3!! stupid bugs in ia32_control87, its caller and the header that
were canceling each other out. float exceptions now enabled except for
"inexact result" (too common). (update: nicolai had already fixed 2 of
these)
This was SVN commit r2964.
- enable floating point exceptions (helps catch bugs)
file.cpp: improved error checking in dir_open/dir_next_ent code
vfs.h: expand docs; add note on patching + SCM
main: use spf (1/fps) to derive TimeSinceLastFrame (makes for smoother
updates)
timer: rename SUM_TIMER to TIMER_ACCRUE. interface change allows
unlimited number of timers (instead of static limit as before).
documented everything
This was SVN commit r2958.
GUI/input code: moved g_active, g_keys etc. into ps/Globals; it has its
own input handler as well
all users of fopen(): add file_make_full_native_path to get correct path
even though current dir = system/
This was SVN commit r2954.
TextureEntry: add SUM_TIMER around base color calculation
Zip: add SUM_TIMER around inflate/memcpy
main: re-removed g_MaxZoomHeight - this doesn't belong in the message
loop. it resides in GameView.cpp
This was SVN commit r2945.
wsdl: initialise handles such that wsdl_shutdown doesn't try to close
them if they remain unchanged.
GameSetup: made work in Atlas.
Renderer: fixed progressive loading of water textures.
This was SVN commit r2941.
config: proper detect for clock_gettime
file: file_rel_chdir -> file_set_root_dir; it no longer changes current
directory; instead, root dir is prepended to all paths (not that bad
perf-wise)
netlog: avoid a CRT assert if log file open failed. now that current dir
is no longer being set, we need to think about what will happen to the
logs - they either need to use file_make_full_native_path, or use the
entire file.cpp interface instead of fopen etc.
This was SVN commit r2936.
wsdl: add proper event queuing mechanism (no longer requires hacky
polling for changes and avoids WM_USER)
rename keys[] and mouse_buttons to g_keys and g_mouse_buttons
fix flipped mouse wheel direction; wsdl now sends up AND down event
(removed 'reset' hack in main.cpp)
main: clean up event handler and kill_mainloop
This was SVN commit r2934.
ogl_tex: bind() implementation much simplified; also fix bug that set
TMU correctly when disabling texturing
wsdl: fix stdout.txt redirect; now works regardless of current
directory. also no longer disable file buffering except when in full
debug mode (because it's so slow). also add minimize button to caption
bar in windowed mode.
This was SVN commit r2919.
dyn_array.h -> allocators.h
ogl_tex: reenable performance warning
tex: comments
h_mgr: debug_printf if long filename is passed in (so we notice)
wsdl: squelch DestroyWindow warning. will look into the cause.
sysdep: slightly simplify "restrict" determination
This was SVN commit r2916.
file: add timer
h_mgr bugfix: h_force_free wasn't clearing refcnt
mem: add note on shutdown order
snd: bugfixes: VSrc_validate was overzealous (al_src == 0 is allowed);
sd->is_valid wasn't being set -> leaked AL buffers.
wsdl: remove overzealous ReleaseDC check (false alarm)
gamesetup: clarify (resource) shutdown order
This was SVN commit r2913.
tex: add support for generating mipmaps in software (simplifies
ogl_tex_upload)
all codecs: change interface, adding "restrict" keyword; rename util
functions to tex_util
tex_dds: support for decompressing images with mipmaps included
This was SVN commit r2909.
- add automatically called validate function
- make sure dtors correctly handle partial reload failures
all file code: IO routines renamed to io_* from *_io
h_mgr: add suballocator for filenames; some reorganization+cleanup;
better example code and added some notes to docs
snd: reorg to move resource methods next to struct
This was SVN commit r2907.
dyn_array: add pool allocator - see comments.
file(+gamesetup): add suballocator for aiocb (requires shutdown); revise
validator; rename file_*_io to file_io_*
This was SVN commit r2906.
gfx: extern "C"-ed
wtime, util, win, wdbg_sym: minor / commenting only
wdetect: don't skip gfx_card detect if buffer already filled
glext_funcs: remove obsolete defs
detect: call both OpenGL and platform-specific gfx_card detect; cleanup
vendor name to remove copyright/Inc crap
ogl: remove some variables that don't belong. moved vendor cleanup to
detect. moved S3TC emu code to ogl_tex
This was SVN commit r2905.
GUIrenderer: add oglSquelchError
lib.h: add feq() (checks for floating point equality); remove redundant
if from SAFE_DELETE
maths: use new feq()
Model*RData, VertexArray: fix trivial warnings
This was SVN commit r2904.
use SUM_TIMER; see comments in source+header.
(i've tested this on my laptop, but only get as far as the main menu.
hopefully this won't break anything :S)
This was SVN commit r2893.
Terrain: nicer handling of negative map coordinates (mainly for Atlas
brush previews that fall over the edge).
Misc: reverted seconds->microseconds.
This was SVN commit r2866.
- switch() statements don't handle all values in an enum
- missing \n at end of file
- non-virtual destructors in classes containing virtual functions
- order of initializers in constructor initializer lists
... some other stuff (signedness, nested comments, unused variables) as
well.
This was SVN commit r2864.
Add Ogl_Shader and Ogl_Program handle types for shaders/programs loaded
from
files.
In the vertexshader render path, use a vertex program for lighting for
optimization.
This was SVN commit r2853.
fix 2 bugs in tex / ogl_tex reported by philip (related to caching) -
thanks!
tex: documented header and improved implementation. add tex_transform_to
for convenience. change tex_write to require going through tex_wrap.
This was SVN commit r2837.
Added float-to-byte color conversion, including an SSE assembler
version.
Model renderer: Push UV coordinates into a shared vertex array and use
bytes instead of floats for the color array, thereby, significantly
reducing
the total size of vertex arrays.
This was SVN commit r2827.
ObjectBase: removed support for old actor format
Various: reduced sometimes-unnecessary header inclusions
Atlas: slightly nicer tool and message systems
This was SVN commit r2816.
cursor: reflects the above; much simplified now.
ogl_tex: preserve all texture state across reloads. add quality
mechanism (perf boost on older cards). split up upload code. add
ogl_tex_transform(). add more docs.
renderer, GUIrenderer, unifont: bring in line with ogl_tex changes (int
-> uint and call setters before ogl_tex_upload)
GameSetup.cpp: add tex quality mechanism
This was SVN commit r2803.
Shutdown doesn't look clean on Linux, and this might help highlight
current and future problems. Besides, we don't want shutdown to take
ages, do we? ;)
This was SVN commit r2801.
also fix refcnt for tex_wrap temporarily until mem_assign/mem_get_ptr
do.
h_mgr: add disallow-reload support (required for wrapped ogl_tex since
they are not backed by a file)
This was SVN commit r2780.
fix UNREACHABLE def on unix;
string_s: use HAVE_STRING_S;
wdbg_sym: fix option set code; explain why search path isn't needed
WriteScreenshot: make sure there's enough mem; use Handle to free mem
(more efficient+less error prone)
This was SVN commit r2779.
- config: add proper HAVE_ macro for string_s functions rather than
checking MSC ver directly
- string_s: disable parts of the self-test that trigger errors if not
using the string_s.cpp implementation
This was SVN commit r2760.
to that end, provide support for "wrapping" existing textures so that
tex_* and ogl_tex* calls may be used.
also have renderer use ogl_tex for its created-on-the-fly composite
alpha texture
also named atlas's thread (for fun+profit during debugging)
This was SVN commit r2754.
executive summary: memcpy2 aka. ia32_memcpy is a drop-in replacement
that is much faster than memcpy (7% on small buffers, 300% on 192K
buffers)
This was SVN commit r2729.
considerable continued cleanup in ia32
came across article detailing HT detect on multicore systems. that
requires new code, working on it.
pthread: while reading, came across idea of wrapping thread trampoline
in __except -> more reliable exception handling
This was SVN commit r2716.
premake stuff: call assembler objects *.asm.obj instead of *.obj (so
that ia32.asm doesn't collide with ia32.cpp)
ia32.asm: use .text section for proper linkage
This was SVN commit r2709.
lib: add bits() function (actually moved it from zip.cpp)
ia32: start moving code out to external asm file (will use NASM in
pre-build step; avoids needing MSC and GCC-specific inline code). move
memcpy test code out to other file
This was SVN commit r2706.
add tex error codes
move memcpy code to ia32
tex: simplify codec call with separate tex_codec_for* calls
codecs: use error code instead of string; remove redundant params
ia32: heavy WIP - testing memcpy implementations
util: prepare for zero-copy improvement to screenshot code
This was SVN commit r2695.
dyn_array supports "wrapping" other types of memory (stopgap measure)
texture codecs now load via DynArray (intermediate step to all mem stuff
going through res/mem.cpp)
simplified tex codecs by doing as many checks as possible in
tex_load_mem ("template method"-esque)
This was SVN commit r2690.
file: expose block size constant; always round user transfers up
tex: transform() now receives what to change, not what to achieve.
tex*: encoding works with DynArray+VFS backend
GameSetup: free g_BuildingPlacer to avoid mem leak.
fixed some warnings+bugs.
This was SVN commit r2679.
self_test: added another note
wtime: fix evil bug - was casting FILETIME* to u64*, which has different
alignment guarantees.
This was SVN commit r2662.
self_test: add dox (also to wiki)
tex_codecs: further work; renamed+reorg for clarity. separating codecs
from IO implementation
This was SVN commit r2654.
- mem.h: export mem_assign (needed to wrap a mem buffer)
- use stricmp in some file extension comparisons
- wposix: properly sets last-error code when opendir fails
- also: misc comments
This was SVN commit r2650.
tex.cpp now has loader API and codec support routines.
provide for codecs "transforming" the image; this allows e.g.
decompressing DDS, which is currently done in ogl code (but belongs
here)
This was SVN commit r2648.
- ogl_tex_bind now supports multitexturing (avoids need to get id and
then bind manually)
- provide nicer API for querying texture properties (no longer one big
getter). improved GUI determination of texture alpha.
- renderer: another see-if-texture-has-alpha and fixed alpha map code
(wasn't checking if all are same size. only worked because the first map
was larger than the rest
This was SVN commit r2647.
squelch debug asserts during self-tests to avoid warning about intended
errors (passing invalid data into functions to test their error
reporting)
This was SVN commit r2646.
- input.cpp allows feeding in events from the outside (will be used by
main.cpp and Atlas msg loop)
- most of main.cpp split into ps/GameSetup.*
- main.cpp is now a "controller" that drives the game via SDL events
(Atlas is another such controller that can override main.cpp). it calls
GameSetup functions to set up and processes messages.
- add functions to import AtlasUI.dll automatically
also, the usual refactoring ;)
This was SVN commit r2622.
main: add logic for run-time load of Atlas (ATLAS_* section). also moved
GUI code into a GUI_* section, removed console "Testing function
registration", moved input init into a separate function and cleaned up
a bit
This was SVN commit r2619.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.
This was SVN commit r2604.
- add note on performance in TextureManager.cpp
debug_stl: more fine-grained #if STL_DINKUMWARE (gets this closer to
working on other STL implementations)
vfs.h: improved dox and moved vfs_path public functions here.
cursor: pass g_mouse_x as a parameter (SwEng)
This was SVN commit r2595.
wsdl: create window at expected size, and retrieve correct mouse coords
CStr: not ISerializable (=> not virtual)
Game: less excessive complaining, since the original problem seems to be
fixed
Entity: fixed evaluation order
Others: minor comments/etc
This was SVN commit r2591.
file: now provides a much more efficient alternative to file_enum that
does not sort all files (this was a problem for check_if_oal_dll which
was scanning the entire system32 dir)
- use the same DirEnt struct for file and VFS due to clever name pointer
trick.
- wposix: avoid malloc for most opendir() and fix mmap() bugs (thanks to
Philip for noticing+reporting them)
- VFS: was getting too large to manage, now split into an additional
file
- WIP: much more efficient mounting; supports other mount sources than
file or zip (e.g. if we want to add network files); clean separation
between VFS submodules; dox; beginning of thread locking.
This was SVN commit r2589.
- debug: add provision for naming threads. allows adding current thread
name to log messages and displays their names in the debugger.
- replaced various if(err < 0) complain() sequences with new variants of
CHECK_ERR (see lib.h)
- fixes to mmgr/VC debug alloc enable code
- improved h_mgr error reporting (now complains when h_free fails)
- US -> UK english (partial)
- fix tex_load double-free bug
- move win32 mouse cursor code into sysdep
- error dialog is now topmost to make sure it's visible (was a problem)
- handle WM_QUIT before displaying error dialog (makes sure it's shown)
also as in previous 3 revisions.
This was SVN commit r2588.
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap
This was SVN commit r2585.