1
0
forked from 0ad/0ad
Commit Graph

165 Commits

Author SHA1 Message Date
19dbbb816d Changed all references from old CLogger API to use the new API. Removed old API. Fixes #247
This was SVN commit r8791.
2010-12-05 08:41:55 +00:00
64bd264fc0 Attempt to fix GUI script interaction with JITs.
Simplify some other GUI script interface code.

This was SVN commit r8657.
2010-11-20 00:45:58 +00:00
bd3bd084c0 Support new SpiderMonkey API.
wposix: Define int8_t compatibly with SpiderMonkey.
Remove unused camera, lightenv JS interfaces.
Remove most of vector JS interface.
Remove some of the redundant JS string conversion functions.
Remove unneeded vmem, _lodBias functions.
Clean up some formatting.

This was SVN commit r8629.
2010-11-16 23:00:52 +00:00
293e5e33ec Changed GUI mouse event handling so that button events use the mouse position at the time of the button state change. Fixed minimap message handling to respect out-of-order events. Fixes #669
This was SVN commit r8610.
2010-11-14 22:47:39 +00:00
9e499cdec5 # Fix hotkey bugs.
Simplify hotkey system to use strings consistently.
Restrict scope of GUI hotkey bindings to the associated page.
Avoid hard-coding list of hotkeys.
Clean up the code a little bit and fix some bugs.
Remove unused "!" prefix for key negation.
Fixes #567.

This was SVN commit r8444.
2010-10-23 02:37:00 +00:00
a9b11b780e Fix right clicks passing through GUI objects and triggering unit commands.
Fix cursor displaying unit commands when over a GUI object.

This was SVN commit r8020.
2010-08-21 23:58:08 +00:00
2deac598eb Remove focus from chat box after sending message
This was SVN commit r7931.
2010-08-13 13:50:03 +00:00
9674c3c0fe Remove ScriptingHost initialisation code (share with ScriptInterface instead).
Fix GUI scripts to avoid strict warnings.
Rejig GUI/SpiderMonkey interface to use less custom code, and to work
with JSOPTION_VAROBJFIX.
Add event name to GUI event handler function names (visible in the
profiler).

This was SVN commit r7769.
2010-07-19 23:01:58 +00:00
d2cf6ceb88 less global variables: make most uses of g_VFS explicit (required for another app that has two VFSes), g_yres is no longer required by cursor module
This was SVN commit r7686.
2010-07-04 10:15:53 +00:00
4ff8d8742c Partially support Unicode strings in GUI XML files
This was SVN commit r7594.
2010-05-30 13:11:32 +00:00
fe53bce3b1 Rewrite the clone-object-between-JS-contexts code (for GUI<->simulation interface) to be more efficient.
Delete unnecessary unused incomplete profiler scripting support.
Clean up some JSAPI code to use newer features.
Display simulation script functions in the profiler.

This was SVN commit r7503.
2010-05-05 22:36:35 +00:00
a7484933e7 wchar.h -> utf8.h (see previous change)
This was SVN commit r7341.
2010-03-01 14:55:34 +00:00
633705c832 Support <repeat> in the GUI XML files, as a primitive mechanism to simplify the definition of repetitive structures (like lists of buttons)
This was SVN commit r7336.
2010-02-28 21:36:25 +00:00
953fb41c82 # Basic in-game building placement with new simulation system
This was SVN commit r7285.
2010-01-24 17:24:35 +00:00
f0d9806b3f # Restructured GUI implementation
CGUI now represents a single 'page'. CGUIManager maintains multiple
pages and switches between them.
Split the XML files into pregame, loading, session and messagebox pages.
Added hotloading of GUI pages.
Minor GUI cleanups.
(Merge from hg 81862d33780c)

This was SVN commit r7214.
2009-12-03 20:17:22 +00:00
ff15c522fe implement changes suggested by Philip:
- add self-test
- allow decoding UTF8 values beyond BMP (and replace them later)
- quietly replace invalid bytes

This was SVN commit r7187.
2009-11-09 20:53:48 +00:00
450da0aaf7 rename [w]string_to_[w]string UTF8
add safer/more portable/less dependent on locale implementation of
wchar_t <-> UTF8

This was SVN commit r7185.
2009-11-09 14:52:51 +00:00
f432d9d18b fix dehydra warnings (some of which were dangerous pass-user-string-as-format-string vulnerabilities)
This was SVN commit r7177.
2009-11-07 09:32:19 +00:00
3334c83ce0 Fix build and tests on Linux
This was SVN commit r7174.
2009-11-06 18:35:32 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
92637c1041 refactoring all PS_RESULT in GUI to PSRETURN/PSERROR
closes #128

This was SVN commit r7147.
2009-09-27 15:04:46 +00:00
cd6a926c14 Fix #293 (Lots of printf format string errors), based on patch from Cygal
This was SVN commit r7113.
2009-08-14 18:42:39 +00:00
008d894dd7 Fix some GCC warnings
This was SVN commit r7048.
2009-07-28 16:59:19 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
2bc48fc1e7 Stop relying on XML default values from DTDs
This was SVN commit r6767.
2009-03-23 21:35:26 +00:00
2624069993 replace most BIT macros with a Bit() template for better 64-bit safety
test_bits: add tests for all routines in bits.h
hpet: add safety check
unit.h, bits.h, DOMEvent.h: change T(~0) to ~T(0) (required when T is
64-bit)

This was SVN commit r6335.
2008-09-06 21:15:53 +00:00
4027a8f11b dehydra-inspired fix: get rid of all using namespace std (potentially confusing / pollutes namespace).
Long iterator type names are better expressed via typedefs, anyway :)
(or 'auto' keyword of upcoming C++09)

This was SVN commit r6226.
2008-07-13 21:22:03 +00:00
a859562ea7 improvements and fixes:
- properly differentiate between buffer/offset alignment and length
alignment (relevant since block size has been increased to 256k)
- use VfsPath for most game paths instead of CStr
- clean up timer interface and implementation
- self-tests no longer crash
- file_cache.cpp: fix for the case where allocation fails (prevent
deleter from seeing a null pointer)
- allocators: move all shared_ptr-related stuff to its own component;
add DummySharedPtr
- codec: disable checksums (important for performance at work)
- File: made into an interface class to avoid export problems. not
entirely sure about this..
- vfs_path.h, path.h, os_path.h: proper fix for using
fs::change_extension and similar utility functions with derivatives of
basic_path
- lib_api: automatically link against import lib if building lib/ as a
DLL
- path_util: remove unused functions (this component is deprecated)
- compiler.h: add INLINE
- Xeromyces.cpp: pass PIVFS so that GetXMBPath works in self-test
(should do this mostly everywhere rather than have one singleton g_VFS)

This was SVN commit r5537.
2008-01-07 20:03:19 +00:00
5529977ecd fix: CLogger's ELogMethod is now inside the class and does not use names that are vulnerable to macro destruction (fixes a conflict with Windows system header's #define ERROR)
This was SVN commit r5532.
2007-12-29 16:22:23 +00:00
e2eb5b2610 part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former
into the newly created latter component. removed VFSUtil entirely (that
functionality is available from lib/file/file_system_util.h)

Xeromyces.cpp: simplify buffer handling since smart pointers are now in
play. also use WriteBuffer instead of membuffer.

This was SVN commit r5519.
2007-12-20 20:21:45 +00:00
73884c1f09 Console: changed things so declaring variables while an entity is selected will no longer define a new property in that entity. Kind of broke the ability to access properties of the selected object without typing selection[0], due to other bugs.
ScriptableComplex: added evil hack so iteration through properties works
with the new SpiderMonkey, which fixes the GUI scripts.

This was SVN commit r5185.
2007-06-16 22:07:40 +00:00
5664f097d9 Profiler: Added malloc-counting to GCC. Fixed counting of unlogged allocations in the root node.
GUI: Tried a tiny bit to improve the response to mouse movement.
Atlas: Realised you can do "new XML(...)" to parse XML.

This was SVN commit r5180.
2007-06-15 17:03:26 +00:00
a34b759720 . split up lib.h/.cpp, include the remnants from PCH, remove (pretty much universal) include of it.
. timer, config: fix definition of ALLOW_RDTSC
. add movsx_be64 (for whirlpool), revise implementation, move to
byte_order, add test
. MAX -> std::max, remove those macros
. add timestamp to system_info as requested by philip

This was SVN commit r5050.
2007-05-09 21:01:11 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +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
5a427440d0 #SwEng
fpclassify fix
EntityManager: rename getExtant -> GetExtantAsHandles, fix its
implementation+call site to avoid dynamic alloc/auto ptr, rename extant
-> IsExtant
vsnprintf2 -> sys_vsnprintf. remove printf.h (function is declared in
sysdep header)
use SUS/posix-ish strcasecmp instead of defining that to the
windows-only stricmp
add cppdoc for ia32/cpu

This was SVN commit r5011.
2007-04-30 19:58:04 +00:00
be3f3bdbfb # SwEng / MacOSX compat
further cleanup to sysdep.h: avoid pulling in win and ia32; split header
up into stl, compiler, and the actual sys_* API. (all but the latter are
in PCH).

timer: also avoid dragging in ia32
win: move snprintf fix to posix.h
cpu: simplify reasoning about cores, now given as logicalPerCore (not
package)
vfs_optimizer: fix if archive building is partially disabled

This was SVN commit r5008.
2007-04-30 14:35:19 +00:00
8d0a7170f6 # Slightly tidied up string code.
CStr: Indented comments more consistently. Made some parameters
pass-by-reference, made some others not. Removed some useless methods -
Length (use length or empty), GetSubstring (use substr), LCase/UCase
(use LowerCase/UpperCase). Removed operator[] bounds-checking because
VS2005 does that anyway.
Maybe fixed noncopyable warnings on VS2003.

This was SVN commit r4828.
2007-02-01 14:46:14 +00:00
a265a441fd # Fixed string handling for Windows/Linux compatibility.
* vsnprintf2: Made compatible between GCC and MSVC - it now always
null-terminates the buffer, and returns -1 on overflow. Fixes #158.
Added tests.
 * MeshManager: Use shared_ptr.expired() instead of checking for
bad_weak_ptr exception.
 * Xeromyces: Added tests for GetXMBPath, because it does unusual things
in sscanf which MSVC's /analyze complains about.
 * ConfigDB, ScriptGlue: Replaced some asserts with return-on-failure,
to avoid invalid array accesses when continuing after the assert (as
complained about by /analyze).
 * CStr: Removed "using namespace std". Added tests for handling of
invalid UTF-8.

This was SVN commit r4625.
2006-11-07 21:03:13 +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
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
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
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
68d4d6cd77 # Removed some ancient unused code
This was SVN commit r3758.
2006-04-13 21:50:44 +00:00
dda6268466 - cgui: now convert EventName to lowercase in SendEventToAll
- compression: now use "fastest" compression mode and more memory unless
in FINAL build. this greatly speeds up archive generation at expense of
1.5% size increase (fine during development). done because profiling
shows ZLib accounts for 78% of CPU; practically nothing else shows up,
which shows effectiveness of compressing in parallel with reading from
disk.

- file_cache: documented; fixed several potential issues with exact_buf
when invalidating files.

This was SVN commit r3586.
2006-03-03 06:03:16 +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
pyrolink
230b7a896c Right click/double click support in main GUI handler, minimap updates-drag and order issuing
This was SVN commit r3381.
2006-01-21 11:07:25 +00:00
6af5888866 replace g_active with more clear g_app_has_focus and g_app_minimized
reinstate g_keys - realized that atlas mode cannot call SDL_GetKeyState
main: use g_app_minimized etc. to use up less CPU time when app isn't
active (makes debugging more bearable)

This was SVN commit r3070.
2005-10-31 18:36:36 +00:00
8c76dc34af g_keys[] has been made redundant by SDL's key array; use SDL_GetKeyState instead to get address of new keys array
fix W4 warnings (unused param and type conversion mostly)

This was SVN commit r3068.
2005-10-31 16:26:51 +00:00