Commit Graph

2643 Commits

Author SHA1 Message Date
4730ed0276 Fixed a bug that could cause corpses to "wiggle" if a unit died while moving.
This was SVN commit r4532.
2006-10-09 04:32:27 +00:00
4fb0f2ae5d Added CEventTargetExhausted, used by the unit AI for gather and build, as well as GetDistance and GetVisibleEntities JS functions in CEntity that are required by the JS code for these events.
This was SVN commit r4531.
2006-10-09 04:17:15 +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
985a4cc6d5 # Bug fixes.
- Fixed shutdown order so the console is shut down after the simulation
(fixes #152).
- Fixed CPlayer::JSI_GetColour to not create a copy of the colour
object, since that caused problems when the copy went out of scope and
the corresponding JSObject was deleted.

This was SVN commit r4522.
2006-10-08 04:56:30 +00:00
12f0720f31 More minimap fixes on game restart (recalculate everything because the map size might have changed).
This was SVN commit r4520.
2006-10-08 03:28:22 +00:00
ba4d30d149 Fixed a crash in snd_mgr.cpp that sometimes happen on fade(), although no function should really be calling it with hvs=0. Also made the minimap reupdate its texture when the game is restarted.
This was SVN commit r4519.
2006-10-08 03:07:54 +00:00
3c74758f5c Modified default water parameters.
This was SVN commit r4501.
2006-10-07 17:59:06 +00:00
2337cb203a # Order queueing for construction.
This was SVN commit r4497.
2006-10-06 14:21:16 +00:00
0df95f3e8f Things without a death animation will now disappear when killed.
Also removed some debug info and added some checks for passability in
pathfinding to avoid long searches when the source or destination is
impassable.

This was SVN commit r4495.
2006-10-06 05:38:57 +00:00
1036799546 # Units will now back away from enemies when below minimum range.
Also a small water specular strength tweak.

This was SVN commit r4481.
2006-10-04 04:47:58 +00:00
de0f893c18 Recompiled Premake on Windows. Added some headers so HAVE_PCH=0 works in MSVC.
This was SVN commit r4442.
2006-09-30 21:36:19 +00:00
d0dd86d0b4 # Fixed unit test build system on Linux
This was SVN commit r4441.
2006-09-30 21:09:02 +00:00
920cbe4dc3 #First submission of SoundGroup.h and SoundGroup.cpp ref #138
This was SVN commit r4440.
2006-09-30 20:13:11 +00:00
c1377256fa #changed VSrc_validate to accept values up to and including 2.0 for vs->pitch
This was SVN commit r4439.
2006-09-30 20:10:30 +00:00
a2432adad3 # GCC 4.1.1 compatibility
which is just "class C { void C::f(); }" code, which other compilers
seem to have ignored.
Also removed HAVE_PCH from GCC because our build system doesn't have
PCH. Added necessary headers to make it compile again.

This was SVN commit r4437.
2006-09-30 15:46:40 +00:00
d46122e60a # minor fix to sound pitch shift
(allowing positive pitch shift)

This was SVN commit r4430.
2006-09-29 01:04:25 +00:00
8f82d5ab17 Tweaked water movement speed.
This was SVN commit r4427.
2006-09-28 23:27:55 +00:00
d0b61a5318 As per request: media player.
This was SVN commit r4426.
2006-09-28 22:34:27 +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
cc8bf09cc5 Added 'float' flag to actors - fixes #153.
Fixed creation and selection of entities (and now actors) which float on
water.
Added ctrl+n/o/s keys to actor editor.

This was SVN commit r4417.
2006-09-28 02:05:56 +00:00
b6c1022566 # Improved actor-viewer tool (more viewing controls, support for random actor variations)
Also right-click-and-drag to rotate the camera vertically.
Fixed LookAt code (the algorithm in the gluLookAt man page seems to be
wrong).

This was SVN commit r4394.
2006-09-27 16:54:23 +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
76e957ed78 Fixed compilation errors.
Slightly tidied Atlas code.
Removed old unused ScEd code.

This was SVN commit r4389.
2006-09-24 15:59:33 +00:00
ac47d2d028 Cleanup: Remove unused COverlay class
This was SVN commit r4388.
2006-09-24 12:06:36 +00:00
c47d1cc663 CRenderer: Cleanup some remnants of object types for which the Submit() method has been removed.
This was SVN commit r4387.
2006-09-24 11:56:11 +00:00
119f1452bf # Fix a crash during exit.
Refs #152

The issue was that the JSInterface_Console would attempt to write a
message on the console even after the g_Console object was deleted. Work
around this by:
1. resetting the g_Console pointer to 0 after deletion and
2. adding a null-pointer check

This was SVN commit r4386.
2006-09-24 11:48:24 +00:00
c14765989e # Introduce a Scene abstraction that allows the renderer to query visibility from multiple virtual camera positions.
This is the first step towards fixing #142

This was SVN commit r4385.
2006-09-24 11:25:11 +00:00
a63f49e582 Add gameView.culling and renderer.skipSubmit for debugging purposes.
This was SVN commit r4382.
2006-09-23 16:04:54 +00:00
e0b68b7f9f Use AddLocalProperty in CRenderer.
This gets rid of lots of boiler-plate code in JSI_* functions.

This was SVN commit r4380.
2006-09-23 12:48:06 +00:00
714e436e3c Made AT_STARTUP use an unnamed namespace, to avoid collisions between structs in different files that happen to have the same name (which sometimes causes the constructors to get mixed up by the linker)
This was SVN commit r4378.
2006-09-23 00:01:00 +00:00
a1a7dac59c # Integrated Actor Viewer and Actor Editor tools
ObjectManager: Removed ObjectTypes because it hasn't been used for
years.
Atlas: Fixed leak when saving with Xerces. Changed range of water
shininess slider.
Actor Editor: Relabelled "Freq" to "Ratio". Made modal dialogs use the
correct parent.

This was SVN commit r4376.
2006-09-22 17:43:00 +00:00
871cdb6ef9 # SwEng (reduce full recompiles by splitting up master error header)
- error codes now accessed as ERR::NO_MEM, INFO::OK etc.
- no more X-macros => the above are now recognized by visual assist
- error codes are defined by the module originating them (lib_errors has
some generic ones)
  => no full rebuild when adding some
- error descriptions are now in C++ files => can be changed without full
rebuild

added AT_STARTUP in lib.h.

This was SVN commit r4374.
2006-09-22 13:19:40 +00:00
05aadf1f12 # SwEng: remove X-macros from app_hooks (confused static code analysis)
This was SVN commit r4372.
2006-09-21 12:06:56 +00:00
7ce31a1544 Hopefully fixing VS2003 (autobuilder) error ("'operator &&' is ambiguous - could be 'built-in C++ operator&&(bool, bool)' or 'built-in C++ operator&&(bool, CEntity *)' while trying to match the argument list '(bool, HEntity)'")
This was SVN commit r4358.
2006-09-18 18:38:29 +00:00
bfae07a0bc # Added more control for water shader
(Murkiness, colour, tint, reflection tint, reflection tint strength)

This was SVN commit r4357.
2006-09-18 18:09:07 +00:00
5e28c4bebf - Fixed a bug with aura rendering that was causing a crash when rendering auras that were added to a unit after its creation (initAuraData was not called on subsequent AddAura calls). This caused objects like Settlements, Mills, Farmsteads and Temples to crash when you mouseover them since they do not gain the aura until construction is complete.
- When the map contains no territories, ignore territory-related
building placement rules.

Fixes #149.

This was SVN commit r4349.
2006-09-17 02:49:29 +00:00
e4bcc1c6a3 Gameplay fixes:
- Set the default rally point to be right on top of each building
(rather than (0,0)).
- issueCommand used to send 2 copies of a command, which caused for
example units to be trained in twos (it added some entities twice to
msgEntities).

This was SVN commit r4348.
2006-09-17 02:20:20 +00:00
6b73ba0296 - Terrain conformance should now work in Atlas as well.
- Renamed Passive stance to Hold (which is what it's called in the
design doc and GUI).

This was SVN commit r4345.
2006-09-16 21:30:23 +00:00
04b9809e0b Made CTerrain::getSlopeAngleFace even more "continous" at places where the slope changes rapidly (before, it only checked elevation forward and right, now it also looks left and up).
This was SVN commit r4340.
2006-09-16 20:16:42 +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
6e328f1c1c Linux fixes.
This was SVN commit r4335.
2006-09-14 23:04:20 +00:00
43526b061d Linux fixes.
This was SVN commit r4334.
2006-09-14 23:03:54 +00:00
8126769863 Linux fixes.
This was SVN commit r4333.
2006-09-14 23:03:16 +00:00
33ddc81871 Linux fixes.
This was SVN commit r4332.
2006-09-14 23:02:39 +00:00
09b87e84ec #Bugfix: Shadows appeared to be rendered one frame too late
close #141

The problem was that the shadow matrices were setup in BeginFrame, but
GraphicsView calls SetCamera after BeginFrame. The solution was to move
the shadow matrix setup into CRenderer::SetCamera.

This caused a second problem because RenderReflections/RenderRefractions
used SetCamera to change the OpenGL matrices. Solved this problem by
distinguishing explicitly between the camera used for the scene as a
whole and the camera used to configure OpenGL. The latter can be a
virtual camera for shadow or reflection rendering and similar
render-to-texture effects.

This was SVN commit r4330.
2006-09-14 20:06:21 +00:00
1767fe0304 close #103
Produce a more informative warning when GL_ARB_texture_env_crossbar is
missing, and disable shadows in that case.

This was SVN commit r4329.
2006-09-14 19:15:32 +00:00
faa998b8a9 # more mouse fixes (windowed mode)
note: previous fix (clamp to 0 in screen_to_client) causes spurious
messages if mouse moves outside of the window (which is bad). "client"
coords are allowed to be negative, but "idealized client coords" (which
are defended by assert >= 0 or is_in_window) aren't.
fixes #146

This was SVN commit r4324.
2006-09-11 23:30:23 +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
aa6ca7d1e8 Modified world intersection so that you can also intersect with the water plane, which is useful for making ships move around as expected when you rightclick a spot on the water.
This was SVN commit r4319.
2006-09-10 20:38:39 +00:00
df1a779d76 # Updates to water rendering (more effects).
This was SVN commit r4318.
2006-09-10 05:31:41 +00:00
aa50820d9a #Unit AI: Aggressive, defensive and stand ground stances.
Also split Entity.cpp further, moving the rendering code to
EntityRendering.cpp and the JS interface code to
EntityScriptInterface.cpp. This makes each individual file smaller
(about 1000 lines still!) and lets them be compiled independently.

This was SVN commit r4314.
2006-09-09 00:00:23 +00:00
18720c9c20 # multimonitor mouse fix (2)
hopefully found last confusion between screen/client coords (now prefix
the former with screen_*)
SDL passes around client coords in message as Uint16, int in API calls,
Window gives/takes screen space POINT (LONG x,y)

This was SVN commit r4311.
2006-09-08 20:09:26 +00:00
c7870cfbb4 buildFileList -> buildDirEntList to emphasize that dirs can be returned. (pt2)
This was SVN commit r4310.
2006-09-08 18:41:30 +00:00
f8bff91a38 Sped up territory border rendering by caching each edge segment's terrain-conformed coordinates so they don't have to be recalculated each frame.
This was SVN commit r4308.
2006-09-08 16:03:18 +00:00
6db054f7dd # Add JS variable renderer.fancyWater to enable/disable fancy water rendering at runtime
This was SVN commit r4307.
2006-09-07 22:16:15 +00:00
c183bcde1f Territory boundaries are now rendered before transparent objects, so these can properly cover them.
This was SVN commit r4306.
2006-09-06 22:26:27 +00:00
245496e201 Fixed warnings/errors/leaks related to Xerces update
This was SVN commit r4303.
2006-09-04 20:59:21 +00:00
dave
3b41b5fbd1 Moved the include of cmath out of the #ifdef
This avoids stuff like

/usr/include/c++/4.0.0/cmath:85: error: template with C linkage
/usr/include/c++/4.0.0/cmath: In function 'float std::abs(float)':
/usr/include/c++/4.0.0/cmath:92: error: declaration of C function 'float
std::abs(float)' conflicts with
/usr/include/c++/4.0.0/cmath:88: error: previous declaration 'double
std::abs(double)' here

This was SVN commit r4291.
2006-09-03 02:17:57 +00:00
8e02ec84f9 Updated OpenAL to 1.1 (which no longer includes ALUT).
Changed player-id code a bit so the entity and actor and unit should
stay in sync more often. (The entity/actor/unit mixing still looks a bit
dodgy and unreliable, though.)
Simplified console help code.
Allowed init/shutdown to be done with the simulation/world/etc parts
disabled (so the actor viewer can load faster).

This was SVN commit r4289.
2006-09-02 21:20:25 +00:00
dave
12b060d34f isfinite etc.. is now properly defined as a macro
This was SVN commit r4288.
2006-09-02 19:41:26 +00:00
dave
0ffabbc5dc Mac compat ..
This was SVN commit r4287.
2006-09-02 17:21:49 +00:00
dave
2bb1bde51e Mac gcc complains about mixing size_t, uint etc..
This was SVN commit r4285.
2006-09-01 06:59:29 +00:00
f79af31e42 Units can no longer "track" enemies that are out of the player's LOS when performing a contact action (attack, gather, etc).
This was SVN commit r4272.
2006-09-01 00:24:26 +00:00
789c850049 # Updates to fog of war rendering.
This was SVN commit r4270.
2006-08-31 23:56:12 +00:00
c4d478a690 Fixed a crash in renderTerritories when there were no Settlements.
This was SVN commit r4267.
2006-08-29 03:46:14 +00:00
973161ed1b Territory manager now ignores territory centres that have ENTF_DESTROYED, so it will work when you delete objects in Atlas.
This was SVN commit r4265.
2006-08-28 23:05:15 +00:00
a55697e2e5 # Improved territory rendering.
- Territory boundaries are now offset slightly and drawn in player
colour, so you can see whose territory you're on the border of.
- Removed some duplication in the code by modifying a loop slightly.

This was SVN commit r4264.
2006-08-28 23:01:16 +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
5205944dce Added the concept of diplomatic stance in CPlayer.
This was SVN commit r4259.
2006-08-28 03:07:48 +00:00
ad5054205c # Optimised minimap drawing
Initially saved a little bit of time by changing it to use vertex
arrays, and then realised that disabling point-smoothing saved much more
time (from 70ms per frame on cantabrian_generated down to 2ms, which is
worth any quality loss)

This was SVN commit r4256.
2006-08-27 22:51:53 +00:00
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
3954604890 compensation for timer overhead (measurements now more precise; timer undershoots by 0.5us per start/stop session)
This was SVN commit r4099.
2006-07-13 21:04:06 +00:00
ed7b4b5fca # simple profiler/timer for JS scripts
cheezy but low-overhead. call startXTimer(i) and stopXTimer(i), where i
can be 0..9 for now. results are displayed via debug_out at end of
program run.

This was SVN commit r4095.
2006-07-13 20:09:20 +00:00
ac71eefbff Removed and #include for JSI_Entity.h.
This was SVN commit r4094.
2006-07-13 19:27:02 +00:00
b701269b0b # cleanup
replace it->member with variable=it->member for easier debugging. also
skip the AddProperty redundancy check in release mode instead of only
final builds

This was SVN commit r4093.
2006-07-13 19:12:50 +00:00
a56ec5bdcd Some cleanup - renamed CBaseEntity to CEntityTemplate, and removed JSInterface_BaseEntity.h and JSInterface_Entity.h (which were unused).
This was SVN commit r4091.
2006-07-13 03:29:33 +00:00
eb467745b3 Fixed a small bug - CEntity::m_extant was not initialized to true.
This was SVN commit r4089.
2006-07-13 00:16:11 +00:00
d2e8804ce0 Removed old attribute table code since it's no longer used.
This was SVN commit r4087.
2006-07-12 22:50:09 +00:00
c3879b182d # CSimulation cleanup and optimization.
- Modified CJSSharedProperty so it can be inherited. It now acts as our
"static property" class with a pointer-to-member field. It did much of
this before but it wasn't used much because of the way XML properties
were loaded.
- Modified CEntity and CBaseEntity so that virtually all properties are
now CJSSharedProperty's added with AddClassProperty in ScriptingInit.
- Removed m_run SEntityAction field, replacing its fields with separate
variables, so we can have proper pointer-to-members for them.
- Modified CTechnology to use CJSComplex::Get/SetProperty so that
attributes no longer need to be "registered" for use in techs.

This was SVN commit r4086.
2006-07-12 22:24:25 +00:00
bd3a188cf9 m_sectorValues should be per-entity, not a property of BaseEntity.
This was SVN commit r4084.
2006-07-12 19:31:27 +00:00
ca4a4613f1 # CSimulation optimization+cleanup (2)
made many (*)of the bools in CEntity into a bitfield (flags). this saves
a lot of space inside CEntity.
* only those that are not specified in XML and/or accessed via JS

This was SVN commit r4082.
2006-07-12 16:18:31 +00:00
397a350e45 svn:ignore auto-generated test .cpp files.
Territories: Fixed memory leaks.
Atlas: New section-toolbar. Fixed colour of brush grid. Moved open/save
into File menu. Added 3D-ish lighting control. Added 'busy'
notifications.

This was SVN commit r4079.
2006-07-12 14:49:10 +00:00
e4ed1d52b9 # CSimulation cleanup and optimization (1)
moved some fields (e.g. size of health bar) out of CEntity and into
BaseEntity so they can be shared between entities (instead of duplicated
in each).

TODO: is it ok to remove AddProperty for those properties in CEntity?
(BaseEntity is still adding them)

This was SVN commit r4078.
2006-07-12 14:36:59 +00:00
1034a980fe Added code for placement of socketted buildings.
This was SVN commit r4073.
2006-07-09 23:12:37 +00:00
eaf12ae666 #fix to isnan() bug
big thanks to philip for seeing the problem! :D
cause: not popping FPU stack. didn't happen on my athlonXP presumably
due to different FPU usage (possibly in drivers): pushing 8 values could
clear the stack and mask overflow. the cause was not due to compiler
(and FLD/FSTP param passing) because Philip uses VC2005 as well, but saw
the crash (on P4 CPU)

fixes #130

This was SVN commit r4072.
2006-07-09 00:24:21 +00:00
7926b3d93c # Some groundwork for territories.
Entities with traits.is_territory_centre == true will act as territory
centres, and territory areas are calculated and displayed on the
minimap. It remains to display these areas in the game view and to make
Civ Centres "socketable" so you can build them on Settlements to claim
them.

This was SVN commit r4070.
2006-07-08 22:40:01 +00:00
f3b3e0be6e # big refactor of error display code. fixes crash in release-mode selftest
* debug_write_crashlog and debug_dump_stack are now responsible for
detecting reentrancy (reported via new ERR_REENTERED error code).
* export debug_error_message_build to allow unit test of stack dumper
* split+clean up debug_display_error to allow this.
* error_description_r now returns buf for convenience
* ia32: fix typo causing disassembly to fail
* wdbg_sym: bugfix causing incorrect debug_walk_stack return value.
prevent recursive locking, provide locked version of
debug_resolve_symbol. add skip_this_frame for convenience.

refs #130

This was SVN commit r4067.
2006-07-07 01:22:23 +00:00
dd6679b0b8 # fixes to string_s selftest
snd_mgr: fix cppdoc comments (got shredded by IDE autofmt)
string_s: disable WARN_IF_PTR_LEN (too many false positives)
test_string_s: add missing debug_skip_next_err (fixes complaints on
VC2003)

refs #130

This was SVN commit r4066.
2006-07-06 15:52:59 +00:00
pyrolink
a95c72d0c1 Upgraded console (text wrap, help text), cinematic stuff
This was SVN commit r4065.
2006-07-06 03:17:44 +00:00
a0e92ee51c # small fixes
ia32: fix overly zealous error return in ia32_get_call_target
sysdep: more correct definition of fpclassify() (takes into account
argument size)

This was SVN commit r4055.
2006-07-02 20:03:05 +00:00
1f663eaf14 (fix: didn't see compiler error message, oops.)
This was SVN commit r4049.
2006-06-29 22:59:10 +00:00
600adac871 # housekeeping and bugfix in Loader queue
remove old instrumentation, fix warnings, add measured timing results
Loader: bugfix: no more memory leak whenever callback returns a warning
code. this was a loophole in the callback return value docs.

This was SVN commit r4048.
2006-06-29 22:52:50 +00:00
5586f29c5f # housekeeping
remove no longer needed timers and debug_printfs.
delete JSInterface_*Entity.cpp files because they are empty and cause
linker warnings.

This was SVN commit r4043.
2006-06-26 12:47:23 +00:00
aeed96dafa # improvements to build system for asm files
split ia32_asm code up into memcpy, color
premake: add (windows-only so far) support for NASM include paths -
required when using %include. see rationale in vs.c
refs #124

This was SVN commit r4039.
2006-06-25 20:58:03 +00:00
77faccb6cb # small fixes.
add translate_free (avoids mem leak in translate API)
debug: when skipping errors but an unexpected one is raised, trigger a
warning.
test_archive_builder: properly clean up archive; decrease number of
files to speed things up.

This was SVN commit r4035.
2006-06-25 15:35:28 +00:00
3b753a4df8 # add cppdoc
refs #122

This was SVN commit r4034.
2006-06-25 15:31:58 +00:00
45af5f0d4f # final self-test fixes; integration complete.
reinstate and fix archive_builder and compression tests.
file: add dir_delete
wdbg_sym: stack trace check is now silent.
Win32Gui: fix indentation

closes #117

This was SVN commit r4022.
2006-06-24 13:41:42 +00:00
7e3265899c # fix errors in self-tests and the code they test. all now run through.
(archive_builder and compression tests are disabled ATM)

also fixed some compile warnings inside cxxtest.

refs #117

This was SVN commit r4021.
2006-06-24 10:44:08 +00:00
7cb82ada2f # lots of housekeeping/fixes
premake: document extra_params
ogl: remove EXT_ symbols, use glext instead
adts: move cache into separate file (also remove old cache impl)
move SDL files in sysdep/win to libraries/SDL
ScopeTimerAccrue: change #ifdef spaghetti into templated policy class
app_hooks, define VOID_FUNC to FUNC(.., (void) )
look at stalk walk code; any reason not to work on Win64?
replace ERR_TEX_CODEC_CANNOT_HANDLE with INFO_* - not an error. also
ERR_SYM_SUPPRESS_OUTPUT ERR_SYM_SINGLE_SYMBOL_LIMIT
wdbg_sym: only import RtlCaptureContext once (not every walk_stack)
add sys_last_error (!GetLastError on win32); converts to text in
display_error, also show sys_last_error and errno
app_hooks: move i18n impl out (belongs in pyrogenesis)
fixes to string_s test.

refs #124

This was SVN commit r4020.
2006-06-23 17:41:55 +00:00
980689e054 Hopefully closes #126 again
This was SVN commit r4016.
2006-06-23 01:06:21 +00:00
04e36e4bef Hopefully closes #126
This was SVN commit r4015.
2006-06-23 01:00:20 +00:00