1
0
forked from 0ad/0ad
Commit Graph

80 Commits

Author SHA1 Message Date
a74fcdcb35 Durations over 1 hour aren't displayed correctly
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D44
refs #4418, #3350

This was SVN commit r19180.
2017-01-28 10:59:53 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
a3c3ca79cf Save the config file even it does not exist, patch by Vladislav Belov, fixes #4146
This was SVN commit r18960.
2016-11-18 18:06:01 +00:00
c92e74138a Use the local timezone when localizing UTC timestamps. Patch by Imarok, fixes #3350, refs #2938.
Thus show the correct time in the lobby, savegame and replay menu.

This was SVN commit r18725.
2016-09-15 13:16:48 +00:00
e7df8edc7d Mark method const.
This was SVN commit r18619.
2016-08-21 20:35:06 +00:00
7c21a0cf8e Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00
43f358563c when saving an option to file, write only that value and not all the content of the user configDB, refs #3737
This was SVN commit r17738.
2016-02-07 11:31:23 +00:00
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
540cf75794 L10n code cleanup.
This was SVN commit r16892.
2015-07-29 23:44:05 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
aeb18239c3 Update tinygettext to upstream commit ca0f3ff640. Refs #2522.
Keeps our addition of precompiled.h (fd3d335265), win32/dirent,
4c9d99ff68, de6823d23f, and 8fc14655b5.

This was SVN commit r16168.
2015-01-21 20:37:37 +00:00
a9c6b7080a Fixes intermittent error messages caused by uninitialized variable
This was SVN commit r16049.
2014-12-14 17:43:40 +00:00
eb8a6c9427 Explictly use GMT when displaying a localized time that is not a date. Patch by lafferjm. Fixes #2938.
Also make some parameters const references.

This was SVN commit r16037.
2014-12-12 01:11:00 +00:00
9407dbe45e Remove useless parameter from CFG_GET_VALUE.
This was SVN commit r15984.
2014-11-17 23:29:49 +00:00
e108b162b6 Add hotloading for translation files. Fixes #2915.
This was SVN commit r15947.
2014-11-09 16:58:14 +00:00
18ab827886 Change L10n code to use ps/Singleton, so that we can recreate it.
This allows for adding locales in mods.

This was SVN commit r15874.
2014-10-15 16:04:37 +00:00
c37a8cafc3 Fixes a few building warnings and convention issues from 19ca1e3ebf
This was SVN commit r15128.
2014-05-07 23:33:21 +00:00
19ca1e3ebf Fix locale verification to also allow ICU locales without data, but still don't allow bogus locales. Patch by Yves. Fixes #2533.
This was SVN commit r15122.
2014-05-07 08:14:57 +00:00
2b192a4fb5 Do not call Translate() on empty lines
Reported by Yves at Github:
https://github.com/leper/0ad/issues/11

This was SVN commit r15003.
2014-04-26 16:05:41 +00:00
8fea36cdd0 Made tinygettext’s debug output optional
You can now enable tinygettext’s output from the user.cfg file
(tinygettext.debug).
This enhancement also solved a warning due to the previous workaround,
which was
to uncomment the output line to avoid the debug messages.

This issue was reported by Yves at Github:
https://github.com/leper/0ad/issues/10

This was SVN commit r15002.
2014-04-26 15:32:18 +00:00
c82544be9f Use an early return in L10n::GetDictionaryLocale()
Suggested by l777 on the IRC.

This was SVN commit r14999.
2014-04-26 12:29:01 +00:00
d4f701d5f5 Remove MarkToTranslate from the JavaScript interface
The ‘l10n.js’ global JavaScript file already defines this function as
markForTranslation(),
and defines a context-aware twin function as well. Those two functions
are the only ones
currently used in the mod code (as it should be), and there are no
remaining calls to the
engine for that.

This was SVN commit r14998.
2014-04-26 12:26:04 +00:00
d6e37321d5 Removed an obsolete TODO comment in the L10n class implementation
This was SVN commit r14997.
2014-04-26 12:11:08 +00:00
fc793609eb Added API documentation to ‘source/i18n/’
This was SVN commit r14996.
2014-04-26 12:10:15 +00:00
9b9a96382c Fix boolean type
This was SVN commit r14971.
2014-04-22 12:52:49 +00:00
21362de6ac Add workaround for testing long strings with the separate po. ICU wouldn't accept a non-existing language.
This was SVN commit r14969.
2014-04-22 11:38:15 +00:00
d6db5a466d Internationalization of the C++ side
Provides the logic to detect the system language, load translations, and
use
loaded translations both in the C++ and the JavaScript side.

This patch includes code by Yves, sanderd17, leper, historic_bruno and
Gallaecio. It’s worth noting that Yves and historic_bruno were also the
main
contributors behind the changes in 1b3261b8f4 as well.

This was SVN commit r14953.
2014-04-20 20:03:57 +00:00
818ea52c3b Delete obsolete non-working i18n code
This was SVN commit r8527.
2010-11-03 17:52:07 +00:00
52851faeb6 cleanup - remove old cpu_memcpy and cpu_i64FromDouble that are no longer needed
This was SVN commit r8517.
2010-11-01 11:09:03 +00:00
1e40c8c776 MSVC warning fixes
This was SVN commit r7583.
2010-05-25 19:12:00 +00:00
e7e8b8dbc3 Fix spidermonkey-tip to build on Windows. Add precompiled binaries.
This was SVN commit r7365.
2010-03-19 20:28:22 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
da3030cfe6 more unicode/string cleanup:
- swprintf -> swprintf_s
- use secure_crt's _wfopen_s instead of conversion+fopen
- centralize all MBS <-> WCS conversion in new wchar.cpp (requires
workspace rebuild)
- remove no longer needed os_path
- remove unnecessary fs::wpath / VfsPath constructor casts
- fixed buffer size parameters -> ARRAY_SIZE

This was SVN commit r7162.
2009-11-03 22:27:25 +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
2001557224 Make jsval typedef match the bundled spidermonkey headers
This was SVN commit r7093.
2009-08-08 13:25:23 +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
Zyi
6822796a95 Simplified the logger:
- Removed the configurable interestingness from system.cfg.
- InterestingLog contains all warning and errors now.
- Modified and implemented methods in CLogger to write messages,
warnings and errors to the log.
- Modified a warning in CLocale so that the log wouldn't get spammed.

To do:
- Modify all of the logging statements in the source code.
- Remove the current preprocessor directives LOG_INFO, LOG_WARNING and
LOG_ERROR so that they can be used to log messages.

This was SVN commit r6817.
2009-04-11 22:53:33 +00:00
b51353ae0b Use NONCOPYABLE macro, to avoid ICC warnings
This was SVN commit r6589.
2009-01-03 18:40:28 +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
fbc3d22720 Use GCC's std::tr1::unordered_* classes instead of the now-deprecated __gnu_cxx::hash_* when possible
This was SVN commit r6250.
2008-07-19 00:20:54 +00:00
fe6370aff8 more dehydra. disabled lockfree module (not in use).
This was SVN commit r6240.
2008-07-17 17:00:00 +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
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
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00