1
0
forked from 0ad/0ad
Commit Graph

93 Commits

Author SHA1 Message Date
410d2e883a Remove leftover terrain-based movement cost code.
6581796103 removed the ability for terrain to affect movement speed. The
JPS pathfinder cannot support it, and the approach was poor anyways,
coupling rendering data with simulation data.
This lets us remove the dependency on CTerrainTextureManager everywhere.

Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D4459
This was SVN commit r26269.
2022-01-29 08:22:28 +00:00
9696df3c28 Removes unused ogl/ogl_tex includes.
This was SVN commit r26121.
2021-12-27 10:11:26 +00:00
924c6ce34e Rework 7ee94f23df
Following comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3860
This was SVN commit r25278.
2021-04-16 16:01:30 +00:00
7ee94f23df Use type_identity to simplify Clamp usage.
Differential Revision: https://code.wildfiregames.com/D3859
This was SVN commit r25266.
2021-04-15 13:01:24 +00:00
365dbd91fc Fixes terrain index type (causing a warning) introduced in 1e1ce27eba.
This was SVN commit r23807.
2020-07-07 16:51:20 +00:00
1e1ce27eba Adds offsets to the terrain resize function and adds comments how the resizing works.
Original Patch By: Clockwork-Muse
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2724
This was SVN commit r23639.
2020-05-07 21:46:17 +00:00
050f1dc8df Removes usages of duplication of Clamp function in graphics. Refs D1763.
This was SVN commit r22925.
2019-09-18 08:34:36 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
4043c56518 Fixes global init order bug that caused OOS between OS X and other platforms, fixes #3499. May improve pathfinding behavior in some cases, please test!
This was SVN commit r17132.
2015-10-15 02:51:12 +00:00
6581796103 New long-range pathfinder.
Based on Philip's work located at
http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in
detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

This was SVN commit r16751.
2015-06-12 18:58:24 +00:00
b1c4e29ac8 Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some
modded actors/scenarios

This was SVN commit r16438.
2015-03-15 23:59:48 +00:00
699d5c5d79 Fixes possible overflow in terrain position/normal calculation, based on patch by sanderd17. Fixes #1986
This was SVN commit r13499.
2013-06-25 00:57:42 +00:00
177d7856a6 Avoid assertion failure when editing terrain off the edge of the map
This was SVN commit r11600.
2012-04-21 13:07:47 +00:00
769350a3e7 Compute camera height and zoom limits based on smoothed terrain heightmap. Fixes #794, based on patch by Dietger.
This was SVN commit r11556.
2012-04-18 20:39:00 +00:00
3027ce1a04 Rationalise terrain dirty-rect coordinates.
Clean up some whitespace.

This was SVN commit r11543.
2012-04-17 22:35:34 +00:00
a16d56cc72 Delete an unused obsolete method
This was SVN commit r11540.
2012-04-17 21:06:47 +00:00
ce67dfd333 Rename CELL_SIZE to TERRAIN_TILE_SIZE, to free up the term "cell" for other concepts.
This was SVN commit r10902.
2012-01-12 12:51:10 +00:00
vts
85186c98b2 Better selection boxes. Closes #914, #295, #810.
This was SVN commit r10593.
2011-11-25 06:36:13 +00:00
8fee3d8ef8 # New territory border rendering.
Add textured line overlay rendering.
Change terrain height calculations to be triangulation-dependent for
improved accuracy.
Add triangulation-dependent terrain normal function.
Support separate S/T wrap modes for textures.
Rename CVector2D_Maths since it no longer conflicts with simulation
CVector2D.
Coalesce freed chunks in vertex buffers, to avoid excessive
fragmentation.
Add some things to help debug vertex buffer allocation a little.

This was SVN commit r9929.
2011-07-30 00:56:45 +00:00
d24c93237c # Initial version of terrain decal textures.
Rejig CModel to support non-mesh-based props.
Avoid redundant recomputation for non-moving CRenderableObjects.

This was SVN commit r9055.
2011-03-13 19:22:05 +00:00
ba8163e248 # Explicitly triangulate terrain tiles.
Store blend splats as indexed triangles.
Remove unnecessary copy of vertex data.
Fixes #169.

This was SVN commit r9054.
2011-03-13 19:10:38 +00:00
3a5ca7fdbc Improve camera restraints at edge of map to be independent of zoom, and to work on circular maps.
Fixes #573.

This was SVN commit r9011.
2011-03-04 20:02:05 +00:00
bf3d5c75f0 Be more robust to broken terrain property files.
This was SVN commit r8888.
2011-02-05 13:13:57 +00:00
02e7eb69ff # Add solid black sides to the map, to hide underwater terrain.
This was SVN commit r8886.
2011-02-03 14:36:54 +00:00
52851faeb6 cleanup - remove old cpu_memcpy and cpu_i64FromDouble that are no longer needed
This was SVN commit r8517.
2010-11-01 11:09:03 +00:00
6c7830df3f Rename CTextureManager and CTextureEntry since they are only for terrain textures
This was SVN commit r8076.
2010-09-04 21:26:52 +00:00
11a20e1bcf # Handle terrain passability and movement costs in pathfinder.
Simplify terrain code (remove Handle indirection).
Delete unused terrain properties.

This was SVN commit r7590.
2010-05-27 23:31:03 +00:00
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +00:00
f33706bf8b Switch everything to 15.16-bit precision fixeds, to allow more accurate unit vectors and angles.
This was SVN commit r7497.
2010-05-02 20:32:37 +00:00
cfae58928f # New unit movement system, which does a far better job of approaching targets and avoiding obstacles.
Add short-range vertex-based pathfinder.
Integrate new pathfinder into unit motion code.
Change obstruction system to get rid of circles, and differentiate
structures from units.
Make PositionChanged messages synchronous.
Try to prevent some accidental float->int conversions.

This was SVN commit r7484.
2010-04-29 23:36:05 +00:00
2f34e5fbc6 Fix #472 (fixed-point CTerrain::GetExactGroundLevel), based on patch from JubJub
This was SVN commit r7443.
2010-04-06 17:31:38 +00:00
abe5d3185f Fix crash when constructing buildings off the edge of the map
This was SVN commit r7320.
2010-02-12 12:01:46 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
6fbc524e65 # Terrain-related bug fixes
Fix several off-by-one errors
Reorder some loops to be theoretically more efficient
Other minor cleanups

This was SVN commit r7221.
2009-12-12 17:52:38 +00:00
51f16c30d1 Fix recently-introduced bug
This was SVN commit r7196.
2009-11-14 00:08:16 +00:00
6cc0b1649a robustified GetPatch / GetTile:
- clarify the meaning of mapSize (patchesPerSide)
- use a single ClampCoordToMap function for clamping
- add annotations to all call sites when it is sure they will succeed
- otherwise, ensure return value is checked or at least add debug_assert
fixes #311 (successfully built house and dock at top of latium map)
thanks to Heron for tracking down the cause!

This was SVN commit r7183.
2009-11-08 16:49:52 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
b343249fcc add missing terrains.xml
avoid data-dependent bug (null pointer when no terrain properties
loaded)
fixes #307
thanks go to BadassTester and Heron!

This was SVN commit r7153.
2009-10-11 21:27:35 +00:00
cdfb58a62f Fix some more GCC warnings
This was SVN commit r7045.
2009-07-28 09:27:56 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +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
e2eb5b2610 part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former
into the newly created latter component. removed VFSUtil entirely (that
functionality is available from lib/file/file_system_util.h)

Xeromyces.cpp: simplify buffer handling since smart pointers are now in
play. also use WriteBuffer instead of membuffer.

This was SVN commit r5519.
2007-12-20 20:21:45 +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
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00
ee3243ff92 # Fixes for simulation speed in scenario edtior. Various code cleanups.
Game, Simulation, etc: Separated 'update' and 'interpolate', and made
'update' return whether it's going fast enough (so callers can decide to
do more updates per render). Changed some time variables to 'double' so
they have enough precision in long games.
Atlas: Added "Fast" playback button. Made simulation sometimes go at
real-time speed, if it's just slightly too slow at rendering.
VertexBuffer: Removed some non-useful glGetError calls.
Entity: Commented out redundant Tick code. Fixed syntax error in
disabled code that confused the IDE.
Aura: Changed string code again, to simply use ASCII instead of UTF-16.
(SpiderMonkey seems to handle it just as efficiently, for small
strings.)
Misc: Some more minor header-file cleanup.
SVN log: Added feed link.

This was SVN commit r4807.
2007-01-24 20:17:28 +00:00
603401dc09 # Bug fixes.
- Fixed a crash that was happening in pathfinding on maps where some
tiles had invalid texture names (from earlier versions of the game).
- Releasing the mouse over the minimap while dragging a selection band
will no longer cause the view to move there. Unfortunately, the bandbox
still won't properly "release". The bandbox input routine should ideally
be placed at a higher priority than the GUI, separate from the other
Interact.cpp routines.

This was SVN commit r4711.
2006-12-20 05:41:54 +00:00
db045c330b # Made Atlas compile on linux
graphics: basic terrain passibility
atlas: lots of changes to make atlas compile under linux
unix/X: more clipboard support - copy from 0AD to other programs
unix/debug: use sys_get_executable_name instead of hard-coded paths
... and lots of other misc. changes

This was SVN commit r4640.
2006-11-12 04:02:36 +00:00
1f268b17bb GCC compatibility (fixed CStr.h case, got rid of a few warnings)
This was SVN commit r4581.
2006-10-20 01:06:43 +00:00