Commit Graph

147 Commits

Author SHA1 Message Date
b889826a3d Some Linux compile fixes over the place.
Create TerrainRenderer, ShadowMap and WaterManager classes to divide
CRenderer's functions into more logical units.

This was SVN commit r3332.
2006-01-07 01:04:26 +00:00
db0846c53f All pglXYZ functions should be available everywhere (independent of system
GL headers).
Some minor cleanup in the patch rendering code.

This was SVN commit r3269.
2005-12-18 02:04:24 +00:00
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
71f1d3ed68 Consistently declare CRendererInternals as a struct, not a class.
This was SVN commit r3155.
2005-11-19 16:37:50 +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
124f7171bd More reliable texture blending. Resource unloading. Minor fixes.
This was SVN commit r3106.
2005-11-06 05:05:07 +00:00
db67607f62 Patch vertex buffers are marked as dynamic now, since they're changed every
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.
2005-11-06 04:16:19 +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
5f5d19cac4 Compile fixes and cleanup
This was SVN commit r3088.
2005-11-03 22:21:44 +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
8c76dc34af g_keys[] has been made redundant by SDL's key array; use SDL_GetKeyState instead to get address of new keys array
fix W4 warnings (unused param and type conversion mostly)

This was SVN commit r3068.
2005-10-31 16:26:51 +00:00
7078279ca2 Atlas: Altered some terminology (command vs message etc). Allowed information to pass from engine to UI.
This was SVN commit r3067.
2005-10-31 03:36:50 +00:00
be44dc842e Fix memory leaks in the new model code.
This was SVN commit r3063.
2005-10-30 21:31:10 +00:00
695d966788 ia32_memcpy now returns the destination pointer just like the standard
library version does.
Fixed improper non-use of delete[] in the new model code.

This was SVN commit r3060.
2005-10-30 21:01:42 +00:00
20d038efda profiling indicates memcpy is a bottleneck, so globally replace all of them with memcpy2 (hand-optimized). depending on transfer size, this is 10%..300% faster. also made memcpy2 into a macro instead of thunk function because vc7 was still generating a jump.
This was SVN commit r3057.
2005-10-30 16:19:20 +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
faa6a78304 Added LOS setting to GameAttributes. Also fixed a small bug with LOS rendering (the patch's render data wasn't updated for LOS until the second frame after it became visible, displaying it in black for 1 frame).
This was SVN commit r2887.
2005-10-10 03:35:32 +00:00
c468eedbbb Sped up LOS rendering.
This was SVN commit r2880.
2005-10-09 08:14:42 +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
13697b8512 Stupid bug in VertexArrayIterator template - forgot a return *this.
This was SVN commit r2854.
2005-10-05 16:54:10 +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
a4fc7105be Explicitly call VertexBufferManager cleanup code, since we can't rely on
the order of destructors called for global instances.

This was SVN commit r2846.
2005-10-04 20:54:47 +00:00
b8c2f424e7 glDrawRangeElements -> glDrawRangeElementsEXT (fixes compilation error; EXT/ARB/etc extensions need to be used for everything not in GL1.1)
Reinserted mu-like symbol.
Fixed some minor warnings.

This was SVN commit r2838.
2005-10-03 16:04:55 +00:00
6fc1f45fa6 Stab at fixing the VertexArray compile error on VC++.
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.
2005-10-03 03:41:42 +00:00
a05e712319 Added VertexArray & co. classes to simplify a flexible, render path dependent
vertex array layout.
Add CModelDefRData, a per-CModelDef render data class.

This was SVN commit r2826.
2005-10-02 21:11:11 +00:00