Commit Graph

32 Commits

Author SHA1 Message Date
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
4e32136b4c # Fixed ambient terrain lighting when shadows are disabled
This was SVN commit r6808.
2009-04-05 18:31:05 +00:00
228859da99 # Fix water-related crash on some video drivers
Detect some errors loading fancy-water fragment shader, and disable
fancy water.
Fixes crash with Mesa on 945GM (which doesn't support fragment shaders,
though it advertises the extensions).

This was SVN commit r6773.
2009-03-24 21:00:41 +00:00
3c411dd174 large batch of Dehydra static code analysis fixes
(mostly passing arguments by const reference and checking LibError
return codes)

This was SVN commit r6214.
2008-07-12 10:45:11 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
6cfb96855a # Added initial play-testing support in the scenario editor.
Atlas: Added simulation play/pause/reset controls; automatically plays
while recording cinematics.
FFmpeg: Fixed broken output files.
MapReader: Fixed entity loading.
ObjectHandlers: Made unit preview more robust when the preview unit gets
destroyed.
Various: Replaced manual matrix construction with SetYRotation call.
Turned some more CStr8 back into CStr.
h_mgr: Optimisation - don't calculate slow debug-output strings if
they're never going to be seen (since it takes a few hundred
milliseconds).
TerrainRenderer: Made more tolerant of accidental negative times.
Entity: Fixed m_refd being out of date when deleteAll is called. Fixed
problems when doing an initializeAll...deleteAll...initializeAll
sequence.
SCN: Removed non-useful AoE3Ed code that never did anything.
SVNLog: Made output more valid and made titles more descriptive, so it
works properly in FF's live bookmarks.

This was SVN commit r4779.
2007-01-17 03:25:20 +00:00
3f017c418c Removed some header files from header files.
Changed SoundGroupTable to use the right string type for the comparison.
Also changed from CStr8 to CStr because I prefer that spelling (and it's
more consistent with most other code).

This was SVN commit r4771.
2007-01-13 22:44:42 +00:00
8f82d5ab17 Tweaked water movement speed.
This was SVN commit r4427.
2006-09-28 23:27:55 +00:00
2fac02f40a # Actor Viewer tool: added controls to toggle shadows, ground and polygon counts.
Elsewhere:
Disabled stack-trace test because it gives me assertion failures.
Fixed some uses of snprintf (which doesn't always add a \0 to the end of
the string), then got bored so there are still lots of broken ones.
Probably should replace snprintf with something more like snprintf_s
(but non-fatal) or something.
Made CLogger output valid HTML (except for the potentially dodgy
doctype). Removed its memory-logger, since we never use it and MICROLOG
can be used instead for quick execution-tracing.
Added tests to make sure CLogger handles long strings properly (which it
didn't). Made CLogger not a singleton, so it can be tested sensibly.

This was SVN commit r4424.
2006-09-28 20:41:12 +00:00
1056788a6a - Added support for translating texture coordinates in fancy water, so it can move in some direction like the non-fancy water can.
- Removed a debug assertion that could occur in windowed mode if you
moved your mouse above or to the left of the window (client x and y >=
0); instead, negative client coordinates are now clipped to 0. (The
coordinates can't actually stay negative because we are casting them to
uints, so that would give very large values.)

This was SVN commit r4323.
2006-09-11 22:35:44 +00:00
df1a779d76 # Updates to water rendering (more effects).
This was SVN commit r4318.
2006-09-10 05:31:41 +00:00
789c850049 # Updates to fog of war rendering.
This was SVN commit r4270.
2006-08-31 23:56:12 +00:00
35e91718c5 # Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.

This was SVN commit r4261.
2006-08-28 17:36:42 +00:00
3195893d1c # MacOS X compat (part 1)
- u_anim_name disambiguation
- fix implementation of finite (use our fpclassify instead of compiler's
routine)
- รค -> ae
- workaround for MAP_ANONYMOUS
- fix GLint in ogl.cpp
- add include for SIZE_MAX in string_s
- avoid PIC clobbered error and speed up rdtsc a bit
- add include for stat

This was SVN commit r4170.
2006-07-26 14:04:52 +00:00
2b0e5d0b42 # Added parameters to control water murkiness.
This was SVN commit r4013.
2006-06-22 21:11:18 +00:00
5814e10126 # complete revamp of build system in preparation for automated self tests.
* now splits everything up into independent static libraries.
* fixed a great deal of incorrect #include statements. all headers must
now be specified with their full path relative to source. exception: if
file being included and including file are in the same directory, no
path needed.
use <> when relying on the build system's include path (e.g. for system
headers and external libraries, e.g. boost), otherwise "".

* temporarily renamed maths/Vector2D to Vector2D_Maths to avoid
conflict. these should be merged.
* hacked around VC linker stupidness when building static libs; texture
codecs must now be registered manually.

This was SVN commit r3931.
2006-06-02 03:56:24 +00:00
1a8cb85e08 Some water-related bug fixes:
- Underwater tiles will be tested against the frustum with a bounding
box including the water surface, so the water gets drawn even if the
terrain is off-screen.
- Transparent objects (e.g. trees) should now interact with water
properly. I did this by rendering them twice, first before the water, so
it overlaps the underwater pieces, then after, so the above-water pieces
overlap the water (the water now writes Z as well as colour to allow
this). Before, only the first pass was done, so the tops of trees were
covered by water. There might be more efficient ways of doing this - the
best could be for the transparent objects to be drawn with a shader that
always either discards a pixel or writes alpha of 1.0 instead of using
2-pass depth write then colour write.

This was SVN commit r3904.
2006-05-29 00:49:09 +00:00
67ede785d5 Updates to water and a fix for a rendering bug with bar textures
This was SVN commit r3902.
2006-05-28 21:58:56 +00:00
f8de293512 Water manager will now load uncompressed TGA's rather than DDS'es.
This was SVN commit r3900.
2006-05-28 09:55:44 +00:00
106f59c5c7 # Added fancy water.
This was SVN commit r3897.
2006-05-28 02:13:32 +00:00
f0615df318 # Initial work on fancy water.
Also, horizon height (skybox vertical offset) can now be set from the
console with renderer.horizonHeight.

This was SVN commit r3893.
2006-05-25 05:46:17 +00:00
d158ed9dc9 Terrain overlay: Fixed incorrect state change
Other: Trivially tidied profile text. Removed VC2005 deprecation
avoidance, since wx 2.6.3 does that anyway.

This was SVN commit r3773.
2006-04-19 00:56:24 +00:00
pyrolink
3408b078b7 #Unit formations and rank textures
-Added functionality for "casting" and creating net messages (without
JS)
-Rank textures-specified in XML
-Formations-currently don't attack correctly (i.e. travel like mobs) and
don't switch to their movement formations when tasked to go somewhere
(the pathfinder doesn't give any heads up about destination reached, so
there's no way to change back to the original).  Also, base switching is
untested so no garuntees for next and prior formation things.

This was SVN commit r3710.
2006-03-31 03:30:34 +00:00
f45c44ca09 Rotated various things (terrain texture UVs, default light and camera angles) by 45 degrees.
Map XML: Store camera position. Stopped using DTDs (because they make it
too hard to change the XML structure without breaking all the old XML
files).
Game.h: Include fewer files, to make compilation sometimes faster.
World: Changed some things to not be singletons, since they were
(ab)used as CWorld members.

This was SVN commit r3670.
2006-03-21 20:55:45 +00:00
36fa5ec2bf * clean up CLightEnv a bit
* add CLightEnv::m_TerrainShadowTransparency
* shadows will let a fraction of diffuse light through
* added JS LightEnv objects, so the lighting environment can be changed
  from the console
* new element TerrainShadowTransparency supported in the scenario .xml
format,
  changed cantabrian_generated with an example

This was SVN commit r3513.
2006-02-15 00:45:16 +00:00
1560a17dfb Rendering related fixes:
- explicitly enable blending in the ProfileViewer (fixes display bug)
- adjust luminance map based shadows to look roughly the same as depth
texture
  shadows (minus self-shadows, obviously)
- default depth texture path will not touch TexParameters any longer

This was SVN commit r3511.
2006-02-14 20:38:51 +00:00
7dee30e24c - Terrain self-shadows (only noticeable with a low angle of sun)
- explicitly split ambient and diffuse
- add renderer.shadowZBias to bias depths in the depth texture
  and avoid flickering artifacts caused by Z fighting
- cantabrian_generated uses new light values so that shadows aren't
pitch
  black

This was SVN commit r3508.
2006-02-13 14:18:20 +00:00
9f055eddb0 Shadow rendering can use depth textures, as a preparation for
self-shadowing and shadows on models in general.
Usage of depth textures can be toggled using
?renderer.useDepthTexture = true/false in the JavaScript console.

This was SVN commit r3495.
2006-02-11 18:04:32 +00:00
5ac92a3302 Advance water in sync with simulation and unit animations (so it stops when the game is paused).
Other miscellaneous tidyings.

This was SVN commit r3386.
2006-01-21 23:27:42 +00:00
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