byte_order: add FOURCC_BE and _LE versions (needed for zip)
ogl: quick hack: prevent crash on laptop by providing a
pglDrawRangeElementsEXT stub
file, h_mgr: update pool_alloc call site
tex: fix incorrect indexing/stride for mipmap generation
vfs_mount: disable archives (zip code is WIP)
zip: heavy WIP. add support for writing archives (needed for thesis);
revised Zip read code. sped up archive open. further major changes
pending.
wposix: moved allocator code (see above)
This was SVN commit r3298.
- renamed sysdep/unix/ functions where necessary
- more int -> LibError conversions in the sysdep/unix/ part
- added some explicit #include statements where necessary
- moved enum LibError/ErrorReaction declarations
(gcc doesn't support forward enum declarations)
This was SVN commit r3267.
timer: greatly speed up TIMER_ACCRUE by having it gather raw ticks and
only converting those to wall-clock time at exit when displaying the
values. old codepath remains and can be restored via TIMER_USE_RAW_TICKS
This was SVN commit r3241.
- Times on auras (a unit must be in range for X seconds for the aura to
start affecting it)
- An efficient GetInRange implementation in CEntityManager using a
quadtree or something of the sort (current one is linear in the number
of entities).
This was SVN commit r3238.
- debug_warn_err now takes LibError
- lib_error.cpp: revise error code -> string (only support liberror
now); add function to set errno from LibError
- unifont, CFont: parameter made a simple wchar_t from const wchar_t&
- mmap now sets errno
- Loader and VfsUtil function now return LibError as well
- Profile.cpp, ProfileViewer.cpp: fix int/uint/size_t warnings
- Renderer.cpp: fix cannot-generate-assignment-operator warning
This was SVN commit r3235.
- add translators from errno and GetLastError to LibError
- clarified return values of callbacks (they must return
INFO_CB_CONTINUE to continue)
- this exposed a few bugs in error handling chains (returning incorrect
values); also reduced say-nothing instances of return -1.
- move CHECK_ERR etc. macros to lib_error
This was SVN commit r3229.
lib: add display_msgw which is a wrapper around the sys_display_msgw
impl and takes care of translating text
lib_errors: codes are now an enum (this will allow a special return type
and make documentation much more clear); codes are defined in the
header, not from lib.h
wsdl: resolve todo comment
This was SVN commit r3217.
- config: add CONFIG_TRACE
- display_error_impl->sys_display_error
- cleaned up sysdep; add sys_ prefix everywhere and document everything
- add to vfs_load dox
- cursor: sys_cursor_load -> sys_cursor_create. sysdep code is no longer
dependent on tex; instead of calling tex_load, the caller passes a BGRA
texture in.
memcpy: huge kick in the pants for accompanying paper; now even faster.
- on_each_cpu -> sys_on_each_cpu (removed manager function also)
- wsdl: explain PeekMessage CPU usage issue
This was SVN commit r3203.
Quaternion: Removed operator- since it doesn't seem geometrically
sensible for rotation-quaternions. Added ToAxisAngle but don't actually
use it anywhere.
GameView: Changed unit-view to look slightly more correct.
This was SVN commit r3201.
Interact: Answered comment. Fixed calculation of map edge.
Renderer: Fixed unloading of water textures. Removed some redundant
state-setting in water renderer. Avoided potential problems with
floating point accuracy.
This was SVN commit r3182.
data model.
Profile.cpp implements AbstractProfileTable so the original
functionality
of the profiling display remains.
CRenderer also contains an AbstractProfileTable implementation that
displays
the rendering stats. Switch through different profile views using F11.
This was SVN commit r3154.
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.
EventTypes.h: was missing comma. also insert onHeal string since that
array seems to depend on index values matching the enums (would be a
very insidious error!)
entity/entityorders: fix typo - ORDER_HEAL_NOTPATHING ->
ORDER_HEAL_NOPATHING
eventhandlers: was missing semicolon
This was SVN commit r3133.
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.
frame for LOD (in the long run, try splitting them into dynamic and
non-dynamic parts).
Also, using TIMER_ACCRUE in an inner loop isn't such a good idea ;)
This was SVN commit r3104.
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.
transpose. This assumes orthogonal transformations (which we have
exclusively,
as far as I can tell), but is significantly faster, because calculating
the
inverse is slow.
This was SVN commit r3041.
Performance impact:
+ Player color rendered models are batched like normal models
- Transparent sorted models never use the vertex shader path
This was SVN commit r3009.
textureconv: Made -(no)mipmaps work. Defaulted to DXT5 for alpha
textures (since DXT3 almost never seems any good). Recompiled with new
DevIL code.
GUIRenderer: Removed complaints about 0-sized objects (e.g. hitpoint
bars).
Atlas: Added forgotten files.
This was SVN commit r3006.
add ClearMouseState to reset buttons when alt+tabbing out (thanks to
Philip for mentioning the problem and Gustav for telling me how to fix
it :D)
This was SVN commit r3003.
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.
cause of minimap click no longer working has been found:
GlobalInputHandler isn't getting called due to incorrect order of
registration. fix is pending.
game: add code from ScEd that fixes lack of player color (by setting up
local players)
thanks to Simon for finding the cause (I want that crystal ball :D)
This was SVN commit r2967.
-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.
Premake: allow slight separation of files' locations on disk vs in the
project tree.
Atlas: require fewer include directories.
This was SVN commit r2956.
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.
Falls back to a simpler formula when only 2 TMUs are available.
CRenderer is now a JS object called "renderer" for scripting.
This was SVN commit r2891.
LOS issues still outstanding:
- LOS looks ugly because of quad tesselation into 2 triangles
- Quad tesselation is unspecified by OpenGL (in fact using GL_QUADS on
LOS quads seemed to give different tesselations than it did for the
underlying terrain quads, but terrain rendering also used GL_QUADS).
This should be fixed once we decide on the quad tesselation issue.
- Units with traits.vision.permanent set are visible through FOW even if
you havent seen them before; this should only be true when you have seen
them before. But it gets even more complicated - if a permanent unit
seen through FOW dies or gets upgraded or something, perhaps you should
remember the old version. I'm not completely sure how to do this
(probably involves cloning its actor somehow).
This was SVN commit r2876.
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.
Deleted ps_test, since it isn't updated by the autobuilder and will be
out of date.
Removed console history file, since it doesn't need to be
version-controlled.
This was SVN commit r2823.
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.