1
0
forked from 0ad/0ad
Commit Graph

43 Commits

Author SHA1 Message Date
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
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
33ec9060dd gcc compile fix (thanks to Heron for reporting the problem)
This was SVN commit r7184.
2009-11-08 18:58:14 +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
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
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
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
fa229121ec Bug fixes and more game setup options.
- Added "Screenshot Mode" and "Fog of War" game attributes. (Screenshot
Mode causes units to be initialized to Hold stance instead of Aggress
and also forces LOS to be All Visible. Atlas turn on Screenshot Mode by
default so units don't try to kill each other in there.)
- Modified LOSManager to allow disabling fog of war.
- Removed some debug message spam.
- Enabled line antialiasing for aura rendering and fixed some bugs that
caused strange effects (color was not set properly for the center point,
and when a unit was both mouseover'ed and selected, the aura was drawn
twice).
- Modified Stand stance to allow retaliation on attacks (normally Stand
will attack any enemy in LOS, but this is useful if a neutral unit is in
LOS).
- Modified pathfinder to not take into account terrain slope, which is
an expensive calculation - we'll eventually take into account terrain
type instead.

This was SVN commit r4527.
2006-10-08 17:39:46 +00:00
2f53eea71a Actor Viewer: Added controls for wireframe, background colour, move-when-walking. Reduced CPU usage when 'playing' things with no animation.
Color: Moved SColor* structs into SColor.h, so they can be used without
indirectly including CVector[34]D.
Terrain: Added 'base colour', for the Actor Viewer to be able to
modulate the colour of normally-white terrain.
Removed some "using namespace std" (because it doesn't make the code
easier to read, and it defeats the point of namespaces, and the rest of
the code doesn't do it).

This was SVN commit r4392.
2006-09-26 01:44:20 +00:00
0baca62d61 # Fixes to terrain conformance and movement speed bonus.
- Simplified CTerrain::getSlopeAngleFace and made it work correctly in
all cases (before, it sometimes returned NAN and used an overly
complicated method based on 8 angle sectors instead of a "continuous"
method).
- Removed the EntityMovement event - instead, movement speed modifier is
calculated in C++ for performance.

This was SVN commit r4339.
2006-09-16 20:13:40 +00:00
7d3d8fdbf3 # move ps/Network into top level project (and static lib).
This was SVN commit r4249.
2006-08-26 20:25:37 +00:00
d39a4fac21 Premake: include precompiled.h in the project; set up dependencies for Atlas projects.
# Attempted to make compilation faster
by including as little as possible in some .h files, and moving it into
.cpp.
Fixed BaseTechCollection memory leak.

This was SVN commit r3992.
2006-06-09 16:44:16 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
pyrolink
39e89c406e #Fixes to flank penalty, notifications, sectors, terrain conformance. Added speed bonus based on terrain slope.
-added NOTIFY_ORDER_CHANGE, which is used for flank penalty instead of
idle.
-entity speed is now actions.move.speed_curr for the current speed, but
the original speed is still actions.move.speed.  Changes take place in
entityEventMovemen.

This was SVN commit r3840.
2006-05-04 04:14:48 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
pyrolink
b5d9da29c1 #When appropriate (i.e. wheeled units), units will align with the slope of the terrain. *JS documentation
*added CTerrain::getSlopeAngle[Face]() which returns the angle in
radians of the slope of the terrain.  getSlopeAngleFace should be used
for entities because it takes into account which way the entity is
facing, which allows for negative angles.
*the max and min graphical rotation for the slope is under traits.pitch.
This is used so that you can have certain units such as infantry that
don't rotate very far go down steep slopes but not rotate too much.
*JS documentation in docs/JSReg.rtf -- I put in most of the relevant
global functions; still needs entity functions.

This was SVN commit r3794.
2006-04-22 05:52:23 +00:00
8a11f53011 # More consistent terrain-space coordinate names
# Removed more ancient unused code
# Partial VC2005 compatibility for Atlas editor / AoE3Ed
# Terrain overlay rendering system; used to implemented Atlas brush
display
# Renamed 'right' to 'left'

This was SVN commit r3771.
2006-04-17 20:02:51 +00:00
kevmo
baf357d2ea # Began work on new pathfinder
Created CTerrain::getSlope(x,y), and added a new order type to support
high-level pathing.

This was SVN commit r3735.
2006-04-09 00:36:52 +00:00
bd2c1d73a3 Terrain, Interact, LOSManager, Atlas, etc: Fixed some off-by-one and off-by-FLT_EPSILON problems with objects near/off the edge of the map. Also changed some model.GetBounds().GetCentre() into model.GetTransform().GetTranslation() to fix off-by-centre-of-bounds-minus-position problems. Thus, you can no longer make units in Atlas disappear off the edge and never be seen or selected again. Also changed out-of-bounds LOS value to make them visible if they somehow escape anyway. Also fixed out-of-bounds access of terrain heightmap.
MapReader: Tidied usage of Xeromyces.
Projectile: Avoided warnings.

This was SVN commit r3212.
2005-12-09 01:08:08 +00:00
14c62e721d ia32, sysdep: add float->int implementation and fallback version and self-test
config: add macro that determines when it's used
Terrain, wtime: use new float->int code
detect: no longer change _MCW_RC

This was SVN commit r3114.
2005-11-07 02:04:28 +00:00
78f9dbb6f1 Fix various warnings (both implicit conversions and real bugs).
This was SVN commit r3110.
2005-11-06 17:58:47 +00:00
124f7171bd More reliable texture blending. Resource unloading. Minor fixes.
This was SVN commit r3106.
2005-11-06 05:05:07 +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
faaee7d1b5 Atlas: Terrain painting
This was SVN commit r3092.
2005-11-05 04:59:54 +00:00
364e36128e g_YMinOffset declared in gameview.h instead of extern elsewhere
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.
2005-10-19 17:16:34 +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
29d6f420fd GameView: removed unused ancient camera code.
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.
2005-10-07 21:09:29 +00:00
aa118403bb Terrain: CalcFromPosition, to convert world-space to tile-space.
ScEd: Compilation fixes.
Atlas: Screen-space to world-space conversion when editing terrain.
Wireframe option. Minor wxWidgets 2.6.1 fixes. AoE3Ed.

This was SVN commit r2698.
2005-09-12 20:04:26 +00:00
549150fe38 Atlas: simple camera control and terrain editing.
Terrain: added terrain-editing code to CTerrain, for better
encapsulation or something.
Console: simplified screen resizing.
Game/etc: removed some unnecessary header file inclusions.

This was SVN commit r2459.
2005-07-03 16:25:48 +00:00
MarkT
2ab625720b Fairly major XML/entprop changes; some more minor stuff that fell out as a consequence.
This was SVN commit r1220.
2004-10-07 19:23:35 +00:00
notpete
17a4174505 Minor additional functionality.
This was SVN commit r1218.
2004-10-06 18:45:59 +00:00
09f47d6820 Core Classes Reorganization:
- g_Terrain and g_Camera totally eradicated as globals, is now m_Terrain
of CWorld and m_Camera of CGameView
- terrainMain.cpp is almost completely empty with functionality moved
into the relevant core classes
- Miscellaneous global functions moved into Core Classes (mostly
GameView)

This was SVN commit r865.
2004-07-31 15:57:18 +00:00
d2070837d2 Global variables are nasty. Hacked g_Terrain into a pointer so that it doesn't crash when automatically destructing, although it ought to be handled in a nicer way.
This was SVN commit r839.
2004-07-28 19:27:35 +00:00
MarkT
befae8627d Changed hotkey handling for groups and bookmarks; small pathfinding fixes.
This was SVN commit r809.
2004-07-23 10:56:52 +00:00
8d52add5ea ran newline stomper; no real changes
This was SVN commit r423.
2004-06-08 12:10:51 +00:00
notpete
97b7efab20 Fixed some assumptions PATCH_SIZE is 16.
This was SVN commit r415.
2004-06-07 19:59:20 +00:00
3abf9ac4b5 lots of type fixes; types.h is now a convenience wrapper on top of the standard uintN_t routines
This was SVN commit r334.
2004-06-01 17:34:12 +00:00
notpete
7fb944a1e1 Either moved from terrain directory, or an inital revision, depending on the file. Whole bunch of changes related to props and animation.
This was SVN commit r306.
2004-05-29 20:56:24 +00:00