1
0
forked from 0ad/0ad
Commit Graph

2473 Commits

Author SHA1 Message Date
6124ebd62c add missing file from sweng/"forward declare" commit
This was SVN commit r4254.
2006-08-27 12:17:27 +00:00
c53269caac # fix for mouse handling on multimonitor systems
+ cleanup

This was SVN commit r4253.
2006-08-27 10:33:22 +00:00
bc24974496 # sweng
forward declare SDL_event. remove SDL dependency of network code.
refs #140

This was SVN commit r4252.
2006-08-26 21:52:18 +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
855e9bce02 # macosx compat
.. by removing support for WAV. see rationale in source; in short, we
don't need it and it's not worth the minimal trouble of adding freealut
dependency.

entityhandles: remove old comment

This was SVN commit r4247.
2006-08-26 13:40:18 +00:00
9fc485c9a6 # Fixes to the line segment frustum test.
This was SVN commit r4245.
2006-08-25 19:31:01 +00:00
147d4f2bd3 # Fixed minor shadow bug
CBound operator+= updated the minimum value or the maximum value, but
never both. (I think the operator+=(CVector3D) has always been buggy
(because it assumes min<max, which isn't true of empty bounds), and I
propagated the error to operator+=(CBound) ages ago.)
Added test cases, and fixed.

This was SVN commit r4244.
2006-08-25 12:52:26 +00:00
pyrolink
50e5e9acd9 # Aura and territory rendering
-Auras now take additional parameters from XML, containing a tag for r,
g, b, and a.  No line thickness parameter yet.
-For territories, added function to frustum for determining if line
segment passes through the frustum.

This was SVN commit r4242.
2006-08-25 06:04:33 +00:00
6732af1ba9 # Updates to the order system, including shift-click queueing.
This was SVN commit r4240.
2006-08-25 04:24:06 +00:00
e53242284f # Updates to unit-testing system.
Premake: Changed to use PCH when compiling tests.
CxxTest: Got rid of /Wp64 warnings. Changed TS_ASSERT_STR_EQUALS to
print both strings on failure.
win_internal: Added the bits that CxxTest::Win32Gui needs (because
Win32Gui is now compiled with PCH and uses our sysdep headers).
Disabled test_cache_policies, because it took long enough for me to read
its name.

This was SVN commit r4237.
2006-08-22 21:38:53 +00:00
dave
bf95b26a80 int to GLint
This was SVN commit r4235.
2006-08-22 03:00:31 +00:00
pyrolink
b62f53620f #Cinematic editor
This was SVN commit r4234.
2006-08-22 02:24:44 +00:00
6a7ee226f0 Restored Windows compatibility (and hopefully didn't break OS X compatibility).
Fixed copy-constructor-generation warnings in VS2003.

This was SVN commit r4232.
2006-08-21 21:27:12 +00:00
dave
98697b4676 Mac OS X Compat
LightEnv - has byte order marks
Texture - conv from int to GLint wasn't allowed
JSConversion - to use isfinite you need the std:: namespace
	(this is temporary... atm I don't know why you can't call isfinite)
ScriptableComplex - when implementing methods it did not like default
values (they were removed from the cpp file)
timer.h - simple change

This was SVN commit r4231.
2006-08-19 20:24:49 +00:00
dave
a20db60354 Variable type change from uint to size_t when calling functions in vfs
This was SVN commit r4230.
2006-08-19 20:01:26 +00:00
e2add58410 # Improved pathfinder precision.
Added code to requestLowLevelPath that modifies the final waypoint to
use exactly the coordinates where the player clicked, instead of the
rounded-to-nearest-tile coordinates from the A* pathfinder. A more
complete fix required eventually might be to make the A* engine itself
aware of fractional locations within a tile but for now this seemed like
a simple thing to do.

Also fixed a bug that was causing the final step of the path not to be
added: the code was adding an ORDER_PATH_END_MARKER but no
ORDER_GOTO_NOPATHING for the final point. The ORDER_PATH_END_MARKER
doesn't seem to do anything useful here so the unit never went that last
step.

Also fixed a bug with "pass-through-allies" that was causing units to
avoid allies anyway: although the pathfinder assumed you could pass
through allies, when you actually bumped into one while executing a goto
instruction, the collision test used did not check for
pass-through-allies so you ended up avoiding allies anyway. This might
not be too horrible if it works in practice (since the avoidance was
done using simple local work, not a full repath) but I've removed it for
now since it might cause problems with formations, when avoidance will
not be trivial.

This was SVN commit r4226.
2006-08-17 21:09:46 +00:00
802e099e35 # mac compat
tricky issue with isfinite: <cmath> also stomps on that (C99) macro,
instead of only C89 libc. fix: include math.h instead. rationale is
documented.

This was SVN commit r4224.
2006-08-12 16:42:50 +00:00
b6aa68b677 Reorganized some building placement code.
This was SVN commit r4208.
2006-08-08 16:00:47 +00:00
fce69aaa7f # - Housekeeping
# - Territory restriction rules for buildings.

This was SVN commit r4206.
2006-08-08 03:45:13 +00:00
d789c92bd0 Modified CSimulation's random number generator to use the Boost small_int and uniform_01 distributions for better portability.
This was SVN commit r4203.
2006-08-07 20:38:23 +00:00
48e80bdfbc Fixed deunicodification of actor strings - need to be converted from CStr to std::wstring when passed to Atlas
This was SVN commit r4200.
2006-08-06 18:41:07 +00:00
399e26a9c5 # macosx compat
This was SVN commit r4196.
2006-08-04 09:30:43 +00:00
44fe226dd2 # Housekeeping and pathfinder enhancements / optimization when dealing with ranged actions.
- Modified Xeromyces to no longer automatically convert element and
attribute names to lowercase, so that we can have camelCase names. We
should now be able to convert all the multi-word entity properties, like
pass_through_allies, to camelCase, like passThroughAllies, which is more
consistent with the rest of our JavaScript naming conventions. To
support the existing code that assumes lowercase element names, I made
the getElementID and getAttributeID methods (used in the EL and AT
macros) ignore case, and I changed any code that directly accessed
element names to use the right case. CEntityTemplate now converts
Names_LikeThis to names_likeThis (changing each separate "word" in the
name to camelCase). Changed the version letter in XMB filenames from A
to B to support this without requiring people to delete old XMBs.

- Enhanced the pathfinder's handling of contact paths, resulting in a
very large speedup for actions like attacking, construction, etc. The
problem was that the pathfinder used to not count a given state as the
goal unless it was exactly coincident with the target location. This is
fine when you order a unit to go exactly to a certain spot, but if
you're ordering a unit to build, gather or attack something, then the
target tile is impassable (because your target is there) and therefore
the pathfinder never declares a state final. As a result, the pathfinder
tries hundreds of extra tiles in case there is a long path that gets to
the goal, and after failing to find any path that reaches the goal, it
gives you one to the closest point it got to. To fix it, I made the
pathfinder take into account a radius around the goal in which it's OK
to be, which depends on the size of the target unit and the range of
your action.

This was SVN commit r4186.
2006-08-01 03:41:21 +00:00
f007b1dc0c Added a random number generator in CSimulation and functions to access it from JavaScript, which will be useful for things like projectile inaccuracy.
This was SVN commit r4183.
2006-07-30 00:24:04 +00:00
903b97c1a8 - Optimization: added bit vector to let CEntityManager check referenced entities with more spatial locality.
- Bug fix: Entities that died due to the action of a previous entity in
a simulation step still tried to update that step.

This was SVN commit r4182.
2006-07-29 23:58:33 +00:00
554b9e537e - Changed actor selection sets to CStr8 rather than CStrW.
- Added more comments in ScriptableComplex.h/inl explaining how they are
split up and when to #include the inl.

This was SVN commit r4180.
2006-07-29 22:02:11 +00:00
dbe4451da2 # Housekeeping.
ScriptableComplex.inl is now only #included in CPP files that need it
(files that use functions from it directly), which is a total of 5
files, so recompiling after modifying it should be a lot faster.

This was SVN commit r4176.
2006-07-27 21:20:30 +00:00
1da24b9cee # housekeeping - comments+rationale for yesterday's CJSComplex cleanup
This was SVN commit r4175.
2006-07-27 12:54:47 +00:00
cc22d9b73e # Housekeeping.
- Jan and I cleaned up CJSComplex and put all the function bodies and
helper classes in ScriptableComplex.inl. This also required minor
changes to other files.
- Removed a debug message from Technology.cpp.

This was SVN commit r4173.
2006-07-27 02:42:35 +00:00
8c14a7c8e4 # housekeeping
remove one entity.h (replace with forward declare) => less coupling

This was SVN commit r4172.
2006-07-27 01:29:28 +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
37c87a6579 # housekeeping
add new JSUtil, automatically included via SpiderMonkey.h.
move JS_ASSERT there and rename JSU_ASSERT.
move scriptglue's REQUIRE_PARAMS there and rename to JSU_*
replace if(argc < x) bail() code with those macros.

This was SVN commit r4169.
2006-07-26 13:10:13 +00:00
2261231ffa # Housekeeping.
Jan and I implemented a number of changes:

- Converted SClassSet to vector.
- Refactored get/set ClassSet from string into methods in CClassSet.
- Turned pass-by-value string params in getCollisionObject, CEntity
constructor and CEntityManager into pointers.
- Simplified processChooseMovement.
- Merged CalculateRun and CalculateHealth into a single, simpler
CalculateRegen + helper functions.
- Changed the way regen works so the rates read in the XML act as rates
(before, they were the number of seconds until the entity will be fully
regenned, which is a bit counterintuitive).

This was SVN commit r4167.
2006-07-24 01:33:26 +00:00
c19dbd1360 Removed UTF-8 BOM
This was SVN commit r4164.
2006-07-22 17:51:37 +00:00
03349d7d0c More tech work:
- Added the ability to specify modifiers as percentages, by typing for
example "<value>10%</value>".
- Changed the way required techs work so you need any of them rather
than all (which is how Andrew originally had it, I think, except I
changed it to all because techs with 0 prereqs counted as unresearchable
and I thought there was a logic error).
- Techs will now correctly declare themselves unavailable if a pair tech
is in progress of being researched.

This was SVN commit r4162.
2006-07-21 22:57:38 +00:00
90bfaf9c99 # housekeeping + bugfix in file trace recorder
entity.cpp: fix indenting (was using space instead of tab)
replace all instance of & operator=( with NO_COPY_CTOR
trace: fix bug reported by michael: if trace file is huge, indices would
keep on being recorded but data was cut off after a certain limit,
leading to invalid pointers (into garbage data)

This was SVN commit r4158.
2006-07-21 01:11:23 +00:00
7831f3cbe4 # Better handling of entity ownership changes.
Entities will now leave all their auras and cancel all their productions
when they change ownership, which will be useful when we have
convertible buildings.

This was SVN commit r4156.
2006-07-21 00:05:56 +00:00
2f68e8d547 # Updates to techs.
- Added name and player JS properties for use in scripts.
- Remoed IsJSFirst since it doesn't make much sense for techs that also
apply to newly created units.

This was SVN commit r4154.
2006-07-20 22:43:06 +00:00
c817566222 # housekeeping
replaced all (*) CStr / CStrW by-value params with const reference. hoo
boy.

please always perform this optimization (actually standard idiom) when
writing the code - it takes little work, tells the next guy that the
string won't be modified, and makes a large performance difference.

(* where possible.. a few require other changes and will follow later)

This was SVN commit r4151.
2006-07-20 14:37:58 +00:00
673624d4ad Updates to techs: Added m_inProgress variable and fixed up some JS interface functions that were returning JS_TRUE/JS_FALSE rather than JSVAL_TRUE/JSVAL_FALSE.
This was SVN commit r4146.
2006-07-19 05:26:52 +00:00
8eae620b11 # More work on technologies.
Techs will now apply to units created after they are researched.

This was SVN commit r4143.
2006-07-18 23:59:48 +00:00
b70e16cf2a Removed traits.health.curr from CEntityTemplate (this is a per-entity property, and putting it in the template caused units to revert to 0 health when they changed templates; that hadn't been happening in the past due to the m_inherited bug).
This was SVN commit r4141.
2006-07-18 16:52:53 +00:00
845b606763 # Updates to the tech system, and bug fixes.
Techs: Made a separate list of technologies for every player, rather
than array fields in CTechnology. This also involved changing the
tech-related JS functions.

Bugs:
- PS_MAX_PLAYERS should be 8 (the way it's used for array sizes, etc
indicates that it's the maximum possible number of players ever, but it
used to be 6 while the game had 8 players).
- When you changed a CJSSharedProperty that was inherited, m_Inherited
was set to false, so it was no longer inherited by subsequent entities
you created. They got initialized to garbage values as a result.

This was SVN commit r4138.
2006-07-18 04:17:46 +00:00
e1f06f4667 # Updates to health/stamina bar rendering code, and optimizations in CJSObject.
(Replaced CStrW parameters with const CStrW& in CJSObject and
CSynchedJSObject).

This was SVN commit r4136.
2006-07-17 22:18:37 +00:00
f0ec100d1a Bug fix to construction (units weren't being given the building to convert to due to some hasty refactoring in an earlier commit). Also increased shadow Z bias to 0.02 since there still seemed to be cases when it was very visible.
This was SVN commit r4125.
2006-07-17 00:59:32 +00:00
29ea79f5eb # CSimulation init optimization
* ScriptableComplex.h: big bang (several hundred ms) for little buck:
made all CStrW params const CStrW& instead. this should *always* be done
as a matter of principle, unless the string actually needs to be
modified (in which case compiler will tell you)

* adts: slight improvement to hash table perf: change expansion
threshold to 50% full, and implement quadratic probing (as suggested by
matei)

This was SVN commit r4122.
2006-07-16 23:03:26 +00:00
4630745625 # Updates to the entity bar display system by Andrew.
Bars and rank icons now scale with zoom level. I've left in the old
render functions for now, but they can be removed later.

This was SVN commit r4120.
2006-07-16 19:32:48 +00:00
4a259aa439 # add cppdoc, refactor EntityManager
entitymanager: remove duplication, move refcnt && !destroyed check into
helper function in preparation for caching result of that calculation
scriptglue: improved timer calibration

This was SVN commit r4113.
2006-07-14 14:00:00 +00:00
85959bb073 Fixed a crash that happened for me in release mode when pressing the shift key. In Hotkey.cpp:594, there was a line like
if( !unified[(*itKey)-UNIFIED_SHIFT] ) accept = false;

This was causing an index out of bounds when the key at *itKey was
AND'ed with the HOTKEY_NEGATION_MASK and thus became greater than 65536
and way out of bounds of the array. For now I added a check that *itKey
< HOTKEY_NEGATION_MASK, but maybe this is not the intended usage.

This was SVN commit r4111.
2006-07-14 00:14:44 +00:00
3f91cbe3c1 # Brightened default ambient lighting
This was SVN commit r4109.
2006-07-13 22:41:49 +00:00