1
0
forked from 0ad/0ad
Commit Graph

85 Commits

Author SHA1 Message Date
6e82e33ccf - display_msg and display_error -> debug prefix since in debug header
- 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.
2005-12-12 19:19:30 +00:00
pyrolink
f174796540 Added fresnel effect for water.
This was SVN commit r3194.
2005-12-06 06:42:49 +00:00
8f976e4b8a glext_funcs: Added gDEBugger-specific extension.
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.
2005-12-02 02:08:26 +00:00
5c9501830c Fix some more warnings.
This was SVN commit r3156.
2005-11-19 16:43:20 +00:00
5087732fe3 Refactor ProfileViewer into a singleton that uses AbstractProfileTable as
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.
2005-11-19 16:15:34 +00:00
d5d6e4052e lib: only debug_warn in UNREACHABLE in paranoia builds - avoids lots of warnings in debug mode
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.
2005-11-18 16:23:39 +00:00
15cce8566f minimap: only update 10x/sec and if LOS state != ALL_VISIBLE; fix incorrect SAFE_DELETE
fix use of LOS_EXPLORED; == implies explored but not visible

This was SVN commit r3100.
2005-11-06 02:02:44 +00:00
6668ad6e1c CTerrain, Brushes: made CalcFromPosition static and added float x,y overload
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.
2005-11-06 01:33:16 +00:00
0346ba1b18 Refactor model rendering to perform vertex setup in ModelVertexRenderer.
Sort all transparent models by distance to camera (however, do not sort
polygons by default).

This was SVN commit r3096.
2005-11-05 23:15:23 +00:00
74bf76d523 fix bug #71 - was a double-free (both ~CRenderer and UnloadResources were calling UnloadWaterTextures)
This was SVN commit r3071.
2005-10-31 18:57:03 +00:00
501acc65f5 Extension function pointers are renamed from glXyzARB to pglXyzARB
to avoid conflicts with system header files.

This was SVN commit r3054.
2005-10-30 01:18:15 +00:00
875cb3bca1 Add ARB_vertex_shader specific functions to glext_funcs.h
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.
2005-10-30 00:22:22 +00:00
15d9278af6 tex, mem: fix refcnt issue that is the possible cause of bug#70! huge thanks to philip, who localized the problem to tex_wrap/memory not getting freed.
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.
2005-10-29 22:29:55 +00:00
b10534d224 Transform normals using the original bone matrix instead of the inverse of the
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.
2005-10-28 19:25:47 +00:00
bbda296289 TerrainProperties: Use CTerrainPropertiesPtr (boost::shared_ptr) instead of CTerrainProperties*, to fix (slightly inelegantly) memory leaks.
Renderer: Initialise pointers when HW lighting is unavailable.
Atlas: Avoid strange VS2005 iterator complaint.

This was SVN commit r3036.
2005-10-28 01:43:16 +00:00
b7df6f7fbf Do not sort transparent models by default.
This was SVN commit r3012.
2005-10-25 02:22:22 +00:00
d977bc27dc Eek.. apparently, I committed in the wrong subdirectory.
Also, fixed a stupid bug that caused transparent objects to be
retransformed
all the time.

This was SVN commit r3011.
2005-10-25 02:00:09 +00:00
82ee484821 Massive rewrite/refactoring of the model rendering system.
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.
2005-10-25 01:43:07 +00:00
26d2fc71ad loaders: increase timeout interval (less time wasted in main loop during loading)
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.
2005-10-21 18:01:21 +00:00
d43aa11d36 file: free cached IO blocks to avoid them appearing as "leaks"
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.
2005-10-21 07:47:38 +00:00
d7996c104a CInput: swapped direction of mouse-wheel scrolling.
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.
2005-10-14 21:59:08 +00:00
991d6c438c Fix water renderer to fully specify its texture environment.
This was SVN commit r2932.
2005-10-13 15:46:31 +00:00
a1cddc4ac3 gameview, renderer: LoadWaterTextures is now a coroutine because it takes friggin forever (3 seconds). VFS performance is down by a factor of ten! investigating is on todo.
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.
2005-10-12 17:19:07 +00:00
990e343ae6 renderer: load/unload water textures (similar to alpha maps); do that in delay load and avoid leaking them.
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.
2005-10-12 04:16:41 +00:00
de5361047a Player colour rendering fallback now looks exactly the same as the fast path
again (using multi-pass).

This was SVN commit r2902.
2005-10-12 01:07:01 +00:00
e05ca36bc5 Changed water color/depth/alpha again
This was SVN commit r2897.
2005-10-10 23:05:53 +00:00
6efb1e1c00 Single pass player color rendering.
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.
2005-10-10 14:15:28 +00:00
57cfc7c6ac Made LOS drawn using terrain vertex color (which requires some terrain render data to be rebuilt each frame, but is faster).
This was SVN commit r2878.
2005-10-09 04:40:18 +00:00
0ed2815c8b Added initial version of LOS, and updated minimap to show both LOS and water.
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.
2005-10-09 03:43:03 +00:00
04650efe7a Lots of gcc -Wall fixes. The common ones:
- 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.
2005-10-07 15:24:29 +00:00
dbd58f4011 Remove CRenderer::Close(), which wasn't called anyway and the only reasonable
calling site would have been just before the destructor.
m_VertexShader is no longer leaked.

This was SVN commit r2860.
2005-10-06 16:07:36 +00:00
f1ee2cd66d Add the notion of render paths and an appropriate configuration option.
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.
2005-10-05 16:42:09 +00:00
a92e92cd46 Basic GL_ARB_vertex_shader detection.
Remove a redundant copy operation in ModelRData::BuildVertices

This was SVN commit r2822.
2005-09-30 22:23:48 +00:00
2790981eae CVSROOT: doesn't seem particularly useful now
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.
2005-09-30 00:59:42 +00:00
d98abf0685 final refactor (i hope). split up fmt / int_fmt determination to allow override of fmt without overriding int_fmt (useful for unifont.cpp). this changed the signature of ogl_tex_upload. better explained flags in OglTex and warn_if_uploaded.
also a few improvements / stomped on some warnings.

This was SVN commit r2809.
2005-09-29 17:33:30 +00:00
cd2f3948dd changed sys_cursor interface to load directly from file; can add createFromMemory version later if ever needed.
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.
2005-09-29 05:00:20 +00:00
f5613e74c8 Changed water color to Jason's dark blue.
This was SVN commit r2792.
2005-09-28 05:53:22 +00:00
b7c04793f4 Updated water to use black-and-white texture and mix it with material color, allowing water color to be changed.
This was SVN commit r2786.
2005-09-27 23:14:08 +00:00
f2cae8cb9b Added animated water.
This was SVN commit r2783.
2005-09-27 18:17:45 +00:00
37e9fc0388 - update load times
- 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.
2005-09-21 16:42:56 +00:00
13501cf58b hook up emulate_glCompressedTexImage2D to new tex transform code (which takes care of DDS unpack)
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.
2005-09-19 22:48:20 +00:00
603c475cf0 This was SVN commit r2749. 2005-09-18 06:28:23 +00:00
e5dea3e5a1 Water source code :|.
This was SVN commit r2746.
2005-09-18 03:47:15 +00:00
a0a01e7a7d Linux/GCC Compat, added some includes, ported inline assembly stuff to gnu syntax (and misc. cleanup in ia32.cpp)
This was SVN commit r2702.
2005-09-12 23:37:52 +00:00
9ec828f6fd - both tex.cpp and ogl_tex.cpp had functions named tex_* - confusing. renamed to ogl_tex* to disambiguate.
- 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.
2005-09-02 02:54:02 +00:00
0e20c08969 waio: fix spurious WARN_ERR
vfs: integrate hotload code
fixed a few warnings as well.

This was SVN commit r2609.
2005-08-13 17:09:57 +00:00
4aa740bff5 - split up lib/res into file, graphics and sound.
- 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.
2005-08-12 17:06:53 +00:00
a69ac0dee9 - fix w4 warnings
- 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.
2005-08-09 15:55:44 +00:00
d24fd1b0c9 Use gl*ARB wherever possible. They are mapped onto the core gl* function if the driver's version is high enough, else onto the extension's gl*ARB function.
(Just for fun, compressed texture uploads are mapped onto a
decompression function if the user's system doesn't understand S3TC
textures.)
Corrected (unless I'm wrong) GL version identification logic.

This was SVN commit r2384.
2005-06-14 03:33:16 +00:00
0331883a86 Temporary fix for mouse input. Improved performance in player-colour model renderer. Also improved performance in lighting, at least in unoptimised builds.
This was SVN commit r2328.
2005-05-20 17:09:47 +00:00