Commit Graph

396 Commits

Author SHA1 Message Date
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
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
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
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
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
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
pyrolink
a95c72d0c1 Upgraded console (text wrap, help text), cinematic stuff
This was SVN commit r4065.
2006-07-06 03:17:44 +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
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
92b9c07f95 Restoring SVN repository:
Greek basket texture

# New Greek vases

# housekeeping
documentation fix: trailing / in directory names is mandatory

# Atlas: Sky texture selection; save with maps

Atlas code tidying: Slightly nicer syntax for defining command handlers,
and some explanation of how it works

Automated build.

This was SVN commit r4008.
2006-06-21 22:37:31 +00:00
039f26f0c3 Fixed editor brokenness.
# More useful environment (water, lighting) editing
(now saved into the map files).
Fixed no-PCH a bit.

This was SVN commit r4002.
2006-06-11 07:03:59 +00:00
77c59070c1 # Various gameplay updates.
- Added per-player resource pool and modified the GUI and entity scripts
to work with it.
- Modified unit creation functions so the unit is always assigned a
player before firing its initialize event, so that this event can deduct
population, etc from the right player.
- Fixed various small bugs, like a unit not cancelling all of its queued
items when it dies, or buildings not costing anything.

This was SVN commit r3998.
2006-06-10 03:05:16 +00:00
8d06d8601b A few organization changes:
- Removed "Base" from the Technology and Formation class names (it
doesn't make sense because these don't use inheritance).
- Modified the tech methods a little so a player ID is passed to
applyEffects, not getTechnology.

Also added a game startup script which will eventually set up player
resource pools and give them their civ techs.

This was SVN commit r3996.
2006-06-09 23:07:11 +00:00
a553182f6a More header-file rejigging.
This was SVN commit r3993.
2006-06-09 18:32:00 +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
718f2fe8f1 More tech bug fixes.
This was SVN commit r3956.
2006-06-07 01:40:42 +00:00
40f29a8345 Some fixes for techs.
This was SVN commit r3954.
2006-06-07 01:04:41 +00:00
pyrolink
e4c40841b2 #Configurable game speed, techs, elevation attack bonus
-techs are not operational yet
-set the game speed with setSimRate() in the console or in the config
file under hotkey.speed.increase or hotkey.speed.decrease
-made a few other small fixes

This was SVN commit r3950.
2006-06-06 06:31:17 +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
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
9124f7266c Tidied up some include paths
This was SVN commit r3929.
2006-06-02 01:01:39 +00:00
bde2a0b0c7 # Fixed a pathfinder bug.
The pathfinder was pushing locations with negative coordinates (or
coordinates larger than the map size) onto the queue, which led to
memory corruption in CAStarEngine's node array and later a crash in its
destructor.

This was SVN commit r3923.
2006-06-01 06:04:32 +00:00
bca1f982eb This was SVN commit r3921. 2006-06-01 03:26:51 +00:00
03a08e00a5 # Fixed infinite loop.
Also fixed sectorDivs so it's always initialised, since the complaints
were annoying.
Camera: Added a const.
Super cavalry: Added required(?) aura attributes.

This was SVN commit r3906.
2006-05-29 03:28:54 +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
275a73851c # Added sky box as well as repair, heal and trample actions.
Closes #31, #32, #37. Refs  #46.

This was SVN commit r3865.
2006-05-16 04:41:37 +00:00
1e3f5f5d3e # Added some groundwork for technologies and fixed some small bugs.
- Entity templates are now per-player, along with an unowned
"unmodified" version of each template that should be used to find the
original values of the stats. This can be accessed in the scripts as
<template>.unmodified.

- Fixed a pathfinder crash when the last path from the engine had 0
elements (just ignoring this for now).

- Units should no longer become purple when they upgrade in rank.

Refs #3.

This was SVN commit r3863.
2006-05-13 22:11:46 +00:00
kevmo
68644fb42b # Updated pathfinding to improve speed and ignore allied unit collisions
- Pulled out the A* implementation to a separate class to support reuse
of code for the high level pathfinder
- Cached the the open/closed status of nodes to improve speed
- Added a maximum node limit before the search is cut off
(DEFAULT_SEARCH_LIMIT in AStarEngine.cpp for now)
- Allied unit collisions are now ignored

This was SVN commit r3861.
2006-05-13 18:50:58 +00:00
f40b90570c # Fixed a bug with the run action.
Also added a pass-through-allies attribute in CEntity as
m_passThroughAllies (actions.move.pass_through_allies).

This was SVN commit r3853.
2006-05-13 04:07:42 +00:00
2a2d115f4d # Updates to construction: Added a start construction net message and made the selected units start working on a newly placed building after you place it.
This was SVN commit r3845.
2006-05-04 07:40:31 +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
a7594bb39c # GCC compatibility
This was SVN commit r3828.
2006-04-28 04:53:23 +00:00
5a84badd8c #bugfix: prevent crash due to entities that don't have angle_penalty.sectors set
This was SVN commit r3810.
2006-04-24 15:07:43 +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
2fbb899bb5 # Animate props.
tex: Reverted recent WARN_RETURN(ERR_TEX_CODEC_CANNOT_HANDLE) changes,
since (I think) it shouldn't warn about that being returned (because it
intentionally happens frequently).
XMLWriter: Trivial inconsequential optimisations (avoiding temporary
strings).

This was SVN commit r3801.
2006-04-23 22:22: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
8bb97e63cd # Work around a problem in ATI's binary Linux driver
This was SVN commit r3789.
2006-04-21 03:06:57 +00:00
c81df59294 # Include headers for compilation without PCH
This was SVN commit r3774.
2006-04-19 05:30:02 +00:00
89c3fad6f3 # Fixed a bug with the rendering of unit rank icons.
This was SVN commit r3768.
2006-04-14 08:33:52 +00:00
8d7e2ff00a Fix to some of the rank icon rendering issues.
This was SVN commit r3767.
2006-04-14 08:25:29 +00:00
6fbce9c355 # refactoring
- color: the sse codepath is now detected and activated from within
color.cpp, which avoids making ia32 dependent on the color header. it's
called from gamesetup!InitRenderer.
- move VFSUtil::EnumDirEnts to vfs.cpp!vfs_dir_enum - allows it to be
used from within lib/ without dependency on ps (annoying for other
projects)

This was SVN commit r3764.
2006-04-14 06:32:05 +00:00
c41248b585 # Updates to actor prop-switching system
Forced variant names to lowercase. Allowed empty prop model names to
remove inherited props. Removed a little code duplication.
Entity: Changed confusing (and probably incorrect) loop/STL logic, to
use slightly more confusing syntax instead.

This was SVN commit r3761.
2006-04-14 03:14:43 +00:00
5812774ded # fix bug#80 (was due to uninitialized mem)
This was SVN commit r3755.
2006-04-12 06:37:51 +00:00
kevmo
bd431d25f6 # First iteration of low-level pathfinder
PathfindSparse replaced with an A* implementation.  Low-level
pathfinding done on the tiles of the map, high level pathfinding is
currently a placeholder, and only gives the final waypoint.

This was SVN commit r3747.
2006-04-10 22:05:21 +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
604225f971 # Fix unportable code and g++ specific warnings
* Use / instead of \ in #include path names
* g++ prefers files that end in a newline

This was SVN commit r3734.
2006-04-08 23:47:29 +00:00
pyrolink
f2e867e239 #Bar borders and angle penalty
-Changes to notifications. They take different parameters now-see
template_entity_script.js.  You can choose to destroy the notifiers
yourself in the script (useful for idle)
-Added "idle" event with registerIdle and registerDamage to assist with
the angle penalty.
-Bar border stuff
-Angle penalty is set up but untested-it just needs to use
this.getAttackDirections() to find the number of directions the entity
is being attacked from.  The penalty is specified in template_unit

There is a problem when the game exits-it attempts to destroy the
notifiers in entity.cpp's constructor, where it calls
DestroyAllNotifiers().  The problem is that the notifiers don't exist
any longer because they've been destroyed. I would fix it but I'm
leaving for vacation (Jason told me it was OK to comitt). Hope it isn't
too much of a problem.

This was SVN commit r3732.
2006-04-08 22:34:54 +00:00
44901d38b9 # further documentation and improvements to lib/res/file code
FILE_CACHE_BLOCK flag used more safely (copied in afile_read)
add file_sector_size (set from sysdep code)
documented and organized FileFlags
moved publically visible file_buf* decls to file.h; add FileBufFlags
file_buf_get: moved to file_io and renamed because it is not a part of
the file_buf manager itself
FILE_BLOCK_SIZE no longer exposed to users - it's an implementation
detail. for alignment purposes, you should use file_sector_size (less
wasteful)
add page_aligned allocator (mmap)
write buffers now allocated via file_buf_alloc(FB_FROM_HEAP) (avoids
wasting cache space)
append trace runs into the trace file (-> better input data for archive
ordering)
document lib_errors.h
tex_load: add provision for file_flags, used by ogl_tex_load to prevent
caching file data

simulation, entitymanager: add perf measurements

This was SVN commit r3725.
2006-04-03 21:28:10 +00:00
d9944f9524 # remove last occurrences of old ScEd-specific code
This was SVN commit r3719.
2006-04-02 16:27:34 +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
2e0a312913 update load time estimates. CSimulation is quite high and in need of optimization!
This was SVN commit r3664.
2006-03-18 21:25:03 +00:00
d3f57744d9 Refactored actor variation system, and added support for entity-level selections (controlled by the current animation).
Avoided tooltip error message.
Avoided noisy warnings when textures fail to load.

This was SVN commit r3653.
2006-03-17 03:59:49 +00:00
8b3e5759eb Fixed GC bug (plus some potential ones that didn't seem to actually cause problems).
Added \r\n->\n conversion in JS ReadFile functions.

This was SVN commit r3644.
2006-03-16 03:45:31 +00:00
ed38414b41 Texture converter, DevIL: ABGR DDS support.
Textures: converted ARGB to ABGR.
Misc: warning fixes, etc.

This was SVN commit r3631.
2006-03-14 21:29:19 +00:00
e0280949fd file_cache: fix: add buf/size combo to exact_buf_oracle if file_io rounded size up.
trace: split code out of vfs_optimizer (was getting too large)
vfs_mount: expose API to unmount all (needed to be able to delete
archives after building)
vfs_optimizer: safely handle empty connection/node lists;
refactored+documented
vfs_tree: eliminate 'file in root dir' warning (can happen easily
enough)

rest: fixes/minor tweaks

This was SVN commit r3610.
2006-03-07 05:44:34 +00:00
f1123fa2b9 Initialized health to 0 for entities with no health.
This was SVN commit r3593.
2006-03-04 01:15:32 +00:00
12c2a28774 - Added getColour() to Player JS interface
- Set stamina to 0 by default for units without stamina

This was SVN commit r3590.
2006-03-03 20:57:45 +00:00
943f1fca16 Fixed a couple of small bugs:
- Doubleclicking a unit only selects units of that type owned by the
same player (before, it selected all units of that type).
- Stamina no longer decays when you finish running to something and
start attacking/gathering it.
- Removed the extra frame of gather/build animation that played after
you finished gathering/building something before the idle animation
kicked in.

This was SVN commit r3568.
2006-02-26 22:37:04 +00:00
192ddf9ddf Added construction logic in startPlacing and Entity and BaseEntity, as well as the Death event.
This was SVN commit r3564.
2006-02-26 09:55:20 +00:00
bc07b9ff0a file code v2 is now feature complete and works.
- adts: add basic benchmark to self-test; use fminf instead of MIN; fix
overly pessimistic invalidation in Landlord_Cached
- allocators: no longer complain if DynArray is full
- lib: warn if rand() min=max
- archive: bugfixes: plug leak, correctly handle 0-length files, carry
over flags when reading uncompressed file from archive
- file: expose file_get_sorted_dirents and implement file_enum in terms
of that
- file_cache: many bugfixes (especially related to CacheAllocator
freelist)
- vfs_optimizer: finish implementation of archive builder
- zip: correctly handle 0-length files
- tex: add tex_is_known_extension
- sysdep: add efficient fminf implementation (assumes P6+)

- config: update archive builder call site
- gamesetup: add call for delayed self tests
- entity: return JSVAL_VOID as per philip's suggestion

This was SVN commit r3553.
2006-02-23 07:55:32 +00:00
7a4aeb69ed Added production queue system and associated events. It might still need some extra features but it should be functional.
This was SVN commit r3547.
2006-02-22 22:45:16 +00:00
e2a11fabe8 fix warnings (VC7)
This was SVN commit r3542.
2006-02-19 21:16:54 +00:00
0a368a4fec massive update to adts: cache now implemented via templated policy classes.
Entity.h: fix minor warning

This was SVN commit r3539.
2006-02-19 18:51:00 +00:00
pyrolink
10d84599e9 This was SVN commit r3507. 2006-02-13 03:32:15 +00:00
0fa0bfcb28 ConfigDB.cpp: fix vfs_load return value check
baseentity, entity: remove multiple property adds (source of
scriptablecomplex memory leak)
scriptablecomplex: add code to check for leak regression and prevent
them; add suballocator for properties, since 60k are allocated in a
short while (!) - saves time and memory

This was SVN commit r3429.
2006-01-28 22:21:54 +00:00
7838627cd2 - vfs_load now returns error code and takes FileIOBuf; that must be freed via file_buf_free. if Handle is needed, use mem_wrap.
- remove ScEd hacks and CFont et al macro rename
- fix accursed bug in VFS buffer management that was causing ReadFile to
fail without error (not allocating enough padding)
- vfs_tree: bugfix in tree_lookup
- waio: temporarily disable sector size determination (pending better
approach - need to determine if using DVD drive)

This was SVN commit r3421.
2006-01-24 08:16:29 +00:00
c4aea4eb62 Health regen fix for ranged attack.
This was SVN commit r3411.
2006-01-23 03:56:48 +00:00
a0936ede65 Fixes to the melee/ranged attack split.
This was SVN commit r3403.
2006-01-22 11:55:16 +00:00
pyrolink
c03cdd6a23 This was SVN commit r3402. 2006-01-22 11:09:13 +00:00
pyrolink
c6620bb358 Range and melee attack split up.
This was SVN commit r3396.
2006-01-22 08:53:35 +00:00
1290c3dcfd Fixed bug with pathfinding during a contact action on Linux.
This was SVN commit r3388.
2006-01-22 01:17:58 +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
pyrolink
5d4ec7f4bb Health regen, run bugfix
This was SVN commit r3382.
2006-01-21 11:17:15 +00:00
c2c5e87c61 Removed references to the old attack, gather, heal and damage events (that were no longer used).
This was SVN commit r3375.
2006-01-20 21:38:58 +00:00
pyrolink
1175b5cdba Stamina bars, run order
This was SVN commit r3364.
2006-01-16 10:56:47 +00:00
pyrolink
b781c898df Fixed ugly run bug
This was SVN commit r3349.
2006-01-10 04:39:11 +00:00
pyrolink
19b33141c1 Fixed up running and notifications.
This was SVN commit r3341.
2006-01-08 08:25:11 +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
pyrolink
2d8f45fd94 Added run order (if applicable, the unit will use the run animation and speed for movement, otherwise walk is used). If the unit's run speed is more than 0 and the target is within the run action's range, it will run instead of walk.
Notifications - called from javascript.  You request orders with a
target entity, order type, and whether the previous listeners you have
requested for this entity should be destroyed.  When the target entity
processes an order that was requested, that order is pushed onto the
queue of the requester.  This is useful for things such as follow that
require the actual order to perform the action.

This was SVN commit r3329.
2006-01-05 06:13:31 +00:00
0a3e9ec537 - Added pause game functionality.
- Removed CDamageType from the engine - damage is now handled only
within the entity script (easier to mod/modify).

This was SVN commit r3325.
2006-01-02 03:07:29 +00:00
fce3b183bb This was SVN commit r3311. 2005-12-29 09:12:54 +00:00
4a40baef33 Generic orders source commit. Also includes a fix to the animation bug where one frame of "idle" is played at the end of each cycle, and an enhancement to the entity script loading code to only load each script file once, which should save loading time and also allow script files to behave in a more logical way (e.g. no redeclaration errors when you have a constant).
This was SVN commit r3309.
2005-12-29 08:42:44 +00:00
pyrolink
2d57e13eb5 (see EntityManger.cpp log)
This was SVN commit r3304.
2005-12-29 04:58:41 +00:00
pyrolink
e968bd91ed Actual death flag and CHandle entity handle retrieval.
This was SVN commit r3303.
2005-12-29 04:57:02 +00:00
pyrolink
79ecda1ecf Commented out notifications and death flag set during kill().
This was SVN commit r3302.
2005-12-29 04:56:15 +00:00
pyrolink
69acf1c68c Commented out notifications.
This was SVN commit r3301.
2005-12-29 04:55:16 +00:00
709d1389da Removed a compile warning and changed scheduler's "tasks to cancel" set to a hash set.
This was SVN commit r3273.
2005-12-18 07:41:02 +00:00
5e0e3c32f3 Added support for cancelling a timeout or interval set using setTimeout/setInterval, which is used by the infidelity aura.
This was SVN commit r3272.
2005-12-18 07:33:16 +00:00
3ea5fa5b46 Lots of fixes for the Linux build:
- renamed sysdep/unix/ functions where necessary
- more int -> LibError conversions in the sysdep/unix/ part
- added some explicit #include statements where necessary
- moved enum LibError/ErrorReaction declarations
  (gcc doesn't support forward enum declarations)

This was SVN commit r3267.
2005-12-17 22:00:54 +00:00
45255d3f37 Added a "collision patch" system that groups entities into a grid on top of the map to make aura checking and collision detection faster.
This was SVN commit r3253.
2005-12-16 05:35:26 +00:00
2300a81070 C++ code changes for new entities (mostly referring to the right new properties or XML attributes in CEntity.cpp and CBaseEntity.cpp).
This was SVN commit r3249.
2005-12-15 21:59:48 +00:00
d939a006ae Added C++ code for auras. Some things that still need to be implemented are:
- Times on auras (a unit must be in range for X seconds for the aura to
start affecting it)
- An efficient GetInRange implementation in CEntityManager using a
quadtree or something of the sort (current one is linear in the number
of entities).

This was SVN commit r3238.
2005-12-13 08:05:30 +00:00
8cbf23f123 Fixed a bug with projectiles trying to hit non-extant entities.
This was SVN commit r3232.
2005-12-11 23:28:50 +00:00
bc23379066 Fixes to entity death and event handling, plus some updates to RmGen.
This was SVN commit r3226.
2005-12-11 02:09:11 +00:00
pyrolink
4f6dafd82a Added heal
This was SVN commit r3221.
2005-12-10 19:39:17 +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
5250814397 Atlas: Fixed entities-don't-move-when-terrain-is-altered. Unbroke and fixed entity memory management. Added flatten tool. Added object movement/rotation/deletion tool - but not yet finished, since 'redo' usually crashes (for known reasons).
This was SVN commit r3207.
2005-12-08 02:50:55 +00:00
a5d1968a8c ProfileViewer: Fixed char* vs wchar_t*.
Quaternion: Removed operator- since it doesn't seem geometrically
sensible for rotation-quaternions. Added ToAxisAngle but don't actually
use it anywhere.
GameView: Changed unit-view to look slightly more correct.

This was SVN commit r3201.
2005-12-06 20:16:50 +00:00
pyrolink
74f8d8c213 Bug correction for heal action.
This was SVN commit r3193.
2005-12-06 06:41:47 +00:00
547293ee49 Atlas: Vaguely usable object placement code. Bug fixes.
This was SVN commit r3186.
2005-12-02 21:08:10 +00:00
b417951ef8 (Oops, committed inconsistent code)
This was SVN commit r3164.
2005-11-20 00:52:41 +00:00
41ae0f9a44 Various hacks to make ScEd work. Should be removed once ScEd is no longer needed.
This was SVN commit r3162.
2005-11-20 00:41:45 +00:00
81eec3aa10 fix build breakage (baad!):
EventTypes.h: was missing comma. also insert onHeal string since that
array seems to depend on index values matching the enums (would be a
very insidious error!)
entity/entityorders: fix typo - ORDER_HEAL_NOTPATHING ->
ORDER_HEAL_NOPATHING
eventhandlers: was missing semicolon

This was SVN commit r3133.
2005-11-13 23:29:56 +00:00
pyrolink
9cf709ff5a Added entity heal capabilities/
This was SVN commit r3127.
2005-11-13 06:42:12 +00:00
d51f4900d8 Don't crash when units are hanging over the edge of the map
This was SVN commit r3119.
2005-11-08 22:52:55 +00:00
d64561d18d minimap: fix issue where changes to terrain might not be noticed
losmanager: only comment out timer_accrue

This was SVN commit r3105.
2005-11-06 04:22:47 +00:00
db67607f62 Patch vertex buffers are marked as dynamic now, since they're changed every
frame for LOD (in the long run, try splitting them into dynamic and
non-dynamic parts).
Also, using TIMER_ACCRUE in an inner loop isn't such a good idea ;)

This was SVN commit r3104.
2005-11-06 04:16:19 +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
82bdda29ef GameView: revise usage of LOS_VISIBLE - must check bit, not equality
ia32: removing misleading and outdated comment
Player: add "LOS token" - speeds up LosManager by caching a temp result
LOSMAnager: speed up by about 9%, more to come. combined 2 DWORDs into
one u16; further optimization pending. old code remains (via #ifdef
frankenstein)

This was SVN commit r3097.
2005-11-06 00:07:01 +00:00
139c48e733 Removed TickAll of entities, for performance
This was SVN commit r3095.
2005-11-05 23:10:54 +00:00
a1cddc4ac3 gameview, renderer: LoadWaterTextures is now a coroutine because it takes friggin forever (3 seconds). VFS performance is down by a factor of ten! investigating is on todo.
dyn_array.h -> allocators.h
ogl_tex: reenable performance warning
tex: comments
h_mgr: debug_printf if long filename is passed in (so we notice)
wsdl: squelch DestroyWindow warning. will look into the cause.
sysdep: slightly simplify "restrict" determination

This was SVN commit r2916.
2005-10-12 17:19:07 +00:00
3c2d38502c dyn_array: added matrix allocator for convenience. renamed to "allocators.cpp" (now contains several of them)
LOSMananager: uses matrix allocator; free them in dtor

This was SVN commit r2914.
2005-10-12 15:51:26 +00:00
1b59f4c56e Keep renderer in sync with simulation when running too slowly for the sim to keep up
This was SVN commit r2895.
2005-10-10 19:49:02 +00:00
faa6a78304 Added LOS setting to GameAttributes. Also fixed a small bug with LOS rendering (the patch's render data wasn't updated for LOS until the second frame after it became visible, displaying it in black for 1 frame).
This was SVN commit r2887.
2005-10-10 03:35:32 +00:00
c468eedbbb Sped up LOS rendering.
This was SVN commit r2880.
2005-10-09 08:14:42 +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
04650efe7a Lots of gcc -Wall fixes. The common ones:
- switch() statements don't handle all values in an enum
- missing \n at end of file
- non-virtual destructors in classes containing virtual functions
- order of initializers in constructor initializer lists
... some other stuff (signedness, nested comments, unused variables) as
well.

This was SVN commit r2864.
2005-10-07 15:24:29 +00:00
8529426fa8 Optimisation: Don't recalculate actor transform data for entities that haven't moved
This was SVN commit r2862.
2005-10-07 02:44:54 +00:00
2790981eae CVSROOT: doesn't seem particularly useful now
ObjectBase: removed support for old actor format
Various: reduced sometimes-unnecessary header inclusions
Atlas: slightly nicer tool and message systems

This was SVN commit r2816.
2005-09-30 00:59:42 +00:00
ee35659dc7 udbg fixes and a fix for the underscore problem in the assembler symbols
This was SVN commit r2765.
2005-09-26 05:38:40 +00:00
37e9fc0388 - update load times
- config: add proper HAVE_ macro for string_s functions rather than
checking MSC ver directly
- string_s: disable parts of the self-test that trigger errors if not
using the string_s.cpp implementation

This was SVN commit r2760.
2005-09-21 16:42:56 +00:00
603c475cf0 This was SVN commit r2749. 2005-09-18 06:28:23 +00:00