1
1
forked from 0ad/0ad
Commit Graph

109 Commits

Author SHA1 Message Date
92f94e25c6 Adds ortho projection type and its test.
This was SVN commit r25073.
2021-03-17 23:03:35 +00:00
f175bc4f8d Fixes big screenshots with water (reflection or refraction camera), adds big screenshot customization.
Commented By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3557
This was SVN commit r24891.
2021-02-12 21:20:07 +00:00
205486d6f3 Fix sound errors when no sound card is detected.
Based on a patch by: @Imarok
Refs: #3285

Differential Revision: https://code.wildfiregames.com/D1481
This was SVN commit r24551.
2021-01-11 18:56:33 +00:00
dd0b56c8aa Replace DISCARD macro with ignore_result template.
Fixes eb7940b418.
As reported by Vladislav, there is possibly confusion on what exactly is
being ignored when there are multiple statements after DISCARD. Explicit
wrapping avoids that.

Differential Revision: https://code.wildfiregames.com/D3206
This was SVN commit r24397.
2020-12-15 09:03:44 +00:00
ea38089853 Fix userreport detection of sound cards
Differential Revision: https://code.wildfiregames.com/D3025
This was SVN commit r24367.
2020-12-10 18:36:05 +00:00
eb7940b418 Silence warnings about unused result.
Introduce a DISCARD macro to ignore the warn_unused_result attribute
used by Spidermonkey, and reuse it elsewhere.

Differential Revision: https://code.wildfiregames.com/D3147
This was SVN commit r24261.
2020-11-26 13:58:59 +00:00
1273307b58 Don't detect audio card when audio is disabled, Fix compilation with --without-audio, fix a few warnings.
Reviewed by: @bb
Comments by: @vladislavbelov, @wraitii
Differential Revision: https://code.wildfiregames.com/D2809
This was SVN commit r24079.
2020-10-02 07:35:59 +00:00
8abc7c051b Include Pyrogenesis.h and os_path.h where needed
These two headers were missing in various places, preventing build in
some cases.

Patch By: linkmauve
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2481
This was SVN commit r23321.
2020-01-02 18:07:40 +00:00
d7ea078583 Removes unused variables after 7f38bef8e1 and 75d9c6293b. Reported by elexis.
This was SVN commit r23046.
2019-10-04 22:06:52 +00:00
75d9c6293b Adds projection type to CCamera to control usages of projection dependent properties.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2351
This was SVN commit r23036.
2019-10-03 18:51:40 +00:00
a19b14aeb7 Cleanup Camera related code and uses constant references where possible.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2350
This was SVN commit r23033.
2019-10-03 12:58:47 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
ecce63628c Unify duplicate u8* to hex string functions in a new Hexify function variant, similar to bb1f86f515, used by Tests, CacheLoader, Terms and Conditions, Lobby and mod.io.
Removes the call to the sprintf_s function from test_MD5.h in 17718981cf
and JSInterface_Main.cpp in 468d963e78.
As reported by Vladislav that function might not null-terminate strings
on untested/newer platforms, but the caller requires it here.
The sprintf_s calls in other places have the same problem.

Differential Revision: https://code.wildfiregames.com/D1591
Accepted By: Vladislav
This was SVN commit r21863.
2018-08-08 12:59:05 +00:00
9aad0137ba Stop using WMI for detecting the sound card, and use OpenAL instead. Delete WMI code altogether now it is unused.
This fixes #4561 and makes sound card detection work on non-Windows
platforms.

Reviewed By: echotangoecho
Tested By: Imarok, elexis
Differential Revision: https://code.wildfiregames.com/D636
This was SVN commit r19877.
2017-07-06 17:29:49 +00:00
4ed7d6c202 Fix compilation failure.
This was SVN commit r18621.
2016-08-21 20:35:10 +00:00
bb1f86f515 Remove duplication of the Hexify function.
Remove the useless extern keyword from function declarations in
ps/Util.h.

Patch by echotangoecho, refs #4095

This was SVN commit r18591.
2016-08-08 12:50:39 +00:00
5ad1079a5a Show the filepath in the command line output when taking screenshots.
This was SVN commit r18245.
2016-05-27 14:24:05 +00:00
f4e69b7c07 Cleanup of #3255, fixes #3966.
Don't create an empty oos_logs directory when starting the game.
Rename getDateIndexSubdirectory to createDateIndexSubdirectory.
Add a comment for the breakpoint argument of CreateDirectories.

This was SVN commit r18183.
2016-05-16 00:56:07 +00:00
a32ed75bff Fix a race-condition when two games have been started simultaneously and attempt to create the same replay directory, refs #3255.
Instead of triggering a debug-breakpoint, print a warning to stdout and
succeed in the N'th retry when having started N processes
simultaneously.
Previously the problem had been addressed by using the processID in the
directory name.

This was SVN commit r17776.
2016-02-19 11:22:32 +00:00
5998d13442 Use date and sequential ID for replay-directorynames, fixes #3255.
Save replays in userdata (screenshots, savegames)  and create one
subdirectory for every release.

This was SVN commit r17761.
2016-02-15 15:57:23 +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
e9a33b71ae Manually fix the less trivial CLogger format strings.
This was SVN commit r16184.
2015-01-22 20:32:06 +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
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
9dd4e71f1d Internationalized some messages
• You can now translate “The production queue is full”.
• Internationalized the “Pause” and “Resume” buttons. Only the initial
label was internationalized, it would switch to English as soon as you
pause the game for the first time.
• Internationalized the “Screenshot written to” message in the engine.

This was SVN commit r14968.
2014-04-22 06:35:51 +00:00
a5639631ee Texture system refactoring and cleanup, fixes #2455, patch by IronNerd.
This was SVN commit r14835.
2014-03-13 02:37:05 +00:00
f4625e69af Partial Android compatibility.
Remove unnecessary VM allocation (which seemingly causes problems on
Android due to mmap during static initialization).
Allow building without NVTT.

This was SVN commit r11074.
2012-02-15 13:58:58 +00:00
d70a981377 Android fixes
This was SVN commit r11068.
2012-02-13 23:53:09 +00:00
db85833655 More GLES compatibility.
Move more rendering code to shader API.

This was SVN commit r11050.
2012-02-12 13:20:49 +00:00
3537ae31d5 sync with work:
x86_x64: update MSR definitions to include model 2F (westmere ex);
update bus clock computation for sandy bridge; remove unused
cpu_Serialize; use namespace, add model names
mahaf: cope with stricter security for services/drivers
ApicId -> GetApicId, move to apic module
aken: add batch file to install driver (optional)

This was SVN commit r10815.
2011-12-27 14:12:31 +00:00
39d100c732 Moves camera projection settings to default.cfg.
Changes field of view (FOV) to 45 degrees per discussion. Fixes #941.
Tweaks default camera zoom and rotation accordingly.

This was SVN commit r10548.
2011-11-17 23:34:01 +00:00
15df4aa4be OS X fix: if os_cpu_ClockFrequency reports an unknown/invalid value, measure the frequency instead; also avoid reporting invalid freqs in system_info
This was SVN commit r9886.
2011-07-20 08:10:36 +00:00
e3d87b0375 remove no longer necessary lowlevel wsock implementation (superseded by enet) since the delay load hook isn't compatible with a DLL packaging of enet.
-> cstr serialization uses lib/byte_order.h instead of htons; removed
hostname/IP from system_info (Philip agrees its utility is negligible)

This was SVN commit r9572.
2011-05-29 19:59:51 +00:00
34186dd017 refactor file interface. requires workspace update
- separate file_system_util into vfs functions (-> vfs/vfs_util) and
file_system (avoids ugly fs_util namespace prefix)
- get rid of non-portable O_BINARY_NP etc. flags
- use standard O_WRONLY etc. flags instead of LIO_WRITE; but avoid the
need for specifying O_CREAT|O_TRUNC
- only open files for aio when O_DIRECT is specified (which 0ad does
not) - avoids wasting time and security issues
- return file descriptor directly instead of via output param
- waio: safer FCB mechanism that avoids mixing descriptors between lowio
and aio

This was SVN commit r9550.
2011-05-25 10:39:13 +00:00
7600c3862b refactor gfx detection code (interface), allow exporting from DLL (required at work)
This was SVN commit r9546.
2011-05-24 14:17:47 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
2374caac3e major refactor of file/io and alignment code. requires update-workspaces
. completely rewrite waio - use IOCP, add several hardcore
optimizations. now outperforms the
  AS SSD and ATTO benchmarks when writing
. refactor file interface - use LIO_READ instead of 'r', allow access to
file descriptor.
. completely rewrite the IO wrapper. now much more simple, less CPU
overhead, adds
  support for pre-issue/post-completion hooks and preallocation.
  io::Run defaults to simple synchronous IO; use io::Parameters to get
asynchronous.
. add alignment.h with constants and Align() function template (more
efficient than
  round_up for compile-time constants)
. add UniqueRange - similar to C++0x unique_ptr (emulated for C++03),
plus a
  built-in size. avoids expensive thread-safe reference counting in
shared_ptr.

cleanup:
- move fat_time functions into archive_zip
- remove no longer needed io_align and block_cache
- reduce dependencies in sysdep/compiler (move parts to
code_annotation.h)
- move IOCP into separate file (reused by waio)

This was SVN commit r9350.
2011-04-29 19:10:34 +00:00
99aa427ffa make use of SMBIOS information to detect CPU frequency and memory size
smbios fixes: also ignore max value (used by Dell BIOS to report invalid
MemoryDevice bit width); fix incorrect error check that caused 0 to be
returned on all but the first call; add implicit conversion operator to
allow using size without appending .value

This was SVN commit r9195.
2011-04-07 17:06:00 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +00:00
c0a105432e Use path types and conversions more consistently.
This was SVN commit r9094.
2011-03-21 22:59:00 +00:00
c3405e6f50 path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 ->
NativePathFromString
- replace sequences of Join(Path(), Basename+extension) with
ChangeExtension in wsdl, CacheLoader
- add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()).
also changed behavior to reflect the fact that "" is the VFS root
_directory_
- Path::Join now allows 2 identical path types (e.g. VfsPath) or one
char* literal (prevents inadvertently introducing non-safe characters).
to convert from wstring or wchar_t, use an explicit ctor (e.g.
VfsPath(wchar_t_string))

This was SVN commit r9091.
2011-03-21 19:54:08 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
b8925fbbc9 # Support AI construction of buildings.
Pass terrain passability data to AI scripts.
Expand pathfinder passability data to 16 bits per tile, to allow more
classes.
Support 16-bit ints in serializer.
Partially support JS typed arrays.
Allow foundations to be placed on top of units (fixes #499).
Stop farms and fishes blocking movement (fixes #534).
Add obstruction flags to allow finer control over what they block.
Associate entity IDs with obstruction shapes, to allow finding colliding
entities.
Support moving to the edge of a target entity with inactive obstruction.
Support foundation entities in AI.
Support playing as non-hele civs.

This was SVN commit r8899.
2011-02-10 16:06:28 +00:00
2963422173 Add screenshot location logging w/ rendered console message. Rendered messages are hidden before screenshot is taken. Fixes #675
This was SVN commit r8675.
2010-11-21 01:25:16 +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
0436dc4cb9 Fix memory leak
This was SVN commit r8302.
2010-10-07 18:42:35 +00:00
aa44bac652 from work: add thread-safe timer; add CAS64 (required for thread-safe timer); remove topology init requirements, no longer cache results (simplifies GroupPolicy_PerCache); add scoped affinitizer; whrt: fix race condition reported by parallel inspector. also refactor cache and TLB detection.
This was SVN commit r7785.
2010-07-22 16:17:33 +00:00
0f611042b1 # Support alt+enter to toggle fullscreen mode. Make game window resizable.
Refactor the video mode setting logic to cope better with dynamic
changes.

This was SVN commit r7606.
2010-06-03 19:07:59 +00:00