1
0
forked from 0ad/0ad
Commit Graph

32 Commits

Author SHA1 Message Date
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
5228800b73 # Fixed Linux build
Use noncopyable instead of boost::noncopyable. (But maybe this should be
changed to the NONCOPYABLE macro instead?)
Use boost::filesystem::wpath::file_string instead of
external_file_string, since the latter varies between std::string on
Linux and std::wstring on Windows.
Use wcstombs instead of wcstombs_s.
Use rtl_AllocateAligned instead of _mm_malloc.

This was SVN commit r6574.
2009-01-02 21:19:41 +00:00
aebe9a7936 Added active field to players to check whether the player is a human or CPU.
This was SVN commit r6267.
2008-07-23 05:21:57 +00:00
6eb29f76d3 Already existed as a property.
This was SVN commit r6256.
2008-07-19 02:43:35 +00:00
afae8e6c7d Adding the getName() method to be used from JS scripts.
This was SVN commit r6248.
2008-07-18 23:55:13 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
fba692c8b5 # Fixed some warnings and potentially misleading code
* Removed ToJSVal<jsval> because it's treated as ToJSVal<long> and
causes minor confusion and/or compiler errors.
   Changed script interface functions to return either C++ types or a
jsval_t wrapper.
 * Replaced some C casts with static_cast to avoid significant confusion
and to cause compiler errors instead.
 * Removed some redundant argument-checking code. Simplified some
string-generating code.
 * Fixed some "dereferencing type-punned pointer will break
strict-aliasing rules" warnings (from `g++ -O3`).

This was SVN commit r5115.
2007-05-29 19:01:21 +00:00
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
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
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
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
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
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
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
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
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
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
7362d746d5 Function property Getter/Setters now take a JSContext parameter.
This was SVN commit r2996.
2005-10-24 02:32:44 +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
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
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
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
da5816e971 Re-enabled VC's memory debugging by default (when not using USE_MMGR). Hopefully fixed the resulting memory leaks. Also fixed incompatibilities with VC2005.
This was SVN commit r1950.
2005-02-27 22:11:26 +00:00
85a95e3e41 Fixed warnings. Made invalid-player-ID complaint less annoying.
This was SVN commit r1930.
2005-02-21 19:49:20 +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
4ed4a7e16d Fix for the crash when a client connects, as well as some minor additions to client/server code
This was SVN commit r1861.
2005-01-29 16:51:13 +00:00
NoMonkey
02cc4d9c8e This was SVN commit r1793. 2005-01-23 22:21:37 +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
6b64327a19 This was SVN commit r1734. 2005-01-18 10:48:51 +00:00
4d9c7684df w00t! first batch of actual network support!
This was SVN commit r1006.
2004-08-16 15:19:17 +00:00