Commit Graph

295 Commits

Author SHA1 Message Date
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
7d3d8fdbf3 # move ps/Network into top level project (and static lib).
This was SVN commit r4249.
2006-08-26 20:25:37 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
1034a980fe Added code for placement of socketted buildings.
This was SVN commit r4073.
2006-07-09 23:12:37 +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
2b0e5d0b42 # Added parameters to control water murkiness.
This was SVN commit r4013.
2006-06-22 21:11:18 +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
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
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
b8c131c431 # housekeeping
* zip.h removed old test symbols
* path_util fixed bug in mixed-separating-slash handling
* renamed ERR_OK to INFO_OK; allows searching for "return ERR_" to yield
all actual errors (instead of having to filter out ERR_OK)

This was SVN commit r3945.
2006-06-04 22:27:40 +00:00
4da75f049d Added resetGUI() JS function, to quickly reload the entire GUI (probably not very reliably)
This was SVN commit r3941.
2006-06-03 23:02:37 +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
2610dbdec6 undo inadvertent commit of timing scaffolding
This was SVN commit r3877.
2006-05-17 16:51:12 +00:00
e6be7e36d2 FILE_WRITE_TO_MOD is now FILE_WRITE_TO_TARGET
ERR_(FILE|PATH)_NOT_FOUND -> ERR_TNODE_NOT_FOUND, ERR_NOT_(FILE|DIR) ->
ERR_TNODE_WRONG TYPE
path_util:
- path_append: bugfix (no more extraneous /); add support for appending
slash
- path_replace: bugfix (no more warnings for expected error)
- add path_last_component, path_foreach_component
- move some defs to the header that belong there from vfs.h/path.h

file: add dir_create; move PosixFile definition here and provide
accessor for fileio
vfs: no longer automatically append slash; instead, make sure caller
does
vfs_mount:
- mount_realpath: bugfix (strip trailing /), interface improvement
- document write_target; clarify MULTIPLE_MOUNTINGS; add support for
creating real dirs
vfs_tree:
- refactor TDir::add into find, add, find_and_add
- fix TDir and TNode for dir-ends-with-slash requirement
- split up lookup into lookup_cb and path_foreach_component
- add support for inserting dirs with given mount point: tree_add_path
(needed when mounting)

wposix: get rid of weird PATH_MAX = 260 (Win32 weirdness)


TextureManager: remove no longer needed SupportedTextureFormats
GameSetup, Xeromyces: setup XMB location to data/cache/mods/official/xmb
Util: HardcodedErrorString now uses error_description_r
VFSUtil, i18n: fixes for dir slash issue

Closes #79, #80

This was SVN commit r3874.
2006-05-17 14:48:18 +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
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
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
fd08924348 # VC2005, GCC compatibility
Used new library include paths.
Renamed ia32.asm to ia32_asm.asm, so we don't need Premake modifications
to avoid object-file conflicts with ia32.cpp.

This was SVN commit r3784.
2006-04-20 01:33:57 +00:00
c81df59294 # Include headers for compilation without PCH
This was SVN commit r3774.
2006-04-19 05:30:02 +00:00
6eac18d9fe # housekeeping (improve unreachable code annotations and avoid compiler warnings)
adts: use SAFE_FREE
config: add CONFIG_FINAL; use it in
compression,vfs_optimizer,scriptablecomplex
lib: add discussion of unreachable code avoidance; revise UNREACHABLE
and add NODEFAULT
ogl_tex, tex_dds: remove some unnecessary UNREACHABLE
sysdep: move compiler-specific implementation of UNREACHABLE here.
use NODEFAULT in snd, wdbg, wposix, wsdl

This was SVN commit r3739.
2006-04-10 06:44:54 +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
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
0fd85b76db automatic archive builder now functional and enabled.
- allocators.cpp: fix: make sure all pool fields are reset in
pool_free_all; correct matrix self-test
- lib: fix self-test
- lib_error: give "informational" return codes values > 100 (allows
multiplexing with percent indicator)
- archive: add clarification to afile_enum; use vfs_load when building
archive (fixes caching problem); add support for progressive archive
creation
- file: allow pp_set_dir's path to end in slash (simplifies other code);
add file_exists
- file_cache: add stats+sanity checks to allocator; improve ExtantBufMgr
find(); add ExactBufOracle to translate padded address returned by Cache
to what was actually allocated; relax infinite-loop check; fix
file_cache_reset
- file_io: refactor callback logic so it can be used by vfs (needed for
vfs_load)
- vfs: vfs_load now supports calling back (required for archive builder)
- vfs_mount: optimize path caching in afile_cb: due to atom_fn system,
string compare can be done via pointer compare
- vfs_optimizer: support auto-build of archive (progressive); improve
should-build-archive check (WIP)
- vfs_path: add util functions (also used in screenshot code)
- vfs_tree: simplify pathname storage
- wposix: mmap bugfix
- main: call progressive archive builder; skip reload when doing so
(documented)
- JSInterface_VFS+scriptglue: add archiveBuilderCancel
- ps/Util: use new vfs_path helper function for cleverer screenshot
naming (correctly handles some being deleted)

This was SVN commit r3578.
2006-03-01 22:31:11 +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
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
36fa5ec2bf * clean up CLightEnv a bit
* add CLightEnv::m_TerrainShadowTransparency
* shadows will let a fraction of diffuse light through
* added JS LightEnv objects, so the lighting environment can be changed
  from the console
* new element TerrainShadowTransparency supported in the scenario .xml
format,
  changed cantabrian_generated with an example

This was SVN commit r3513.
2006-02-15 00:45:16 +00:00
pyrolink
b3a5c6f8af This was SVN commit r3506. 2006-02-13 03:31:45 +00:00
fcfa746244 Linux compat changes, fix for (really old) bug in VertexBufferManager shutdown, GUI header reorganization for gcc 4.0
This was SVN commit r3437.
2006-01-29 18:23:47 +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
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
01f5a963a0 notification event
This was SVN commit r3338.
2006-01-08 05:57:40 +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
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
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
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
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
0e40dfc480 file: add note on pp_set_dir
CLogger: fix log file opening (now uses VFS path correctly)
ScriptingHost: fix error reporter - no longer does redundant write to
console

This was SVN commit r3246.
2005-12-14 18:32:02 +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
2ddf20374c entity healing
This was SVN commit r3128.
2005-11-13 06:42:33 +00:00
78f9dbb6f1 Fix various warnings (both implicit conversions and real bugs).
This was SVN commit r3110.
2005-11-06 17:58:47 +00:00
e3b0f20d4e change requested by philip: debug_printf "tags" are now followed by '|' instead of ':' because something like "func: i am blowing up" is rather common.
This was SVN commit r3035.
2005-10-27 16:53:41 +00:00
7362d746d5 Function property Getter/Setters now take a JSContext parameter.
This was SVN commit r2996.
2005-10-24 02:32:44 +00:00
2ef8a7b630 Sped up minimap rendering by having a separate LOS texture and recomputing only that per frame. To force a recompute of the terrain texture, set g_TerrainModified to true sometime before the render step of each frame (it is set back to false at the end of the frame).
This was SVN commit r2963.
2005-10-19 03:02:51 +00:00
6efb1e1c00 Single pass player color rendering.
Falls back to a simpler formula when only 2 TMUs are available.
CRenderer is now a JS object called "renderer" for scripting.

This was SVN commit r2891.
2005-10-10 14:15:28 +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
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
8e31f44249 This is what the explicit "this->" before accesses of members of a
template base class needs to look like. More will surely follow.

This was SVN commit r2772.
2005-09-26 23:37:37 +00:00
603c475cf0 This was SVN commit r2749. 2005-09-18 06:28:23 +00:00
e5dea3e5a1 Water source code :|.
This was SVN commit r2746.
2005-09-18 03:47:15 +00:00
1a7d67a97f dyn_array: efficient expandable array that doesn't waste mem or relocate itself. TODO: self test and dox
file: expose block size constant; always round user transfers up
tex: transform() now receives what to change, not what to achieve.
tex*: encoding works with DynArray+VFS backend
GameSetup: free g_BuildingPlacer to avoid mem leak.
fixed some warnings+bugs.

This was SVN commit r2679.
2005-09-06 22:44:48 +00:00
1af9aa074e Added initial version of building placement cursor, which can be shown with the startPlacing(templateName) JS function.
Also activated depth test for selection outlines so they don't overlap
units.

This was SVN commit r2667.
2005-09-05 19:48:28 +00:00
dc027002c0 host of changes to accommodate Atlas:
- input.cpp allows feeding in events from the outside (will be used by
main.cpp and Atlas msg loop)
- most of main.cpp split into ps/GameSetup.*
- main.cpp is now a "controller" that drives the game via SDL events
(Atlas is another such controller that can override main.cpp). it calls
GameSetup functions to set up and processes messages.
- add functions to import AtlasUI.dll automatically

also, the usual refactoring ;)

This was SVN commit r2622.
2005-08-14 23:34:37 +00:00
3552c54bdc Made ToPrimitive throw on failure (since that is preferable to returning an undefined value)
This was SVN commit r2613.
2005-08-13 18:32:58 +00:00
4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00
b63bc42245 TextureManager: stopped memory leaks
wsdl: create window at expected size, and retrieve correct mouse coords
CStr: not ISerializable (=> not virtual)
Game: less excessive complaining, since the original problem seems to be
fixed
Entity: fixed evaluation order
Others: minor comments/etc

This was SVN commit r2591.
2005-08-09 21:26:40 +00:00
52ebd6ba11 scripting-interface improvements
- strict param count checks
- use ScriptingHost::RunMemScript instead of copy+pasted code
- replace duplicated parameter access code with macros

StringBuffer: use pointer instead of reference to allow
compiler-generated copy ctor
singleton: fix whitespace

This was SVN commit r2586.
2005-08-09 16:02:15 +00:00
a69ac0dee9 - fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
2005-08-09 15:55:44 +00:00
4b6a19cdfb better error reporter, use consistent exceptions if init fails, add notes which functions are currently unused
This was SVN commit r2515.
2005-07-22 18:41:49 +00:00
533eb66ea7 add dox
This was SVN commit r2513.
2005-07-22 03:56:11 +00:00
f715e6c226 ScriptableComplex.h: ScriptingHost already includes SpiderMonkey.h
scriptglue: additional refactoring
scriptinghost: remove useless GC function
SpiderMonkey.h: more dox

This was SVN commit r2497.
2005-07-20 04:53:58 +00:00
67777bd159 cursor: remove old Win32 implementation
main: add new variable for clarity

scriptglue: massive refactor. added docs, rearranged into groups,
eliminate forward decls, consistent param checking, some progress on
consistent naming and formatting.

This was SVN commit r2492.
2005-07-20 00:57:17 +00:00
2ea40a23a3 VS2005 compatibility fixes and warning adjustments:
Updated DLLs.
Added DirectX headers/libraries, since they're not in the platform SDK.
Fixed invalid STL iterator usage.
Disabled STL in stack trace, since it breaks.
Added comments for some reported warnings.
Corrected some apparent off-by-one errors.
Defined strlen_s to strnlen.
Probably broke pre-beta2 versions of VC2005.

This was SVN commit r2454.
2005-07-02 21:42:55 +00:00
ec6b78b252 rename assert2 debug_assert; use instead of all plain assert(), since there are no longer any issues (e.g. can't use while handling an exception)
This was SVN commit r2447.
2005-06-28 04:06:25 +00:00
f3951fbfae all JS-dependent code now includes scripting/SpiderMonkey.h instead of <js*.h> directly - see rationale in that header.
singleton: removed unnecessary headers

This was SVN commit r2425.
2005-06-22 02:23:46 +00:00
b657a1cbca Added CStr and some other things to precompiled.h, to reduce build times.
Altered CStr/UniDoubler's macros, to avoid polluting/conflicting/etc.
Fixed headers in non-PCH builds.
Used the _d version of vorbisfile*.lib in Debug builds.

This was SVN commit r2366.
2005-06-01 20:12:45 +00:00
0331883a86 Temporary fix for mouse input. Improved performance in player-colour model renderer. Also improved performance in lighting, at least in unoptimised builds.
This was SVN commit r2328.
2005-05-20 17:09:47 +00:00
d0f7cb015c - Linux/GCC (as usual :P)
- Ported lockless code to gcc inline assembly
- A few new net messages (gather, attack, add waypoint)
- Support for new messages in network->entity order converter
- Implemented rudimentary JS interface for Interaction
- issueCommand JS API, connected to the network
- Removed Interaction stuff now replaced by JS
- And something in there should probably break VS builds :P

This was SVN commit r2316.
2005-05-18 05:32:09 +00:00
fd4eb91e93 debug_out -> debug_printf; MICROLOG moved to ps/Pyrogenesis.h
This was SVN commit r2285.
2005-05-11 18:56:30 +00:00
MarkT
86dc351205 Projectile code and updates to some actors that can use it (celt_ijv and hele_iar)
This was SVN commit r2266.
2005-05-10 07:13:25 +00:00
5037da70d0 Fixed memory leak, I think.
This was SVN commit r2261.
2005-05-09 04:52:55 +00:00
MarkT
c8cd52578a Put the extra animation event in the struct def, also adding Jan's VFS script wrapper.
This was SVN commit r2218.
2005-05-03 04:27:07 +00:00
MarkT
db168702df Jason's animation events. Also reworked entity-types system.
This was SVN commit r2209.
2005-05-01 19:09:13 +00:00
MarkT
899cf87b41 This was SVN commit r2159. 2005-04-22 19:14:50 +00:00
MarkT
bcabe3aa53 Script integration work - valueOf() is no longer required most of the time; also property-change watches and enumeration over entities (but not yet other native objects), rudimentary beginnings of a global events system, and adjusted the status orb to update only on changes.
This was SVN commit r2157.
2005-04-22 07:12:55 +00:00
MarkT
2120576bc7 Gathering and unit training (engine-side); also other minor improvements
This was SVN commit r2132.
2005-04-15 04:23:33 +00:00
0eb78450c0 Maybe fixed GUI event-handler function things. Other minor changes and fixes.
This was SVN commit r2096.
2005-03-30 22:33:10 +00:00
MarkT
bb7a22f32a First draft of a GPG3-style profiler (including tracing into scripts, after a fashion)
This was SVN commit r2090.
2005-03-30 16:14:19 +00:00
22dd4dd67b Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual
editing. Updated existing maps to newest format, so that they can still
work. Added undocumented _rewriteMaps() JS function. Also renamed _mem
to vmem, and reclassified its undocumentedness as unintentional, since
it's reasonably useful.
Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc
which don't care about progressiveness.
main.cpp: re-enabled vfs_display, since it doesn't crash now
Vector3D: stopped warning

This was SVN commit r2078.
2005-03-29 20:50:04 +00:00
MarkT
3c99f0f2eb Minor JavaScript updates
This was SVN commit r2073.
2005-03-28 22:13:47 +00:00
79da4bf050 On-demand loading of actors (sort of)
This was SVN commit r2017.
2005-03-19 11:55:27 +00:00
7bcc12373b - Created JSMap
- Changed player colour JS interface: setColour(...) instead of a colour
property
- Introduced a network log and replaced most network LOG() calls with
NET_LOG()
- Moved to a slot-based system for Pre-Game and extended a lot of the JS
APIs to networking stuff
- A bit of cleanup in the low-level network code (Unix parts)
- Clients now keep track of all other connected clients on the server
(And exposes this info to JS)
- Split out GameAttributes to its own file
- Removed unused class AttributeMap
- Changed CJSObject to use T* pointers in JS_SetPrivate (needed to make
ToScript work with multiple inheritance)

This was SVN commit r1929.
2005-02-21 17:13:31 +00:00
880634b598 Small changes to ScEd, to remove some hacky bits and to make it not crash with player-colours
This was SVN commit r1899.
2005-02-04 23:16:42 +00:00
aca9ce6c3c MiniMap GCC and crash bug fix as well as some miscellany
This was SVN commit r1896.
2005-02-02 17:03:37 +00:00
bcf89936c1 Fixed a few memory leaks as well as the CPlayer/SColour crash-on-exit bug
This was SVN commit r1756.
2005-01-23 01:36:47 +00:00
ae38aee3d2 Revamped CNetClient/CNetServer JS Interface and new CGameAttributes
implementation (moving towards a merger of CGameAttribs into CGame).

This was SVN commit r1746.
2005-01-19 22:32:25 +00:00
MarkT
1b961ec163 This was SVN commit r1737. 2005-01-18 10:52:22 +00:00
MarkT
25fdbfd931 Fixes for two pathfinding bugs (neither of which were actually pathfinding bugs), added player objects (details in TM)
This was SVN commit r1733.
2005-01-18 00:46:18 +00:00
2077698156 New JavaScript interface for the network client, plus some linux/gcc/misc fixes
This was SVN commit r1730.
2005-01-17 04:52:02 +00:00
551bef482a Prevented crash when loading non-existent maps
This was SVN commit r1721.
2005-01-15 17:20:51 +00:00
75c714b8df Made ScEd compile more pleasantly
This was SVN commit r1700.
2005-01-10 22:13:18 +00:00
f7e82dbc16 add ps/Errors.h and/or lib/types.h headers (shouldn't rely on precompiled.h to pull those in).
also prepended ps/ to make location clear.

This was SVN commit r1652.
2005-01-07 00:47:44 +00:00
cff12c4127 Extremely important whitespace fix
This was SVN commit r1623.
2005-01-03 20:34:38 +00:00
28c7a682b8 Fixed annoying crash when SpiderMonkey's GC ran.
Minor tooltip updates.

This was SVN commit r1542.
2004-12-21 18:41:58 +00:00
659a9ea57a Initial (incomplete) tooltip code
This was SVN commit r1540.
2004-12-21 13:37:24 +00:00
46f5c61179 Linux/GCC/glibc Compat
This was SVN commit r1532.
2004-12-18 23:30:28 +00:00
MarkT
da4c42ef58 Fix for misinterpretation of data types in XML
This was SVN commit r1512.
2004-12-16 09:41:41 +00:00
32854fc162 JS scripts are now loaded via VFS, as per "JS optimization" email from stu.
This was SVN commit r1502.
2004-12-15 14:23:27 +00:00
bc0c59b084 as per "JS Optimisation?" email from stu, updated to use VFS.
This was SVN commit r1500.
2004-12-14 17:58:37 +00:00
6d7d049d89 Attempted to minimise dependencies between header files (to make compilation minorly faster)
This was SVN commit r1490.
2004-12-12 19:43:55 +00:00
8d20cfefdb remove cout << "initialized"
This was SVN commit r1463.
2004-12-07 01:08:56 +00:00
4d83cba7e6 add required precompiled header include
This was SVN commit r1431.
2004-12-01 06:52:39 +00:00
MarkT
f930bf1df4 Added semi-intelligent text parser for XMLs - so that numeric properties on entities are no longer stored as strings instead.
This was SVN commit r1409.
2004-11-27 20:02:51 +00:00
30ad195c0b Linux/GCC Compat
This was SVN commit r1393.
2004-11-23 23:56:10 +00:00
cda100e72d fix warning: cast -1 to uint
This was SVN commit r1353.
2004-11-18 20:56:45 +00:00
df2e7f1b08 fix warning: add typecast to JSVAL_NULL
This was SVN commit r1352.
2004-11-18 20:56:13 +00:00
MarkT
d30e10042f Minor changes to sound-script interface.
This was SVN commit r1332.
2004-11-15 22:30:01 +00:00
MarkT
793794649f Combat code, some scripting, broken network, and fixed some bugs.
This was SVN commit r1301.
2004-11-11 07:09:32 +00:00
3136791492 Linux/GCC Compat(tm)
This was SVN commit r1284.
2004-11-07 21:30:47 +00:00
MarkT
d33d2e4450 Added some support for user profiles
This was SVN commit r1270.
2004-10-23 14:39:28 +00:00
6b084c3173 Fixes to comply with VC2005.
This was SVN commit r1229.
2004-10-07 22:03:12 +00:00
MarkT
2ab625720b Fairly major XML/entprop changes; some more minor stuff that fell out as a consequence.
This was SVN commit r1220.
2004-10-07 19:23:35 +00:00
9c2fb5a466 stomped on vc2k5 warning (size_t -> uint)
This was SVN commit r1191.
2004-09-22 18:14:00 +00:00
df1b502bbd Linux Compat and some updated PARANOIA code
This was SVN commit r1189.
2004-09-22 15:20:58 +00:00
eb2989176e startGame() shouldn't crash and burn if the game's already been started
This was SVN commit r1181.
2004-09-21 16:10:46 +00:00
777f06143d - A lot of small network fixes
- Connecting client(s) to a server and giving orders to a shared set of
entities now works - Yeah!
- Removed thread sync from CNetServer

This was SVN commit r1180.
2004-09-21 14:40:43 +00:00
3a3a5b6c34 Added getFPS(), so the GUI can draw the FPS counter. Also added getLanguageID(), so it knows what language it's using
This was SVN commit r1122.
2004-09-05 11:28:59 +00:00