Compare commits

...

1260 Commits

Author SHA1 Message Date
Oliver Brakmann
ee3fc57b40 Fix an invalid owner init entry in nod05. 2015-05-31 09:17:27 +02:00
Oliver Brakmann
90b44e7d28 Fix tesla zaps being visible under the fog 2015-05-31 09:01:04 +02:00
penev92
7530cf9031 Make speedModifiers Lazy 2015-05-31 08:51:23 +02:00
Mustafa Alperen Seki
5f64c16439 Add hightech to Prerequisite of Stealth Raider 2015-05-30 13:57:06 +02:00
Oliver Brakmann
9bf3b84a9e Update gdi05a mission preview image. 2015-05-30 08:04:03 +02:00
Oliver Brakmann
0c51fe6419 Add missing DamageType to deviator weapon 2015-05-29 18:08:39 +02:00
Oliver Brakmann
eee612421c Add a missing DamageType to missions which re-define weapons 2015-05-29 18:08:16 +02:00
Matthias Mailänder
d43f5bbd0a use premultiplied alpha on geometric renderers
to fix transparency again
2015-05-29 14:07:06 +02:00
Oliver Brakmann
9166771113 Fix potentially removing actors twice from world in Actor::ChangeOwner 2015-05-27 22:12:28 +02:00
abcdefg30
468e607daa Disable hijackers in monster tank madness 2015-05-27 14:59:52 +02:00
abcdefg30
00042927bf Fixed captured buildings producing bot controled units 2015-05-27 14:59:52 +02:00
Oliver Brakmann
581596dd5f Fix Nod attacking the world in gdi05b 2015-05-27 00:10:49 +02:00
Matthias Mailänder
b6f5cacc47 copy it in the make dependencies step 2015-05-25 10:40:37 +01:00
Matthias Mailänder
b65508faad fix error CS0219:
The variable `zoom' is assigned but its value is never used
2015-05-25 01:29:18 +02:00
Paul Chote
02adf2b212 Add nuke flash to D2K. 2015-05-24 21:35:19 +02:00
Paul Chote
90af8fb07a Update NukePaletteEffect for premultiplied alpha. 2015-05-24 21:35:19 +02:00
Paul Chote
2cc125a3fa Merge pull request #8236 from Mailaender/win-geoip-gz
Fixed a GeoLite2-Country DB filename in Windows fetch scripts.
2015-05-24 15:37:38 +01:00
Matthias Mailänder
f2124f7ebe fix file name 2015-05-24 16:17:43 +02:00
Oliver Brakmann
a507b7d567 Merge pull request #8196 from Mailaender/stylecop-mono-4
Fixed StyleCop on Mono 4
2015-05-24 16:02:13 +02:00
Pavel Penev
902cd124ba Merge pull request #8149 from Mailaender/fetch-geoip-db
Automatized GeoIP database download
2015-05-24 16:43:22 +03:00
Paul Chote
767a63d43e Merge pull request #8235 from obrakmann/map-chooser-delete-unpacked-maps
Fix inability to delete unpacked maps
2015-05-24 13:53:27 +01:00
Oliver Brakmann
331ad217c2 Fix inability to delete unpacked maps 2015-05-24 14:32:46 +02:00
Paul Chote
c5614d4c3a Merge pull request #8223 from Mailaender/fix-sequences
Fixed several broken YAML sequences
2015-05-24 13:12:22 +01:00
Pavel Penev
9ed7ef10b9 Merge pull request #8227 from obrakmann/fix8219_rise_of_the_undead_bridges
Fix broken bridges being initialized with a non-zero HP value
2015-05-24 15:05:29 +03:00
Paul Chote
8483152a3c Merge pull request #8222 from Mailaender/water-troopers
Fixed the AI not avoiding boats when searching for viable paradrop targets
2015-05-24 12:54:48 +01:00
Pavel Penev
3ebb6573a4 Merge pull request #8228 from Mailaender/render-trait-doc
Added render trait documentation
2015-05-24 14:41:44 +03:00
Matthias Mailänder
5b5b0c02dd add trait documentation 2015-05-24 13:37:04 +02:00
Matthias Mailänder
5838dc39fc Merge pull request #8231 from obrakmann/map-chooser-addendum
Fix map chooser crashing the server creation dialog in cnc
2015-05-24 13:32:27 +02:00
Matthias Mailänder
472de004ed Merge pull request #8232 from obrakmann/fix_game.exe.config_removal
Fix OpenRA.Game.exe.config issues
2015-05-24 13:30:14 +02:00
Oliver Brakmann
c6c9863681 Merge pull request #8176 from pchote/fix-palette-alpha
Load textures using premultiplied alpha.
2015-05-24 13:15:54 +02:00
Oliver Brakmann
88d448bf40 Merge pull request #8229 from Mailaender/noget
Added a NuGet replacement script as fallback
2015-05-24 12:18:58 +02:00
Oliver Brakmann
fac0991901 Fix OpenRA.Game.exe.config not being copied to the built dir during packaging 2015-05-24 12:17:43 +02:00
Oliver Brakmann
29efb0675d Fix OpenRA.Game.exe.config being removed by 'make clean' 2015-05-24 12:08:30 +02:00
Oliver Brakmann
00bf032a8f Fix custom map tab offset in cnc mod 2015-05-24 11:45:37 +02:00
Oliver Brakmann
6f0e155afb Fix map chooser crashing the server creation dialog in cnc 2015-05-24 11:40:33 +02:00
Pavel Penev
f2abf10670 Merge pull request #8230 from reaperrr/grav-bomb-fix
Made projectiles accept empty to disable image or sequence
2015-05-24 11:32:48 +03:00
Matthias Mailänder
b2fc8585e0 unify the spelling towards the official one 2015-05-24 10:24:47 +02:00
Matthias Mailänder
c4deaef163 remove nuget until the connectivity problems are resolved 2015-05-24 10:24:22 +02:00
Matthias Mailänder
dd19d9127b add a fallback if nuget is not available on the system 2015-05-24 10:24:19 +02:00
reaperrr
6ab73fa982 Made projectile effects accept empty values to disable/negate image or sequence.
In addition to accepting null.
2015-05-24 10:02:53 +02:00
Matthias Mailänder
cc34463019 require DetectCloaked as it is useless otherwise 2015-05-24 09:06:03 +02:00
Matthias Mailänder
d0b3e5fb8b Merge pull request #8114 from penev92/bleed_d2kUpgrades
Add D2k building upgrades
2015-05-24 08:23:28 +02:00
Matthias Mailänder
d87d3e5283 Merge pull request #8220 from abcdefg30/bombletcrash
Fix a crash in the ParaBomb weapon defintion
2015-05-24 08:10:23 +02:00
Pavel Penev
9e0e866199 Merge pull request #8207 from obrakmann/map-chooser-overhaul
Split maps into system and custom maps in the map chooser
2015-05-24 04:12:23 +03:00
Oliver Brakmann
d9f0ca362f Fix broken bridges being initialized with a non-zero HP value 2015-05-24 02:02:20 +02:00
Oliver Brakmann
dc08b7a90a Add buttons for map file management to map chooser 2015-05-24 01:49:30 +02:00
abcdefg30
8c59016853 Merge pull request #8066 from penev92/bleed_warheads
Remove DeathType from DamageWarhead
2015-05-24 01:33:44 +02:00
Oliver Brakmann
1854d994fd Split map chooser in system- and user-installed map lists 2015-05-24 01:28:22 +02:00
Oliver Brakmann
72c0f9b8dc Allow non-hosts to open the map chooser 2015-05-23 23:38:30 +02:00
penev92
9ea78285fa Add an upgrade rule for DeathSounds.DeathTypes 2015-05-24 00:16:26 +03:00
penev92
1c44fcbad4 Add upgrade rules to remove DamageWarhead.DeathType
and replace it with proper DamageTypes
2015-05-24 00:15:09 +03:00
penev92
b5e4876b7f Add DeathTypes to WithDeathAnimation 2015-05-24 00:15:08 +03:00
penev92
32bb70abca Remove DamageWarhead.DeathType in favor of DamageWarhead.DamageTypes 2015-05-24 00:15:07 +03:00
Matthias Mailänder
a2c553478d fetch GeoLite2-Country.mmdb.gz after 30 days of file age 2015-05-23 22:45:31 +02:00
Matthias Mailänder
c76fb51b14 Merge pull request #8208 from penev92/bleed_registerFileTypes
Register .orarep file type and openra:// URI scheme on Windows
2015-05-23 22:27:41 +02:00
penev92
b1c36246cf Clean Windows registry on uninstall 2015-05-23 23:15:51 +03:00
Matthias Mailänder
486c7527c9 Merge pull request #8012 from reaperrr/voiceset
Extracted actor Voices from Selectable into own Voiced trait
2015-05-23 21:59:34 +02:00
Pavel Penev
54e806568a Merge pull request #7934 from Mailaender/mime-join
Registered the openra:// protocol to join games on Linux
2015-05-23 22:39:17 +03:00
Matthias Mailänder
44a4c0600e redirect Microsoft.Build.Framework.dll on Mono 4 2015-05-23 18:30:12 +02:00
Matthias Mailänder
9773cca214 rename and fix unused sequences 2015-05-23 16:10:55 +02:00
Matthias Mailänder
47927963a7 fix misnamed TakeCover sequence 2015-05-23 16:10:55 +02:00
Matthias Mailänder
13a8f6f5bd remove duplicate and unused land animation 2015-05-23 16:10:55 +02:00
Matthias Mailänder
c88daef3b3 fix missing make and crumble animation 2015-05-23 16:10:52 +02:00
Matthias Mailänder
a424440cd2 fix missing aim sequence 2015-05-23 16:10:29 +02:00
Matthias Mailänder
861ebd61b7 fix missing make animation for civilian buildings 2015-05-23 16:10:26 +02:00
Matthias Mailänder
add0cc565a don't paradrop units near boats 2015-05-23 16:05:56 +02:00
Matthias Mailänder
8e919d3215 move GeoIP functions into it's own class
extract the geoip database .gz in-game
2015-05-23 16:00:46 +02:00
reaperrr
a99f69035c Made AnnounceOnKill and AnnounceOnBuild voices customisable. 2015-05-23 13:53:38 +02:00
reaperrr
3777a8bca9 Moved Voice-related extensions to VoiceExts.
Note: This is a work-around until Selectable can be moved to Mods.Common, which is when the voice extensions should be moved back to ActorExts.

Pulled phrase check before foreach in PlayVoice ActorExts.
Removed superflous actor parameter from PlayVoice/PlayVoiceLocal.

Simplified PlayVoice extensions.

variant is no longer customisable, as all current usages use self.Owner.Country.Race anyway.
2015-05-23 13:46:01 +02:00
abcdefg30
b5b2a6bdcb Fix a crash in the ParaBomb weapon defintion
in Fort Lonestar and Survival02
2015-05-23 13:31:45 +02:00
Paul Chote
80a54fe4fe Fix repair depot lights. 2015-05-23 08:50:29 +01:00
Paul Chote
5532ed4fc9 Remove now-redundant blend code. 2015-05-23 08:50:28 +01:00
Paul Chote
4eb76046f4 Fix deviator gas blending. 2015-05-23 08:50:28 +01:00
Paul Chote
26fd858fc7 Use premultiplied alpha for all textures and blending. 2015-05-23 08:50:28 +01:00
Matthias Mailänder
78f1e9fb2f Merge pull request #8215 from abcdefg30/raflare
Removed bogus traits from ra FLARE
2015-05-23 08:50:21 +02:00
abcdefg30
89db7bbf05 Add a tooltip to FLARE 2015-05-22 23:25:42 +02:00
Oliver Brakmann
e75e6fee0e Remove superfluous traits from crate actor definitions 2015-05-22 22:29:07 +02:00
abcdefg30
bc55748e81 Removed bogus traits from FLARE 2015-05-22 22:29:06 +02:00
penev92
42af5f0939 Fix how OpenRA.exe launches OpenRA.Game.exe 2015-05-22 20:38:45 +03:00
penev92
cffc01ab28 Register .orarep file type and openra:// URI scheme on Windows 2015-05-22 20:38:41 +03:00
Pavel Penev
fe45a85349 Merge pull request #8187 from Mailaender/travis-windows-deploy
Brought back the Windows setup deployment via Travis CI
2015-05-22 20:03:28 +03:00
Pavel Penev
0d33fdb5e1 Merge pull request #8200 from RoosterDragon/sheet-fixes
Sheet fixes
2015-05-22 18:30:13 +03:00
Pavel Penev
686e01c6cc Merge pull request #8193 from RoosterDragon/line-render-perf
Improve performance of line rendering
2015-05-22 17:51:11 +03:00
Pavel Penev
bd7838bdb6 Merge pull request #8211 from obrakmann/fix8175_ext-editor-breakage
Fix legacy editor
2015-05-22 17:19:59 +03:00
Pavel Penev
beb1481107 Merge pull request #8195 from obrakmann/fix8181_reveal_fakes_with_unit_selection_key
Fix revealing fakes by double-clicking a building
2015-05-22 17:09:00 +03:00
reaperrr
b9e8406aeb Fix Unload definition in voice sets. 2015-05-22 01:51:56 +02:00
reaperrr
5e2c781c8a Adds PlayVoice, PlayVoiceLocal and HasVoice to ActorExts.
Makes Cargo unload voice customisable.
2015-05-22 01:51:55 +02:00
reaperrr
5f68516070 Cleaned up IVoiced-related code.
Added Volume control and descriptions to Voiced.

Streamline voice checks in WorldUtils and DeathSounds.
2015-05-22 01:51:54 +02:00
reaperrr
251d3e6864 Move PlayVoice and PlayVoiceLocal from Sound to Voiced.
Move HasVoice, HasVoices and GetVoices from WorldUtils to Voiced.
2015-05-22 01:51:53 +02:00
reaperrr
037bd6794c Upgrade rules for moving Voice to Voiced trait 2015-05-22 01:51:52 +02:00
reaperrr
0d05fdefbb Extract actor voice set into Voiced trait 2015-05-22 01:51:51 +02:00
Oliver Brakmann
f8774dd575 Adjust legacy editor after moving player palettes to the World actor 2015-05-21 21:30:35 +02:00
Oliver Brakmann
b35491d609 Fixed reading past the bounds of the map when rendering in the legacy editor 2015-05-21 21:29:59 +02:00
Pavel Penev
66f99704a8 Merge pull request #8209 from Mailaender/mono2-CS0172
Fixed a compilation error on Mono 2.10
2015-05-21 22:06:54 +03:00
Matthias Mailänder
31d1f0bcf9 fix error CS0172 2015-05-21 20:43:45 +02:00
Pavel Penev
21d1348ea3 Merge pull request #8202 from deniz1a/revert-8097
Reverts #8097.
2015-05-21 21:38:10 +03:00
Matthias Mailänder
b518e5949c register the openra:// protocol to join games 2015-05-21 20:33:42 +02:00
Matthias Mailänder
da2b7e687c add a new Launch.URI parameter 2015-05-21 20:33:36 +02:00
Oliver Brakmann
d46cf70b00 Make d2k AI aware of buildings upgrades 2015-05-21 21:26:16 +03:00
OmegaBolt
8b5353e39b Fix D2k tech tree
- Added upgrades for the Con Yard, Barracks, Light, Heavy and High Tech Factory (last one is Atreides only)
- Updated the prerequisites of all structures, infantry and vehicles to use the upgrades
- Fixed the Ix Research building to use vanilla Dune 2000 prerequisites
- Renamed High Tech Facility to High Tech Factory like vanilla Dune 2000
- Given the Air Strike power to the High Tech Factory Upgrade like vanilla
2015-05-21 21:26:14 +03:00
OmegaBolt
340c8dad21 Add D2k building upgrades 2015-05-21 21:26:12 +03:00
OmegaBolt
f3ec07d4e4 Add Upgrade production queue to D2k 2015-05-21 21:26:10 +03:00
Matthias Mailänder
81608a3282 remove unused replay launch script 2015-05-21 18:45:57 +02:00
abcdefg30
0b09b82254 Merge pull request #8198 from Mailaender/net40-thirdparty-dll
Fixed SystemNotSupportedException caused by thirdparty mod DLLs on .NET > 4.0
2015-05-21 17:20:42 +02:00
Oliver Brakmann
5c95c7e157 Merge pull request #8130 from Mailaender/tileset-filters
Fixed glitchy remap errors of non-fitting actors on certain tilesets
2015-05-21 16:27:37 +02:00
Matthias Mailänder
07fb7f921f bring back system markdown 2015-05-21 11:54:21 +02:00
Matthias Mailänder
f079b1980f switch back to the old Travis infrastructure 2015-05-21 11:53:47 +02:00
Igor Popov
28e1eccf29 Merge pull request #8206 from baxxxster/bleed
Added possibility to use spaces in Server.Name
2015-05-21 12:25:25 +03:00
Glenn Martin Jensen
615c22f158 Added possibility to use spaces in Server.Name
This way it's easier for others to set a servername with spaces in it by
default
2015-05-21 09:49:04 +02:00
Matthias Mailänder
27cbfd9bb1 Merge pull request #8204 from reaperrr/group-sel-bug
Fixes bug that selection voices are played twice when selecting groups
2015-05-21 08:04:18 +02:00
reaperrr
75a0ff7702 Fixes the bug that selection voices are played twice when selecting groups
via 0-9 hotkeys.

Problem was that the voice was played for both KeyUp and KeyDown events.

Closes #8121.
2015-05-21 03:01:13 +02:00
deniz1a
e290975952 Reverts #8097.
It caused units not targeting enemies under fog even with satellite.
2015-05-21 00:24:27 +03:00
Oliver Brakmann
1f17ec4d4f Merge pull request #8201 from Mailaender/isometric-editor-sprites
Fixed Tiberian Sun multiplayer spawn and waypoints
2015-05-20 21:56:07 +02:00
Matthias Mailänder
d9b0e00b41 isometric waypoints 2015-05-20 21:17:20 +02:00
Matthias Mailänder
ca73b9612a isometric spawn points 2015-05-20 21:17:14 +02:00
RoosterDragon
b48b994f16 Remove half-baked thread-safety mechanisms from Sheet.
Sheet is now thread-unsafe, rather than attempting to expose a dodgy thread safety model.
2015-05-20 18:50:28 +01:00
RoosterDragon
d42c3a9740 Allow a sheet buffer to be released without error, even if unbuffered. 2015-05-20 18:35:24 +01:00
Matthias Mailänder
9e81a05f86 allow 3rd-party mod DLLs on .NET > 4.0 2015-05-20 19:32:19 +02:00
Oliver Brakmann
da16142412 Enable unit selection keys for spectators and in replays.
Only work in per-player views.
2015-05-20 18:56:14 +02:00
Oliver Brakmann
9895aee6f2 Disable unit selection by double-clicking for enemy units 2015-05-20 18:28:34 +02:00
Oliver Brakmann
5db63ba7aa Merge pull request #8123 from 42foobar42/nod06a
added mission 6a nod
2015-05-20 17:12:39 +02:00
abcdefg30
e725732f69 Merge pull request #8078 from Mailaender/make-all-docs
Fixed the trait documentation
2015-05-20 17:05:46 +02:00
Alexander Boll
da3d177c60 added mission 6a nod 2015-05-20 16:29:58 +02:00
Matthias Mailänder
9c53ff1403 Merge pull request #8103 from RoosterDragon/mapcache-better-threading
Fix graphical glitches & crashes related to map loading
2015-05-20 13:11:44 +02:00
Matthias Mailänder
1e7e2aa1e0 Merge pull request #8085 from abcdefg30/funpark
Add funpark01 - Take #3
2015-05-20 13:01:36 +02:00
RoosterDragon
b9ebeaadca Improve performance of line rendering.
- Create an overload that renders a line in one color, as this allows most existing calls to be simplified. This also allows a slight performance improvement by only normalizing the components once.
- Introduce a DrawLineStrip method. This improves performance by allowing the color components to be normalized once for the whole strip, and only needing to calculate vertices once per point rather than twice since we can reuse the last result.
2015-05-19 21:41:50 +01:00
Oliver Brakmann
9397749118 Merge pull request #8097 from deniz1a/cloaked-targetability
Fixes location of phase transport being revealed by attack line.
2015-05-18 23:04:09 +02:00
Matthias Mailänder
6f3c11da1d remove actors without palette glitches, but non-sensical 2015-05-18 19:41:47 +02:00
Matthias Mailänder
2fbe7b0013 filter actors with glitchy remap errors on certain tilesets 2015-05-18 19:12:20 +02:00
Matthias Mailänder
fd85b208fa update documentation 2015-05-18 18:54:53 +02:00
Matthias Mailänder
2eac646929 deploy Windows setup with Travis CI only 2015-05-18 18:54:41 +02:00
Pavel Penev
a47235d162 Merge pull request #8065 from pchote/ingame-map-editor
Add the new map editor.
2015-05-18 19:16:16 +03:00
Pavel Penev
5d593de09d Merge pull request #8183 from Mailaender/unused-tilestart
Fixed the build for Mono 2.10 again
2015-05-17 22:02:15 +03:00
Matthias Mailänder
ffffe0089a fix error CS0219:
The variable `tileStart' is assigned but its value is never used
2015-05-17 20:34:47 +02:00
Pavel Penev
53af3df3ee Merge pull request #8174 from abcdefg30/formattime
Added a FormatTime function to UtilsGlobal.cs
2015-05-17 17:48:23 +03:00
Pavel Penev
d978fff982 Merge pull request #8106 from reaperrr/cnc-fixes
Several TD mod fixes
2015-05-17 17:39:33 +03:00
Pavel Penev
d718a5a5ca Merge pull request #8094 from reaperrr/hackyai-tweaks
Make HackyAI squad creation a little more flexible and controllable
2015-05-17 17:28:02 +03:00
Pavel Penev
2230daee14 Merge pull request #8179 from Mailaender/ts-skirmish-stats
Added skirmish stats to Tiberian Sun
2015-05-17 15:38:50 +03:00
Paul Chote
09e4c5c5ab Merge pull request #8109 from reaperrr/fix-idleoverlay
Fixes WithIdleOverlay to start with first frame after make animation
2015-05-17 13:06:44 +01:00
Paul Chote
60f96fcb7b Overhaul save panel. 2015-05-17 12:09:41 +01:00
Paul Chote
445c0d76a2 Fix create map panel geometry. 2015-05-17 12:09:40 +01:00
Matthias Mailänder
0638f1ce7d add skirmish stats
fixes #7728
2015-05-17 10:37:49 +02:00
deniz1a
db38f52721 Fixes location of phase transport being revealed by attack line. 2015-05-16 15:20:07 +03:00
abcdefg30
d50ed6ec2f Replace a bogus tab 2015-05-16 13:19:46 +02:00
abcdefg30
2fd91c53f2 Remove trailing spaces from nod04b map.yaml 2015-05-16 13:19:45 +02:00
abcdefg30
57dbdd097d Add a FormatTime function to UtilsGlobal.cs 2015-05-16 13:19:44 +02:00
Paul Chote
469f47aeea Add new map editor UI. 2015-05-15 17:09:27 +01:00
Paul Chote
d211fe9fe1 Add the world components of the new editor. 2015-05-15 17:09:20 +01:00
Matthias Mailänder
1f024a8695 Add menu plumbing for the new map editor. 2015-05-15 17:08:33 +01:00
Paul Chote
444c02a498 Add ClickThrough property to ContainerWidget. 2015-05-15 17:08:32 +01:00
Paul Chote
b1dc5012c3 Don’t crash if IQBO isn’t present on an actor. 2015-05-15 17:08:32 +01:00
Paul Chote
038847cc4c Force the first template variant in TTPW. 2015-05-15 17:08:32 +01:00
Paul Chote
443bc63fa7 Render terrain grid above actors, too. 2015-05-15 17:08:31 +01:00
Paul Chote
b889101ba1 Make sure that ScreenMap is initialized before other traits. 2015-05-15 17:08:31 +01:00
Paul Chote
9e5e1f1a89 Add methods to IOccupySpaceInfo. 2015-05-15 17:08:31 +01:00
Paul Chote
5754de141d Add Remove support to TypeDictionary. 2015-05-15 17:08:30 +01:00
abcdefg30
f65d9ab584 Merge pull request #8166 from Mailaender/win-dedicated-launcher
Added a Windows dedicated server launch script
2015-05-15 17:36:48 +02:00
Glen Anderson
71c42f5b38 add a Windows dedicated server launch script 2015-05-15 17:12:03 +02:00
Pavel Penev
29c4b646e3 Merge pull request #8144 from abcdefg30/lowfakepower
Add a low power overlay to fake structures
2015-05-15 15:40:35 +03:00
abcdefg30
70e7b33fd7 Merge pull request #7979 from Mailaender/d2k-sand-blendmode
Fixed the Dune 2000 harvester sand out animation
2015-05-14 19:21:06 +02:00
abcdefg30
48a9807273 Merge pull request #8164 from Mailaender/common-render-voxel
Moved the generic voxel rendering traits to Mods.Common
2015-05-14 17:38:06 +02:00
Matthias Mailänder
7e1c3047f6 move generic Voxel render traits to Mods.Common 2015-05-14 17:02:47 +02:00
abcdefg30
96767bab5d Add funpark01 2015-05-14 16:57:30 +02:00
abcdefg30
db3f84e361 Merge pull request #8158 from deniz1a/nodogspy
Removes Spy's ability to disguise as Attack Dog or Giant Ant.
2015-05-14 16:49:23 +02:00
Matthias Mailänder
e8144e1194 Merge pull request #8161 from LipkeGu/ts_music_installer
Allow music download for TS
2015-05-14 16:21:01 +02:00
abcdefg30
e338c63203 Add attack sounds for dinos 2015-05-14 14:07:18 +02:00
abcdefg30
4d864c9aaf Add selection boxes for dinos 2015-05-14 14:07:17 +02:00
Guido L
004c7316fc Allow music download 2015-05-14 13:51:03 +02:00
reaperrr
e190093ac4 Fix WithIdleOverlay to start with first frame after make animation 2015-05-13 23:18:59 +02:00
reaperrr
0d3dd28a3f Unharcode squad randomization, add minimum delay for creating attack force 2015-05-13 22:50:23 +02:00
Deniz Ayikol
153bac4602 Removes Spy's ability to disguise as Attack Dog and Giant Ant. 2015-05-13 20:03:26 +03:00
Pavel Penev
7154ce4a2f Merge pull request #8147 from DeadlySurprise/vqaAudioFix
Fixed gdi3lose.vqa crash
2015-05-13 03:50:45 +03:00
Oliver Brakmann
1c75d62d4c Merge pull request #8150 from penev92/bleed_factionDescriptions
Add faction description tooltips to TD
2015-05-12 21:26:43 +02:00
penev92
c352e5309d Add faction description tooltips to TD 2015-05-12 22:07:47 +03:00
Matthias Mailänder
e80641940b Merge pull request #8151 from abcdefg30/armordropAI
ArmorDrop has been removed
2015-05-12 19:14:00 +02:00
abcdefg30
d62b01d294 Merge pull request #7538 from cjshmyr/teamhealth
Give ally players a yellow health bar (team health colors)
2015-05-12 18:01:27 +02:00
abcdefg30
e9884b740b ArmorDrop has been removed 2015-05-12 13:53:08 +02:00
Pavel Penev
5fc452412a Merge pull request #8148 from Mailaender/thanks-ihptru
Moved ihptru on top of the Credits
2015-05-11 23:33:50 +03:00
Matthias Mailänder
9f3008456e move ihptru up front 2015-05-11 22:08:41 +02:00
DeadlySurprise
35445775c2 Fixed crash 2015-05-11 18:19:06 +02:00
abcdefg30
5553f55705 Merge pull request #8087 from 42foobar42/nod5
added mission 5 nod
2015-05-11 17:03:50 +02:00
abcdefg30
e55364dd0f Add a low power overlay to fake structures 2015-05-11 16:35:17 +02:00
Pavel Penev
648dc31e24 Merge pull request #8131 from obrakmann/fix8129_hotkey_input_lose_focus
Fix HotkeyEntryWidget keeping keyboard focus after receiving input
2015-05-11 03:42:30 +03:00
Pavel Penev
ffd45e9b04 Merge pull request #7982 from Mailaender/ts-obelisk
Added the Tiberian Sun Nod Obelisk charge animation
2015-05-11 03:30:48 +03:00
Matthias Mailänder
69ce877a89 Merge pull request #8083 from obrakmann/separate_download_dir
Closes #8069
2015-05-10 21:30:38 +02:00
Alexander Boll
6a2b9fc41b added mission 5 nod
Update nod05
2015-05-10 19:43:42 +02:00
Curtis Shmyr
6ca51e47c1 Give ally players a yellow hp bar for team health colors 2015-05-10 11:12:10 -06:00
Matthias Mailänder
4b50f34c46 Merge pull request #7849 from penev92/bleed_notifications
Add new enemy detection voice notifications to RA and D2k
2015-05-10 18:32:13 +02:00
Oliver Brakmann
7ef14f56e2 Fix HotkeyEntryWidget keeping keyboard focus after receiving input 2015-05-10 17:46:39 +02:00
Oliver Brakmann
0f7aaf3445 Merge pull request #8125 from pchote/player-palettes
Reorganize palette loading.
2015-05-10 17:35:34 +02:00
Oliver Brakmann
53995bf3f3 Merge pull request #7938 from Mailaender/appdata
Added Linux app store data metadata
2015-05-10 16:02:43 +02:00
Matthias Mailänder
3d23897af0 install Linux app store data metadata 2015-05-10 15:38:01 +02:00
Matthias Mailänder
0e987137a2 Merge pull request #8124 from pchote/actorpreview-owners
Remove Owner from ActorPreviews.
2015-05-10 14:21:44 +02:00
Paul Chote
889360d4c6 Regenerate cached texture indices when the palette size changes. 2015-05-10 00:59:15 +01:00
Paul Chote
c0282bdff9 Remove Owner from ActorPreviews. 2015-05-10 00:01:43 +01:00
Paul Chote
7eae157ad8 Rework player palette loading. 2015-05-10 00:01:14 +01:00
Paul Chote
1d835edfca Split PaletteReference into its own file. 2015-05-09 22:36:28 +01:00
Matthias Mailänder
d99ae3bcb9 split render building/overlay and play sound for charge
to add the Tiberian Sun Nod Obelisk

tick slightly faster

tweak the local offsets
2015-05-09 19:56:15 +02:00
Oliver Brakmann
d3f76f13a1 Merge pull request #8048 from 42foobar42/nod4b
added nod4b
2015-05-09 12:56:01 +02:00
Alexander Boll
912ab4d1b8 added nod4b 2015-05-09 12:10:35 +02:00
Scott
c9d6760972 Merge pull request #8104 from penev92/bleed_factionDescriptions
Add D2k faction description tooltips
2015-05-09 13:13:22 +12:00
Oliver Brakmann
0c1b825877 Adjust travis-ci caching
1. Removes the APT caching, since it's not available on the docker infrastructure.
2. Enables caching for the dependency download directory.
2015-05-08 20:59:45 +02:00
Oliver Brakmann
71857be388 Make packaging less noisy, + random cleanups 2015-05-08 20:59:45 +02:00
Oliver Brakmann
f251813f89 Keep downloaded files in a separate directory
As a side effect, this re-enables building the Windows installer on Linux hosts.
2015-05-08 20:59:24 +02:00
Oliver Brakmann
14886bc3f7 Merge pull request #8101 from penev92/bleed_references
Cleanup unused DLL references
2015-05-08 20:41:37 +02:00
penev92
873c47127a Add "Enemy detected" notification to RA 2015-05-08 20:07:08 +03:00
penev92
606f69ed7c Add "Enemy units detected" notifications to D2k 2015-05-08 20:06:56 +03:00
penev92
8e730c264f Revert removal of EnemyWatcher and AnnounceOnSeen traits from RA and D2k 2015-05-08 20:06:52 +03:00
Paul Chote
ba131fcf0a Merge pull request #7805 from penev92/bleed_prerequisites
Make buildings explicitly provide their names as prerequisites
2015-05-08 17:29:22 +01:00
Pavel Penev
0d759eee2a Merge pull request #8061 from Phrohdoh/with-decoration
Implement WithDecoration and subtraits.
2015-05-08 18:02:13 +03:00
Taryn Hill
cace31f5e9 Implement WithDecorationCarryable. 2015-05-08 09:55:40 -05:00
Taryn Hill
dd1cc4eb2f Implement WithDecorationDisguised. 2015-05-08 09:55:40 -05:00
Taryn Hill
d57d7c522f Implement WithDecoration. 2015-05-08 09:55:31 -05:00
Pavel Penev
3eb556258d Merge pull request #8021 from sinf/quickbuild
Added quick build feature
2015-05-08 17:53:57 +03:00
abcdefg30
4d0fb8b931 Merge pull request #8102 from RoosterDragon/objective-size
Fix objectives window
2015-05-08 15:24:29 +02:00
reaperrr
89845272e0 Add two previously unused voices to Commando voice set 2015-05-08 02:59:08 +02:00
reaperrr
f7c69b4801 Split radar dish from Nod airfield and make it an idle overlay 2015-05-08 02:59:07 +02:00
reaperrr
d441d9bd6e Converted rank and levelup art to cnc palette 2015-05-08 02:59:06 +02:00
reaperrr
c88ee0f56a Tweaked Break of Day and Chokepoint
Break of Day:
- fixed tiberium tree positions
- fixed a minor tile error near a river

Chokepoint:
- replaced temperate tree groups with large desert tree
2015-05-08 02:59:05 +02:00
reaperrr
fe0c21aa91 Significantly improved Rogue States
- fixed most, possibly all cliff errors
- fixed many river, shore and road errors
- hid a few remaining shore errors behind trees/rocks
- fixed positions of all tiberium trees (1 cell down)
- replaced temperate tree groups with large desert tree
- tweaked position of some buildings at the border of the map so they're more visible (instead of half-hidden below shroud edge)
2015-05-08 02:59:03 +02:00
reaperrr
9a23ef2ac5 Significantly improved Necessary Illusions
- fixed all cliff tile errors
- fixed most noticable river errors
- fixed some noticable road errors
- fixed position of all tiberium trees (regression from #5198)
2015-05-08 02:59:01 +02:00
penev92
58ecf9cbac Add D2k faction descriptions to the lobby 2015-05-08 01:54:11 +03:00
RoosterDragon
a42b69bd98 Give objectives proper sizing.
This gives the container an actual size, which prevents the scroll panel logic skipping rendering in the belief that it is not visible.
2015-05-07 21:07:35 +01:00
RoosterDragon
3b5a672848 Always access the SheetBuilder from the main thread in MapCache.
Not doing this can occasionally this can result in a cross thread call to the backing texture which leads to bad things. This stops trying to be clever regarding the thread safety invariants exposed by SheetBuilder and does things simply and safely: All updates happen on the main thread.
2015-05-07 20:58:59 +01:00
Matthias Mailänder
4dbdd365de also version the all helper mod 2015-05-07 21:25:32 +02:00
Oliver Brakmann
2e11b5d809 Merge pull request #8099 from pchote/scrollpanel-move-regression
Only issue a MouseMove event if the scroll offset actually changed.
2015-05-07 19:23:45 +02:00
Oliver Brakmann
1fe8b98415 Merge pull request #8095 from penev92/bleed_tiles
Add one more D2k tile definition
2015-05-07 19:10:47 +02:00
penev92
bb51657e40 Cleanup unused DLL references 2015-05-07 18:59:01 +03:00
penev92
dc3ae39db1 Rename ProvidesCustomPrerequisite to ProvidesPrerequisite 2015-05-07 03:04:11 +03:00
Paul Chote
88221423b6 Only issue a MouseMove event if the scroll offset actually changed. Fixes #8098. 2015-05-06 21:51:24 +01:00
penev92
95eb8b27b5 Add tile BLOXTREE-345 2015-05-06 17:11:25 +03:00
Paul Chote
e170140084 Merge pull request #8091 from penev92/bleed_someRandomFix
Don't do trait lookups for Health on each processed order
2015-05-05 23:40:00 +01:00
penev92
ea9d49e2b7 Don't do trait lookups for Health on each processed order 2015-05-05 19:41:45 +03:00
penev92
834e4bfe9c Fix building prerequisites in TS 2015-05-04 01:58:56 +03:00
penev92
352c28314b Fix building prerequisites in D2k 2015-05-04 01:58:55 +03:00
penev92
1154e109d3 Fix building prerequisites in RA 2015-05-04 01:58:54 +03:00
penev92
75687ba271 Fix building prerequisites in Cnc 2015-05-04 01:58:51 +03:00
penev92
e3e6bcaf2a Add an upgrade rule for explicit prerequisite providing by buildings 2015-05-04 01:58:49 +03:00
penev92
50fb6f1d25 Make buildings grant prerequisites explicitly 2015-05-04 01:39:32 +03:00
Oliver Brakmann
a310411bcc Merge pull request #8013 from penev92/bleed_wormSound
Add sandworm attack sound
2015-05-03 23:23:11 +02:00
Oliver Brakmann
62b3592bd4 Merge pull request #7998 from Mailaender/ts-proc-dock
Added the Tiberian Sun docking overlays
2015-05-03 22:50:16 +02:00
Oliver Brakmann
622685c8f4 Merge pull request #7968 from pchote/ts-tileset-depth
Load depth data from tmp(ts) sprites.
2015-05-03 22:31:27 +02:00
Oliver Brakmann
536d80a7f3 Merge pull request #7917 from RoosterDragon/replay-browser-load-perf
Faster replay browser loading
2015-05-03 20:13:13 +02:00
Oliver Brakmann
3ae7d51feb Merge pull request #7871 from Mailaender/ambient-sound
Added a looping sound trait
2015-05-03 16:46:36 +02:00
Oliver Brakmann
b9f2caa0cf Merge pull request #8082 from Mailaender/more-dependency-fixes
Moved configure native dependencies
2015-05-03 16:07:08 +02:00
penev92
76a3b9c3b7 Add sandworm attack sound 2015-05-03 12:55:32 +03:00
Matthias Mailänder
4818efe036 Merge pull request #8080 from abcdefg30/upgrademaps
Run the utility on all maps
2015-05-03 11:23:22 +02:00
abcdefg30
cd9af39662 Merge pull request #8044 from penev92/bleed_withSpriteBody
Retire RenderFlare and WithFire traits
2015-05-03 11:19:02 +02:00
abcdefg30
3f7fc18ee7 Run the utility on all maps and polish stuff 2015-05-03 11:00:50 +02:00
penev92
c5dead9098 Introduce WithSpriteBody trait
Add upgrade rules

Add ISpriteBody
2015-05-03 11:54:27 +03:00
Matthias Mailänder
d999617a3c add the flame animation 2015-05-03 08:50:06 +02:00
Matthias Mailänder
2db26c93ff fix an overlap when the harvester exits to the north 2015-05-03 08:45:35 +02:00
Paul Chote
2682dc4228 Move native deps script into thirdparty to avoid confusion. 2015-05-03 07:47:17 +02:00
Paul Chote
a11e9e348b Configure native dependencies from the makefile. 2015-05-03 07:47:15 +02:00
Paul Chote
89a1bdd4f1 Merge pull request #7475 from abcdefg30/perhealth
Convert the float health percentage to an int percentage
2015-05-03 08:35:58 +12:00
Matthias Mailänder
10e9c774a8 Merge pull request #8079 from penev92/bleed_make
Fix the Windows Make script
2015-05-02 18:45:51 +02:00
penev92
ccd5a56fdb Fix the Windows Make script 2015-05-02 14:04:29 +03:00
Matthias Mailänder
3bd4a97d11 Merge pull request #8068 from Phrohdoh/spawn-actors-power
SpawnActorPower no longer forces removal of the spawned actor.
2015-05-02 12:30:54 +02:00
Matthias Mailänder
cdc98013f7 readonly 2015-05-02 12:14:46 +02:00
Matthias Mailänder
84e247f1eb separate with newlines for readability 2015-05-02 12:14:46 +02:00
Matthias Mailänder
34cd717349 Merge pull request #8071 from pchote/remove-trait-test-plumbing
Remove plumbing for trait unit tests.
2015-05-02 11:34:54 +02:00
Oliver Brakmann
0cfa1d3b1e Merge pull request #8077 from Mailaender/appveyor-improve-cache
Improved AppVeyor build cache
2015-05-02 10:51:12 +02:00
Matthias Mailänder
ebfd6eb8f6 fix trait documentation leaving out certain namespaces 2015-05-02 10:09:22 +02:00
Matthias Mailänder
50ae255395 don't hardcode hidden mods 2015-05-02 10:07:26 +02:00
Matthias Mailänder
a3b5f5a9a2 separate docs by namespace 2015-05-02 10:06:33 +02:00
Matthias Mailänder
0b1c2135db don't redownload cached files 2015-05-02 08:07:41 +02:00
Matthias Mailänder
b87fcacf46 catch all nuget CLI downloads 2015-05-02 08:02:47 +02:00
Matthias Mailänder
7cbdc07ca3 add a looping sound trait 2015-05-02 06:59:57 +02:00
Paul Chote
9edc0675f0 Merge pull request #7953 from Mailaender/github-release-thirdparty
Removed all remaining binaries from thirdparty
2015-05-02 08:57:44 +12:00
Matthias Mailänder
7cef5cfbfd clean Windows dependencies as well 2015-05-01 21:49:13 +02:00
Matthias Mailänder
30a0eb6082 remove non-existent DLL from list 2015-05-01 21:49:13 +02:00
Matthias Mailänder
753045ca65 clean the thirdparty directory, too 2015-05-01 21:49:13 +02:00
Matthias Mailänder
a43d303eb7 use curl everywhere to run out of the box on Mac 2015-05-01 21:49:11 +02:00
Oliver Brakmann
3cda61a13a Merge pull request #8014 from abcdefg30/hijacksurvival
Fix a problem with hijackers in the survival maps
2015-05-01 15:58:47 +02:00
Matthias Mailänder
7be62f3bbb Merge pull request #7986 from abcdefg30/mtm
Updated Monster Tank Madness
2015-05-01 14:30:23 +02:00
abcdefg30
51433e7c64 Updated all maps with the utility 2015-05-01 14:16:21 +02:00
abcdefg30
95e3713b69 Add an upgrade rule 2015-05-01 14:16:20 +02:00
abcdefg30
8d2307db83 Convert the float health percentage to an int one 2015-05-01 14:16:19 +02:00
Matthias Mailänder
8a514ee143 remove outdated documentation 2015-05-01 11:45:12 +02:00
Matthias Mailänder
78588753e8 fetch Eluant from GitHub 2015-05-01 11:45:12 +02:00
Matthias Mailänder
adddf1245b fetch SDL2-CS from GitHub 2015-05-01 11:45:12 +02:00
Matthias Mailänder
732001f3f3 Merge pull request #7696 from Robmaister/bleed
Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types
2015-05-01 11:41:20 +02:00
Pavel Penev
dacf094956 Merge pull request #7981 from Mailaender/ts-apc
Added the amphibious mode to the Tiberian Sun APC
2015-05-01 11:52:27 +03:00
Matthias Mailänder
fa0ce88f70 change voxel image on water terrain type for APC 2015-05-01 10:37:17 +02:00
Paul Chote
b1e285f243 Remove Moq dependency. 2015-05-01 16:29:31 +12:00
David Jiménez
044b51742f Remove plumbing for trait unit tests. 2015-05-01 16:24:14 +12:00
Paul Chote
8d0acaaa4f Merge pull request #8053 from reaperrr/fix-td-bluetib-editor
Fixes blue tiberium not appearing in legacy editor (TD)
2015-05-01 14:10:54 +12:00
Paul Chote
68eb73fe34 Merge pull request #8063 from Phrohdoh/silent-curl
Silence curl output for OS X native dependencies.
2015-05-01 14:05:30 +12:00
Taryn Hill
7a4076630f SpawnActorPower no longer forces removal of the spawned actor. 2015-04-30 18:35:06 -05:00
sinf
5991a9b439 Added quick build feature 2015-05-01 01:40:26 +03:00
Pavel Penev
f9baa38169 Merge pull request #8067 from Phrohdoh/terms-sprite-effect
Correct terminology and add readonly modifiers in SpriteEffect.
2015-05-01 01:27:04 +03:00
Taryn Hill
d279e1dcee Correct terminology and add readonly modifiers in SpriteEffect. 2015-04-30 17:19:13 -05:00
abcdefg30
e6828aa1ff Fix a problem with hijackers in the survival maps 2015-04-30 22:37:43 +02:00
Oliver Brakmann
583b89eb17 Merge pull request #8001 from RoosterDragon/hardware-cursor-fixes
Hardware cursor fixes
2015-04-30 20:24:19 +02:00
Chris Forbes
16c61cb929 Merge pull request #8017 from pchote/map-definitions
Remove magic ActorReference/SmudgeReference parsing
2015-04-30 10:46:27 +12:00
Chris Forbes
1c0809962e Merge pull request #7898 from Phrohdoh/unload-terrain-types
Add UnloadTerrainTypes to Cargo.
2015-04-30 10:36:14 +12:00
Taryn Hill
af78370506 Silence curl output for OS X native dependencies. 2015-04-29 16:58:36 -05:00
Pavel Penev
2d5517fc23 Merge pull request #8057 from RoosterDragon/location-fix
Safer country lookup
2015-04-29 23:57:20 +03:00
Pavel Penev
bf0ee862b2 Merge pull request #8004 from pchote/remove-owner
Remove deprecated Buildable.Owner field.
2015-04-29 23:01:41 +03:00
Paul Chote
d255a3989e Upgrade mod rules. 2015-04-30 07:35:27 +12:00
Paul Chote
97b4509607 Remove deprecated Buildable.Owner field. 2015-04-30 07:35:27 +12:00
Matthias Mailänder
b1dd380db1 Merge pull request #8055 from pchote/scroll-mouseover
Update widget mouseover when scrolling panels.
2015-04-29 21:07:21 +02:00
Paul Chote
981f782cf9 Add a stub for upgrading map actors. 2015-04-30 07:06:14 +12:00
Paul Chote
4b1f541f34 Reorganize actor and smudge loading.
The actor and smudge definitions are now stored
as raw MiniYamlNodes in the map.  It is now the
responsibility of the consumers to parse these
into real objects.
2015-04-30 07:06:14 +12:00
Paul Chote
cd12dcc2ff Update widget mouseover when scrolling panels. 2015-04-30 07:01:52 +12:00
RoosterDragon
748b37ede7 Ensure we never return a null string from LookupCountry. 2015-04-29 19:27:49 +01:00
Oliver Brakmann
ea679d4557 Merge pull request #8054 from pchote/terrain-console
Separate terrain geometry visualization from DevMode.
2015-04-29 20:16:25 +02:00
Matthias Mailänder
f4ba56912f Merge pull request #8043 from pchote/exit-delays
Polish TS war factories.
2015-04-28 22:22:29 +02:00
Matthias Mailänder
6921cb904f Merge pull request #8052 from Phrohdoh/desc-cargo
Add Cargo descriptions.
2015-04-28 21:59:01 +02:00
Taryn Hill
92ba61b149 Add descriptions to CargoInfo members. 2015-04-28 13:48:44 -05:00
Paul Chote
f46e15c63e Separate terrain geometry visualization from DevMode.
Also adds a “terrainoverlay" console command.
2015-04-29 05:26:50 +12:00
reaperrr
365e7a9584 Fix blue tiberium not appearing in legacy editor (TD) 2015-04-28 16:20:08 +02:00
Paul Chote
413eaadb06 Polish TD weapons factory. Fixes #6651. 2015-04-28 19:34:24 +12:00
Paul Chote
dac9431ca3 Polish TS war factories. 2015-04-28 19:25:41 +12:00
Paul Chote
8e9a7fd08b Add an ExitDelay field to allow doors to open before exiting. 2015-04-28 19:18:44 +12:00
Paul Chote
ccf9d8fe97 Merge pull request #8047 from OpenRA/travis-mono-3.12
Updated Travis CI configuration to enforce Mono 3
2015-04-28 18:50:27 +12:00
Matthias Mailänder
c4bc974eb6 Update .travis.yml
define the mono version
2015-04-27 22:01:15 +02:00
Matthias Mailänder
4e950024d3 Merge pull request #8046 from obrakmann/fix_missing_infantry_in_legacy_editor
Fix missing infantry in the legacy editor
2015-04-27 21:28:43 +02:00
Matthias Mailänder
f9fa5cc9b0 Merge pull request #8038 from pchote/resource-slopes
Prevent resources from spawning on ramps.
2015-04-27 21:24:09 +02:00
Taryn Hill
f6a34aab9c Add UnloadTerrainTypes restriction to Cargo. 2015-04-27 12:23:29 -05:00
Oliver Brakmann
d92f4cedc5 Merge pull request #8045 from abcdefg30/fakeweap
Use WithProductionDoorOverlay on fake weap
2015-04-27 19:00:34 +02:00
Oliver Brakmann
22cd68e8f9 Fix missing infantry in the legacy editor
The editor is looking for actor types that implement ILegacyEditorRender, but infantry units don't anymore since #7638.

This moves ILegacyEditorRender to the root of the Render* inheritance tree, so that all actor types have access to it.
2015-04-27 17:52:14 +02:00
abcdefg30
a2c1993561 Merge pull request #7980 from pchote/animation-keys
Remove RenderSprites animation keys.
2015-04-27 17:48:41 +02:00
abcdefg30
cc61f904e0 Use WithProductionDoorOverlay on fake weap 2015-04-27 17:42:58 +02:00
Paul Chote
94f22638be Add an upgrade rule. 2015-04-27 19:47:12 +12:00
Paul Chote
614f96046c Remove RenderSprites animation keys. 2015-04-27 19:38:23 +12:00
Paul Chote
937d2070cc Add a palette for previewing depth info in the asset browser. 2015-04-27 19:21:55 +12:00
Paul Chote
b62d1cae78 Load tmp(ts) depth data. 2015-04-27 19:21:55 +12:00
Paul Chote
8b7453070a Include all the relevant palettes in the asset browser. 2015-04-27 19:21:55 +12:00
Paul Chote
098d69f120 Prevent resources from spawning on ramps. 2015-04-27 19:21:12 +12:00
abcdefg30
c4a63eee30 Merge pull request #7875 from penev92/bleed_exposePlayerReferences
Add upgrade rules support for map PlayerReferences
2015-04-26 22:53:42 +02:00
Oliver Brakmann
d6963567d9 Merge pull request #8034 from pchote/chrome-logic
Some chrome logic cleanups
2015-04-26 22:19:28 +02:00
penev92
2402b56da7 Reorganize PlayerReference loading to enable upgrade rules for them.
The PlayerReference definitions are now stored
as raw MiniYamlNodes in the map.
2015-04-26 23:16:20 +03:00
Oliver Brakmann
a6b8bdf978 Merge pull request #8027 from pchote/update-terrain-vertexbuffer
Update terrain layer when the terrain data changes.
2015-04-26 21:15:45 +02:00
Oliver Brakmann
354b45add7 Merge pull request #8025 from pchote/radar-updates
Use the correct (tile-based) radar color when updating the radar.
2015-04-26 20:30:54 +02:00
Oliver Brakmann
e7cbd5a41b Merge pull request #7937 from pchote/some-editor-prereqs
A collection of ActorPreview improvements.
2015-04-26 18:46:26 +02:00
Paul Chote
bf8e5169f6 Fix colorpicker preview. 2015-04-27 04:14:09 +12:00
Oliver Brakmann
db170f75e5 Merge pull request #8037 from OpenRA/osx-github-usercontent
Fixed Mac OS X dependencies pointing to a redirect
2015-04-26 18:06:38 +02:00
Oliver Brakmann
3ac12323db Merge pull request #8032 from OpenRA/ts-offline-speech-fix
Fixed "building online" played by power off and vice versa on Tiberian Sun
2015-04-26 17:26:12 +02:00
Matthias Mailänder
9bbed8adec Update configure
Fixes #8036
2015-04-26 17:24:49 +02:00
Matthias Mailänder
6653322096 Merge pull request #8011 from penev92/bleed_fixTakeCover
Move prone-related logic from DamageWarhead to TakeCover
2015-04-26 16:20:27 +02:00
Matthias Mailänder
fccbde3c36 Merge pull request #7534 from 42foobar42/nod4a
added mission nod4a
2015-04-26 16:10:31 +02:00
Matthias Mailänder
67c9df62c3 Merge pull request #7829 from sinf/hotkeys
Closes #7369
2015-04-26 16:02:08 +02:00
penev92
36abf2ac41 Add an upgrade rule for TakeCover 2015-04-26 14:29:12 +03:00
penev92
ea01439377 Add an upgrade rule for DamageWarheads 2015-04-26 14:29:10 +03:00
penev92
aa57d5f956 Move prone-related logic from DamageWarhead to TakeCover
Add DamageTypes to DamageWarhead and DamageTypeModifiers to TakeCover
2015-04-26 14:29:08 +03:00
Paul Chote
e0ac3df373 Split perf widgets into their own file. 2015-04-26 23:21:02 +12:00
Paul Chote
da70683c03 Split OrderButtonsChromeLogic into smaller classes. 2015-04-26 23:21:02 +12:00
Alexander Boll
0f0c400657 added mission nod4a
Polish nod04a a bit
2015-04-26 12:59:23 +02:00
Paul Chote
f4987f7258 Add support for multiple logic objects on a widget. 2015-04-26 19:30:28 +12:00
Matthias Mailänder
45ffac350f fix d2k harvester sand overlay 2015-04-26 09:22:23 +02:00
Matthias Mailänder
996445a178 fix the Multiply blend mode 2015-04-26 09:22:23 +02:00
Matthias Mailänder
63e4d40770 add alpha channel to every possible blend mode 2015-04-26 09:22:19 +02:00
Matthias Mailänder
a84345f5d3 add water wakes to APC 2015-04-26 08:54:10 +02:00
Paul Chote
1b31001661 Merge pull request #7974 from Mailaender/ts-hover-wakes
Added the Hovercraft wake animation
2015-04-26 18:50:42 +12:00
Paul Chote
57db20da5d Merge pull request #8028 from RoosterDragon/cache-traits
Cache traits
2015-04-26 18:23:15 +12:00
Paul Chote
8a171bb452 Don’t export certain Init types. 2015-04-26 18:12:21 +12:00
Matthias Mailänder
b5ff247fa5 fix the cnc mpspawn and waypoint palettes 2015-04-26 18:12:21 +12:00
Paul Chote
a2af79ff98 Add support for wall preview neighbours. 2015-04-26 18:12:20 +12:00
Paul Chote
76202a9f6a Fix turret preview z-offsets. 2015-04-26 18:12:20 +12:00
Paul Chote
d5541accda Fix custom palettes in actor previews. 2015-04-26 18:12:20 +12:00
Paul Chote
1256ddc6a6 Account for bibs in ActorPreviews. 2015-04-26 18:12:19 +12:00
Paul Chote
56bf0f36a8 Fix crate actor previews. 2015-04-26 18:12:19 +12:00
Paul Chote
09bad3f0ef Account for damage state in ActorPreviews. 2015-04-26 18:12:19 +12:00
Matthias Mailänder
6d03eef998 Update sounds-generic.yaml
switch building online/offline
2015-04-26 07:31:51 +02:00
Pavel Penev
ef55cb6528 Merge pull request #7862 from Mailaender/ts-factory-doors
Fixed the Tiberian Sun weapon factory doors
2015-04-26 01:12:11 +03:00
Paul Chote
8f93d7b5d7 Simplify and fix animation glitches. 2015-04-25 22:52:14 +02:00
Matthias Mailänder
75624560d2 remove trailing tabs 2015-04-25 22:52:14 +02:00
Matthias Mailänder
b07d125d18 add an upgrade rule 2015-04-25 22:52:14 +02:00
Matthias Mailänder
8c8b9b1cc3 deprecate RenderBuildingWarFactory 2015-04-25 22:52:14 +02:00
Matthias Mailänder
9a37e77d1a fix the weapon factory door opening animation 2015-04-25 22:52:14 +02:00
Matthias Mailänder
9c20de7d98 readonly and don't sync cosmetic traits 2015-04-25 22:52:14 +02:00
RoosterDragon
fb0cab7481 Cache results of TraitsImplementing calls.
If a class is caching the TraitsImplementing enumerable, instead cache the results of enumerating it to an array. The avoids having to enumerate the sequence each time it is needed.
2015-04-25 20:42:27 +01:00
RoosterDragon
2937a31463 Make IsDisabled a method on Actor.
This allows us to cache the disabled traits, which simplifies life for some callers since we relieve them of having to cache it, as well as improving perf for all IsDisabled calls.
2015-04-25 20:42:26 +01:00
RoosterDragon
500a33b590 Cache some trait lookups that occur frequently. 2015-04-25 20:41:49 +01:00
RoosterDragon
6125d7c117 Rename existing fields that are caching TraitsImplementing calls for consistency. 2015-04-25 20:41:48 +01:00
Paul Chote
7df12cb3e9 Update terrain layer when the terrain data changes. 2015-04-26 07:35:07 +12:00
Paul Chote
acee680083 Use the correct (tile-based) radar color when updating the radar. 2015-04-26 07:19:57 +12:00
RoosterDragon
087b407f46 Avoid ScrollPanelWidget drawing invisible child items.
If child items in a scroll panel will be outside the scissor area, then we can avoid drawing them at all. If a scroll panel has many items, this reduces to the draw cost closer to those visible in the panel, rather than costing for all the items.
2015-04-25 18:55:47 +01:00
RoosterDragon
60238a858d Load replays asynchronously and in parallel.
This prevents the UI blocking, and also speeds up loading time for getting all the replays displayed.
2015-04-25 18:55:46 +01:00
RoosterDragon
d2d2f4a838 Made FieldLoader thread-safe, and cache some expensive reflection calls. 2015-04-25 18:55:46 +01:00
RoosterDragon
109ccbb0b0 Added ConcurrentCache, a thread-safe Cache. 2015-04-25 18:55:45 +01:00
Oliver Brakmann
a48a878a71 Merge pull request #7983 from pchote/radar-colors
Adjust IRadarSignature to support per-cell colors.
2015-04-25 16:38:28 +02:00
Robert Rouhani
5d4ca1d52f Fixed bug where the SDL2 directory wouldn't be deleted 2015-04-25 10:33:20 -04:00
Robert Rouhani
d3528d6ed8 Removed zlib from NSIS script 2015-04-25 10:30:01 -04:00
Robert Rouhani
7ccd5521e0 Removed zlib dependency and chose a specific version of SharpFont.Dependencies. 2015-04-25 10:30:00 -04:00
Robert Rouhani
4987a6b24c Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types. 2015-04-25 10:26:41 -04:00
abcdefg30
2a80642c6a Add a new line at the end of descriptions for better readability 2015-04-25 15:47:18 +02:00
abcdefg30
100a58e12c Use OnPlayerDiscovered instead of OnEnteredFootprint
in Monster Tank Madness
2015-04-25 15:47:17 +02:00
Oliver Brakmann
bc7fd81297 Merge pull request #7840 from sinf/fix7838
Fixed parsing of hotkeys with no name (such as tilde)
2015-04-25 14:19:25 +02:00
sinf
5e86e63b37 Fixed parsing of hotkeys with no name (such as tilde) 2015-04-25 15:01:00 +03:00
Matthias Mailänder
175e9a14b7 Merge pull request #8000 from pchote/bogus-yaml-removals
Fix yaml merging
2015-04-25 13:42:18 +02:00
Matthias Mailänder
14777e46c4 Merge pull request #7933 from pchote/new-osx-launcher
New OSX launcher
2015-04-25 12:41:28 +02:00
Oliver Brakmann
ed5e8beedd Merge pull request #7978 from pchote/orca
Fix orca’s flying sequences.
2015-04-25 12:30:40 +02:00
sinf
9250c61473 Added Hotkeys for support powers 2015-04-25 13:15:06 +03:00
Paul Chote
722f4725d5 Fix orca’s flying sequences. 2015-04-25 22:06:02 +12:00
Matthias Mailänder
70db0fa784 add the Hovercraft wake animation 2015-04-25 11:26:59 +02:00
Oliver Brakmann
76ff0eddb9 Merge pull request #7908 from penev92/bleed_minimapCheat
Add a DevCommand for enabling the minimap
2015-04-25 11:13:23 +02:00
Matthias Mailänder
1476a0eb70 Merge pull request #7847 from RoosterDragon/screen-map-refactor-perf
Refactored ScreenMap & improved perf of updates, removals and region lookups
2015-04-25 10:12:52 +02:00
Paul Chote
6b79af4d62 Merge pull request #7957 from Mailaender/ts-powerdown-indicator-palette
Fixed Tiberian Sun building repair and power down indicator palette
2015-04-25 19:50:21 +12:00
Matthias Mailänder
a5f60deedd fix TS repair indicator palette 2015-04-25 09:36:20 +02:00
Paul Chote
d8f24adcc7 Merge pull request #7853 from Mailaender/alpha-experiments
Added AlphaImage support
2015-04-25 19:03:25 +12:00
Paul Chote
e452aba9e4 Merge pull request #7850 from Mailaender/appveyor-cache
Tried to cache AppVeyor downloads
2015-04-25 18:57:57 +12:00
Paul Chote
1e30fdb333 Merge pull request #7909 from reaperrr/projectile-cleanup2
Projectiles cleanup Part 2
2015-04-25 18:41:06 +12:00
Paul Chote
27127dd1a9 Merge pull request #7907 from rneatherway/nuget-version-fix
Remove version information from NuGet folder names
2015-04-25 18:28:45 +12:00
Paul Chote
69fed6a688 Merge pull request #7865 from Phrohdoh/deploy-to-upgrade
Implement DeployToUpgrade.
2015-04-25 18:11:34 +12:00
Paul Chote
4116da7c01 Merge pull request #7857 from sinf/glgl
Print GLSL info log if shader compilation fails
2015-04-25 17:56:32 +12:00
Paul Chote
ddc3bd3a1f Merge pull request #7887 from Mailaender/unhardcode-render-sequence
Unhardcoded and self-documented render sequences
2015-04-25 17:35:07 +12:00
Pavel Penev
479e81d7f5 Merge pull request #7944 from LunaticEdit/bleed
EndOfStream first chance exceptions on server
2015-04-25 07:17:24 +03:00
Pavel Penev
6d64217769 Merge pull request #7863 from Mailaender/global-palette-effect
Added a global palette effect for day/night lighting
2015-04-25 07:11:01 +03:00
Pavel Penev
f759530964 Merge pull request #7854 from sinf/tsnotifications
Add more TS notification sounds
2015-04-25 07:06:57 +03:00
Pavel Penev
f372f0c466 Merge pull request #7726 from Phrohdoh/prevent-eod
Prevent EjectOnDeath.
2015-04-25 07:03:00 +03:00
Pavel Penev
c9e89cc7f5 Merge pull request #7832 from Phrohdoh/cleanup
Another cleanup.
2015-04-25 06:53:16 +03:00
Pavel Penev
494d2f274a Merge pull request #7463 from Smith00101010/gdi05b
Added CnC: gdi05b
2015-04-25 06:48:06 +03:00
reaperrr
b100091ad1 Merge pull request #7967 from abcdefg30/tsfixes
Add descriptions to all TS units
2015-04-25 01:25:26 +02:00
abcdefg30
158659abcf Add descriptions for all buildable actors 2015-04-24 16:32:15 +02:00
RoosterDragon
09dc1db651 Refactored ScreenMap & improved perf of updates, removals and region lookups.
Reduce code duplication by extracting a common class to deal with spatial partitioning of actors, and use some (cached) delegates to reduce duplication further without affecting performance too much.

Speed up updates and removal of actors by caching their location so we only need to update or remove them from bins they are actually in (typically very few), compared to having to check every bin for removals which is much more work in comparison.

Speed up checking for actors inside a region by checking if items are located entirely within the bin they are located in. If so, we don't need to add them to the hash-set for de-duplication purposes which is fairly expensive.
2015-04-23 21:06:09 +01:00
Pavel Penev
f6051b1e2b Merge pull request #8007 from obrakmann/fix8006_carryall_dead_cargo_crash
Clean up state properly when a Carryall's cargo has died
2015-04-23 00:24:44 +03:00
Oliver Brakmann
3924e2643d Clean up state properly when a Carryall's cargo has died 2015-04-22 21:51:01 +02:00
Paul Chote
8a1f9261c3 Convert hidden [Desc] to a <summary>. 2015-04-22 21:24:48 +12:00
Paul Chote
44f2dd5a3d Extract common inherits in ra defaults.yaml. 2015-04-22 21:24:47 +12:00
Paul Chote
2cbe269c1e Support multiple inheritance for actor rules. 2015-04-22 21:24:47 +12:00
Paul Chote
8de497925d Fix map yaml removals. 2015-04-22 21:24:47 +12:00
Paul Chote
7dd51663b6 Fix the MiniYaml unit tests. Fixes #7999. 2015-04-22 19:58:10 +12:00
Paul Chote
29b7bc4d79 Restore RallyPoint removal in soviet-01. 2015-04-22 19:58:10 +12:00
Paul Chote
0a43b3da72 Rewrite yaml merging block removal.
Fixes #2922, #6818.
2015-04-22 19:58:10 +12:00
RoosterDragon
13078c820b Retry hardware cursor creation.
On Windows, a spurious error sometimes occur when creating cursors. We retry a few times before before having to give up and fall back to software cursors.
2015-04-21 20:46:22 +01:00
RoosterDragon
c963806dae Prevent leaking of hardware cursors.
Added the lacking finialization machinery, ensured disposal under exceptional circumstances and also ensure the game calls dispose on old cursors before creating new ones.
2015-04-21 20:46:21 +01:00
Matthias Mailänder
b4fa704fbd Merge pull request #7950 from penev92/bleed_fixRaHarvester
Change the RA harvester SHP file
2015-04-20 21:50:15 +02:00
Matthias Mailänder
132b5e34c4 Merge pull request #7984 from abcdefg30/watchfix
Fix an issue in EnemyWatcher.cs
2015-04-20 21:05:02 +02:00
Oliver Brakmann
70b7d3ac47 Merge pull request #7992 from reaperrr/d2k-zoffsets
Made sure spice blooms are drawn below harvesters
2015-04-20 16:28:26 +02:00
reaperrr
6e7a6cef5e Merge pull request #7852 from Mailaender/gaspot-regression-fix
Fixed GASPOT again
2015-04-20 16:24:40 +02:00
Paul Chote
58161d6178 Merge pull request #7990 from obrakmann/fix7988_d2k_score_screen_misalignments
Fix alignment issues in the score screen
2015-04-20 21:06:16 +12:00
reaperrr
11d759c59c Merge pull request #7985 from Mailaender/ts-transforms
Fixed the offsets for Tiberian Sun transformable units
2015-04-20 10:53:45 +02:00
Paul Chote
796b2caca1 Merge pull request #7972 from abcdefg30/tsfixes2
Some general polish in TS
2015-04-20 18:40:25 +12:00
Paul Chote
7bb25ec913 Merge pull request #7880 from Mailaender/ts-crates
Added the Tiberian Sun crates
2015-04-20 17:40:42 +12:00
Paul Chote
4fb076ac92 Merge pull request #7843 from reaperrr/ts-inf-seq
Cleaned up TS infantry and player structure sequences
2015-04-20 15:50:48 +12:00
abcdefg30
273a78b889 Added BuildLimit: 1 to CYC2 2015-04-19 21:52:56 +02:00
Matthias Mailänder
dbfd8da6c4 fix the artillery voxel lighting 2015-04-19 21:51:54 +02:00
abcdefg30
c0b8fce427 Remove the interval hack from gdi05a 2015-04-19 21:48:15 +02:00
abcdefg30
1c44f30e2c Fix an issue in EnemyWatcher.cs 2015-04-19 21:48:14 +02:00
Matthias Mailänder
6fc1627f99 Update README.md
add some additional new-lines to fix problems with local Markdown scripts
2015-04-19 20:34:10 +02:00
reaperrr
1655a1462d Made sure spice blooms are drawn below harvesters all the time 2015-04-19 19:54:28 +02:00
Oliver Brakmann
5e2b7add6e Fix alignment issues in the score screen 2015-04-19 19:23:20 +02:00
reaperrr
1df2f5e387 Merge pull request #7989 from pchote/oops
Fix a regression from #7976.
2015-04-19 19:18:21 +02:00
Paul Chote
4b22436d14 Fix a regression from #7987. 2015-04-20 04:55:31 +12:00
Oliver Brakmann
322801247f Merge pull request #7987 from pchote/fix-player-bogosity
Fix random country display.
2015-04-19 18:13:04 +02:00
Paul Chote
3cfa96e7a6 Fix random country display. 2015-04-20 03:33:46 +12:00
Matthias Mailänder
450b427d98 fix transform offsets 2015-04-19 16:23:18 +02:00
Pavel Penev
5676c55082 Merge pull request #7976 from pchote/subcell-crash
Don’t crash when asking for the offset of an invalid subcell.
2015-04-19 13:40:47 +03:00
Paul Chote
145f7b28f5 Adjust IRadarSignature to support per-cell colors. 2015-04-19 22:27:47 +12:00
Paul Chote
ab7706073b Don’t crash when asking for the offset of an invalid subcell. 2015-04-19 15:20:45 +12:00
Matthias Mailänder
e8493ab855 fix TS power down palette 2015-04-18 14:11:51 +02:00
Matthias Mailänder
9a6e8467da fix GASPOT again 2015-04-18 13:47:20 +02:00
reaperrr
dd689de0e6 Fixed alphatst.shp 2015-04-18 13:41:53 +02:00
Matthias Mailänder
fdf58b29e2 setup the alpha image lighting for the light spot 2015-04-18 13:41:53 +02:00
Matthias Mailänder
868e404b22 add 2 new blend modes: Multiplicative, DoubleMultiplicative 2015-04-18 13:41:53 +02:00
Matthias Mailänder
d5cbf82889 add the Tiberian Sun crates 2015-04-18 13:25:45 +02:00
Pavel Penev
9df371b393 Merge pull request #7970 from obrakmann/fix-rgb-map-previews
Fix RGB map previews
2015-04-18 14:15:53 +03:00
Oliver Brakmann
cda7310b25 Convert RGB map preview image files to RGBA 2015-04-18 11:35:01 +02:00
Oliver Brakmann
b363c2c51e Don't unnecessarily discard 24bpp map previews
Those images now get converted on-the-fly by the game.
2015-04-18 11:27:23 +02:00
Matthias Mailänder
7157cc0a9f unhardcode and self-document render sequences 2015-04-18 08:44:43 +02:00
abcdefg30
2ebd2cac98 Remove bogus hotkey ("Hothey") definition 2015-04-17 22:19:34 +02:00
abcdefg30
e7724eeb2e Correct TRNSPORT prerequisites 2015-04-17 22:19:33 +02:00
abcdefg30
dab0cd7bda Added BuildLimit: 1 to GHOST and HMEC 2015-04-17 22:19:32 +02:00
abcdefg30
03e81f9739 Fix HMEC walking animation 2015-04-17 22:19:31 +02:00
abcdefg30
6b9a359bce Adjust some selection bounds
No idea what regressed them.
2015-04-17 22:18:57 +02:00
penev92
b4112dc2c3 Change RA harv.shp 2015-04-17 23:12:21 +03:00
Oliver Brakmann
fe8b3d91b1 Merge pull request #7951 from RoosterDragon/fix-browser-images
Fix mod browser previews
2015-04-17 21:52:38 +02:00
Pavel Penev
8f05d8a931 Merge pull request #7966 from obrakmann/fix7927
Allow players locked to unplayable factions in the lobby
2015-04-17 12:37:49 -07:00
Oliver Brakmann
28310ce2fc Allow players locked to unplayable factions in the lobby 2015-04-17 20:50:15 +02:00
abcdefg30
3f333b0f0a Merge pull request #7948 from penev92/bleed_fixCarryalls
Fix carryalls unreserving issue
2015-04-17 20:47:00 +02:00
RoosterDragon
9c93001c84 Convert to 32bbp internally in FastCopyIntoSprite.
This avoids the need for callers to ensure the pixel format is correct, but ensures that the copying succeeds when the format is different.
2015-04-17 18:50:49 +01:00
Oliver Brakmann
f77d6f6044 Merge pull request #7959 from Rydra/upstream/pathfinderFix
BugFix for #7955
2015-04-16 22:22:26 +02:00
abcdefg30
cfa59d611a Merge pull request #7844 from reaperrr/ts-rules-split
Split TS rules for infantry, structures and vehicles
2015-04-16 22:00:38 +02:00
reaperrr
62bb9677a6 Remove obsolete gagreen sequence
and removed a superflous newline
2015-04-16 21:47:38 +02:00
Pavel Penev
0dfbc7b651 Merge pull request #7961 from reaperrr/fix-preview-bpp
Convert TD and D2k previews to 32bpp
2015-04-16 10:49:23 -07:00
reaperrr
8b07c0826b Convert TD and D2k previews to 32bpp 2015-04-16 19:12:16 +02:00
David Jiménez
6d96a43341 Fixes #7955. Improves pathfinder performance a bit. 2015-04-15 23:43:14 +02:00
Matthias Mailänder
012226c481 Merge pull request #7952 from RoosterDragon/cache-render-traits
Cache render traits in Actor
2015-04-15 07:01:22 +02:00
penev92
665c82305e Fix carryalls telling carryables to unreserve when they are reserved for a different carryall;
Reserve carryable in FreeActorWithDelivery
2015-04-15 00:40:06 +03:00
RoosterDragon
106816a547 Cache the IRenderModifier and IRender traits in Actor.
Previously we just cached the query object, but now we cache the full results. This avoids having to re-evaluate them every render.
2015-04-14 20:15:45 +01:00
abcdefg30
af1dfd3d17 Merge pull request #7947 from penev92/bleed_diplomacyWindow
Fix flag-related crash for scripted "players"

Closes: #7929
2015-04-14 15:20:39 +02:00
LunaticEdit
575b568c6a EndOfStream first chance exceptions on server
The server class reads the memory stream in a forever loop until an
EndOfStreamException occurs. This causes repeated first chance
exceptions due to EndOfStreamException. This change verifies that the
memory stream's reader position is not past the length of the memory
stream.
2015-04-13 19:09:32 -04:00
penev92
cc73ba09ab Fix flag-related crash for scripted "players" 2015-04-13 23:36:29 +03:00
Moshe Schmidt
7d6f367d84 Added CnC: gdi05b 2015-04-13 22:31:51 +02:00
reaperrr
fbb245d569 Removes armament pistol from TS civilian default
Adds pistols to civ1 and civ3.
2015-04-13 17:31:49 +02:00
reaperrr
f7a20ceb62 Clean up infantry sequences 2015-04-13 17:11:52 +02:00
Taryn Hill
0717ca57ea Implement DeployToUpgrade.
Expose some deploy-related cursors to yaml.
2015-04-13 10:04:03 -05:00
reaperrr
24057ee5bb Clean up structure sequences
Now that we have tileset codes, those bitrotted file name definitions are no longer needed.
2015-04-13 17:00:01 +02:00
Robin Neatherway
2dba45ebac Remove version information from NuGet folder names
This makes the names consistent and prevents changes in versions of
dependencies from breaking the build.
2015-04-13 15:41:17 +01:00
Paul Chote
03572ecb3a Remove binaries from thirdparty/osx dir. 2015-04-12 21:22:26 +01:00
Paul Chote
85cd7308b4 Replace OSX launcher with a native-code version.
- Binary files hosted externally.
- Fixes dialogs hijacking Finder.
- Fixes dock icon being lost when restarting.
- Adds openra:// url handling.
- Adds .orarep file handling.
- Minimum OS X version is now 10.6.
2015-04-12 21:21:46 +01:00
reaperrr
1c06f43924 Redistribute defense/support structure rules for more consistency 2015-04-12 19:10:51 +02:00
reaperrr
cebdcdddc9 Rename yamls for actors available to both sides from player-* to shared-* 2015-04-12 19:10:51 +02:00
reaperrr
194fe8d926 Improve rules yaml order in mod.yaml a little 2015-04-12 19:10:50 +02:00
reaperrr
71b9665ad6 structures.yaml split into faction-specific structure and defense yamls 2015-04-12 19:10:49 +02:00
reaperrr
bc7af30ae9 Split TS vehicles.yaml into gdi-, nod- and player-vehicles.yaml 2015-04-12 18:59:55 +02:00
reaperrr
4fe72d95c3 Rename civilian.yaml to civilian-structures.yaml
Move Sandbags to civilian structures.
Remove GAGREEN.
2015-04-12 18:59:54 +02:00
reaperrr
f1cb333d6b Split TS infantry.yaml into gdi-, nod- and player-infantry.yaml 2015-04-12 18:59:53 +02:00
Paul Chote
70c9bca847 Merge pull request #7936 from obrakmann/fix7935_random_factions_in_missions
Allow non-selectable factions for players if LockRace is set
2015-04-12 17:49:39 +01:00
abcdefg30
8b090423a3 Merge pull request #7924 from Mailaender/windmill
Added the windmill to the Red Alert civilian buildings
2015-04-12 18:30:58 +02:00
Oliver Brakmann
7b1b17df4a Allow non-selectable factions for players if LockRace is set 2015-04-12 15:27:25 +02:00
Matthias Mailänder
cae7d7cffa add the windmill 2015-04-12 13:31:56 +02:00
abcdefg30
83e9c51940 Merge pull request #7923 from Mailaender/lighthouse
Added a lighthouse to the Red Alert civilian buildings
2015-04-12 13:13:43 +02:00
Matthias Mailänder
18064370ee Merge pull request #7919 from RoosterDragon/fix-previews
Fix custom map previews
2015-04-12 12:52:25 +02:00
Matthias Mailänder
fc0ad15a5b Merge pull request #7915 from obrakmann/fix7911_osx_freetype_lib_path
Fix path to freetype library in SharpFont's .dll mapping for OS X
2015-04-12 12:50:25 +02:00
Matthias Mailänder
0cde0c1224 add the light house 2015-04-12 08:11:13 +02:00
RoosterDragon
84dffce7c1 Added an extension method to clone bitmaps with a 32bbpArgb pixel format. 2015-04-11 21:05:46 +01:00
RoosterDragon
c1787a8368 Don't process images with the wrong pixel format in MapCache. 2015-04-11 15:20:16 +01:00
Matthias Mailänder
56405f42ab add a global palette effect for day/night ambient 2015-04-11 12:05:25 +02:00
Oliver Brakmann
1a21421217 Merge pull request #7921 from ScottNZ/balance-stuff
Move ra silo to defense queue
2015-04-11 11:39:49 +02:00
ScottNZ
79ca6a401a Move ra silo to defense queue 2015-04-11 17:10:47 +12:00
Oliver Brakmann
b6f015641e Fix path to freetype library in SharpFont's .dll mapping for OS X 2015-04-11 00:11:52 +02:00
RoosterDragon
7883355481 Validate PixelFormat of source bitmap argument in FastCopyIntoSprite. 2015-04-10 19:54:03 +01:00
RoosterDragon
5dfcc3e9d0 Convert custom map previews that are not using PixelFormat.Format32bppArgb. 2015-04-10 19:54:02 +01:00
Matthias Mailänder
03e25c73d8 Merge pull request #7910 from obrakmann/make-docs-with-version
Set version before creating docs
2015-04-10 20:22:33 +02:00
reaperrr
6e14d96815 Merge pull request #7912 from Mailaender/ts-missile-silo-owner-fix
Fixed the missile silo being visible to GDI commanders
2015-04-10 13:17:18 +02:00
reaperrr
b45dd32242 Merge pull request #7914 from penev92/bleed_authors
Add penev92 to AUTHORS
2015-04-10 12:49:28 +02:00
Oliver Brakmann
8bb19defd6 Only set the version once in appveyor.yaml 2015-04-10 12:10:12 +02:00
penev92
e3012ae505 Enable minimap toggling via the DisableShroud dev command 2015-04-10 09:42:07 +03:00
penev92
fd674962e3 Add penev92 to AUTHORS 2015-04-10 09:19:02 +03:00
Matthias Mailänder
7a4f7527a4 fix missile silo being visible to GDI commanders 2015-04-10 06:36:36 +02:00
reaperrr
6b7ffdc1b7 De-hardcoded GravityBomb idle and opening sequence
Avoid checking for sequence if Image is null.
2015-04-10 00:39:34 +02:00
reaperrr
b7bb719173 De-hardcoded LaserZap animation sequence 2015-04-10 00:39:32 +02:00
Oliver Brakmann
9aa16c95da Set version before creating docs
Since the version string gets embedded into the created documentation.
2015-04-10 00:13:19 +02:00
Taryn Hill
96d6ea79ce Remove explicit private.
Remove unnecessary delegate.
Use extension method syntax.
Fix HealthInfo.NotifyAppliedDamage’s desc.
Remove unused using directives.
Remove explicit type declaration in Manifest.
2015-04-09 13:59:20 -05:00
Pavel Penev
87b7cc4527 Merge pull request #7906 from reaperrr/public-classes
Made JamsMissiles and Hovers classes public
2015-04-09 07:10:01 -07:00
reaperrr
94c5ef7260 Make JamsMissiles and Hovers classes public 2015-04-09 15:38:49 +02:00
Pavel Penev
6a66cea01f Merge pull request #7903 from obrakmann/fix_allies01_power
Fix issues in Allies01 and Monster Tank Madness
2015-04-08 10:23:24 -07:00
Oliver Brakmann
f5579bc749 Fix tooltips in mission Monster Tank Madness 2015-04-08 15:55:00 +02:00
Oliver Brakmann
1c1a9f3065 Fix power levels in mission Allies01 2015-04-08 15:54:34 +02:00
Pavel Penev
0617eb2e59 Merge pull request #7881 from ScottNZ/balance-stuff
Misc ra balance changes, pt. 2
2015-04-07 16:12:38 -07:00
Pavel Penev
37ec903c67 Merge pull request #7896 from reaperrr/missile-hit
Tweaks RA and TD helicopter weapon minimum ranges
2015-04-07 16:07:47 -07:00
reaperrr
7ddd6aab93 Make helicopters move backwards when target is too close
'Too close' as in closer than weapons' MinRange.
2015-04-08 00:51:24 +02:00
Pavel Penev
66e8545eaa Merge pull request #7894 from obrakmann/fix_7890_7893
Fix issues in latest playtest
2015-04-07 14:52:51 -07:00
reaperrr
a37babf0c1 Tweaked TD aircraft weapon minimum ranges. 2015-04-07 23:52:16 +02:00
reaperrr
ebcde3922d Tweaked/added RA helicopter weapon minimum ranges. 2015-04-07 23:52:14 +02:00
Oliver Brakmann
5ddce9a197 Merge pull request #7897 from reaperrr/flaktruck-art
Fixed empty pixels on flak truck art
2015-04-07 21:58:28 +02:00
Taryn Hill
2bac9f6c64 Add interface IPreventsEjectOnDeath. 2015-04-07 14:02:27 -05:00
reaperrr
0b79141252 Fixed empty pixels on flak truck art 2015-04-07 18:11:49 +02:00
Oliver Brakmann
197f60b2a5 Mark running games as password protected as well
Fixes #7893
2015-04-07 17:35:03 +02:00
Oliver Brakmann
a992318208 Fix "ally" suffix being wrongly assigned to enemy players
Fixes #7890
2015-04-07 17:34:54 +02:00
ScottNZ
ce88dc3112 Remove orphaned armor airdrop icon and sequences 2015-04-08 02:33:24 +12:00
ScottNZ
c2c661de82 Decrease power requirement of tsla from 150 to 100 2015-04-08 02:33:23 +12:00
ScottNZ
99945e1154 Increase power requirement of mslo from 100 to 150 2015-04-08 02:33:23 +12:00
ScottNZ
15c548c60a Have build limit of 1 for pdof and mslf 2015-04-08 02:33:22 +12:00
ScottNZ
011433041d Rename 'Allied' to 'Allies' in faction selector 2015-04-08 02:33:22 +12:00
ScottNZ
65aa4b369e Spread out parabombs badgers 2015-04-08 02:33:21 +12:00
ScottNZ
7aca8d426b Increase parabombs support power charge time to 360 2015-04-08 02:33:21 +12:00
ScottNZ
540148038d Increase Ukraine parabombs badger squad size to 3 2015-04-08 02:33:20 +12:00
ScottNZ
f142fb4e09 Remove vanilla Allies and vanilla Soviet countries from multiplayer 2015-04-08 02:33:20 +12:00
ScottNZ
5653b3cbf3 Move fake structures to France 2015-04-08 02:33:20 +12:00
ScottNZ
8e1960452b Remove advanced gap generator 2015-04-08 02:33:19 +12:00
ScottNZ
461cf89676 Make paratroopers available to all Soviet factions 2015-04-08 02:33:19 +12:00
ScottNZ
0442c790da Rework Russia's abilities to be Tesla-themed 2015-04-08 02:33:18 +12:00
reaperrr
bcb75869c7 Merge pull request #7866 from obrakmann/fix-fall-rates
Fix fallrates for parachutable things to match lowered release altitude
2015-04-07 14:16:01 +02:00
Pavel Penev
0dbfce258a Merge pull request #7885 from obrakmann/fix7884_td_create_server_mapchooser_crash
Fix crash in TD's server creation dialog
2015-04-06 18:40:49 -07:00
Oliver Brakmann
2b62284fc7 Fix crash in TD's server creation dialog 2015-04-06 15:44:06 +02:00
Paul Chote
27c4512ec7 Import lighting parameters for TS maps. 2015-04-06 08:50:08 +02:00
Pavel Penev
cd9589eaa0 Merge pull request #7868 from Mailaender/mono-2.10-CS0172
Fixed CS0172 compile error on Fedora 21
2015-04-05 08:50:29 -07:00
Oliver Brakmann
6329563c03 Merge pull request #7867 from OpenRA/tsbuilder-makefile
Remove a forgotten TilesetBuilder reference from the Makefile
2015-04-05 13:49:40 +02:00
Matthias Mailänder
a8b9026876 fix CS0172 2015-04-05 12:46:41 +02:00
Matthias Mailänder
2eb996751b Update Makefile
remove last TilesetBuilder reference
2015-04-05 12:26:00 +02:00
Oliver Brakmann
f7a02eeca5 Fix fallrates for parachutable things to match lowered release altitude 2015-04-05 12:23:32 +02:00
sinf
73ef8f855a Print GLSL info log if shader compilation fails 2015-04-05 11:03:28 +03:00
Matthias Mailänder
3f48c649f0 Merge pull request #7722 from penev92/bleed_diplomacyWindow
Closes #7391
2015-04-05 08:34:38 +02:00
sinf
9ada9fb343 Add more TS notification sounds 2015-04-05 00:42:36 +03:00
Pavel Penev
a013cf4fca Merge pull request #7842 from obrakmann/change_aircraft_altitude
Lower aircraft altitude
2015-04-04 14:18:20 -07:00
Pavel Penev
be0eaee6cc Merge pull request #7864 from Mailaender/ra-logo
Removed the grain effect from the Red Alert logo
2015-04-04 13:59:01 -07:00
Pavel Penev
0190382104 Merge pull request #7839 from obrakmann/fix7836_gdi05a_crash
Fix issues in gdi05a
2015-04-04 13:50:57 -07:00
Matthias Mailänder
5409c04066 use the new vectorized hammer & sickle as a template 2015-04-04 22:41:41 +02:00
penev92
2c108a1845 Use proper names and flags for unknown players 2015-04-04 17:24:19 +03:00
Matthias Mailänder
cc82e7c527 Merge pull request #7841 from Mailaender/ra-announce-yaml-polishing
Removed AnnounceOnSeen from Red Alert and fixed Lint warnings
2015-04-04 14:22:29 +02:00
Oliver Brakmann
a3f875b8a8 Merge pull request #7845 from reaperrr/mapcontrol-remove
Removed map control from player statistics for performance reasons
2015-04-04 13:24:07 +02:00
Matthias Mailänder
109392e7f9 try to cache the native DLL dependencies 2015-04-04 12:01:13 +02:00
Matthias Mailänder
611067da7e try to cache build dependency downloads 2015-04-04 12:00:58 +02:00
Matthias Mailänder
612f18edd8 Merge pull request #7846 from obrakmann/turn-to-attack-delay-v2
Expose turn-to-attack delay to yaml, v2
2015-04-04 10:54:50 +02:00
reaperrr
e25247f259 Removes map control from player statistics for performance reasons 2015-04-04 01:38:54 +02:00
Oliver Brakmann
b1d3486561 Expose Plane turn-to-attack delay to yaml 2015-04-04 00:10:06 +02:00
Oliver Brakmann
32ed63727d Revert "Expose Plane turn-to-attack delay to yaml."
This reverts commit 02da41e5c5.
2015-04-03 23:42:35 +02:00
Oliver Brakmann
a8d7140c1a Merge pull request #7815 from Phrohdoh/aircraft-turn-timing
Expose Plane turn-to-attack delay to yaml.
2015-04-03 23:15:41 +02:00
Oliver Brakmann
4ca27234e6 Merge pull request #7686 from reaperrr/custom-visibility-update
Skip visibility updates when fog & shroud are disabled via lobby
2015-04-03 20:58:56 +02:00
Matthias Mailänder
fd143a5eb0 remove EnemyWatcher from RA 2015-04-03 17:04:43 +02:00
Oliver Brakmann
ba977c040f gdi05a: ensure base discovery trigger fires in time 2015-04-03 16:27:48 +02:00
Oliver Brakmann
d53cfafde9 Lower aircraft altitude
In order to work around a problem where the game does not take aircrafts' altitude into account when deciding whether a unit should be rendered or not, leading to aircrafts seemingly (dis)appearing a couple of cells into the map instead of right at the lower edge of the map.

Planes will now fly at the default altitude of 1280, helicopters slightly below at 1024.
2015-04-03 16:19:27 +02:00
Matthias Mailänder
016e8cd6fe remove automatic EnemyUnitsApproaching notification for D2k 2015-04-03 16:18:41 +02:00
Matthias Mailänder
d0046f804a remove AnnounceOnSeen from Red Alert mod again
closes #7787
2015-04-03 15:36:44 +02:00
Matthias Mailänder
a6af357646 fix OpenRA.Lint Warning
Sprite image camera.* from actor camera.* has no sequence definition
2015-04-03 15:35:29 +02:00
Matthias Mailänder
a8bf90f8b2 Merge pull request #7746 from RoosterDragon/shroud-vis-perf
Speed up frozen actor visibility updates.
2015-04-03 15:20:10 +02:00
Matthias Mailänder
8494ad0a38 Merge pull request #7834 from RoosterDragon/avoid-preventable-allocations
Avoid preventable allocations
2015-04-03 13:52:46 +02:00
RoosterDragon
3885ca3f14 Speed up frozen actor visibility updates.
Cache the isVisibleTest function in the ctor for FrozenActor. The footprint never changes so the test will always be valid.
2015-04-03 12:21:03 +01:00
Oliver Brakmann
253d97ca5d Fix sandbag ownership and build prerequisites for gdi05a 2015-04-03 13:16:57 +02:00
Pavel Penev
cedfe5c0b5 Merge pull request #7734 from RoosterDragon/frozen-lazy-render
Lazily generate frozen actor renderables.
2015-04-03 04:16:19 -07:00
Oliver Brakmann
1070d752f3 Turn event handler into no-op for captured factories in gdi05a 2015-04-03 13:14:25 +02:00
Pavel Penev
39dfbb5505 Merge pull request #7837 from Mailaender/ts-building-overlay-translucency
Added transparency to the Tiberian Sun building placement overlay
2015-04-03 03:39:44 -07:00
Paul Chote
98b8078f7d Merge pull request #7573 from bvandenbogaard/bleed
Added audio.bag/audio.idx support used in RA2
2015-04-03 11:35:54 +01:00
Matthias Mailänder
5733c049e1 Merge pull request #7715 from RoosterDragon/random-prevent-crash
Only evaluate input sequence once in RandomOrDefault.
2015-04-03 12:27:20 +02:00
Matthias Mailänder
bf588c1cf2 transparent build overlay 2015-04-03 12:03:39 +02:00
Paul Chote
070d8ea6a2 Merge pull request #7811 from reaperrr/new-blendmodes1
Added two new BlendModes
2015-04-03 10:57:12 +01:00
Matthias Mailänder
f785f15bf4 Merge pull request #7798 from reaperrr/ts-weapons01
Split TS weapons.yaml and fix weapons and aircraft
2015-04-03 11:56:21 +02:00
Paul Chote
94360655c3 Merge pull request #7830 from obrakmann/fix7824_allies03b_crash
Fix crash in allies03b
2015-04-03 10:44:05 +01:00
Matthias Mailänder
de2860358f Merge pull request #7814 from Phrohdoh/default-image
Image reference in 'Defaults' sequence block.
2015-04-03 10:36:29 +02:00
Matthias Mailänder
39b42a35a0 Merge pull request #7823 from RoosterDragon/celllayer-enumerator
Fix CellLayer.GetEnumerator
2015-04-03 10:13:16 +02:00
Paul Chote
5f7b9b7621 Merge pull request #7827 from obrakmann/fix-refund-tooltip-margins
Fix margins of refund tooltips
2015-04-03 01:13:04 +01:00
RoosterDragon
b66db23adf Only evaluate input sequence once in RandomOrDefault.
This ensures non-deterministic sequences cannot crash by returning an empty sequence on the second evaluation.
2015-04-03 01:08:30 +01:00
Pavel Penev
78afbffbc8 Merge pull request #7835 from reaperrr/fix-ps-check
Fixed make.ps1 'check' command
2015-04-02 15:12:41 -07:00
reaperrr
d72cec6275 Fix make.ps1 'check' command 2015-04-02 23:19:49 +02:00
RoosterDragon
287ead56b3 Avoid allocating a delegate and new list in every tick of RepairableBuilding. 2015-04-02 21:41:22 +01:00
RoosterDragon
ab2ef0ba03 Improve performance of target validation.
The Warhead and WeaponInfo classes now maintain preconstructed sets of valid and invalid targets to speed up validation checks since LINQ Intersect no longer has to be called (which recreates the sets internally each time).

Fixed minor bugs in the AI where it was repeating the validation logic but failing to account for invalid targets.
2015-04-02 21:11:12 +01:00
Pavel Penev
5ac648600d Merge pull request #7794 from ScottNZ/balance-stuff
Misc ra balance changes
2015-04-02 11:47:38 -07:00
Oliver Brakmann
92e0dbd864 Merge pull request #7822 from RoosterDragon/map-cache-dispose-fix
Ensure MapCache disposes cleanly.
2015-04-02 20:26:02 +02:00
Oliver Brakmann
b1f6136b98 Fix crash in allies03b 2015-04-02 19:06:16 +02:00
Taryn Hill
58f32a11f8 Merge pull request #7828 from obrakmann/fix7821_pbog_crash_td
Fix crash when placing buildings in TD.
2015-04-02 11:38:35 -05:00
Oliver Brakmann
0406e8e708 Add $-sign to refund tooltip 2015-04-02 18:35:34 +02:00
Oliver Brakmann
5e7a71edf5 Fix crash when placing buildings in TD
Caused by production queues being tied to buildings, not the player, in TD.
PBOG would therefore try to find the PlaceBuilding trait, which is on the player, on the conyard actor and crash.
2015-04-02 18:04:19 +02:00
reaperrr
4fc58b4491 Skip shroud/fog calculations when both are disabled via lobby option. 2015-04-02 00:42:51 +02:00
RoosterDragon
9c0d3d737d Fix CellLayer.GetEnumerator. 2015-04-01 22:52:36 +01:00
reaperrr
6dc577ed6f Make all aircraft repairable on GDI repair bay, make all armed aircraft rearmable on both helipads 2015-04-01 23:49:01 +02:00
reaperrr
32bed06df5 Fix Orca Bomber and Banshee Fighter flight behavior and reloading 2015-04-01 23:49:00 +02:00
reaperrr
0efce0e94a Brings TS weapons more in line with the original's rules
Adds trails to missiles.
2015-04-01 23:48:59 +02:00
reaperrr
fbfc38fe1b Fix TS weapon names to match the original 2015-04-01 22:42:01 +02:00
reaperrr
ca67407358 Split TS weapons.yaml into several categorized yamls 2015-04-01 22:42:01 +02:00
reaperrr
40d73db9fd Added BlendModes to TS EMP explosion and Ion Cannon explosion 2015-04-01 22:01:26 +02:00
reaperrr
883e3822c6 Tweak D2k artillery missiles speed and angle.
Additionally, remove bogus properties (leftovers from projectile change)
2015-04-01 22:01:25 +02:00
reaperrr
10f205b43d Reduce brightness of several D2k weapon effects via new blend modes 2015-04-01 22:01:24 +02:00
RoosterDragon
47e2c48068 Ensure MapCache disposes cleanly.
This prevents the map loading thread writing to disposed objects which can have unintended side effects.
2015-04-01 20:58:09 +01:00
Oliver Brakmann
cc1da824cd Merge pull request #7820 from Mailaender/oldlength-ancient-mono-fix
Removed unused oldLength
2015-04-01 21:39:56 +02:00
reaperrr
c0448fce3e Adds two new BlendModes. 2015-04-01 21:16:01 +02:00
Matthias Mailänder
dc3f82f537 Merge pull request #7816 from Phrohdoh/cleanups
Small code cleanup.
2015-04-01 20:53:42 +02:00
Matthias Mailänder
4cc016c3d0 remove unused oldLength
closes #7808
2015-04-01 19:43:56 +02:00
Taryn Hill
4ed53c5952 Simplify return statements.
Remove redundant ‘this’.
Remove unused using directives.
Simplify LINQ chains.
Add some trait property descriptions.
Add readonly where viable.
Add fullstops to some yaml descriptions.
2015-04-01 12:33:17 -05:00
Chris Forbes
14e9cfd433 Merge pull request #7812 from pchote/modules
Pluggable upgrade modules
2015-04-02 05:25:48 +13:00
Oliver Brakmann
ff77d2d029 Fix margins of refund tooltips 2015-04-01 17:14:41 +02:00
Taryn Hill
28ea59854e Merge pull request #7748 from pchote/heightmap-input
Account for terrain height and slope when calculating order location.
2015-04-01 07:57:33 -05:00
Taryn Hill
02da41e5c5 Expose Plane turn-to-attack delay to yaml.
Require Plane in some ctors.
2015-04-01 00:12:20 -05:00
Taryn Hill
32083344aa Set place to default image for TS’ overlay sequence. 2015-03-31 21:37:28 -05:00
Taryn Hill
f41497b421 Allow Defaults: image in sequence definitions. 2015-03-31 21:36:50 -05:00
Taryn Hill
e066c893eb Remove unnecessary image references in ts/sequences/misc. 2015-03-31 21:36:15 -05:00
Paul Chote
704e3656b4 Implement Ion Cannon Uplink upgrade. 2015-03-31 22:32:13 +01:00
Paul Chote
a89029acf0 Implement GDI power turbines upgrade. 2015-03-31 22:32:13 +01:00
Paul Chote
0c5be6183f Implement GDI component tower upgrades. 2015-03-31 22:32:13 +01:00
Paul Chote
ebd09f196c Add upgrade support to SupportPower. 2015-03-31 22:32:12 +01:00
Paul Chote
e440d00585 Add upgrade support to WithIdleOverlay. 2015-03-31 22:32:12 +01:00
Paul Chote
5c18220636 Add upgrade support to WithTurret. 2015-03-31 22:32:11 +01:00
Paul Chote
42f3fa7439 Add upgrade support to WithMuzzleFlash. 2015-03-31 22:23:44 +01:00
Paul Chote
ee12257d24 Fix RenderRangeCircle for disabled Armaments. 2015-03-31 22:23:43 +01:00
Paul Chote
a9e1c09d82 Add upgrade support to DetectCloaked. 2015-03-31 22:23:43 +01:00
Paul Chote
4597895ea3 Add upgrade support to AttackBase. 2015-03-31 22:23:43 +01:00
Paul Chote
d1839701bb Add Plug and Pluggable for building actor-specific upgrades. 2015-03-31 22:23:41 +01:00
reaperrr
c0c7ad1035 Merge pull request #7806 from Phrohdoh/ts-placement-marker
Expose PlaceBuilding palette and use palette.pal for TS' overlay.
2015-03-31 23:19:02 +02:00
Taryn Hill
79a0ab0667 Use palette.pal for the TS foundation overlay. 2015-03-31 15:26:16 -05:00
Taryn Hill
c6c52eac7d Expose and document the palette used
by PlaceBuildingOrderGenerator for
the structure placement overlay
2015-03-31 15:26:04 -05:00
Paul Chote
57a6fff6ce Don’t crash if the click location is outside the map. 2015-03-31 20:59:53 +01:00
Paul Chote
c0fa025b74 Indicate current mouseover cell in TerrainGeometryOverlay. 2015-03-31 20:59:53 +01:00
Paul Chote
1e54b19bd3 Implement heightmap-aware view -> cell conversion. 2015-03-31 20:59:53 +01:00
Paul Chote
c68cb995f4 Move cell corner state into Map. 2015-03-31 20:59:52 +01:00
Paul Chote
49624e335c Remove legacy DIY view -> world conversions. 2015-03-31 20:59:52 +01:00
Paul Chote
2630537daf Fix a mistake in Map.CellContaining.
Fixes #6247.
2015-03-31 20:59:52 +01:00
Taryn Hill
0d5588f08a Merge pull request #7772 from pchote/remove-tilesetbuilder
Remove OpenRA.TilesetBuilder.
2015-03-31 14:56:02 -05:00
Paul Chote
878a0f7008 Remove OpenRA.TilesetBuilder.
This project has not been maintained in years,
and has been outright broken for a significant
amount of this period.
2015-03-31 20:42:37 +01:00
reaperrr
360f3bc2f8 Merge pull request #7776 from pchote/ts-buildables
Remove bogus buildable actors from TS.
2015-03-31 21:05:15 +02:00
Paul Chote
9ac3e57afd Fix EMP icon. 2015-03-31 19:11:38 +01:00
Paul Chote
f0414d2ec0 Make special structures unbuildable. 2015-03-31 19:11:38 +01:00
Paul Chote
a3ba925458 Make special vehicles unbuildable. 2015-03-31 19:11:38 +01:00
Paul Chote
1f4fe0a44d Move civilian vehicles to their own yaml file. 2015-03-31 19:11:37 +01:00
Paul Chote
7b330e23e2 Make special aircraft unbuildable. 2015-03-31 19:11:37 +01:00
Paul Chote
b6ca5102b4 Fix mutant hijacker. 2015-03-31 19:11:37 +01:00
Paul Chote
fbca912207 Make mission-specific and civilian infantry unbuildable. 2015-03-31 19:11:22 +01:00
Paul Chote
f7e1140268 Merge pull request #7771 from reaperrr/d2k-yaml-cleanup1
Fixes D2k muzzle/firing offsets and cleans sequences
2015-03-31 17:55:13 +01:00
Paul Chote
9fdd43ed41 Merge pull request #7789 from Phrohdoh/ts-starting-units
Add light, medium, and heavy starting units to TS.
2015-03-31 17:45:54 +01:00
Paul Chote
cca1ccab1f Merge pull request #7796 from MustaphaTR/3-orni
D2K - 3 Ornithopter
2015-03-31 17:42:13 +01:00
Paul Chote
b9ac0ec077 Merge pull request #7792 from reaperrr/ts-shell-titan
Fix TS shellmap music and Titan selection box
2015-03-31 17:40:12 +01:00
Benno van den Bogaard
8cf7c46c8f Added audio.bag/audio.idx support used in RA2 2015-03-31 18:13:20 +02:00
Oliver Brakmann
bec56ee5b6 Merge pull request #7784 from reaperrr/fix-ctor-regressions
Fixes #7764, #7780...
2015-03-31 00:06:01 +02:00
Oliver Brakmann
c9a4f9c126 Merge pull request #7757 from pchote/ts-tileset-variants
Add support for TS-style random tile variants.
2015-03-30 23:25:05 +02:00
reaperrr
83b702343e Fixes #7764, #7780 and other potential regressions introduced by #7671. 2015-03-30 21:51:29 +02:00
Paul Chote
84e85d8a5d Rename Image -> Images. 2015-03-30 20:20:36 +01:00
Paul Chote
4be5334a0e Add support for TS-style random tile variants. 2015-03-30 19:44:53 +01:00
Mustafa Alperen Seki
71874392b7 3 Ornithopter 2015-03-30 17:35:23 +02:00
ScottNZ
d3f2a8677e Spy Plane ability is no longer special compared to the other factions, so remove it from the Soviet faction description 2015-03-31 00:01:40 +13:00
ScottNZ
925f838e6d Update some infantry tooltip descriptions 2015-03-30 23:55:22 +13:00
ScottNZ
5a29febe97 Increase shroud reveal range of shok from 4 cells to 5 2015-03-30 23:55:22 +13:00
ScottNZ
c193b91b4f Increase shok range from 3.5 cells to 6 2015-03-30 23:55:21 +13:00
ScottNZ
b62a710fd9 Remove sniper (make it unbuildable) 2015-03-30 23:55:20 +13:00
ScottNZ
f7893534f5 Make spy plane available to all Soviet factions 2015-03-30 23:55:20 +13:00
ScottNZ
5e3457a046 Buff pillbox against infantry 2015-03-30 23:55:19 +13:00
reaperrr
0b4ec5a815 Merge pull request #7770 from penev92/bleed_starportCarryall
Bring back carryall.starport and fix trike.starport's prerequisites
2015-03-30 02:13:46 +02:00
reaperrr
ad808a4ad0 Fixes Titan selection box, improves Wolverine selection box. 2015-03-30 02:04:52 +02:00
reaperrr
ba0b934c38 Fix TS shellmap music 2015-03-30 02:04:51 +02:00
Taryn Hill
410d9325e3 Add light, medium, and heavy starting units to TS. 2015-03-29 14:50:05 -05:00
reaperrr
57dab6ccc1 Fix D2k gun tower to use tank muzzle 2015-03-29 14:23:09 +02:00
Paul Chote
dcebbf211c Merge pull request #7754 from Phrohdoh/crlf-to-lf
Replace CRLF with LF in TilesetBuilder/defaults.yaml.
2015-03-29 12:17:19 +01:00
reaperrr
25d5daf6f5 Fixes/improves D2k firing offsets.
- Raider/Stealth Raider
- Bazooka infantry
- Devastator
- Gun Tower
2015-03-29 12:42:47 +02:00
reaperrr
05426562cd D2k sequence cleanups and gun turret muzzle fix 2015-03-29 12:42:46 +02:00
penev92
df759172c0 Bring back carryall.starport and fix trike.starport's prerequisites 2015-03-29 13:06:51 +03:00
Pavel Penev
975cb3101f Merge pull request #7765 from Mailaender/voxel-shadow-palette
Documented the voxel shadow palette
2015-03-29 02:27:21 -07:00
Oliver Brakmann
9b1ef23c3c Merge pull request #7768 from OpenRA/revert-7761-appveyor-artifacts-kiss
Revert "Deploy with just OpenRA-Setup.exe"
2015-03-29 11:09:51 +02:00
Oliver Brakmann
ebe8e1dc4d Merge pull request #7766 from Mailaender/appveyor-make-version
Fixed the missing version tag in the Windows installer
2015-03-29 11:08:52 +02:00
Matthias Mailänder
105417e7c1 Revert "Deploy with just OpenRA-Setup.exe" 2015-03-29 10:30:57 +02:00
Matthias Mailänder
e289be1557 tag the version on Windows 2015-03-29 08:24:47 +02:00
Matthias Mailänder
c5a1141711 un-hardcode and self-document the shadow palette 2015-03-29 08:17:20 +02:00
Matthias Mailänder
91d4a1ce66 Update README.md
linkfix
2015-03-28 23:58:09 +01:00
Matthias Mailänder
6666f1ec46 Merge pull request #7762 from Mailaender/appveyor-after-test
Package after the units tests instead of before deploy
2015-03-28 23:33:55 +01:00
Matthias Mailänder
fb3ea081a1 before before deploy 2015-03-28 23:20:16 +01:00
Oliver Brakmann
4a69687311 Merge pull request #7761 from Mailaender/appveyor-artifacts-kiss
Deploy with just OpenRA-Setup.exe
2015-03-28 23:00:30 +01:00
Matthias Mailänder
dc9b193925 KISS 2015-03-28 22:53:41 +01:00
Matthias Mailänder
49835b2f7a Merge pull request #7760 from Mailaender/appveyor-artifact-name
Yet another attempt to fix AppVeyor deployment
2015-03-28 22:22:45 +01:00
Matthias Mailänder
766b9d6aa3 try a different syntax for environment variables 2015-03-28 22:01:33 +01:00
Matthias Mailänder
e454e6dcb1 name the artifact 2015-03-28 21:53:39 +01:00
Matthias Mailänder
3bcc94c182 Merge pull request #7759 from obrakmann/fix-wiki-update
Fix wiki update to match travis' idea of branch names
2015-03-28 21:15:23 +01:00
Oliver Brakmann
858a8331b1 Merge pull request #7758 from Mailaender/appveyor-artifacts
Tried to fix AppVeyor deployment
2015-03-28 21:14:42 +01:00
Oliver Brakmann
6f54f8e616 Fix wiki update to match travis' idea of branch names 2015-03-28 21:00:17 +01:00
Matthias Mailänder
324dcf0e8a try to simplify/fix the artifacts filter 2015-03-28 20:57:42 +01:00
Matthias Mailänder
e886f64785 Merge pull request #7756 from pchote/fix-ts-palette
Fix TS player palette definition.
2015-03-28 20:17:49 +01:00
Paul Chote
77a56c95f1 Fix TS player palette definition.
Regression from #7699.
2015-03-28 19:11:44 +00:00
Oliver Brakmann
820df840a3 Merge pull request #7755 from Mailaender/powershell-utf8
Enforced UTF8 encoding for pandoc
2015-03-28 20:07:49 +01:00
Matthias Mailänder
f287fb9c10 enforce UTF8 encoding for pandoc 2015-03-28 19:45:11 +01:00
penev92
a26be8188c Hide faction for players who randomed in diplomacy and objectives panels 2015-03-28 20:44:05 +02:00
Taryn Hill
3faea1bfc0 Replace CRLF with LF in TilesetBuilder/defaults.yaml 2015-03-28 12:53:34 -05:00
Matthias Mailänder
b59bdce194 Merge pull request #7753 from obrakmann/fix-appyveyor
Fix appveyor build again
2015-03-28 18:20:21 +01:00
Oliver Brakmann
ba7b2ac6bd Reverse arguments to pandoc 2015-03-28 18:15:29 +01:00
Oliver Brakmann
93af7b7677 Merge pull request #7752 from Mailaender/pandoc-appveyor-fix
Trying to fix pandoc in the AppVeyor build again
2015-03-28 18:00:43 +01:00
Matthias Mailänder
f6d740b4b7 absolute path for pandoc 2015-03-28 16:55:43 +01:00
Matthias Mailänder
8f1f2e8999 prepare for Chocolatey (v0.9.9) 2015-03-28 16:54:58 +01:00
Oliver Brakmann
2cf53f0e13 Merge pull request #7747 from reaperrr/ra-tent-fix
Made RA tent art tileset-specific again
2015-03-28 16:22:40 +01:00
reaperrr
c32631de9b Merge pull request #7699 from x-a-n-a-x/new-TS-build-palette-skin
Added a new Tiberian Sun mod build palette skin
2015-03-28 16:15:22 +01:00
Paul Chote
9b11b0fd41 Merge pull request #7607 from Mailaender/html-local-markdown
Brought back the HTML documentation for NSIS
2015-03-28 14:55:00 +00:00
Matthias Mailänder
5733e3832e Merge pull request #7749 from pchote/remove-legacy-extensions
Remove GlobalFilesystem.OpenWithExts.
2015-03-28 15:27:03 +01:00
Paul Chote
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
reaperrr
2a6f69345d Removes the desert conversions of walls.
The files aren't used by the game anymore and just confuse the legacy editor.
2015-03-28 13:38:08 +01:00
reaperrr
557b479f40 Makes ra tent art tileset-specific again 2015-03-28 12:43:12 +01:00
Matthias Mailänder
99283da84f Merge pull request #7723 from RoosterDragon/batch-shroud-cell-changes
Batch shroud cell changes
2015-03-28 12:16:30 +01:00
x-a-n-a-x
a8d5542422 Added a new Tiberian Sun mod build palette skin 2015-03-28 10:10:45 +01:00
Matthias Mailänder
87d2aa062a Merge pull request #7710 from pchote/radar-geometry-fix
Fix radar origin for non-square widgets.
2015-03-28 10:01:06 +01:00
reaperrr
fe09cef825 Merge pull request #7745 from pchote/ts-snow
Add snow tileset and artwork to TS.
2015-03-28 01:26:41 +01:00
reaperrr
764c082478 Merge pull request #7741 from pchote/ra-remove-legacy-parsing
Disable legacy sequence parsing in RA.
2015-03-28 00:45:46 +01:00
Oliver Brakmann
18c59bdb7f Merge pull request #7671 from reaperrr/random-optimisations
More constructor caching and minor random optimisations
2015-03-27 23:40:11 +01:00
Oliver Brakmann
66c56ac47a Merge pull request #7678 from delftswa2014/feature/aicheats
Money cheat for all players and AI
2015-03-27 23:02:37 +01:00
Oliver Brakmann
7739f59d62 Merge pull request #7703 from reaperrr/d2k-trails
Fixed D2k trails and deviator explosion color
2015-03-27 22:27:20 +01:00
RoosterDragon
d44830c945 Inline the equality test in CPos.Equals for performance. 2015-03-27 19:50:09 +00:00
RoosterDragon
1853ddde94 Use MPos indexer for CellLayer in Shroud.
This reduces us to one conversion per cell rather than two or three.
2015-03-27 19:50:07 +00:00
RoosterDragon
1584018dcd Batch shroud cell changes.
By maintaining a set of changed cells we can avoid repeating work for cells that change multiple times before being rendered. The shroud renderer and radar widget now delay their work until they must render, and thus process each changed cell only once. This avoids significant repetition that was causing major slowdown when many actors were in the world.
2015-03-27 19:50:05 +00:00
reaperrr
663d434457 Fix sniper electro death anim.
Closes #7742.
2015-03-27 17:35:16 +00:00
reaperrr
b7fc275067 RA sequence cleanups.
Note: Removing Length: * from interior boxes and larvae as well as barrels
is intentional, boxes have just 1 frame, and frames 2+3 of larvae and
barrels are just duplicates of the first, added by Westwood to work around
damage stage issues.

Fixes fence palette on desert maps.
2015-03-27 17:35:16 +00:00
Paul Chote
08aa1e86a9 Disable legacy sequence parsing in RA. 2015-03-27 17:35:15 +00:00
reaperrr
6f244d5e3c Fix D2k missile trails and deviator explosion 2015-03-27 13:59:34 +01:00
reaperrr
8bc31a4ae2 Make smoke trail palette customisable, add player color trail support to bullets & missiles 2015-03-27 13:59:33 +01:00
reaperrr
9e2da0d2df Add support for player color explosions to CreateEffectWarhead 2015-03-27 13:51:13 +01:00
reaperrr
b52d055eec Misc constructor caching
Cache trait look-ups in constructor for various other traits and
activities.
2015-03-27 13:47:04 +01:00
reaperrr
1e9d1a6cb7 Cache trait look-ups in the constructor where possible for Air activities/traits 2015-03-27 13:47:04 +01:00
Pavel Penev
9a780ba07d Merge pull request #7738 from pchote/cnc-remove-legacy-parsing
Disable legacy sequence parsing in TD.
2015-03-27 02:58:41 -07:00
Pavel Penev
7179ec6ffb Merge pull request #7639 from reaperrr/projectile-cleanup
Remove TurboBoost and various other Projectile cleanups
2015-03-27 01:46:54 -07:00
reaperrr
b5c74c63c9 Make variable bullet angle and speed independent from each other 2015-03-27 00:11:33 +01:00
reaperrr
d531d29791 Add/tweak some descriptions and streamline style/organisation of
projectile and explosion effects code
2015-03-27 00:11:32 +01:00
reaperrr
1cc900b269 Yaml style fixes to reduce future --upgrade-mod "noise" a little 2015-03-27 00:11:32 +01:00
reaperrr
33cb4fe3e1 Projectile refactoring upgrade rules 2015-03-27 00:11:31 +01:00
reaperrr
c92b2298c3 Remove missile TurboBoost 2015-03-27 00:04:39 +01:00
reaperrr
2a4719b88b Rename Missile ROT to RateOfTurn 2015-03-27 00:04:38 +01:00
reaperrr
f9332c9efe Renames BlocksBullets to BlocksProjectiles and projectile High property to Blockable 2015-03-27 00:04:37 +01:00
reaperrr
fb710f15bb Move projectile palette definition from weapon to projectile effects 2015-03-27 00:04:36 +01:00
Pavel Penev
c61dc48548 Merge pull request #7324 from reaperrr/limitedammo2
Refactored LimitedAmmo to AmmoPool
2015-03-26 15:59:56 -07:00
Paul Chote
4e1a02e35e Add snow test map. 2015-03-26 22:42:44 +00:00
Paul Chote
0a6e21d908 Support tileset-specific art in TS. 2015-03-26 22:42:43 +00:00
Paul Chote
a9f6e09afd Add TS snow tileset. 2015-03-26 22:42:43 +00:00
Paul Chote
a2b423e4f9 Add a(nother) workaround for the legacy editor. 2015-03-26 22:41:46 +00:00
Paul Chote
549c0bf382 Disable legacy sequence parsing in TD.
Removes unused `powerdown` sequences.
2015-03-26 22:41:46 +00:00
Paul Chote
7ad2f3e104 Support tileset-specific sprite definitions. 2015-03-26 22:41:45 +00:00
reaperrr
c51afd837c Upgrade rules for LimitedAmmo -> AmmoPool refactoring 2015-03-26 23:21:02 +01:00
reaperrr
38d5163062 Refactors LimitedAmmo to AmmoPool.
Removes Reloads trait.

This enables adding multiple AmmoPools via @ differentiators and
Name which adds the possibility to assign each armament to a specific
ammo pool.

Furthermore, this moves all Reloads functionality onto AmmoPool.

Now a combination of all three is possible on a single actor: no limited
ammo, limited ammo that can reload on its own, and limited ammo which
needs to be reloaded at a rearm actor.

Additionally moves RearmSound from Minelayer to AmmoPool.
2015-03-26 23:21:01 +01:00
Matthias Mailänder
43b4bfc9e5 Merge pull request #7706 from penev92/bleed_fixDisguise
Fix for the EnemyWatcher-Disguise trait interaction
2015-03-26 22:35:18 +01:00
Matthias Mailänder
ab2db13b3c Merge pull request #7736 from abcdefg30/allies05aFIX
Fixes #7735
2015-03-26 22:26:31 +01:00
Matthias Mailänder
4084140716 Merge pull request #7731 from pchote/ts-tileset-fixes
Fix TS/RA2 tileset importer and apply correctness fixes to TS temperate.
2015-03-26 22:13:31 +01:00
penev92
460d0b84a6 Fix EnemyWatcher's interaction with disguised actors 2015-03-26 15:20:26 +02:00
Paul Chote
bbee16db99 Fix TS tileset. 2015-03-25 19:59:09 +00:00
Paul Chote
5d0eecd4c5 Don’t crash on bogus TerrainTiles. 2015-03-25 19:59:09 +00:00
Paul Chote
c5625d0d70 Fix radar color keys. 2015-03-25 19:59:09 +00:00
Paul Chote
a76bc3e188 Include sprite extension in imported tilesets. 2015-03-25 19:59:08 +00:00
Paul Chote
23bbe23603 Update imported tile types.
Using data provided by @tomsons26.
2015-03-25 19:59:08 +00:00
Oliver Brakmann
6fca67e7f6 Merge pull request #7664 from penev92/bleed_harvesterInsurance
Implement Carryall edge spawn, harvester delivery by carryall and harvester insurance for D2k
2015-03-25 20:03:00 +01:00
Oliver Brakmann
15af43d9b4 Merge pull request #7674 from obrakmann/fix7414_debian_dependencies
Add MaxMind GeoIP2's dependencies to debian package
2015-03-25 19:14:01 +01:00
abcdefg30
7c7e5efc4f Fix a fatal error in allies05a 2015-03-25 16:15:49 +01:00
reaperrr
036f2459bf Merge pull request #7732 from pchote/tsra2-reverses
Clean up sequence key loading and add Reverses field for TS/RA2.
2015-03-25 06:41:44 +01:00
Matthias Mailänder
b5779b2583 Merge pull request #7733 from pchote/d2k-remove-legacy-parsing
Disable legacy sequence parsing in D2K.
2015-03-24 22:16:12 +01:00
RoosterDragon
777a57af62 Lazily generate frozen actor renderables.
Previously actors that could be frozen under fog but were currently visible would be rendered by the frozen under fog system constantly in order to keep a copy of the renderables ready to go for the frozen counterpart when the actor became invisible. Instead, we now delay this extra rendering until the actor actually becomes invisible. This eliminates the wasted rendering to generate renderables that were never used.
2015-03-24 21:08:27 +00:00
Paul Chote
9b33d7b1e5 Disable legacy sequence parsing in D2K. 2015-03-24 18:01:30 +00:00
Paul Chote
4baf639130 Add a Reverses sequence key for TS/RA2 animations. 2015-03-24 17:37:08 +00:00
Paul Chote
4d60757611 Simplify sequence field parsing. 2015-03-24 17:37:08 +00:00
Taryn Hill
8d8db8d90d Merge pull request #7707 from pchote/tileset-fixes
Automated correctness fixes for tileset definitions.
2015-03-24 09:03:34 -05:00
Oliver Brakmann
60319aa500 Add MaxMind GeoIP2's dependencies to debian package
It would have been easier to just depend on libnewtonsoft-json5.0-cil, but that is only available in Ubuntu 14.04 and higher.
2015-03-24 14:30:22 +01:00
Paul Chote
52624912fe Work around bogus tiles. 2015-03-23 20:33:24 +00:00
Paul Chote
92452271fe Use per-tile color in minimap. 2015-03-23 20:33:23 +00:00
Paul Chote
491c851c87 Fix D2K tileset. 2015-03-23 20:33:23 +00:00
Paul Chote
dd36c5094c Fix TD tilesets. 2015-03-23 20:32:29 +00:00
Paul Chote
6e1307d08d Fix RA tilesets. 2015-03-23 20:32:28 +00:00
Paul Chote
ec77e15e54 Add a utility command to fix implicit tile definitions. 2015-03-23 20:32:28 +00:00
Paul Chote
8844defb44 Fix TileSet.Save(). 2015-03-23 20:32:28 +00:00
Taryn Hill
ab63d3f7df Merge pull request #7714 from Mailaender/d2k-black-tile-removal
Removed legacy ARRAKIS tiles.
2015-03-23 15:15:28 -05:00
Matthias Mailänder
2f1aae59eb don't crash so easily 2015-03-23 21:03:26 +01:00
Matthias Mailänder
edbb31afe1 remove mistaken templates 2015-03-23 21:03:24 +01:00
Matthias Mailänder
2223b0a43b Merge pull request #7719 from reaperrr/fix-wda-crashes
Disables WithDeathAnimation for deployed TS units
2015-03-23 20:30:24 +01:00
Taryn Hill
c68becb1ea Merge pull request #7721 from abcdefg30/smallpolish
Small polish.
2015-03-23 12:28:55 -05:00
abcdefg30
f84882ce9c Replace spaces with tabs 2015-03-23 17:27:53 +01:00
abcdefg30
fb8ac18522 Fix the wrong indentation in PerfHistory.cs 2015-03-23 17:27:52 +01:00
abcdefg30
c5a5bb0844 Add a missing space in the Template description 2015-03-23 17:27:51 +01:00
reaperrr
e65453de24 Disables WithDeathAnimation for deployed TS units (Tick Tank, Arty, Sensor Array, ICBM launcher)
Fixes crash when destroying them.
2015-03-23 14:56:40 +01:00
reaperrr
3c4d712b78 Merge pull request #7708 from pchote/sequence-utility
Add a utility command for checking sequences.
2015-03-23 13:19:42 +01:00
Paul Chote
d631d8b780 Merge pull request #7711 from Mailaender/d2k-sietch-offset
Fixed the Sietch sprite offset
2015-03-22 22:31:59 +00:00
reaperrr
bbabf4e2e7 Merge pull request #7712 from Mailaender/grid-above-spice
Fixed spice being drawn above the grid
2015-03-22 22:49:23 +01:00
reaperrr
09a0d83936 Merge pull request #7577 from RoosterDragon/shroud-visibility-perf
Speed up shroud visibility updates.
2015-03-22 22:38:41 +01:00
Paul Chote
7b57d87df5 Merge pull request #7713 from Mailaender/camera-icon
Added a camera icon
2015-03-22 19:30:00 +00:00
Matthias Mailänder
f39b01b53c Merge pull request #7700 from pchote/sequence-defaults
Add support for per-sequence animation defaults
2015-03-22 20:22:04 +01:00
Paul Chote
a7c64a0941 Remove redundancies from TS sequences. 2015-03-22 17:31:42 +00:00
Matthias Mailänder
90138785a1 draw the grid above the spice 2015-03-22 18:13:08 +01:00
Matthias Mailänder
ee58c68604 fix Sietch sprite offset 2015-03-22 18:09:33 +01:00
Paul Chote
2444f35695 Fix radar origin for non-square widgets. 2015-03-22 17:01:24 +00:00
penev92
efee3598f9 Add D2k harvester insurance on worm frenzy 2015-03-22 17:00:59 +02:00
penev92
0d05fb5326 Implement FreeActorWithDelivery to enable off-map harvester delivery
Fix FreeActorInfo fields descriptions
2015-03-22 17:00:57 +02:00
penev92
fa6e5948d7 Remove the Lua scripted harvester delivery from the D2k shellmap and reorganize Carryall actor definitions 2015-03-22 16:58:16 +02:00
penev92
7608cb93b4 Split CarryUnit into PickupUnit and DeliverUnit 2015-03-22 16:58:15 +02:00
penev92
4eb67b328f Refactor AutoCarryall trait and rename to Carryall
Fixup Carryable
2015-03-22 16:58:14 +02:00
penev92
f9a2378be8 Produce D2k carryalls at the edge of the map 2015-03-22 16:58:13 +02:00
penev92
5927e1080a Add ChooseClosestEdgeCell() method to the Map class 2015-03-22 16:58:11 +02:00
Paul Chote
bcc3aefaa7 Merge pull request #7702 from abcdefg30/tscrash
Fix a crash in UpgradeActorsNear.cs
2015-03-22 13:58:05 +00:00
Paul Chote
8fd4eca2da Merge pull request #7560 from RoosterDragon/let-it-go
Speed up frozen actor updates & prevent flicker
2015-03-22 13:52:33 +00:00
Paul Chote
c92d1342f0 Allow mods to define Defaults for all animations in a sequence. 2015-03-22 12:58:08 +00:00
Paul Chote
a69145caf0 Add a utility command for checking sequences. 2015-03-22 12:48:51 +00:00
Matthias Mailänder
7f9f29c8a2 add a camera icon 2015-03-22 07:51:22 +01:00
abcdefg30
5d7f6081e4 Fix a crash in UpgradeActorsNear.cs 2015-03-21 22:51:25 +01:00
Matthias Mailänder
5de9e72707 Merge pull request #7492 from penev92/bleed_enemySightedNotification
Closes #7491
2015-03-21 19:18:01 +01:00
Matthias Mailänder
3900733c1d Merge pull request #7581 from Phrohdoh/sequence-error-fix
Clarify the error relating to too many frames defined in a sequence.
2015-03-21 15:33:14 +01:00
Oliver Brakmann
919c0fd359 Merge pull request #7638 from pchote/infantry-body
Decompose RenderInfantry into WithInfantryBody and RenderSprites.
2015-03-21 15:22:53 +01:00
Paul Chote
cf92d0ea24 Merge pull request #7687 from reaperrr/ts-wda
Use 3rd damage level of TS buildings for death instead of critical
2015-03-21 14:10:45 +00:00
Oliver Brakmann
ff49cdcc5f Use the OnPlayerDiscovered trigger in gdi05a 2015-03-21 15:19:19 +02:00
penev92
16dee554c4 Introduce OnDiscovered and OnPlayerDiscovered Lua triggers 2015-03-21 15:19:18 +02:00
Matthias Mailänder
79c53e3981 Merge pull request #7525 from penev92/bleed_enemySightedNotification2
Refactor EnemyWatcher and AnnounceOnSeen traits
2015-03-21 14:16:06 +01:00
Paul Chote
4ea55809ca Decompose RenderInfantry into WithInfantryBody and RenderSprites. 2015-03-21 13:04:17 +00:00
Paul Chote
fa0264a73c Fix WithDeathAnimation dependency. 2015-03-21 13:04:16 +00:00
Oliver Brakmann
6c50d0eda8 Merge pull request #7608 from pchote/widgetcommon
Move common widgets from Game to Mods.Common.
2015-03-21 13:57:56 +01:00
penev92
d9a6b1ec5a Disable notifications for U2 2015-03-21 14:19:20 +02:00
Paul Chote
e5c03413cc Move common widgets from Game to Mods.Common. 2015-03-21 11:53:53 +00:00
penev92
328e329fe7 Disallow sound/radar notifications for neutral actors via a configurable field on the trait 2015-03-21 12:03:41 +02:00
penev92
55e04a44c8 Add EnemyWatcher and AnnounceOnSeen to RA 2015-03-21 11:32:28 +02:00
penev92
1b616123ef Introduce INotifyDiscovered interface and use it to move notifications from EnemyWatcher to AnnounceOnSeen 2015-03-21 07:53:41 +02:00
Matthias Mailänder
eb0ea8d543 Merge pull request #7693 from obrakmann/fix7688_d2k_insignia_behind_radar
Fix d2k faction logos being visible behind radar on narrow maps
2015-03-20 22:46:14 +01:00
Oliver Brakmann
112d7caf97 Fix d2k faction logos being visible behind radar on narrow maps 2015-03-20 19:10:05 +01:00
Matthias Mailänder
e98c55a852 Merge pull request #7681 from abcdefg30/startgamenotification
Allow the use of race variants in "StartGameNotification:"
2015-03-20 18:08:16 +01:00
Matthias Mailänder
146afd755b bring back the HTML documentation 2015-03-20 18:01:12 +01:00
Matthias Mailänder
7be8c4461b Merge pull request #7405 from Rydra/upstream/int2immutable
Made int2 class immutable
2015-03-20 16:03:46 +01:00
abcdefg30
a249302b6b Allow the use of race variants in "StartGameNotification:" 2015-03-20 14:52:58 +01:00
David Jiménez
f15f1e41e8 Made int2 struct immutable 2015-03-20 13:54:01 +01:00
Matthias Mailänder
dc1862f3dc Merge pull request #7529 from delftswa2014/feature/kdr_stat
Add Kill/Death ratio in statistics window
2015-03-20 13:35:21 +01:00
Matthias Mailänder
d7a373ffda Merge pull request #7691 from Mailaender/appveyor-windows-move
Corrected the NSIS Setup.exe renaming in the last AppVeyor step
2015-03-20 07:37:54 +01:00
Matthias Mailänder
2f199a1c9c correct the path 2015-03-20 07:34:42 +01:00
Matthias Mailänder
fc09fe9e03 Merge pull request #7683 from obrakmann/fix-appveyor-build-the-37482th
Fix archive extraction in appveyor builds
2015-03-20 07:10:02 +01:00
Matthias Mailänder
0569eb640f Merge pull request #7649 from RoosterDragon/stylecop-line-length
Enforce a line length limit.
2015-03-20 07:07:58 +01:00
reaperrr
b66cae100b Use 3rd damage level of TS buildings for death animation instead of critical damage state 2015-03-20 01:11:50 +01:00
RoosterDragon
c3531d6f70 Avoid duplicated frozen visibility checks.
The FrozenUnderFog.Tick method will now reuse the calculation do by the frozen actor when it had to calculate its visibility, this prevents it having to re-do the fairly expensive visibility calculation.
2015-03-19 17:30:40 +00:00
RoosterDragon
1515ac54f6 Enforce a line length limit. 2015-03-19 17:20:34 +00:00
Oliver Brakmann
721ba5e9c3 Merge pull request #7595 from WolfGaming/SellTooltip
Refund tooltip
2015-03-19 18:11:30 +01:00
WolfGaming
068a96fd46 Fixes NullPointerException when frozen.Actor is null. 2015-03-19 05:53:59 +00:00
WolfGaming
d2f02e7a4b Fix missions showing tooltips wrong. 2015-03-19 05:53:55 +00:00
WolfGaming
c460906ed5 Added refund tooltip. 2015-03-19 05:53:51 +00:00
WolfGaming
bf3ddcfbf1 Implemented an interface that allows traits to add custom information to tooltips. 2015-03-19 05:53:44 +00:00
Pavel Penev
272086de76 Merge pull request #7541 from Mailaender/d2k-build-hotkeys
Fixed the hard-coded Dune 2000 production tab hotkeys
2015-03-18 12:08:41 -07:00
Oliver Brakmann
4d8189ea97 Fix archive extraction in appveyor builds 2015-03-18 18:10:10 +01:00
Matthias Mailänder
73b4a18e22 make the d2k production tab hotkeys configurable 2015-03-18 06:49:44 +01:00
Matthias Mailänder
16ff6e2112 Merge pull request #7561 from RoosterDragon/fast-map-border-shroud
Speed up map border shroud & fix viewport visible cells
2015-03-18 06:36:45 +01:00
Pavel Penev
82c01ec640 Merge pull request #7667 from Mailaender/move-without-force
Avoid PowerShellisms to fix the AppVeyor build
2015-03-17 18:58:09 -07:00
Pavel Penev
4c0a81fe15 Merge pull request #7679 from obrakmann/new-ftrk-icon
Replace flak truck icon with non-copyrighted art
2015-03-17 12:45:50 -07:00
Oliver Brakmann
d16701447f Replace flak truck icon with non-copyrighted art
The new art is based on an image from the public domain (http://commons.wikimedia.org/wiki/File:%D0%9C%D1%83%D0%B7%D0%B5%D0%B9_%D0%B2%D0%BE%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9_%D1%82%D0%B5%D1%85%D0%BD%D0%B8%D0%BA%D0%B8_%D0%9E%D1%80%D1%83%D0%B6%D0%B8%D0%B5_%D0%9F%D0%BE%D0%B1%D0%B5%D0%B4%D1%8B,_%D0%9A%D1%80%D0%B0%D1%81%D0%BD%D0%BE%D0%B4%D0%B0%D1%80_%2829%29.jpg), modified for OpenRA by @OmegaBolt.
2015-03-17 18:51:04 +01:00
pevers
bc14889881 added cheat command to give money to all the players and AI 2015-03-17 16:45:37 +01:00
Matthias Mailänder
26a4b9b841 Merge pull request #7623 from cjshmyr/orelord
Added new 1v1 RA map by MicroBit - Ore Lord
2015-03-17 05:15:00 +01:00
Oliver Brakmann
e4ef1eb820 Merge pull request #7626 from Mailaender/ts-radar-dishes
Fixed Tiberian Sun radar dishes
2015-03-16 18:37:59 +01:00
reaperrr
258e924afe Merge pull request #7619 from pchote/ts-civilian-fixes
Fix TS civilian actor/sequence definitions.
2015-03-16 03:41:37 +01:00
reaperrr
a14bf8622f Merge pull request #7570 from Mailaender/mods-common
Moved more traits to Mods.Common
2015-03-15 19:53:13 +01:00
Curtis Shmyr
e71aca2038 Added new RA map by MicroBit - Ore Lord 2015-03-15 11:47:29 -06:00
Matthias Mailänder
737a0e0b67 move common traits 2015-03-15 18:25:28 +01:00
Oliver Brakmann
4a2803c9d1 Merge pull request #7528 from delftswa2014/feature/distinguish_ally_enemy_messages
Add "(Ally)" behind the name of allies in all-chat
2015-03-15 16:15:01 +01:00
Oliver Brakmann
f6b45fe6cd Merge pull request #7648 from Phrohdoh/emit-inf-check-race
Make EmitInfantryOnSell compare string[] for owner's race.
2015-03-15 15:03:51 +01:00
jabbink
1f26d900f5 Add "(Ally)" behind the name of allies in all-chat
Fixes #7518
2015-03-15 11:52:32 +01:00
Matthias Mailänder
5c1cd0db16 suppress prompting on file moves 2015-03-15 07:32:33 +01:00
Matthias Mailänder
fe5ff86fe2 avoid PowerShellisms 2015-03-15 01:34:50 +01:00
Taryn Hill
fcb2141132 EmitInfantryOnSell now checks a Races string[] against the seller’s race. 2015-03-14 15:54:26 -05:00
Taryn Hill
bc69539993 Clarify the error relating to too many frames defined in a sequence. 2015-03-14 15:50:52 -05:00
Pavel Penev
9a66fc7382 Merge pull request #7656 from OmegaBolt/bfdmap
Battle for Dune 3v3 map
2015-03-14 18:20:24 +02:00
OmegaBolt
9d3efd12a0 Battle for Dune 3v3 map
PR as recommended by penev
2015-03-14 15:42:30 +00:00
Pavel Penev
e8a12a5550 Merge pull request #7661 from Mailaender/appveyor-nsis-plugins
Try to fix the AppVeyor build
2015-03-14 15:00:50 +02:00
Matthias Mailänder
32e1cfd2f2 Merge pull request #7644 from razzmatazz/hackyai-mcv-redeployment-fix
HackyAI can now build buildings near a new MCV
2015-03-14 12:40:39 +01:00
Oliver Brakmann
863db5a42c Merge pull request #7640 from Phrohdoh/rand-dmg-sounds
SoundOnDamageTransition to use string[].
2015-03-14 12:39:20 +01:00
Oliver Brakmann
0062391665 Merge pull request #7652 from fluxer/bleed
add /lib and /lib64 to the locations lookup for Lua
2015-03-14 10:52:32 +01:00
Matthias Mailänder
33e49c371a try to fix the AppVeyor build 2015-03-14 09:57:22 +01:00
Pavel Penev
03bab4a72a Merge pull request #7631 from pchote/sequence-rework
Rework sequence parsing.
2015-03-14 00:13:03 +02:00
Taryn Hill
76457c5fc1 Merge pull request #7542 from Mailaender/appveyor-deployment-fix
Fixed AppVeyor deployment.
2015-03-13 16:22:40 -05:00
Pavel Penev
04e0275d33 Merge pull request #7650 from Phrohdoh/fix-ramp-nre
Fix NRE caused by checking the RampType of a tile in #7645.
2015-03-13 20:30:02 +02:00
Pavel Penev
dd424f0b14 Merge pull request #7657 from MustaphaTR/copyright-date-readme
Update year of Copyrights on Readme
2015-03-13 16:34:54 +02:00
Mustafa Alperen Seki
aaf0f8d906 Update year of Copyrights on Readme 2015-03-13 12:36:09 +02:00
Pavel Penev
dc6040217b Merge pull request #7618 from Rydra/upstream/hv-heuristic
Changed the harvester heuristic, solved several regressions in Pathfinder and harvesters
2015-03-13 01:55:50 +02:00
Taryn Hill
7bf058896d Apply SoundOnDamageTransition upgrade rule. 2015-03-12 16:09:15 -05:00
Taryn Hill
1e0612ddf0 Change SoundOnDamageTransition to randomly select
from a string[] instead of a single string.
2015-03-12 16:09:11 -05:00
Taryn Hill
32edeccb56 Merge pull request #7476 from abcdefg30/any-subfaction
Allow picking of a random subfaction.
2015-03-12 15:52:39 -05:00
abcdefg30
63fe578ba8 Allow picking of a random subfaction 2015-03-12 21:34:23 +01:00
Saulius Menkevičius
e1fa6af954 HackyAI can now build buildings with new MCV
There was an issue where HackyAI would try to build buildings
at old base location and would fail, unless it was placed at the
same place where the old MCV was.
2015-03-12 20:10:08 +02:00
Ivailo Monev
6f070994b5 add /lib and /lib64 to the locations lookup for Lua (issue #7637) 2015-03-12 15:20:46 +00:00
Taryn Hill
602de0ea13 Fix NRE caused by checking the RampType of a tile in #7645. 2015-03-12 09:11:51 -05:00
David Jiménez
ea32c20450 Changed the harvester heuristic so that now takes into account the distance from the initial search location. This makes harvesters somewhat more "intelligent" and gather nearer resources. Also solved several regressions introduced in the recent changes in the Pathfinder 2015-03-12 12:28:34 +01:00
Matthias Mailänder
fa4f43b750 account for initial health 2015-03-11 23:18:03 +01:00
Pavel Penev
687403ab89 Merge pull request #7645 from Phrohdoh/fix-slope-buildings
Mark ramp/slope tiles as unbuildable.
2015-03-11 23:50:17 +02:00
Taryn Hill
a744900e74 Mark ramp/slope tiles as unbuildable. 2015-03-11 16:30:55 -05:00
Matthias Mailänder
4f775a8dc7 Merge pull request #7641 from Generalcamo/patch-2
Add a Cloaking sound to the Phase Transport
2015-03-11 20:24:42 +01:00
Cody Brittain
a2de502619 Add a Cloaking sound to the Phase Transport
Adds a cloaking sound to the phase transport
2015-03-10 20:30:45 -04:00
Oliver Brakmann
f5535c00a2 Merge pull request #7593 from Phrohdoh/wiki-trait-links
Wiki trait links.
2015-03-10 18:40:53 +01:00
Oliver Brakmann
60bf903e7c Merge pull request #7634 from Phrohdoh/sw-docs
Add some documentation to support powers.
2015-03-10 18:35:41 +01:00
Matthias Mailänder
cb29c29efc deploy on any branch with tags 2015-03-10 07:31:26 +01:00
Matthias Mailänder
32328835ff try to fix artifact deployment 2015-03-10 07:31:26 +01:00
Matthias Mailänder
7bf3ef0e90 stop 7-Zip from displaying prompts that halt the build 2015-03-10 07:31:24 +01:00
Matthias Mailänder
7123f93e86 Merge pull request #7617 from Mailaender/fuzzy-nuget
Removed FuzzyLogicLibrary.dll binary from source code management
2015-03-10 06:50:56 +01:00
Taryn Hill
a5bbb60db9 Remove unnecessary newline from output.
Make required trait strings a hyperlink.
2015-03-10 00:20:40 -05:00
Taryn Hill
51e470e64c Add some documentation to support powers. 2015-03-10 00:13:24 -05:00
Paul Chote
f91ee3fb45 Fix sequence terminology. 2015-03-09 20:45:49 +00:00
Paul Chote
7292bd20b3 Move Sequence parsing into mod code. 2015-03-09 20:45:22 +00:00
Paul Chote
d3783f0244 Introduce ISpriteSequence interface. 2015-03-09 19:19:00 +00:00
Paul Chote
2cc714be4e Allow IGlobalModData to opt-in to custom parsing. 2015-03-09 19:19:00 +00:00
Paul Chote
60937b096b Give a sensible error if LoadScreen/LobbyDefaults is missing. 2015-03-09 19:18:59 +00:00
Matthias Mailänder
429111a282 fix the destroyed radar dishes 2015-03-08 21:51:36 +01:00
Matthias Mailänder
762c0e12a2 Merge pull request #7522 from delftswa2014/bugfix/sellicon
Closes #7508
2015-03-08 19:13:34 +01:00
Oliver Brakmann
78e74eb685 Merge pull request #7601 from Phrohdoh/ab-hotkeys
Add hotkeys to playback controls.
2015-03-08 17:19:24 +01:00
Taryn Hill
a05b015581 Add hotkeys to playback controls. 2015-03-08 10:30:26 -05:00
Oliver Brakmann
190d197613 Merge pull request #7544 from delftswa2014/bugfix/sam_site_friendlyfire
Friendly fire fixes and sam sites
2015-03-08 16:16:14 +01:00
Oliver Brakmann
a39352aee3 Merge pull request #7524 from penev92/bleed_enemySightedNotification1
Fix the EnemyWatcher trait (hotfix)
2015-03-08 15:44:31 +01:00
Paul Chote
4110064c44 Fix TS civilian actor/sequence definitions. 2015-03-08 13:01:47 +00:00
penev92
4a5b3b59ed Properly remove worms from the world 2015-03-08 15:01:40 +02:00
penev92
58ab28206f Fix multiple notifications in multiplayer bug 2015-03-08 15:01:38 +02:00
penev92
1261fd1b07 Increase NotificationInterval to 30 seconds 2015-03-08 15:01:36 +02:00
Pavel Penev
a3065ad90c Merge pull request #7616 from obrakmann/fix-win-map-hashes
Ensure LF line ending for .yaml files for hash consistency across platforms
2015-03-08 14:55:32 +02:00
Matthias Mailänder
ac5a1b2569 fetch FuzzyLogicLibrary from NuGet 2015-03-08 10:22:37 +01:00
Pavel Penev
5ad1424c87 Merge pull request #7579 from Mailaender/lua51-msvc110
Avoid MSVC120 runtime dependency for Lua Windows DLLs
2015-03-08 02:29:55 +02:00
Pavel Penev
4c394d61e4 Merge pull request #7611 from Mailaender/freetype2-msvc-downgrade
Fixed FreeType2 depending on too new VS C++ runtime DLLs
2015-03-08 02:27:14 +02:00
Oliver Brakmann
419e63a33c Ensure LF line ending for .yaml files for hash consistency across platforms
Without this change, the git client will auto-convert the line endings to CRLF, which leads to hash mismatches for unpacked maps, which would be especially bad if we were going to build the Windows package on a Windows system.

Adds the same rule for .lua files as well, in preparation for a change that will make those contribute to the map hash.
2015-03-07 23:34:01 +01:00
Matthias Mailänder
b7255761e3 downgrade to MSVC8 runtime dependency 2015-03-07 17:54:42 +01:00
Taryn Hill
04fff1da72 Merge pull request #7606 from pchote/manifest
Allow mods to define custom manifest data.
2015-03-07 09:51:00 -06:00
Matthias Mailänder
0f309c31be downgrade FreeType2 version to old msvcrt.dll dependency
also downgrade ZLib dependency to old VC runtime versions
2015-03-07 14:04:36 +01:00
Paul Chote
dcfc62f333 Move InstallUtils from Game to Mods.Common. 2015-03-07 10:02:43 +00:00
Paul Chote
2de91a4c4e Convert ContentInstaller into a manifest module. 2015-03-07 10:02:42 +00:00
Paul Chote
5552000d69 Allow mods to define custom manifest metadata. 2015-03-07 10:02:42 +00:00
Paul Chote
31710c1644 Remove obsolete Movies entry from cnc manifest. 2015-03-07 10:02:42 +00:00
Pavel Penev
77684f4439 Merge pull request #7353 from Mailaender/promptconfirm-incompatible-replay
Added a warning before loading incompatible replays
2015-03-07 11:20:33 +02:00
Matthias Mailänder
e13447e641 automatically switch mods when possible 2015-03-07 10:12:16 +01:00
Matthias Mailänder
3bb448b29b warn before loading incompatible replays 2015-03-07 10:06:17 +01:00
Pavel Penev
5fa7e50c8e Merge pull request #7599 from DeadlySurprise/radarCursorFix
Fixed radar not showing move/attack cursors
2015-03-06 22:32:37 +02:00
Pavel Penev
f590fe0d91 Merge pull request #7602 from obrakmann/fix7600_pdof_bib
Add mini-bib to fake chronosphere
2015-03-06 22:24:31 +02:00
Oliver Brakmann
886513277a Add mini-bib to fake chronosphere
Fixes #7600
2015-03-06 20:29:30 +01:00
DeadlySurprise
1a2e8d56d1 Fixed radar not showing move/attack cursors 2015-03-06 14:30:45 +01:00
Taryn Hill
36db620262 Merge pull request #7533 from reaperrr/ra-weapons
Split RA weapons.yaml into multiple roughly categorized files.
2015-03-05 17:27:16 -06:00
jabbink
da546fc955 Add Kill/Death ratio in statistics window
closes #6858
2015-03-05 11:15:08 +01:00
Matthias Mailänder
957a9e2532 Merge pull request #7580 from Phrohdoh/ab-logical-frame-counter
Use correct frame indices in the asset browser.
2015-03-04 22:11:56 +01:00
Matthias Mailänder
fc750874bc Merge pull request #7586 from Phrohdoh/exit-descs-buff
Make Exit’s descs more informative.
2015-03-04 20:45:59 +01:00
pevers
17fec82348 fixed taking over sam/pillbox/etc. to stop firing
fixed issue with powered down samsites

more optimization

very small optimization

undo changes to powerdown samsite fixes

refixed powered down sam sites

removed debug line

redid the fix in another approach by queueing a sell activity on the top of the queue. This was already present but didn't always work

fixed line I removed

prevented attack activity to be queued when actor is disabled

another style fail of me

reverse and queueactivity activities are now executed on top of the queue for a sell action
2015-03-04 18:13:33 +01:00
Taryn Hill
7b16ba5d42 Use correct frame indices in the asset browser
with total frame count in parentheses.
2015-03-04 10:52:07 -06:00
Taryn Hill
d6da7d54e4 Make Exit’s descs more informative. 2015-03-04 09:15:09 -06:00
Scott
43c3621ef6 Merge pull request #7582 from Phrohdoh/ignore-moq
Add Moq.dll to the gitignore.
2015-03-04 19:00:46 +13:00
Taryn Hill
025493f6a5 Add Moq.dll to the gitignore. 2015-03-03 22:02:35 -06:00
Paul Chote
8c4ea20636 Merge pull request #7430 from Rydra/upstream/pf-optimized
[Discussion PR] Complete refactor of Pathfinder
2015-03-03 19:50:25 +00:00
David Jiménez
54ae572303 - Introduced Unit Testing capabilities to the PathFinder trait and algorithm.
Introduced also a small Unit test project to prove it.

- Separated caching capabilities from PathFinder class to increase cohesion and maintainability.
Refactored the pathfinding algorithm by extracting methods based on responsibilities like
calculating costs and reordering functions. These changes should provide a in average a small increase in
pathfinding performance and maintainability.

- Optimized the pathfinder algorithm to reuse calculations like the
MovementCost and heuristics.

- Introduced base classes, IPathSearch and IPriorityQueue interfaces,
and restructured code to ease readability and testability

- Renamed the PathFinder related classes to more appropriate names. Made the
traits rely on the interface IPathfinder instead of concrete PathFinder
implementation.

- Massive performance improvements

- Solved error with harvesters' Heuristic

- Updated the heuristic to ease redability and adjustability. D can be
adjusted to offer best paths by decreasing and more performance by
increasing it

- Refactored the CellLayer<CellInfo> creation in its own Singleton class

- Extracted the graph abstraction onto an IGraph interface, making the
Pathfinder agnostic to the definition of world and terrain. This
abstraction can help in the future to be able to cache graphs for similar
classes and their costs, speeding up the pathfinder and being able to feed
the A* algorithm with different types of graphs like Hierarchical graphs
2015-03-03 20:11:11 +01:00
Oliver Brakmann
50d726ea31 Merge pull request #7477 from pchote/d2k-raceart
Add race-specific sequence support, and overhaul D2K actor definitions.
2015-03-03 20:07:30 +01:00
Paul Chote
b968b527d2 Allow map players to use non-selectable races. 2015-03-03 18:45:46 +00:00
Paul Chote
6e08fd33c4 Update d2k map importer actor table. 2015-03-03 18:45:46 +00:00
Paul Chote
476986660f Allow GDI/Nod flavoured conyards to be built in debug mode. 2015-03-03 18:45:45 +00:00
Paul Chote
b670673f9f Reorganize D2K actor rules.
This removes the redundancy between faction variants and adjusts the layout
to be more consistent with the other mods.
2015-03-03 18:45:45 +00:00
Paul Chote
b7a98c8eb7 Document the other Transforms trait properties. 2015-03-03 18:45:45 +00:00
Paul Chote
59d06a22bf Change "Cannot deploy here" to a notification. 2015-03-03 18:45:44 +00:00
Paul Chote
7b27b803f9 Allow actors to force a specific race variant. 2015-03-03 18:45:44 +00:00
Paul Chote
d1ed1bf0fb Set actor race (and icons) based on active producer. 2015-03-03 18:45:44 +00:00
RoosterDragon
6234e311ca Speed up shroud visibility updates.
A unit with the CreatesShroud or RevealsShroud trait must update all shrouds when it changes position. Calculating the tiles it can currently see is an expensive calculation that previously had to be repeated for every shroud that needed to know these tiles.

Now, we lazily populate a ref parameter to allow it to be reused for an actor if possible. The biggest improvement comes from the fact that allied players can re-use this calculation when updating their shrouds. Since many games includes a neutral player allied to both sides, most games will see a decent speedup.
2015-03-02 22:18:06 +00:00
Paul Chote
44159ecdd6 Add support for race-specific actor sequences. 2015-03-02 20:46:24 +00:00
Paul Chote
00a2146299 Adjust GetImage plumbing in preparation for race-specific sequences. 2015-03-02 20:46:24 +00:00
Paul Chote
4c3a95ebc0 Fix bogus Produces definition on TD FACT. 2015-03-02 20:46:24 +00:00
Paul Chote
f606a1bfd7 Use a consistent set of arguments for Render* ctors. 2015-03-02 20:46:23 +00:00
Oliver Brakmann
d135e58ad9 Merge pull request #7501 from Bynnar18/leftclick
Reimplementing Left Click Orders with Fixes
2015-03-02 18:01:26 +01:00
reaperrr
477dbbd532 Splits RA weapons.yaml into multiple roughly categorized files 2015-03-01 22:11:45 +01:00
Bynnar18
0abe8f9b2b Fixes issues with support powers and adds property to all IOrderGenerator classes to determine priority over selection in the left-click order scheme. 2015-03-01 14:58:19 -06:00
Bynnar18
7b46b76329 Fixed left-click orders and implemented a selection deadzone. 2015-03-01 14:58:19 -06:00
Bynnar18
36d59d6b1d Restored faulty left-click logic for now. 2015-03-01 14:58:18 -06:00
Oliver Brakmann
75bfd0fb31 Merge pull request #7535 from reaperrr/allmods-audio
Cleanup: Moved audio-related yamls to audio subfolder
2015-03-01 19:20:47 +01:00
Pavel Penev
711659d7dd Merge pull request #7540 from Mailaender/d2k-description
Changed the Dune 2000 mod chooser description
2015-03-01 17:53:20 +02:00
Matthias Mailänder
ab04380234 give this a more in-universe description
we now have sandworms, carryalls and concrete
2015-03-01 14:59:41 +01:00
Oliver Brakmann
61cea23c3c Merge pull request #7562 from abcdefg30/onSellRemoved
Fix a crash in OnAllRemovedFromWorld
2015-03-01 14:00:25 +01:00
Oliver Brakmann
74c22523aa Merge pull request #7564 from Mailaender/common-widgets
Moved the whole widget code to OpenRA.Mods.Common
2015-02-28 23:00:07 +01:00
Matthias Mailänder
ff6dbde8d7 move widget code to commons 2015-02-28 20:32:19 +01:00
Oliver Brakmann
92101a1393 Merge pull request #7487 from abcdefg30/changealtitude
Change the plane altitude in ra
2015-02-28 19:49:39 +01:00
RoosterDragon
d3b93345b4 Fix Viewport.VisibleCells.
Reworked the visible cells calculation to ensure the visible region is actually minimal, which should reduce the amount of rendering to be done by a small amount. Previously, the region would tend to overdraw by 2-3 cells in either direction. For isometric maps, there was also a bug where it would draw far too much vertically above the top of the map.
2015-02-28 13:36:58 +00:00
abcdefg30
28262df1e5 Don't crash when selling an actor using OnAllRemovedFromWorld 2015-02-28 09:38:14 +01:00
RoosterDragon
803390c68e Speed up rendering map border shroud when no shroud is visible.
When the map border shroud must be rendered, but no cells at the border are visible, then we know that no shroud will be visible at all. We can bail from rendering early in this case.
2015-02-27 20:07:32 +00:00
Pavel Penev
cee3d6cf9e Merge pull request #7532 from RoosterDragon/disabledoverlay-modifyrender
Adjust DisabledOverlay.ModifyRender to be more efficient.
2015-02-27 01:08:39 +02:00
RoosterDragon
6baa35a763 Adjust DisabledOverlay.ModifyRender to be more efficient.
When not disabled, ModifyRender doesn't actually alter the sequence, so we can just return it directly and avoid adding another layer of enumerable. If it is disabled, then the modifying enumerable has one less condition to check inside the loop.
2015-02-26 21:58:29 +00:00
Pavel Penev
0c9960ae1b Merge pull request #7519 from obrakmann/fix7516_default-facing
Change default facing to 0
2015-02-26 23:23:43 +02:00
Oliver Brakmann
a1beb8a61e Merge pull request #7555 from delftswa2014/bugfix/resourcegrowth_transient
allowed resources to be grown under Actors
2015-02-26 22:18:01 +01:00
Pavel Penev
67cee6324c Merge pull request #7511 from obrakmann/vqaplayer-no-mouse
Prevent VqaPlayerWidget from eating the radar bin's mouse input
2015-02-26 23:14:26 +02:00
Oliver Brakmann
325f8fbb17 Merge pull request #7554 from x-a-n-a-x/RA-DebugSymbol
Adds a debug symbol (RA mod)
2015-02-26 22:00:20 +01:00
Nick ten Veen
96e9b90a64 Fixed #7008 for TD, TS and D2K aswell 2015-02-26 21:56:35 +01:00
Nick ten Veen
78511de58f allowed resources to be grown under Actors 2015-02-26 18:15:09 +01:00
Sebastien Kerguen
1b0a805fc6 Adds the chrome.psd (art source) 2015-02-26 17:26:07 +01:00
Sebastien Kerguen
3834a08c73 Adds a debug symbol (RA mod) 2015-02-26 17:08:00 +01:00
Oliver Brakmann
4beef806d6 Merge pull request #7521 from delftswa2014/bugfix/cheatfix
Forgot shroud on all-cheat
2015-02-25 23:35:00 +01:00
reaperrr
57a4bdb606 Remove obsolete PackageContents from TS mod.yaml 2015-02-23 23:30:14 +01:00
reaperrr
e38736670c Move TS music, notifications and voices yamls to audio subfolder.
Move TileSets and tile/cell settings for consistency with other mods.
2015-02-23 23:29:39 +01:00
reaperrr
650bc615af Move D2k music, notifications and voices yamls to audio subfolder.
Move TileSets a little for consistency with other mod.yamls.
2015-02-23 23:27:49 +01:00
reaperrr
26158ad722 Move TD music, notifications and voices yamls to audio subfolder.
Move TileSets and Translations in mods.yaml for consistency with other mods.
2015-02-23 23:24:18 +01:00
reaperrr
7baad53124 Move RA music, notifications and voices yamls to audio subfolder 2015-02-23 23:20:55 +01:00
Oliver Brakmann
ec12fb130c Merge pull request #7527 from delftswa2014/bugfix/lobby_chat_margin
Increase ItemSpacing in CHAT_TEMPLATE for the lobby chat
2015-02-23 22:13:42 +01:00
Oliver Brakmann
0bf9b04b51 Merge pull request #7531 from RoosterDragon/stream-read-fixes
Fix some broken Stream.Read calls.
2015-02-23 21:49:49 +01:00
pevers
6d716d301a DisableShroud cheat now properly disables after disabling the all-cheat
Smaller code base

Added newline

Added newline between assignment and statement

fixed spacing

fixed spacing

fixed spacing
2015-02-23 21:19:07 +01:00
RoosterDragon
d4421f0a41 Fix some broken Stream.Read calls.
Change callers of this method to use the ReadBytes extension method that ensures the requested amount of bytes are consumed.

Also tighten argument validation.
2015-02-23 19:40:16 +00:00
jabbink
a7a326c568 Increase ItemSpacing in CHAT_TEMPLATE for the lobby chat
Fixes #7447
2015-02-23 15:12:11 +01:00
David Jiménez
8659a3e71e Introduced the interfaces IActor, ICacheStorage, ILog, IMap, IWorld a
nd IMobileInfo to separate concrete implementations and abstractions
2015-02-22 23:14:12 +01:00
pevers
97ca96f8ab fixed sellicon bug 2015-02-22 18:14:25 +01:00
Oliver Brakmann
85fae8720d Merge pull request #7510 from DeadlySurprise/UninstallFix
Added uninstaller check for running game
2015-02-22 17:14:11 +01:00
Oliver Brakmann
02c4ace0af Change default facing to 0 2015-02-22 16:25:40 +01:00
Oliver Brakmann
293ec6577b Merge pull request #7507 from delftswa2014/bugfix/cheatfix
Fixed all cheat code
2015-02-22 15:10:17 +01:00
pevers
3f1db45ea6 changed all cheat to really enable everything on call
added givecash to the all cheat

fixed spacing

fixed spacing
2015-02-22 14:43:42 +01:00
DeadlySurprise
4668452e9b Added plugin download to appveyor 2015-02-21 21:58:07 +01:00
DeadlySurprise
c50feeb4e2 Added uninstaller check for running game 2015-02-21 21:57:46 +01:00
Oliver Brakmann
d3dab83de8 Merge pull request #7461 from pchote/remove-legacy-sidebar
Remove legacy sidebar code
2015-02-21 16:46:39 +01:00
Oliver Brakmann
878430622f Merge pull request #7479 from Mailaender/nuget-openal-soft
Replaced OpenAL Soft Windows DLL with a fetch script from Nuget
2015-02-21 15:42:24 +01:00
Matthias Mailänder
361c1bc010 Merge pull request #7483 from pchote/deadbuildingstate
Fix missing first animation frame and remove DeadBuildingState.
2015-02-21 14:00:23 +01:00
Pavel Penev
20ca9b2ab1 Merge pull request #7486 from delftswa2014/bugfix/apcbibs
Fixed #7472 so that cargo is only shown on allied vehicles
2015-02-21 02:08:41 +02:00
Pavel Penev
293bb78a3c Merge pull request #7457 from pchote/actorpreviews
Introduce ActorPreviewWidget (and other related changes).
2015-02-21 01:35:03 +02:00
Oliver Brakmann
aeceb05e08 Merge pull request #7305 from RoosterDragon/shroud-lazy-update
Vastly improve shroud rendering performance.
2015-02-20 23:59:48 +01:00
Oliver Brakmann
10f0c83270 Prevent VqaPlayerWidget from eating the radar bin's mouse inputs 2015-02-20 22:44:37 +01:00
RoosterDragon
4d5101a7c4 Vastly improve shroud rendering performance.
Changes in the shroud are now tracked. If a cell changes it will mark itself and its neighbors as dirty. During the render phase all dirty cells will have their vertices calculated and cached. If a cell is not dirty, the pre-calculated vertices are retrieved from cache. Then the sprite renderer is provided the sprite and the pre-calculated vertices to draw.

This prevents constant recalculation of vertices for the shroud in the render phase, requiring instead only dirty cells in the visible area. The update phase is reduced to a practical noop, instead incurring the cost only of changed cells each frame, rather than checking the visible area.
2015-02-20 20:03:42 +00:00
Paul Chote
df7588f1bc Merge pull request #7488 from RoosterDragon/trait-remove-perf
Speed up TraitContainer.RemoveActor.
2015-02-20 17:45:40 +00:00
Paul Chote
4ac8199e8e Merge pull request #7482 from OpenRA/appveyor-deploy-conditions
Fixed AppVeyor deploying and failing the build
2015-02-20 17:29:10 +00:00
Paul Chote
1a6de9a03c Merge pull request #7374 from DeadlySurprise/cashOverflowFix
Added a check for overflowing player credits
2015-02-20 17:24:57 +00:00
Paul Chote
f4e94f9f60 Merge pull request #7318 from reaperrr/remove-percellwh
Removed PerCellDamageWarhead
2015-02-20 17:15:28 +00:00
Paul Chote
f2087de9bd Remove DeadBuildingState.
Fixes #3422, #3522, #5136.
2015-02-20 16:56:46 +00:00
Paul Chote
29bf625887 Remove DeadBuildingState from RA. 2015-02-20 16:56:41 +00:00
Paul Chote
63e9cd4c9c Remove DeadBuildingState from TD. 2015-02-20 16:54:04 +00:00
Paul Chote
e9caf7f6e6 Initialise frame time when playing a new sequence.
Fixes #3706, #6389.
2015-02-20 16:54:04 +00:00
Paul Chote
e52c15553f Remove legacy sidebar code. 2015-02-20 16:46:55 +00:00
pevers
329d610577 Fixed #7472 so that cargo is only shown on allied vehicles
fixed spacing

pips are shown on every team when shroud is disabled

removed comment

Remove unwanted comment explaining how ally-detection works

fixed the real problem in RenderAfterWorld
2015-02-19 21:09:37 +01:00
Paul Chote
2a1e4f70a9 Replace the legacy TS sidebar placeholder with a modern placeholder. 2015-02-19 17:54:01 +00:00
Pavel Penev
e2da1f11cb Merge pull request #7495 from abcdefg30/placed_overlay
Fix a visual glitch in WithBuildingPlacedOverlay
2015-02-19 00:40:58 +02:00
abcdefg30
adffd33f4d Don't repulse actors flying with another altitude 2015-02-18 22:06:31 +01:00
abcdefg30
c70edc65fe Change cruise altitudes and fall rates 2015-02-18 22:06:30 +01:00
abcdefg30
6155928678 Don't display beacons in the air 2015-02-18 22:06:28 +01:00
Oliver Brakmann
44f884c561 Merge pull request #7156 from DeadlySurprise/luaMediaApi
Lua API : Added floating text and radar video
2015-02-18 20:57:37 +01:00
Oliver Brakmann
ca611a82e4 Merge pull request #7135 from penev92/bleed_d2kMapImporter
D2k: Add map importer
2015-02-18 20:33:17 +01:00
DeadlySurprise
7b53582c5e Implemented Floating Text and radar video 2015-02-18 14:38:30 +01:00
abcdefg30
f63bc1e001 Fix a glitch in WithBuildingPlacedOverlay
when transforming the actor.
2015-02-18 12:50:17 +01:00
penev92
922af4d9cf Add missing tiles BLOXBGBS-29 (1x1) and BLOXBGBS-617 (2x2) 2015-02-18 13:18:42 +02:00
penev92
da425f47e7 Initial implementation of D2k legacy map importer
Improve error handling; fix utility command description

Revert output location to working directory for both map importers

Rework how the map tiles get populated

Remove actor comments
2015-02-18 13:16:32 +02:00
abcdefg30
035b96f469 Made the ts conyard sellable 2015-02-18 11:13:48 +01:00
Igor Popov
5bcd56eb9d Merge pull request #7439 from ScottNZ/fix-map-import
Fix map importer using the map title as the output filename.
2015-02-17 09:47:01 +03:00
reaperrr
89527962dd Upgrade rule for PerCellDamage removal 2015-02-17 01:33:23 +01:00
reaperrr
f39488de41 Remove PerCellDamageWarhead
Remove redundant CrateNuke definition from Training Camp
2015-02-17 01:33:22 +01:00
RoosterDragon
a3898db660 Speed up TraitContainer.RemoveActor.
Use the binary search invariant of the lists to find the actor quickly and remove the range of entries from the list in a single operation to avoid redundant copying otherwise caused by removing entries one by one.
2015-02-17 00:02:43 +00:00
Chris Forbes
32411d64df Merge pull request #7480 from pchote/beacon-poster-fade
Desaturate beacon posters in TD menu.
2015-02-17 10:06:27 +13:00
Matthias Mailänder
38dbb3063b Merge pull request #7462 from obrakmann/fix7459_build_area
Fix extent of buildable area below structures
2015-02-16 22:04:03 +01:00
penev92
9664e32005 Merge pull request #7424 from RoosterDragon/minor-alloc
Avoid some memory allocations
2015-02-16 20:20:40 +02:00
Matthias Mailänder
917ae35e40 don't try to deploy all the time 2015-02-15 17:30:40 +01:00
Paul Chote
6e55c79a66 Desaturate beacon posters in TD menu. 2015-02-15 15:34:40 +00:00
Matthias Mailänder
6626df468c fetch OpenAL Soft from Nuget on Windows 2015-02-15 11:33:05 +01:00
Matthias Mailänder
4b70005d49 Merge pull request #7458 from pchote/replay-metadata
Closes #6669
2015-02-15 10:31:17 +01:00
Paul Chote
2d31e12bb9 Add --replay-metadata utility command. 2015-02-15 08:58:59 +00:00
Oliver Brakmann
7c59a523db Merge pull request #7460 from pchote/soviet-sidebar
Fix soviet sidebar regression
2015-02-14 20:47:06 +01:00
Oliver Brakmann
beb9e5087b Merge pull request #7446 from atimoschenkow/fix-sound-reset
Fix #7431
2015-02-14 17:04:14 +01:00
Oliver Brakmann
d1f810731d Merge pull request #7437 from 42foobar42/nod2b
added nod mission 2b
2015-02-14 16:50:27 +01:00
Oliver Brakmann
de16d29aa6 Merge pull request #7445 from jwbuurlage/bleed
Fixes #7219. In addition, sets cursor corresponding to the order with hi...
2015-02-14 12:22:34 +01:00
ScottNZ
61de2a2312 Fix map importer using the map title as the output filename.
This is broken because the map title can make an invalid filename.
2015-02-15 00:04:38 +13:00
Matthias Mailänder
76bf570426 Merge pull request #7436 from penev92/bleed_moveFiles2
Move the AI to Mods.Common
2015-02-14 09:42:18 +01:00
Matthias Mailänder
589e9fb5ee Merge pull request #7471 from x-a-n-a-x/D2KUI-tooltips
Closes #7470
2015-02-14 07:21:14 +01:00
Sebastien Kerguen
fa3c0e77d5 - fixes the missing tooltip glyphs #7470 2015-02-13 22:55:02 +01:00
Paul Chote
50860ab2b5 Merge pull request #7378 from obrakmann/fix_wiki_deployment
Switch wiki deployment to the orabot user with SSH auth
2015-02-12 14:43:19 +00:00
Taryn Hill
5349c69307 Merge pull request #7467 from ScottNZ/stylecop-fixes
Brace style fixes.
2015-02-12 07:54:10 -06:00
ScottNZ
582b6635ff Brace style fixes 2015-02-13 02:32:49 +13:00
Paul Chote
aa550790e5 Merge pull request #4528 from Mailaender/mime
Registered Linux MIME type to directly load replays
2015-02-12 11:21:37 +00:00
Paul Chote
6cacc70f6e Merge pull request #7456 from Mailaender/d2k-radar-fixup
Fixed the faction insignia being drawn over the radar minimap
2015-02-12 10:36:41 +00:00
Alexander Boll
52c67aef76 added hunt to every movement 2015-02-10 21:08:20 +01:00
Alexander Boll
e4647a8333 added nod mission 2b 2015-02-10 21:08:19 +01:00
Matthias Mailänder
ba66be18f7 remove empty Children: 2015-02-10 20:17:50 +01:00
Matthias Mailänder
b4ada2d61c change drawing order of faction logos over the minimap 2015-02-10 20:17:48 +01:00
Oliver Brakmann
7f4b62b7ee Fix extent of buildable area below structures
Restore use of GetBuildingAt to take bibs into account for buildable area, and only consult the actor map if the actor at that location is not a building.
2015-02-10 19:28:54 +01:00
Paul Chote
1af61c92c5 Split SpriteRenderable into its own file. 2015-02-10 17:47:49 +00:00
Paul Chote
2834c95e35 Fix soviet sidebar texture rectangles. 2015-02-10 17:11:15 +00:00
Paul Chote
8d51fb0e66 Use ActorPreviewWidget for the color pickers. 2015-02-10 15:22:42 +00:00
Paul Chote
aa9db669e7 Fix ActorPreview turret facings. 2015-02-10 15:22:42 +00:00
Paul Chote
268ca94dc1 Introduce ActorPreviewWidget. 2015-02-10 15:22:42 +00:00
Paul Chote
db1a27b071 Introduce IFinalizedRenderable.ScreenBounds. 2015-02-10 14:26:44 +00:00
Paul Chote
c55d723fb4 Remove Scale from IRenderable interface.
It is no longer used, and isn’t implemented for most renderables.
2015-02-09 23:26:06 +00:00
Paul Chote
a495a2f528 Split IFinalizedRenderable from Renderable to remove mutable structs. 2015-02-09 23:23:37 +00:00
Matthias Mailänder
1eb6c984f5 Merge pull request #7384 from Mailaender/new-d2k-build-palette
Added the new modular build palette to Dune 2000
2015-02-09 22:08:43 +01:00
penev92
6c6a4322ed Move the AI namespace to Mods.Common 2015-02-09 16:57:29 +02:00
atimoschenkow
9bf43c00a3 Fix #7431 2015-02-09 00:50:18 +01:00
Jan-Willem Buurlage
7eb2106375 Change cursor according to the command with highest priority. 2015-02-08 22:38:05 +01:00
Jan-Willem Buurlage
ce6c883fb1 Fixed #7219. Reduce boarding priority to resolve conflict with force-attacking own units. 2015-02-08 22:31:56 +01:00
Jan-Willem Buurlage
26562862f7 Add myself to authors 2015-02-08 22:30:55 +01:00
Matthias Mailänder
b0f986887c make maximum and minimum rows configurable 2015-02-08 20:43:35 +01:00
Matthias Mailänder
3be3700722 use the new modular UI 2015-02-08 20:43:32 +01:00
Matthias Mailänder
d921e0f838 Merge pull request #7418 from Mailaender/movie-list-removal
Removed the unused movie lists
2015-02-08 13:00:02 +01:00
Oliver Brakmann
32243122be Merge pull request #7435 from penev92/bleed_moveFiles
Moving more files to Mods.Common
2015-02-07 10:10:32 +01:00
Oliver Brakmann
0af8d6902b Merge pull request #7420 from abcdefg30/tsbounds
Fix some ts structure bounds
2015-02-06 22:03:54 +01:00
Oliver Brakmann
aafde15ddf Merge pull request #7393 from 42foobar42/bleed
Nod Mission 2a
2015-02-06 21:18:50 +01:00
Alexander Boll
9a09421800 fixed mission 2a and cleaned the code
changed according style code and added production trigger

corrected tech tree

removed comments and corrected same style issues

added gdi tech tree and changed produce to build

changed image format and replace spaces with tabs

deleted unnecessary tabs, added tooltips and corrected name

added lua file from nod 2a

changed according style code and added production trigger

deleted unnecessary tabs, added tooltips and corrected name

fixed image size

changed for loops to Utils.Do, removed facing and health from yaml,
changed movement function and corrected mission description

restored facing values unequal zero und fixed image position

Polish things a bit

Have player's units move into the map at the start

Polish some things
2015-02-06 21:11:18 +01:00
abcdefg30
3b84f42689 Fix some structure bounds 2015-02-06 20:48:21 +01:00
penev92
64887cb8c8 Move MainMenuLogic to Mods.Common 2015-02-06 13:37:43 +02:00
penev92
494b600ed8 Move refinery and harvester logic to Mods.Common;
Remove unused interface IAcceptOreDockAction
2015-02-06 13:23:07 +02:00
Matthias Mailänder
6714b498af Merge pull request #7428 from Phrohdoh/chmod
Unset executable bit from some thirdparty objects.
2015-02-05 19:22:22 +01:00
Oliver Brakmann
fc7e944727 Merge pull request #7398 from LipkeGu/ts_assets_part2
Adding the Rocks to Tiberian Sun
2015-02-05 18:22:57 +01:00
Oliver Brakmann
01ee8a3ca7 Merge pull request #7421 from huwpascoe/bugfix-carryall
BugFix: harvester-carryall remote death
2015-02-05 17:04:40 +01:00
Oliver Brakmann
1cb04d4500 Merge pull request #7408 from Mailaender/appveyor-nsis-deploy
Fixed NSIS being installed during every pull request build
2015-02-05 16:11:50 +01:00
Taryn Hill
a0130f105e Unset executable bit from some thirdparty objects. 2015-02-04 12:37:04 -06:00
huwpascoe
804cdee8f0 BugFix: harvester-carryall remote death
The d2k harvester would suddenly explode if the approaching carryall was
destroyed. This is because there was no distinction between the unit being
carried and the unit being reserved. To test you'll probably have to tweak
the turret missile in weapons.yaml so you can forcefire on the carryall.

* added a bool to check if carryall is actually holding it's target
* fixed harvester being stuck in reserved mode
2015-02-03 22:43:35 +00:00
Taryn Hill
e79239311a Merge pull request #7376 from abcdefg30/tsprereqs
Fix TS prerequisites.
2015-02-03 15:46:13 -06:00
Oliver Brakmann
86051ade43 Merge pull request #7423 from abcdefg30/demofix
Fix the demo truck explosion not killing the initiator
2015-02-03 22:20:18 +01:00
Guido L.
ce5e6e5a76 Add Rocks to Tiberian Sun 2015-02-03 19:26:47 +01:00
Oliver Brakmann
99c4e12650 Merge pull request #7425 from chrisforbes/issuestats
add issuestats badges to README
2015-02-03 17:21:54 +01:00
Chris Forbes
9f05d39352 add issuestats badges to README 2015-02-03 15:35:42 +13:00
RoosterDragon
b4993efff1 Avoid some minor allocations.
- Don't call string.Format in Actor.ToString since it gets called often, instead prefer a simple concat.
- In HiddenUnderFog.IsVisible, avoid a needless level of lambda indirection.
2015-02-02 21:16:14 +00:00
RoosterDragon
7e28acadd8 DrawPanelPartial now specifies each sprite as an individual parameter.
This allows some array allocations to be avoided, and makes the code more obvious since each sprite is referred to by name rather than an array index.
2015-02-02 21:16:14 +00:00
Oliver Brakmann
0371cfef3b Merge pull request #7406 from abcdefg30/allies05a
Ported allies05a to lua
2015-02-02 17:06:53 +01:00
Oliver Brakmann
ccc34806de Some polish for allies05a
* Viewport follows the truck automatically
* Greece's reinforcements arrive only after the heli has left the scene
* Added "Reinforcements have arrived" notification
* Adds all the Lua files of the recent missions to the solution
2015-02-02 16:51:50 +01:00
abcdefg30
aab54218e5 Ported allies05a to lua 2015-02-02 16:51:50 +01:00
abcdefg30
3b5e95bdc5 Set "AffectsParent: true" for the "MiniNuke" weapon 2015-02-02 15:17:41 +01:00
Matthias Mailänder
595c792879 remove the unused movie lists 2015-02-01 18:53:50 +01:00
Matthias Mailänder
5040baac9b Merge pull request #7415 from obrakmann/gdi05a
Add mission gdi05a
2015-02-01 18:49:27 +01:00
Oliver Brakmann
1b4dc3d1fe Add mission gdi05a 2015-02-01 18:12:46 +01:00
Oliver Brakmann
479259b9d7 Update mission gdi03 2015-02-01 15:50:18 +01:00
Oliver Brakmann
4aa97ec776 Allow support powers to start with a full charge when created 2015-02-01 15:49:45 +01:00
Oliver Brakmann
de616c69a2 Merge pull request #7416 from atimoschenkow/adjust-nudge
Adjust nudging for cases where no enterable cell is found
2015-02-01 15:18:59 +01:00
Oliver Brakmann
07d6a104a1 Merge pull request #7413 from Unit158/BoDupdate
Updated Break of Day
2015-02-01 15:14:51 +01:00
atimoschenkow
f2ae11f247 Adjust nudging for cases where no enterable cell is found
- Randomly select one of the occupied "non-stupid" cells
- Notify blockers in that cell
- Wait until it can be entered
- Move to cell
2015-02-01 14:57:10 +01:00
DeadlySurprise
4f07de2af8 Added a check for overflowing player credits 2015-02-01 13:28:47 +01:00
Matthias Mailänder
bcda232a1c Merge pull request #7231 from RoosterDragon/linq-checks
Checked LINQ queries and collections for inefficiencies.
2015-02-01 08:56:15 +01:00
Christopher Grant
ec79915323 Updated Break of Day 2015-01-31 18:04:35 -05:00
Oliver Brakmann
b68918f5d5 Merge pull request #7401 from RoosterDragon/stylecop-ignore-designer
Ignore designer generated files during StyleCop checks.
2015-01-31 14:35:28 +01:00
RoosterDragon
7ad58a3e3d Revert "don't check auto-generated code"
This reverts commit 47e2d9d623.
2015-01-31 12:46:47 +00:00
RoosterDragon
7a0889db91 Ignore designer generated files during StyleCop checks. 2015-01-31 12:46:47 +00:00
Matthias Mailänder
cfbe59f1e4 only install NSIS during deployment 2015-01-31 11:31:48 +01:00
Paul Chote
885b8ee18b Merge pull request #7407 from Mailaender/moneybinwidget-invalid-spacing
Fixed OpenRA.Mods.D2k/Widgets/MoneyBinWidget.cs: [SP2000] Invalid spacing at the end of the line.
2015-01-31 23:21:36 +13:00
Matthias Mailänder
89a5facb14 fix SP2000 2015-01-31 11:07:06 +01:00
Matthias Mailänder
7592f7d6fb Merge pull request #7342 from LipkeGu/Draw_sprite_crash
Do not try to draw "null" sprites
2015-01-31 10:55:26 +01:00
Matthias Mailänder
f0d4650857 Merge pull request #7392 from abcdefg30/missiondiplomacy
Disable the diplomacy menu in mission or campaign maps
2015-01-31 10:49:44 +01:00
Matthias Mailänder
83e3edb90a Merge pull request #7404 from obrakmann/non-targetable-spyplane
Make spy plane non-targetable
2015-01-31 10:37:53 +01:00
Oliver Brakmann
22b1f4de59 Merge pull request #7331 from Phrohdoh/dune-armor-bonuses
TerrainModifiesDamage trait.
2015-01-30 17:30:43 +01:00
Oliver Brakmann
f0a1292207 Make spy plane non-targetable 2015-01-30 15:52:35 +01:00
Matthias Mailänder
4899b555a9 Merge pull request #7191 from Mailaender/ts-superweapons
Added the Nod missile silo and the Ion Cannon to the Tiberian Sun mod
2015-01-29 21:48:14 +01:00
abcdefg30
28b90b0115 Use the class enum in LeaveMapLogic.cs as well 2015-01-29 20:26:40 +01:00
abcdefg30
b7b1e13c63 Disable the diplomacy menu in mission or campaign maps 2015-01-29 20:26:15 +01:00
RoosterDragon
82bea961ba Checked LINQ queries and collections for inefficiencies.
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
  - Collection queried often via Contains use ToHashSet to speed up lookups.
  - Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
  - Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
2015-01-29 19:20:11 +00:00
Oliver Brakmann
f5f3747338 Merge pull request #7400 from obrakmann/whitespace-fix
Remove whitespace from empty line
2015-01-28 21:36:32 +01:00
Oliver Brakmann
f247bc890e Remove whitespace from empty line 2015-01-28 21:25:07 +01:00
Oliver Brakmann
7ddc340d5b Merge pull request #7314 from Unit158/Levelup-command
Added a levelup command
2015-01-28 20:58:17 +01:00
Oliver Brakmann
2e1ca40bb5 Merge pull request #7155 from cjshmyr/buildarea
Use ActorMap instead of BuildingInfluence for finding buildable area
2015-01-28 19:03:49 +01:00
Oliver Brakmann
9ec349cfd6 Merge pull request #7259 from MustaphaTR/d2k-tile-fix
D2K - Fixed some tiles
2015-01-28 18:54:02 +01:00
Mustafa Alperen Seki
a1810f7d28 Fixed some d2k tiles. 2015-01-28 14:17:06 +02:00
Oliver Brakmann
b0b83f2a3e Merge pull request #7388 from MustaphaTR/d2k-carryall-to-last
D2K - Carryall moved to last in Starport.
2015-01-27 20:32:06 +01:00
Matthias Mailänder
1859e9289a Merge pull request #7385 from huwpascoe/beepy
Changed the chat notification sounds for RA mod
2015-01-27 20:26:09 +01:00
Mustafa Alperen Seki
4e366a85fe Carryall moved to last in Starport. 2015-01-27 16:23:13 +02:00
Curtis Shmyr
30cf02c8e2 Use ActorMap instead of BuildingInfluence for finding buildable area 2015-01-26 20:22:21 -07:00
Taryn Hill
86f6d634c0 Add TerrainModifiesDamage trait.
^Infantry take 80% damage on Rough terrain in D2k.
2015-01-26 18:08:44 -06:00
huwpascoe
ac38340f4e Changed the chat notification sounds for RA and CNC mod. 2015-01-26 23:10:02 +00:00
Matthias Mailänder
034c071fbc Merge pull request #7382 from Mailaender/stylecop-plus
Added support for StyleCop+
2015-01-25 23:58:42 +01:00
Paul Chote
27a3a1e974 Merge pull request #7383 from obrakmann/fix7379_invalid_debug_channel
Fix wrong log channel name: Debug -> debug
2015-01-26 09:20:10 +13:00
Oliver Brakmann
b75adfe40e Merge pull request #6846 from Mailaender/gem-mine
Replaced the gem mine artwork
2015-01-25 20:16:51 +01:00
Oliver Brakmann
f2d8831576 Merge pull request #7360 from abcdefg30/allies03b
Ported allies03b to lua
2015-01-25 20:01:30 +01:00
Matthias Mailänder
f444fa6763 Merge pull request #7362 from RoosterDragon/fix-shared-font-sheetbuilder
Avoid a globally shared SheetBuilder in SpriteFont.
2015-01-25 19:48:54 +01:00
abcdefg30
4a7afd1a16 Ported allies03b to lua 2015-01-25 19:34:30 +01:00
Oliver Brakmann
266f26cdce Merge pull request #7223 from LipkeGu/ts_assets_mapeditor
Add Buildings and Trees to Tiberian Sun
2015-01-25 19:13:35 +01:00
Matthias Mailänder
24deec2a7b fix CodeLineMustNotEndWithWhitespace 2015-01-25 18:41:29 +01:00
Matthias Mailänder
47e2d9d623 don't check auto-generated code 2015-01-25 18:40:44 +01:00
Matthias Mailänder
93c4be6f7a add support for StyleCop+ 2015-01-25 18:40:44 +01:00
Oliver Brakmann
16cf805a23 Fix wrong log channel name: Debug -> debug 2015-01-25 18:34:16 +01:00
Oliver Brakmann
a38a1918dc Merge pull request #7098 from penev92/bleed_fixRefineryHierarchy
Clean up refinery and harvester docking sequence logic
2015-01-25 18:08:14 +01:00
penev92
828614d0f0 Add YAML upgrade rule 2015-01-25 17:17:35 +02:00
penev92
49508482c3 Update Refinery docking rules in YAML files 2015-01-25 17:17:34 +02:00
penev92
502ed6a0e7 Add SpriteHarvesterDockSequence and VoxelHarvesterDockSequence
Pass drag-related info from Refinery to HarvesterDockSequence
2015-01-25 17:17:34 +02:00
penev92
c18da7abb0 Fix harvester dock sequence names 2015-01-25 16:58:04 +02:00
penev92
202e280551 Fix OreRefinery and TiberiumRefinery names 2015-01-25 16:58:03 +02:00
penev92
6a40dfd0db Changed IAcceptOre to IAcceptResources 2015-01-25 16:58:02 +02:00
Oliver Brakmann
4cbfa31053 Merge pull request #6880 from Mailaender/lua-music
Added Media.PlayMusic to the Lua API
2015-01-25 15:05:47 +01:00
Oliver Brakmann
1f048b64ac Add upgrade rule for PlayMusicOnMapLoad removal 2015-01-25 14:44:13 +01:00
Matthias Mailänder
895f02d7cb update the music player widget when the music changes 2015-01-25 14:43:36 +01:00
Matthias Mailänder
c3e3a47746 play mission won theme 2015-01-25 14:43:36 +01:00
Matthias Mailänder
d5643a79b7 auto play shellmap music (again) on all mods
closes #6071
2015-01-25 14:43:36 +01:00
Matthias Mailänder
a7f27a65ea add Media.StopMusic() 2015-01-25 14:43:36 +01:00
Matthias Mailänder
3489794713 replace PlayMusicOnMapLoad trait with Lua Media.PlayMusic method 2015-01-25 14:43:36 +01:00
Matthias Mailänder
554f3ae8de Merge pull request #7375 from abcdefg30/fixsurvival02
Fix a crash in survival02
2015-01-25 14:34:51 +01:00
abcdefg30
a5b0ea73b0 Fix ts prerequisistes 2015-01-25 14:31:48 +01:00
Christopher Grant
66c33452e8 Added a levelup command 2015-01-24 14:56:33 -05:00
Matthias Mailänder
26202520a1 add the GDI Upgrade Center and Ion Cannon 2015-01-24 17:35:53 +01:00
Matthias Mailänder
d7c9a6cbc8 add the Nod Missile Silo and Cluster Missile 2015-01-24 17:35:52 +01:00
Matthias Mailänder
fc16990c05 unhardcode and self-document 2015-01-24 17:35:21 +01:00
Matthias Mailänder
aba9ffe93e remove unused sequence 2015-01-24 17:35:21 +01:00
Oliver Brakmann
98fd875a43 Merge pull request #7372 from ScottNZ/countries
Add more fake buildings
2015-01-24 12:30:48 +01:00
ScottNZ
7d8a6186e2 No access to Allied construction yards in allies 03, so remove unneeded fake definitions 2015-01-24 13:03:06 +13:00
ScottNZ
8e1661c297 Remove high tech fake structure access from a few missions 2015-01-24 13:02:35 +13:00
Oliver Brakmann
2f588968b0 Switch wiki deployment to the openra user with ssh auth 2015-01-23 22:36:10 +01:00
Oliver Brakmann
f360161922 Merge pull request #7227 from sinaptik/bleed
add scroll buttons that appear in the production palette when icons exceed available space
2015-01-23 19:46:30 +01:00
abcdefg30
b309983fd4 Fix a crash in survival02 2015-01-23 15:18:20 +01:00
ScottNZ
3c4e149f80 Rebalance fake structure costs: %10 of the original 2015-01-23 23:45:00 +13:00
ScottNZ
1986b31bcb Add fake atek (atef), mslo (mslf) and pdox (pdof) structures to ra.
Thanks to MicroBit for the icons.
2015-01-23 23:44:59 +13:00
ScottNZ
806d9ad4ad Move fake structures to fakes.yaml 2015-01-23 23:44:59 +13:00
sinaptik
b6b2b1a942 Add scroll buttons that appear in the production palette when icons exceed available space #7227
scroll up and down buttons: add disabled status, make dynamic, make smaller

Rename MaxIconRows to MaxIconRowOffset for clarity

Clean up scrolling logic, reset row position when switching tab
2015-01-23 18:40:11 +13:00
Oliver Brakmann
b97ccc3465 Merge pull request #7201 from reaperrr/yaml-reorg-cnc
Split TD weapons.yaml into multiple categorised yamls
2015-01-22 22:31:27 +01:00
Oliver Brakmann
2c71e954bf Merge pull request #7170 from penev92/bleed_enemySightedNotification
Implement "Enemy unit sighted" notification
2015-01-22 21:58:58 +01:00
Oliver Brakmann
ee3b4e6652 Merge pull request #7364 from RoosterDragon/yaml-redo
Reassert some changes lost in rebasing in MiniYaml.cs.
2015-01-21 20:14:32 +01:00
Oliver Brakmann
e875240ca3 Merge pull request #7367 from abcdefg30/fixmgg
Fix the prerequisites of mobile gap generator
2015-01-21 20:05:44 +01:00
abcdefg30
d73e739e5b Make mgg buildable by france only 2015-01-21 16:15:51 +01:00
reaperrr
309d64f2a3 Split cnc weapons.yaml into multiple rough categories 2015-01-20 23:23:50 +01:00
RoosterDragon
c39ff6894c Reassert some changes lost in rebasing in MiniYaml.cs. 2015-01-20 20:52:02 +00:00
Oliver Brakmann
7267a3afdb Merge pull request #6984 from DeadlySurprise/yamlFix
Fixed yaml bug with leading spaces
2015-01-20 21:42:22 +01:00
Paul Chote
99e2700ba7 Merge pull request #7356 from abcdefg30/limitcheat
Ignore buildlimits with AllTech cheat
2015-01-20 11:46:27 +13:00
RoosterDragon
c313c52e96 Avoid a globally shared SheetBuilder in SpriteFont.
A globally shared sheet builder leaks memory and resources between mod switches. Instead, we create and inject the sheet builder during mod startup to ensure we still share the builder across all fonts, but can reclaim it when the mod is unloaded.
2015-01-19 21:04:17 +00:00
Matthias Mailänder
398af8e513 Merge pull request #7357 from pchote/yay-outdated-distros
Fix compilation on mono 2.10.
2015-01-18 22:12:11 +01:00
Paul Chote
fb17fe79e2 Merge pull request #7351 from Mailaender/appveyor-push-artifact
Added appveyor PushArtifact to fix deployment
2015-01-19 09:51:13 +13:00
Paul Chote
4a73c88a85 Fix compilation on mono 2.10. 2015-01-19 08:56:18 +13:00
abcdefg30
2fd1576d15 Ignore buildlimits with AllTech cheat 2015-01-18 20:36:26 +01:00
Oliver Brakmann
98325ea32e Merge pull request #7329 from abcdefg30/improvemtm
Polished monster-tank-madness
2015-01-18 16:51:50 +01:00
reaperrr
ea1b45551c Merge pull request #7354 from penev92/bleed_moveFiles
Move parachutes and crates to Mods.Common
2015-01-18 16:28:27 +01:00
penev92
52cc69fd1f Move Crate, CrateSpawner and all CrateActions to Mods.Common 2015-01-18 16:40:55 +02:00
penev92
f1a0f6e2a5 Move Parachute, Parachutable and ParaDrop to Mods.Common 2015-01-18 16:15:14 +02:00
Matthias Mailänder
411446f9bd package the XML files 2015-01-18 13:17:11 +01:00
Matthias Mailänder
1b5928879c save replays in a less generic file extension 2015-01-18 13:17:11 +01:00
Matthias Mailänder
417b499472 register Linux MIME type to directly load replays 2015-01-18 13:17:10 +01:00
Matthias Mailänder
37c9caabd8 this has already been resolved in #7121 and #7187 2015-01-18 13:17:10 +01:00
Matthias Mailänder
44f1c52e44 Merge pull request #7204 from Mailaender/ts-harvest-overlay
Added the Tiberian Sun harvest animation
2015-01-18 12:58:46 +01:00
Matthias Mailänder
22df04a51b push the artifact rename the setup.exe 2015-01-18 10:54:35 +01:00
Matthias Mailänder
17277a318d Merge pull request #7345 from Mailaender/appveyor-nsis
Moved Windows setup deployment to AppVeyor
2015-01-18 09:50:32 +01:00
Matthias Mailänder
6a25bc90d8 Merge pull request #7346 from Mailaender/windows-dependencies
Added all native Windows dependencies to the fetch script
2015-01-18 09:46:26 +01:00
Matthias Mailänder
8e4674520e create a thirdparty/windows directory if it does not exit 2015-01-18 08:33:59 +01:00
Matthias Mailänder
601022f582 deploy Windows setup exe via AppVeyor only 2015-01-18 08:01:33 +01:00
Matthias Mailänder
b25184adca fetch Zlib from nuget 2015-01-18 07:35:54 +01:00
Matthias Mailänder
9cae84d29d fetch Lua 5.1 from nuget.org 2015-01-18 07:35:41 +01:00
Matthias Mailänder
23380c6df6 don't fetch native Windows binaries on Unix 2015-01-18 07:35:40 +01:00
Guido L.
8d6722be2d Do not try to pass "null" sprites 2015-01-18 03:41:10 +01:00
abcdefg30
7fe64b14a4 Polished monster-tank-madness 2015-01-17 23:56:31 +01:00
reaperrr
55b858051d Merge pull request #7347 from Mailaender/ingame-menu-csproj
Fixed the IDE build again
2015-01-17 18:52:05 +01:00
Matthias Mailänder
d6d75e244b bring back IngameMenuLogic 2015-01-17 18:30:47 +01:00
Oliver Brakmann
c2dac459bb Merge pull request #7334 from RoosterDragon/less-alloc
Cache or inline some delegates to avoid allocations.
2015-01-17 16:04:36 +01:00
Oliver Brakmann
c7b2bce18b Merge pull request #7307 from Mailaender/common-networking-ui
Moved connection UI to OpenRA.Mods.Common
2015-01-17 15:51:43 +01:00
Matthias Mailänder
5aeb6eda06 move connection UI to commons 2015-01-17 15:17:54 +01:00
Matthias Mailänder
94a3fc0186 Merge pull request #7336 from obrakmann/d2k-no-healing-barracks
Remove healing ability from d2k barracks
2015-01-17 15:13:50 +01:00
Matthias Mailänder
94678e37e8 Merge pull request #7296 from MustaphaTR/d2k-starport-tank
D2K - Fix Starport unit prerequisites.
2015-01-17 15:09:37 +01:00
Matthias Mailänder
c1c1960b44 Merge pull request #7337 from reaperrr/common29
Moved Lint, UtilityCommands and Scripting properties to Mods.Common
2015-01-17 14:53:48 +01:00
penev92
a4a8a793df Add EnemyWatcher trait to D2k and AnnounceOnSeen to D2k units and sandworms; remove sandworm announcement on worm spawn 2015-01-17 14:41:23 +02:00
penev92
e2832bb3d7 Implement EnemyWatcher and AnnounceOnSeen traits 2015-01-17 14:41:22 +02:00
Matthias Mailänder
e694692b97 add the Tiberian Sun harvest animation 2015-01-17 11:36:41 +01:00
reaperrr
52dd8c922f Moves Lint checks to Mods.Common 2015-01-15 23:15:51 +01:00
reaperrr
e82b2ce8dd Moves BaseAttackNotifier to Mods.Common 2015-01-15 22:59:43 +01:00
reaperrr
6f0ae30a7e Moves nearly all ScriptingProperties to Mods.Common 2015-01-15 22:56:35 +01:00
reaperrr
f3d364877a Moves the last 3 UtilityCommands and some prerequisite references to Mods.Common 2015-01-15 22:39:41 +01:00
Oliver Brakmann
13d819f0ac Remove healing ability from d2k barracks 2015-01-15 20:14:42 +01:00
RoosterDragon
930d9cbea3 Cache or inline some delegates to avoid repeated allocations. 2015-01-14 22:57:41 +00:00
Mustafa Alperen Seki
a7017d6d71 Fix Starport unit prerequisites. 2015-01-09 10:34:49 +02:00
Mustafa Alperen Seki
52a08e24af Fix Starport unit prerequisites. 2015-01-09 10:32:08 +02:00
Mustafa Alperen Seki
c2f9169d54 Fix Starport unit prerequisites. 2015-01-09 10:29:02 +02:00
DeadlySurprise
fbe6ab7f4e Fixed yaml bug with leading spaces 2015-01-07 22:16:15 +01:00
Matthias Mailänder
0046dab1fd avoid legacy boolean values 2015-01-04 14:29:40 +01:00
Matthias Mailänder
18663323aa add the gem mine by @MicroJOo 2015-01-04 14:26:05 +01:00
Guido L.
2c485414e2 Add Buildings and Trees to Tiberian Sun 2014-12-30 18:18:48 +01:00
1082 changed files with 67811 additions and 30524 deletions

2
.gitattributes vendored
View File

@@ -1,4 +1,6 @@
# Enforce LF normalization on Windows
*.yaml eol=lf
*.lua eol=lf
* text=lf
# Custom for Visual Studio

13
.gitignore vendored
View File

@@ -28,17 +28,8 @@ mods/*/*.mdb
/*.pdb
/*.mdb
/*.exe
thirdparty/StyleCop*
thirdparty/ICSharpCode.SharpZipLib.dll*
thirdparty/MaxMind*
thirdparty/RestSharp*
thirdparty/Newtonsoft.Json*
thirdparty/SharpFont*
thirdparty/windows/freetype6.dll
thirdparty/nunit*
thirdparty/windows/SDL2.dll
thirdparty/Mono.Nat.dll
thirdparty/nuget.exe
thirdparty/download/*
*.mmdb.gz
# backup files by various editors
*~

View File

@@ -2,15 +2,26 @@
# see travis-ci.org for details
language: csharp
mono: 3.12.0
# Use the Docker-based infrastructure
sudo: false
cache: apt
# Don't use the container based infrastructure
sudo: true
cache:
directories:
- thirdparty/download
# Environment variables
env:
secure: "C0+Hlfa0YGErxUuWV00Tj6p45otC/D3YwYFuLpi2mj1rDFn/4dgh5WRngjvdDBVbXJ3duaZ78jPHWm1jr7vn2jqj9yETsCIK9psWd38ep/FEBM0SDr6MUD89OuXk/YyvxJAE+UXF6bXg7giey09g/CwBigjMW7ynET3wNAWPHPs="
# Fetch dependencies
# Run the build script
# call RALint to check for YAML errors
# Check source code with StyleCop
# call OpenRA to check for YAML errors
script:
- travis_retry make cli-dependencies
- sudo apt-get remove nuget # https://github.com/travis-ci/travis-ci/issues/3940
- travis_retry make all-dependencies
- make all
- make check
- make test
@@ -38,9 +49,7 @@ notifications:
skip_join: true
before_deploy:
- apt-get download nsis nsis-common markdown
- dpkg -x nsis*deb $HOME
- dpkg -x markdown*deb $HOME
- sudo apt-get install nsis nsis-common dpkg markdown
- export PATH=$PATH:$HOME/usr/bin
- DOTVERSION=`echo ${TRAVIS_TAG} | sed "s/-/\\./g"`
- cd packaging

View File

@@ -4,6 +4,7 @@ hard work of many contributors.
The OpenRA developers are:
* Chris Forbes (chrisf)
* Curtis Shmyr (hamb)
* Igor Popov (ihptru)
* Matthias Mailänder (Mailaender)
* Oliver Brakmann (obrakmann)
* Paul Chote (pchote)
@@ -38,6 +39,7 @@ Also thanks to:
* D2k Sardaukar
* Daniel Derejvanik (Harisson)
* Danny Keary (Dan9550)
* David Jiménez (Rydra)
* David Russell (DavidARussell)
* DeadlySurprise
* Erasmus Schroder (rasco)
@@ -45,16 +47,17 @@ Also thanks to:
* Fahrradkette
* Frank Razenberg (zzattack)
* Gareth Needham (Ripley`)
* Glen Anderson (GlenAnderson)
* Glenn Martin Jensen (Baxxster)
* Gordon Martin (Happy0)
* Guido Lipke (LipkeGu)
* Huw Pascoe
* Ian T. Jacobsen (Smilex)
* Igor Popov (ihptru)
* Imago
* Iran
* Jacob Dufault (jacobdufault)
* James Dunne (jsd)
* Jan-Willem Buurlage (jwbuurlage)
* Jason (atlimit8)
* Jeff Harris (jeff_1amstudios)
* Jes
@@ -77,11 +80,13 @@ Also thanks to:
* Michael Sztolcman (s1w_)
* Mustafa Alperen Seki (MustaphaTR)
* Neil Shivkar (havok13888)
* Nooze
* Nukem
* Okunev Yu Dmitry (xaionaro)
* Olaf van der Spek
* Paolo Chiodi (paolochiodi)
* Paul Dovydaitis (pdovy)
* Pavel Penev (penev92)
* Pavlos Touboulidis (pav)
* Pizzaoverhead
* Psydev

Binary file not shown.

105
Makefile
View File

@@ -40,7 +40,7 @@
CSC = dmcs
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
DEFINE = DEBUG;TRACE
COMMON_LIBS = System.dll System.Core.dll System.Data.dll System.Data.DataSetExtensions.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll thirdparty/MaxMind.Db.dll thirdparty/MaxMind.GeoIP2.dll thirdparty/Eluant.dll
COMMON_LIBS = System.dll System.Core.dll System.Data.dll System.Data.DataSetExtensions.dll System.Drawing.dll System.Xml.dll thirdparty/download/ICSharpCode.SharpZipLib.dll thirdparty/download/FuzzyLogicLibrary.dll thirdparty/download/Mono.Nat.dll thirdparty/download/MaxMind.Db.dll thirdparty/download/MaxMind.GeoIP2.dll thirdparty/download/Eluant.dll
@@ -71,9 +71,17 @@ INSTALL_DATA = $(INSTALL) -m644
# program targets
CORE = rsdl2 rnull game utility
TOOLS = editor tsbuild crashdialog
TOOLS = editor crashdialog
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
# dependencies
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
os-dependencies = linux-dependencies
else ifeq ($(UNAME_S),Darwin)
os-dependencies = osx-dependencies
endif
######################## PROGRAM TARGET RULES ##########################
@@ -83,7 +91,7 @@ VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev
game_SRCS := $(shell find OpenRA.Game/ -iname '*.cs')
game_TARGET = OpenRA.Game.exe
game_KIND = winexe
game_LIBS = $(COMMON_LIBS) $(game_DEPS) thirdparty/SDL2-CS.dll thirdparty/SharpFont.dll
game_LIBS = $(COMMON_LIBS) $(game_DEPS) thirdparty/download/SDL2-CS.dll thirdparty/download/SharpFont.dll
game_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico
PROGRAMS += game
game: $(game_TARGET)
@@ -93,7 +101,7 @@ rsdl2_SRCS := $(shell find OpenRA.Renderer.Sdl2/ -iname '*.cs')
rsdl2_TARGET = OpenRA.Renderer.Sdl2.dll
rsdl2_KIND = library
rsdl2_DEPS = $(game_TARGET)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/SDL2-CS.dll $(rsdl2_DEPS)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/download/SDL2-CS.dll $(rsdl2_DEPS)
rnull_SRCS := $(shell find OpenRA.Renderer.Null/ -iname '*.cs')
rnull_TARGET = OpenRA.Renderer.Null.dll
@@ -108,7 +116,7 @@ mod_common_SRCS := $(shell find OpenRA.Mods.Common/ -iname '*.cs')
mod_common_TARGET = mods/common/OpenRA.Mods.Common.dll
mod_common_KIND = library
mod_common_DEPS = $(game_TARGET)
mod_common_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) thirdparty/StyleCop.dll thirdparty/StyleCop.CSharp.dll thirdparty/StyleCop.CSharp.Rules.dll
mod_common_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) thirdparty/download/StyleCop.dll thirdparty/download/StyleCop.CSharp.dll thirdparty/download/StyleCop.CSharp.Rules.dll
PROGRAMS += mod_common
mod_common: $(mod_common_TARGET)
@@ -160,7 +168,7 @@ editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs')
editor_TARGET = OpenRA.Editor.exe
editor_KIND = winexe
editor_DEPS = $(game_TARGET) $(mod_common_TARGET)
editor_LIBS = System.Windows.Forms.dll System.Data.dll System.Drawing.dll $(editor_DEPS) thirdparty/Eluant.dll
editor_LIBS = System.Windows.Forms.dll System.Data.dll System.Drawing.dll $(editor_DEPS) thirdparty/download/Eluant.dll
editor_EXTRA = -resource:OpenRA.Editor.Form1.resources -resource:OpenRA.Editor.MapSelect.resources
editor_FLAGS = -win32icon:OpenRA.Editor/OpenRA.Editor.Icon.ico
@@ -208,9 +216,6 @@ check: utility mods
@echo
@echo "Checking for code style violations in OpenRA.Test..."
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Test
@echo
@echo "Checking for code style violations in OpenRA.TilesetBuilder..."
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.TilesetBuilder
test: utility mods
@echo
@@ -226,22 +231,6 @@ test: utility mods
@echo "Testing Red Alert mod MiniYAML..."
@mono --debug OpenRA.Utility.exe ra --check-yaml
# Builds and exports tilesets from a bitmap
tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_TARGET = OpenRA.TilesetBuilder.exe
tsbuild_KIND = winexe
tsbuild_DEPS = $(game_TARGET)
tsbuild_LIBS = $(COMMON_LIBS) $(tsbuild_DEPS) System.Windows.Forms.dll
tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.FormBuilder.resources -resource:OpenRA.TilesetBuilder.FormNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources
PROGRAMS += tsbuild
OpenRA.TilesetBuilder.FormBuilder.resources:
resgen2 OpenRA.TilesetBuilder/FormBuilder.resx OpenRA.TilesetBuilder.FormBuilder.resources 1> /dev/null
OpenRA.TilesetBuilder.FormNew.resources:
resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.FormNew.resources 1> /dev/null
OpenRA.TilesetBuilder.Surface.resources:
resgen2 OpenRA.TilesetBuilder/Surface.resx OpenRA.TilesetBuilder.Surface.resources 1> /dev/null
tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET)
##### Launchers / Utilities #####
@@ -259,7 +248,7 @@ utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs')
utility_TARGET = OpenRA.Utility.exe
utility_KIND = exe
utility_DEPS = $(game_TARGET)
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/download/ICSharpCode.SharpZipLib.dll
PROGRAMS += utility
utility: $(utility_TARGET)
@@ -290,43 +279,58 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
########################## MAKE/INSTALL RULES ##########################
#
default: cli-dependencies core
default: core
core: game renderers mods utility
tools: editor tsbuild gamemonitor
tools: editor gamemonitor
package: cli-dependencies core editor gamemonitor docs version
package: all-dependencies core tools docs version
mods: mod_common mod_ra mod_cnc mod_d2k mod_ts
all: cli-dependencies core tools
all: dependencies core tools
clean:
@-$(RM_F) *.exe *.dll ./OpenRA*/*.dll ./OpenRA*/*.mdb *.mdb mods/**/*.dll mods/**/*.mdb *.resources
@-$(RM_F) *.exe *.dll *.dylib *.dll.config ./OpenRA*/*.dll ./OpenRA*/*.mdb *.mdb mods/**/*.dll mods/**/*.mdb *.resources
@-$(RM_RF) ./*/bin ./*/obj
@-$(RM_RF) ./thirdparty/download
distclean: clean
dependencies: cli-dependencies native-dependencies
cli-dependencies:
cd thirdparty && ./fetch-thirdparty-deps.sh && cd ..
@ $(CP_R) thirdparty/*.dll .
@ $(CP_R) thirdparty/*.dll.config .
@./thirdparty/fetch-thirdparty-deps.sh
@ $(CP_R) thirdparty/download/*.dll .
@ $(CP_R) thirdparty/download/*.dll.config .
@ $(CP) thirdparty/SDL2-CS.dll.config .
native-dependencies:
@./configure
linux-dependencies: cli-dependencies linux-native-dependencies
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml
linux-native-dependencies:
@./thirdparty/configure-linux-native-deps.sh
windows-dependencies:
@./thirdparty/fetch-thirdparty-deps-windows.sh
osx-dependencies: cli-dependencies
@./thirdparty/fetch-thirdparty-deps-osx.sh
@ $(CP_R) thirdparty/download/osx/*.dylib .
@ $(CP_R) thirdparty/download/osx/*.dll.config .
dependencies: $(os-dependencies)
@./thirdparty/fetch-geoip-db.sh
@ $(CP) thirdparty/download/GeoLite2-Country.mmdb.gz .
all-dependencies: cli-dependencies windows-dependencies osx-dependencies
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml mods/all/mod.yaml
@for i in $? ; do \
awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $${i} > $${i}.tmp && \
mv -f $${i}.tmp $${i} ; \
done
# Documentation (d2k depends on all mod libraries)
docs: utility mods
@mono --debug OpenRA.Utility.exe d2k --docs > DOCUMENTATION.md
docs: utility mods version
@mono --debug OpenRA.Utility.exe all --docs > DOCUMENTATION.md
@mono --debug OpenRA.Utility.exe ra --lua-docs > Lua-API.md
install: install-core
@@ -351,7 +355,7 @@ install-core: default
@$(CP_R) mods/modchooser "$(DATA_INSTALL_DIR)/mods/"
@$(INSTALL_DATA) "global mix database.dat" "$(DATA_INSTALL_DIR)/global mix database.dat"
@$(INSTALL_DATA) "GeoLite2-Country.mmdb" "$(DATA_INSTALL_DIR)/GeoLite2-Country.mmdb"
@$(INSTALL_DATA) "GeoLite2-Country.mmdb.gz" "$(DATA_INSTALL_DIR)/GeoLite2-Country.mmdb.gz"
@$(INSTALL_DATA) AUTHORS "$(DATA_INSTALL_DIR)/AUTHORS"
@$(INSTALL_DATA) COPYING "$(DATA_INSTALL_DIR)/COPYING"
@@ -377,7 +381,6 @@ install-tools: tools
@-echo "Installing OpenRA tools to $(DATA_INSTALL_DIR)"
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) $(foreach prog,$(TOOLS),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)"
@$(RM) $(DATA_INSTALL_DIR)/OpenRA.TilesetBuilder.exe # TODO: won't work outside the source tree
install-linux-icons:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/"
@@ -388,6 +391,18 @@ install-linux-desktop:
@$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications"
install-linux-mime:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/mime/packages/"
@$(INSTALL_DATA) packaging/linux/openra-mimeinfo.xml "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-join-servers.desktop "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-replays.desktop "$(DESTDIR)$(datadir)/applications"
install-linux-appdata:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/appdata/"
@$(INSTALL_DATA) packaging/linux/openra.appdata.xml "$(DESTDIR)$(datadir)/appdata/"
install-linux-scripts:
@echo "#!/bin/sh" > openra
@echo 'cd "$(gameinstalldir)"' >> openra
@@ -423,6 +438,8 @@ uninstall:
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png"
@-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
@-$(RM_F) "$(DESTDIR)$(datadir)/appdata/openra.appdata.xml"
help:
@echo to compile, run:

View File

@@ -26,12 +26,12 @@ namespace OpenRA.Editor
public void Apply(Surface surface)
{
if (surface.Map.Actors.Value.Any(a => a.Value.Location() == surface.GetBrushLocation()))
if (surface.Actors.Any(a => a.Value.Location() == surface.GetBrushLocation()))
return;
var owner = surface.NewActorOwner;
var id = NextActorName(surface);
surface.Map.Actors.Value[id] = new ActorReference(actorTemplate.Info.Name.ToLowerInvariant())
surface.Actors[id] = new ActorReference(actorTemplate.Info.Name.ToLowerInvariant())
{
new LocationInit(surface.GetBrushLocation()),
new OwnerInit(owner)
@@ -44,7 +44,7 @@ namespace OpenRA.Editor
for (;;)
{
var possible = "Actor{0}".F(id++);
if (!surface.Map.Actors.Value.ContainsKey(possible)) return possible;
if (!surface.Actors.ContainsKey(possible)) return possible;
}
}
}

View File

@@ -126,8 +126,11 @@ namespace OpenRA.Editor
// upgrade maps that have no player definitions. editor doesnt care,
// but this breaks the game pretty badly.
if (map.Players.Count == 0)
map.MakeDefaultPlayers();
if (map.PlayerDefinitions.Count == 0)
{
var players = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length);
map.PlayerDefinitions = players.ToMiniYaml();
}
PrepareMapResources(Game.ModData, map);
@@ -170,7 +173,7 @@ namespace OpenRA.Editor
foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); }
var templateOrder = tileset.EditorTemplateOrder ?? new string[] { };
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category).OrderBy(t => Array.IndexOf(templateOrder, t.Key)))
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category).OrderBy(t => templateOrder.IndexOf(t.Key)))
{
var category = tc.Key ?? "(Uncategorized)";
var categoryHeader = new Label
@@ -210,7 +213,7 @@ namespace OpenRA.Editor
var template = t.Value;
tilePalette.Controls.Add(ibox);
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Image, template.Id, template.Size.X, template.Size.Y));
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Images[0], template.Id, template.Size.X, template.Size.Y));
}
catch { }
}
@@ -238,7 +241,9 @@ namespace OpenRA.Editor
if (rsi != null && rsi.EditorPalette != null && rsi.EditorPalette.Contains("terrain"))
templatePalette = palette;
var template = RenderUtils.RenderActor(info, tileset, templatePalette);
var race = Program.Rules.Actors["world"].Traits.WithInterface<CountryInfo>().First().Race;
var sequenceProvider = Program.Rules.Sequences[tileset.Id];
var template = RenderUtils.RenderActor(info, sequenceProvider, tileset, templatePalette, race);
var ibox = new PictureBox
{
Image = template.Bitmap,
@@ -267,7 +272,7 @@ namespace OpenRA.Editor
{
try
{
var template = RenderUtils.RenderResourceType(a, tileset.Extensions, shadowedPalette);
var template = RenderUtils.RenderResourceType(a, tileset, shadowedPalette);
var ibox = new PictureBox
{
Image = template.Bitmap,
@@ -313,7 +318,7 @@ namespace OpenRA.Editor
void PopulateActorOwnerChooser()
{
actorOwnerChooser.Items.Clear();
actorOwnerChooser.Items.AddRange(surface1.Map.Players.Values.ToArray());
actorOwnerChooser.Items.AddRange(new MapPlayers(surface1.Map.PlayerDefinitions).Players.Values.ToArray());
actorOwnerChooser.SelectedIndex = 0;
surface1.NewActorOwner = ((PlayerReference)actorOwnerChooser.SelectedItem).Name;
}
@@ -410,8 +415,9 @@ namespace OpenRA.Editor
map.ResizeCordon((int)nmd.CordonLeft.Value, (int)nmd.CordonTop.Value,
(int)nmd.CordonRight.Value, (int)nmd.CordonBottom.Value);
map.Players.Clear();
map.MakeDefaultPlayers();
var players = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length);
map.PlayerDefinitions = players.ToMiniYaml();
map.FixOpenAreas(Program.Rules);
NewMap(map);
@@ -500,8 +506,8 @@ namespace OpenRA.Editor
void SetupDefaultPlayers(object sender, EventArgs e)
{
dirty = true;
surface1.Map.Players.Clear();
surface1.Map.MakeDefaultPlayers();
var players = new MapPlayers(surface1.Map.Rules, surface1.Map.SpawnPoints.Value.Length);
surface1.Map.PlayerDefinitions = players.ToMiniYaml();
surface1.Chunks.Clear();
surface1.Invalidate();
@@ -575,10 +581,11 @@ namespace OpenRA.Editor
void AboutToolStripMenuItemClick(object sender, EventArgs e)
{
MessageBox.Show("OpenRA and OpenRA Editor are Free/Libre Open Source Software released under the GNU General Public License version 3. See AUTHORS and COPYING for details.",
"About",
MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
MessageBox.Show(
"OpenRA and OpenRA Editor are Free/Libre Open Source Software released under the GNU General Public License version 3. See AUTHORS and COPYING for details.",
"About",
MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
}
void HelpToolStripButton_Click(object sender, EventArgs e)

View File

@@ -59,7 +59,7 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Eluant">
<HintPath>..\thirdparty\Eluant.dll</HintPath>
<HintPath>..\thirdparty\download\Eluant.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

View File

@@ -14,6 +14,7 @@ using System.Linq;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.SpriteLoaders;
using OpenRA.Traits;
@@ -46,27 +47,30 @@ namespace OpenRA.Editor
return bitmap;
}
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, IPalette p)
static readonly string[] LegacyExtensions = new[] { ".shp", ".tem", "" };
static string ResolveFilename(string name, TileSet tileSet)
{
var image = info.Traits.Get<ILegacyEditorRenderInfo>().EditorImage(info);
using (var s = GlobalFileSystem.OpenWithExts(image, tileset.Extensions))
var ssl = Game.ModData.SpriteSequenceLoader as TilesetSpecificSpriteSequenceLoader;
var extensions = ssl != null ? new[] { ssl.TilesetExtensions[tileSet.Id], ssl.DefaultSpriteExtension }.Append(LegacyExtensions) :
LegacyExtensions.AsEnumerable();
foreach (var e in extensions)
if (GlobalFileSystem.Exists(name + e))
return name + e;
return name;
}
public static ActorTemplate RenderActor(ActorInfo info, SequenceProvider sequenceProvider, TileSet tileset, IPalette p, string race)
{
var image = info.Traits.Get<ILegacyEditorRenderInfo>().EditorImage(info, sequenceProvider, race);
image = ResolveFilename(image, tileset);
using (var s = GlobalFileSystem.Open(image))
{
var shp = new ShpTDSprite(s);
var bitmap = RenderShp(shp, p);
try
{
using (var s2 = GlobalFileSystem.OpenWithExts(image + "2", tileset.Extensions))
{
var shp2 = new ShpTDSprite(s2);
var roofBitmap = RenderShp(shp2, p);
using (var g = System.Drawing.Graphics.FromImage(bitmap))
g.DrawImage(roofBitmap, 0, 0);
}
}
catch { }
return new ActorTemplate
{
Bitmap = bitmap,
@@ -76,10 +80,10 @@ namespace OpenRA.Editor
}
}
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, string[] exts, IPalette p)
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, TileSet tileset, IPalette p)
{
var image = info.EditorSprite;
using (var s = GlobalFileSystem.OpenWithExts(image, exts))
var image = ResolveFilename(info.EditorSprite, tileset);
using (var s = GlobalFileSystem.Open(image))
{
// TODO: Do this properly
var shp = new ShpTDSprite(s);

View File

@@ -43,6 +43,7 @@ namespace OpenRA.Editor
class Surface : Control
{
public Map Map { get; private set; }
public Dictionary<string, ActorReference> Actors { get; private set; }
public TileSet TileSet { get; private set; }
public TileSetRenderer TileSetRenderer { get; private set; }
public IPalette Palette { get; private set; }
@@ -84,6 +85,9 @@ namespace OpenRA.Editor
public void Bind(Map m, TileSet ts, TileSetRenderer tsr, IPalette p, IPalette pp)
{
Map = m;
if (m != null)
Actors = m.ActorDefinitions.ToDictionary(n => n.Key, n => new ActorReference(n.Value.Value, n.Value.ToDictionary()));
TileSet = ts;
TileSetRenderer = tsr;
Palette = p;
@@ -132,7 +136,7 @@ namespace OpenRA.Editor
{
base.OnDoubleClick(e);
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
var x = Actors.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
if (x.Key != null)
ActorDoubleClicked(x);
}
@@ -203,8 +207,8 @@ namespace OpenRA.Editor
currentTool = null;
var key = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == brushLocation);
if (key.Key != null) Map.Actors.Value.Remove(key.Key);
var key = Actors.FirstOrDefault(a => a.Value.Location() == brushLocation);
if (key.Key != null) Actors.Remove(key.Key);
if (Map.MapResources.Value[brushLocation].Type != 0)
{
@@ -274,6 +278,15 @@ namespace OpenRA.Editor
var ui = u * ChunkSize + i;
var vj = v * ChunkSize + j;
var uv = new MPos(ui, vj);
if (uv.U >= Map.MapSize.X || uv.V >= Map.MapSize.Y)
{
for (var x = 0; x < TileSetRenderer.TileSize; x++)
for (var y = 0; y < TileSetRenderer.TileSize; y++)
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] = 0;
continue;
}
var tr = Map.MapTiles.Value[uv];
var tile = TileSetRenderer.Data(tr.Type);
if (tile == null)
@@ -283,7 +296,8 @@ namespace OpenRA.Editor
var rawImage = tile[index];
for (var x = 0; x < TileSetRenderer.TileSize; x++)
for (var y = 0; y < TileSetRenderer.TileSize; y++)
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] = Palette.GetColor(rawImage[x + TileSetRenderer.TileSize * y]).ToArgb();
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] =
Palette.GetColor(rawImage[x + TileSetRenderer.TileSize * y]).ToArgb();
if (Map.MapResources.Value[uv].Type != 0)
{
@@ -385,8 +399,8 @@ namespace OpenRA.Editor
ColorPalette GetPaletteForPlayerInner(string name)
{
var pr = Map.Players[name];
var pcpi = Program.Rules.Actors["player"].Traits.Get<PlayerColorPaletteInfo>();
var pr = new MapPlayers(Map.PlayerDefinitions).Players[name];
var pcpi = Program.Rules.Actors["world"].Traits.Get<PlayerColorPaletteInfo>();
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.Color, pcpi.Ramp);
return new ImmutablePalette(PlayerPalette, remap).AsSystemPalette();
}
@@ -455,7 +469,7 @@ namespace OpenRA.Editor
height * (TileSetRenderer.TileSize * Zoom));
}
foreach (var ar in Map.Actors.Value)
foreach (var ar in Actors)
{
if (actorTemplates.ContainsKey(ar.Value.Type))
DrawActor(e.Graphics, ar.Value.Location(), actorTemplates[ar.Value.Type],
@@ -465,7 +479,7 @@ namespace OpenRA.Editor
}
if (ShowActorNames)
foreach (var ar in Map.Actors.Value)
foreach (var ar in Actors)
if (!ar.Key.StartsWith("Actor")) // if it has a custom name
e.Graphics.DrawStringContrast(Font, ar.Key,
(int)(ar.Value.Location().X * TileSetRenderer.TileSize * Zoom + Offset.X),
@@ -499,7 +513,7 @@ namespace OpenRA.Editor
if (currentTool == null)
{
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
var x = Actors.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
if (x.Key != null && actorTemplates.ContainsKey(x.Value.Type))
DrawActorBorder(e.Graphics, x.Value.Location(), actorTemplates[x.Value.Type]);
}

View File

@@ -50,10 +50,10 @@ namespace OpenRA.Editor
this.TileSize = Math.Min(tileSize.Width, tileSize.Height);
templates = new Dictionary<ushort, byte[][]>();
var frameCache = new FrameCache(Game.ModData.SpriteLoaders, tileset.Extensions);
var frameCache = new FrameCache(Game.ModData.SpriteLoaders);
foreach (var t in tileset.Templates)
{
var allFrames = frameCache[t.Value.Image];
var allFrames = frameCache[t.Value.Images[0]];
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
templates.Add(t.Value.Id, frames.Select(f => ExtractSquareTile(f)).ToArray());
}

6
OpenRA.Game.exe.config Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>

View File

@@ -25,11 +25,12 @@ namespace OpenRA
public class Actor : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILuaEqualityBinding, ILuaToStringBinding, IEquatable<Actor>
{
public readonly ActorInfo Info;
public readonly World World;
public readonly uint ActorID;
[Sync]
public Player Owner;
[Sync] public Player Owner { get; set; }
public bool IsInWorld { get; internal set; }
public bool Destroyed { get; private set; }
@@ -65,8 +66,9 @@ namespace OpenRA
}
}
readonly IEnumerable<IRenderModifier> traitsImplementingRenderModifier;
readonly IEnumerable<IRender> traitsImplementingRender;
readonly IRenderModifier[] renderModifiers;
readonly IRender[] renders;
readonly IDisable[] disables;
internal Actor(World world, string name, TypeDictionary initDict)
{
@@ -108,8 +110,9 @@ namespace OpenRA
return new Rectangle(offset.X, offset.Y, size.X, size.Y);
});
traitsImplementingRenderModifier = TraitsImplementing<IRenderModifier>();
traitsImplementingRender = TraitsImplementing<IRender>();
renderModifiers = TraitsImplementing<IRenderModifier>().ToArray();
renders = TraitsImplementing<IRender>().ToArray();
disables = TraitsImplementing<IDisable>().ToArray();
}
public void Tick()
@@ -125,14 +128,14 @@ namespace OpenRA
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
var renderables = Renderables(wr);
foreach (var modifier in traitsImplementingRenderModifier)
foreach (var modifier in renderModifiers)
renderables = modifier.ModifyRender(this, wr, renderables);
return renderables;
}
IEnumerable<IRenderable> Renderables(WorldRenderer wr)
{
foreach (var render in traitsImplementingRender)
foreach (var render in renders)
foreach (var renderable in render.Render(this, wr))
yield return renderable;
}
@@ -181,7 +184,10 @@ namespace OpenRA
public override string ToString()
{
return "{0} {1}{2}".F(Info.Name, ActorID, IsInWorld ? "" : " (not in world)");
var name = Info.Name + " " + ActorID;
if (!IsInWorld)
name += " (not in world)";
return name;
}
public T Trait<T>()
@@ -232,16 +238,21 @@ namespace OpenRA
{
World.AddFrameEndTask(w =>
{
if (this.Destroyed)
if (Destroyed)
return;
var oldOwner = Owner;
var wasInWorld = IsInWorld;
// momentarily remove from world so the ownership queries don't get confused
w.Remove(this);
if (wasInWorld)
w.Remove(this);
Owner = newOwner;
Generation++;
w.Add(this);
if (wasInWorld)
w.Add(this);
foreach (var t in this.TraitsImplementing<INotifyOwnerChanged>())
t.OnOwnerChanged(this, oldOwner, newOwner);
@@ -256,6 +267,14 @@ namespace OpenRA
health.Value.InflictDamage(this, attacker, health.Value.MaxHP, null, true);
}
public bool IsDisabled()
{
foreach (var disable in disables)
if (disable.Disabled)
return true;
return false;
}
#region Scripting interface
Lazy<ScriptActorInterface> luaInterface;

View File

@@ -37,7 +37,7 @@ namespace OpenRA
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public bool Equals(CPos other) { return other == this; }
public bool Equals(CPos other) { return X == other.X && Y == other.Y; }
public override bool Equals(object obj) { return obj is CPos && Equals((CPos)obj); }
public override string ToString() { return X + "," + Y; }

View File

@@ -0,0 +1,19 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA
{
public interface ICacheStorage<T>
{
void Remove(string key);
void Store(string key, T data);
T Retrieve(string key);
}
}

View File

@@ -0,0 +1,38 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Graphics;
namespace OpenRA.Effects
{
public class AsyncAction : IEffect
{
Action a;
IAsyncResult ar;
public AsyncAction(IAsyncResult ar, Action a)
{
this.a = a;
this.ar = ar;
}
public void Tick(World world)
{
if (ar.IsCompleted)
{
world.AddFrameEndTask(w => { w.Remove(this); a(); });
}
}
public IEnumerable<IRenderable> Render(WorldRenderer r) { yield break; }
}
}

View File

@@ -25,8 +25,11 @@ namespace OpenRA.Effects
this.target = target;
player = asPlayer;
remainingTicks = ticks;
foreach (var e in target.World.Effects.OfType<FlashTarget>().Where(a => a.target == target).ToArray())
target.World.Remove(e);
target.World.RemoveAll(effect =>
{
var flashTarget = effect as FlashTarget;
return flashTarget != null && flashTarget.target == target;
});
}
public void Tick(World world)

View File

@@ -15,15 +15,15 @@ namespace OpenRA.Effects
{
public class SpriteEffect : IEffect
{
string palette;
Animation anim;
WPos pos;
readonly string palette;
readonly Animation anim;
readonly WPos pos;
public SpriteEffect(WPos pos, World world, string sprite, string palette)
public SpriteEffect(WPos pos, World world, string image, string palette)
{
this.pos = pos;
this.palette = palette;
anim = new Animation(world, sprite);
anim = new Animation(world, image);
anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this)));
}

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.Linq;
using System.Reflection;
@@ -87,6 +88,29 @@ namespace OpenRA
return r.Contains(p.ToPointF());
}
static int WindingDirectionTest(int2 v0, int2 v1, int2 p)
{
return (v1.X - v0.X) * (p.Y - v0.Y) - (p.X - v0.X) * (v1.Y - v0.Y);
}
public static bool PolygonContains(this int2[] polygon, int2 p)
{
var windingNumber = 0;
for (var i = 0; i < polygon.Length; i++)
{
var tv = polygon[i];
var nv = polygon[(i + 1) % polygon.Length];
if (tv.Y <= p.Y && nv.Y > p.Y && WindingDirectionTest(tv, nv, p) > 0)
windingNumber++;
else if (tv.Y > p.Y && nv.Y <= p.Y && WindingDirectionTest(tv, nv, p) < 0)
windingNumber--;
}
return windingNumber != 0;
}
public static bool HasModifier(this Modifiers k, Modifiers mod)
{
return (k & mod) == mod;
@@ -106,21 +130,34 @@ namespace OpenRA
return ret;
}
public static int IndexOf<T>(this T[] array, T value)
{
return Array.IndexOf(array, value);
}
public static T Random<T>(this IEnumerable<T> ts, MersenneTwister r)
{
var xs = ts as ICollection<T>;
if (xs != null)
return xs.ElementAt(r.Next(xs.Count));
var ys = ts.ToList();
return ys[r.Next(ys.Count)];
return Random(ts, r, true);
}
public static T RandomOrDefault<T>(this IEnumerable<T> ts, MersenneTwister r)
{
if (!ts.Any())
return default(T);
return Random(ts, r, false);
}
return ts.Random(r);
static T Random<T>(IEnumerable<T> ts, MersenneTwister r, bool throws)
{
var xs = ts as ICollection<T>;
xs = xs ?? ts.ToList();
if (xs.Count == 0)
{
if (throws)
throw new ArgumentException("Collection must not be empty.", "ts");
else
return default(T);
}
else
return xs.ElementAt(r.Next(xs.Count));
}
public static float Product(this IEnumerable<float> xs)
@@ -299,12 +336,21 @@ namespace OpenRA
return ts.Concat(moreTs);
}
public static Dictionary<TKey, TSource> ToDictionaryWithConflictLog<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, string debugName, Func<TKey, string> logKey, Func<TSource, string> logValue)
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
{
return new HashSet<T>(source);
}
public static Dictionary<TKey, TSource> ToDictionaryWithConflictLog<TSource, TKey>(
this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,
string debugName, Func<TKey, string> logKey, Func<TSource, string> logValue)
{
return ToDictionaryWithConflictLog(source, keySelector, x => x, debugName, logKey, logValue);
}
public static Dictionary<TKey, TElement> ToDictionaryWithConflictLog<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, string debugName, Func<TKey, string> logKey, Func<TElement, string> logValue)
public static Dictionary<TKey, TElement> ToDictionaryWithConflictLog<TSource, TKey, TElement>(
this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector,
string debugName, Func<TKey, string> logKey, Func<TElement, string> logValue)
{
// Fall back on ToString() if null functions are provided:
logKey = logKey ?? (s => s.ToString());
@@ -341,7 +387,7 @@ namespace OpenRA
// If any duplicates were found, throw a descriptive error
if (dupKeys.Count > 0)
{
var badKeysFormatted = string.Join(", ", dupKeys.Select(p => "{0}: [{1}]".F(logKey(p.Key), string.Join(",", p.Value.ToArray()))).ToArray());
var badKeysFormatted = string.Join(", ", dupKeys.Select(p => "{0}: [{1}]".F(logKey(p.Key), string.Join(",", p.Value))));
var msg = "{0}, duplicate values found for the following keys: {1}".F(debugName, badKeysFormatted);
throw new ArgumentException(msg);
}
@@ -375,7 +421,8 @@ namespace OpenRA
{
for (var j = 0; j < height; j++)
{
// Workaround for broken ternary operators in certain versions of mono (3.10 and certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
// Workaround for broken ternary operators in certain versions of mono
// (3.10 and certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
if (i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1))
result[i, j] = ts[i, j];
else
@@ -388,6 +435,25 @@ namespace OpenRA
public static Rectangle Bounds(this Bitmap b) { return new Rectangle(0, 0, b.Width, b.Height); }
public static Bitmap CloneWith32bbpArgbPixelFormat(this Bitmap original)
{
// Note: We would use original.Clone(original.Bounds(), PixelFormat.Format32bppArgb)
// but this doesn't work on mono.
var clone = new Bitmap(original.Width, original.Height, PixelFormat.Format32bppArgb);
try
{
using (var g = System.Drawing.Graphics.FromImage(clone))
g.DrawImage(original, original.Bounds());
}
catch (Exception)
{
clone.Dispose();
throw;
}
return clone;
}
public static int ToBits(this IEnumerable<bool> bits)
{
var i = 0;

View File

@@ -33,9 +33,17 @@ namespace OpenRA
throw new NotImplementedException("FieldLoader: Missing field `{0}` on `{1}`".F(s, f.Name));
};
static readonly ConcurrentCache<Type, FieldLoadInfo[]> TypeLoadInfo =
new ConcurrentCache<Type, FieldLoadInfo[]>(BuildTypeLoadInfo);
static readonly ConcurrentCache<MemberInfo, bool> MemberHasTranslateAttribute =
new ConcurrentCache<MemberInfo, bool>(member => member.HasAttribute<TranslateAttribute>());
static readonly object TranslationsLock = new object();
static Dictionary<string, string> translations;
public static void Load(object self, MiniYaml my)
{
var loadInfo = typeLoadInfo[self.GetType()];
var loadInfo = TypeLoadInfo[self.GetType()];
Dictionary<string, MiniYaml> md = null;
@@ -82,7 +90,6 @@ namespace OpenRA
return t;
}
static readonly object[] NoIndexes = { };
public static void LoadField(object target, string key, string value)
{
const BindingFlags Flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
@@ -103,7 +110,7 @@ namespace OpenRA
{
var sa = prop.GetCustomAttributes<SerializeAttribute>(false).DefaultIfEmpty(SerializeAttribute.Default).First();
if (!sa.FromYamlKey)
prop.SetValue(target, GetValue(prop.Name, prop.PropertyType, value, prop), NoIndexes);
prop.SetValue(target, GetValue(prop.Name, prop.PropertyType, value, prop), null);
return;
}
@@ -162,7 +169,7 @@ namespace OpenRA
}
else if (fieldType == typeof(string))
{
if (field != null && field.HasAttribute<TranslateAttribute>())
if (field != null && MemberHasTranslateAttribute[field])
return Regex.Replace(value, "@[^@]+@", m => Translate(m.Value.Substring(1, m.Value.Length - 2)), RegexOptions.Compiled);
return value;
}
@@ -438,12 +445,10 @@ namespace OpenRA
public static IEnumerable<FieldLoadInfo> GetTypeLoadInfo(Type type, bool includePrivateByDefault = false)
{
return typeLoadInfo[type].Where(fli => includePrivateByDefault || fli.Field.IsPublic || (fli.Attribute.Serialize && !fli.Attribute.IsDefault));
return TypeLoadInfo[type].Where(fli => includePrivateByDefault || fli.Field.IsPublic || (fli.Attribute.Serialize && !fli.Attribute.IsDefault));
}
static Cache<Type, List<FieldLoadInfo>> typeLoadInfo = new Cache<Type, List<FieldLoadInfo>>(BuildTypeLoadInfo);
static List<FieldLoadInfo> BuildTypeLoadInfo(Type type)
static FieldLoadInfo[] BuildTypeLoadInfo(Type type)
{
var ret = new List<FieldLoadInfo>();
@@ -465,7 +470,7 @@ namespace OpenRA
ret.Add(fli);
}
return ret;
return ret.ToArray();
}
[AttributeUsage(AttributeTargets.Field)]
@@ -520,17 +525,27 @@ namespace OpenRA
public static string Translate(string key)
{
if (Translations == null || string.IsNullOrEmpty(key))
if (string.IsNullOrEmpty(key))
return key;
string value;
if (!Translations.TryGetValue(key, out value))
return key;
lock (TranslationsLock)
{
if (translations == null)
return key;
return value;
string value;
if (!translations.TryGetValue(key, out value))
return key;
return value;
}
}
public static Dictionary<string, string> Translations = new Dictionary<string, string>();
public static void SetTranslations(IDictionary<string, string> translations)
{
lock (TranslationsLock)
FieldLoader.translations = new Dictionary<string, string>(translations);
}
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
@@ -546,6 +561,7 @@ namespace OpenRA
}
// mirrors DescriptionAttribute from System.ComponentModel but we dont want to have to use that everywhere.
[AttributeUsage(AttributeTargets.All)]
public sealed class DescAttribute : Attribute
{
public readonly string[] Lines;

View File

@@ -45,8 +45,8 @@ namespace OpenRA.FileFormats
public static class AudLoader
{
static int[] indexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 };
static int[] stepTable =
{
static int[] stepTable =
{
7, 8, 9, 10, 11, 12, 13, 14, 16,
17, 19, 21, 23, 25, 28, 31, 34, 37,
41, 45, 50, 55, 60, 66, 73, 80, 88,
@@ -56,7 +56,7 @@ namespace OpenRA.FileFormats
1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749,
3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289,
16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
};
static short DecodeSample(byte b, ref int index, ref int current)

View File

@@ -241,9 +241,8 @@ namespace OpenRA.FileFormats
var num = (code >> 4) + 1; // Number of codes (top four bits plus 1)
var len = (byte)(code & 15); // Code length (low four bits)
do
{
length[s++] = len;
} while (--num > 0);
while (--num > 0);
}
n = s;

View File

@@ -187,9 +187,7 @@ namespace OpenRA.FileFormats
blockStart = offset;
}
else
{
offset++;
}
}
// Write what we haven't written up to now

View File

@@ -0,0 +1,44 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.IO;
using OpenRA.FileSystem;
namespace OpenRA.FileFormats
{
public class IdxReader
{
public readonly int SoundCount;
public List<IdxEntry> Entries;
public IdxReader(Stream s)
{
s.Seek(0, SeekOrigin.Begin);
var id = s.ReadASCII(4);
if (id != "GABA")
throw new InvalidDataException("Unable to load Idx file, did not find magic id, found {0} instead".F(id));
var two = s.ReadInt32();
if (two != 2)
throw new InvalidDataException("Unable to load Idx file, did not find magic number 2, found {0} instead".F(two));
SoundCount = s.ReadInt32();
Entries = new List<IdxEntry>();
for (var i = 0; i < SoundCount; i++)
Entries.Add(new IdxEntry(s));
}
}
}

View File

@@ -43,7 +43,7 @@ namespace OpenRA.FileFormats
1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749,
3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289,
16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
};
static short DecodeImaAdpcmSample(byte b, ref int index, ref int current)

View File

@@ -71,7 +71,7 @@ namespace OpenRA.FileFormats
public void RenameFile(string newFilenameWithoutExtension)
{
var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".rep";
var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".orarep";
File.Move(FilePath, newPath);
FilePath = newPath;
}

View File

@@ -38,8 +38,12 @@ namespace OpenRA.FileFormats
byte[] cbf;
byte[] cbp;
byte[] cbfBuffer;
byte[] fileBuffer = new byte[256000]; // Buffer for loading file subchunks, the maximum chunk size of a file is not defined
int maxCbfzSize = 256000; // and the header definition for the size of the biggest chunks (color data) isn't accurate. But 256k is large enough for all TS videos(< 200k).
// Buffer for loading file subchunks, the maximum chunk size of a file is not defined
// and the header definition for the size of the biggest chunks (color data) isn't accurate.
// But 256k is large enough for all TS videos(< 200k).
byte[] fileBuffer = new byte[256000];
int maxCbfzSize = 256000;
int vtprSize = 0;
int currentChunkBuffer = 0;
int chunkBufferOffset = 0;
@@ -73,7 +77,7 @@ namespace OpenRA.FileFormats
/*var length2 = */stream.ReadUInt32();
/*var version = */stream.ReadUInt16();
videoFlags = stream.ReadUInt16();
videoFlags = stream.ReadUInt16();
Frames = stream.ReadUInt16();
Width = stream.ReadUInt16();
Height = stream.ReadUInt16();
@@ -129,7 +133,7 @@ namespace OpenRA.FileFormats
type = stream.ReadASCII(4);
}
else
throw new NotSupportedException("Vqa uses unknown Subtype : {0}".F(type));
throw new NotSupportedException("Vqa uses unknown Subtype: {0}".F(type));
}
/*var length = */stream.ReadUInt16();
@@ -183,7 +187,9 @@ namespace OpenRA.FileFormats
{
case "SND0":
case "SND2":
if (audioChannels == 1)
if (audioChannels == 0)
throw new NotSupportedException();
else if (audioChannels == 1)
{
var rawAudio = stream.ReadBytes((int)length);
audio1.Write(rawAudio);
@@ -194,11 +200,15 @@ namespace OpenRA.FileFormats
audio1.Write(rawAudio);
rawAudio = stream.ReadBytes((int)length / 2);
audio2.Write(rawAudio);
if (length % 2 != 0)
stream.ReadBytes(2);
}
compressed = type == "SND2";
break;
default:
if (length + stream.Position > stream.Length)
throw new NotSupportedException("Vqa uses unknown Subtype: {0}".F(type));
stream.ReadBytes((int)length);
break;
}
@@ -209,9 +219,7 @@ namespace OpenRA.FileFormats
}
if (audioChannels == 1)
{
audioData = compressed ? AudLoader.LoadSound(audio1.ToArray(), ref adpcmIndex) : audio1.ToArray();
}
else
{
byte[] leftData, rightData;
@@ -317,7 +325,7 @@ namespace OpenRA.FileFormats
// Full frame-modifier
case "CBFZ":
var decodeMode = s.Peek() == 0;
s.Read(fileBuffer, 0, subchunkLength);
s.ReadBytes(fileBuffer, 0, subchunkLength);
Array.Clear(cbf, 0, cbf.Length);
Array.Clear(cbfBuffer, 0, cbfBuffer.Length);
var decodeCount = 0;
@@ -388,7 +396,7 @@ namespace OpenRA.FileFormats
return;
case "VPRZ":
Array.Clear(origData, 0, origData.Length);
s.Read(fileBuffer, 0, subchunkLength);
s.ReadBytes(fileBuffer, 0, subchunkLength);
if (fileBuffer[0] != 0)
vtprSize = Format80.DecodeInto(fileBuffer, origData);
else
@@ -396,7 +404,7 @@ namespace OpenRA.FileFormats
return;
case "VPTR":
Array.Clear(origData, 0, origData.Length);
s.Read(origData, 0, subchunkLength);
s.ReadBytes(origData, 0, subchunkLength);
vtprSize = subchunkLength;
return;
default:
@@ -413,7 +421,7 @@ namespace OpenRA.FileFormats
if (IsHqVqa)
{
/* The VP?? chunks of the video file contains an array of instructions for
* how the blocks of the finished frame will be filled with color data blocks
* how the blocks of the finished frame will be filled with color data blocks
* contained in the CBF? chunks.
*/
var p = 0;
@@ -424,7 +432,7 @@ namespace OpenRA.FileFormats
if (y >= blocks.Y)
break;
// The first 3 bits of the short determine the type of instruction with the rest being one or two parameters.
// The first 3 bits of the short determine the type of instruction with the rest being one or two parameters.
var val = (int)origData[p++];
val |= origData[p++] << 8;
var para_A = val & 0x1fff;

View File

@@ -129,7 +129,7 @@ namespace OpenRA.FileFormats
// Decode each block of IMA ADPCM data in RawOutput
for (var block = 0; block < numBlocks; block++)
{
// Each block starts with a initial state per-channel
// Each block starts with a initial state per-channel
for (var c = 0; c < Channels; c++)
{
predictor[c] = s.ReadInt16();

View File

@@ -0,0 +1,192 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using OpenRA.FileFormats;
using OpenRA.Primitives;
namespace OpenRA.FileSystem
{
public sealed class BagFile : IFolder, IDisposable
{
static readonly uint[] Nothing = { };
readonly string bagFilename;
readonly Stream s;
readonly int bagFilePriority;
readonly Dictionary<uint, IdxEntry> index;
public BagFile(string filename, int priority)
{
bagFilename = filename;
bagFilePriority = priority;
// A bag file is always accompanied with an .idx counterpart
// For example: audio.bag requires the audio.idx file
var indexFilename = Path.ChangeExtension(filename, ".idx");
s = GlobalFileSystem.Open(filename);
// Build the index and dispose the stream, it is no longer needed after this
List<IdxEntry> entries;
using (var indexStream = GlobalFileSystem.Open(indexFilename))
{
var reader = new IdxReader(indexStream);
entries = reader.Entries;
}
index = entries.ToDictionaryWithConflictLog(x => x.Hash,
"{0} (bag format)".F(filename),
null, x => "(offs={0}, len={1})".F(x.Offset, x.Length));
}
public int Priority { get { return 1000 + bagFilePriority; } }
public string Name { get { return bagFilename; } }
public Stream GetContent(uint hash)
{
IdxEntry entry;
if (!index.TryGetValue(hash, out entry))
return null;
s.Seek(entry.Offset, SeekOrigin.Begin);
var waveHeaderMemoryStream = new MemoryStream();
var channels = (entry.Flags & 1) > 0 ? 2 : 1;
if ((entry.Flags & 2) > 0)
{
// PCM
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("RIFF"));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.Length + 36));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("WAVE"));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("fmt "));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(16));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)WavLoader.WaveType.Pcm));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)channels));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.SampleRate));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(2 * channels * entry.SampleRate));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)(2 * channels)));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)16));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("data"));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.Length));
}
if ((entry.Flags & 8) > 0)
{
// IMA ADPCM
var samplesPerChunk = (2 * (entry.ChunkSize - 4)) + 1;
var bytesPerSec = (int)Math.Floor(((double)(2 * entry.ChunkSize) / samplesPerChunk) * ((double)entry.SampleRate / 2));
var chunkSize = entry.ChunkSize > entry.Length ? entry.Length : entry.ChunkSize;
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("RIFF"));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.Length + 52));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("WAVE"));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("fmt "));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(20));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)WavLoader.WaveType.ImaAdpcm));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)channels));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.SampleRate));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(bytesPerSec));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)chunkSize));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)4));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)2));
waveHeaderMemoryStream.Write(BitConverter.GetBytes((short)samplesPerChunk));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("fact"));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(4));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(4 * entry.Length));
waveHeaderMemoryStream.Write(Encoding.ASCII.GetBytes("data"));
waveHeaderMemoryStream.Write(BitConverter.GetBytes(entry.Length));
}
waveHeaderMemoryStream.Seek(0, SeekOrigin.Begin);
// Construct a merged stream
var mergedStream = new MergedStream(waveHeaderMemoryStream, s);
mergedStream.SetLength(waveHeaderMemoryStream.Length + entry.Length);
return mergedStream;
}
uint? FindMatchingHash(string filename)
{
var hash = IdxEntry.HashFilename(filename, PackageHashType.CRC32);
if (index.ContainsKey(hash))
return hash;
// Maybe we were given a raw hash?
uint raw;
if (!uint.TryParse(filename, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out raw))
return null;
if ("{0:X}".F(raw) == filename && index.ContainsKey(raw))
return raw;
return null;
}
public Stream GetContent(string filename)
{
var hash = FindMatchingHash(filename);
return hash.HasValue ? GetContent(hash.Value) : null;
}
public bool Exists(string filename)
{
return FindMatchingHash(filename).HasValue;
}
public IEnumerable<uint> ClassicHashes()
{
return Nothing;
}
public IEnumerable<uint> CrcHashes()
{
return index.Keys;
}
public IEnumerable<string> AllFileNames()
{
var lookup = new Dictionary<uint, string>();
if (GlobalFileSystem.Exists("global mix database.dat"))
{
var db = new XccGlobalDatabase(GlobalFileSystem.Open("global mix database.dat"));
foreach (var e in db.Entries)
{
var hash = IdxEntry.HashFilename(e, PackageHashType.CRC32);
if (!lookup.ContainsKey(hash))
lookup.Add(hash, e);
}
}
return index.Keys.Select(k => lookup.ContainsKey(k) ? lookup[k] : "{0:X}".F(k));
}
public void Write(Dictionary<string, byte[]> contents)
{
GlobalFileSystem.Unmount(this);
throw new NotImplementedException("Updating bag files unsupported");
}
public void Dispose()
{
if (s != null)
s.Dispose();
}
}
}

View File

@@ -101,6 +101,8 @@ namespace OpenRA.FileSystem
return new PakFile(filename, order);
if (filename.EndsWith(".big", StringComparison.InvariantCultureIgnoreCase))
return new BigFile(filename, order);
if (filename.EndsWith(".bag", StringComparison.InvariantCultureIgnoreCase))
return new BagFile(filename, order);
return new Folder(filename, order);
}
@@ -164,45 +166,38 @@ namespace OpenRA.FileSystem
return null;
}
public static Stream Open(string filename) { return OpenWithExts(filename, ""); }
public static Stream OpenWithExts(string filename, params string[] exts)
public static Stream Open(string filename)
{
Stream s;
if (!TryOpenWithExts(filename, exts, out s))
if (!TryOpen(filename, out s))
throw new FileNotFoundException("File not found: {0}".F(filename), filename);
return s;
}
public static bool TryOpenWithExts(string filename, string[] exts, out Stream s)
public static bool TryOpen(string filename, out Stream s)
{
// Check the cache for a quick lookup
if (filename.IndexOfAny(new char[] { '/', '\\' }) == -1)
{
foreach (var ext in exts)
{
s = GetFromCache(PackageHashType.Classic, filename + ext);
if (s != null)
return true;
s = GetFromCache(PackageHashType.Classic, filename);
if (s != null)
return true;
s = GetFromCache(PackageHashType.CRC32, filename + ext);
if (s != null)
return true;
}
s = GetFromCache(PackageHashType.CRC32, filename);
if (s != null)
return true;
}
foreach (var ext in exts)
{
var possibleName = filename + ext;
var folder = MountedFolders
.Where(x => x.Exists(possibleName))
.MaxByOrDefault(x => x.Priority);
// Ask each package individually
var folder = MountedFolders
.Where(x => x.Exists(filename))
.MaxByOrDefault(x => x.Priority);
if (folder != null)
{
s = folder.GetContent(possibleName);
return true;
}
if (folder != null)
{
s = folder.GetContent(filename);
return true;
}
s = null;

View File

@@ -0,0 +1,94 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.IO;
namespace OpenRA.FileSystem
{
public class IdxEntry
{
public const string DefaultExtension = "wav";
public readonly uint Hash;
public readonly string Name;
public readonly string Extension;
public readonly uint Offset;
public readonly uint Length;
public readonly uint SampleRate;
public readonly uint Flags;
public readonly uint ChunkSize;
public IdxEntry(uint hash, uint offset, uint length, uint sampleRate, uint flags, uint chuckSize)
{
Hash = hash;
Offset = offset;
Length = length;
SampleRate = sampleRate;
Flags = flags;
ChunkSize = chuckSize;
}
public IdxEntry(Stream s)
{
var asciiname = s.ReadASCII(16);
var pos = asciiname.IndexOf('\0');
if (pos != 0)
asciiname = asciiname.Substring(0, pos);
Name = asciiname;
Extension = DefaultExtension;
Offset = s.ReadUInt32();
Length = s.ReadUInt32();
SampleRate = s.ReadUInt32();
Flags = s.ReadUInt32();
ChunkSize = s.ReadUInt32();
Hash = HashFilename(string.Concat(Name, ".", Extension), PackageHashType.CRC32);
}
public void Write(BinaryWriter w)
{
w.Write(Name.PadRight(16, '\0'));
w.Write(Offset);
w.Write(Length);
w.Write(SampleRate);
w.Write(Flags);
w.Write(ChunkSize);
}
public override string ToString()
{
string filename;
if (names.TryGetValue(Hash, out filename))
return "{0} - offset 0x{1:x8} - length 0x{2:x8}".F(filename, Offset, Length);
else
return "0x{0:x8} - offset 0x{1:x8} - length 0x{2:x8}".F(Hash, Offset, Length);
}
public static uint HashFilename(string name, PackageHashType type)
{
return PackageEntry.HashFilename(name, type);
}
static Dictionary<uint, string> names = new Dictionary<uint, string>();
public static void AddStandardName(string s)
{
// RA1 and TD
var hash = HashFilename(s, PackageHashType.Classic);
names.Add(hash, s);
// TS
var crcHash = HashFilename(s, PackageHashType.CRC32);
names.Add(crcHash, s);
}
}
}

View File

@@ -15,7 +15,6 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using MaxMind.GeoIP2;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Network;
@@ -44,8 +43,6 @@ namespace OpenRA
public static Renderer Renderer;
public static bool HasInputFocus = false;
public static DatabaseReader GeoIpDatabase;
public static OrderManager JoinServer(string host, int port, string password, bool recordReplay = true)
{
IConnection connection = new NetworkConnection(host, port);
@@ -216,14 +213,7 @@ namespace OpenRA
Settings.Server.AllowPortForward = false;
}
try
{
GeoIpDatabase = new DatabaseReader("GeoLite2-Country.mmdb");
}
catch (Exception e)
{
Log.Write("geoip", "DatabaseReader failed: {0}", e);
}
GeoIP.Initialize();
GlobalFileSystem.Mount(Platform.GameDir); // Needed to access shaders
var renderers = new[] { Settings.Graphics.Renderer, "Sdl2", null };
@@ -309,6 +299,9 @@ namespace OpenRA
using (new PerfTimer("LoadMaps"))
ModData.MapCache.LoadMaps();
if (Cursor != null)
Cursor.Dispose();
if (Settings.Graphics.HardwareCursors)
{
try
@@ -372,6 +365,11 @@ namespace OpenRA
ModData.LoadScreen.StartGame(args);
}
public static void LoadEditor(string mapUid)
{
StartGame(mapUid, WorldType.Editor);
}
public static void LoadShellMap()
{
var shellmap = ChooseShellmap();
@@ -494,7 +492,7 @@ namespace OpenRA
if (worldRenderer != null)
{
Renderer.BeginFrame(worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.Zoom);
Sound.SetListenerPosition(worldRenderer.Position(worldRenderer.Viewport.CenterLocation));
Sound.SetListenerPosition(worldRenderer.Viewport.CenterPosition);
worldRenderer.Draw();
}
else
@@ -502,6 +500,10 @@ namespace OpenRA
using (new PerfSample("render_widgets"))
{
Game.Renderer.WorldVoxelRenderer.BeginFrame();
Ui.PrepareRenderables();
Game.Renderer.WorldVoxelRenderer.EndFrame();
Ui.Draw();
if (ModData != null && ModData.CursorProvider != null)
@@ -617,9 +619,7 @@ namespace OpenRA
}
}
else
{
Thread.Sleep(nextUpdate - now);
}
}
}

View File

@@ -18,8 +18,12 @@ namespace OpenRA
{
public class GameInformation
{
public string Mod;
public string Version;
public string MapUid;
public string MapTitle;
public DateTime StartTimeUtc;
// Game end timestamp (when the recoding stopped).
@@ -114,7 +118,7 @@ namespace OpenRA
Color = runtimePlayer.Color,
Team = client.Team,
SpawnPoint = runtimePlayer.SpawnPoint,
IsRandomFaction = runtimePlayer.Country.Race != client.Country,
IsRandomFaction = runtimePlayer.Country.Race != client.Race,
IsRandomSpawnPoint = runtimePlayer.SpawnPoint != client.SpawnPoint
};
@@ -134,7 +138,7 @@ namespace OpenRA
public class Player
{
// Start-up information
// Start-up information
public int ClientIndex;
// The player name, not guaranteed to be unique.

View File

@@ -16,15 +16,18 @@ using OpenRA.Traits;
namespace OpenRA
{
// TODO: This is not exported into the documentation yet.
[Desc("A unit/building inside the game. Every rules starts with one and adds trait to it.",
"Special actors like world or player are usually defined in system.yaml and affect everything.")]
/// <summary>
/// A unit/building inside the game. Every rules starts with one and adds trait to it.
/// Special actors like world or player are usually defined in system.yaml and affect everything.
/// </summary>
public class ActorInfo
{
[Desc("The actor name can be anything, but the sprites used in the Render*: traits default to this one.",
"If you add an ^ in front of the name, the engine will recognize this as a collection of traits",
"that can be inherited by others (using Inherits:) and not a real unit.",
"You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait.")]
/// <summary>
/// The actor name can be anything, but the sprites used in the Render*: traits default to this one.
/// If you add an ^ in front of the name, the engine will recognize this as a collection of traits
/// that can be inherited by others (using Inherits:) and not a real unit.
/// You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait.
/// </summary>
public readonly string Name;
public readonly TypeDictionary Traits = new TypeDictionary();
List<ITraitInfo> constructOrderCache = null;
@@ -33,12 +36,22 @@ namespace OpenRA
{
try
{
var mergedNode = MergeWithParent(node, allUnits).ToDictionary();
var allParents = new HashSet<string>();
// Guard against circular inheritance
allParents.Add(name);
var mergedNode = MergeWithParents(node, allUnits, allParents).ToDictionary();
Name = name;
foreach (var t in mergedNode)
if (t.Key != "Inherits" && !t.Key.StartsWith("-"))
{
if (t.Key[0] == '-')
throw new YamlException("Bogus trait removal: " + t.Key);
if (t.Key != "Inherits" && !t.Key.StartsWith("Inherits@"))
Traits.Add(LoadTraitInfo(t.Key.Split('@')[0], t.Value));
}
}
catch (YamlException e)
{
@@ -46,32 +59,31 @@ namespace OpenRA
}
}
static MiniYaml GetParent(MiniYaml node, Dictionary<string, MiniYaml> allUnits)
static Dictionary<string, MiniYaml> GetParents(MiniYaml node, Dictionary<string, MiniYaml> allUnits)
{
MiniYaml inherits;
node.ToDictionary().TryGetValue("Inherits", out inherits);
if (inherits == null || string.IsNullOrEmpty(inherits.Value))
return null;
return node.Nodes.Where(n => n.Key == "Inherits" || n.Key.StartsWith("Inherits@"))
.ToDictionary(n => n.Value.Value, n =>
{
MiniYaml i;
if (!allUnits.TryGetValue(n.Value.Value, out i))
throw new YamlException(
"Bogus inheritance -- parent type {0} does not exist".F(n.Value.Value));
MiniYaml parent;
allUnits.TryGetValue(inherits.Value, out parent);
if (parent == null)
throw new InvalidOperationException(
"Bogus inheritance -- actor type {0} does not exist".F(inherits.Value));
return parent;
return i;
});
}
static MiniYaml MergeWithParent(MiniYaml node, Dictionary<string, MiniYaml> allUnits)
static MiniYaml MergeWithParents(MiniYaml node, Dictionary<string, MiniYaml> allUnits, HashSet<string> allParents)
{
var parent = GetParent(node, allUnits);
if (parent != null)
{
var result = MiniYaml.MergeStrict(node, MergeWithParent(parent, allUnits));
var parents = GetParents(node, allUnits);
// strip the '-'
result.Nodes.RemoveAll(a => a.Key.StartsWith("-"));
return result;
foreach (var kv in parents)
{
if (!allParents.Add(kv.Key))
throw new YamlException(
"Bogus inheritance -- duplicate inheritance of {0}.".F(kv.Key));
node = MiniYaml.MergeStrict(node, MergeWithParents(kv.Value, allUnits, allParents));
}
return node;

View File

@@ -8,27 +8,18 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Effects;
using OpenRA.Traits;
namespace OpenRA.GameRules
{
public abstract class DamageWarhead : Warhead
{
[Desc("How much (raw) damage to deal")]
[Desc("How much (raw) damage to deal.")]
public readonly int Damage = 0;
[Desc("Infantry death animation to use")]
public readonly string DeathType = "1";
[Desc("Whether we should prevent prone response for infantry.")]
public readonly bool PreventProne = false;
[Desc("By what percentage should damage be modified against prone infantry.")]
public readonly int ProneModifier = 50;
[Desc("Types of damage that this warhead causes. Leave empty for no damage.")]
public readonly string[] DamageTypes = new string[0];
[FieldLoader.LoadUsing("LoadVersus")]
[Desc("Damage percentage versus each armortype. 0% = can't target.")]

View File

@@ -22,7 +22,6 @@ namespace OpenRA
public readonly IReadOnlyDictionary<string, SoundInfo> Voices;
public readonly IReadOnlyDictionary<string, SoundInfo> Notifications;
public readonly IReadOnlyDictionary<string, MusicInfo> Music;
public readonly IReadOnlyDictionary<string, string> Movies;
public readonly IReadOnlyDictionary<string, TileSet> TileSets;
public readonly IReadOnlyDictionary<string, SequenceProvider> Sequences;
@@ -32,7 +31,6 @@ namespace OpenRA
IDictionary<string, SoundInfo> voices,
IDictionary<string, SoundInfo> notifications,
IDictionary<string, MusicInfo> music,
IDictionary<string, string> movies,
IDictionary<string, TileSet> tileSets,
IDictionary<string, SequenceProvider> sequences)
{
@@ -41,7 +39,6 @@ namespace OpenRA
Voices = new ReadOnlyDictionary<string, SoundInfo>(voices);
Notifications = new ReadOnlyDictionary<string, SoundInfo>(notifications);
Music = new ReadOnlyDictionary<string, MusicInfo>(music);
Movies = new ReadOnlyDictionary<string, string>(movies);
TileSets = new ReadOnlyDictionary<string, TileSet>(tileSets);
Sequences = new ReadOnlyDictionary<string, SequenceProvider>(sequences);
}

View File

@@ -26,7 +26,6 @@ namespace OpenRA
readonly Dictionary<string, SoundInfo> voiceCache = new Dictionary<string, SoundInfo>();
readonly Dictionary<string, SoundInfo> notificationCache = new Dictionary<string, SoundInfo>();
readonly Dictionary<string, MusicInfo> musicCache = new Dictionary<string, MusicInfo>();
readonly Dictionary<string, string> movieCache = new Dictionary<string, string>();
readonly Dictionary<string, TileSet> tileSetCache = new Dictionary<string, TileSet>();
readonly Dictionary<string, SequenceCache> sequenceCaches = new Dictionary<string, SequenceCache>();
@@ -56,7 +55,6 @@ namespace OpenRA
Dictionary<string, SoundInfo> voices;
Dictionary<string, SoundInfo> notifications;
Dictionary<string, MusicInfo> music;
Dictionary<string, string> movies;
Dictionary<string, TileSet> tileSets;
using (new PerfTimer("Actors"))
@@ -69,14 +67,12 @@ namespace OpenRA
notifications = LoadYamlRules(notificationCache, m.Notifications, map.NotificationDefinitions, (k, _) => new SoundInfo(k.Value));
using (new PerfTimer("Music"))
music = LoadYamlRules(musicCache, m.Music, new List<MiniYamlNode>(), (k, _) => new MusicInfo(k.Key, k.Value));
using (new PerfTimer("Movies"))
movies = LoadYamlRules(movieCache, m.Movies, new List<MiniYamlNode>(), (k, v) => k.Value.Value);
using (new PerfTimer("TileSets"))
tileSets = LoadTileSets(tileSetCache, sequenceCaches, m.TileSets);
var sequences = sequenceCaches.ToDictionary(kvp => kvp.Key, kvp => new SequenceProvider(kvp.Value, map));
return new Ruleset(actors, weapons, voices, notifications, music, movies, tileSets, sequences);
return new Ruleset(actors, weapons, voices, notifications, music, tileSets, sequences);
}
Dictionary<string, T> LoadYamlRules<T>(

View File

@@ -33,6 +33,18 @@ namespace OpenRA.GameRules
[Desc("Delay in ticks before applying the warhead effect.", "0 = instant (old model).")]
public readonly int Delay = 0;
HashSet<string> validTargetSet;
HashSet<string> invalidTargetSet;
public bool IsValidTarget(IEnumerable<string> targetTypes)
{
if (validTargetSet == null)
validTargetSet = new HashSet<string>(ValidTargets);
if (invalidTargetSet == null)
invalidTargetSet = new HashSet<string>(InvalidTargets);
return validTargetSet.Overlaps(targetTypes) && !invalidTargetSet.Overlaps(targetTypes);
}
/// <summary>Applies the warhead's effect against the target.</summary>
public abstract void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers);
@@ -52,8 +64,7 @@ namespace OpenRA.GameRules
return false;
var cellInfo = world.Map.GetTerrainInfo(cell);
if (!ValidTargets.Intersect(cellInfo.TargetTypes).Any()
|| InvalidTargets.Intersect(cellInfo.TargetTypes).Any())
if (!IsValidTarget(cellInfo.TargetTypes))
return false;
return true;
@@ -81,8 +92,7 @@ namespace OpenRA.GameRules
// A target type is valid if it is in the valid targets list, and not in the invalid targets list.
var targetable = victim.TraitOrDefault<ITargetable>();
if (targetable == null || !ValidTargets.Intersect(targetable.TargetTypes).Any()
|| InvalidTargets.Intersect(targetable.TargetTypes).Any())
if (targetable == null || !IsValidTarget(targetable.TargetTypes))
return false;
return true;
@@ -101,8 +111,7 @@ namespace OpenRA.GameRules
// A target type is valid if it is in the valid targets list, and not in the invalid targets list.
var targetable = victim.Info.Traits.GetOrDefault<ITargetableInfo>();
if (targetable == null || !ValidTargets.Intersect(targetable.GetTargetTypes()).Any()
|| InvalidTargets.Intersect(targetable.GetTargetTypes()).Any())
if (targetable == null || !IsValidTarget(targetable.GetTargetTypes()))
return false;
return true;

View File

@@ -19,8 +19,8 @@ namespace OpenRA.GameRules
public class ProjectileArgs
{
public WeaponInfo Weapon;
public IEnumerable<int> DamageModifiers;
public IEnumerable<int> InaccuracyModifiers;
public int[] DamageModifiers;
public int[] InaccuracyModifiers;
public int Facing;
public WPos Source;
public Actor SourceActor;
@@ -30,7 +30,7 @@ namespace OpenRA.GameRules
public interface IProjectileInfo { IEffect Create(ProjectileArgs args); }
public class WeaponInfo
public sealed class WeaponInfo
{
[Desc("The maximum range the weapon can fire.")]
public readonly WRange Range = WRange.Zero;
@@ -46,8 +46,6 @@ namespace OpenRA.GameRules
public readonly bool Charges = false;
public readonly string Palette = "effect";
[Desc("What types of targets are affected.")]
public readonly string[] ValidTargets = { "Ground", "Water" };
@@ -66,9 +64,14 @@ namespace OpenRA.GameRules
[FieldLoader.LoadUsing("LoadWarheads")]
public readonly List<Warhead> Warheads = new List<Warhead>();
readonly HashSet<string> validTargetSet;
readonly HashSet<string> invalidTargetSet;
public WeaponInfo(string name, MiniYaml content)
{
FieldLoader.Load(this, content);
validTargetSet = new HashSet<string>(ValidTargets);
invalidTargetSet = new HashSet<string>(InvalidTargets);
}
static object LoadProjectile(MiniYaml yaml)
@@ -94,6 +97,11 @@ namespace OpenRA.GameRules
return retList;
}
public bool IsValidTarget(IEnumerable<string> targetTypes)
{
return validTargetSet.Overlaps(targetTypes) && !invalidTargetSet.Overlaps(targetTypes);
}
/// <summary>Checks if the weapon is valid against (can target) the target.</summary>
public bool IsValidAgainst(Target target, World world, Actor firedBy)
{
@@ -110,8 +118,7 @@ namespace OpenRA.GameRules
return false;
var cellInfo = world.Map.GetTerrainInfo(cell);
if (!ValidTargets.Intersect(cellInfo.TargetTypes).Any()
|| InvalidTargets.Intersect(cellInfo.TargetTypes).Any())
if (!IsValidTarget(cellInfo.TargetTypes))
return false;
return true;
@@ -124,8 +131,7 @@ namespace OpenRA.GameRules
public bool IsValidAgainst(Actor victim, Actor firedBy)
{
var targetable = victim.TraitOrDefault<ITargetable>();
if (targetable == null || !ValidTargets.Intersect(targetable.TargetTypes).Any()
|| InvalidTargets.Intersect(targetable.TargetTypes).Any())
if (targetable == null || !IsValidTarget(targetable.TargetTypes))
return false;
if (!Warheads.Any(w => w.IsValidAgainst(victim, firedBy)))
@@ -138,8 +144,7 @@ namespace OpenRA.GameRules
public bool IsValidAgainst(FrozenActor victim, Actor firedBy)
{
var targetable = victim.Info.Traits.GetOrDefault<ITargetableInfo>();
if (targetable == null || !ValidTargets.Intersect(targetable.GetTargetTypes()).Any()
|| InvalidTargets.Intersect(targetable.GetTargetTypes()).Any())
if (targetable == null || !IsValidTarget(targetable.GetTargetTypes()))
return false;
if (!Warheads.Any(w => w.IsValidAgainst(victim, firedBy)))

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Graphics
public class Animation
{
readonly int defaultTick = 40; // 25 fps == 40 ms
public Sequence CurrentSequence { get; private set; }
public ISpriteSequence CurrentSequence { get; private set; }
public bool IsDecoration = false;
public Func<bool> Paused;
@@ -47,7 +47,7 @@ namespace OpenRA.Graphics
this.facingFunc = facingFunc;
}
int CurrentFrame { get { return backwards ? CurrentSequence.Start + CurrentSequence.Length - frame - 1 : frame; } }
public int CurrentFrame { get { return backwards ? CurrentSequence.Start + CurrentSequence.Length - frame - 1 : frame; } }
public Sprite Image { get { return CurrentSequence.GetSprite(CurrentFrame, facingFunc()); } }
public IEnumerable<IRenderable> Render(WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale)
@@ -79,6 +79,8 @@ namespace OpenRA.Graphics
backwards = false;
tickAlways = false;
CurrentSequence = sequenceProvider.GetSequence(name, sequenceName);
timeUntilNextFrame = CurrentSequence != null ? CurrentSequence.Tick : defaultTick;
frame = 0;
tickFunc = () =>
{
@@ -94,6 +96,8 @@ namespace OpenRA.Graphics
return false;
CurrentSequence = sequenceProvider.GetSequence(name, sequenceName);
var tick = CurrentSequence != null ? CurrentSequence.Tick : defaultTick;
timeUntilNextFrame = Math.Min(tick, timeUntilNextFrame);
frame %= CurrentSequence.Length;
return true;
}
@@ -103,6 +107,8 @@ namespace OpenRA.Graphics
backwards = false;
tickAlways = false;
CurrentSequence = sequenceProvider.GetSequence(name, sequenceName);
timeUntilNextFrame = CurrentSequence != null ? CurrentSequence.Tick : defaultTick;
frame = 0;
tickFunc = () =>
{
@@ -127,10 +133,30 @@ namespace OpenRA.Graphics
backwards = false;
tickAlways = true;
CurrentSequence = sequenceProvider.GetSequence(name, sequenceName);
timeUntilNextFrame = CurrentSequence != null ? CurrentSequence.Tick : defaultTick;
frame = func();
tickFunc = () => frame = func();
}
public void PlayFetchDirection(string sequenceName, Func<int> direction)
{
tickAlways = false;
CurrentSequence = sequenceProvider.GetSequence(name, sequenceName);
timeUntilNextFrame = CurrentSequence != null ? CurrentSequence.Tick : defaultTick;
frame = 0;
tickFunc = () =>
{
var d = direction();
if (d > 0 && ++frame >= CurrentSequence.Length)
frame = 0;
if (d < 0 && --frame < 0)
frame = CurrentSequence.Length - 1;
};
}
int timeUntilNextFrame;
Action tickFunc;
@@ -169,7 +195,7 @@ namespace OpenRA.Graphics
}
}
public Sequence GetSequence(string sequenceName)
public ISpriteSequence GetSequence(string sequenceName)
{
return sequenceProvider.GetSequence(name, sequenceName);
}

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Graphics
Palettes = palettes.AsReadOnly();
var frameCache = new FrameCache(modData.SpriteLoaders, new string[0]);
var frameCache = new FrameCache(modData.SpriteLoaders);
var cursors = new Dictionary<string, CursorSequence>();
foreach (var s in nodesDict["Cursors"].Nodes)
foreach (var sequence in s.Value.Nodes)

View File

@@ -45,9 +45,18 @@ namespace OpenRA.Graphics
.ToArray();
if (d.ContainsKey("X"))
Exts.TryParseIntegerInvariant(d["X"].Value, out Hotspot.X);
{
int x;
Exts.TryParseIntegerInvariant(d["X"].Value, out x);
Hotspot = Hotspot.WithX(x);
}
if (d.ContainsKey("Y"))
Exts.TryParseIntegerInvariant(d["Y"].Value, out Hotspot.Y);
{
int y;
Exts.TryParseIntegerInvariant(d["Y"].Value, out y);
Hotspot = Hotspot.WithY(y);
}
}
}
}

View File

@@ -52,10 +52,14 @@ namespace OpenRA.Graphics
for (var k = 0; k < 3; k++)
{
if (trgb[k] < 1 / 6.0f) { rgb[k] = p + ((q - p) * 6 * trgb[k]); }
else if (trgb[k] >= 1 / 6.0f && trgb[k] < 0.5) { rgb[k] = q; }
else if (trgb[k] >= 0.5f && trgb[k] < 2.0f / 3) { rgb[k] = p + ((q - p) * 6 * (2.0f / 3 - trgb[k])); }
else { rgb[k] = p; }
if (trgb[k] < 1 / 6.0f)
rgb[k] = p + ((q - p) * 6 * trgb[k]);
else if (trgb[k] >= 1 / 6.0f && trgb[k] < 0.5)
rgb[k] = q;
else if (trgb[k] >= 0.5f && trgb[k] < 2.0f / 3)
rgb[k] = p + ((q - p) * 6 * (2.0f / 3 - trgb[k]));
else
rgb[k] = p;
}
return Color.FromArgb((int)(rgb[0] * 255), (int)(rgb[1] * 255), (int)(rgb[2] * 255));

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Graphics
{
dataX = -hotspot.X;
dataWidth += dataX;
hotspot.X = 0;
hotspot = hotspot.WithX(0);
}
else if (hotspot.X >= frameWidth)
dataWidth = hotspot.X + 1;
@@ -64,7 +64,7 @@ namespace OpenRA.Graphics
{
dataY = -hotspot.Y;
dataHeight += dataY;
hotspot.Y = 0;
hotspot = hotspot.WithY(0);
}
else if (hotspot.Y >= frameHeight)
dataHeight = hotspot.Y + 1;

View File

@@ -30,6 +30,11 @@ namespace OpenRA.Graphics
readOnlyModifiablePalettes = modifiablePalettes.AsReadOnly();
}
public bool Contains(string name)
{
return modifiablePalettes.ContainsKey(name) || palettes.ContainsKey(name);
}
public IPalette GetPalette(string name)
{
MutablePalette mutable;

View File

@@ -34,7 +34,16 @@ namespace OpenRA
public interface IHardwareCursor : IDisposable { }
public enum BlendMode : byte { None, Alpha, Additive, Subtractive, Multiply }
public enum BlendMode : byte
{
None,
Alpha,
Additive,
Subtractive,
Multiply,
Multiplicative,
DoubleMultiplicative
}
public interface IGraphicsDevice : IDisposable
{
@@ -72,6 +81,7 @@ namespace OpenRA
{
void Bind();
void SetData(T[] vertices, int length);
void SetData(T[] vertices, int start, int length);
}
public interface IShader

View File

@@ -9,6 +9,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
namespace OpenRA.Graphics
@@ -69,10 +70,26 @@ namespace OpenRA.Graphics
{
var tr = new float2(br.X, tl.Y);
var bl = new float2(tl.X, br.Y);
DrawLine(tl, tr, c, c);
DrawLine(tl, bl, c, c);
DrawLine(tr, br, c, c);
DrawLine(bl, br, c, c);
DrawLine(tl, tr, c);
DrawLine(tl, bl, c);
DrawLine(tr, br, c);
DrawLine(bl, br, c);
}
public void DrawLine(float2 start, float2 end, Color color)
{
renderer.CurrentBatchRenderer = this;
if (nv + 2 > renderer.TempBufferSize)
Flush();
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;
var a = color.A / 255.0f;
vertices[nv++] = new Vertex(start + Offset, r, g, b, a);
vertices[nv++] = new Vertex(end + Offset, r, g, b, a);
}
public void DrawLine(float2 start, float2 end, Color startColor, Color endColor)
@@ -82,19 +99,55 @@ namespace OpenRA.Graphics
if (nv + 2 > renderer.TempBufferSize)
Flush();
vertices[nv++] = new Vertex(start + Offset,
startColor.R / 255.0f, startColor.G / 255.0f,
startColor.B / 255.0f, startColor.A / 255.0f);
startColor = Util.PremultiplyAlpha(startColor);
var r = startColor.R / 255.0f;
var g = startColor.G / 255.0f;
var b = startColor.B / 255.0f;
var a = startColor.A / 255.0f;
vertices[nv++] = new Vertex(start + Offset, r, g, b, a);
vertices[nv++] = new Vertex(end + Offset,
endColor.R / 255.0f, endColor.G / 255.0f,
endColor.B / 255.0f, endColor.A / 255.0f);
endColor = Util.PremultiplyAlpha(endColor);
r = endColor.R / 255.0f;
g = endColor.G / 255.0f;
b = endColor.B / 255.0f;
a = endColor.A / 255.0f;
vertices[nv++] = new Vertex(end + Offset, r, g, b, a);
}
public void DrawLineStrip(IEnumerable<float2> points, Color color)
{
renderer.CurrentBatchRenderer = this;
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;
var a = color.A / 255.0f;
var first = true;
var prev = new Vertex();
foreach (var point in points)
{
if (first)
{
first = false;
prev = new Vertex(point + Offset, r, g, b, a);
continue;
}
if (nv + 2 > renderer.TempBufferSize)
Flush();
vertices[nv++] = prev;
prev = new Vertex(point + Offset, r, g, b, a);
vertices[nv++] = prev;
}
}
public void FillRect(RectangleF r, Color color)
{
for (var y = r.Top; y < r.Bottom; y++)
DrawLine(new float2(r.Left, y), new float2(r.Right, y), color, color);
DrawLine(new float2(r.Left, y), new float2(r.Right, y), color);
}
public void FillEllipse(RectangleF r, Color color)
@@ -106,7 +159,7 @@ namespace OpenRA.Graphics
for (var y = r.Top; y <= r.Bottom; y++)
{
var dx = a * (float)Math.Sqrt(1 - (y - yc) * (y - yc) / b / b);
DrawLine(new float2(xc - dx, y), new float2(xc + dx, y), color, color);
DrawLine(new float2(xc - dx, y), new float2(xc + dx, y), color);
}
}

View File

@@ -44,8 +44,10 @@ namespace OpenRA.Graphics
{
var mapX = x + b.Left;
var mapY = y + b.Top;
var type = tileset[tileset.GetTerrainIndex(mapTiles[new MPos(mapX, mapY)])];
colors[y * stride + x] = type.Color.ToArgb();
var type = tileset.GetTileInfo(mapTiles[new MPos(mapX, mapY)]);
var color = type != null ? type.LeftColor : Color.Black;
colors[y * stride + x] = color.ToArgb();
}
}
}
@@ -145,12 +147,11 @@ namespace OpenRA.Graphics
if (!t.Actor.IsInWorld || world.FogObscures(t.Actor))
continue;
var color = t.Trait.RadarSignatureColor(t.Actor);
foreach (var cell in t.Trait.RadarSignatureCells(t.Actor))
{
var uv = cell.ToMPos(map);
var uv = cell.First.ToMPos(map);
if (b.Contains(uv.U, uv.V))
colors[(uv.V - b.Top) * stride + uv.U - b.Left] = color.ToArgb();
colors[(uv.V - b.Top) * stride + uv.U - b.Left] = cell.Second.ToArgb();
}
}
}

View File

@@ -0,0 +1,37 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Graphics
{
public sealed class PaletteReference
{
readonly float index;
readonly HardwarePalette hardwarePalette;
public readonly string Name;
public IPalette Palette { get; internal set; }
public float TextureIndex { get { return index / hardwarePalette.Height; } }
public float TextureMidIndex { get { return (index + 0.5f) / hardwarePalette.Height; } }
public PaletteReference(string name, int index, IPalette palette, HardwarePalette hardwarePalette)
{
Name = name;
Palette = palette;
this.index = index;
this.hardwarePalette = hardwarePalette;
}
}
}

View File

@@ -32,14 +32,14 @@ namespace OpenRA.Graphics
var c1 = new HSLColor(c.H, c.S, (byte)Math.Max(rampRange, c.L)).RGB;
var c2 = new HSLColor(c.H, c.S, (byte)Math.Max(0, c.L - rampRange)).RGB;
var baseIndex = ramp[0];
var remapRamp = ramp.Select(r => r - ramp[0]).ToArray();
var remapRamp = ramp.Select(r => r - ramp[0]);
// reversed remapping
if (ramp[0] > ramp[15])
{
baseIndex = ramp[15];
for (var i = 15; i > 0; i--)
remapRamp = ramp.Select(r => r - ramp[15]).ToArray();
remapRamp = ramp.Select(r => r - ramp[15]);
}
remapColors = remapRamp.Select((x, i) => Pair.New(baseIndex + i, Exts.ColorLerp(x / 16f, c1, c2)))

View File

@@ -51,6 +51,7 @@ namespace OpenRA.Graphics
if (nv + 4 > renderer.TempBufferSize)
Flush();
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;

View File

@@ -17,73 +17,22 @@ namespace OpenRA.Graphics
public interface IRenderable
{
WPos Pos { get; }
float Scale { get; }
PaletteReference Palette { get; }
int ZOffset { get; }
bool IsDecoration { get; }
IRenderable WithScale(float newScale);
IRenderable WithPalette(PaletteReference newPalette);
IRenderable WithZOffset(int newOffset);
IRenderable OffsetBy(WVec offset);
IRenderable AsDecoration();
void BeforeRender(WorldRenderer wr);
IFinalizedRenderable PrepareRender(WorldRenderer wr);
}
public interface IFinalizedRenderable
{
void Render(WorldRenderer wr);
void RenderDebugGeometry(WorldRenderer wr);
}
public struct SpriteRenderable : IRenderable
{
public static readonly IEnumerable<IRenderable> None = new IRenderable[0].AsEnumerable();
readonly Sprite sprite;
readonly WPos pos;
readonly WVec offset;
readonly int zOffset;
readonly PaletteReference palette;
readonly float scale;
readonly bool isDecoration;
public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, bool isDecoration)
{
this.sprite = sprite;
this.pos = pos;
this.offset = offset;
this.zOffset = zOffset;
this.palette = palette;
this.scale = scale;
this.isDecoration = isDecoration;
}
public WPos Pos { get { return pos + offset; } }
public WVec Offset { get { return offset; } }
public float Scale { get { return scale; } }
public PaletteReference Palette { get { return palette; } }
public int ZOffset { get { return zOffset; } }
public bool IsDecoration { get { return isDecoration; } }
public IRenderable WithScale(float newScale) { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, newScale, isDecoration); }
public IRenderable WithPalette(PaletteReference newPalette) { return new SpriteRenderable(sprite, pos, offset, zOffset, newPalette, scale, isDecoration); }
public IRenderable WithZOffset(int newOffset) { return new SpriteRenderable(sprite, pos, offset, newOffset, palette, scale, isDecoration); }
public IRenderable OffsetBy(WVec vec) { return new SpriteRenderable(sprite, pos + vec, offset, zOffset, palette, scale, isDecoration); }
public IRenderable AsDecoration() { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, scale, true); }
float2 ScreenPosition(WorldRenderer wr)
{
return wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset) - (0.5f * scale * sprite.Size).ToInt2();
}
public void BeforeRender(WorldRenderer wr) { }
public void Render(WorldRenderer wr)
{
Game.Renderer.WorldSpriteRenderer.DrawSprite(sprite, ScreenPosition(wr), palette, sprite.Size * scale);
}
public void RenderDebugGeometry(WorldRenderer wr)
{
var offset = ScreenPosition(wr) + sprite.Offset;
Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + sprite.Size, Color.Red);
}
Rectangle ScreenBounds(WorldRenderer wr);
}
}

View File

@@ -37,6 +37,8 @@ namespace OpenRA.Graphics
readonly Queue<IVertexBuffer<Vertex>> tempBuffers = new Queue<IVertexBuffer<Vertex>>();
readonly Stack<Rectangle> scissorState = new Stack<Rectangle>();
SheetBuilder fontSheetBuilder;
Size? lastResolution;
int2? lastScroll;
float? lastZoom;
@@ -94,14 +96,23 @@ namespace OpenRA.Graphics
public void InitializeFonts(Manifest m)
{
using (new Support.PerfTimer("SpriteFonts"))
{
if (fontSheetBuilder != null)
fontSheetBuilder.Dispose();
fontSheetBuilder = new SheetBuilder(SheetType.BGRA);
Fonts = m.Fonts.ToDictionary(x => x.Key,
x => new SpriteFont(Platform.ResolvePath(x.Value.First), x.Value.Second)).AsReadOnly();
x => new SpriteFont(Platform.ResolvePath(x.Value.First), x.Value.Second, fontSheetBuilder)).AsReadOnly();
}
}
public void BeginFrame(int2 scroll, float zoom)
{
Device.Clear();
SetViewportParams(scroll, zoom);
}
public void SetViewportParams(int2 scroll, float zoom)
{
var resolutionChanged = lastResolution != Resolution;
if (resolutionChanged)
{
@@ -246,6 +257,13 @@ namespace OpenRA.Graphics
foreach (var buffer in tempBuffers)
buffer.Dispose();
tempBuffers.Clear();
if (fontSheetBuilder != null)
fontSheetBuilder.Dispose();
}
public string GetClipboardText()
{
return Device.GetClipboardText();
}
}
}

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Graphics
{
public struct SelectionBarsRenderable : IRenderable
public struct SelectionBarsRenderable : IRenderable, IFinalizedRenderable
{
readonly WPos pos;
readonly Actor actor;
@@ -30,12 +30,10 @@ namespace OpenRA.Graphics
public WPos Pos { get { return pos; } }
public float Scale { get { return 1f; } }
public PaletteReference Palette { get { return null; } }
public int ZOffset { get { return 0; } }
public bool IsDecoration { get { return true; } }
public IRenderable WithScale(float newScale) { return this; }
public IRenderable WithPalette(PaletteReference newPalette) { return this; }
public IRenderable WithZOffset(int newOffset) { return this; }
public IRenderable OffsetBy(WVec vec) { return new SelectionBarsRenderable(pos + vec, actor); }
@@ -67,23 +65,39 @@ namespace OpenRA.Graphics
var z = float2.Lerp(start, end, value);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(start + p, end + p, c, c);
wlr.DrawLine(start + q, end + q, c2, c2);
wlr.DrawLine(start + r, end + r, c, c);
wlr.DrawLine(start + p, end + p, c);
wlr.DrawLine(start + q, end + q, c2);
wlr.DrawLine(start + r, end + r, c);
wlr.DrawLine(start + p, z + p, barColor2, barColor2);
wlr.DrawLine(start + q, z + q, barColor, barColor);
wlr.DrawLine(start + r, z + r, barColor2, barColor2);
wlr.DrawLine(start + p, z + p, barColor2);
wlr.DrawLine(start + q, z + q, barColor);
wlr.DrawLine(start + r, z + r, barColor2);
}
Color GetHealthColor(Health health)
{
if (Game.Settings.Game.TeamHealthColors)
var player = actor.World.RenderPlayer ?? actor.World.LocalPlayer;
if (Game.Settings.Game.TeamHealthColors && player != null && !player.Spectating)
{
var isAlly = actor.Owner.IsAlliedWith(actor.World.LocalPlayer)
|| (actor.EffectiveOwner != null && actor.EffectiveOwner.Disguised
&& actor.World.LocalPlayer.IsAlliedWith(actor.EffectiveOwner.Owner));
return isAlly ? Color.LimeGreen : actor.Owner.NonCombatant ? Color.Tan : Color.Red;
var apparentOwner = actor.EffectiveOwner != null && actor.EffectiveOwner.Disguised
? actor.EffectiveOwner.Owner
: actor.Owner;
// For friendly spies, treat the unit's owner as the actual owner
if (actor.Owner.IsAlliedWith(actor.World.RenderPlayer))
apparentOwner = actor.Owner;
if (apparentOwner == player)
return Color.LimeGreen;
if (apparentOwner.IsAlliedWith(player))
return Color.Yellow;
if (apparentOwner.NonCombatant)
return Color.Tan;
return Color.Red;
}
else
return health.DamageState == DamageState.Critical ? Color.Red :
@@ -111,13 +125,13 @@ namespace OpenRA.Graphics
var z = float2.Lerp(start, end, (float)health.HP / health.MaxHP);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(start + p, end + p, c, c);
wlr.DrawLine(start + q, end + q, c2, c2);
wlr.DrawLine(start + r, end + r, c, c);
wlr.DrawLine(start + p, end + p, c);
wlr.DrawLine(start + q, end + q, c2);
wlr.DrawLine(start + r, end + r, c);
wlr.DrawLine(start + p, z + p, healthColor2, healthColor2);
wlr.DrawLine(start + q, z + q, healthColor, healthColor);
wlr.DrawLine(start + r, z + r, healthColor2, healthColor2);
wlr.DrawLine(start + p, z + p, healthColor2);
wlr.DrawLine(start + q, z + q, healthColor);
wlr.DrawLine(start + r, z + r, healthColor2);
if (health.DisplayHp != health.HP)
{
@@ -129,13 +143,13 @@ namespace OpenRA.Graphics
deltaColor.B / 2);
var zz = float2.Lerp(start, end, (float)health.DisplayHp / health.MaxHP);
wlr.DrawLine(z + p, zz + p, deltaColor2, deltaColor2);
wlr.DrawLine(z + q, zz + q, deltaColor, deltaColor);
wlr.DrawLine(z + r, zz + r, deltaColor2, deltaColor2);
wlr.DrawLine(z + p, zz + p, deltaColor2);
wlr.DrawLine(z + q, zz + q, deltaColor);
wlr.DrawLine(z + r, zz + r, deltaColor2);
}
}
public void BeforeRender(WorldRenderer wr) { }
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }
public void Render(WorldRenderer wr)
{
if (!actor.IsInWorld || actor.IsDead)
@@ -155,5 +169,6 @@ namespace OpenRA.Graphics
}
public void RenderDebugGeometry(WorldRenderer wr) { }
public Rectangle ScreenBounds(WorldRenderer wr) { return Rectangle.Empty; }
}
}

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Graphics
{
public struct SelectionBoxRenderable : IRenderable
public struct SelectionBoxRenderable : IRenderable, IFinalizedRenderable
{
readonly WPos pos;
readonly float scale;
@@ -34,18 +34,16 @@ namespace OpenRA.Graphics
public WPos Pos { get { return pos; } }
public float Scale { get { return scale; } }
public PaletteReference Palette { get { return null; } }
public int ZOffset { get { return 0; } }
public bool IsDecoration { get { return true; } }
public IRenderable WithScale(float newScale) { return new SelectionBoxRenderable(pos, bounds, newScale, color); }
public IRenderable WithPalette(PaletteReference newPalette) { return this; }
public IRenderable WithZOffset(int newOffset) { return this; }
public IRenderable OffsetBy(WVec vec) { return new SelectionBoxRenderable(pos + vec, bounds, scale, color); }
public IRenderable AsDecoration() { return this; }
public void BeforeRender(WorldRenderer wr) { }
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }
public void Render(WorldRenderer wr)
{
var screenPos = wr.ScreenPxPosition(pos);
@@ -57,17 +55,18 @@ namespace OpenRA.Graphics
var v = new float2(0, 4f / wr.Viewport.Zoom);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(tl + u, tl, color, color);
wlr.DrawLine(tl, tl + v, color, color);
wlr.DrawLine(tr, tr - u, color, color);
wlr.DrawLine(tr, tr + v, color, color);
wlr.DrawLine(tl + u, tl, color);
wlr.DrawLine(tl, tl + v, color);
wlr.DrawLine(tr, tr - u, color);
wlr.DrawLine(tr, tr + v, color);
wlr.DrawLine(bl, bl + u, color, color);
wlr.DrawLine(bl, bl - v, color, color);
wlr.DrawLine(br, br - u, color, color);
wlr.DrawLine(br, br - v, color, color);
wlr.DrawLine(bl, bl + u, color);
wlr.DrawLine(bl, bl - v, color);
wlr.DrawLine(br, br - u, color);
wlr.DrawLine(br, br - v, color);
}
public void RenderDebugGeometry(WorldRenderer wr) { }
public Rectangle ScreenBounds(WorldRenderer wr) { return Rectangle.Empty; }
}
}

View File

@@ -1,157 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Linq;
namespace OpenRA.Graphics
{
public class Sequence
{
readonly Sprite[] sprites;
readonly bool reverseFacings, transpose;
public readonly string Name;
public readonly int Start;
public readonly int Length;
public readonly int Stride;
public readonly int Facings;
public readonly int Tick;
public readonly int ZOffset;
public readonly int ShadowStart;
public readonly int ShadowZOffset;
public readonly int[] Frames;
public Sequence(SpriteCache cache, string unit, string name, MiniYaml info)
{
var srcOverride = info.Value;
Name = name;
var d = info.ToDictionary();
var offset = float2.Zero;
var blendMode = BlendMode.Alpha;
try
{
if (d.ContainsKey("Start"))
Start = Exts.ParseIntegerInvariant(d["Start"].Value);
if (d.ContainsKey("Offset"))
offset = FieldLoader.GetValue<float2>("Offset", d["Offset"].Value);
if (d.ContainsKey("BlendMode"))
blendMode = FieldLoader.GetValue<BlendMode>("BlendMode", d["BlendMode"].Value);
// Apply offset to each sprite in the sequence
// Different sequences may apply different offsets to the same frame
sprites = cache[srcOverride ?? unit].Select(
s => new Sprite(s.Sheet, s.Bounds, s.Offset + offset, s.Channel, blendMode)).ToArray();
if (!d.ContainsKey("Length"))
Length = 1;
else if (d["Length"].Value == "*")
Length = sprites.Length - Start;
else
Length = Exts.ParseIntegerInvariant(d["Length"].Value);
if (d.ContainsKey("Stride"))
Stride = Exts.ParseIntegerInvariant(d["Stride"].Value);
else
Stride = Length;
if (d.ContainsKey("Facings"))
{
var f = Exts.ParseIntegerInvariant(d["Facings"].Value);
Facings = Math.Abs(f);
reverseFacings = f < 0;
}
else
Facings = 1;
if (d.ContainsKey("Tick"))
Tick = Exts.ParseIntegerInvariant(d["Tick"].Value);
else
Tick = 40;
if (d.ContainsKey("Transpose"))
transpose = bool.Parse(d["Transpose"].Value);
if (d.ContainsKey("Frames"))
Frames = Array.ConvertAll<string, int>(d["Frames"].Value.Split(','), Exts.ParseIntegerInvariant);
if (d.ContainsKey("ShadowStart"))
ShadowStart = Exts.ParseIntegerInvariant(d["ShadowStart"].Value);
else
ShadowStart = -1;
if (d.ContainsKey("ShadowZOffset"))
{
WRange r;
if (WRange.TryParse(d["ShadowZOffset"].Value, out r))
ShadowZOffset = r.Range;
}
else
ShadowZOffset = -5;
if (d.ContainsKey("ZOffset"))
{
WRange r;
if (WRange.TryParse(d["ZOffset"].Value, out r))
ZOffset = r.Range;
}
if (Length > Stride)
throw new InvalidOperationException(
"{0}: Sequence {1}.{2}: Length must be <= stride"
.F(info.Nodes[0].Location, unit, name));
if (Start < 0 || Start + Facings * Stride > sprites.Length || ShadowStart + Facings * Stride > sprites.Length)
throw new InvalidOperationException(
"{6}: Sequence {0}.{1} uses frames [{2}..{3}] of SHP `{4}`, but only 0..{5} actually exist"
.F(unit, name, Start, Start + Facings * Stride - 1, srcOverride ?? unit, sprites.Length - 1,
info.Nodes[0].Location));
}
catch (FormatException f)
{
throw new FormatException("Failed to parse sequences for {0}.{1} at {2}:\n{3}".F(unit, name, info.Nodes[0].Location, f));
}
}
public Sprite GetSprite(int frame)
{
return GetSprite(Start, frame, 0);
}
public Sprite GetSprite(int frame, int facing)
{
return GetSprite(Start, frame, facing);
}
public Sprite GetShadow(int frame, int facing)
{
return ShadowStart >= 0 ? GetSprite(ShadowStart, frame, facing) : null;
}
Sprite GetSprite(int start, int frame, int facing)
{
var f = Traits.Util.QuantizeFacing(facing, Facings);
if (reverseFacings)
f = (Facings - f) % Facings;
var i = transpose ? (frame % Length) * Facings + f :
(f * Stride) + (frame % Length);
if (Frames != null)
return sprites[Frames[i]];
return sprites[start + i];
}
}
}

View File

@@ -12,11 +12,36 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA.Graphics
{
using Sequences = IReadOnlyDictionary<string, Lazy<IReadOnlyDictionary<string, Sequence>>>;
using UnitSequences = Lazy<IReadOnlyDictionary<string, Sequence>>;
using Sequences = IReadOnlyDictionary<string, Lazy<IReadOnlyDictionary<string, ISpriteSequence>>>;
using UnitSequences = Lazy<IReadOnlyDictionary<string, ISpriteSequence>>;
public interface ISpriteSequence
{
string Name { get; }
int Start { get; }
int Length { get; }
int Stride { get; }
int Facings { get; }
int Tick { get; }
int ZOffset { get; }
int ShadowStart { get; }
int ShadowZOffset { get; }
int[] Frames { get; }
Sprite GetSprite(int frame);
Sprite GetSprite(int frame, int facing);
Sprite GetShadow(int frame, int facing);
}
public interface ISpriteSequenceLoader
{
Action<string> OnMissingSpriteError { get; set; }
IReadOnlyDictionary<string, ISpriteSequence> ParseSequences(ModData modData, TileSet tileSet, SpriteCache cache, MiniYamlNode node);
}
public class SequenceProvider
{
@@ -29,19 +54,24 @@ namespace OpenRA.Graphics
this.SpriteCache = cache.SpriteCache;
}
public Sequence GetSequence(string unitName, string sequenceName)
public ISpriteSequence GetSequence(string unitName, string sequenceName)
{
UnitSequences unitSeq;
if (!sequences.Value.TryGetValue(unitName, out unitSeq))
throw new InvalidOperationException("Unit `{0}` does not have any sequences defined.".F(unitName));
Sequence seq;
ISpriteSequence seq;
if (!unitSeq.Value.TryGetValue(sequenceName, out seq))
throw new InvalidOperationException("Unit `{0}` does not have a sequence named `{1}`".F(unitName, sequenceName));
return seq;
}
public bool HasSequence(string unitName)
{
return sequences.Value.ContainsKey(unitName);
}
public bool HasSequence(string unitName, string sequenceName)
{
UnitSequences unitSeq;
@@ -72,6 +102,7 @@ namespace OpenRA.Graphics
public sealed class SequenceCache : IDisposable
{
readonly ModData modData;
readonly TileSet tileSet;
readonly Lazy<SpriteCache> spriteCache;
public SpriteCache SpriteCache { get { return spriteCache.Value; } }
@@ -80,8 +111,10 @@ namespace OpenRA.Graphics
public SequenceCache(ModData modData, TileSet tileSet)
{
this.modData = modData;
this.tileSet = tileSet;
spriteCache = Exts.Lazy(() => new SpriteCache(modData.SpriteLoaders, tileSet.Extensions, new SheetBuilder(SheetType.Indexed)));
// Every time we load a tile set, we create a sequence cache for it
spriteCache = Exts.Lazy(() => new SpriteCache(modData.SpriteLoaders, new SheetBuilder(SheetType.Indexed)));
}
public Sequences LoadSequences(Map map)
@@ -111,7 +144,7 @@ namespace OpenRA.Graphics
items.Add(node.Key, t);
else
{
t = Exts.Lazy(() => CreateUnitSequences(node));
t = Exts.Lazy(() => modData.SpriteSequenceLoader.ParseSequences(modData, tileSet, SpriteCache, node));
sequenceCache.Add(key, t);
items.Add(node.Key, t);
}
@@ -120,28 +153,6 @@ namespace OpenRA.Graphics
return new ReadOnlyDictionary<string, UnitSequences>(items);
}
IReadOnlyDictionary<string, Sequence> CreateUnitSequences(MiniYamlNode node)
{
var unitSequences = new Dictionary<string, Sequence>();
foreach (var kvp in node.Value.ToDictionary())
{
using (new Support.PerfTimer("new Sequence(\"{0}\")".F(node.Key), 20))
{
try
{
unitSequences.Add(kvp.Key, new Sequence(spriteCache.Value, node.Key, kvp.Key, kvp.Value));
}
catch (FileNotFoundException ex)
{
Log.Write("debug", ex.Message);
}
}
}
return new ReadOnlyDictionary<string, Sequence>(unitSequences);
}
public void Dispose()
{
if (spriteCache.IsValueCreated)

View File

@@ -18,7 +18,6 @@ namespace OpenRA.Graphics
{
public sealed class Sheet : IDisposable
{
readonly object textureLock = new object();
bool dirty;
bool releaseBufferOnCommit;
ITexture texture;
@@ -50,15 +49,9 @@ namespace OpenRA.Graphics
using (var bitmap = (Bitmap)Image.FromStream(stream))
{
Size = bitmap.Size;
data = new byte[4 * Size.Width * Size.Height];
var dataStride = 4 * Size.Width;
data = new byte[dataStride * Size.Height];
var bd = bitmap.LockBits(bitmap.Bounds(),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
for (var y = 0; y < Size.Height; y++)
Marshal.Copy(IntPtr.Add(bd.Scan0, y * bd.Stride), data, y * dataStride, dataStride);
bitmap.UnlockBits(bd);
Util.FastCopyIntoSprite(new Sprite(this, bitmap.Bounds(), TextureChannel.Red), bitmap);
}
ReleaseBuffer();
@@ -66,33 +59,21 @@ namespace OpenRA.Graphics
public ITexture GetTexture()
{
// This is only called from the main thread but 'dirty'
// is set from other threads too via CommitData().
GenerateTexture();
return texture;
}
void GenerateTexture()
{
lock (textureLock)
if (texture == null)
{
if (texture == null)
{
texture = Game.Renderer.Device.CreateTexture();
dirty = true;
}
if (data != null)
{
if (dirty)
{
texture.SetData(data, Size.Width, Size.Height);
dirty = false;
if (releaseBufferOnCommit)
data = null;
}
}
texture = Game.Renderer.Device.CreateTexture();
dirty = true;
}
if (data != null && dirty)
{
texture.SetData(data, Size.Width, Size.Height);
dirty = false;
if (releaseBufferOnCommit)
data = null;
}
return texture;
}
public Bitmap AsBitmap()
@@ -141,42 +122,32 @@ namespace OpenRA.Graphics
public void CreateBuffer()
{
lock (textureLock)
{
if (data != null)
return;
if (texture == null)
data = new byte[4 * Size.Width * Size.Height];
else
data = texture.GetData();
releaseBufferOnCommit = false;
}
if (data != null)
return;
if (texture == null)
data = new byte[4 * Size.Width * Size.Height];
else
data = texture.GetData();
releaseBufferOnCommit = false;
}
public void CommitData()
public void CommitBufferedData()
{
CommitData(false);
if (!Buffered)
throw new InvalidOperationException(
"This sheet is unbuffered. You cannot call CommitBufferedData on an unbuffered sheet. " +
"If you need to completely replace the texture data you should set data into the texture directly. " +
"If you need to make only small changes to the texture data consider creating a buffered sheet instead.");
dirty = true;
}
public void ReleaseBuffer()
{
CommitData(true);
}
void CommitData(bool releaseBuffer)
{
lock (textureLock)
{
if (!Buffered)
throw new InvalidOperationException(
"This sheet is unbuffered. You cannot call CommitData on an unbuffered sheet. " +
"If you need to completely replace the texture data you should set data into the texture directly. " +
"If you need to make only small changes to the texture data consider creating a buffered sheet instead.");
dirty = true;
if (releaseBuffer)
releaseBufferOnCommit = true;
}
if (!Buffered)
return;
dirty = true;
releaseBufferOnCommit = true;
}
public void Dispose()

View File

@@ -31,8 +31,8 @@ namespace OpenRA.Graphics
public sealed class SheetBuilder : IDisposable
{
public readonly SheetType Type;
readonly List<Sheet> sheets = new List<Sheet>();
readonly SheetType type;
readonly Func<Sheet> allocateSheet;
Sheet current;
@@ -54,7 +54,7 @@ namespace OpenRA.Graphics
public SheetBuilder(SheetType t, Func<Sheet> allocateSheet)
{
channel = TextureChannel.Red;
type = t;
Type = t;
current = allocateSheet();
sheets.Add(current);
this.allocateSheet = allocateSheet;
@@ -70,7 +70,7 @@ namespace OpenRA.Graphics
var rect = Allocate(size, spriteOffset);
Util.FastCopyIntoChannel(rect, src);
current.CommitData();
current.CommitBufferedData();
return rect;
}
@@ -78,7 +78,7 @@ namespace OpenRA.Graphics
{
var rect = Allocate(src.Size);
Util.FastCopyIntoSprite(rect, src);
current.CommitData();
current.CommitBufferedData();
return rect;
}
@@ -93,7 +93,7 @@ namespace OpenRA.Graphics
TextureChannel? NextChannel(TextureChannel t)
{
var nextChannel = (int)t + (int)type;
var nextChannel = (int)t + (int)Type;
if (nextChannel > (int)TextureChannel.Alpha)
return null;

View File

@@ -24,12 +24,9 @@ namespace OpenRA.Graphics
public readonly float Top, Left, Bottom, Right;
public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel)
: this(sheet, bounds, float2.Zero, channel, BlendMode.Alpha) { }
: this(sheet, bounds, float2.Zero, channel) { }
public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel, BlendMode blendMode)
: this(sheet, bounds, float2.Zero, channel, blendMode) { }
public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel, BlendMode blendMode)
public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel, BlendMode blendMode = BlendMode.Alpha)
{
Sheet = sheet;
Bounds = bounds;

View File

@@ -19,32 +19,35 @@ namespace OpenRA.Graphics
{
public class SpriteFont
{
static Library library = new Library();
static SheetBuilder builder;
static readonly Library Library = new Library();
readonly int size;
string name;
readonly SheetBuilder builder;
readonly Func<string, float> lineWidth;
readonly Face face;
readonly Cache<Pair<char, Color>, GlyphInfo> glyphs;
public SpriteFont(string name, int size)
public SpriteFont(string name, int size, SheetBuilder builder)
{
this.size = size;
this.name = name;
if (builder.Type != SheetType.BGRA)
throw new ArgumentException("The sheet builder must create BGRA sheets.", "builder");
face = new Face(library, name);
this.size = size;
this.builder = builder;
face = new Face(Library, name);
face.SetPixelSizes((uint)size, (uint)size);
glyphs = new Cache<Pair<char, Color>, GlyphInfo>(CreateGlyph, Pair<char, Color>.EqualityComparer);
// setup a SheetBuilder for our private use
// TODO: SheetBuilder state is leaked between mod switches
if (builder == null)
builder = new SheetBuilder(SheetType.BGRA);
Func<char, float> characterWidth = character => glyphs[Pair.New(character, Color.White)].Advance;
lineWidth = line => line.Sum(characterWidth);
PrecacheColor(Color.White);
PrecacheColor(Color.Red);
PrecacheColor(Color.White, name);
PrecacheColor(Color.Red, name);
}
void PrecacheColor(Color c)
void PrecacheColor(Color c, string name)
{
using (new PerfTimer("PrecacheColor {0} {1}px {2}".F(name, size, c.Name)))
for (var n = (char)0x20; n < (char)0x7f; n++)
@@ -91,29 +94,27 @@ namespace OpenRA.Graphics
public int2 Measure(string text)
{
var lines = text.Split('\n');
return new int2((int)Math.Ceiling(lines.Max(s => s.Sum(a => glyphs[Pair.New(a, Color.White)].Advance))), lines.Length * size);
return new int2((int)Math.Ceiling(lines.Max(lineWidth)), lines.Length * size);
}
Cache<Pair<char, Color>, GlyphInfo> glyphs;
Face face;
GlyphInfo CreateGlyph(Pair<char, Color> c)
{
face.LoadChar(c.First, LoadFlags.Default, LoadTarget.Normal);
face.Glyph.RenderGlyph(RenderMode.Normal);
var size = new Size((int)face.Glyph.Metrics.Width >> 6, (int)face.Glyph.Metrics.Height >> 6);
var size = new Size((int)face.Glyph.Metrics.Width, (int)face.Glyph.Metrics.Height);
var s = builder.Allocate(size);
var g = new GlyphInfo
{
Sprite = s,
Advance = (int)face.Glyph.Metrics.HorizontalAdvance / 64f,
Offset = { X = face.Glyph.BitmapLeft, Y = -face.Glyph.BitmapTop }
Advance = (float)face.Glyph.Metrics.HorizontalAdvance,
Offset = new int2(face.Glyph.BitmapLeft, -face.Glyph.BitmapTop)
};
// A new bitmap is generated each time this property is accessed, so we do need to dispose it.
using (var bitmap = face.Glyph.Bitmap)
{
unsafe
{
var p = (byte*)bitmap.Buffer;
@@ -123,20 +124,25 @@ namespace OpenRA.Graphics
for (var j = 0; j < s.Size.Y; j++)
{
for (var i = 0; i < s.Size.X; i++)
{
if (p[i] != 0)
{
var q = destStride * (j + s.Bounds.Top) + 4 * (i + s.Bounds.Left);
dest[q] = c.Second.B;
dest[q + 1] = c.Second.G;
dest[q + 2] = c.Second.R;
dest[q + 3] = p[i];
var pmc = Util.PremultiplyAlpha(Color.FromArgb(p[i], c.Second));
dest[q] = pmc.B;
dest[q + 1] = pmc.G;
dest[q + 2] = pmc.R;
dest[q + 3] = pmc.A;
}
}
p += bitmap.Pitch;
}
}
}
s.Sheet.CommitData();
s.Sheet.CommitBufferedData();
return g;
}

View File

@@ -35,13 +35,11 @@ namespace OpenRA.Graphics
public readonly SheetBuilder SheetBuilder;
readonly Cache<string, Sprite[]> sprites;
public SpriteCache(ISpriteLoader[] loaders, string[] exts, SheetBuilder sheetBuilder)
public SpriteCache(ISpriteLoader[] loaders, SheetBuilder sheetBuilder)
{
SheetBuilder = sheetBuilder;
// Include extension-less version
exts = exts.Append("").ToArray();
sprites = new Cache<string, Sprite[]>(filename => SpriteLoader.GetSprites(filename, exts, loaders, sheetBuilder));
sprites = new Cache<string, Sprite[]>(filename => SpriteLoader.GetSprites(filename, loaders, sheetBuilder));
}
public Sprite[] this[string filename] { get { return sprites[filename]; } }
@@ -51,11 +49,9 @@ namespace OpenRA.Graphics
{
readonly Cache<string, ISpriteFrame[]> frames;
public FrameCache(ISpriteLoader[] loaders, string[] exts)
public FrameCache(ISpriteLoader[] loaders)
{
// Include extension-less version
exts = exts.Append("").ToArray();
frames = new Cache<string, ISpriteFrame[]>(filename => SpriteLoader.GetFrames(filename, exts, loaders));
frames = new Cache<string, ISpriteFrame[]>(filename => SpriteLoader.GetFrames(filename, loaders));
}
public ISpriteFrame[] this[string filename] { get { return frames[filename]; } }
@@ -63,14 +59,14 @@ namespace OpenRA.Graphics
public static class SpriteLoader
{
public static Sprite[] GetSprites(string filename, string[] exts, ISpriteLoader[] loaders, SheetBuilder sheetBuilder)
public static Sprite[] GetSprites(string filename, ISpriteLoader[] loaders, SheetBuilder sheetBuilder)
{
return GetFrames(filename, exts, loaders).Select(a => sheetBuilder.Add(a)).ToArray();
return GetFrames(filename, loaders).Select(a => sheetBuilder.Add(a)).ToArray();
}
public static ISpriteFrame[] GetFrames(string filename, string[] exts, ISpriteLoader[] loaders)
public static ISpriteFrame[] GetFrames(string filename, ISpriteLoader[] loaders)
{
using (var stream = GlobalFileSystem.OpenWithExts(filename, exts))
using (var stream = GlobalFileSystem.Open(filename))
{
ISpriteFrame[] frames;
foreach (var loader in loaders)

View File

@@ -0,0 +1,74 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRA.Graphics
{
public struct SpriteRenderable : IRenderable, IFinalizedRenderable
{
public static readonly IEnumerable<IRenderable> None = new IRenderable[0].AsEnumerable();
readonly Sprite sprite;
readonly WPos pos;
readonly WVec offset;
readonly int zOffset;
readonly PaletteReference palette;
readonly float scale;
readonly bool isDecoration;
public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, bool isDecoration)
{
this.sprite = sprite;
this.pos = pos;
this.offset = offset;
this.zOffset = zOffset;
this.palette = palette;
this.scale = scale;
this.isDecoration = isDecoration;
}
public WPos Pos { get { return pos + offset; } }
public WVec Offset { get { return offset; } }
public PaletteReference Palette { get { return palette; } }
public int ZOffset { get { return zOffset; } }
public bool IsDecoration { get { return isDecoration; } }
public IRenderable WithPalette(PaletteReference newPalette) { return new SpriteRenderable(sprite, pos, offset, zOffset, newPalette, scale, isDecoration); }
public IRenderable WithZOffset(int newOffset) { return new SpriteRenderable(sprite, pos, offset, newOffset, palette, scale, isDecoration); }
public IRenderable OffsetBy(WVec vec) { return new SpriteRenderable(sprite, pos + vec, offset, zOffset, palette, scale, isDecoration); }
public IRenderable AsDecoration() { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, scale, true); }
float2 ScreenPosition(WorldRenderer wr)
{
return wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset) - (0.5f * scale * sprite.Size).ToInt2();
}
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }
public void Render(WorldRenderer wr)
{
Game.Renderer.WorldSpriteRenderer.DrawSprite(sprite, ScreenPosition(wr), palette, sprite.Size * scale);
}
public void RenderDebugGeometry(WorldRenderer wr)
{
var offset = ScreenPosition(wr) + sprite.Offset;
Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + sprite.Size, Color.Red);
}
public Rectangle ScreenBounds(WorldRenderer wr)
{
var offset = ScreenPosition(wr) + sprite.Offset;
return new Rectangle((int)offset.X, (int)offset.Y, (int)sprite.Size.X, (int)sprite.Size.Y);
}
}
}

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System;
using System.Drawing;
namespace OpenRA.Graphics
@@ -49,6 +50,17 @@ namespace OpenRA.Graphics
}
}
void SetRenderStateForSprite(Sprite s)
{
renderer.CurrentBatchRenderer = this;
if (s.BlendMode != currentBlend || s.Sheet != currentSheet || nv + 4 > renderer.TempBufferSize)
Flush();
currentBlend = s.BlendMode;
currentSheet = s.Sheet;
}
public void DrawSprite(Sprite s, float2 location, PaletteReference pal)
{
DrawSprite(s, location, pal.TextureIndex, s.Size);
@@ -61,19 +73,7 @@ namespace OpenRA.Graphics
void DrawSprite(Sprite s, float2 location, float paletteTextureIndex, float2 size)
{
renderer.CurrentBatchRenderer = this;
if (s.Sheet != currentSheet)
Flush();
if (s.BlendMode != currentBlend)
Flush();
if (nv + 4 > renderer.TempBufferSize)
Flush();
currentBlend = s.BlendMode;
currentSheet = s.Sheet;
SetRenderStateForSprite(s);
Util.FastCreateQuad(vertices, location + s.FractionalOffset * size, s, paletteTextureIndex, nv, size);
nv += 4;
}
@@ -91,23 +91,18 @@ namespace OpenRA.Graphics
public void DrawSprite(Sprite s, float2 a, float2 b, float2 c, float2 d)
{
renderer.CurrentBatchRenderer = this;
if (s.Sheet != currentSheet)
Flush();
if (s.BlendMode != currentBlend)
Flush();
if (nv + 4 > renderer.TempBufferSize)
Flush();
currentSheet = s.Sheet;
currentBlend = s.BlendMode;
SetRenderStateForSprite(s);
Util.FastCreateQuad(vertices, a, b, c, d, s, 0, nv);
nv += 4;
}
public void DrawSprite(Sprite s, Vertex[] sourceVertices, int offset)
{
SetRenderStateForSprite(s);
Array.Copy(sourceVertices, offset, vertices, nv, 4);
nv += 4;
}
public void DrawVertexBuffer(IVertexBuffer<Vertex> buffer, int start, int length, PrimitiveType type, Sheet sheet)
{
shader.SetTexture("DiffuseTexture", sheet.GetTexture());

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Graphics
{
public struct TargetLineRenderable : IRenderable
public struct TargetLineRenderable : IRenderable, IFinalizedRenderable
{
readonly IEnumerable<WPos> waypoints;
readonly Color color;
@@ -28,18 +28,16 @@ namespace OpenRA.Graphics
}
public WPos Pos { get { return waypoints.First(); } }
public float Scale { get { return 1f; } }
public PaletteReference Palette { get { return null; } }
public int ZOffset { get { return 0; } }
public bool IsDecoration { get { return true; } }
public IRenderable WithScale(float newScale) { return new TargetLineRenderable(waypoints, color); }
public IRenderable WithPalette(PaletteReference newPalette) { return new TargetLineRenderable(waypoints, color); }
public IRenderable WithZOffset(int newOffset) { return new TargetLineRenderable(waypoints, color); }
public IRenderable OffsetBy(WVec vec) { return new TargetLineRenderable(waypoints.Select(w => w + vec), color); }
public IRenderable AsDecoration() { return this; }
public void BeforeRender(WorldRenderer wr) { }
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }
public void Render(WorldRenderer wr)
{
if (!waypoints.Any())
@@ -49,7 +47,7 @@ namespace OpenRA.Graphics
var a = first;
foreach (var b in waypoints.Skip(1).Select(pos => wr.ScreenPxPosition(pos)))
{
Game.Renderer.WorldLineRenderer.DrawLine(a, b, color, color);
Game.Renderer.WorldLineRenderer.DrawLine(a, b, color);
wr.DrawTargetMarker(color, b);
a = b;
}
@@ -58,5 +56,6 @@ namespace OpenRA.Graphics
}
public void RenderDebugGeometry(WorldRenderer wr) { }
public Rectangle ScreenBounds(WorldRenderer wr) { return Rectangle.Empty; }
}
}

View File

@@ -16,33 +16,70 @@ namespace OpenRA.Graphics
sealed class TerrainRenderer : IDisposable
{
readonly IVertexBuffer<Vertex> vertexBuffer;
readonly World world;
readonly Vertex[] updateCellVertices = new Vertex[4];
readonly int rowStride;
readonly WorldRenderer worldRenderer;
readonly Theater theater;
readonly CellLayer<TerrainTile> mapTiles;
readonly Map map;
float terrainPaletteIndex;
public TerrainRenderer(World world, WorldRenderer wr)
{
this.world = world;
this.map = world.Map;
worldRenderer = wr;
theater = wr.Theater;
map = world.Map;
mapTiles = map.MapTiles.Value;
var terrainPalette = wr.Palette("terrain").TextureIndex;
var vertices = new Vertex[4 * map.Bounds.Height * map.Bounds.Width];
terrainPaletteIndex = wr.Palette("terrain").TextureIndex;
rowStride = 4 * map.Bounds.Width;
vertexBuffer = Game.Renderer.Device.CreateVertexBuffer(rowStride * map.Bounds.Height);
UpdateMap();
map.MapTiles.Value.CellEntryChanged += UpdateCell;
map.MapHeight.Value.CellEntryChanged += UpdateCell;
wr.PaletteInvalidated += () =>
{
terrainPaletteIndex = wr.Palette("terrain").TextureIndex;
UpdateMap();
};
}
void GenerateTileVertices(Vertex[] vertices, int offset, CPos cell)
{
var tile = theater.TileSprite(mapTiles[cell]);
var pos = worldRenderer.ScreenPosition(map.CenterOfCell(cell)) + tile.Offset - 0.5f * tile.Size;
Util.FastCreateQuad(vertices, pos, tile, terrainPaletteIndex, offset, tile.Size);
}
void UpdateMap()
{
var nv = 0;
var vertices = new Vertex[rowStride * map.Bounds.Height];
foreach (var cell in map.Cells)
{
var tile = wr.Theater.TileSprite(map.MapTiles.Value[cell]);
var pos = wr.ScreenPosition(map.CenterOfCell(cell)) + tile.Offset - 0.5f * tile.Size;
Util.FastCreateQuad(vertices, pos, tile, terrainPalette, nv, tile.Size);
GenerateTileVertices(vertices, nv, cell);
nv += 4;
}
vertexBuffer = Game.Renderer.Device.CreateVertexBuffer(vertices.Length);
vertexBuffer.SetData(vertices, nv);
}
public void UpdateCell(CPos cell)
{
var uv = cell.ToMPos(map.TileShape);
var offset = rowStride * (uv.V - map.Bounds.Top) + 4 * (uv.U - map.Bounds.Left);
GenerateTileVertices(updateCellVertices, 0, cell);
vertexBuffer.SetData(updateCellVertices, offset, 4);
}
public void Draw(WorldRenderer wr, Viewport viewport)
{
var verticesPerRow = 4 * map.Bounds.Width;
var cells = viewport.VisibleCells;
// Only draw the rows that are visible.
@@ -51,10 +88,10 @@ namespace OpenRA.Graphics
var lastRow = cells.BottomRight.ToMPos(map).V - map.Bounds.Top + 1;
Game.Renderer.WorldSpriteRenderer.DrawVertexBuffer(
vertexBuffer, verticesPerRow * firstRow, verticesPerRow * (lastRow - firstRow),
vertexBuffer, rowStride * firstRow, rowStride * (lastRow - firstRow),
PrimitiveType.QuadList, wr.Theater.Sheet);
foreach (var r in world.WorldActor.TraitsImplementing<IRenderOverlay>())
foreach (var r in wr.World.WorldActor.TraitsImplementing<IRenderOverlay>())
r.Render(wr);
}

View File

@@ -13,14 +13,30 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileSystem;
using OpenRA.Support;
namespace OpenRA.Graphics
{
class TheaterTemplate
{
public readonly Sprite[] Sprites;
public readonly int Stride;
public readonly int Variants;
public TheaterTemplate(Sprite[] sprites, int stride, int variants)
{
Sprites = sprites;
Stride = stride;
Variants = variants;
}
}
public sealed class Theater : IDisposable
{
readonly Dictionary<ushort, Sprite[]> templates = new Dictionary<ushort, Sprite[]>();
readonly Dictionary<ushort, TheaterTemplate> templates = new Dictionary<ushort, TheaterTemplate>();
readonly SheetBuilder sheetBuilder;
readonly Sprite missingTile;
readonly MersenneTwister random;
TileSet tileset;
public Theater(TileSet tileset)
@@ -37,20 +53,27 @@ namespace OpenRA.Graphics
};
sheetBuilder = new SheetBuilder(SheetType.Indexed, allocate);
templates = new Dictionary<ushort, Sprite[]>();
random = new MersenneTwister();
var frameCache = new FrameCache(Game.ModData.SpriteLoaders, tileset.Extensions);
var frameCache = new FrameCache(Game.ModData.SpriteLoaders);
foreach (var t in tileset.Templates)
{
var allFrames = frameCache[t.Value.Image];
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
var sprites = frames.Select(f => sheetBuilder.Add(f));
var variants = new List<Sprite[]>();
foreach (var i in t.Value.Images)
{
var allFrames = frameCache[i];
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
variants.Add(frames.Select(f => sheetBuilder.Add(f)).ToArray());
}
var allSprites = variants.SelectMany(s => s);
// Ignore the offsets baked into R8 sprites
if (tileset.IgnoreTileSpriteOffsets)
sprites = sprites.Select(s => new Sprite(s.Sheet, s.Bounds, float2.Zero, s.Channel, s.BlendMode));
allSprites = allSprites.Select(s => new Sprite(s.Sheet, s.Bounds, float2.Zero, s.Channel, s.BlendMode));
templates.Add(t.Value.Id, sprites.ToArray());
templates.Add(t.Value.Id, new TheaterTemplate(allSprites.ToArray(), variants.First().Count(), t.Value.Images.Length));
}
// 1x1px transparent tile
@@ -59,16 +82,17 @@ namespace OpenRA.Graphics
Sheet.ReleaseBuffer();
}
public Sprite TileSprite(TerrainTile r)
public Sprite TileSprite(TerrainTile r, int? variant = null)
{
Sprite[] template;
TheaterTemplate template;
if (!templates.TryGetValue(r.Type, out template))
return missingTile;
if (r.Index >= template.Length)
if (r.Index >= template.Stride)
return missingTile;
return template[r.Index];
var start = template.Variants > 1 ? variant.HasValue ? variant.Value : random.Next(template.Variants) : 0;
return template.Sprites[start * template.Stride + r.Index];
}
public Rectangle TemplateBounds(TerrainTemplateInfo template, Size tileSize, TileShape tileShape)

View File

@@ -14,7 +14,7 @@ using System.Linq;
namespace OpenRA.Graphics
{
public struct UISpriteRenderable : IRenderable
public struct UISpriteRenderable : IRenderable, IFinalizedRenderable
{
readonly Sprite sprite;
readonly int2 screenPos;
@@ -36,17 +36,15 @@ namespace OpenRA.Graphics
public WVec Offset { get { return WVec.Zero; } }
public bool IsDecoration { get { return true; } }
public float Scale { get { return scale; } }
public PaletteReference Palette { get { return palette; } }
public int ZOffset { get { return zOffset; } }
public IRenderable WithScale(float newScale) { return new UISpriteRenderable(sprite, screenPos, zOffset, palette, newScale); }
public IRenderable WithPalette(PaletteReference newPalette) { return new UISpriteRenderable(sprite, screenPos, zOffset, newPalette, scale); }
public IRenderable WithZOffset(int newOffset) { return this; }
public IRenderable OffsetBy(WVec vec) { return this; }
public IRenderable AsDecoration() { return this; }
public void BeforeRender(WorldRenderer wr) { }
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }
public void Render(WorldRenderer wr)
{
Game.Renderer.SpriteRenderer.DrawSprite(sprite, screenPos, palette, sprite.Size * scale);
@@ -57,5 +55,11 @@ namespace OpenRA.Graphics
var offset = screenPos + sprite.Offset;
Game.Renderer.LineRenderer.DrawRect(offset, offset + sprite.Size, Color.Red);
}
public Rectangle ScreenBounds(WorldRenderer wr)
{
var offset = screenPos + sprite.Offset;
return new Rectangle((int)offset.X, (int)offset.Y, (int)sprite.Size.X, (int)sprite.Size.Y);
}
}
}

View File

@@ -64,18 +64,70 @@ namespace OpenRA.Graphics
public static void FastCopyIntoSprite(Sprite dest, Bitmap src)
{
var data = dest.Sheet.GetData();
var dataStride = dest.Sheet.Size.Width * 4;
var x = dest.Bounds.Left * 4;
var width = dest.Bounds.Width * 4;
var y = dest.Bounds.Top;
var height = dest.Bounds.Height;
var createdTempBitmap = false;
if (src.PixelFormat != PixelFormat.Format32bppArgb)
{
src = src.CloneWith32bbpArgbPixelFormat();
createdTempBitmap = true;
}
var bd = src.LockBits(src.Bounds(),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
for (var row = 0; row < height; row++)
Marshal.Copy(IntPtr.Add(bd.Scan0, row * bd.Stride), data, (y + row) * dataStride + x, width);
src.UnlockBits(bd);
try
{
var destData = dest.Sheet.GetData();
var destStride = dest.Sheet.Size.Width;
var width = dest.Bounds.Width;
var height = dest.Bounds.Height;
var srcData = src.LockBits(src.Bounds(),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
unsafe
{
var c = (int*)srcData.Scan0;
// Cast the data to an int array so we can copy the src data directly
fixed (byte* bd = &destData[0])
{
var data = (int*)bd;
var x = dest.Bounds.Left;
var y = dest.Bounds.Top;
for (var j = 0; j < height; j++)
{
for (var i = 0; i < width; i++)
{
var cc = Color.FromArgb(*(c + (j * srcData.Stride >> 2) + i));
data[(y + j) * destStride + x + i] = PremultiplyAlpha(cc).ToArgb();
}
}
}
}
src.UnlockBits(srcData);
}
finally
{
if (createdTempBitmap)
src.Dispose();
}
}
public static Color PremultiplyAlpha(Color c)
{
var a = c.A / 255f;
return Color.FromArgb(c.A, (byte)(c.R * a + 0.5f), (byte)(c.G * a + 0.5f), (byte)(c.B * a + 0.5f));
}
public static Color PremultipliedColorLerp(float t, Color c1, Color c2)
{
// Colors must be lerped in a non-multiplied color space
var a1 = 255f / c1.A;
var a2 = 255f / c2.A;
return PremultiplyAlpha(Color.FromArgb(
(int)(t * c2.A + (1 - t) * c1.A),
(int)((byte)(t * a2 * c2.R + 0.5f) + (1 - t) * (byte)(a1 * c1.R + 0.5f)),
(int)((byte)(t * a2 * c2.G + 0.5f) + (1 - t) * (byte)(a1 * c1.G + 0.5f)),
(int)((byte)(t * a2 * c2.B + 0.5f) + (1 - t) * (byte)(a1 * c1.B + 0.5f))));
}
public static float[] IdentityMatrix()

View File

@@ -15,8 +15,11 @@ namespace OpenRA.Graphics
[StructLayout(LayoutKind.Sequential)]
public struct Vertex
{
// TODO Workaround for unused field warnings in mono 2.10
#pragma warning disable 414
float x, y, z, u, v;
float p, c;
#pragma warning restore
public Vertex(float2 xy, float u, float v, float p, float c)
{

View File

@@ -105,9 +105,71 @@ namespace OpenRA.Graphics
public CPos ViewToWorld(int2 view)
{
var world = worldRenderer.Viewport.ViewToWorldPx(view);
var map = worldRenderer.World.Map;
var ts = Game.ModData.Manifest.TileSize;
var candidates = CandidateMouseoverCells(world);
var tileSet = worldRenderer.World.TileSet;
foreach (var uv in candidates)
{
// Coarse filter to nearby cells
var p = map.CenterOfCell(uv.ToCPos(map.TileShape));
var s = worldRenderer.ScreenPxPosition(p);
if (Math.Abs(s.X - world.X) <= ts.Width && Math.Abs(s.Y - world.Y) <= ts.Height)
{
var ramp = 0;
if (map.Contains(uv))
{
var tile = map.MapTiles.Value[uv];
var ti = tileSet.GetTileInfo(tile);
if (ti != null)
ramp = ti.RampType;
}
var corners = map.CellCorners[ramp];
var pos = map.CenterOfCell(uv.ToCPos(map));
var screen = corners.Select(c => worldRenderer.ScreenPxPosition(pos + c)).ToArray();
if (screen.PolygonContains(world))
return uv.ToCPos(map);
}
}
// Mouse is not directly over a cell (perhaps on a cliff)
// Try and find the closest cell
if (candidates.Any())
{
return candidates.OrderBy(uv =>
{
var p = map.CenterOfCell(uv.ToCPos(map.TileShape));
var s = worldRenderer.ScreenPxPosition(p);
var dx = Math.Abs(s.X - world.X);
var dy = Math.Abs(s.Y - world.Y);
return dx * dx + dy * dy;
}).First().ToCPos(map);
}
// Something is very wrong, but lets return something that isn't completely bogus and hope the caller can recover
return worldRenderer.World.Map.CellContaining(worldRenderer.Position(ViewToWorldPx(view)));
}
/// <summary> Returns an unfiltered list of all cells that could potentially contain the mouse cursor</summary>
IEnumerable<MPos> CandidateMouseoverCells(int2 world)
{
var map = worldRenderer.World.Map;
var minPos = worldRenderer.Position(world);
// Find all the cells that could potentially have been clicked
var a = map.CellContaining(minPos - new WVec(1024, 0, 0)).ToMPos(map.TileShape);
var b = map.CellContaining(minPos + new WVec(512, 512 * maxGroundHeight, 0)).ToMPos(map.TileShape);
for (var v = b.V; v >= a.V; v--)
for (var u = b.U; u >= a.U; u--)
yield return new MPos(u, v);
}
public int2 ViewToWorldPx(int2 view) { return (1f / Zoom * view.ToFloat2()).ToInt2() + TopLeft; }
public int2 WorldToViewPx(int2 world) { return (Zoom * (world - TopLeft).ToFloat2()).ToInt2(); }
@@ -163,16 +225,20 @@ namespace OpenRA.Graphics
var wtl = worldRenderer.Position(TopLeft);
var wbr = worldRenderer.Position(BottomRight);
// Visible rectangle in map coordinates
var ctl = new MPos(wtl.X / 1024, wtl.Y / 1024);
// Due to diamond tile staggering, we need to adjust the top-left bounds outwards by half a cell.
if (map.TileShape == TileShape.Diamond)
wtl -= new WVec(512, 512, 0);
// Visible rectangle in map coordinates.
var dy = map.TileShape == TileShape.Diamond ? 512 : 1024;
var cbr = new MPos((wbr.X + 1023) / 1024, (wbr.Y + dy - 1) / dy);
var ctl = new MPos(wtl.X / 1024, wtl.Y / dy);
var cbr = new MPos(wbr.X / 1024, wbr.Y / dy);
// Add a 1 cell cordon to prevent holes, then convert back to cell coordinates
var tl = map.Clamp(new MPos(ctl.U - 1, ctl.V - 1).ToCPos(map));
var tl = map.Clamp(ctl.ToCPos(map));
// Also need to account for height of cells in rows below the bottom
var br = map.Clamp(new MPos(cbr.U + 1, cbr.V + 2 + maxGroundHeight / 2).ToCPos(map));
// Also need to account for height of cells in rows below the bottom.
var heightPadding = map.TileShape == TileShape.Diamond ? 2 : 0;
var br = map.Clamp(new MPos(cbr.U, cbr.V + heightPadding + maxGroundHeight / 2).ToCPos(map));
cells = new CellRegion(map.TileShape, tl, br);
cellsDirty = false;

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Graphics
var s = sheetBuilder.Allocate(new Size(su, sv));
Util.FastCopyIntoChannel(s, 0, colors);
Util.FastCopyIntoChannel(s, 1, normals);
s.Sheet.CommitData();
s.Sheet.CommitBufferedData();
var channelP = ChannelSelect[(int)s.Channel];
var channelC = ChannelSelect[(int)s.Channel + 1];
@@ -217,9 +217,9 @@ namespace OpenRA.Graphics
{
VxlReader vxl;
HvaReader hva;
using (var s = GlobalFileSystem.OpenWithExts(files.First, ".vxl"))
using (var s = GlobalFileSystem.Open(files.First + ".vxl"))
vxl = new VxlReader(s);
using (var s = GlobalFileSystem.OpenWithExts(files.Second, ".hva"))
using (var s = GlobalFileSystem.Open(files.Second + ".hva"))
hva = new HvaReader(s);
return new Voxel(this, vxl, hva);
}

View File

@@ -16,23 +16,6 @@ using OpenRA.Traits;
namespace OpenRA.Graphics
{
public class PaletteReference
{
public readonly string Name;
public IPalette Palette { get; internal set; }
readonly float index;
readonly HardwarePalette hardwarePalette;
public float TextureIndex { get { return index / hardwarePalette.Height; } }
public float TextureMidIndex { get { return (index + 0.5f) / hardwarePalette.Height; } }
public PaletteReference(string name, int index, IPalette palette, HardwarePalette hardwarePalette)
{
Name = name;
Palette = palette;
this.index = index;
this.hardwarePalette = hardwarePalette;
}
}
public sealed class WorldRenderer : IDisposable
{
public static readonly Func<IRenderable, int> RenderableScreenZPositionComparisonKey =
@@ -42,19 +25,27 @@ namespace OpenRA.Graphics
public readonly Theater Theater;
public Viewport Viewport { get; private set; }
public event Action PaletteInvalidated = null;
readonly HardwarePalette palette = new HardwarePalette();
readonly Dictionary<string, PaletteReference> palettes = new Dictionary<string, PaletteReference>();
readonly TerrainRenderer terrainRenderer;
readonly Lazy<DeveloperMode> devTrait;
readonly Func<string, PaletteReference> createPaletteReference;
internal WorldRenderer(World world)
{
World = world;
Viewport = new Viewport(this, world.Map);
createPaletteReference = CreatePaletteReference;
foreach (var pal in world.TraitDict.ActorsWithTrait<ILoadsPalettes>())
pal.Trait.LoadPalettes(this);
foreach (var p in world.Players)
UpdatePalettesForPlayer(p.InternalName, p.Color, false);
palette.Initialize();
Theater = new Theater(world.TileSet);
@@ -63,26 +54,50 @@ namespace OpenRA.Graphics
devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
}
public void UpdatePalettesForPlayer(string internalName, HSLColor color, bool replaceExisting)
{
foreach (var pal in World.WorldActor.TraitsImplementing<ILoadsPlayerPalettes>())
pal.LoadPlayerPalettes(this, internalName, color, replaceExisting);
}
PaletteReference CreatePaletteReference(string name)
{
var pal = palette.GetPalette(name);
return new PaletteReference(name, palette.GetPaletteIndex(name), pal, palette);
}
public PaletteReference Palette(string name) { return palettes.GetOrAdd(name, CreatePaletteReference); }
public void AddPalette(string name, ImmutablePalette pal) { palette.AddPalette(name, pal, false); }
public void AddPalette(string name, ImmutablePalette pal, bool allowModifiers) { palette.AddPalette(name, pal, allowModifiers); }
public void ReplacePalette(string name, IPalette pal) { palette.ReplacePalette(name, pal); palettes[name].Palette = pal; }
public PaletteReference Palette(string name) { return palettes.GetOrAdd(name, createPaletteReference); }
public void AddPalette(string name, ImmutablePalette pal, bool allowModifiers = false, bool allowOverwrite = false)
{
if (allowOverwrite && palette.Contains(name))
ReplacePalette(name, pal);
else
{
var oldHeight = palette.Height;
palette.AddPalette(name, pal, allowModifiers);
List<IRenderable> GenerateRenderables()
if (oldHeight != palette.Height && PaletteInvalidated != null)
PaletteInvalidated();
}
}
public void ReplacePalette(string name, IPalette pal)
{
palette.ReplacePalette(name, pal);
// Update cached PlayerReference if one exists
if (palettes.ContainsKey(name))
palettes[name].Palette = pal;
}
List<IFinalizedRenderable> GenerateRenderables()
{
var actors = World.ScreenMap.ActorsInBox(Viewport.TopLeft, Viewport.BottomRight)
.Append(World.WorldActor)
.ToList();
.Append(World.WorldActor);
// Include player actor for the rendered player
if (World.RenderPlayer != null)
actors.Add(World.RenderPlayer.PlayerActor);
actors = actors.Append(World.RenderPlayer.PlayerActor);
var worldRenderables = actors.SelectMany(a => a.Render(this));
if (World.OrderGenerator != null)
@@ -98,12 +113,9 @@ namespace OpenRA.Graphics
if (World.OrderGenerator != null)
effectRenderables = effectRenderables.Concat(World.OrderGenerator.RenderAfterWorld(this, World));
// Iterating via foreach copies the structs, so enumerate by index
var renderables = worldRenderables.Concat(effectRenderables).ToList();
Game.Renderer.WorldVoxelRenderer.BeginFrame();
for (var i = 0; i < renderables.Count; i++)
renderables[i].BeforeRender(this);
var renderables = worldRenderables.Concat(effectRenderables)
.Select(r => r.PrepareRender(this)).ToList();
Game.Renderer.WorldVoxelRenderer.EndFrame();
return renderables;
@@ -144,21 +156,19 @@ namespace OpenRA.Graphics
var overlayRenderables = World.Selection.Actors.Where(a => !a.Destroyed)
.SelectMany(a => a.TraitsImplementing<IPostRenderSelection>())
.SelectMany(t => t.RenderAfterWorld(this))
.ToList();
.SelectMany(t => t.RenderAfterWorld(this));
Game.Renderer.WorldVoxelRenderer.BeginFrame();
for (var i = 0; i < overlayRenderables.Count; i++)
overlayRenderables[i].BeforeRender(this);
var finalOverlayRenderables = overlayRenderables.Select(r => r.PrepareRender(this));
Game.Renderer.WorldVoxelRenderer.EndFrame();
// HACK: Keep old grouping behaviour
foreach (var g in overlayRenderables.GroupBy(prs => prs.GetType()))
foreach (var g in finalOverlayRenderables.GroupBy(prs => prs.GetType()))
foreach (var r in g)
r.Render(this);
if (devTrait.Value != null && devTrait.Value.ShowDebugGeometry)
foreach (var g in overlayRenderables.GroupBy(prs => prs.GetType()))
foreach (var g in finalOverlayRenderables.GroupBy(prs => prs.GetType()))
foreach (var r in g)
r.RenderDebugGeometry(this);
@@ -192,7 +202,7 @@ namespace OpenRA.Graphics
{
var pa = pos + offset.Rotate(WRot.FromFacing(8 * i));
var pb = pos + offset.Rotate(WRot.FromFacing(8 * i + 6));
Game.Renderer.WorldLineRenderer.DrawLine(ScreenPosition(pa), ScreenPosition(pb), c, c);
Game.Renderer.WorldLineRenderer.DrawLine(ScreenPosition(pa), ScreenPosition(pb), c);
}
}
@@ -204,10 +214,10 @@ namespace OpenRA.Graphics
var tr = new float2(br.X, tl.Y);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(location + tl, location + tr, c, c);
wlr.DrawLine(location + tr, location + br, c, c);
wlr.DrawLine(location + br, location + bl, c, c);
wlr.DrawLine(location + bl, location + tl, c, c);
wlr.DrawLine(location + tl, location + tr, c);
wlr.DrawLine(location + tr, location + br, c);
wlr.DrawLine(location + br, location + bl, c);
wlr.DrawLine(location + bl, location + tl, c);
}
public void RefreshPalette()

View File

@@ -15,8 +15,8 @@ namespace OpenRA
{
public class Group
{
List<Actor> actors;
int id;
readonly Actor[] actors;
readonly int id;
static int nextGroup;
@@ -24,7 +24,7 @@ namespace OpenRA
public Group(IEnumerable<Actor> actors)
{
this.actors = actors.ToList();
this.actors = actors.ToArray();
foreach (var a in actors)
a.Group = this;

View File

@@ -28,7 +28,12 @@ namespace OpenRA
Keycode key;
if (!Enum<Keycode>.TryParse(parts[0], true, out key))
return false;
{
int c;
if (!int.TryParse(parts[0], out c))
return false;
key = (Keycode)c;
}
var mods = Modifiers.None;
if (parts.Length >= 2)

View File

@@ -49,4 +49,23 @@ namespace OpenRA
Sync.CheckSyncUnchanged(world, () => Ui.HandleInput(input));
}
}
public class MouseButtonPreference
{
public MouseButton Action
{
get
{
return Game.Settings.Game.UseClassicMouseStyle ? MouseButton.Left : MouseButton.Right;
}
}
public MouseButton Cancel
{
get
{
return Game.Settings.Game.UseClassicMouseStyle ? MouseButton.Right : MouseButton.Left;
}
}
}
}

25
OpenRA.Game/LogProxy.cs Normal file
View File

@@ -0,0 +1,25 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA
{
public interface ILog
{
void Write(string channel, string format, params object[] args);
}
public class LogProxy : ILog
{
public void Write(string channel, string format, params object[] args)
{
Log.Write(channel, format, args);
}
}
}

View File

@@ -18,6 +18,18 @@ using OpenRA.Primitives;
namespace OpenRA
{
public enum TileShape { Rectangle, Diamond }
public interface IGlobalModData { }
public sealed class SpriteSequenceFormat : IGlobalModData
{
public readonly string Type;
public readonly IReadOnlyDictionary<string, MiniYaml> Metadata;
public SpriteSequenceFormat(MiniYaml yaml)
{
Type = yaml.Value;
Metadata = new ReadOnlyDictionary<string, MiniYaml>(yaml.ToDictionary());
}
}
// Describes what is to be loaded in order to run a mod
public class Manifest
@@ -26,14 +38,14 @@ namespace OpenRA
public readonly string[]
Folders, Rules, ServerTraits,
Sequences, VoxelSequences, Cursors, Chrome, Assemblies, ChromeLayout,
Weapons, Voices, Notifications, Music, Movies, Translations, TileSets,
Weapons, Voices, Notifications, Music, Translations, TileSets,
ChromeMetrics, MapCompatibility, Missions;
public readonly IReadOnlyDictionary<string, string> Packages;
public readonly IReadOnlyDictionary<string, string> MapFolders;
public readonly MiniYaml LoadScreen;
public readonly MiniYaml LobbyDefaults;
public readonly InstallData ContentInstaller;
public readonly Dictionary<string, Pair<string, int>> Fonts;
public readonly Size TileSize = new Size(24, 24);
public readonly TileShape TileShape = TileShape.Rectangle;
@@ -54,10 +66,19 @@ namespace OpenRA
[Desc("Default subcell index used if SubCellInit is absent", "0 - full cell, 1 - first sub-cell")]
public readonly int SubCellDefaultIndex = 3;
readonly string[] reservedModuleNames = { "Metadata", "Folders", "MapFolders", "Packages", "Rules",
"Sequences", "VoxelSequences", "Cursors", "Chrome", "Assemblies", "ChromeLayout", "Weapons",
"Voices", "Notifications", "Music", "Translations", "TileSets", "ChromeMetrics", "Missions",
"ServerTraits", "LoadScreen", "LobbyDefaults", "Fonts", "TileSize",
"TileShape", "SubCells", "SupportsMapsFrom", "SpriteFormats" };
readonly TypeDictionary modules = new TypeDictionary();
readonly Dictionary<string, MiniYaml> yaml;
public Manifest(string mod)
{
var path = Platform.ResolvePath(".", "mods", mod, "mod.yaml");
var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).ToDictionary();
yaml = new MiniYaml(null, MiniYaml.FromFile(path)).ToDictionary();
Mod = FieldLoader.Load<ModMetadata>(yaml["Metadata"]);
Mod.Id = mod;
@@ -77,18 +98,18 @@ namespace OpenRA
Voices = YamlList(yaml, "Voices", true);
Notifications = YamlList(yaml, "Notifications", true);
Music = YamlList(yaml, "Music", true);
Movies = YamlList(yaml, "Movies", true);
Translations = YamlList(yaml, "Translations", true);
TileSets = YamlList(yaml, "TileSets", true);
ChromeMetrics = YamlList(yaml, "ChromeMetrics", true);
Missions = YamlList(yaml, "Missions", true);
ServerTraits = YamlList(yaml, "ServerTraits");
LoadScreen = yaml["LoadScreen"];
LobbyDefaults = yaml["LobbyDefaults"];
if (yaml.ContainsKey("ContentInstaller"))
ContentInstaller = FieldLoader.Load<InstallData>(yaml["ContentInstaller"]);
if (!yaml.TryGetValue("LoadScreen", out LoadScreen))
throw new InvalidDataException("`LoadScreen` section is not defined.");
if (!yaml.TryGetValue("LobbyDefaults", out LobbyDefaults))
throw new InvalidDataException("`LobbyDefaults` section is not defined.");
Fonts = yaml["Fonts"].ToDictionary(my =>
{
@@ -134,6 +155,35 @@ namespace OpenRA
SpriteFormats = FieldLoader.GetValue<string[]>("SpriteFormats", yaml["SpriteFormats"].Value);
}
public void LoadCustomData(ObjectCreator oc)
{
foreach (var kv in yaml)
{
if (reservedModuleNames.Contains(kv.Key))
continue;
var t = oc.FindType(kv.Key);
if (t == null || !typeof(IGlobalModData).IsAssignableFrom(t))
throw new InvalidDataException("`{0}` is not a valid mod manifest entry.".F(kv.Key));
IGlobalModData module;
var ctor = t.GetConstructor(new[] { typeof(MiniYaml) });
if (ctor != null)
{
// Class has opted-in to DIY initialization
module = (IGlobalModData)ctor.Invoke(new object[] { kv.Value });
}
else
{
// Automatically load the child nodes using FieldLoader
module = oc.CreateObject<IGlobalModData>(kv.Key);
FieldLoader.Load(module, kv.Value);
}
modules.Add(module);
}
}
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key, bool parsePaths = false)
{
if (!yaml.ContainsKey(key))
@@ -153,5 +203,19 @@ namespace OpenRA
return new ReadOnlyDictionary<string, string>(inner);
}
public T Get<T>() where T : IGlobalModData
{
var module = modules.GetOrDefault<T>();
// Lazily create the default values if not explicitly defined.
if (module == null)
{
module = (T)Game.ModData.ObjectCreator.CreateBasic(typeof(T));
modules.Add(module);
}
return module;
}
}
}

View File

@@ -102,4 +102,14 @@ namespace OpenRA
return world.Players.First(x => x.InternalName == PlayerName);
}
}
// Allows maps / transformations to specify the race variant of an actor.
public class RaceInit : IActorInit<string>
{
[FieldFromYamlKey] public readonly string Race;
public RaceInit() { }
public RaceInit(string race) { Race = race; }
public string Value(World world) { return Race; }
}
}

View File

@@ -15,6 +15,8 @@ using OpenRA.Primitives;
namespace OpenRA
{
public interface ISuppressInitExport { }
public class ActorReference : IEnumerable
{
public string Type;
@@ -46,11 +48,17 @@ namespace OpenRA
return info;
}
public MiniYaml Save()
public MiniYaml Save(Func<object, bool> initFilter = null)
{
var ret = new MiniYaml(Type);
foreach (var init in InitDict)
{
if (init is ISuppressInitExport)
continue;
if (initFilter != null && !initFilter(init))
continue;
var initName = init.GetType().Name;
ret.Nodes.Add(new MiniYamlNode(initName.Substring(0, initName.Length - 4), FieldSaver.Save(init)));
}

View File

@@ -45,6 +45,21 @@ namespace OpenRA
Array.Copy(anotherLayer.entries, entries, entries.Length);
}
public static CellLayer<T> CreateInstance(Func<MPos, T> initialCellValueFactory, Size size, TileShape tileShape)
{
var cellLayer = new CellLayer<T>(tileShape, size);
for (var v = 0; v < size.Height; v++)
{
for (var u = 0; u < size.Width; u++)
{
var mpos = new MPos(u, v);
cellLayer[mpos] = initialCellValueFactory(mpos);
}
}
return cellLayer;
}
// Resolve an array index from cell coordinates
int Index(CPos cell)
{
@@ -100,7 +115,7 @@ namespace OpenRA
public IEnumerator<T> GetEnumerator()
{
return (IEnumerator<T>)entries.GetEnumerator();
return ((IEnumerable<T>)entries).GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()

View File

@@ -9,9 +9,9 @@
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
@@ -113,10 +113,46 @@ namespace OpenRA
public class Map
{
static readonly int[][] CellCornerHalfHeights = new int[][]
{
// Flat
new[] { 0, 0, 0, 0 },
// Slopes (two corners high)
new[] { 0, 0, 1, 1 },
new[] { 1, 0, 0, 1 },
new[] { 1, 1, 0, 0 },
new[] { 0, 1, 1, 0 },
// Slopes (one corner high)
new[] { 0, 0, 0, 1 },
new[] { 1, 0, 0, 0 },
new[] { 0, 1, 0, 0 },
new[] { 0, 0, 1, 0 },
// Slopes (three corners high)
new[] { 1, 0, 1, 1 },
new[] { 1, 1, 0, 1 },
new[] { 1, 1, 1, 0 },
new[] { 0, 1, 1, 1 },
// Slopes (two corners high, one corner double high)
new[] { 1, 0, 1, 2 },
new[] { 2, 1, 0, 1 },
new[] { 1, 2, 1, 0 },
new[] { 0, 1, 2, 1 },
// Slopes (two corners high, alternating)
new[] { 1, 0, 1, 0 },
new[] { 0, 1, 0, 1 },
new[] { 1, 0, 1, 0 },
new[] { 0, 1, 0, 1 }
};
public const int MaxTilesInCircleRange = 50;
public readonly TileShape TileShape;
[FieldLoader.Ignore]
public readonly WVec[] SubCellOffsets;
[FieldLoader.Ignore] public readonly WVec[] SubCellOffsets;
public readonly SubCell DefaultSubCell;
public readonly SubCell LastSubCell;
[FieldLoader.Ignore] public IFolder Container;
@@ -137,10 +173,15 @@ namespace OpenRA
public Bitmap CustomPreview;
public bool InvalidCustomRules { get; private set; }
public WVec OffsetOfSubCell(SubCell subCell) { return SubCellOffsets[(int)subCell]; }
public WVec OffsetOfSubCell(SubCell subCell)
{
if (subCell == SubCell.Invalid || subCell == SubCell.Any)
return WVec.Zero;
[FieldLoader.LoadUsing("LoadOptions")]
public MapOptions Options;
return SubCellOffsets[(int)subCell];
}
[FieldLoader.LoadUsing("LoadOptions")] public MapOptions Options;
static object LoadOptions(MiniYaml y)
{
@@ -152,8 +193,7 @@ namespace OpenRA
return options;
}
[FieldLoader.LoadUsing("LoadVideos")]
public MapVideos Videos;
[FieldLoader.LoadUsing("LoadVideos")] public MapVideos Videos;
static object LoadVideos(MiniYaml y)
{
@@ -165,16 +205,11 @@ namespace OpenRA
return videos;
}
[FieldLoader.Ignore] public Lazy<Dictionary<string, ActorReference>> Actors;
public int PlayerCount { get { return Players.Count(p => p.Value.Playable); } }
public Rectangle Bounds;
// Yaml map data
[FieldLoader.Ignore] public Dictionary<string, PlayerReference> Players = new Dictionary<string, PlayerReference>();
[FieldLoader.Ignore] public Lazy<List<SmudgeReference>> Smudges;
public Lazy<CPos[]> SpawnPoints;
// Yaml map data
[FieldLoader.Ignore] public List<MiniYamlNode> RuleDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> SequenceDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> VoxelSequenceDefinitions = new List<MiniYamlNode>();
@@ -182,6 +217,10 @@ namespace OpenRA
[FieldLoader.Ignore] public List<MiniYamlNode> VoiceDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> NotificationDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> TranslationDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> PlayerDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> ActorDefinitions = new List<MiniYamlNode>();
[FieldLoader.Ignore] public List<MiniYamlNode> SmudgeDefinitions = new List<MiniYamlNode>();
// Binary map data
[FieldLoader.Ignore] public byte TileFormat = 2;
@@ -199,6 +238,7 @@ namespace OpenRA
public Ruleset Rules { get { return rules != null ? rules.Value : null; } }
public SequenceProvider SequenceProvider { get { return Rules.Sequences[Tileset]; } }
public WVec[][] CellCorners { get; private set; }
[FieldLoader.Ignore] public CellRegion Cells;
public static Map FromTileset(TileSet tileset)
@@ -233,8 +273,8 @@ namespace OpenRA
MapResources = Exts.Lazy(() => new CellLayer<ResourceTile>(tileShape, size)),
MapTiles = makeMapTiles,
MapHeight = makeMapHeight,
Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>()),
Smudges = Exts.Lazy(() => new List<SmudgeReference>())
SpawnPoints = Exts.Lazy(() => new CPos[0])
};
map.PostInit();
@@ -262,7 +302,7 @@ namespace OpenRA
AssertExists("map.yaml");
AssertExists("map.bin");
var yaml = new MiniYaml(null, MiniYaml.FromStream(Container.GetContent("map.yaml")));
var yaml = new MiniYaml(null, MiniYaml.FromStream(Container.GetContent("map.yaml"), path));
FieldLoader.Load(this, yaml);
// Support for formats 1-3 dropped 2011-02-11.
@@ -284,36 +324,17 @@ namespace OpenRA
Visibility = MapVisibility.MissionSelector;
}
// Load players
foreach (var my in nd["Players"].ToDictionary().Values)
SpawnPoints = Exts.Lazy(() =>
{
var player = new PlayerReference(my);
Players.Add(player.Name, player);
}
Actors = Exts.Lazy(() =>
{
var ret = new Dictionary<string, ActorReference>();
foreach (var kv in nd["Actors"].ToDictionary())
ret.Add(kv.Key, new ActorReference(kv.Value.Value, kv.Value.ToDictionary()));
return ret;
});
// Smudges
Smudges = Exts.Lazy(() =>
{
var ret = new List<SmudgeReference>();
foreach (var name in nd["Smudges"].ToDictionary().Keys)
var spawns = new List<CPos>();
foreach (var kv in ActorDefinitions.Where(d => d.Value.Value == "mpspawn"))
{
var vals = name.Split(' ');
var loc = vals[1].Split(',');
ret.Add(new SmudgeReference(vals[0], new int2(
Exts.ParseIntegerInvariant(loc[0]),
Exts.ParseIntegerInvariant(loc[1])),
Exts.ParseIntegerInvariant(vals[2])));
var s = new ActorReference(kv.Value.Value, kv.Value.ToDictionary());
spawns.Add(s.InitDict.Get<LocationInit>().Value(null));
}
return ret;
return spawns.ToArray();
});
RuleDefinitions = MiniYaml.NodesOrEmpty(yaml, "Rules");
@@ -323,10 +344,14 @@ namespace OpenRA
VoiceDefinitions = MiniYaml.NodesOrEmpty(yaml, "Voices");
NotificationDefinitions = MiniYaml.NodesOrEmpty(yaml, "Notifications");
TranslationDefinitions = MiniYaml.NodesOrEmpty(yaml, "Translations");
PlayerDefinitions = MiniYaml.NodesOrEmpty(yaml, "Players");
MapTiles = Exts.Lazy(() => LoadMapTiles());
MapResources = Exts.Lazy(() => LoadResourceTiles());
MapHeight = Exts.Lazy(() => LoadMapHeight());
ActorDefinitions = MiniYaml.NodesOrEmpty(yaml, "Actors");
SmudgeDefinitions = MiniYaml.NodesOrEmpty(yaml, "Smudges");
MapTiles = Exts.Lazy(LoadMapTiles);
MapResources = Exts.Lazy(LoadResourceTiles);
MapHeight = Exts.Lazy(LoadMapHeight);
TileShape = Game.ModData.Manifest.TileShape;
SubCellOffsets = Game.ModData.Manifest.SubCellOffsets;
@@ -374,6 +399,18 @@ namespace OpenRA
CustomTerrain = new CellLayer<byte>(this);
foreach (var uv in Cells.MapCoords)
CustomTerrain[uv] = byte.MaxValue;
var leftDelta = TileShape == TileShape.Diamond ? new WVec(-512, 0, 0) : new WVec(-512, -512, 0);
var topDelta = TileShape == TileShape.Diamond ? new WVec(0, -512, 0) : new WVec(512, -512, 0);
var rightDelta = TileShape == TileShape.Diamond ? new WVec(512, 0, 0) : new WVec(512, 512, 0);
var bottomDelta = TileShape == TileShape.Diamond ? new WVec(0, 512, 0) : new WVec(-512, 512, 0);
CellCorners = CellCornerHalfHeights.Select(ramp => new WVec[]
{
leftDelta + new WVec(0, 0, 512 * ramp[0]),
topDelta + new WVec(0, 0, 512 * ramp[1]),
rightDelta + new WVec(0, 0, 512 * ramp[2]),
bottomDelta + new WVec(0, 0, 512 * ramp[3])
}).ToArray();
}
public Ruleset PreloadRules()
@@ -381,14 +418,6 @@ namespace OpenRA
return rules.Value;
}
public CPos[] GetSpawnPoints()
{
return Actors.Value.Values
.Where(a => a.Type == "mpspawn")
.Select(a => (CPos)a.InitDict.Get<LocationInit>().Value(null))
.ToArray();
}
public void Save(string toPath)
{
MapFormat = 7;
@@ -420,13 +449,10 @@ namespace OpenRA
root.Add(new MiniYamlNode("Options", FieldSaver.SaveDifferences(Options, new MapOptions())));
root.Add(new MiniYamlNode("Players", null,
Players.Select(p => new MiniYamlNode("PlayerReference@{0}".F(p.Key), FieldSaver.SaveDifferences(p.Value, new PlayerReference()))).ToList()));
root.Add(new MiniYamlNode("Players", null, PlayerDefinitions));
root.Add(new MiniYamlNode("Actors", null,
Actors.Value.Select(x => new MiniYamlNode(x.Key, x.Value.Save())).ToList()));
root.Add(new MiniYamlNode("Smudges", MiniYaml.FromList<SmudgeReference>(Smudges.Value)));
root.Add(new MiniYamlNode("Actors", null, ActorDefinitions));
root.Add(new MiniYamlNode("Smudges", null, SmudgeDefinitions));
root.Add(new MiniYamlNode("Rules", null, RuleDefinitions));
root.Add(new MiniYamlNode("Sequences", null, SequenceDefinitions));
root.Add(new MiniYamlNode("VoxelSequences", null, VoxelSequenceDefinitions));
@@ -621,7 +647,7 @@ namespace OpenRA
// - ax + by adds (a - b) * 512 + 512 to u
// - ax + by adds (a + b) * 512 + 512 to v
var z = Contains(cell) ? 512 * MapHeight.Value[cell] : 0;
return new WPos(512 * (cell.X - cell.Y + 1), 512 * (cell.X + cell.Y + 1), z);
return new WPos(512 * (cell.X - cell.Y), 512 * (cell.X + cell.Y + 1), z);
}
public WPos CenterOfSubCell(CPos cell, SubCell subCell)
@@ -640,10 +666,10 @@ namespace OpenRA
// Convert from world position to diamond cell position:
// (a) Subtract (512, 512) to move the rotation center to the middle of the corner cell
// (b) Rotate axes by -pi/4
// (c) Add 512 to x (but not y) to realign the cell
// (c) Add (512, 512) to move back to the center of the cell
// (d) Divide by 1024 to find final cell coords
var u = (pos.Y + pos.X - 512) / 1024;
var v = (pos.Y - pos.X) / 1024;
var v = (pos.Y - pos.X - 512) / 1024;
return new CPos(u, v);
}
@@ -692,45 +718,6 @@ namespace OpenRA
}
}
public void MakeDefaultPlayers()
{
var firstRace = Rules.Actors["world"].Traits
.WithInterface<CountryInfo>().First(c => c.Selectable).Race;
if (!Players.ContainsKey("Neutral"))
Players.Add("Neutral", new PlayerReference
{
Name = "Neutral",
Race = firstRace,
OwnsWorld = true,
NonCombatant = true
});
var numSpawns = GetSpawnPoints().Length;
for (var index = 0; index < numSpawns; index++)
{
if (Players.ContainsKey("Multi{0}".F(index)))
continue;
var p = new PlayerReference
{
Name = "Multi{0}".F(index),
Race = "Random",
Playable = true,
Enemies = new[] { "Creeps" }
};
Players.Add(p.Name, p);
}
Players.Add("Creeps", new PlayerReference
{
Name = "Creeps",
Race = firstRace,
NonCombatant = true,
Enemies = Players.Where(p => p.Value.Playable).Select(p => p.Key).ToArray()
});
}
public void FixOpenAreas(Ruleset rules)
{
var r = new Random();
@@ -784,6 +771,19 @@ namespace OpenRA
return new MPos(x, y).ToCPos(this);
}
public CPos ChooseClosestEdgeCell(CPos pos)
{
var mpos = pos.ToMPos(this);
var horizontalBound = ((mpos.U - Bounds.Left) < Bounds.Width / 2) ? Bounds.Left : Bounds.Right;
var verticalBound = ((mpos.V - Bounds.Top) < Bounds.Height / 2) ? Bounds.Top : Bounds.Bottom;
var distX = Math.Abs(horizontalBound - mpos.U);
var distY = Math.Abs(verticalBound - mpos.V);
return distX < distY ? new MPos(horizontalBound, mpos.V).ToCPos(this) : new MPos(mpos.U, verticalBound).ToCPos(this);
}
public CPos ChooseRandomEdgeCell(MersenneTwister rand)
{
var isX = rand.Next(2) == 0;

View File

@@ -60,6 +60,8 @@ namespace OpenRA
{
Console.WriteLine("Failed to load map: {0}", path);
Console.WriteLine("Details: {0}", e);
Log.Write("debug", "Failed to load map: {0}", path);
Log.Write("debug", "Details: {0}", e);
}
}
}
@@ -77,7 +79,7 @@ namespace OpenRA
foreach (var p in maps.Values)
p.UpdateRemoteSearch(MapStatus.Searching, null);
var url = Game.Settings.Game.MapRepository + "hash/" + string.Join(",", maps.Keys.ToArray()) + "/yaml";
var url = Game.Settings.Game.MapRepository + "hash/" + string.Join(",", maps.Keys) + "/yaml";
Action<DownloadDataCompletedEventArgs, bool> onInfoComplete = (i, cancelled) =>
{
@@ -173,34 +175,31 @@ namespace OpenRA
bitmap = Minimap.RenderMapPreview(modData.DefaultRules.TileSets[p.Map.Tileset], p.Map, modData.DefaultRules, true);
}
// Note: this is not generally thread-safe, but it works here because:
// (a) This worker is the only thread writing to this sheet
// (b) The main thread is the only thread reading this sheet
// (c) The sheet is marked dirty after the write is completed,
// which causes the main thread to copy this to the texture during
// the next render cycle.
// (d) Any partially written bytes from the next minimap is in an
// unallocated area, and will be committed in the next cycle.
try
Game.RunAfterTick(() =>
{
p.SetMinimap(sheetBuilder.Add(bitmap));
}
finally
{
if (createdPreview)
bitmap.Dispose();
}
try
{
p.SetMinimap(sheetBuilder.Add(bitmap));
}
finally
{
if (createdPreview)
bitmap.Dispose();
}
});
// Yuck... But this helps the UI Jank when opening the map selector significantly.
Thread.Sleep(Environment.ProcessorCount == 1 ? 25 : 5);
}
}
sheetBuilder.Current.ReleaseBuffer();
// The buffer is not fully reclaimed until changes are written out to the texture.
// We will access the texture in order to force changes to be written out, allowing the buffer to be freed.
Game.RunAfterTick(() => sheetBuilder.Current.GetTexture());
Game.RunAfterTick(() =>
{
sheetBuilder.Current.ReleaseBuffer();
sheetBuilder.Current.GetTexture();
});
Log.Write("debug", "MapCache.LoadAsyncInternal ended");
}
@@ -221,7 +220,6 @@ namespace OpenRA
if (previewLoaderThread != null)
previewLoaderThread.Join();
sheetBuilder.Current.CreateBuffer();
previewLoaderThread = new Thread(LoadAsyncInternal)
{
Name = "Map Preview Loader",
@@ -248,7 +246,20 @@ namespace OpenRA
public void Dispose()
{
sheetBuilder.Dispose();
if (previewLoaderThread == null)
{
sheetBuilder.Dispose();
return;
}
// We need to let the loader thread exit before we can dispose our sheet builder.
// Ideally we should dispose our resources before returning, but we don't to block waiting on the loader thread to exit.
// Instead, we'll queue disposal to be run once it has exited.
ThreadPool.QueueUserWorkItem(_ =>
{
previewLoaderThread.Join();
Game.RunAfterTick(sheetBuilder.Dispose);
});
}
}
}

View File

@@ -0,0 +1,75 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA
{
public class MapPlayers
{
public readonly Dictionary<string, PlayerReference> Players;
public MapPlayers() : this(new List<MiniYamlNode>()) { }
public MapPlayers(IEnumerable<MiniYamlNode> playerDefinitions)
{
Players = playerDefinitions.Select(pr => new PlayerReference(new MiniYaml(pr.Key, pr.Value.Nodes)))
.ToDictionary(player => player.Name);
}
public MapPlayers(Ruleset rules, int playerCount)
{
var firstRace = rules.Actors["world"].Traits
.WithInterface<CountryInfo>().First(c => c.Selectable).Race;
Players = new Dictionary<string, PlayerReference>
{
{
"Neutral", new PlayerReference
{
Name = "Neutral",
Race = firstRace,
OwnsWorld = true,
NonCombatant = true
}
},
{
"Creeps", new PlayerReference
{
Name = "Creeps",
Race = firstRace,
NonCombatant = true,
Enemies = Exts.MakeArray(playerCount, i => "Multi{0}".F(i))
}
}
};
for (var index = 0; index < playerCount; index++)
{
var p = new PlayerReference
{
Name = "Multi{0}".F(index),
Race = "Random",
Playable = true,
Enemies = new[] { "Creeps" }
};
Players.Add(p.Name, p);
}
}
public List<MiniYamlNode> ToMiniYaml()
{
return Players.Select(p => new MiniYamlNode("PlayerReference@{0}".F(p.Key),
FieldSaver.SaveDifferences(p.Value, new PlayerReference()))).ToList();
}
}
}

View File

@@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
@@ -29,9 +30,15 @@ namespace OpenRA
// Used for verifying map availability in the lobby
public enum MapRuleStatus { Unknown, Cached, Invalid }
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Fields names must match the with the remote API.")]
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1304:NonPrivateReadonlyFieldsMustBeginWithUpperCaseLetter", Justification = "Fields names must match the with the remote API.")]
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:FieldNamesMustNotContainUnderscore", Justification = "Fields names must match the with the remote API.")]
[SuppressMessage("StyleCop.CSharp.NamingRules",
"SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter",
Justification = "Fields names must match the with the remote API.")]
[SuppressMessage("StyleCop.CSharp.NamingRules",
"SA1304:NonPrivateReadonlyFieldsMustBeginWithUpperCaseLetter",
Justification = "Fields names must match the with the remote API.")]
[SuppressMessage("StyleCop.CSharp.NamingRules",
"SA1310:FieldNamesMustNotContainUnderscore",
Justification = "Fields names must match the with the remote API.")]
public class RemoteMapData
{
public readonly string title;
@@ -46,7 +53,7 @@ namespace OpenRA
public class MapPreview
{
static readonly List<CPos> NoSpawns = new List<CPos>();
static readonly CPos[] NoSpawns = new CPos[] { };
MapCache cache;
public readonly string Uid;
@@ -54,12 +61,13 @@ namespace OpenRA
public string Type { get; private set; }
public string Author { get; private set; }
public int PlayerCount { get; private set; }
public List<CPos> SpawnPoints { get; private set; }
public CPos[] SpawnPoints { get; private set; }
public Rectangle Bounds { get; private set; }
public Bitmap CustomPreview { get; private set; }
public Map Map { get; private set; }
public MapStatus Status { get; private set; }
public MapClassification Class { get; private set; }
public bool SuitableForInitialMap { get; private set; }
public MapRuleStatus RuleStatus { get; private set; }
@@ -110,12 +118,36 @@ namespace OpenRA
Type = m.Type;
Type = m.Type;
Author = m.Author;
PlayerCount = m.Players.Count(x => x.Value.Playable);
Bounds = m.Bounds;
SpawnPoints = m.GetSpawnPoints().ToList();
SpawnPoints = m.SpawnPoints.Value;
CustomPreview = m.CustomPreview;
Status = MapStatus.Available;
Class = classification;
var players = new MapPlayers(m.PlayerDefinitions).Players;
PlayerCount = players.Count(x => x.Value.Playable);
SuitableForInitialMap = EvaluateUserFriendliness(players);
}
bool EvaluateUserFriendliness(Dictionary<string, PlayerReference> players)
{
if (Status != MapStatus.Available || !Map.Visibility.HasFlag(MapVisibility.Lobby))
return false;
// Other map types may have confusing settings or gameplay
if (Type != "Conquest")
return false;
// Maps with bots disabled confuse new players
if (players.Any(x => !x.Value.AllowBots))
return false;
// Large maps expose unfortunate performance problems
if (Bounds.Width > 128 || Bounds.Height > 128)
return false;
return true;
}
public void UpdateRemoteSearch(MapStatus status, MiniYaml yaml)
@@ -143,9 +175,9 @@ namespace OpenRA
PlayerCount = r.players;
Bounds = r.bounds;
var spawns = new List<CPos>();
var spawns = new CPos[r.spawnpoints.Length / 2];
for (var j = 0; j < r.spawnpoints.Length; j += 2)
spawns.Add(new CPos(r.spawnpoints[j], r.spawnpoints[j + 1]));
spawns[j / 2] = new CPos(r.spawnpoints[j], r.spawnpoints[j + 1]);
SpawnPoints = spawns;
CustomPreview = new Bitmap(new MemoryStream(Convert.FromBase64String(r.minimap)));
@@ -242,5 +274,11 @@ namespace OpenRA
Map.PreloadRules();
RuleStatus = Map.InvalidCustomRules ? MapRuleStatus.Invalid : MapRuleStatus.Cached;
}
public void Invalidate()
{
Status = MapStatus.Unavailable;
RuleStatus = MapRuleStatus.Unknown;
}
}
}

View File

@@ -1,31 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA
{
public struct SmudgeReference
{
public readonly string Type;
public readonly int2 Location;
public readonly int Depth;
public SmudgeReference(string type, int2 location, int depth)
{
Type = type;
Location = location;
Depth = depth;
}
public override string ToString()
{
return "{0} {1},{2} {3}".F(Type, Location.X, Location.Y, Depth);
}
}
}

View File

@@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Primitives;
namespace OpenRA
{
@@ -24,11 +25,29 @@ namespace OpenRA
public readonly Color LeftColor;
public readonly Color RightColor;
public MiniYaml Save() { return FieldSaver.Save(this); }
public MiniYaml Save(TileSet tileSet)
{
var root = new List<MiniYamlNode>();
if (Height != 0)
root.Add(FieldSaver.SaveField(this, "Height"));
if (RampType != 0)
root.Add(FieldSaver.SaveField(this, "RampType"));
if (LeftColor != tileSet.TerrainInfo[TerrainType].Color)
root.Add(FieldSaver.SaveField(this, "LeftColor"));
if (RightColor != tileSet.TerrainInfo[TerrainType].Color)
root.Add(FieldSaver.SaveField(this, "RightColor"));
return new MiniYaml(tileSet.TerrainInfo[TerrainType].Type, root);
}
}
public class TerrainTypeInfo
{
static readonly TerrainTypeInfo Default = new TerrainTypeInfo();
public readonly string Type;
public readonly string[] TargetTypes = { };
public readonly string[] AcceptsSmudgeType = { };
@@ -36,18 +55,20 @@ namespace OpenRA
public readonly Color Color;
public readonly string CustomCursor;
public TerrainTypeInfo() { }
// Private default ctor for serialization comparison
TerrainTypeInfo() { }
public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); }
public MiniYaml Save() { return FieldSaver.Save(this); }
public MiniYaml Save() { return FieldSaver.SaveDifferences(this, Default); }
}
public class TerrainTemplateInfo
{
static readonly string[] Fields = { "Id", "Image", "Frames", "Size", "PickAny", "Category" };
static readonly TerrainTemplateInfo Default = new TerrainTemplateInfo(0, new string[] { null }, int2.Zero, null);
public readonly ushort Id;
public readonly string Image;
public readonly string[] Images;
public readonly int[] Frames;
public readonly int2 Size;
public readonly bool PickAny;
@@ -55,10 +76,10 @@ namespace OpenRA
TerrainTileInfo[] tileInfo;
public TerrainTemplateInfo(ushort id, string image, int2 size, byte[] tiles)
public TerrainTemplateInfo(ushort id, string[] images, int2 size, byte[] tiles)
{
this.Id = id;
this.Image = image;
this.Images = images;
this.Size = size;
}
@@ -129,45 +150,44 @@ namespace OpenRA
public MiniYaml Save(TileSet tileSet)
{
var root = new List<MiniYamlNode>();
foreach (var field in Fields)
{
var f = this.GetType().GetField(field);
if (f.GetValue(this) == null)
continue;
var root = FieldSaver.SaveDifferences(this, Default);
root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f)));
}
var tileYaml = tileInfo
.Select((ti, i) => Pair.New(i.ToString(), ti))
.Where(t => t.Second != null)
.Select(t => new MiniYamlNode(t.First, t.Second.Save(tileSet)))
.ToList();
root.Add(new MiniYamlNode("Tiles", null,
tileInfo.Select((terrainTypeIndex, templateIndex) => new MiniYamlNode(templateIndex.ToString(), terrainTypeIndex.Save())).ToList()));
root.Nodes.Add(new MiniYamlNode("Tiles", null, tileYaml));
return new MiniYaml(null, root);
return root;
}
}
public class TileSet
{
static readonly string[] Fields = { "Name", "Id", "SheetSize", "Palette", "PlayerPalette", "Extensions", "WaterPaletteRotationBase", "EditorTemplateOrder", "IgnoreTileSpriteOffsets", "MaximumHeight" };
public readonly string Name;
public readonly string Id;
public readonly int SheetSize = 512;
public readonly string Palette;
public readonly string PlayerPalette;
public readonly string[] Extensions;
public readonly int WaterPaletteRotationBase = 0x60;
public readonly byte MaxGroundHeight = 0;
public readonly Color[] HeightDebugColors = new[] { Color.Red };
public readonly string[] EditorTemplateOrder;
public readonly bool IgnoreTileSpriteOffsets;
[FieldLoader.Ignore]
public readonly Dictionary<ushort, TerrainTemplateInfo> Templates = new Dictionary<ushort, TerrainTemplateInfo>();
[FieldLoader.Ignore]
public readonly TerrainTypeInfo[] TerrainInfo;
readonly Dictionary<string, byte> terrainIndexByType = new Dictionary<string, byte>();
readonly byte defaultWalkableTerrainIndex;
// Private default ctor for serialization comparison
TileSet() { }
public TileSet(ModData modData, string filepath)
{
var yaml = MiniYaml.DictFromFile(filepath);
@@ -201,12 +221,11 @@ namespace OpenRA
.Select(y => new TerrainTemplateInfo(this, y)).ToDictionary(t => t.Id);
}
public TileSet(string name, string id, string palette, string[] extensions, TerrainTypeInfo[] terrainInfo)
public TileSet(string name, string id, string palette, TerrainTypeInfo[] terrainInfo)
{
Name = name;
Id = id;
Palette = palette;
Extensions = extensions;
TerrainInfo = terrainInfo;
if (TerrainInfo.Length >= byte.MaxValue)
@@ -245,7 +264,9 @@ namespace OpenRA
public byte GetTerrainIndex(TerrainTile r)
{
var tpl = Templates[r.Type];
TerrainTemplateInfo tpl;
if (!Templates.TryGetValue(r.Type, out tpl))
return defaultWalkableTerrainIndex;
if (tpl.Contains(r.Index))
{
@@ -259,25 +280,17 @@ namespace OpenRA
public TerrainTileInfo GetTileInfo(TerrainTile r)
{
var tpl = Templates[r.Type];
TerrainTemplateInfo tpl;
if (!Templates.TryGetValue(r.Type, out tpl))
return null;
return tpl.Contains(r.Index) ? tpl[r.Index] : null;
}
public void Save(string filepath)
{
var root = new List<MiniYamlNode>();
var gen = new List<MiniYamlNode>();
foreach (var field in Fields)
{
var f = this.GetType().GetField(field);
if (f.GetValue(this) == null)
continue;
gen.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f)));
}
root.Add(new MiniYamlNode("General", null, gen));
root.Add(new MiniYamlNode("General", FieldSaver.SaveDifferences(this, new TileSet())));
root.Add(new MiniYamlNode("Terrain", null,
TerrainInfo.Select(t => new MiniYamlNode("TerrainType@{0}".F(t.Type), t.Save())).ToList()));

105
OpenRA.Game/MiniYaml.cs Executable file → Normal file
View File

@@ -83,9 +83,9 @@ namespace OpenRA
public class MiniYaml
{
const int SpacesPerLevel = 4;
static readonly Func<string, string> StringIdentity = s => s;
static readonly Func<MiniYaml, MiniYaml> MiniYamlIdentity = my => my;
public string Value;
public List<MiniYamlNode> Nodes;
@@ -154,13 +154,45 @@ namespace OpenRA
{
var line = ll;
++lineNo;
var commentIndex = line.IndexOf('#');
if (commentIndex != -1)
line = line.Substring(0, commentIndex).TrimEnd(' ', '\t');
var t = line.TrimStart(' ', '\t');
if (line.Length == 0)
continue;
var cp = 0;
var level = 0;
var spaces = 0;
var textStart = false;
var c = line[cp];
while (!(c == '\n' || c == '\r') && cp < line.Length && !textStart)
{
c = line[cp];
switch (c)
{
case ' ':
spaces++;
if (spaces >= SpacesPerLevel)
{
spaces = 0;
level++;
}
cp++;
break;
case '\t':
level++;
cp++;
break;
default:
textStart = true;
break;
}
}
var t = line.Substring(cp);
if (t.Length == 0)
continue;
var level = line.Length - t.Length;
var location = new MiniYamlNode.SourceLocation { Filename = filename, Line = lineNo };
if (levels.Count <= level)
@@ -211,28 +243,28 @@ namespace OpenRA
return FromLines(File.ReadAllLines(path), path);
}
public static List<MiniYamlNode> FromStream(Stream s)
public static List<MiniYamlNode> FromStream(Stream s, string fileName = "<no filename available>")
{
using (var reader = new StreamReader(s))
return FromString(reader.ReadToEnd());
return FromString(reader.ReadToEnd(), fileName);
}
public static List<MiniYamlNode> FromString(string text)
public static List<MiniYamlNode> FromString(string text, string fileName = "<no filename available>")
{
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), "<no filename available>");
}
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, false);
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), fileName);
}
public static List<MiniYamlNode> MergeStrict(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, false);
}
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, true);
}
static List<MiniYamlNode> Merge(List<MiniYamlNode> a, List<MiniYamlNode> b, bool throwErrors)
static List<MiniYamlNode> Merge(List<MiniYamlNode> a, List<MiniYamlNode> b, bool allowUnresolvedRemoves = false)
{
if (a.Count == 0)
return b;
@@ -243,10 +275,11 @@ namespace OpenRA
var dictA = a.ToDictionaryWithConflictLog(x => x.Key, "MiniYaml.Merge", null, x => "{0} (at {1})".F(x.Key, x.Location));
var dictB = b.ToDictionaryWithConflictLog(x => x.Key, "MiniYaml.Merge", null, x => "{0} (at {1})".F(x.Key, x.Location));
var keys = dictA.Keys.Union(dictB.Keys).ToList();
var allKeys = dictA.Keys.Union(dictB.Keys);
var noInherit = keys.Where(x => x.Length > 0 && x[0] == '-')
.ToDictionary(x => x.Substring(1), x => false);
var keys = allKeys.Where(x => x.Length == 0 || x[0] != '-').ToList();
var removeKeys = allKeys.Where(x => x.Length > 0 && x[0] == '-')
.Select(k => k.Substring(1)).ToHashSet();
foreach (var key in keys)
{
@@ -254,47 +287,55 @@ namespace OpenRA
dictA.TryGetValue(key, out aa);
dictB.TryGetValue(key, out bb);
if (noInherit.ContainsKey(key))
{
if (!throwErrors)
if (aa != null)
ret.Add(aa);
noInherit[key] = true;
}
if (removeKeys.Contains(key))
removeKeys.Remove(key);
else
{
var loc = aa == null ? default(MiniYamlNode.SourceLocation) : aa.Location;
var merged = (aa == null || bb == null) ? aa ?? bb : new MiniYamlNode(key, Merge(aa.Value, bb.Value, throwErrors), loc);
var merged = (aa == null || bb == null) ? aa ?? bb : new MiniYamlNode(key, Merge(aa.Value, bb.Value, allowUnresolvedRemoves), loc);
ret.Add(merged);
}
}
if (throwErrors && noInherit.ContainsValue(false))
throw new YamlException("Bogus yaml removals: {0}".F(
noInherit.Where(x => !x.Value).JoinWith(", ")));
if (removeKeys.Any())
{
if (allowUnresolvedRemoves)
{
// Add the removal nodes back for the next pass to deal with
foreach (var k in removeKeys)
{
var key = "-" + k;
MiniYamlNode rem;
if (!dictA.TryGetValue(key, out rem))
rem = dictB[key];
ret.Add(rem);
}
}
else
throw new YamlException("Bogus yaml removals: {0}".F(removeKeys.JoinWith(", ")));
}
return ret;
}
public static MiniYaml MergeLiberal(MiniYaml a, MiniYaml b)
{
return Merge(a, b, false);
return Merge(a, b, true);
}
public static MiniYaml MergeStrict(MiniYaml a, MiniYaml b)
{
return Merge(a, b, true);
return Merge(a, b, false);
}
static MiniYaml Merge(MiniYaml a, MiniYaml b, bool throwErrors)
static MiniYaml Merge(MiniYaml a, MiniYaml b, bool allowUnresolvedRemoves)
{
if (a == null)
return b;
if (b == null)
return a;
return new MiniYaml(a.Value ?? b.Value, Merge(a.Nodes, b.Nodes, throwErrors));
return new MiniYaml(a.Value ?? b.Value, Merge(a.Nodes, b.Nodes, allowUnresolvedRemoves));
}
public IEnumerable<string> ToLines(string name)

View File

@@ -25,6 +25,7 @@ namespace OpenRA
public readonly WidgetLoader WidgetLoader;
public readonly MapCache MapCache;
public readonly ISpriteLoader[] SpriteLoaders;
public readonly ISpriteSequenceLoader SpriteSequenceLoader;
public readonly RulesetCache RulesetCache;
public ILoadScreen LoadScreen { get; private set; }
public VoxelLoader VoxelLoader { get; private set; }
@@ -38,6 +39,8 @@ namespace OpenRA
Languages = new string[0];
Manifest = new Manifest(mod);
ObjectCreator = new ObjectCreator(Manifest);
Manifest.LoadCustomData(ObjectCreator);
if (useLoadScreen)
{
LoadScreen = ObjectCreator.CreateObject<ILoadScreen>(Manifest.LoadScreen.Value);
@@ -50,17 +53,26 @@ namespace OpenRA
RulesetCache.LoadingProgress += HandleLoadingProgress;
MapCache = new MapCache(this);
var loaders = new List<ISpriteLoader>();
var spriteLoaders = new List<ISpriteLoader>();
foreach (var format in Manifest.SpriteFormats)
{
var loader = ObjectCreator.FindType(format + "Loader");
if (loader == null || !loader.GetInterfaces().Contains(typeof(ISpriteLoader)))
throw new InvalidOperationException("Unable to find a sprite loader for type '{0}'.".F(format));
loaders.Add((ISpriteLoader)ObjectCreator.CreateBasic(loader));
spriteLoaders.Add((ISpriteLoader)ObjectCreator.CreateBasic(loader));
}
SpriteLoaders = loaders.ToArray();
SpriteLoaders = spriteLoaders.ToArray();
var sequenceFormat = Manifest.Get<SpriteSequenceFormat>();
var sequenceLoader = ObjectCreator.FindType(sequenceFormat.Type + "Loader");
var ctor = sequenceLoader != null ? sequenceLoader.GetConstructor(new[] { typeof(ModData) }) : null;
if (sequenceLoader == null || !sequenceLoader.GetInterfaces().Contains(typeof(ISpriteSequenceLoader)) || ctor == null)
throw new InvalidOperationException("Unable to find a sequence loader for type '{0}'.".F(sequenceFormat.Type));
SpriteSequenceLoader = (ISpriteSequenceLoader)ctor.Invoke(new[] { this });
SpriteSequenceLoader.OnMissingSpriteError = s => Log.Write("debug", s);
// HACK: Mount only local folders so we have a half-working environment for the asset installer
GlobalFileSystem.UnmountAll();
@@ -104,7 +116,6 @@ namespace OpenRA
if (!Manifest.Translations.Any())
{
Languages = new string[0];
FieldLoader.Translations = new Dictionary<string, string>();
return;
}
@@ -132,7 +143,7 @@ namespace OpenRA
translations.Add(tkv.Key, tkv.Value);
}
FieldLoader.Translations = translations;
FieldLoader.SetTranslations(translations);
}
public Map PrepareMap(string uid)

View File

@@ -23,6 +23,7 @@ namespace OpenRA
public string Description;
public string Version;
public string Author;
public bool Hidden;
static Dictionary<string, ModMetadata> ValidateMods()
{

View File

@@ -0,0 +1,52 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.GZip;
using MaxMind.GeoIP2;
namespace OpenRA.Network
{
public class GeoIP
{
static DatabaseReader database;
public static void Initialize()
{
try
{
using (var fileStream = new FileStream("GeoLite2-Country.mmdb.gz", FileMode.Open, FileAccess.Read))
using (var gzipStream = new GZipInputStream(fileStream))
database = new DatabaseReader(gzipStream);
}
catch (Exception e)
{
Log.Write("geoip", "DatabaseReader failed: {0}", e);
}
}
public static string LookupCountry(string ip)
{
const string Unknown = "Unknown Location";
try
{
return database.Country(ip).Country.Name ?? Unknown;
}
catch (Exception e)
{
Log.Write("geoip", "LookupCountry failed: {0}", e);
return Unknown;
}
}
}
}

View File

@@ -195,7 +195,7 @@ namespace OpenRA
switch (OrderString)
{
/*
/*
* Format:
* u8: orderID.
* 0xFF: Full serialized order.

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Network
var id = -1;
while (file == null)
{
var fullFilename = Path.Combine(dir, id < 0 ? "{0}.rep".F(filename) : "{0}-{1}.rep".F(filename, id));
var fullFilename = Path.Combine(dir, id < 0 ? "{0}.orarep".F(filename) : "{0}-{1}.orarep".F(filename, id));
id++;
try
{

View File

@@ -102,7 +102,7 @@ namespace OpenRA.Network
public int Index;
public HSLColor PreferredColor; // Color that the client normally uses from settings.yaml.
public HSLColor Color; // Actual color that the client is using. Usually the same as PreferredColor but can be different on maps with locked colors.
public string Country;
public string Race;
public int SpawnPoint;
public string Name;
public string IpAddress;

View File

@@ -44,7 +44,8 @@ namespace OpenRA.Network
if (NatDevice == null || NatDevice.GetType() != typeof(Mono.Nat.Upnp.UpnpNatDevice))
{
Log.Write("server", "No NAT devices with UPnP enabled found within {0} ms deadline. Disabling automatic port forwarding.".F(Game.Settings.Server.NatDiscoveryTimeout));
Log.Write("server",
"No NAT devices with UPnP enabled found within {0} ms deadline. Disabling automatic port forwarding.".F(Game.Settings.Server.NatDiscoveryTimeout));
Game.Settings.Server.NatDeviceAvailable = false;
Game.Settings.Server.AllowPortForward = false;
}

View File

@@ -44,6 +44,10 @@ namespace OpenRA.Network
var player = world != null ? world.FindPlayerByClient(client) : null;
var suffix = (player != null && player.WinState == WinState.Lost) ? " (Dead)" : "";
suffix = client.IsObserver ? " (Spectator)" : suffix;
if (orderManager.LocalClient != null && client != orderManager.LocalClient && client.Team > 0 && client.Team == orderManager.LocalClient.Team)
suffix += " (Ally)";
Game.AddChatLine(client.Color.RGB, client.Name + suffix, order.TargetString);
}
else
@@ -154,7 +158,7 @@ namespace OpenRA.Network
Name = Game.Settings.Player.Name,
PreferredColor = Game.Settings.Player.Color,
Color = Game.Settings.Player.Color,
Country = "random",
Race = "Random",
SpawnPoint = 0,
Team = 0,
State = Session.ClientState.Invalid
@@ -293,8 +297,7 @@ namespace OpenRA.Network
if (!order.IsImmediate)
{
var self = order.Subject;
var health = self.TraitOrDefault<Health>();
if (health == null || !health.IsDead)
if (!self.IsDead)
foreach (var t in self.TraitsImplementing<IResolveOrder>())
t.ResolveOrder(self, order);
}

View File

@@ -10,7 +10,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.Primitives;

View File

@@ -45,38 +45,36 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
<Reference Include="SharpFont">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\SharpFont.dll</HintPath>
<HintPath>..\thirdparty\download\SharpFont.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Nat">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
<Package>mono.nat</Package>
<HintPath>..\thirdparty\Mono.Nat.dll</HintPath>
<HintPath>..\thirdparty\download\Mono.Nat.dll</HintPath>
</Reference>
<Reference Include="Eluant">
<HintPath>..\thirdparty\Eluant.dll</HintPath>
<HintPath>..\thirdparty\download\Eluant.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\thirdparty\ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>..\thirdparty\download\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MaxMind.GeoIP2">
<HintPath>..\thirdparty\MaxMind.GeoIP2.dll</HintPath>
<HintPath>..\thirdparty\download\MaxMind.GeoIP2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MaxMind.Db">
<HintPath>..\thirdparty\MaxMind.Db.dll</HintPath>
<HintPath>..\thirdparty\download\MaxMind.Db.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SDL2-CS">
<HintPath>..\thirdparty\SDL2-CS.dll</HintPath>
<HintPath>..\thirdparty\download\SDL2-CS.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
@@ -84,10 +82,17 @@
<Compile Include="Activities\Activity.cs" />
<Compile Include="Activities\CallFunc.cs" />
<Compile Include="Actor.cs" />
<Compile Include="CacheStorage.cs" />
<Compile Include="FileSystem\IdxEntry.cs" />
<Compile Include="LogProxy.cs" />
<Compile Include="FileFormats\IdxReader.cs" />
<Compile Include="FileSystem\BagFile.cs" />
<Compile Include="Map\MapPlayers.cs" />
<Compile Include="MPos.cs" />
<Compile Include="GameRules\Warhead.cs" />
<Compile Include="Graphics\QuadRenderer.cs" />
<Compile Include="Download.cs" />
<Compile Include="Effects\AsyncAction.cs" />
<Compile Include="Effects\DelayedAction.cs" />
<Compile Include="Effects\FlashTarget.cs" />
<Compile Include="Effects\IEffect.cs" />
@@ -106,7 +111,6 @@
<Compile Include="Graphics\MappedImage.cs" />
<Compile Include="Graphics\Minimap.cs" />
<Compile Include="Graphics\Renderer.cs" />
<Compile Include="Graphics\Sequence.cs" />
<Compile Include="Graphics\SequenceProvider.cs" />
<Compile Include="Graphics\Sheet.cs" />
<Compile Include="Graphics\SheetBuilder.cs" />
@@ -124,6 +128,7 @@
<Compile Include="Network\Connection.cs" />
<Compile Include="Network\FrameData.cs" />
<Compile Include="Network\GameServer.cs" />
<Compile Include="Network\GeoIP.cs" />
<Compile Include="Network\Handshake.cs" />
<Compile Include="Network\Order.cs" />
<Compile Include="Network\OrderIO.cs" />
@@ -137,6 +142,9 @@
<Compile Include="Orders\IOrderGenerator.cs" />
<Compile Include="Orders\UnitOrderGenerator.cs" />
<Compile Include="Player.cs" />
<Compile Include="Primitives\MergedStream.cs" />
<Compile Include="Primitives\SpatiallyPartitioned.cs" />
<Compile Include="Primitives\ConcurrentCache.cs" />
<Compile Include="Selection.cs" />
<Compile Include="Server\Connection.cs" />
<Compile Include="Server\Exts.cs" />
@@ -170,38 +178,12 @@
<Compile Include="Traits\World\ResourceType.cs" />
<Compile Include="Traits\World\ScreenShaker.cs" />
<Compile Include="Traits\World\Shroud.cs" />
<Compile Include="Widgets\BackgroundWidget.cs" />
<Compile Include="Widgets\ButtonWidget.cs" />
<Compile Include="Widgets\ChatDisplayWidget.cs" />
<Compile Include="Widgets\CheckboxWidget.cs" />
<Compile Include="Widgets\ChromeMetrics.cs" />
<Compile Include="Widgets\ColorBlockWidget.cs" />
<Compile Include="Widgets\DropDownButtonWidget.cs" />
<Compile Include="Widgets\GridLayout.cs" />
<Compile Include="Widgets\ImageWidget.cs" />
<Compile Include="Widgets\LabelWidget.cs" />
<Compile Include="Widgets\LineGraphWidget.cs" />
<Compile Include="Widgets\ListLayout.cs" />
<Compile Include="Widgets\MapPreviewWidget.cs" />
<Compile Include="Widgets\PasswordFieldWidget.cs" />
<Compile Include="Widgets\PerfGraphWidget.cs" />
<Compile Include="Widgets\ProgressBarWidget.cs" />
<Compile Include="Widgets\ScrollItemWidget.cs" />
<Compile Include="Widgets\ScrollPanelWidget.cs" />
<Compile Include="Widgets\SliderWidget.cs" />
<Compile Include="Widgets\TextFieldWidget.cs" />
<Compile Include="Widgets\VqaPlayerWidget.cs" />
<Compile Include="Widgets\Widget.cs" />
<Compile Include="Widgets\WidgetLoader.cs" />
<Compile Include="Widgets\WidgetUtils.cs" />
<Compile Include="Widgets\WorldInteractionControllerWidget.cs" />
<Compile Include="World.cs" />
<Compile Include="WorldUtils.cs" />
<Compile Include="VoiceExts.cs" />
<Compile Include="Network\ReplayRecorderConnection.cs" />
<Compile Include="Widgets\TooltipContainerWidget.cs" />
<Compile Include="Traits\DebugPauseState.cs" />
<Compile Include="Network\UPnP.cs" />
<Compile Include="Widgets\ClientTooltipRegionWidget.cs" />
<Compile Include="Graphics\Renderable.cs" />
<Compile Include="Graphics\Voxel.cs" />
<Compile Include="Graphics\VoxelRenderer.cs" />
@@ -209,17 +191,12 @@
<Compile Include="Graphics\VoxelProvider.cs" />
<Compile Include="Traits\BodyOrientation.cs" />
<Compile Include="Graphics\VoxelAnimation.cs" />
<Compile Include="Widgets\ViewportControllerWidget.cs" />
<Compile Include="Traits\Player\FrozenActorLayer.cs" />
<Compile Include="Graphics\Theater.cs" />
<Compile Include="Traits\Player\PlayerColorPalette.cs" />
<Compile Include="Traits\Player\PlayerHighlightPalette.cs" />
<Compile Include="Traits\World\ScreenMap.cs" />
<Compile Include="Traits\World\ActorMap.cs" />
<Compile Include="Widgets\HotkeyEntryWidget.cs" />
<Compile Include="Widgets\SpriteWidget.cs" />
<Compile Include="Widgets\SpriteSequenceWidget.cs" />
<Compile Include="Widgets\RGBASpriteWidget.cs" />
<Compile Include="Scripting\ScriptContext.cs" />
<Compile Include="Scripting\ScriptActorInterface.cs" />
<Compile Include="Scripting\ScriptObjectWrapper.cs" />
@@ -235,7 +212,6 @@
<Compile Include="GameRules\RulesetCache.cs" />
<Compile Include="Support\MersenneTwister.cs" />
<Compile Include="GameInformation.cs" />
<Compile Include="Widgets\RootWidget.cs" />
<Compile Include="Map\CellLayer.cs" />
<Compile Include="Map\CellRegion.cs" />
<Compile Include="Input\IInputHandler.cs" />
@@ -257,6 +233,14 @@
<Compile Include="Graphics\HardwareCursor.cs" />
<Compile Include="Support\PerfItem.cs" />
<Compile Include="Support\PerfSample.cs" />
<Compile Include="Graphics\SpriteRenderable.cs" />
<Compile Include="Widgets\Widget.cs" />
<Compile Include="Widgets\RootWidget.cs" />
<Compile Include="Widgets\WidgetLoader.cs" />
<Compile Include="Widgets\ChromeMetrics.cs" />
<Compile Include="Widgets\WidgetUtils.cs" />
<Compile Include="Widgets\WorldInteractionControllerWidget.cs" />
<Compile Include="Graphics\PaletteReference.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="FileSystem\D2kSoundResources.cs" />
@@ -267,12 +251,10 @@
<Compile Include="FileSystem\ZipFile.cs" />
<Compile Include="FileSystem\BigFile.cs" />
<Compile Include="Map\PlayerReference.cs" />
<Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\TileReference.cs" />
<Compile Include="Map\TileSet.cs" />
<Compile Include="FieldLoader.cs" />
<Compile Include="FieldSaver.cs" />
<Compile Include="InstallUtils.cs" />
<Compile Include="Manifest.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="FileFormats\ImaAdpcmLoader.cs" />

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Orders
var orders = world.Selection.Actors
.Select(a => OrderForUnit(a, target, mi))
.Where(o => o != null)
.ToArray();
.ToList();
var actorsInvolved = orders.Select(o => o.Actor).Distinct();
if (actorsInvolved.Any())
@@ -79,13 +79,27 @@ namespace OpenRA.Orders
target = frozen != null ? Target.FromFrozenActor(frozen) : Target.FromCell(world, xy);
}
var orders = world.Selection.Actors
var ordersWithCursor = world.Selection.Actors
.Select(a => OrderForUnit(a, target, mi))
.Where(o => o != null)
.ToArray();
.Where(o => o != null && o.Cursor != null);
var cursorName = orders.Select(o => o.Cursor).FirstOrDefault();
return cursorName ?? (useSelect ? "select" : "default");
var cursorOrder = ordersWithCursor.MaxByOrDefault(o => o.Order.OrderPriority);
return cursorOrder != null ? cursorOrder.Cursor : (useSelect ? "select" : "default");
}
// Used for classic mouse orders, determines whether or not action at xy is move or select
public static bool InputOverridesSelection(World world, int2 xy, MouseInput mi)
{
var target = Target.FromActor(world.ScreenMap.ActorsAt(xy).WithHighestSelectionPriority());
var underCursor = world.Selection.Actors.WithHighestSelectionPriority();
var o = OrderForUnit(underCursor, target, mi);
if (o != null && o.Order.OverrideSelection)
return false;
return true;
}
static UnitOrderResult OrderForUnit(Actor self, Target target, MouseInput mi)
@@ -96,7 +110,7 @@ namespace OpenRA.Orders
if (self.Destroyed || !target.IsValidFor(self))
return null;
if (mi.Button == MouseButton.Right)
if (mi.Button == Game.Settings.Game.MouseButtonPreference.Action)
{
foreach (var o in self.TraitsImplementing<IIssueOrder>()
.SelectMany(trait => trait.Orders

Some files were not shown because too many files have changed in this diff Show More