Compare commits

...

2173 Commits

Author SHA1 Message Date
reaperrr
5d1d6d6d08 Merge pull request #6576 from pchote/armaments
Allow armaments to be enabled/disabled by upgrades.
2014-09-27 14:08:07 +02:00
Matthias Mailänder
71a872c53c Merge pull request #6553 from Phrohdoh/TSGridFixes
More TS art offset fixes.
2014-09-27 13:36:59 +02:00
reaperrr
477d7894a0 Merge pull request #6569 from jacobdufault/add-author
Update AUTHORS
2014-09-27 13:32:27 +02:00
obrakmann
be44b20797 Merge pull request #6577 from pchote/fix-validation
Don’t die when connecting to a full server.
2014-09-27 13:23:45 +02:00
reaperrr
ffeff5c7b6 Merge pull request #6575 from pchote/selfhealing
Add elite self-healing bonus
2014-09-27 13:19:24 +02:00
Paul Chote
3a64fd717f Merge pull request #6488 from jonathanmiles/support-power-targetability
AI no longer calls support power on things it can't target
2014-09-27 23:13:14 +12:00
Paul Chote
2bbdd0ae06 Add self-healing for elite units. 2014-09-27 22:14:45 +12:00
Paul Chote
372d03c320 Convert SelfHealing to upgrades. 2014-09-27 22:14:45 +12:00
Paul Chote
56332251f5 Don’t double-remove dead actors from the world. 2014-09-27 22:14:16 +12:00
Paul Chote
7042004af3 Don’t die when connecting to a full server. 2014-09-27 22:07:04 +12:00
Matthias Mailänder
82d3833d18 Merge pull request #6557 from abcdefg30/progbarcolors
Unhardcoded productionbar colors
2014-09-27 10:09:10 +02:00
Matthias Mailänder
d21c28310e Merge pull request #6568 from jacobdufault/remove-dead-settings
Remove an unused setting
2014-09-27 10:02:31 +02:00
Matthias Mailänder
15e5db855a Merge pull request #6573 from obrakmann/fix6572
Do not validate the color of players which have the LockColor flag set
2014-09-27 08:15:11 +02:00
Paul Chote
67e3c74d31 Allow armaments to be enabled/disabled by upgrades. 2014-09-27 14:59:15 +12:00
Oliver Brakmann
00dc6f1633 Do not validate the color of players which have the LockColor flag set
Fixes #6572
2014-09-27 01:43:02 +02:00
Jacob Dufault
ad98a831da Remove an unused setting 2014-09-26 17:38:36 -04:00
Jacob Dufault
7fe7284d99 Update AUTHORS 2014-09-26 17:37:42 -04:00
abcdefg30
22dc63620f Unhardcoded productionbar colors 2014-09-26 14:55:42 +02:00
Paul Chote
8d54efc7af Merge pull request #6555 from obrakmann/fix6547_global_chat
Add a chat cache
2014-09-26 23:18:49 +12:00
obrakmann
7bb89ba664 Merge pull request #6543 from s1ww/upgraded_gui
Upgrading player gui redux
2014-09-26 09:49:22 +02:00
Oliver Brakmann
36b5097fa0 Cache chat conversations in the lobby and in-game
This preserves the chat content from the lobby and makes it available
in-game, and also makes all chat content available to the end-game
dialog.
2014-09-26 07:18:33 +02:00
s1ww
b4705add88 Upgrading player gui 2014-09-26 07:02:15 +02:00
Oliver Brakmann
ef35ee2204 Load end-game dialog only after game ends, not already when it starts
This is to ensure that statistics reflect the state at the end of the
game, not that from the start of the game.

Fixes #6547.
2014-09-25 21:02:39 +02:00
Scott
47565c33be Merge pull request #6512 from pchote/more-color-validation
Include map-players in the color validation checks.
2014-09-25 17:09:09 +12:00
Matthias Mailänder
0428814fe5 Merge pull request #6477 from s1ww/bleed
Updating outdated maps
2014-09-25 06:53:35 +02:00
s1ww
8cba84d47d Reworked railmines for each tileset 2014-09-25 04:38:09 +02:00
Matthias Mailänder
a25248f4bd Merge pull request #6551 from LipkeGu/samsitefix
Adjusting the Offset for the Turret of "Nod SAM Site"
2014-09-24 21:30:02 +02:00
Matthias Mailänder
3d80f47d96 Merge pull request #6550 from pchote/more-bounds-fixes
More map-bounds fixes
2014-09-24 21:23:50 +02:00
Taryn Hill
2988c500c0 More TS art fixes. 2014-09-24 14:20:14 -05:00
LipkeGu
ee079fa01c Adjusting the Z-Offset for the turret of "Nod SAM Site" 2014-09-24 17:11:40 +02:00
Paul Chote
ee77db1831 Add some additional robustness against bogus cell queries in ActorMap. 2014-09-24 22:36:59 +12:00
Paul Chote
3c2383ebc6 Don’t crash if a warhead smudge extends outside the map. Fixes #6548. 2014-09-24 22:34:02 +12:00
Paul Chote
17702dc057 Merge pull request #6334 from Mailaender/parachute-out-of-map
Fixed a crash when parachutes were spawned outside of the map
2014-09-24 22:26:08 +12:00
Paul Chote
8a4e42995a Include map-players in the color validator. 2014-09-24 22:11:37 +12:00
Matthias Mailänder
d1b28ad93b Merge pull request #6549 from LipkeGu/bansheevoice
Assign the correct voice to the "Nod Banshee Fighter"
2014-09-24 06:42:02 +02:00
LipkeGu
8ac97f6297 Assign the correct voice to the "Nod Banshee Fighter" 2014-09-24 03:48:43 +02:00
Chris Forbes
71e79b172c Merge pull request #6542 from jacobdufault/minor-code-cleanup
Simplify GetCtor logic
2014-09-24 09:37:59 +12:00
Matthias Mailänder
c607aabc0b Merge pull request #6539 from LipkeGu/patch-2
Update cursors.yaml
2014-09-23 21:30:55 +02:00
Jacob Dufault
65763a643f Simplify GetCtor logic 2014-09-22 13:41:07 -04:00
LipkeGu
74dc01908e Update cursors.yaml
insert the "missing" space
2014-09-22 16:20:58 +02:00
Matthias Mailänder
b818fb5fe6 Merge pull request #6536 from steelphase-forks/common-modbrowser
Mod Chooser move.
2014-09-21 20:59:23 +02:00
steelphase
7199b6fd96 Mod Chooser move.
Moved code for mod chooser to mod.common.
2014-09-21 14:27:20 -04:00
Matthias Mailänder
57f42aeeef Merge pull request #6535 from huwpascoe/bleed
Added self to AUTHORS
2014-09-21 20:18:33 +02:00
huwpascoe
2ba38f7c56 Added self to AUTHORS 2014-09-21 17:13:38 +01:00
Matthias Mailänder
b30fcc2110 Merge pull request #6521 from steelphase-forks/common-graphics
Add Mod.Common Graphics
2014-09-21 12:05:28 +02:00
Matthias Mailänder
44d134afe0 don't update the actor map outside the map borders 2014-09-21 10:52:44 +02:00
Matthias Mailänder
3f66d310db never spawn parachutes outside the map
fixes #6302
2014-09-21 10:47:33 +02:00
Matthias Mailänder
f0e6eee7e1 Merge pull request #6526 from MatthijsBenschop/debug-crash-fix
Prevent player name from becoming part of a formatting string.
2014-09-21 10:21:11 +02:00
Matthias Mailänder
dc1710d7aa Merge pull request #6522 from obrakmann/fix6517_lobby_music_crash
Check world for null in MusicPlayerLogic to prevent crashing the lobby
2014-09-21 10:17:40 +02:00
Matthijs Benschop
534f6c5a33 Prevent player name from becoming part of a formatting string.
fixes #6524
2014-09-21 10:01:40 +02:00
Oliver Brakmann
52d74886bd Check world for null in MusicPlayerLogic to prevent crashing the lobby
Fixes #6517
2014-09-21 08:17:55 +02:00
steelphase
f948bf0d1b Add Mod.Common Graphics
Moved Graphics to Mod.Common
2014-09-21 01:34:35 -04:00
Matthias Mailänder
ded39d1933 Merge pull request #6519 from abcdefg30/trainingcamp
Repaired Trainingcamp map
2014-09-21 07:13:58 +02:00
Matthias Mailänder
f75f036de3 Merge pull request #6493 from pchote/utility-commands
Move utility commands into the mod assemblies.
2014-09-21 07:10:45 +02:00
Taryn Hill
4be8525852 Merge pull request #6527 from pchote/revert-6518
Revert "Polishing/normalizing new GUI"
2014-09-20 20:27:10 -05:00
Paul Chote
01c5af4046 Revert "Polishing/normalizing new GUI"
This reverts commit 5020c7a73e.
2014-09-21 12:59:04 +12:00
Paul Chote
a3acf2aaca Merge pull request #6516 from LipkeGu/patch-1
Make the TS Construction Yard selectable
2014-09-21 12:08:06 +12:00
Alexander Fast
08890b0994 Added IUtilityCommand and move default commands into Mods.Common. 2014-09-21 10:15:50 +12:00
Matthias Mailänder
ea11906938 Merge pull request #6518 from s1ww/player_gui
Polishing/normalizing new GUI
2014-09-20 20:12:14 +02:00
abcdefg30
698d57ed82 Made dog buildable at fort lonestar 2014-09-20 17:40:10 +02:00
abcdefg30
02adaea35d Fixed training camp map
Removed unused traits,
fixed prerequisites
and fixed two typos.
2014-09-20 17:40:09 +02:00
s1ww
5020c7a73e Polishing/normalizing new GUI 2014-09-20 17:18:42 +02:00
LipkeGu
dce744c51d Make the TS Construction Yard selectable
Increasing the size of the selection box to make the Construction Yard selectable.
2014-09-20 16:31:28 +02:00
Matthias Mailänder
bb21f8b5fa Merge pull request #6473 from obrakmann/fix6422
Add chat tab to end-game dialog
2014-09-20 14:45:47 +02:00
Paul Chote
ff7b3541f4 Remove obsolete —upgrade-map-v5 and --setings-value commands. 2014-09-21 00:25:53 +12:00
Matthias Mailänder
9ebb9209ad Merge pull request #6494 from obrakmann/objectives-fine-tuning
Objectives fine-tuning
2014-09-20 14:22:36 +02:00
Matthias Mailänder
9601f8b833 Merge pull request #6511 from steelphase-forks/bleed
Creation of Mods.Common.
2014-09-20 14:05:58 +02:00
obrakmann
6e349d3052 Merge pull request #6510 from pchote/fix-inaccuracy-crash
Move inaccuracy modifier queries outside the projectile ctors.
2014-09-20 12:24:57 +02:00
Oliver Brakmann
09bda8b709 Remove stats button from end-game dialog in mission-type maps
Still available for skirmish games and replays.
2014-09-20 12:17:53 +02:00
Oliver Brakmann
928ee9c625 Add a chat tab to end-game window
Fixes #6422
2014-09-20 12:17:53 +02:00
Paul Chote
caecf2d82a Move inaccuracy modifier queries outside the projectile ctors. Fixes #6449. 2014-09-20 21:43:00 +12:00
Paul Chote
5fb2475b3c Merge pull request #6505 from abcdefg30/beaconfix
Remove beacons when the badgers get shot down
2014-09-20 21:20:35 +12:00
Oliver Brakmann
1db6388bd4 Update existing maps 2014-09-20 10:42:40 +02:00
Oliver Brakmann
6f538e0180 Add more functions for objectives management to Lua API 2014-09-20 10:42:40 +02:00
abcdefg30
4f0b18a3dc Remove beacons when the badgers get shot down 2014-09-20 09:32:42 +02:00
Matthias Mailänder
f5a1122c6d Merge pull request #6513 from steelphase-forks/windows-dll-update
Fixes #6508
2014-09-20 09:24:45 +02:00
steelphase
35b7493641 Update third party Windows DLLs
http://kcat.strangesoft.net/openal-soft-1.16.0-bin.zip
2014-09-19 22:29:10 -04:00
steelphase
3a72153a3d Create Mods.Common
Create a small base for Mods.Common and update solution and makefile to use it
2014-09-19 22:05:45 -04:00
Paul Chote
83dd4db909 Merge pull request #6506 from abcdefg30/beaconcancel
Allow canceling beacons with right click
2014-09-20 08:34:12 +12:00
abcdefg30
c34719e597 Allow canceling beacons with right click 2014-09-19 13:36:17 +02:00
Oliver Brakmann
97ce246a27 Prevent already failed objectives from being marked as completed
The same change was not and must not be done in the reverse case. It
should be and is possible to mark an already completed objective as
failed.

Consider a case where a player is supposed to capture, but not destroy,
a building.  He captures it, the objective is complete.  However, later
in the game that building gets destroyed. In this case, the objective
should be changed to failed.
2014-09-18 18:32:52 +02:00
Paul Chote
6c399e50a8 Merge pull request #6492 from LipkeGu/patch-7
Added my Name "Guido Lipke" under Section "Thanks to"
2014-09-18 22:09:28 +12:00
LipkeGu
181f9cdea4 Added me to Thanks list :)
Added my Name "Guido Lipke" under Section "Thanks to"
2014-09-18 11:50:54 +02:00
Paul Chote
3b5751b181 Merge pull request #6467 from Mailaender/zeus-miss-unscale
Fixed a glitch at the tech center on map Zeus
2014-09-18 21:17:14 +12:00
Paul Chote
bd682ceebc Merge pull request #6489 from LipkeGu/patch-5
Added return values for "Timeout" and "DNS" Errors
2014-09-18 21:09:28 +12:00
Paul Chote
09fb31721d Merge pull request #6490 from LipkeGu/patch-6
[TS] Fix Shroud revealing on Structures (PROC, GALIGHT)
2014-09-18 21:07:12 +12:00
Paul Chote
dbba609cba Merge pull request #6487 from reaperrr/td-explo-cleanup
Removed obsolete legacy explosion sequences from TD mod
2014-09-18 21:03:17 +12:00
LipkeGu
be38c873bf PROC: Fix Shroud revealing use "6c0" instead of "6"
- PROC doesnt reveal shroud, because all Buildings have Xc0 as Value and PROC has only "6" instead of "6c0"
- GALIGHT (Civillian Light post): increase Shroud reveal from "0c0" up to "2c0"
2014-09-18 09:16:16 +02:00
LipkeGu
06f852070c Added return values for "Timeout" and "DNS" Errors
Added Return value for:
- WebExceptionStatus.NameResolutionFailure : "DNS lookup failed"
- case WebExceptionStatus.Timeout: "Connection timeout"
2014-09-18 00:07:11 +02:00
Chris Forbes
6ca6588798 Merge pull request #6471 from reaperrr/missile-lockon
Added functionality and descriptions to Missile projectile
2014-09-18 09:12:21 +12:00
reaperrr
e9d3397abd Removes obsolete legacy explosion sequences from TD mod. 2014-09-17 23:03:06 +02:00
jonathanmiles
b9867004cb AI no longer calls support power on things it can't target (e.g. cloaked stealth tanks) 2014-09-17 21:52:08 +01:00
Matthias Mailänder
843c139edd Merge pull request #6485 from LipkeGu/patch-3
Use the current selected terrain Palette from the selected Map.
2014-09-17 22:27:29 +02:00
LipkeGu
b956759480 Use the current selected terrain Palette from the selected Map.
Use the current selected terrain Palette from the defined Tileset in the Map. 
- The Tileset is defined in "map.yaml" at "Tileset:"
- The color palette is defined in the "<Tileset>.yaml" at "Palette:"
2014-09-17 22:12:22 +02:00
Matthias Mailänder
52610ab1d5 Merge pull request #6482 from LipkeGu/patch-1
Assign Audio files to the "NoBuild", "DisablePower", "EnablePower" and  "ReinforcementsArrived" events
2014-09-17 21:35:27 +02:00
LipkeGu
51d0d7c3b5 Update notifications.yaml
Assigned Audio files to Sound-Notification event:
- 00-i232 (Building offline) to DisablePower
- 00-i230 (Building online) to EnablePower 

Assigned Audio files to Speech-Notification event:
- 00-i064 (cannot comply, building in progress) to NoBuild:
- 00-i038 (Reinforcements have arrived) to ReinforcementsArrived:
2014-09-17 20:22:03 +02:00
reaperrr
3c6dc5650e Merge pull request #6462 from Mailaender/ts-silo
Added all the Tiberian Sun silo sequences
2014-09-17 19:29:29 +02:00
obrakmann
cbf4203525 Merge pull request #6479 from reaperrr/visc-death-fix
Disabled WithDeathAnimation for TS visceroids
2014-09-17 17:47:58 +02:00
obrakmann
b4beb0ff54 Merge pull request #6474 from jonathanmiles/fix-stealth-tank-cloak
Fix for stealth tanks needing cloak upgrade
2014-09-17 17:27:57 +02:00
reaperrr
5703539acd Disable WithDeathAnimation for TS visceroids.
Fixes #6476.
2014-09-17 12:57:59 +02:00
s1ww
b8d683a3bd poland-raid map file 2014-09-16 23:12:54 +02:00
s1ww
a17628b562 Updating outdated maps 2014-09-16 21:31:16 +02:00
reaperrr
3276db5f92 Use new missile features on TS Bazooka. 2014-09-16 16:14:15 +02:00
reaperrr
eb732572ba If we cache world anyway, might as well use it everywhere. 2014-09-16 16:14:14 +02:00
reaperrr
5cda0853b6 Adds LockOnProbability to missiles.
Turns CloseEnough from a hack into a feature.
Adds some descriptions.
Caches args.SourceActor.World.
2014-09-16 16:14:13 +02:00
jonathanmiles
b51df8a93c Fix for stealth tanks needing cloak upgrade 2014-09-15 22:52:26 +01:00
Matthias Mailänder
14709135d4 fix a syntax error 2014-09-14 17:05:39 +02:00
Matthias Mailänder
0e00bbe6e7 fix a bib rendering problem due to manual sprite scaling 2014-09-14 17:05:05 +02:00
Matthias Mailänder
01f83b8d4a Merge pull request #6463 from MatthijsBenschop/Apollo-map-tiles-fix
Tile misplacement in zeus and apollo map.
2014-09-14 16:59:21 +02:00
Matthias Mailänder
d4a3a3f97f setup all the silo sequences 2014-09-14 15:38:46 +02:00
Matthijs Benschop
fdc0f23bab Tile misplacement in zeus and apollo map.
Fixes #6443
2014-09-14 15:24:07 +02:00
Matthias Mailänder
6de603bc42 Merge pull request #6342 from Phrohdoh/TibSunAI
TS TestAI and more.
2014-09-14 15:23:15 +02:00
Taryn Hill
80ca506e74 Fix GAPOWR.
Fix PROC.
Add Guard/Guardable to ^Helicopter.
Add GASILO.
Add TS Test AI

^Building now has FrozenUnderFog.
2014-09-14 08:11:48 -05:00
Matthias Mailänder
204d9b0450 Merge pull request #6459 from reaperrr/ima-aud-style
Renamed AdpcmLoader to ImaAdpcmLoader
2014-09-14 14:12:07 +02:00
reaperrr
7589e010c3 Back-port some style fixes from ImaAdpcmLoader to AudLoader. 2014-09-14 13:32:37 +02:00
reaperrr
fec5eb178c Rename Adpcm to ImaAdpcm everywhere.
To avoid confusion with Microsoft ADPCM and other ADPCMs.
2014-09-14 13:27:46 +02:00
Matthias Mailänder
bf02d60e30 Merge pull request #6283 from reaperrr/sprite-barrel
Adds WithBarrel trait
2014-09-14 12:54:09 +02:00
Matthias Mailänder
c7c816f22e Merge pull request #6455 from reaperrr/blocksbullets
Renamed Wall to BlocksBullets
2014-09-14 12:51:44 +02:00
reaperrr
e8b9397e1a Update Bullet & Missile descriptions for Wall->BlocksBullets 2014-09-14 11:53:26 +02:00
Matthias Mailänder
53f926b792 Merge pull request #6442 from pchote/no-mission-replays
Closes #6210
2014-09-14 08:54:36 +02:00
Matthias Mailänder
960ca678e6 Merge pull request #6451 from reaperrr/td-civcap
Closes #4487
2014-09-14 08:49:49 +02:00
Matthias Mailänder
9ea3caccaa Merge pull request #6452 from pchote/more-osx-launcher
More OSX launcher tweaks
2014-09-14 08:47:05 +02:00
Matthias Mailänder
819ad44d93 Merge pull request #6453 from reaperrr/wda-followup
Follow-up to #6396 (WithDeathAnimation)
2014-09-14 08:43:51 +02:00
reaperrr
0116bf169a Upgrade rule for Wall -> BlocksBullets + Crushable transition 2014-09-14 01:33:49 +02:00
reaperrr
8c1ab03623 Wall -> Crushable + BlocksBullets yaml changes 2014-09-14 01:33:48 +02:00
reaperrr
60eae9f229 Replace Wall trait with BlocksBullets 2014-09-14 01:33:47 +02:00
reaperrr
4b94d964ca Adds WithBarrel trait. 2014-09-14 01:24:42 +02:00
reaperrr
c451b07c05 Fixes wrong palette for crushed death anim. 2014-09-14 01:03:37 +02:00
Paul Chote
eab8e2e6e2 Merge pull request #6396 from reaperrr/with-deathanim
Added WithDeathAnimation
2014-09-14 10:37:07 +12:00
Paul Chote
59a7351cdd More OSX launcher tweaks:
* Require a framework install of Mono, as our .config files reference dylibs installed to the frameworks dir.
* Bump the minimum Mono version to 3.2, which included the SGen GC.
* Update download link for the new mono website.
* Reference the MRE package to reduce potential confusion.
2014-09-14 10:18:52 +12:00
Matthias Mailänder
054cdf13c0 Merge pull request #6450 from obrakmann/fix6444
Prevent a NullReferenceException in GameInfoStatsLogic
2014-09-13 18:52:56 +02:00
reaperrr
1b19ac09aa Adds "Civilian building captured" notification to TD. 2014-09-13 18:35:49 +02:00
reaperrr
f0705f532b Remove duplicate death sequences from dinos and ants.
Fixes stegosaur death anim palette (no longer shows team color).
2014-09-13 17:22:28 +02:00
reaperrr
46bc3418ea InfDeath -> DeathType upgrade rule fix 2014-09-13 17:21:31 +02:00
reaperrr
1b2ae9b4d4 Upgrade rules for WithDeathAnimation and Crushable renaming 2014-09-13 17:21:30 +02:00
reaperrr
409d6a046d Rename CrushableInfantry to Crushable, adapt to WithDeathAnimation.
Make Crushable compatible with non-mobile actors.

Change RA, TD and TS infantry die-crushed sequence ZOffsets in preparation
for future engine changes.

Add descriptions and CrushedByFriendlies to Crushable.

Adapt code to factor in whether the palette is a player palette.
2014-09-13 17:21:30 +02:00
reaperrr
257c953089 WithDeathAnimation yaml changes 2014-09-13 15:57:14 +02:00
reaperrr
3dd5fe988d Move SpawnsCorpse functionality from RenderInfantry into its own WithDeathAnimation trait.
Add descriptions and player palette booleans to WithDeathAnimation.
2014-09-13 15:57:06 +02:00
Matthias Mailänder
636e1b5102 Merge pull request #6441 from pchote/paste
Support pasting clipboard text into TextFields.
2014-09-13 15:02:15 +02:00
Oliver Brakmann
6a9a70d7b9 Fix #6444 2014-09-13 14:03:17 +02:00
obrakmann
006f11ccf4 Merge pull request #6446 from Mailaender/server-joined-game
Polished status message wording in the lobby
2014-09-13 12:11:26 +02:00
Matthias Mailänder
f4b3a73af6 remove duplicated "Server: ... the server" wording 2014-09-13 11:22:09 +02:00
ScottNZ
b1132fae44 Remove weird "package manifest" line from ra's voices.yaml 2014-09-13 20:22:47 +12:00
Matthias Mailänder
6fe3800268 Merge pull request #6437 from pchote/fix-crate-crash
Fixes #5953
Fixes #6427
2014-09-13 08:25:32 +02:00
Paul Chote
b1de14bc70 Disable replay saving for campaign missions. 2014-09-13 18:08:14 +12:00
Matthias Mailänder
2aabc2686c Merge pull request #6440 from pchote/authors
Update the current developers in AUTHORS.
2014-09-13 07:58:43 +02:00
Matthias Mailänder
a50e27b754 Merge pull request #6438 from pchote/avoid-3point8-fail
Add a symlink to libgdiplus in the OS X package.
2014-09-13 07:57:22 +02:00
ImagoTrigger
eb2124bb89 Adds ability to paste text (ctrl/cmd+v) into chat. 2014-09-13 09:41:59 +12:00
Paul Chote
359dc90a27 Update the current developers in AUTHORS. 2014-09-13 09:12:16 +12:00
Paul Chote
aebb6f6918 Merge pull request #6418 from Mailaender/d2k-idle-stand
Cleaned up Dune 2000 infantry sequences
2014-09-13 08:42:49 +12:00
Paul Chote
eddcfd7362 Merge pull request #6426 from obrakmann/fix6421
Fix a number or bugs wrt shroud/selection interaction in observer mode
2014-09-13 08:34:22 +12:00
Paul Chote
750b3b019f Add a symlink to libgdiplus in the OS X package. Closes #6413. 2014-09-12 21:31:57 +12:00
Paul Chote
b009913e64 Clean up DuplicateUnitCrateAction. 2014-09-12 20:06:52 +12:00
Paul Chote
e95974153d Unify the code style across crate actions. 2014-09-12 20:06:52 +12:00
Paul Chote
8ec8f82178 Destroy a paradropped crate if it lands on something that can’t collect it. Fixes #5953, #6427. 2014-09-12 20:06:52 +12:00
Matthias Mailänder
6e5d1da468 Merge pull request #6425 from obrakmann/mission-polish
Mission follow-up
2014-09-09 21:07:41 +02:00
Oliver Brakmann
1201a628d6 Replace pre-placed Nod units with reinforcements 2014-09-09 19:00:19 +02:00
Matthias Mailänder
bdbf0a7290 Merge pull request #6432 from TWaalen/upstream/luadocs-null-placeholder
Fixes #6078
2014-09-08 22:06:17 +02:00
Thijs Waalen
2da4a53155 Replace the empty defaults caused by a null default with nil 2014-09-08 21:59:58 +02:00
Matthias Mailänder
c204e185bc Merge pull request #6388 from DeadlySurprise/bleed
Closes #6198
2014-09-08 06:03:50 +02:00
Matthias Mailänder
0de4c233cf Merge pull request #6428 from reaperrr/landing-craft-fix
Closes #6419
2014-09-07 18:51:19 +02:00
reaperrr
e071cd017b Fixes that only turrets of exiting units are drawn on top of landing craft. 2014-09-07 16:21:26 +02:00
Matthias Mailänder
9c3baabb6e Merge pull request #6423 from TWaalen/upstream/fix-spelling-luadocs
LuaDocs/Desc attributes spelling fixes
2014-09-07 08:37:01 +02:00
Oliver Brakmann
44582ae647 Fix another shroud/selection bug in observer mode
In a player view, enemy units would not be unselected when they entered
the shroud.
2014-09-07 01:10:52 +02:00
Oliver Brakmann
bc50e1b0e2 Reset selection when switching player shroud in observer mode
The selection will be reset when switching from any shroud view to a
player shroud view. The selection will be kept when switching from any
view to either 'All players' or 'Shroud disabled' view.
2014-09-07 00:55:23 +02:00
Oliver Brakmann
eff54a614b Fix selection glitch in observer mode
Fixes #6421.
2014-09-07 00:52:55 +02:00
Thijs Waalen
de66e947e0 Changed "the player" to "this player" for the mission objective properties 2014-09-07 00:21:38 +02:00
obrakmann
d56c1fa450 Merge pull request #6378 from Mailaender/desert-shellmap-lua-cleaning
Desert shellmap Lua maintenance
2014-09-06 23:14:09 +02:00
Thijs Waalen
3a80ee27cd Fix spelling for Actor.Create description 2014-09-06 21:56:33 +02:00
Thijs Waalen
4f4bdf249b Fix wrong changes of possessive 2014-09-06 21:42:19 +02:00
Thijs Waalen
f47fe75970 LuaDocs consistency fixes 2014-09-06 19:29:38 +02:00
Thijs Waalen
eb959c5858 LuaDocs punctuation fixes 2014-09-06 19:29:37 +02:00
Thijs Waalen
a9b5e1d911 LuaDocs spelling fixes 2014-09-06 19:29:37 +02:00
DeadlySurprise
7183c52a2e Adds damage debug overlay 2014-09-06 16:16:36 +02:00
Matthias Mailänder
8e4b5af352 Merge pull request #6414 from ScottNZ/balance
Some RA balance work
2014-09-06 14:13:43 +02:00
Matthias Mailänder
2a16fe0d6d Merge pull request #6399 from DeadlySurprise/dlPolish
Fixes #6186
2014-09-06 13:57:11 +02:00
Matthias Mailänder
64cf785103 Merge pull request #6397 from obrakmann/cnc-stats
Enable viewing game stats after the game ends
2014-09-06 13:52:16 +02:00
Matthias Mailänder
52aba46b10 Merge pull request #6392 from ingemaradahl/debug-symbols
Copy mod .mdb symbol file together with .dll
2014-09-06 13:40:59 +02:00
Matthias Mailänder
c090c0fe69 remove duplicate bazooka stand sequences 2014-09-06 12:27:55 +02:00
Matthias Mailänder
1183ab8e0d add missing grenadier idle animation 2014-09-06 12:27:43 +02:00
Matthias Mailänder
6f3df2611e remove fake idle animations 2014-09-06 12:27:35 +02:00
Matthias Mailänder
a823b9e5ed Merge pull request #6417 from pchote/fix-infantry-animations
Fixes #6416. Reopens #5884.
2014-09-06 12:21:58 +02:00
Oliver Brakmann
b1ff492ac9 make gdi04c a bit easier 2014-09-06 12:13:32 +02:00
Oliver Brakmann
001ea9a30d Fix mission accomplished notifications and video playback 2014-09-06 12:13:11 +02:00
Oliver Brakmann
bf9a63ff95 Rename widgets 2014-09-06 11:18:47 +02:00
Oliver Brakmann
c61516c55e Add stats button to end game dialog
Also adds the statistics window to TD.  There is no button for it in
observer mode, though, but it is available from the end game dialog.

Fixes #6312.
2014-09-06 11:18:47 +02:00
Paul Chote
6fb4963a57 Revert "fix infantry without idle anim staying in fire animation state"
This reverts commit 1c65b29a30.
2014-09-06 20:42:25 +12:00
ScottNZ
48fe6cccc7 Remove MustBeDestroyed from ra support structures 2014-09-06 19:47:04 +12:00
ScottNZ
4098ad8f98 Remove MustBeDestroyed from cnc support structures 2014-09-06 19:32:44 +12:00
Paul Chote
05f2a06204 Merge pull request #6325 from obrakmann/gdi04c
Port gdi04c to New Lua
2014-09-06 10:55:17 +12:00
Paul Chote
4cd14690f6 Merge pull request #6328 from obrakmann/nod03b
Port nod03b to New Lua
2014-09-06 10:39:16 +12:00
Paul Chote
60c0f47fb3 Merge pull request #6327 from obrakmann/nod03a
Port nod03a to New Lua
2014-09-06 10:28:26 +12:00
Paul Chote
538af31b54 Merge pull request #6398 from obrakmann/pr6303_addendum
Fix an omission from #6303
2014-09-06 10:09:12 +12:00
Paul Chote
ede046cc0c Merge pull request #6331 from Mailaender/infantry-noidle-fix
Fixed Dune 2000 infantry not showing the waiting animation when ordered to stop firing
2014-09-06 09:30:55 +12:00
Oliver Brakmann
da454de398 Complete ArmorModifier->DamageModifier rename
PR #6303 neglected to rename the "armor" upgrade to "damage" in all
necessary places, as mentioned in
https://github.com/OpenRA/OpenRA/pull/6303#issuecomment-53312209
2014-09-05 19:52:35 +02:00
Matthias Mailänder
9b6a5320a4 paradrop zombies instead of ants 2014-09-05 15:42:54 +02:00
Matthias Mailänder
128b2b8b67 rename the boolean 2014-09-05 15:42:38 +02:00
Matthias Mailänder
60d31e643e remove reference to non-existing idle sequences 2014-09-05 15:29:43 +02:00
Matthias Mailänder
2ccc6f63e0 Merge pull request #6362 from atlimit8/SellingSounds
Moved SellSounds from Building to Sellable & added upgrade to rules
2014-09-05 15:17:13 +02:00
obrakmann
efcf66206e Merge pull request #6344 from reaperrr/accuracy-modifier
Added InaccuracyModifier
2014-09-04 22:43:01 +02:00
atlimit8
cc9c253419 Moved SellSounds from Building to Sellable & added upgrade to rules. 2014-09-04 15:25:19 -05:00
reaperrr
9bb9f870d7 Improve accuracy on level-up. 2014-09-04 20:28:34 +02:00
reaperrr
5e9b0a964f Adds InaccuracyModifier. 2014-09-04 20:28:34 +02:00
ScottNZ
4212d04f10 Double projectile speed of AA gun so it misses less often 2014-09-04 17:16:08 +12:00
ScottNZ
6bde85beda Increase prices of yak and hind from $1000 to $1350 (Implicit build time increase as well). 2014-09-04 16:57:02 +12:00
ScottNZ
7e5664b48c Hind and Longbow were a bit too tanky, so reduced their HP levels from 150 to 100 and 150 to 120 respectively. 2014-09-04 16:56:56 +12:00
ScottNZ
ba7a017489 Remove C4 target type from ra vehicles - Tanya was a bit too strong C4ing vehicles 2014-09-04 16:18:04 +12:00
ScottNZ
dc12dff351 Add cloak detection abilities to all ra defenses
(not hbox because it already has cloak detection)
2014-09-04 16:18:03 +12:00
DeadlySurprise
df1df7dedb Improved download progress formatting 2014-09-04 00:12:04 +02:00
Oliver Brakmann
49adf023bb Remove unused usings and arguments 2014-09-03 22:05:06 +02:00
obrakmann
3f23930121 Merge pull request #6347 from mizipzor/tab-completion
Improves tab completion in chat.
2014-09-03 18:43:14 +02:00
Alexander Fast
16965d5797 Improves tab completion in chat.
Pressing tab after completion now cycles to the next candidate.
2014-09-03 11:43:26 +02:00
Paul Chote
f9255ecc49 Merge pull request #6360 from huwpascoe/clientstatus
Player connection status report.
2014-09-03 19:20:23 +12:00
Paul Chote
674998c0ee Merge pull request #6335 from obrakmann/fix6311
Fix end game window conflicting with ingame menu
2014-09-03 18:54:51 +12:00
Paul Chote
31e0ed7001 Merge pull request #6371 from reaperrr/d2k-death-sequences
Fixed D2k infantry death sequences
2014-09-03 08:35:59 +12:00
Ingemar Ådahl
03815a1c8d Copy mod .mdb symbol file together with .dll
Allows for MonoDevelop to debug execution in mod library properly.
2014-09-02 21:15:47 +02:00
Matthias Mailänder
99156451c0 bring back Chinook infantry insertion 2014-08-31 20:38:19 +02:00
Matthias Mailänder
0b8ae4088e use the new reinforcements methods 2014-08-31 20:38:19 +02:00
Matthias Mailänder
03afd1db5d avoid magic numbers 2014-08-31 20:38:19 +02:00
Matthias Mailänder
a7389a0e45 make this a seasonal easter egg 2014-08-31 20:38:16 +02:00
huwpascoe
ffd17af363 Disconnected clients now listed as '(Gone)'. 2014-08-31 18:25:23 +01:00
Matthias Mailänder
5b12ba1c21 refactor and move ShipUnitTypes to the top 2014-08-31 14:45:11 +02:00
Matthias Mailänder
154f6ba297 remove bogus space tabs 2014-08-31 14:29:24 +02:00
Oliver Brakmann
e0af4cf671 Port nod03b to New Lua 2014-08-31 12:53:56 +02:00
Oliver Brakmann
e50b8fafb0 Fix a typo in gdi02 2014-08-31 12:37:28 +02:00
Oliver Brakmann
105a928195 Port nod03a to New Lua 2014-08-31 12:36:24 +02:00
Paul Chote
9ed9096551 Merge pull request #6324 from obrakmann/gdi02
Port gdi02 to New Lua
2014-08-31 21:57:57 +12:00
Paul Chote
c2d748e711 Merge pull request #6326 from obrakmann/nod01
Port nod01 to New Lua
2014-08-31 21:54:12 +12:00
Oliver Brakmann
62baed1c5f Port gdi02 to New Lua 2014-08-31 11:50:41 +02:00
obrakmann
a23cdc6178 Merge pull request #6369 from Mailaender/nickname-change-message
Added a server message about nickname changes
2014-08-31 11:40:17 +02:00
obrakmann
7b8e774b08 Merge pull request #6319 from abcdefg30/fortlonestar
Small cleanup on fort-lonestar map
2014-08-31 11:30:39 +02:00
Matthias Mailänder
a81ce5f318 replace bogus tab with space 2014-08-31 09:23:10 +02:00
Matthias Mailänder
981fff95e1 add missing TakeCover trait 2014-08-31 09:23:10 +02:00
Matthias Mailänder
1c65b29a30 fix infantry without idle anim staying in fire animation state
closes #5884
2014-08-31 09:23:10 +02:00
Matthias Mailänder
52de40f252 remove bogus tab 2014-08-31 09:23:05 +02:00
Matthias Mailänder
44441bf20e remove unused duplicate stand sequences 2014-08-31 09:16:39 +02:00
Matthias Mailänder
4fd4089e54 self-document and un-hardcode the prone sequence prefix 2014-08-31 09:16:39 +02:00
Matthias Mailänder
c867d04986 inform players about nickname changes in the lobby 2014-08-31 09:11:24 +02:00
reaperrr
d438f0efde Fix wrong sequence lengths 2014-08-31 00:33:48 +02:00
reaperrr
80b03dc624 Fix D2k infantry death sequences. 2014-08-31 00:05:14 +02:00
obrakmann
c72bca68ea Merge pull request #6372 from reaperrr/infdeath-to-deathtype
Renamed InfDeath to DeathType
2014-08-30 23:40:48 +02:00
Paul Chote
479b8e13d6 Merge pull request #5891 from Mailaender/d2k-captureable-tech
Added captureable tech for Dune 2000
2014-08-31 09:10:35 +12:00
abcdefg30
5b97076769 Readd correct buildingspeed modifier 2014-08-30 18:24:17 +02:00
Matthias Mailänder
911f79e86f fix production queues and prerequisites 2014-08-30 18:16:36 +02:00
abcdefg30
9a87a7cd10 moved mediamessage to avoid spam 2014-08-30 18:16:36 +02:00
abcdefg30
2e431bb95b removed unused buildable: owner: ... 2014-08-30 18:16:35 +02:00
abcdefg30
adcfdbd391 added ftur and removed hbox 2014-08-30 18:16:35 +02:00
abcdefg30
1e3804b729 unit -> units to avoid crashes 2014-08-30 18:16:34 +02:00
reaperrr
c17b284051 UpgradeRules for InfDeath -> DeathType renaming. 2014-08-30 18:06:07 +02:00
reaperrr
3725ce4f7b InfDeath -> DeathType renaming. 2014-08-30 18:06:05 +02:00
Matthias Mailänder
c1ca55b303 Merge pull request #6208 from atlimit8/FixUnloadCargo
Fixed UnloadCargo stacking using new subcell API exposure
2014-08-30 14:38:17 +02:00
Matthias Mailänder
afe3560fc5 Merge pull request #6346 from abcdefg30/dropzones
Updated dropzone maps
2014-08-30 14:13:50 +02:00
Matthias Mailänder
0470118f2a Merge pull request #6351 from abcdefg30/fixshore
Fixes #6195
2014-08-30 14:03:41 +02:00
reaperrr
0cd244641a Merge pull request #6368 from Mailaender/squishy-unhardcode
Removed hard-coded squishy sounds to avoid confusion
2014-08-30 12:53:51 +02:00
obrakmann
0181347141 Merge pull request #6304 from pchote/fix-laser-vis
Don’t display LaserZap if source and dest are hidden.
2014-08-30 12:02:49 +02:00
atlimit8
8ad1140921 Reduce ICrushable trait lookup & drop -SubCell suffix.
Replace `a.HasTrait<ICrushable>()` with a.TraitsImplementing<ICrushable>().Any() or equivalent.
2014-08-30 04:43:57 -05:00
Matthias Mailänder
db1e9b9c24 don't hard-code sounds for one mod to avoid confusion 2014-08-30 10:32:57 +02:00
Matthias Mailänder
fb1a33da1d Merge pull request #6366 from reaperrr/sound-cleanup
Minor sound fixes for RA and TS
2014-08-30 10:13:23 +02:00
Matthias Mailänder
a92dd17d92 Merge pull request #6279 from mizipzor/new-dialong-png-fix
Fix for blinking vivid red color on unread news
2014-08-30 10:04:22 +02:00
Matthias Mailänder
1ffa88a750 Merge pull request #6162 from UberWaffe/WeaponDiplomacyCheck
Closes #5618
2014-08-30 09:39:05 +02:00
Matthias Mailänder
dadc0903be Merge pull request #6239 from TiagoMLSousa/ISSUE2820_DisableSimilarColors
Issue #2820 - Disable similar colors
2014-08-30 09:21:18 +02:00
atlimit8
e29b9edfc1 Changes to map.cs, rename IPositionable.IsLeaving{ => Cell}, add IPositionable.GetValidSubCell 2014-08-29 23:30:16 -05:00
atlimit8
63c28ee4d7 Refactored in new enum SubCell 2014-08-29 23:00:53 -05:00
atlimit8
27ad5208fb Fixed Mobile.SetPosition & other FixUnloadCargo touch-ups
Fixed Mobile.SetPosition
Finally removed old SubCell enum
Folded MobileInfo.CanEnterCell overloads into one
Renamed IPositionable.{IsMovingFrom => IsLeaving}
Changed Crate.IsLeaving to use crate lifetime
2014-08-29 23:00:53 -05:00
atlimit8
b2c9064545 Refactored [sub-]cell availability logic in IPositionable & ActorMap
Moved the logic from IPositionable.CanEnterCell & integrated sub-cell selection.
Added IPositionable.IsMovingFrom(CPos location, int subCell = -1) - to detect transient actors
Renamed IPositionable.{GetDesiredSubcell => GetAvailableSubcell} - since it checks for available sub-cells
Reduced IPositionable.CanEnterCell to one method that usually uses IPositionable.GetAvailableSubcell
Added actor checking to ActorMap.{HasFreeSubCell, FreeSubCell, AnyUnitsAt} - used by [sub-]cell availability logic
2014-08-29 23:00:53 -05:00
atlimit8
ff7ad53dee Fixed UnloadCargo stacking using new subcell API exposure 2014-08-29 23:00:53 -05:00
atlimit8
9efcf231e1 Refactor MobileInfo.CanEnterCell 2014-08-29 23:00:53 -05:00
atlimit8
fe57417aa8 Added int subCell = -1 to IMove.MoveIntoWorld & IPositionable.SetPosition(Actor self, CPos cell) 2014-08-29 23:00:53 -05:00
Tiago Sousa
ce68d67f0b Disallow same/similar colors (fixes #2820) 2014-08-30 01:53:38 +01:00
reaperrr
b3e0f9b989 Fix TS CrushSounds.
squish2.aud doesn't exist in TS, and Cyborgs aren't crushable anyway.
2014-08-30 02:28:06 +02:00
reaperrr
498b2dd028 Fix Parachutable GroundImpactSound.
squishy2.aud only exists in ts.
2014-08-30 02:27:04 +02:00
Paul Chote
921d77f825 Merge pull request #6202 from ScottNZ/spyabilities
Add power sabotage ability to spy
2014-08-30 10:26:09 +12:00
obrakmann
d9933e9be0 Merge pull request #6358 from huwpascoe/bleed
Cloaked APCs are no longer unstoppable harrassment machines.
2014-08-29 21:05:38 +02:00
huwpascoe
330cb0c488 UncloakOnUnload is now on by default. 2014-08-29 19:57:45 +01:00
abcdefg30
b51a2263b3 Fixed sh31 tile 2014-08-27 12:27:30 +02:00
Paul Chote
0db079ea94 Merge pull request #6321 from Mailaender/less-nervous-clicksounds
Fixed double click sound on Tiberian Dawn production tabs
2014-08-27 18:45:51 +12:00
ScottNZ
cc15d859e2 Have AI account for power outages 2014-08-27 18:45:09 +12:00
ScottNZ
b70395e27c Refactor more power and infiltration stuff. Create new power sabotage ability for spies in ra and ts. 2014-08-27 18:45:09 +12:00
Paul Chote
84cb5f14f5 Merge pull request #6318 from Mailaender/log-session-deserialize-exception
Fixed Session.Deserialize exceptions not throwing properly
2014-08-27 18:39:56 +12:00
reaperrr
4fa199fb10 Merge pull request #6320 from Mailaender/smudge-offset
Unhardcoded and self-documented more resource/smudge parameters
2014-08-26 22:25:32 +02:00
obrakmann
e1eb5a0927 Merge pull request #6340 from cjshmyr/fix6214
Add missing INotifyRemovedFromWorld impl to GlobalUpgradable
2014-08-26 16:42:47 +02:00
abcdefg30
1850794518 'Cleaned away' some unused traits 2014-08-26 12:57:42 +02:00
abcdefg30
b5bdb73447 Fixed crates spawning on inaccessable terrain 2014-08-26 12:52:48 +02:00
abcdefg30
ed5648f873 Disabled wrong crateactions 2014-08-26 12:51:06 +02:00
abcdefg30
2c2424d10e unit -> units to avoid crashes 2014-08-26 11:44:31 +02:00
UberWaffe
1fbcdfc3c3 AffectsParent defaulted to false. 2014-08-25 20:44:21 +02:00
UberWaffe
81cb26116f Ioncannon changed to limited Spread. (1000, 250, 100 damage in 1c1, 2c1, 2c512) 2014-08-25 20:44:21 +02:00
Curtis Shmyr
02a6c6ab77 Add missing INotifyRemovedFromWorld impl to GlobalUpgradable 2014-08-24 13:18:30 -06:00
Oliver Brakmann
fcd5a43659 Port gdi04c to New Lua 2014-08-24 18:49:29 +02:00
Oliver Brakmann
2f4c81b7c9 Fix end game window conflicting with ingame menu
Fixes #6311
2014-08-24 17:00:18 +02:00
Matthias Mailänder
8ebe6345aa Merge pull request #6323 from pchote/tib-craters
Render smudges beneath resources.
2014-08-24 16:50:28 +02:00
Matthias Mailänder
e6a1a2632e add captureable tech for Dune 2000 2014-08-24 08:41:54 +02:00
Matthias Mailänder
97b97a4dd2 bring back click sound for TAB and PageUp/Down 2014-08-24 08:29:19 +02:00
Matthias Mailänder
8649475b91 document engine limitations 2014-08-24 08:16:59 +02:00
Matthias Mailänder
5b4f8d1446 unhardcode and self-document more resource/smudge parameters 2014-08-24 08:13:40 +02:00
Paul Chote
944cfd83e2 Merge pull request #6281 from mizipzor/tab-completion
Added tab completion to in-game and lobby chat.
2014-08-24 17:29:38 +12:00
UberWaffe
e3e5e9eb00 Adds Diplomacy keywords for ValidTarget checks.
Changes:

Allows diplomacy stance checks to be done on warheads and weapons, using keywords in ValidTargets and InvalidTargets.
2014-08-24 07:00:21 +02:00
Paul Chote
ef7d198ca8 Merge pull request #6244 from havok13888/PalaceStarPortBib
Fixes #6013 D2K - Tiles that should unmoveable at Palaces bib
2014-08-24 11:51:52 +12:00
Paul Chote
e4b9872f82 Merge pull request #6291 from UberWaffe/ImpactTarget
Changes Weapon.Impact() to use Target (from WPos).
2014-08-24 09:38:15 +12:00
Paul Chote
966c933cd3 Render smudges beneath resources. Fixes #6270. 2014-08-24 09:15:41 +12:00
Paul Chote
ae0e456565 Merge pull request #6224 from cjshmyr/renderinfantry
RenderInfantry refactoring
2014-08-24 08:59:34 +12:00
Curtis Shmyr
083592e194 Add an update rule to replace RenderInfantryProne and RenderInfantryPanic with RenderInfantry 2014-08-23 14:44:05 -06:00
Curtis Shmyr
fa8229d53b Implement IRenderInfantrySequenceModifier for ScaredyCat and TakeCover 2014-08-23 14:42:55 -06:00
Curtis Shmyr
345e88d75a Add IRenderInfantrySequenceModifier 2014-08-23 14:42:16 -06:00
Oliver Brakmann
ccd6540e13 Port nod01 to New Lua 2014-08-23 22:14:17 +02:00
Matthias Mailänder
ac1544e8bd remove double click sound when switching production tabs
closes #5863
2014-08-23 21:45:55 +02:00
Matthias Mailänder
749314d04e tab to space 2014-08-23 21:44:57 +02:00
Matthias Mailänder
093fe1776f missing tab 2014-08-23 21:44:50 +02:00
Alexander Fast
af0efda6f5 Changes how the playerNames collection is created.
It's now extracted from the orderManager, like it's done in LobbyLogic.
This is to increase consistency.
2014-08-23 21:18:54 +02:00
Alexander Fast
38ab05aa3c Adds newsbutton style. 2014-08-23 20:58:07 +02:00
Alexander Fast
e820c32e35 Fixes button style. 2014-08-23 20:57:01 +02:00
Matthias Mailänder
12876c23a2 fix tried logging to non-existant channel exception
closes #6168
2014-08-23 19:15:46 +02:00
Matthias Mailänder
f0fc63b15d Merge pull request #6274 from abcdefg30/falsekillstats
Fixes #6223
2014-08-23 18:50:44 +02:00
abcdefg30
a3928bfcf0 Fixed displaying false stats 2014-08-23 18:04:24 +02:00
Matthias Mailänder
bc4c344cb0 Merge pull request #6284 from obrakmann/gdi01-touchup
More Lua API enhancements
2014-08-23 16:28:36 +02:00
Oliver Brakmann
d85b5d5a4f Replace explicit Dispose() calls with using statements in ScriptTrigger.cs 2014-08-23 16:21:40 +02:00
Oliver Brakmann
e434011487 Adjust gdi01 to use new functions 2014-08-23 16:21:40 +02:00
Oliver Brakmann
74c45d5d21 Add reinforcements functions to Lua API 2014-08-23 16:21:40 +02:00
Oliver Brakmann
882f3f34c2 Add a number of small helper functions to Lua API 2014-08-23 16:21:40 +02:00
Oliver Brakmann
d23707b5f7 Add OnCapture, OnAddedToWorld and OnRemovedFromWorld triggers to Lua API
This brings the new Lua API up to feature-parity with the old API in the
trigger department.
2014-08-23 16:21:40 +02:00
Oliver Brakmann
1c8a56d197 Make ScriptContext available in Actor- and PlayerProperty classes
Needed to return non-native types to Lua
2014-08-23 16:21:40 +02:00
Oliver Brakmann
1e7f04105d Fix OnObjective(Completed|Failed) not being called for secondary objectives 2014-08-23 16:21:39 +02:00
Oliver Brakmann
56466e312f Ensure that all combatants have a defined WinState at the end of the game 2014-08-23 16:21:39 +02:00
Oliver Brakmann
e6887503af Remove unused method 2014-08-23 16:21:39 +02:00
Matthias Mailänder
7cb7685d62 Merge pull request #6266 from huwpascoe/uiscaling
Cursor Doubling
2014-08-23 16:14:13 +02:00
Matthias Mailänder
08adfcd855 Merge pull request #6300 from pchote/fix-font-freeze
Disable fontconfig in packaged OSX build.
2014-08-23 15:29:18 +02:00
Matthias Mailänder
8e56b527b3 Merge pull request #6309 from pchote/fix-minelayer-exploit
Don’t leak information about hidden actors.
2014-08-23 14:46:50 +02:00
Matthias Mailänder
086d8704d2 Merge pull request #5867 from UberWaffe/AI-MetaData
Closes #2926
Closes #5830
Closes #6207
2014-08-23 14:29:58 +02:00
UberWaffe
a1e51b71d6 AI Support Power Meta Data implemented.
Changes included:
Decision can be defined for the AI support powers, governing their targeting.
Each decision can be made up of multiple considerations.
2014-08-23 12:01:30 +02:00
UberWaffe
76ccb0cf00 Changes Weapon.Impact() to use Target (from WPos). 2014-08-23 11:23:34 +02:00
Matthias Mailänder
60a3196bb2 Merge pull request #6301 from Phrohdoh/TibSunFixes
Tiberian Sun visual fixes.
2014-08-23 11:19:31 +02:00
Matthias Mailänder
152aad9cf9 Merge pull request #6315 from MustaphaTR/d2k-three-orni
D2k - 3 Ornithopter
2014-08-23 11:00:56 +02:00
obrakmann
022c1ae4d1 Merge pull request #6310 from pchote/shroud-reset-fix
Fix shroud hash updating.
2014-08-23 10:43:56 +02:00
Mustafa Alperen Seki
c6196ceb43 Update atreides.yaml 2014-08-23 11:35:52 +03:00
Mustafa Alperen Seki
3ae9c1d796 Added 3 orni. 2014-08-23 11:34:51 +03:00
Matthias Mailänder
c25c3441fb Merge pull request #6305 from pchote/fix-shroud-clear
Don’t clear shroud outside the map.
2014-08-23 10:34:47 +02:00
Matthias Mailänder
6bb392be11 Merge pull request #6303 from obrakmann/fix6263
Fixed invulnerable infantry
2014-08-23 10:28:15 +02:00
Oliver Brakmann
5c15fa2631 Fix a bad merge in UpgradeRules.cs 2014-08-23 10:15:13 +02:00
Paul Chote
3ad9144866 Merge pull request #6313 from Mailaender/CS0067-workaround
Fixed bogus warning as error CS0067 The event is never used
2014-08-23 20:08:01 +12:00
Matthias Mailänder
97cb527a8f Merge pull request #6306 from obrakmann/fix6298
Add creeps to scripted missions
2014-08-23 10:07:47 +02:00
Matthias Mailänder
a4ed71bf84 workaroud warning as error CS0067 The event is never used
closes #6101
2014-08-23 09:53:12 +02:00
Matthias Mailänder
834bc3ba24 Merge pull request #6265 from pchote/warhead-intification
Warhead cleanups
2014-08-23 09:31:41 +02:00
Paul Chote
32e099d60a Fix inner range filtering in HealthPercentageDamageWarhead. 2014-08-23 17:14:12 +12:00
Paul Chote
db1df48466 Increase falloff accuracy for large damage amounts. 2014-08-23 17:14:12 +12:00
Paul Chote
fa3e7b5e1b Convert versus to integers. 2014-08-23 17:14:12 +12:00
Paul Chote
50fea12a80 Remove now-redundant AbsoluteSpreadDamageWarhead. 2014-08-23 17:14:11 +12:00
Paul Chote
97c28e1353 Remove fp calculations from SpreadDamageWarhead. 2014-08-23 17:14:11 +12:00
Paul Chote
d002a23d67 Change EffectivenessAgainst to CanTargetActor. 2014-08-23 17:14:10 +12:00
Paul Chote
227a523878 Further warhead streamlining. 2014-08-23 17:14:10 +12:00
Paul Chote
57ba1b54b4 Convert weapon plumbing to use integer damage modifiers. 2014-08-23 17:14:10 +12:00
Paul Chote
8e8e02dae8 Move warheads into mod code. 2014-08-23 17:14:10 +12:00
Paul Chote
34ca30c9f1 Remove more unnecessary plumbing. 2014-08-23 17:14:10 +12:00
Paul Chote
1261d5891d Move common DoImpact(Target) method into DamageWarhead. 2014-08-23 17:14:09 +12:00
Paul Chote
531e3cfaf3 Fix shroud hash updating. Fixes #6308.
This ensures that multiple Invalidations() in one tick will each update the shroud rendering.
2014-08-23 15:25:39 +12:00
Taryn Hill
4abee8682f Visual fixes for TS structures and units. 2014-08-22 19:01:01 -05:00
Paul Chote
a781e44509 Don’t leak information about hidden actors. Fixes #6125. 2014-08-23 11:19:49 +12:00
Paul Chote
2acfc23f18 Account for map edges in Shroud.IsExploredCore. 2014-08-23 10:54:01 +12:00
obrakmann
af9c182d30 Merge pull request #6307 from pchote/osx-bundle-version
Set the package version in the OS X .app
2014-08-23 00:39:11 +02:00
Paul Chote
af1c9aca30 Set the package version in the OS X .app. 2014-08-23 10:08:28 +12:00
Christopher Grant
774c8121c2 Fixed invulnerable infantry
Closes #6263
2014-08-23 00:04:16 +02:00
Oliver Brakmann
5325fa7bae Add creeps to scripted missions
Fixes #6298
2014-08-23 00:00:40 +02:00
Paul Chote
80c4870a0f Don’t clear shroud outside the map. Fixes #6097. 2014-08-23 09:53:27 +12:00
Paul Chote
fc6d266278 Don’t display LaserZap if source and dest are hidden.
Closes #6146.
2014-08-23 09:47:46 +12:00
Paul Chote
aa71f59688 Disable fontconfig under OSX. Fixes #4785. 2014-08-22 23:33:23 +12:00
huwpascoe
baecedc7b8 Cursor Doubling
Cursor now doubles with pixel doubling, enabled by a new checkbox in the
settings menu.
2014-08-21 20:08:38 +01:00
huwpascoe
7d96a6ac96 Fixed SpriteRenderer offset bug. 2014-08-21 20:08:33 +01:00
obrakmann
6fcd4c3605 Merge pull request #6109 from WolfGaming/RemoveOnPrereq
Added a trait that removes an actor when prereqs are met, with delay.
2014-08-21 20:50:29 +02:00
WolfGaming
d619fbfbbe Added a trait that removes an actor when prereqs are met, with delay. 2014-08-21 18:42:37 +00:00
Alexander Fast
e934df374d Fixes double auto completion in in-game chat. 2014-08-21 13:12:29 +02:00
Alexander Fast
a73898d441 Fixes double auto completion.
Pressing tab twice would auto complete (the same name) twice.
Auto completion is now disabled when last character in sentence is a
space.
2014-08-21 13:05:04 +02:00
Alexander Fast
bab7f765dd Replaced GetPlayerNames method with simpler linq.
Bonus feature: it now auto complete bot names as well.
2014-08-21 13:02:17 +02:00
Alexander Fast
0c6f180f56 Replaced ForEach with loop, moved Trim outside. 2014-08-21 12:39:53 +02:00
Paul Chote
2bc17aee1f Merge pull request #6296 from mizipzor/fix-license
Fixes year numbers in license text in file headers.
2014-08-21 21:36:30 +12:00
Alexander Fast
070d00c678 Fixes year numbers in license text in file headers. 2014-08-21 11:27:52 +02:00
obrakmann
87e4d6b422 Merge pull request #6079 from reaperrr/rof-modifier
Adds ReloadDelay modifier & renames ROF to ReloadDelay
2014-08-21 00:27:39 +02:00
Paul Chote
a3a838cb3f Merge pull request #6089 from reaperrr/wavlength
Add WavSoundLength to show track length in music player
2014-08-20 23:56:02 +12:00
Alexander Fast
e9d488fd9c Update AUTHORS
Added myself as requested by Mailaender.
2014-08-20 12:45:49 +02:00
reaperrr
3e3f1394d9 Adds length display support for PCM & IMA music. 2014-08-20 08:22:40 +02:00
havok13888
d44e01e232 Fixed starport and palace 2014-08-19 18:24:46 -05:00
Alexander Fast
8b7f2e0321 Fixes outdated dialog.png in Tiberian Sun mod. 2014-08-19 22:51:49 +02:00
Alexander Fast
3160fa40f6 Added tab completion to lobby chat.
Also fixes accidental reversion of one word logic during cleanup.
Fields that could be readonly are now readonly.
2014-08-19 22:48:51 +02:00
Alexander Fast
ab61830d0f Code cleanup based on code review.
Fixes multiple enumeration of IEnumerable.
Fixes return value of pure method not used.
Converted OnTabKey and OnClick handlers to method groups.
Removed one set of redundant parenthesis.
Replaced explicit type with var.
2014-08-19 21:27:39 +02:00
Alexander Fast
034625c2ea Added tab completion to in-game chat.
Both player names and chat commands can be completed.
Names of local players and bots are not candidates for completion.
If a completed name is the first word ": " is appended to the end.
The hotkey for toggling team/all chat has been moved to left Alt.
2014-08-19 17:19:32 +02:00
Alexander Fast
bb88fddb0f Manual merge of dialog.png
The new file inclused both the black box and the new vivid red colors.
2014-08-19 09:36:46 +02:00
Sebastien Kerguen
12b2f45d2b Trying to fix Settings buttons 2014-08-19 09:26:39 +02:00
Sebastien Kerguen
dee2f1e67c fixed the Battlefield News button 2014-08-19 09:26:38 +02:00
Sebastien Kerguen
d9a8d09fbe chrome.yaml fixes 2014-08-19 09:26:37 +02:00
reaperrr
f588b07f56 Upgrade rule for ROF > ReloadDelay renaming. 2014-08-19 02:59:51 +02:00
reaperrr
d6ef37a750 ReloadModifier & ROF -> ReloadDelay yaml changes 2014-08-19 02:59:50 +02:00
reaperrr
4469b5f5ca Introduces ReloadModifier
and renames ROF -> ReloadDelay
2014-08-19 02:59:50 +02:00
Paul Chote
520df8242d Merge pull request #6217 from Mailaender/starting-units-classname
Fixed lobby start unit notifications not showing class names
2014-08-19 10:15:12 +12:00
obrakmann
f161d87d07 Merge pull request #6271 from pchote/map-kick-fix
Avoid sending the map change order when selecting the same map.
2014-08-18 20:01:15 +02:00
Paul Chote
774e516106 Suppress map change order when selecting the same map. Fixes #6206. 2014-08-19 00:13:48 +12:00
Paul Chote
fce732b060 Merge pull request #6255 from ScottNZ/generals
Add support for C&C Generals .big archive files
2014-08-18 22:21:21 +12:00
Matthias Mailänder
fa2b2bea0b beautify starting unit notification when joining server
move LobbySettingsNotification into it's own ServerTrait
2014-08-17 07:39:34 +02:00
ScottNZ
009dc79222 Add support for C&C Generals .big archive files 2014-08-17 17:02:38 +12:00
Paul Chote
e2ede4ec24 Merge pull request #6201 from cjshmyr/morelua
Add more Lua functions
2014-08-17 12:54:30 +12:00
Paul Chote
d9dc514d37 Merge pull request #6262 from Mailaender/silo-placement-loop-glitch-fix
Fixed silo fullness animations loop during building placement
2014-08-17 12:36:17 +12:00
Matthias Mailänder
da7caa6105 Merge pull request #6183 from UberWaffe/6030Fix_UpgradeRules
Closes #6177
Closes #6222
Closes #6240
Closes #6245
2014-08-16 18:07:56 +02:00
Matthias Mailänder
df09d16a1c Merge pull request #6218 from pchote/percentmods
Change attribute modifiers to use integers.
2014-08-16 17:28:37 +02:00
Matthias Mailänder
29dc1b574c fix silo animations playing during building placement
closes #6258
2014-08-16 17:17:25 +02:00
UberWaffe
256f6bdd7b Fixed custom weapon rules in maps. 2014-08-16 10:58:04 +02:00
UberWaffe
0ebe1c2c6a Made Effect, Resource and Smudge warheads return 0% effective against actors. 2014-08-16 10:58:04 +02:00
UberWaffe
fb2b63c7f8 #6030 regression fix. Added EffectivenessAgainst <= 0 check to IsvalidAgainst for Warhead. 2014-08-16 10:58:03 +02:00
UberWaffe
390ca380bd Fixed Warhead ValidTargets and InvalidTargets. 2014-08-16 10:58:02 +02:00
UberWaffe
0904b6a1a4 Fixed UpgradeRules for #6030. 2014-08-16 10:58:01 +02:00
Curtis Shmyr
cb4bd52fc0 Added more Lua functions 2014-08-15 19:51:02 -06:00
Paul Chote
c8b3628852 Merge pull request #6219 from Mailaender/auto-lua-update
Fixed the automatic wiki documentation update
2014-08-16 12:21:07 +12:00
Paul Chote
46e133d2c6 Merge pull request #6257 from Mailaender/d2k-light-offset
Fixed sprite offset for light vehicle factory roofs
2014-08-16 12:18:15 +12:00
Paul Chote
02a85b5474 Merge pull request #6173 from reaperrr/jamslater-ima-adpcm
Implement IMA ADPCM WAV file support
2014-08-16 11:20:03 +12:00
Paul Chote
c80a12f99c Merge pull request #5937 from reaperrr/explosions2
Implements more sophisticated explosion animation/sound system
2014-08-16 01:58:11 +12:00
Matthias Mailänder
f8f73e7ba7 Merge pull request #6250 from UberWaffe/#6149_AIRepair
Closes #6149
2014-08-15 06:23:47 +02:00
Matthias Mailänder
d3fbed8faa fix offset for light vehicle factories 2014-08-15 06:17:58 +02:00
Matthias Mailänder
1937e66cca Merge pull request #6248 from reaperrr/d2k-roof-fix
Fix D2k heavy factories roof ZOffset
2014-08-15 06:14:58 +02:00
Matthias Mailänder
53372b7f9d Merge pull request #6256 from jfinkels/patch-1
Fixes incorrect package name in INSTALL.md
2014-08-15 06:11:53 +02:00
jfinkels
79ac45814f Fixes incorrect package name in INSTALL.md
No package `libmono-winforms4.0-cil` exists in Debian or Ubuntu. The correct package name is `libmono-system-windows-forms4.0-cil`.
2014-08-14 23:47:10 -04:00
UberWaffe
1375e56a32 Fixes D2K AI constantly repairing weather damage. 2014-08-13 16:13:34 +02:00
reaperrr
42acb78aba Fixes D2k heavy factory roof displaying below exiting units.
Closes #6236.
2014-08-13 14:19:21 +02:00
James Slater
a5978b5c55 Implement IMA ADPCM WAV file support
Closes #4628
2014-08-13 13:25:28 +02:00
reaperrr
ef54f011bb Change ImpactTypes from array to bitfield approach. 2014-08-13 11:45:58 +02:00
ScottNZ
68712a89c5 Merge pull request #6226 from Mailaender/shroud-updatedregion-nre
Fixed a crash when there are no actors to reveal shroud on the map.
2014-08-12 23:05:23 +12:00
Matthias Mailänder
50ab941d1f avoid NullReferenceException in updatedRegion
fixes #6166
2014-08-12 06:19:34 +02:00
Paul Chote
7fb31dd3aa Upgrade mod rules. 2014-08-12 11:47:01 +12:00
Paul Chote
7e92ba9fdd Rename ProneSpeed to SpeedModifier in TakeCover. 2014-08-12 11:43:24 +12:00
Paul Chote
01cd6efbd0 Convert firepower modifiers to integer percentages. 2014-08-12 11:41:09 +12:00
Paul Chote
84d3497e96 Convert speed modifiers to integer percentages. 2014-08-12 11:41:09 +12:00
Paul Chote
0425416ce2 Convert damage modifiers to integer percentages. 2014-08-12 11:41:09 +12:00
Paul Chote
c5519a7f3b Merge pull request #6220 from obrakmann/fix6211
Make background of FMVPlayers in TD and RA black
2014-08-12 11:16:55 +12:00
obrakmann
63f8f19d1a Merge pull request #6230 from havok13888/AdvancedPowePlant
#5936 Advanced Power Plant have a different layout in the original
2014-08-11 23:16:27 +02:00
havok13888
9ea169b2c8 5936 Advanced Power Plant have a different layout in the original 2014-08-10 23:06:11 -05:00
Oliver Brakmann
0d85b7ee71 Make FMVPlayer in RA use a completely black background 2014-08-10 12:38:55 +02:00
Oliver Brakmann
1aafe0d4b3 Make FMVPlayer in TD use a completely black background
Fixes #6211.
2014-08-10 12:38:54 +02:00
Paul Chote
780fd0df29 Merge pull request #6215 from Mailaender/poland-raid-bots
Disabled bots on maps with separate land masses between destructible bridges
2014-08-10 12:30:03 +12:00
Matthias Mailänder
e4b96c9101 use the new orabot account 2014-08-09 19:22:42 +02:00
Matthias Mailänder
32be7df07c bring back the automatic wiki update
closes #5900
2014-08-09 14:12:35 +02:00
Matthias Mailänder
24a3fd3196 show a user friendly description of the starting unit template
closes #6209
2014-08-09 13:34:03 +02:00
Curtis Shmyr
381505cd19 Merge pull request #6189 from UberWaffe/6066_CratePrerequisites
6066 Crate Prerequisites
2014-08-08 23:14:58 -06:00
Curtis Shmyr
9bca508dd7 Merge pull request #6213 from ScottNZ/balance
Update crushing values for ra vehicles
2014-08-08 22:46:17 -06:00
Matthias Mailänder
97fffb43b0 Merge pull request #6212 from pchote/mapimport
Fix legacy map importer.
2014-08-09 06:24:24 +02:00
Matthias Mailänder
c51750d90b Update CONTRIBUTING.md 2014-08-09 06:09:53 +02:00
Matthias Mailänder
ca79ea9666 disallow bots on burlesca 2014-08-09 05:43:09 +02:00
Matthias Mailänder
e150172d0f disallow bots on poland raid 2014-08-09 05:40:51 +02:00
ScottNZ
578b587679 Let ra apc and minelayers crush infantry too 2014-08-09 13:37:46 +12:00
Paul Chote
4fa55e6c49 Fix legacy map importer. Fixes #6143. 2014-08-09 13:14:25 +12:00
ScottNZ
bfc4adf0c7 Make ra light tanks be able to crush infantry to improve usefulness
and be consistent with the rest of the ra tanks and ra1's light tank
2014-08-09 13:08:50 +12:00
Paul Chote
58b39616f6 Merge pull request #6193 from obrakmann/fix6045
Fix breakage of --upgrade-map in OpenRA.Utility
2014-08-09 12:52:15 +12:00
Paul Chote
54fa8e4d30 Merge pull request #6182 from obrakmann/fix6172
Fix observer widgets not showing up when a player loses
2014-08-09 12:45:54 +12:00
Paul Chote
d15dbb2332 Merge pull request #6059 from obrakmann/mission-objectives
Mission objectives
2014-08-09 12:39:12 +12:00
UberWaffe
30e675a306 Added YamlException to GiveUnitCrateAction if no units are defined. 2014-08-08 17:00:04 +02:00
UberWaffe
9756132006 Update mods (only d2k and RA affected) crate actions to take tech levels and prerequisites into account. 2014-08-08 17:00:04 +02:00
UberWaffe
0ff9332844 Crate actions can now define required prerequisites. 2014-08-08 17:00:03 +02:00
Oliver Brakmann
c9ee475ca9 Added upgrade rules 2014-08-08 13:35:50 +02:00
Oliver Brakmann
00fcf5f969 Convert gdi01 to new Lua 2014-08-08 13:35:50 +02:00
Oliver Brakmann
8c43ffb802 Add some Media functions to new Lua API 2014-08-08 13:35:50 +02:00
Oliver Brakmann
d673520d82 Remove inconsistencies w.r.t the Surrender order
* Surrendering is now possible even in maps that do not use
  ConquestVictoryConditions.
* The Surrender button is greyed out instead of hidden when it cannot be
  used.
2014-08-08 13:35:50 +02:00
Oliver Brakmann
dc33e0e1b0 Make necessary changes to existing maps 2014-08-08 13:35:50 +02:00
Oliver Brakmann
819eb64011 Add end game dialog 2014-08-08 13:35:49 +02:00
Oliver Brakmann
8cec848a0f Add a mission objectives GUI panel 2014-08-08 13:35:49 +02:00
Oliver Brakmann
2c22e5099f Copy checkbox markings from TD to the other mods 2014-08-08 13:35:49 +02:00
Oliver Brakmann
7546e8237e Make CheckboxWidget honour GetText() 2014-08-08 13:35:49 +02:00
Oliver Brakmann
cca6646927 Add mission objectives to Lua interface 2014-08-08 13:35:43 +02:00
Oliver Brakmann
a448ba29a8 Move trigger lists into a dictionary for easier access and enumeration 2014-08-08 13:34:47 +02:00
Oliver Brakmann
6e3000ab0e Make Conquest- and StrategicVictoryConditions use objectives backend
Note: 3rd party KotH maps will need to be modified to work correctly
with this change.  Previously, StrategicVictoryConditions was a
supplement to ConquestVictoryConditions.  After this change, each works
by itself.  So KotH maps will need to remove the ConquestVictoryConditions
trait from the player definitions, or both victory conditions will have
to be satisfied to win the game.
2014-08-07 16:56:17 +02:00
Oliver Brakmann
a3bf3e7403 Add support for mission objectives
Objectives can be either primary or secondary objectives. Primary ones
influence the outcome of the game.  If all primary objectives are
completed the game is won, and lost when any of them fails.

Objectives can be added at any stage during the game, allowing to react
dynamically to game events.

The objectives backend only contains the information about the
objectives themselves. It does not check if objectives are completed or
failed.  Instead, the state of objectives must be manually marked. The
backend, however, does check whether the game is won or lost.
2014-08-07 16:56:17 +02:00
Curtis Shmyr
09652dad23 Merge pull request #6110 from pchote/unit-upgrades
Add an actor upgrade system (+ overhauls veterancy and crates)
2014-08-07 07:59:57 -06:00
Paul Chote
1a4f476ffa Replace CloakCrateAction with upgrades. 2014-08-07 20:44:30 +12:00
Paul Chote
2d062b790b Add FriendlyFire property to GivesExperience. 2014-08-07 20:44:29 +12:00
Paul Chote
de775e2f56 Reimplement unit levels using IUpgradable. 2014-08-07 20:44:28 +12:00
Paul Chote
0ca5336072 Reimplement UnitUpgradeCrate using IUpgradable. 2014-08-07 20:43:27 +12:00
Paul Chote
bf5da145b0 Introduce IUpgradable and purchasable unit upgrades. 2014-08-07 20:40:47 +12:00
Paul Chote
4cf822cd00 Support production of actors without IFacing. 2014-08-07 20:40:47 +12:00
obrakmann
2512bc52f8 Merge pull request #6134 from Mailaender/lobby-notify-followup
Made the lobby notifications less spammy and added some more cases
2014-08-06 19:58:15 +02:00
obrakmann
8efc8ccd4d Merge pull request #6151 from Mailaender/disable-idle-overlay-during-transform
Fixed idle overlays being displayed during actor transformations
2014-08-06 19:31:12 +02:00
obrakmann
42d8a9fe29 Merge pull request #6150 from Mailaender/disable-music-install-during-games
Disabled music installation during matches
2014-08-06 16:47:11 +02:00
Taryn Hill
5627fad797 Merge pull request #6194 from obrakmann/fix6192
Fix Apache's guns being blocked by walls in TD.
2014-08-06 09:23:42 -05:00
Oliver Brakmann
53b02b05ca Fix Apache's guns being blocked by walls in TD.
Closes #6192.
2014-08-06 14:00:05 +02:00
Oliver Brakmann
229f17ab85 Fix breakage of --upgrade-map in OpenRA.Utility
Closes #6045
2014-08-06 13:39:28 +02:00
Igor Popov
55729891de Merge pull request #6188 from cjshmyr/luaparse
Log reason why a Lua script fails to parse
2014-08-06 11:39:27 +04:00
Curtis Shmyr
b572c9b5eb Add an ingame message if a Lua FatalError call occurs 2014-08-05 22:37:00 -06:00
Curtis Shmyr
2d93918469 Log reason why a Lua script fails to parse 2014-08-05 22:36:42 -06:00
reaperrr
09b887abf2 Streamline isValid check. 2014-08-05 13:19:26 +02:00
reaperrr
8be7f127d9 Fix descriptions. 2014-08-05 13:11:30 +02:00
Oliver Brakmann
b85d5a9193 Fix observer widgets not showing up when a player loses
Fixes #6172.
2014-08-05 12:52:04 +02:00
Matthias Mailänder
cacb9fee64 Merge pull request #6100 from atlimit8/Implement6086
Closes #6086
2014-08-05 06:36:11 +02:00
atlimit8
b669029194 reverted mod.yaml in cnc, d2k, & ra 2014-08-04 18:12:14 -05:00
atlimit8
898bf4959a Remove sub-cell offset bounds checking 2014-08-04 18:09:26 -05:00
atlimit8
9b30c21f93 Load subcells and default subcell index from mod.yaml 2014-08-04 18:09:26 -05:00
atlimit8
4b7537bb13 Moved MobileInfo.SubCellOffsets to Map (dropping static) & added Map.SubCellsDefaultIndex 2014-08-04 18:09:26 -05:00
atlimit8
43478dd500 enum SubCell => int & Dictionary<SubCell, WVec> => WVec[] 2014-08-04 18:09:26 -05:00
reaperrr
7513380e08 New explosion system yaml changes. 2014-08-04 23:24:52 +02:00
reaperrr
8798658b35 New Explosion system code changes. 2014-08-04 23:24:51 +02:00
reaperrr
e3d85f29c9 Merge pull request #6169 from UberWaffe/CWRegressFix
#6030 Regression fix: CreateEffectWarhead
2014-08-04 20:59:13 +02:00
Matthias Mailänder
050d55397d Merge pull request #6156 from UberWaffe/MinorFixes
Closes #6128
2014-08-04 20:01:40 +02:00
Matthias Mailänder
b2b1b38044 Merge pull request #6158 from Phrohdoh/DocPrintRequires
Write trait requirements in documentation.
2014-08-04 19:54:53 +02:00
UberWaffe
0f8023217d #6030 Regression fix. CreateEffectWarhead effect location and water impact sound. 2014-08-04 18:09:52 +02:00
UberWaffe
4055d8178d Bridge can now define DemolishWeapon. Defaults to previous "Demolish". 2014-08-04 16:13:21 +02:00
UberWaffe
4f18cb5fc0 IonCannonPower can now define how many ticks into animation the weapon impact happens (as opposed to at the end of the animation). 2014-08-04 16:12:18 +02:00
Taryn Hill
c3c5cd04cc Write trait requirements in documentation. 2014-08-03 21:37:37 -05:00
Chris Forbes
c482e97060 Merge pull request #6152 from Mailaender/money-crate
Added money crates to be spawned by destroyed supply trucks
2014-08-04 10:39:29 +12:00
Taryn Hill
31a7678473 Merge pull request #6163 from Mailaender/shrapnel-lowercase-weapon
Fixed ThrowsShrapnel not using lower case weapon names.
2014-08-03 15:20:30 -05:00
Matthias Mailänder
54e36ecf30 use ToLowerInvariant for all weapon rules 2014-08-03 22:14:00 +02:00
Matthias Mailänder
dd2981a3b4 Merge pull request #6155 from Phoib/sonicbeam
Sonic Tank offset
2014-08-03 21:41:37 +02:00
Matthias Mailänder
aa74046403 Merge pull request #6160 from cjshmyr/returntobase
Remove TakeOff activity from ReturnToBase
2014-08-03 21:11:16 +02:00
Curtis Shmyr
ed08bafd54 Remove TakeOff activity from ReturnToBase 2014-08-03 12:50:01 -06:00
Matthias Mailänder
33655afe21 Merge pull request #6127 from cjshmyr/attackcharge
Fixes #5568
2014-08-03 17:51:28 +02:00
Phoib
59936ab834 Sonic Tank offset 2014-08-03 17:42:47 +02:00
Taryn Hill
b6fd757672 Merge pull request #6030 from UberWaffe/CustomWarheads
Custom Warheads refactor
2014-08-03 10:35:36 -05:00
UberWaffe
c972b39687 Custom Warheads refactor
Changes included:

Warhead code split out of weapon code and refactored.
Warhead functionality now split into several classes, each handling one effect/impact.

Additional custom warheads can now be defined and called via yaml.
Custom warheads inherit the abstract class Warhead,
which provides target check functions.

Custom warheads have to define their own impact functions,
and can also define their own replacement for check
functions.
2014-08-03 17:10:44 +02:00
Matthias Mailänder
98106e2ff7 ContainsCrate is redundant to LeavesHusk 2014-08-03 16:30:45 +02:00
Matthias Mailänder
57463f249c let supply trucks spawn money crates upon destruction 2014-08-03 16:30:41 +02:00
Matthias Mailänder
aa8ce199c2 self-document CrushClass of crates 2014-08-03 16:26:19 +02:00
Matthias Mailänder
91b612fa47 ITeleportable does not exist anymore 2014-08-03 16:26:18 +02:00
Matthias Mailänder
611c803a3a don't display idle overlays during actor transformations
fixes #6018
2014-08-03 15:02:30 +02:00
Matthias Mailänder
282b16e3fc disable music installation during a game
closes #6058
2014-08-03 14:38:47 +02:00
Matthias Mailänder
658ae241dc notify about difficulty level changes 2014-08-03 14:20:09 +02:00
Matthias Mailänder
ed2e4eef17 make the change notifications more natural 2014-08-03 14:19:46 +02:00
Matthias Mailänder
0502d90a05 Merge pull request #6084 from pchote/renderpreview
Improve actor preview rendering
2014-08-03 12:51:21 +02:00
Matthias Mailänder
7305216f7b Merge pull request #6129 from pchote/production-hotkeys
Closes #3915
Closes #4142
Closes #4181
Closes #6031
2014-08-03 12:28:54 +02:00
Matthias Mailänder
56765d5ca2 remove unneccessary build-top sequences. 2014-08-03 22:23:49 +12:00
Paul Chote
b5e4e0e074 Add support for voxels in actor previews. 2014-08-03 22:23:49 +12:00
Paul Chote
3903b9b2b5 Add support for rotors in actor previews. 2014-08-03 22:23:49 +12:00
Paul Chote
7c434507f1 Add support for idle overlays in actor previews. 2014-08-03 22:23:49 +12:00
Paul Chote
c6b6b5d153 Add support for turrets in actor previews. 2014-08-03 22:23:49 +12:00
Paul Chote
9b3a73860c Account for infantry in actor previews. 2014-08-03 22:23:48 +12:00
Paul Chote
79dabe01e8 Account for walls in actor previews. 2014-08-03 22:23:48 +12:00
Paul Chote
b91fe10cad Account for building turret facing in actor previews. 2014-08-03 22:23:48 +12:00
Paul Chote
7fb106e54a Introduce actor previews for PBOG and the editor. 2014-08-03 22:23:47 +12:00
Paul Chote
103cc65b5b Change legacy menu button labels. 2014-08-03 22:21:31 +12:00
Matthias Mailänder
061ab42896 announce kicks and bans 2014-08-03 09:41:23 +02:00
Matthias Mailänder
65049f6212 announce map changes 2014-08-03 09:38:15 +02:00
Matthias Mailänder
b382c0339f only notify when the lobby settings differ from the default 2014-08-03 09:31:25 +02:00
Paul Chote
e827b343ab Disable multiple-queuing from the keyboard. 2014-08-03 19:28:10 +12:00
Paul Chote
0006f4dd2f Remaining hotkey changes. 2014-08-03 19:28:10 +12:00
Paul Chote
5d90b2016f Change status bar hotkeys to match C&C3. 2014-08-03 19:28:10 +12:00
Paul Chote
8b5fd454df Change unit selection hotkeys to match C&C3. 2014-08-03 19:28:10 +12:00
Paul Chote
9626654f87 Redefine orderbutton and menu hotkeys. 2014-08-03 19:28:09 +12:00
Paul Chote
6f19290aeb Add queue hotkeys to RA, and make TD consistent with C&C3. Fixes #6031. 2014-08-03 19:28:09 +12:00
Paul Chote
f64cdc52e1 Remove obsolete key definitions. 2014-08-03 19:28:09 +12:00
Paul Chote
43bd8a361e Implement new production hotkeys. Fixes #3915, #4142, #4181. 2014-08-03 19:28:07 +12:00
Paul Chote
ef2f909f65 Reorganize IBodyOrientation. 2014-08-03 19:20:40 +12:00
Paul Chote
8579ae956a ToLowerInvariant RenderSprites.GetImage.
Some mods (d2k) define bogus-case sequence names.
2014-08-03 19:20:39 +12:00
Paul Chote
61b7e63e77 Merge pull request #6133 from ScottNZ/power
Move Power out of Building and into its own trait
2014-08-03 19:09:42 +12:00
ScottNZ
692e3a9c88 Move Power out of Building and into its own trait
Conflicts:
	mods/ts/rules/structures.yaml
2014-08-03 18:53:51 +12:00
Paul Chote
9527d7c2f4 Merge pull request #6136 from ScottNZ/infiltration
Infiltration refactor
2014-08-03 18:29:23 +12:00
Paul Chote
5b8a70728d Merge pull request #6069 from atlimit8/LineBuild-1x1Only
Makes LineBuild logic require building dimensions of 1x1
2014-08-03 16:16:56 +12:00
ScottNZ
8e062864ce Merge pull request #6135 from pchote/support-fix
Fix instant-use and AllowMultiple support powers.
2014-08-03 16:12:50 +12:00
Paul Chote
2bfd1aa56a Merge pull request #6022 from Phrohdoh/MoveToShroud
Locomotion MovesToShroud bool.
2014-08-03 12:58:06 +12:00
Curtis Shmyr
52aedf4b75 Fix AttackCharge not picking a new target if the current became invalid 2014-08-02 12:26:06 -06:00
ScottNZ
ca4b947037 Rename IAcceptInfiltrator to INotifyInfiltrated 2014-08-02 22:36:44 +12:00
ScottNZ
058185754e Remove Infiltratable trait and refactor surrounding code to use target types 2014-08-02 22:31:46 +12:00
Paul Chote
efebb500f0 Fix instant-use and AllowMultiple support powers.
Fixes #2185, #6090.
2014-08-02 21:30:29 +12:00
Matthias Mailänder
9422285aa2 Merge pull request #6108 from havok13888/LobbyInfoNotification
Closes #6012
2014-08-02 07:19:23 +02:00
Taryn Hill
d6931f1d05 Added flag to Mobile/AircraftInfo: MoveIntoShroud.
Does not change the audio feedback given.
2014-08-01 20:43:29 -05:00
havok13888
65c77677d4 Inform client about changes in lobby options 2014-08-01 15:41:02 -05:00
atlimit8
0a9f54e0ab Makes LineBuild logic require building dimensions of 1x1 2014-07-31 16:47:44 -05:00
Matthias Mailänder
f84b1c145e Merge pull request #6098 from pchote/select-hotkey
Fix unit selection hotkeys for players.
2014-07-31 19:25:58 +02:00
Matthias Mailänder
6ef315217a Merge pull request #6113 from atlimit8/FieldLoadWVecArray
Load WVec[] from MiniYaml
2014-07-31 19:21:56 +02:00
Matthias Mailänder
5618960329 Merge pull request #6121 from ScottNZ/bleed
Add ITraitInfo constraint to Requires<T>
2014-07-31 19:08:18 +02:00
Taryn Hill
738c80bb2a Merge pull request #6102 from ihptru/masterplayers
send player names to master server
2014-07-31 06:59:25 -05:00
ScottNZ
9f2e0e181f Add ITraitInfo constraint to Requires<T> 2014-07-31 22:43:37 +12:00
Igor Popov
78c9585fbe Merge pull request #6111 from abcdefg30/fixmaptiles
Fixed 'seven-stairs' and 'room-warzone'
2014-07-31 09:08:29 +04:00
atlimit8
d1b0dce751 Applied VWec[] yaml loader 2014-07-30 22:59:15 -05:00
ihptru
b76d9ed2e4 send player names to master server 2014-07-30 23:42:34 +04:00
atlimit8
d79ab8070d Added the abiltity to load WVec[] from MiniYaml 2014-07-30 14:34:28 -05:00
abcdefg30
c4f37344a0 Fixed 'seven-stairs' and 'room-warzone' 2014-07-30 13:13:23 +02:00
Curtis Shmyr
de1c80af88 Merge pull request #6105 from WolfGaming/FixTech
Fixes Maps not being able to force tech levels
2014-07-29 20:33:45 -06:00
WolfGaming
d44a5226f5 Fixes Maps not being able to force tech levels 2014-07-29 22:08:36 +00:00
Paul Chote
13656710ca Fix unit selection hotkeys for players. Fixes #5753.
This also explicitly disables them for spectators.
2014-07-29 23:32:47 +12:00
Paul Chote
e3d2104fe3 Merge pull request #6070 from ScottNZ/kenneltech
Move dog to kenn and make kenn buildable
2014-07-29 23:14:17 +12:00
Paul Chote
a9a7f1e5b2 Merge pull request #6088 from obrakmann/fix5939
Remove a spot harvesters had trouble accessing in Sea & Cake map
2014-07-29 22:54:28 +12:00
Oliver Brakmann
19de147551 Remove a spot harvesters had trouble accessing in Sea & Cake map
Fixes #5939
2014-07-29 07:45:10 +02:00
obrakmann
d96c3747be Merge pull request #6085 from UberWaffe/AIRepairFix
Fix AI not repairing buildings if struck by support powers.
2014-07-29 00:46:36 +02:00
Taryn Hill
40d1327939 Merge pull request #6087 from ScottNZ/planerepulsion
Add plane repulsion
2014-07-28 17:25:52 -05:00
Chris Forbes
031c58c10e Merge pull request #6094 from cjshmyr/madfix
Prevent MAD tanks executing multiple StartDetonationSequence activities
2014-07-29 09:42:29 +12:00
Curtis Shmyr
1afdd4d0ac don't let MAD tanks run multiple StartDetionationSequence activities 2014-07-28 15:31:15 -06:00
Matthias Mailänder
56dcba5e47 Merge pull request #6091 from pchote/fixup-d2k-logo
New D2K mod logo (fixed)
2014-07-28 19:35:39 +02:00
ScottNZ
4d355d381d Remove repulsion from ra badgers, adjust mig and yak balance to compensate for new repulsion 2014-07-29 00:18:22 +12:00
ScottNZ
de29b41103 Remove repulsion from d2k planes 2014-07-29 00:18:22 +12:00
ScottNZ
d6fd507b04 Remove repulsion from a10 and c17 2014-07-29 00:18:21 +12:00
ScottNZ
16a30fd6b1 Add plane repulsion logic 2014-07-29 00:18:13 +12:00
Sebastien Kerguen
c540495abf new D2K mod logo 2014-07-28 16:52:22 +12:00
Paul Chote
8de8e67423 Merge pull request #5845 from Mailaender/new-lua-chatline
Added Media.AddChatLine to the new Lua API
2014-07-28 16:42:29 +12:00
UberWaffe
b67a17add0 Fix AI not repairing buildings if struck by support powers. 2014-07-27 12:58:52 +02:00
Matthias Mailänder
e488365f85 add a simple test case 2014-07-27 07:34:31 +02:00
Matthias Mailänder
405d21d797 add Game.AddChatLine to the new Lua API 2014-07-27 07:34:24 +02:00
ScottNZ
88ea7f1c7e Take BuiltAt overrides into account when calculating speedup - prevent kennels contributing to rifle infantry speedup for example 2014-07-27 14:33:55 +12:00
Matthias Mailänder
a57c9c5cf3 Merge pull request #6074 from deniz1a/chrono-curtain-select
Fixes #5166
2014-07-26 17:41:30 +02:00
Deniz Ayıkol
943848e853 Fix support power selector revealing cloaked enemy units.
Delete unnecessary using line.

Fix spacing.
2014-07-26 18:38:25 +03:00
Matthias Mailänder
c67414c4f1 Merge pull request #5993 from obrakmann/fix5651_take2
More aircraft/shroud interaction fixes
2014-07-26 15:43:16 +02:00
Oliver Brakmann
e97efc89cb Make aircraft not waste their missiles by firing from outside the map
Fixes #6001.

This obviously affects Yaks as well as Migs, even though Yaks had no
trouble with attacking from outside the map.
2014-07-26 11:05:41 +02:00
Oliver Brakmann
ad2327828d Make actors outside map borders selectable for their owner
PR #5967 only made planes not lose their selection when they strayed
outside the map border. This PR makes it possible to select them when
they already are outside the map.  It also ensures that the selection
decorations are drawn.  Rank designations, however, will disappear when
a unit leaves the map.

Fixes #5651 for real, then.
2014-07-26 11:05:41 +02:00
Matthias Mailänder
2d02e3f04a Merge pull request #5972 from pchote/new-ra-ui
Closes #2394
Closes #2385
Closes #4980
Closes #5108
2014-07-26 10:22:03 +02:00
ScottNZ
b21f0eaf20 Fix dog breakage in Intervention 2014-07-26 20:19:29 +12:00
Paul Chote
f9c7d2735c Replace source art with a more portable psd. 2014-07-26 19:26:03 +12:00
Paul Chote
d88b27745b Fix observer buttons. 2014-07-26 19:26:03 +12:00
Matthias Mailänder
2637c99d25 Merge pull request #5991 from obrakmann/fix5976
Make sure actors are removed from control groups when captured
2014-07-26 09:25:19 +02:00
Paul Chote
f9fcded77c Add icons to the production tooltip. 2014-07-26 18:20:10 +12:00
Paul Chote
7c9223caea Add tooltips for the power and cash displays. 2014-07-26 18:20:10 +12:00
Paul Chote
f7f01cc08e Add hotkey support to ProductionPaletteWidget. 2014-07-26 18:20:10 +12:00
Paul Chote
fa0b33a1ea Re-enable the ready colour blinking. 2014-07-26 18:20:10 +12:00
Paul Chote
0c607ffff2 Move legacy widgets into D2K project. 2014-07-26 18:20:10 +12:00
Paul Chote
92c0520d9c Add tab click sounds to RA. 2014-07-26 18:20:10 +12:00
Paul Chote
a0e5554aaa Overhaul the RA sidebar UI. 2014-07-26 18:20:09 +12:00
Paul Chote
f779606433 Split TS ingame chrome. 2014-07-26 18:20:09 +12:00
Paul Chote
8f05e04a1f Add icon glyphs for naval, powerdown and diplomacy (for use in RA). 2014-07-26 18:20:09 +12:00
Paul Chote
c1e83d9415 Support trimmed production icon rectangles. 2014-07-26 18:20:09 +12:00
Paul Chote
6d96d46081 Move ProductionQueueFromSelection into RA and generalize. 2014-07-26 18:20:09 +12:00
Paul Chote
17d601113e Move SupportPowersWidget into RA and generalize. 2014-07-26 18:20:08 +12:00
Paul Chote
ae9a3075a9 Add a logic class for faction-specific backgrounds. 2014-07-26 18:20:08 +12:00
Paul Chote
cbfc8e0b27 Blink the power display red when low power. 2014-07-26 18:20:08 +12:00
Paul Chote
dee6a9bac4 Support fading the area behind the radar to black. 2014-07-26 18:20:08 +12:00
Paul Chote
fda3ae2fb0 Make the diplomacy panel consistent with cheats and menu. 2014-07-26 18:20:08 +12:00
Paul Chote
9e2b3ce0b8 Unify cheats -> debug and adjust plumbing for new RA UI. 2014-07-26 18:20:08 +12:00
Paul Chote
e7ae615ac9 Split the last TD UI logic into reuseable chunks. 2014-07-26 18:20:07 +12:00
Paul Chote
ef00411931 Add support for single-line time display. 2014-07-26 18:20:07 +12:00
Paul Chote
2de9d3780b Extract ProductionPalette background drawing into logic code. 2014-07-26 18:20:07 +12:00
Paul Chote
54b5da3460 Don’t crash if there are no production icons. Fixes #5543. 2014-07-26 18:20:07 +12:00
Paul Chote
1e76baf070 Move TD production widgets into the RA project. 2014-07-26 18:20:07 +12:00
Paul Chote
ba21428276 Hide invalid hotkey from button tooltips. 2014-07-26 18:20:06 +12:00
Paul Chote
90403ad40b Fix mouseover filtering in cloned widgets. 2014-07-26 18:20:06 +12:00
Paul Chote
4fb9e59402 Allow ImageWidget to filter mouse events. 2014-07-26 18:20:06 +12:00
Paul Chote
d8b6eac64e Fix mouse event filtering in BackgroundWidget. 2014-07-26 18:20:06 +12:00
Matthias Mailänder
1d0538526d Merge pull request #6040 from pchote/more-renderables
Convert RenderAfterWorld to use Renderables.
2014-07-26 07:28:53 +02:00
ScottNZ
2a4d8a33b9 Move dog to kenn and make kenn buildable 2014-07-26 16:29:23 +12:00
Matthias Mailänder
5e02042629 Merge pull request #6061 from MustaphaTR/d2k-starting-units
Added grenadier as Atreides starting unit
2014-07-26 06:11:45 +02:00
Paul Chote
fffffb8c7c Merge pull request #6014 from atlimit8/FixBuildingsLockedOnWorldLoad
Fix buildings locked on world load
2014-07-26 16:01:28 +12:00
Paul Chote
b55e15f37f Merge pull request #6065 from atlimit8/SellNonBuildings
Sell non buildings
2014-07-26 15:52:33 +12:00
atlimit8
4d23b71f2c Fixed D2K turrets. 2014-07-25 19:53:23 -05:00
atlimit8
0ba1fdcea3 Allow actors that are not buildings to be sold.
The more humane way to refund units (as opposed the grinding them).
2014-07-25 18:00:50 -05:00
atlimit8
72a30e2157 Appears to fix sticky locking of preplaced buildings 2014-07-25 17:07:15 -05:00
atlimit8
0319b8cbda INotifyCreated 2014-07-25 17:07:15 -05:00
atlimit8
027887aa13 AUTHORS 2014-07-25 17:03:05 -05:00
obrakmann
478168cac7 Merge pull request #6062 from ihptru/masterphp
remove .php prefixes related to master server
2014-07-25 19:24:15 +02:00
ihptru
3ef8d76bfe remove .php prefixes related to master server 2014-07-25 19:55:54 +04:00
Mustafa Alperen Seki
a7a65bf213 Added Grenadier as Atreides starting unit 2014-07-25 16:51:55 +03:00
Paul Chote
0884722c4b Change IOrderGenerator.RenderAfterWorld to return Renderables. 2014-07-25 21:14:39 +12:00
Paul Chote
da6ecbf92e Change IPostRenderSelection and IPlaceBuildingDecoration to return renderables. 2014-07-25 21:14:39 +12:00
Paul Chote
8ac9477cd9 Add UISpriteRenderable for screen-space decorations. 2014-07-25 21:14:39 +12:00
Paul Chote
1beff77c6a Split selectable rendering into *Renderables. 2014-07-25 21:14:39 +12:00
Paul Chote
c4bcf0af46 Introduce RangeCircleRenderable. 2014-07-25 21:14:39 +12:00
Paul Chote
48bbac5c6f Merge pull request #5910 from Phrohdoh/CloningVats
Added cloning trait pair for RA2-style Cloning Vats.
2014-07-25 17:53:54 +12:00
Taryn Hill
b4cecff74e ClonesProductionUnits:
string[] CloneableTypes	checks Cloneable.Types

Cloneable:
	string[] Types checked by ClonesProductionUnits.CloneableTypes

Added INotifyOtherProduction
	for notifying self when another actor
	produces a unit.
2014-07-24 19:08:08 -05:00
Matthias Mailänder
e24b9323c8 Merge pull request #6053 from deniz1a/chat-focus
Closes #4722
2014-07-24 22:40:42 +02:00
Matthias Mailänder
79a9b531ea Merge pull request #5941 from reaperrr/spread-upgrade
Added MaxSpread for more control over maximum area of damage
2014-07-24 22:18:03 +02:00
Matthias Mailänder
bc8a9d754c Merge pull request #6035 from pchote/merge-air-queues
Merge RA aircraft queues
2014-07-24 22:04:50 +02:00
Matthias Mailänder
d756d5b0c8 Merge pull request #6052 from deniz1a/mcv-pri
Increase MCV selection priority
2014-07-24 21:51:02 +02:00
Deniz Ayıkol
f08c463181 Cnc: Increase MCV selection priority. 2014-07-24 15:18:37 +03:00
Deniz Ayıkol
17ea6e1ec2 Make lobby chat field have keyboard focus by default. 2014-07-24 14:59:11 +03:00
Deniz Ayıkol
7780862bdd Increase MCV selection priority. 2014-07-24 13:58:55 +03:00
Paul Chote
2a5d7b73f6 Add BuildAtProductionType to boats/subs. 2014-07-24 21:04:35 +12:00
Paul Chote
90d310690b Merge the RA aircraft queues. Closes #5961. 2014-07-24 20:45:28 +12:00
Paul Chote
c164ec8c8c Add Buildable.BuildAtProduction.
This allows actors to be restricted to specific production structures.
2014-07-24 20:45:28 +12:00
Paul Chote
8837b3453c Merge pull request #6036 from Mailaender/trait-export-decimal-separators
Fixed country specific decimal separators in the traits documentation
2014-07-24 20:42:12 +12:00
Paul Chote
b2e7cf8edb Merge pull request #5853 from RoosterDragon/actormap-perf
Sped up ActorMap.ActorsInBox.
2014-07-24 20:40:15 +12:00
Paul Chote
51f69110d0 Merge pull request #6046 from ihptru/masterserver
send 'spectators' and 'protected' to master server
2014-07-24 20:31:35 +12:00
Paul Chote
a7fc41b87e Merge pull request #5943 from pavlos256/fieldloader
Fieldloader and non-public fields
2014-07-24 20:29:25 +12:00
Paul Chote
a2e6feac2a Merge pull request #5850 from pavlos256/game-loop
Improve the game loop
2014-07-24 20:24:08 +12:00
ihptru
26a6f45b8f send 'spectators' and 'protected' to master server; fixes #6041 2014-07-23 23:41:46 +04:00
Matthias Mailänder
93e34a10f0 Merge pull request #6042 from MustaphaTR/bleed
Fixed Atreides Barracks Make Anim.
2014-07-23 19:51:39 +02:00
Matthias Mailänder
20a052d16b Merge pull request #6044 from UberWaffe/CrateMultiUnitsFix
Regression and UpgradeRules fix for #5921.
2014-07-23 19:10:33 +02:00
UberWaffe
2b73fa027b Fixes as per comments. (+1 squashed commits)
Squashed commits:

[c3abf4b] Fixes as per comments. (+1 squashed commits)

Squashed commits:

[a289d17] Regression and UpgradeRules fix for #5921.
2014-07-23 16:47:15 +02:00
Chris Forbes
51316a76cc Merge pull request #6037 from Mailaender/component-tower-walls
Fixed walls not visually attaching to component towers
2014-07-23 21:24:19 +12:00
Chris Forbes
8f42b65f86 Merge pull request #6038 from Mailaender/idle-fly-doc
Documented FlyAwayOnIdle and ReturnOnIdle
2014-07-23 21:23:55 +12:00
Mustafa Alperen Seki
6700ac273e Fixed Atreides Barracks Make Anim. 2014-07-23 09:29:57 +03:00
Matthias Mailänder
778931f650 document ReturnOnIdle 2014-07-23 07:09:07 +02:00
Matthias Mailänder
249be6d9a7 separate and document FlyAwayOnIdle 2014-07-23 07:09:07 +02:00
Matthias Mailänder
d830a0a7ae Merge pull request #6029 from pchote/gametomods
Move *Renderables and Render* out of Game.
2014-07-23 06:54:42 +02:00
Matthias Mailänder
cefc848ee8 visually attach component towers to walls 2014-07-23 06:45:07 +02:00
Matthias Mailänder
8ce65f7310 same for double 2014-07-23 06:33:52 +02:00
Matthias Mailänder
32a4bedd6e don't use country specific decimal separators for decimals 2014-07-23 06:19:45 +02:00
Paul Chote
cffb1f27e4 Merge pull request #6002 from Mailaender/ts-wall-tower-attachment
Allowed walls to attach to component towers
2014-07-23 12:18:26 +12:00
Paul Chote
6b1cecc6b4 Add a workaround for the legacy map editor. 2014-07-23 11:40:30 +12:00
Paul Chote
1d77cd5391 Merge pull request #5851 from RoosterDragon/shroud-perf
Speed up shroud checks
2014-07-23 11:02:27 +12:00
Paul Chote
dab94bcc00 Merge pull request #5904 from ScottNZ/c4-flashtarget
Add target flashing for C4.
2014-07-23 10:36:54 +12:00
Chris Forbes
945455f15e Merge pull request #5973 from reaperrr/renderinf-unhardcode
Unhardcoded RenderInfantry sequence names
2014-07-23 09:58:07 +12:00
Chris Forbes
58ac641578 Merge pull request #5985 from RoosterDragon/random-try-collection
Improve Exts.Random
2014-07-23 09:57:23 +12:00
Chris Forbes
f68de0bbd8 Merge pull request #5921 from UberWaffe/CrateMultiUnits
Crate updates.
2014-07-23 09:50:54 +12:00
Chris Forbes
e023ad6a36 Merge pull request #5999 from Mailaender/trait-documentation-update-july-2014
Updated the trait documentation for modders
2014-07-23 09:49:02 +12:00
Chris Forbes
25d377770d Merge pull request #6007 from MustaphaTR/d2k-ai-improve
Improved D2K AI
2014-07-23 09:46:58 +12:00
Chris Forbes
c8f295a814 Merge pull request #5997 from reaperrr/compress-shps
Compressed shps of all currently shipping mods
2014-07-23 09:46:30 +12:00
Chris Forbes
72c92491a7 Merge pull request #6009 from psydev/patch-2
Nerf flame tank
2014-07-23 09:45:49 +12:00
Chris Forbes
90d5a76443 Merge pull request #6026 from MustaphaTR/d2k-map+tilefix
Added "Pasty Mesa" map and some tile fixes
2014-07-23 09:42:59 +12:00
Chris Forbes
707eefefc4 Merge pull request #6010 from psydev/patch-3
Minor balance tweaks for TD
2014-07-23 09:39:47 +12:00
Mustapha
8b0eb279c3 Added "Pasty Mesa" map and some tile fixes 2014-07-22 16:48:57 +03:00
ScottNZ
ad5e1cbe3a Merge pull request #6027 from OpenRA/revert-5763-build-shift+keypress
Revert "Make Shift+<Hotkey> queue five units/buildings. Fixes #5544."
2014-07-22 22:36:43 +12:00
Paul Chote
3744a1af25 Revert "Make Shift+<Hotkey> queue five units/buildings. Fixes #5544." 2014-07-22 20:16:47 +12:00
Paul Chote
029da5116b Move VoxelRenderable into Mods.RA. 2014-07-22 16:43:39 +12:00
Paul Chote
4589e93180 Move TextRenderable into Mods.RA. 2014-07-22 16:43:39 +12:00
Paul Chote
1cb6026c38 Move ContrailRenderable into Mods.RA. 2014-07-22 16:43:39 +12:00
Paul Chote
6005262992 Move BeamRenderable into Mods.RA. 2014-07-22 16:43:39 +12:00
Paul Chote
51abbad5ff Move RenderSprites and RenderSimple into Mods.RA. 2014-07-22 16:43:39 +12:00
Chris Forbes
3780a70045 Merge pull request #6021 from pchote/gtwr-fix
Give GTWR back to both factions.
2014-07-22 11:25:08 +12:00
Paul Chote
5d0282188c Give GTWR back to both factions. 2014-07-22 10:19:20 +12:00
Paul Chote
f62bec0530 Remove bogus Require<>s. 2014-07-21 23:50:15 +12:00
Mustafa Alperen Seki
7abde5fd32 Improved AI 2014-07-21 08:51:50 +03:00
Chris Forbes
8174cbc88f Merge pull request #5994 from deniz1a/prod_order
Reordered production palette according to prerequisites.
2014-07-21 13:50:49 +12:00
psydev
38937e4caa Reduce BikeRockets' speed a bit
Bike spam is quite effective, and seems almost too good at silencing opposition. After playtesting, it was found that reducing the speed of rockets gives whoever they are engaging a chance to fire back before dying.
(RangeLimit increased to compensate for speed change, to keep it above 6).
2014-07-20 18:26:15 -07:00
psydev
29208fbf5f Nerf Mobile SAM damage a bit
The Mobile SAM has been shown to be exceptionally powerful in small groups, being able to annihilate large groups of helis. While the cost could be increased, it seems like a few changes for now would be good and mitigate some of the OPness.

Changes:
-Replace quick-firing 2-burst and replace it with 1 shot per second.
-Reduce damage to 32. This will make it kill Apaches in 4 shots instead of 3.
-Reduce missile speed from 426 to 341. (This will also effectively reduce range limit from 12.5 cells to 10).
2014-07-20 18:11:48 -07:00
psydev
3aa3097f8a Reduce RangeLimit of Stealth Tank Missiles
Note: the "Range" value of the Stealth Tank remains the same. 

It has been noticed that the missiles of the stealth tank seem to go on for forever (~11.5 cells), making them inescapable; their range is 7, so this is a large difference. Their range limit is being reduced so they will travel only 8.3 cells now.
2014-07-20 18:01:52 -07:00
psydev
62fa566dce Reduce Stealth damage vs. infantry 35% -> 25%
Playtesting has shown that the Stealth Tank is a little bit too good against infantry, which are supposed to be its (soft) natural counter. They are the only units which can detect the stealth tanks, so it's important that they not die too easily. Right now it seems that stealth tanks are able to sit and fight infantry very easily, especially since they outrange them. This change will discourage stealth tanks from engaging infantry without care.
2014-07-20 17:45:37 -07:00
psydev
d38c722082 Reduce Flame Tank damage from 90 -> 75
As mentioned earlier, the reduction of the flame tank cost from $800 to $600 made it a bit too powerful. Playtesting with damage reduced to this level seemed to be reasonable.

The reason for reducing the cost to $600 was that few people were playing with the flame tank, since it costed a lot more than other units like the light tank. It seemed to be too much of a specialist and the added construction time (and cost) didn't appear to be worth it to players. It also seemed that people were not interested in risking the unit in battlefield offensives due to its cost. Part of the changes to the unit (increased damage vs. light, heavier armor, lower cost) were to make it more accessible for use against light vehicles (such as artillery), which it can destroy quickly, but which often result in its own death. A lower cost made the unit more usable in most mixed forces.
2014-07-20 17:40:01 -07:00
psydev
75293ba1ea Reduce Flame Tank HP
In playtesting, the Flame Tank has shown to be too powerful, especially when combined en masse with recon bikes. This is because its cost was reduced to $600 from $800. Reducing a few traits in further playtesting has made it more balanced.
2014-07-20 17:34:28 -07:00
psydev
554412d8e0 Reduce Flame Tank speed
It is a bit too fast, especially given that its armor was upgraded. Still faster than medium tank.
2014-07-20 17:32:42 -07:00
UberWaffe
cb6a724e48 Rename Race to ValidRaces. 2014-07-20 21:40:10 +02:00
UberWaffe
94b1f53ebf Rebased. (+1 squashed commits)
Squashed commits:

[43010a0] Fixes. (+1 squashed commits)

Squashed commits:

[94ee90e] Fixes. (+1 squashed commits)

Squashed commits:

[ef827c7] Style cop updates. Updates to LevelUp, Cloak, and UnitUpgrade to allow multiple units within range, plus maximum extra unit limit. (+1 squashed commits)

Squashed commits:

[2103b01] Dupe crate action updates and fixes. (+2 squashed commit)

Squashed commit:

[0f4df4a] Added DuplicateUnitCrateAction.

[2787fa1] Clarity update. (+1 squashed commits)

Squashed commits:

[93ddc3b] Crate updates.
+Multiple units per crate allowed.
+Allow time delay on crate actions.
2014-07-20 21:37:40 +02:00
Matthias Mailänder
2405ce3251 allow walls to attach to component towers 2014-07-20 19:00:04 +02:00
Matthias Mailänder
7d0f4a261f don't break apart when using empty IReadOnlyDictionary 2014-07-20 14:50:38 +02:00
Matthias Mailänder
1071a94d1d document traits 2014-07-20 14:50:37 +02:00
Matthias Mailänder
907188ccba configurable and self-documenting font name 2014-07-20 14:31:15 +02:00
Matthias Mailänder
547730c195 don't just repeat the name of the trait, but explain 2014-07-20 14:31:15 +02:00
Matthias Mailänder
40d0e20fe1 configurable and self-documenting idle sequence name 2014-07-20 14:31:13 +02:00
Matthias Mailänder
eec36b6d0c configurable and self-documenting color 2014-07-20 13:54:52 +02:00
Matthias Mailänder
ea478e8e7f configurable and self-documenting BuildPaletteWidgetName 2014-07-20 13:54:29 +02:00
Matthias Mailänder
1f7b6f431a fix trait info documentation not being displayed 2014-07-20 13:53:44 +02:00
Matthias Mailänder
7901c06e4c differentiate new/old Lua APIs 2014-07-20 13:53:12 +02:00
Matthias Mailänder
ef5178407c add spaces for proper linebreaks in trait documentation tables 2014-07-20 13:52:00 +02:00
reaperrr
582c1016e9 Merge pull request #5998 from Mailaender/ts-bibs
Added bibs to Tiberian Sun refinery and factories
2014-07-20 12:48:53 +02:00
Matthias Mailänder
702b3f7d20 these are already fixed with the addition of isometry 2014-07-20 11:29:12 +02:00
Matthias Mailänder
dbe64f496b add bibs to refinery and factories 2014-07-20 11:28:06 +02:00
Oliver Brakmann
ff90a7559d Make sure actors are removed from control groups when captured
Fixes #5976.
2014-07-20 02:49:58 +02:00
reaperrr
be1bd215c7 Compress/re-compress custom shps of D2k mod with XCC Mixer to reduce size. 2014-07-19 23:01:20 +02:00
reaperrr
811c6df291 Compress/re-compress custom RA mod shps with XCC Mixer to reduce size. 2014-07-19 22:59:43 +02:00
reaperrr
2a15dc313b Compress/re-compress several custom shps of TD mod with XCC Mixer to reduce size. 2014-07-19 22:56:55 +02:00
Deniz Ayıkol
686c043151 Put Minelayer.AT before Minelayer.AP 2014-07-19 20:16:34 +03:00
Deniz Ayıkol
6e8a002dad Reordered production palette according to prerequisites. 2014-07-19 19:36:36 +03:00
Matthias Mailänder
6c1efac235 Merge pull request #5977 from pchote/oi-keep-moving
Don’t cancel MoveAdjacentTo / MoveWithinRange when target becomes invalid
2014-07-19 09:39:32 +02:00
Matthias Mailänder
d2aa97c1d1 Merge pull request #5990 from pchote/repair-fix
Play the correct race notification when repairing an ally’s structure.
2014-07-19 08:08:05 +02:00
Paul Chote
850fcd5100 Fix a typo. 2014-07-19 18:03:21 +12:00
Paul Chote
5b0cee78cf Calculate a new path (and possibly new target cell) if the original path is blocked. 2014-07-19 18:03:21 +12:00
Paul Chote
e805461be7 Don’t cancel MoveAdjacentTo / MoveWithinRange when target becomes invalid.
Move to the last known position instead.  Fixes #5968.
2014-07-19 15:42:52 +12:00
Paul Chote
c2ba2fe12b Play the correct race notification when repairing an ally’s structure. 2014-07-19 15:33:06 +12:00
obrakmann
312041b9c8 Merge pull request #5988 from pchote/shellmap-paradrop
Fix scripted paradrops.
2014-07-19 05:01:27 +02:00
Oliver Brakmann
0cf49ad49f Fix old-lua paradrop too. 2014-07-19 14:42:36 +12:00
Paul Chote
87e425042f Fix scripted paradrops. 2014-07-19 14:40:29 +12:00
obrakmann
54191039a9 Merge pull request #5989 from pchote/frozen-target-fix
Fix frozen actors being targetable under shroud.
2014-07-19 04:16:56 +02:00
Paul Chote
bcc32d15ed Fix frozen actors being targetable under shroud. Fixes #5979, #5978. 2014-07-19 12:56:52 +12:00
Paul Chote
0f03d6bee8 Merge pull request #5987 from reaperrr/gem-mine-palette
Fixes gem mine desert palette
2014-07-19 12:00:49 +12:00
reaperrr
a447e35695 Fixes gem mine desert palette. 2014-07-18 22:47:11 +02:00
RoosterDragon
c672ac5bad Improve Exts.Random by testing if the input sequence is a collection, thus avoiding the need to create a copy to get the count.
Using the ElementAt method also means that if the sequence is a list too, then the selection can be done via the indexer rather the enumerating the elements.
2014-07-18 20:58:50 +01:00
Paul Chote
58abd45ed9 Merge pull request #5967 from obrakmann/fix5651
Fix aircraft losing selection outside the map borders
2014-07-18 20:36:02 +12:00
Paul Chote
8a65632851 Merge pull request #5965 from WolfGaming/CustomPrereqChange
Adds the RequiresPrerequisites field into ProvidesCustomPrerequisite
2014-07-18 20:29:11 +12:00
Oliver Brakmann
42f963d687 Fix aircraft losing selection outside the map borders
Fixes #5651
2014-07-18 10:03:57 +02:00
WolfGaming
7b10da6bde Adds the RequiresPrerequisites field into ProvidesCustomPrerequisite and all the logic behind it. 2014-07-18 06:11:03 +00:00
Chris Forbes
62820430de Merge pull request #5974 from pchote/cratefix
Fix unit collection crates and drop-zone maps.
2014-07-18 12:58:24 +12:00
abcdefg30
8f60b9b652 Fixed drop-zone units 2014-07-18 11:39:43 +12:00
reaperrr
1ba41a9af5 Unhardcodes RenderInfantry sequence names. 2014-07-17 20:59:08 +02:00
ScottNZ
04cd99cd75 Add target flashing for C4. Closes #4659 2014-07-15 16:06:38 +12:00
Paul Chote
e3dae2edd0 Replace the obsolete race check from GiveUnitCrateAction. 2014-07-15 10:15:35 +12:00
Paul Chote
8bce37710b Merge pull request #5955 from Squiggles211/production_cancel_fix
Restored PlaceBuilding order's ProductionQueue checks.
2014-07-14 20:06:50 +12:00
Chris Forbes
709f29184a Merge pull request #5954 from abcdefg30/fixhijacker
Made Hijacker buildable by soviets
2014-07-14 08:45:51 +12:00
Squiggles211
006f7b888a Restored production queue current item checks
Fixes regression #5948 where you could freely build any building by
canceling the production before deploying by restoring the currentItem
checks in the PlaceBuilding order to ensure that the production is still
valid.
2014-07-13 14:06:30 -05:00
abcdefg30
1ef3099910 Hijacker again buildable by soviets 2014-07-13 20:39:54 +02:00
Matthias Mailänder
aca0b9d7dd Merge pull request #5932 from MustaphaTR/d2k-only-inf-fix
D2K - Fixed some tiles should be only infantry
2014-07-13 08:34:06 +02:00
Chris Forbes
e7cd4e07f9 Merge pull request #5946 from Phrohdoh/MoreTraitDocs
Added some trait [Desc()]s.
2014-07-13 17:51:55 +12:00
Taryn Hill
da001385ae Added some trait [Desc()]s. 2014-07-12 13:31:14 -05:00
reaperrr
56eca3a5e3 Ion Cannon now scorches the whole hit area, and uses higher Spread + low
MaxSpread to increase damage within the hit area, but keep area of effect
itself relatively low.
Additionally increased damage to make it less inferior to Nukes.
2014-07-12 16:31:53 +02:00
reaperrr
eb96b72878 Add MaxSpread to Warhead to allow setting a specific area of effect. 2014-07-12 12:14:56 +02:00
Matthias Mailänder
a03d607878 Merge pull request #5930 from MustaphaTR/ra-oil-explode
RA - Explosive Oil Derricks
2014-07-12 11:25:30 +02:00
Chris Forbes
d8df332d97 Merge pull request #5940 from Mailaender/fort-lonestar-tech-disable
Fixed unbuildable high-tech on Fort Lonestar
2014-07-12 20:28:56 +12:00
Matthias Mailänder
e512799eeb disable tech properly 2014-07-12 09:47:42 +02:00
Matthias Mailänder
8afddd9497 Merge pull request #5938 from abcdefg30/fortlonestar
Fixed a bug in Fort Lonestar
2014-07-12 09:45:00 +02:00
Pavlos Touboulidis
dcb7a44aa2 Use available TypeConverters to serialize and deserialize types 2014-07-12 04:46:45 +03:00
Pavlos Touboulidis
451426bc3f Trivial typo in exception message 2014-07-12 04:35:31 +03:00
Pavlos Touboulidis
e9dd0b0fab Make FieldLoader/FieldSaver able to work with private fields
* Unify the FieldLoader-related attributes (Ignore, LoadUsing,
FieldFromYamlKey) into a new 'Serialize' attribute. Keep the
previous attributes as shortcuts/aliases to the new attribute.

* Add 'YamlName' field to the new 'Serialize' attribute to allow
yaml names different from the field names. Example:
    [Serialize(YamlName = "Width")]
    private int widthExpression = "0";

* The FieldLoader will treat private fields like public now and
will try to load their values. The FieldSaver gets an optional
parameter specifying whether to save private fields by default.
The 'Serialize' attribute can be used to fine-tune individual
fields.

* Updated the traits documentation exporter to write the yaml
name if it has been overriden.
2014-07-12 04:33:36 +03:00
abcdefg30
b87ea6ddef Update fort-lonestar.lua 2014-07-11 23:47:02 +02:00
Mustafa Alperen Seki
70af7f3595 Changed some tiles types 2014-07-11 16:34:16 +03:00
Mustafa Alperen Seki
b6a39c5993 Explosive Oil Derricks 2014-07-11 15:08:41 +03:00
Matthias Mailänder
a357bceb35 Merge pull request #5926 from pchote/ra-tabs
Fixes #5915
2014-07-11 13:42:21 +02:00
Matthias Mailänder
43242245b8 Merge pull request #5927 from MustaphaTR/ra-building-sort
Fixes #5914
2014-07-11 13:34:11 +02:00
Mustafa Alperen Seki
5fa4a5fa20 Sort Changes 2014-07-11 12:56:45 +03:00
Paul Chote
393702fe67 Fix bogus inconsistencies in the ra tab images:
- Soviet-normal tab glyphs were off by 1px.
- Allied-selected tabs had random semi-transparent pixels.
- Most tabs had a discoloured pixel near the left edge.
2014-07-11 20:04:03 +12:00
Paul Chote
1aacb21b04 Enable correct tab images for helicopters and aircraft. 2014-07-11 18:27:35 +12:00
Paul Chote
fc882437f0 Fix incorrect soviet tab image coordinates. 2014-07-11 18:26:00 +12:00
Daniel Hernandez
bac2b4f28e Add opposing-faction tab art for aircraft and navy, 2014-07-11 18:11:40 +12:00
Paul Chote
ee27b248d8 Remove bitrotted tab source artwork. 2014-07-11 18:09:32 +12:00
Paul Chote
fd2254f9db Merge pull request #5924 from Cr0s/patch-1
Fixed typo in HackyAI building placement code
2014-07-11 18:07:32 +12:00
Paul Chote
be2357f509 Merge pull request #5917 from pavlos256/deterministic-sort
Make tiles sorting deterministic in all cases
2014-07-11 17:53:08 +12:00
Cr0s
0f363d4c0f Fixed typo in HackAI building placement code 2014-07-11 05:44:45 +04:00
Matthias Mailänder
efeba3ec4f Merge pull request #5898 from MustaphaTR/d2k-techlevel
D2k Tech Level
2014-07-10 19:05:35 +02:00
Mustafa Alperen Seki
ec69e05433 Added D2K Tech Levels 2014-07-10 17:17:11 +03:00
Matthias Mailänder
6af834c436 Merge pull request #5901 from ScottNZ/techlevel
Add tech levels to ra
2014-07-10 15:07:46 +02:00
Matthias Mailänder
e8a7d4d93a Merge pull request #5911 from pchote/concrete-fix
Add AllowInvalidPlacement check to IsCellBuildable.
2014-07-10 13:41:02 +02:00
Pavlos Touboulidis
f45d063f1e Make tiles sorting deterministic in all cases
This may fix issue #5916.

In any case, it's wanted because this kind of sort is "unstable".
According to the docs:

    "This implementation performs an unstable sort; that is, if two
    elements are equal, their order might not be preserved."
2014-07-10 12:40:38 +03:00
Paul Chote
c6ed6dbeb9 Remove redundant overload and return early if outside map. 2014-07-10 20:34:17 +12:00
Matthias Mailänder
17310b7234 Merge pull request #5912 from pchote/powr-fix
Allow NormalizeSequence to remove existing damage prefixes.
2014-07-10 09:37:31 +02:00
Matthias Mailänder
d3128463c0 Merge pull request #5907 from reaperrr/misc-ts-fixes
More TS fixes & tuning
2014-07-10 09:04:22 +02:00
Paul Chote
2e9e4cff5c Allow NormalizeSequence to remove existing damage prefixes. Fixes #5909. 2014-07-10 17:16:46 +12:00
Paul Chote
05e1841e0e Add AllowInvalidPlacement check to IsCellBuildable. Fixes #5902. 2014-07-10 17:06:57 +12:00
Pavlos Touboulidis
b88b87b899 Improve game loop
Environment.TickCount was replaced with Game.RunTime that's based on
Stopwatch for increased accuracy.
2014-07-10 04:06:29 +03:00
reaperrr
69077629a7 Reduce infantry sequence tick values, fix Cyborg Commando idle shadow. 2014-07-09 20:14:21 +02:00
reaperrr
b09a301bb3 Added ^Tank default, adjusted movement penalties on terrain types. 2014-07-09 20:14:20 +02:00
reaperrr
1600b30fde Doubles Refinery storage capacity. 2014-07-09 20:14:19 +02:00
reaperrr
1973208694 Fixes Light Post. Closes #5903. 2014-07-09 20:13:38 +02:00
RoosterDragon
ffd2e8ea9d Sped up ActorMap.ActorsInBox.
- By ensuring both the add and remove actor lists are sets, we ensure the partitioning bins will contain only distinct actors. We can remove the HashSet and Distinct in ActorsInBox and ActorsInWorld which provides a nice speedup for queries. ActorsInBox sees nearly a 3x speedup in the RA shellmap.
2014-07-09 18:43:40 +01:00
ScottNZ
f8ad69889c Add tech levels to ra 2014-07-10 01:23:29 +12:00
Matthias Mailänder
fd68c81b15 Update .travis.yml
remove failing auto-wiki-update
2014-07-09 14:11:01 +02:00
Matthias Mailänder
5f1a0ddb99 Merge pull request #5899 from obrakmann/blinky-blinky
Change the colour of the blinking READY to gold
2014-07-09 13:09:46 +02:00
Oliver Brakmann
ab4a9388ce Change defaults for the production palette's ready sign
Default is now to blink alternating between white and gold.
2014-07-09 12:09:44 +02:00
Matthias Mailänder
a816956b5e Merge pull request #5897 from pchote/disable-green
Restore blinking ready label in RA.
2014-07-09 11:37:04 +02:00
Paul Chote
8b01ed034b Restore blinking ready label in RA. 2014-07-09 21:08:00 +12:00
Paul Chote
4471891cae Merge pull request #5896 from Mailaender/d2k-parachute-corpse
Fixed missing parachute corpses in Dune 2000
2014-07-09 21:00:28 +12:00
Paul Chote
2524ead1c4 Merge pull request #5892 from Mailaender/destroyed-repair-building-nre
Added a check if the rearm host building is gone
2014-07-09 20:55:20 +12:00
Paul Chote
15ec2b40f2 Merge pull request #5890 from Mailaender/negative-spawns-crash-fix
Made GetSpawnOccupants more robust against invalid list queries
2014-07-09 20:48:12 +12:00
Matthias Mailänder
dc2880e047 bring it in line with Rearm 2014-07-09 09:35:36 +02:00
Matthias Mailänder
26ed4c24be check if the host building is gone
fixes #5670
2014-07-09 09:25:06 +02:00
Matthias Mailänder
befb11ce69 add parachute corpses
fixes #5893
2014-07-09 09:16:27 +02:00
Matthias Mailänder
971ec55679 Merge pull request #5833 from pchote/cnc-techlevels
Closes #3221
2014-07-09 08:51:29 +02:00
Matthias Mailänder
3491d3b9f8 Merge pull request #5894 from pchote/warhead-nre
Fix NRE if a unit is damaged without a warhead.
2014-07-09 08:12:08 +02:00
Paul Chote
83b559befc Fix NRE if a unit is damaged without a warhead. 2014-07-09 18:02:27 +12:00
Paul Chote
4e1f7dedba Fix the bogus D2K AI definitions. 2014-07-09 17:50:14 +12:00
Paul Chote
a46baeaf2b Reorganise AI base building logic.
- Now obeys defined structure percentages and limits.
- Faster.
- More readable and maintainable code.
2014-07-09 17:50:14 +12:00
Paul Chote
c8bd8336f7 Remove super-spammy debug messages. 2014-07-09 17:50:14 +12:00
Paul Chote
ff78b0f7ea Add tech levels to TD. 2014-07-09 17:50:14 +12:00
Matthias Mailänder
5a891daa59 make GetSpawnOccupants more robust against invalid list queries
fixes #5588
2014-07-09 06:21:59 +02:00
Paul Chote
5e96bb3f8c Merge pull request #5824 from reaperrr/pronedamage
Moved ProneDamage to Warhead
2014-07-09 11:02:02 +12:00
Paul Chote
e5b863f926 Merge pull request #5698 from Mailaender/sonar
Added the sonar pulse to reveal sub marines
2014-07-09 10:44:47 +12:00
Chris Forbes
c70087fdb2 Merge pull request #5885 from Mailaender/ra-capture-tech-oversights
Fixed captureable tech oversights in the Red Alert mod
2014-07-09 08:05:35 +12:00
Matthias Mailänder
c4dffa02da fix chronosphere being visible to soviets 2014-07-08 21:30:09 +02:00
Matthias Mailänder
5740faef21 fix Tanya being available to soviets 2014-07-08 21:27:34 +02:00
Matthias Mailänder
63d4df76a8 Merge pull request #5874 from pchote/revert-desyncs
Revert TickRender and PauseState changes
2014-07-08 21:21:49 +02:00
reaperrr
fa98eae2c3 Applies most TS prone damage values to TS mod. 2014-07-08 21:05:43 +02:00
reaperrr
fabca5dca6 Move ProneDamage modifier from TakeCover to Warhead.
Rename it to ProneModifier and convert it to integer.
2014-07-08 21:05:42 +02:00
Matthias Mailänder
b12c630e63 Merge pull request #5883 from reaperrr/ts-tib-heal
Fixes #5877
2014-07-08 21:03:50 +02:00
Matthias Mailänder
db7b7742a3 Merge pull request #5880 from MustaphaTR/ra-capturable-bio
Capturable Bio Lab
2014-07-08 20:54:53 +02:00
reaperrr
b765d5238c Add TiberiumHeal weapon and use it for healing mutants, cyborgs & critters. 2014-07-08 18:04:20 +02:00
reaperrr
343de6a244 Fix palette and add inaccuracy to Tiberian Fiend's weapon. 2014-07-08 18:02:44 +02:00
Mustafa Alperen Seki
101e57eade Capturable Bio Lab 2014-07-08 11:51:29 +03:00
Matthias Mailänder
1a81016bdc Merge pull request #5869 from reaperrr/ts-blue-tib
Added blue tiberium and blue large crystal to TS mod.
2014-07-08 08:12:12 +02:00
Paul Chote
3918c992c4 Fix D2K turret placement crash. 2014-07-08 17:12:51 +12:00
Paul Chote
1b222958d6 Don’t override custom animations if damaged. 2014-07-08 17:12:36 +12:00
Paul Chote
c639339a62 Remove the crumble overlay after it has completed. 2014-07-08 17:11:59 +12:00
Paul Chote
2b91a2363b Fix make animations. 2014-07-08 16:56:09 +12:00
Paul Chote
5650d5fc98 Revert "use TickRender() for RenderSprites and PaletteModifier"
This reverts commit 87fd576b26.
2014-07-08 11:09:54 +12:00
Paul Chote
802b6a652c Revert "new PauseState to differentiate game and editor pausing"
This reverts commit d1e18cad7a.
2014-07-08 10:42:00 +12:00
Paul Chote
18c9a25232 Revert "freeze animations during pause to visualize it better"
This reverts commit 960248fe44.
2014-07-08 10:40:06 +12:00
Paul Chote
3c2d9910e3 Revert "Undo changes to World::SetLocalPauseState to unbreak Lua"
This reverts commit 77e3d17527.
2014-07-08 10:39:18 +12:00
reaperrr
b279de1edb Fixes tiberium tree shadow frames, adds large blue crystal. 2014-07-07 22:53:24 +02:00
reaperrr
e27e7ce87c Adds blue tiberium to TS mod. 2014-07-07 22:51:00 +02:00
reaperrr
a3cb5d2d1d Renames interior tileset to temperate and adds BlueTiberium terrain type. 2014-07-07 22:49:50 +02:00
Matthias Mailänder
dfc722847a Merge pull request #5862 from obrakmann/fix-lua-pausestate
Old Lua: use the correct method to set the pause state
2014-07-07 21:57:14 +02:00
Oliver Brakmann
77e3d17527 Undo changes to World::SetLocalPauseState to unbreak Lua
Fixes #5864.
2014-07-07 21:50:37 +02:00
Matthias Mailänder
d2adc28a00 Merge pull request #5865 from obrakmann/fix5861
Fix RepairBuilding not working for AI and Lua scripts
2014-07-07 20:54:03 +02:00
Oliver Brakmann
33b916a713 Fix RepairBuilding not working for AI and Lua scripts
Fixes #5861
2014-07-07 19:43:52 +02:00
RoosterDragon
a512d9ad0a Sped up shroud rendering.
- Only update shroud within the visible screen area, rather than the whole map. This improves performance on larger maps significantly when scrolling around since large portions of the shroud do not need to be updated.
- Provide methods in Shroud to return delegates to check for explored/visibility for tiles within a certain region. This allows it to return more efficient delegates whenever the region is within the map bounds, or shroud/fog is disabled. In the typical case where the region is in bounds and shroud/fog is enabled, the fast check is almost twice as fast as the slow check.
- Use the Shroud delegate functions in shroud rendering, frozen actors, minimap rendering and resource layer areas to provide a speedup since these areas of code can often take advantage of the fact they perform checks within the map boundary.
- Cache current element in CellRegionEnumerator to prevent repeated work if the element is accessed more than once.
- Decrease the size of elements in some arrays in hopes of reducing memory needs and improving cache hits.
2014-07-07 17:34:31 +01:00
RoosterDragon
2351c43237 Refactoring pass.
- Extract an enum for edges rather than using magic numbers for everything.
- Remove duplicated code between FoggedEdges and ShroudedEdges by hosting the visibility function into a delegate.
- Make minimap methods more readable.
- Tidy formatting.
- Make some fields readonly.
- Remove unused usings.
2014-07-07 17:34:25 +01:00
Matthias Mailänder
91a076728d generalize into SpawnActorPower
closes #5724
2014-07-07 15:27:54 +02:00
Matthias Mailänder
f60fefd5f5 add a ripple animation based on the move flash 2014-07-07 15:26:07 +02:00
Matthias Mailänder
43bca0e73d add the sonar pulse
closes #4729
2014-07-07 15:26:07 +02:00
Matthias Mailänder
5cdf0e6a67 generalize MoveFlash as parametrized SpriteEffect 2014-07-07 15:23:14 +02:00
Matthias Mailänder
4fb38c955b Merge pull request #5859 from pchote/paratrooper-cleanup
Improve paratroopers.
2014-07-07 15:19:41 +02:00
Paul Chote
e4f8816486 Fix the crate drop. 2014-07-08 00:30:55 +12:00
Paul Chote
ab26d4b0ad Overhaul ParatroopersPower:
- Adds support for multiple drop planes.
- Adds support a beacon and camera.
- Prevents the plane from circling if it can’t unload.
2014-07-08 00:30:38 +12:00
Matthias Mailänder
b8756d9de7 Merge pull request #5860 from pchote/news-fix
News fixes
2014-07-07 13:25:25 +02:00
Paul Chote
470dfa941a Merge pull request #5840 from Mailaender/map-download-isometry-nre
Fixed a NullReferenceException in auto map download.
2014-07-07 22:31:25 +12:00
Paul Chote
d0a972f3b7 Merge pull request #5835 from Squiggles211/wall-damage
Removed false damage states which caused invisible walls.  Fixes #5654
2014-07-07 22:27:25 +12:00
Paul Chote
ad375c5734 Reorganize news parsing. Fixes #5647. 2014-07-07 22:23:04 +12:00
Paul Chote
c352ff644f Use a shared url for news updates. Fixes #5603. 2014-07-07 21:48:07 +12:00
Matthias Mailänder
fa83507a62 Merge pull request #5854 from pchote/ra-poster
Add beacons to the RA spy plane and parabombs
2014-07-07 10:15:03 +02:00
Matthias Mailänder
17e41a7b79 Merge pull request #5856 from MustaphaTR/d2k-footprints
D2k Some Footprint Fixes
2014-07-07 09:33:41 +02:00
Mustafa Alperen Seki
96988fe563 Fixed ref and palace footprints. 2014-07-07 10:20:12 +03:00
Matthias Mailänder
d4627479b5 fix a NullReferenceException in preview.Map 2014-07-07 09:18:24 +02:00
Paul Chote
38a08c0967 Add a spy plane beacon, and quantise facings. 2014-07-07 17:40:51 +12:00
Paul Chote
59bea931a5 Use AirstrikePower for spy planes. 2014-07-07 17:40:51 +12:00
Paul Chote
a4ba7f7158 Remove the obsolete flare definition from AirstrikePower. 2014-07-07 17:40:51 +12:00
Paul Chote
c6299892e0 Remove obsolete BeaconDuration definitions. 2014-07-07 17:40:50 +12:00
Paul Chote
6f7816b653 Add beacon to parabombs, and quantise facings. 2014-07-07 17:40:44 +12:00
Paul Chote
e3e5de2b59 Merge pull request #5844 from Mailaender/ts-blossom-trees
Added Blossom Trees to Tiberian Sun
2014-07-07 11:23:04 +12:00
Chris Forbes
43ce9274e1 Merge pull request #5847 from Mailaender/sietch-bib
Fixed the sietch crashing the game when placed on a map
2014-07-07 09:42:06 +12:00
Chris Forbes
e3100171f0 Merge pull request #5848 from Mailaender/shellmap-category
Categorized shellmaps
2014-07-07 09:39:05 +12:00
Chris Forbes
c2a659f4d2 Merge pull request #5849 from Mailaender/active-animation-pause
Fixed active animations playing during paused games
2014-07-07 09:34:44 +12:00
Matthias Mailänder
dc63171e0e pause active animations 2014-07-06 23:11:56 +02:00
Matthias Mailänder
4fb7d4ef41 fix Unit sietch does not have a sequence named bib2x 2014-07-06 22:55:27 +02:00
Matthias Mailänder
a550febc94 categorize shellmaps 2014-07-06 21:04:03 +02:00
Matthias Mailänder
dac2314051 add blossom trees to Tiberian Sun 2014-07-06 19:00:43 +02:00
Matthias Mailänder
0262a946be add FrozenActorLayer to Tiberian Sun 2014-07-06 19:00:25 +02:00
Matthias Mailänder
b466a066a9 Merge pull request #5839 from ihptru/downloadingstatus
depend on proper status in auto-downloading
2014-07-06 17:46:04 +02:00
ihptru
305f76e300 depend on proper status in auto-downloading 2014-07-06 19:17:38 +04:00
Paul Chote
6ad5c99815 Merge pull request #5806 from Mailaender/seeds-resources-cleanup
Fixed SeedsResources messing with make animation
2014-07-07 01:05:17 +12:00
Matthias Mailänder
82a8fd329e don't play active animation when we sell it 2014-07-06 14:58:29 +02:00
Matthias Mailänder
69209cd340 split WithActiveAnimation from SeedsResource
closes #5300
2014-07-06 14:58:29 +02:00
Matthias Mailänder
59dcd297f5 Merge pull request #5828 from reaperrr/missile-shadow
Re-implement Shadow support for Missiles
2014-07-06 14:55:51 +02:00
Paul Chote
06039ce818 Merge pull request #5304 from Mailaender/music-downloads
Added Music downloads
2014-07-07 00:52:05 +12:00
reaperrr
5a645adb2d TS changes to improve missile test cases. 2014-07-06 14:46:07 +02:00
reaperrr
a69f5857e6 Removes Missile-shadow-related bitrot. 2014-07-06 14:46:05 +02:00
reaperrr
cb216aa345 Reimplement Shadow toggle for Missile projectile.
Enable Shadow by default.
2014-07-06 14:46:04 +02:00
Matthias Mailänder
fe41ac7fa3 @pchote breaks all the things 2014-07-06 14:45:05 +02:00
Matthias Mailänder
443b46ca64 fix Tiberian Sun installation from CD 2014-07-06 14:04:26 +02:00
Paul Chote
3f7293b206 Let FieldLoader do the hard work of loading fields. 2014-07-06 14:04:26 +02:00
Matthias Mailänder
352067eb48 consistent size for all install panels 2014-07-06 14:04:26 +02:00
Matthias Mailänder
038146abb3 prevent flickering 2014-07-06 14:04:26 +02:00
Matthias Mailänder
6a0c158ffa rename gameinit to install for consistency 2014-07-06 14:04:26 +02:00
Matthias Mailänder
585264d3ad remove non-existing "INIT_SETUP" chrome widget reference 2014-07-06 14:04:26 +02:00
Matthias Mailänder
a67e2290d1 fix the music list not being populated after CD asset install 2014-07-06 14:04:26 +02:00
Matthias Mailänder
1f4b780450 save a redirect 2014-07-06 14:04:26 +02:00
Matthias Mailänder
2f55768c1b restart the game instead of unmounting on the fly
avoid more redundancy between the load screens
2014-07-06 14:04:26 +02:00
Matthias Mailänder
334605287c Intro/Map music is also split across several files here 2014-07-06 14:04:26 +02:00
Matthias Mailänder
b2517b2c87 don't test for scores.mix as it is optional 2014-07-06 14:04:26 +02:00
Matthias Mailänder
178bf0643f don't check for general.mix as it stays unmounted
however still extract it
2014-07-06 14:04:26 +02:00
Matthias Mailänder
7b5e072994 unmount all to avoid write permission problems
fight the new caching mechanism and M$ WindowsTM file systems
2014-07-06 14:04:25 +02:00
Matthias Mailänder
dbb4132b66 add TrimOrEmpty to avoid NREs 2014-07-06 14:04:25 +02:00
Matthias Mailänder
cc64b41246 fix Tiberian Dawn CD rip logic
closes #4424
2014-07-06 14:04:25 +02:00
Matthias Mailänder
57a631c284 rebase bit rot crap 2014-07-06 14:04:25 +02:00
Matthias Mailänder
7783e988a7 unify music install and add a download option
closes #4759
2014-07-06 14:04:25 +02:00
Matthias Mailänder
14f71c55bf unify install from CD logic 2014-07-06 14:04:25 +02:00
Matthias Mailänder
351c759793 separate content install from loadscreen 2014-07-06 14:04:25 +02:00
Paul Chote
08b1c989d6 Merge pull request #5640 from Mailaender/editor-tick
Separated Tick and TickRender more cleanly
2014-07-07 00:03:04 +12:00
Matthias Mailänder
7e496f8db9 StyleCop and avoid redundancy 2014-07-06 12:48:47 +02:00
Matthias Mailänder
bf1743ac6e Merge pull request #5838 from obrakmann/fix5378
Fix non-infantry support units starting on subcells. Fixes #5378
2014-07-06 12:09:01 +02:00
Oliver Brakmann
bb38521d70 Add myself to AUTHORS 2014-07-06 12:04:15 +02:00
Oliver Brakmann
cb8ed251b2 Fix non-infantry support units starting on subcells.
Fixes #5378
2014-07-06 12:04:15 +02:00
Matthias Mailänder
cde7ec1948 disallow building placement when the game is paused
touches the most glitchy case of #3277
2014-07-06 09:39:16 +02:00
Matthias Mailänder
565ea05bd7 fix problem with cnc nuke leaking the long idle sequence Tick
and avoid magic numbers
2014-07-06 09:23:31 +02:00
Squiggles211
52bc05c1b5 Fixes #5654 by removing false damage states which caused invisible walls
Removes final set of 16 sequences for all walls as it appears that these
are not actually supposed to be used as damage states for the actual
wall, but as end pieces for each wall.  One of the pieces in particular
caused a single wall to be seen as invisible.  Fixes #5654
2014-07-06 02:09:10 -05:00
Matthias Mailänder
960248fe44 freeze animations during pause to visualize it better 2014-07-06 08:24:08 +02:00
Matthias Mailänder
d1e18cad7a new PauseState to differentiate game and editor pausing 2014-07-06 08:24:08 +02:00
Matthias Mailänder
d580ca6417 ActorMap is updated in Tick
so we can't search for adjacent actors in TickRender
2014-07-06 08:24:08 +02:00
Matthias Mailänder
394d635dae new trait WithMakeAnimation 2014-07-06 08:24:08 +02:00
Matthias Mailänder
87fd576b26 use TickRender() for RenderSprites and PaletteModifier 2014-07-06 08:24:08 +02:00
Matthias Mailänder
58cb603803 Merge pull request #5834 from Squiggles211/heli-turn
Increase Chinook landing speed and removed turn before landing.
2014-07-06 08:19:44 +02:00
Matthias Mailänder
9be8f4ce29 Merge pull request #5832 from obrakmann/fix-old-lua-breakage
Fix breakage of the old Lua API due to recent changes
2014-07-06 07:55:34 +02:00
Squiggles211
ebc6515d73 Fixes #5054 by removing chinook's turn before landing and increasing ascend/descend speed
Allows for any helicopter to enable or disable the turn before landing
but sets it to default off for the chinook.  (may be desireable for
single player missions visual effect like Allies01?)  Also gives the
chinook a faster ascend/descend speed.  Fixes #5054
2014-07-06 00:52:43 -05:00
Oliver Brakmann
3a67b3dec3 Fix breakage of the old Lua API due to recent changes
Specifically, the CPos::CenterPosition -> Map::CenterOfCell rename (#5758),
as well as the additional argument to Paradrop::SetLZ (#5695).
2014-07-06 01:21:22 +02:00
Chris Forbes
ee2dc60eb3 Merge pull request #5822 from Mailaender/voxel-walker-move
Moved specialized voxel render traits to Mods.TS library.
2014-07-06 10:52:35 +12:00
Chris Forbes
636f926184 Merge pull request #5821 from Mailaender/bye-scott
Removed Scott from the active maintainer list
2014-07-06 10:22:01 +12:00
Chris Forbes
1ca218182a Merge pull request #5831 from pchote/repair-crashfix
Don’t try to render the repair indicator if there are no repairers.
2014-07-06 10:19:36 +12:00
Paul Chote
cc14f5ef17 Don’t try to render the repair indicator if there are no repairers. Fixes #5823 2014-07-06 10:05:56 +12:00
Matthias Mailänder
b9d84cb422 Merge pull request #5829 from reaperrr/ts-fiendshard
Fixes TS FiendShard using wrong projectile
2014-07-05 18:14:29 +02:00
reaperrr
0d33aec9d9 Fix TS FiendShard using wrong projectile. 2014-07-05 17:30:39 +02:00
Matthias Mailänder
b5a514d868 move WithVoxelUnloadBody 2014-07-05 12:13:47 +02:00
Matthias Mailänder
07c75b5e27 move WithVoxelWalkerBody to Mods.TS 2014-07-05 12:12:56 +02:00
Matthias Mailänder
a0a5d10e4b remove Scott from the active maintainer list 2014-07-05 11:57:19 +02:00
Paul Chote
8743f39a79 Merge pull request #5814 from Mailaender/vamos-vamos
Fixed units not moving to the RallyPoint
2014-07-05 20:00:47 +12:00
Paul Chote
88cd454ce1 Merge pull request #5695 from Mailaender/parachute-dangers
Added the possibility for paratroopers to die on impact
2014-07-05 19:49:15 +12:00
Paul Chote
da66a9a6b3 Merge pull request #5797 from Mailaender/ts-harvester
Fixed the Tiberian Sun harvester
2014-07-05 19:14:47 +12:00
Matthias Mailänder
5e7e677ca9 fix shadow sprite not being rendered on the ground 2014-07-05 09:13:52 +02:00
Matthias Mailänder
8cdd7dce6c make the fallrate customizable 2014-07-05 09:13:52 +02:00
Matthias Mailänder
4a7687d7e4 add a customizable parachute shadow
closes #3335
2014-07-05 09:13:52 +02:00
Matthias Mailänder
18a77e0039 make the parachute palettes configurable 2014-07-05 09:13:52 +02:00
Matthias Mailänder
ef01fb289b make the parachute animation optional
instead of hard-coding default sprite sequences
2014-07-05 09:13:52 +02:00
Matthias Mailänder
ff1be8daea merge ParachuteAttachment and Parachutable 2014-07-05 09:13:52 +02:00
Matthias Mailänder
e04ff18060 @pchote's quest against legacy truth value definitions 2014-07-05 09:13:51 +02:00
Matthias Mailänder
a38d43019a new setting to allow unlucky paratroopers 2014-07-05 09:13:51 +02:00
Matthias Mailänder
2907273ef2 new trait Parachtuable that decides on the fate upon landing 2014-07-05 09:13:51 +02:00
Matthias Mailänder
1a0bb726e6 document for modders 2014-07-05 09:13:51 +02:00
Matthias Mailänder
8f805248ca StyleCop 2014-07-05 09:13:51 +02:00
Matthias Mailänder
d6c60f6436 tweak the DockOffset a bit 2014-07-05 09:08:50 +02:00
Matthias Mailänder
f4f127e3d1 spaces to tabs 2014-07-05 09:08:50 +02:00
Matthias Mailänder
7385fcbf3f fix VoxelAnimation.DisableFunc being ignored 2014-07-05 09:08:49 +02:00
Matthias Mailänder
6734cd96a4 add a voxel harvester unload animation 2014-07-05 09:08:47 +02:00
Matthias Mailänder
1e2e7bcf42 StyleCop 2014-07-05 09:00:20 +02:00
Matthias Mailänder
7b5f000ba0 stop pretending this is configurable and use MoveTo
fixes #5682
2014-07-05 08:58:21 +02:00
Matthias Mailänder
4fed3371d0 avoid an unneccessary conversion FieldLoader can do 2014-07-05 08:58:21 +02:00
Matthias Mailänder
9199cf4669 get to work automatically 2014-07-05 08:45:37 +02:00
Matthias Mailänder
270975a590 fix crash when docking with a voxel harvester 2014-07-05 08:45:34 +02:00
Paul Chote
bf50372f85 Merge pull request #5787 from Mailaender/input-sound-render-split
Sound and Input cleanup
2014-07-05 18:41:11 +12:00
Matthias Mailänder
b1ac961adc StyleCop 2014-07-05 08:35:38 +02:00
Matthias Mailänder
cf6f32fb96 split Sound.cs in smaller chunks 2014-07-05 08:35:38 +02:00
Matthias Mailänder
8cce30d472 sort into sub-folders Input and Graphics 2014-07-05 08:35:32 +02:00
Paul Chote
dbfd1eaaa3 Merge pull request #5808 from reaperrr/td-bluetib
Replaces glitchy blue tiberium art with TS-style remapable tiberium art
2014-07-05 18:34:18 +12:00
Paul Chote
6250c9df12 Merge pull request #5696 from Mailaender/emit-cargo-on-sell
Finished EmitCargoOnSell
2014-07-05 12:30:29 +12:00
Paul Chote
15d8fadb60 Merge pull request #5801 from Mailaender/building-influence-crash
Fixed a crash when trying to capture husks that have been destroyed.
2014-07-05 11:36:54 +12:00
Paul Chote
31aaaf26b5 Merge pull request #5812 from Mailaender/rallypoint-test-building-hack-removal
Fixed the AI choosing rallypoints on land for shipyards
2014-07-05 11:22:00 +12:00
Paul Chote
6deadd7658 Merge pull request #5798 from Mailaender/td-production-tooltip-nre
Fixed a crash in Tiberian Dawn when a production tooltip is being rendered while the last accompanying production queue is destroyed.
2014-07-05 10:58:13 +12:00
Paul Chote
8d6cd143d6 Merge pull request #5807 from Mailaender/building-influence-reslayer
Fixed resources growing on building bibs and behind trees
2014-07-05 10:53:10 +12:00
obrakmann
80f1dc6a56 Merge pull request #5818 from UberWaffe/bleed
Corrected d2k.sardaukar prone-shoot animation.
2014-07-04 22:08:01 +02:00
obrakmann
6d3edb8725 Merge pull request #5817 from Mailaender/chat-command-nre
Fixed chat commands crashing replays
2014-07-04 21:57:12 +02:00
UberWaffe
29df6866d0 Corrected d2k.sardaukar prone-shoot animation. 2014-07-04 20:10:40 +02:00
Matthias Mailänder
13e0dac141 execute chat commands only locally
fixes #5755
2014-07-04 18:18:33 +02:00
Matthias Mailänder
0572220cc3 Merge pull request #5768 from pchote/multirepair
Closes #3748
2014-07-04 16:12:46 +02:00
Matthias Mailänder
7428776e90 Merge pull request #5813 from pavlos256/asset-browser-search
Instant filtering by file name in the asset browser
2014-07-04 16:01:01 +02:00
Matthias Mailänder
65d61dff3e Merge pull request #5767 from pchote/isqrt
Add Exts.ISqrt to avoid fp sqrt calculations.
2014-07-04 15:48:20 +02:00
Pavlos Touboulidis
d1251d412f Instant filtering by file name in the asset browser 2014-07-04 16:33:26 +03:00
Matthias Mailänder
79dd9a9c6b get rid of the RallypointTestBuilding hack 2014-07-04 14:57:34 +02:00
Matthias Mailänder
7824564a44 fix System.Reflection.ReflectionTypeLoadException 2014-07-04 14:34:34 +02:00
Matthias Mailänder
3c502117a5 Merge pull request #5804 from MustaphaTR/d2k-shellmap
Better Shellmap to D2K
2014-07-04 11:44:17 +02:00
Mustapha
c842f1cbc1 High Resolution Fix 2014-07-04 12:37:47 +03:00
Matthias Mailänder
0feb5a7bdc check for building influence when growing resources
closes #5556
2014-07-04 09:22:14 +02:00
Ishan Bhargava
16df8322c6 Added repair bonus for multiple players
More than one player can now contribute to repairing a building.
Base repair amount is multiplied by value of array
Players who can't afford to contribute are ignored
Repair indicator cycles between each player's color.
2014-07-04 10:40:26 +12:00
Paul Chote
9e11e38005 Merge pull request #5781 from pavlos256/format80-write-rle
Implement Format80 RLE compression
2014-07-04 10:34:01 +12:00
Paul Chote
ce99f02ba6 Merge pull request #5678 from pavlos256/find-tiles-in-circle
Fix and optimize FindTilesInCircle
2014-07-04 10:27:37 +12:00
Matthias Mailänder
ae8b2cec74 Merge pull request #5792 from reaperrr/tib-tree-fixes
TD Tiberium tree fixes
2014-07-03 22:35:34 +02:00
reaperrr
7b5078c4f2 Remove bluetib.mix package. 2014-07-03 22:31:34 +02:00
reaperrr
739865062a Replaces glitchy blue tiberium art with TS-style remapable tiberium art. 2014-07-03 22:28:36 +02:00
reaperrr
9e8c7ee145 Remove duplicate split sequence.
Make blue tib tree more centered on cell (fixes #5744).

Remove obsolete splitblue art.
2014-07-03 22:17:01 +02:00
reaperrr
6fa3f4207a Fix editor position of TD tiberium trees. 2014-07-03 21:52:18 +02:00
Matthias Mailänder
b02ca7695f StyleCop 2014-07-03 18:35:11 +02:00
Pavlos Touboulidis
daed053a57 Fix and optimize FindTilesInCircle 2014-07-03 18:11:28 +03:00
Pavlos Touboulidis
f5de0101fe Implement Format80 RLE compression 2014-07-03 17:53:48 +03:00
Paul Chote
0ffe88753c Merge pull request #5789 from Mailaender/render-trait-documentation
Documented the various overlay and animation change traits
2014-07-03 23:54:13 +12:00
Paul Chote
a4083f4597 Merge pull request #5794 from Mailaender/lint-map-cordons
Added a new Lint check for invalid map cordons
2014-07-03 23:43:41 +12:00
Paul Chote
1a88769c12 Merge pull request #5795 from Mailaender/ts-harvester-tiberium-explosion
Added Tiberium explosions to destroyed harvesters in Tiberian Sun
2014-07-03 23:39:39 +12:00
Paul Chote
d92dc70a2f Merge pull request #5712 from RoosterDragon/sheet-release-buffer
Release sheet buffers
2014-07-03 22:57:56 +12:00
Matthias Mailänder
884fbc0ea9 add a new lint check for invalid map cordons 2014-07-03 10:56:59 +02:00
Matthias Mailänder
e666c75883 don't capture dead actors 2014-07-03 10:33:41 +02:00
Matthias Mailänder
6097b3eb19 document the various overlay and animation change traits 2014-07-03 09:50:10 +02:00
Matthias Mailänder
8a89accab6 Merge pull request #5805 from MustaphaTR/mount-idaho
Mount Idaho Map
2014-07-03 09:37:42 +02:00
Matthias Mailänder
04f1ebe969 abort change owner when the actor is destroyed
fixes #5638
2014-07-03 09:19:51 +02:00
Matthias Mailänder
3c3f85a272 add documentation 2014-07-03 09:05:22 +02:00
Matthias Mailänder
68a97b079b spurious tab 2014-07-03 09:05:22 +02:00
Mustapha
432638dcfa added mount idaho map 2014-07-03 09:59:07 +03:00
Mustapha
e13f8873c0 New Shellmap 2014-07-03 09:51:36 +03:00
RoosterDragon
3a30748f05 Reduce working set by releasing buffers for sheets.
Sheets carry a managed buffer of data that allows updates to be made without having to constantly fetch and set data to the texture memory of the video card. This is useful for things like SheetBuilder which make small progressive changes to sheets.

However these buffers are often large and are kept alive because sheets are referenced by the sprites that use them. If this buffer is explicitly null'ed when it is no longer needed then the GC can reclaim it. Sometimes a buffer need not even be created because the object using the sheet only works on the texture directly anyway.

In practise, this reduced memory consumed by such buffers from ~165 MiB to ~112 MiB (at the start of a new RA skirmish mission).
2014-07-02 17:25:56 +01:00
Matthias Mailänder
30edee01c2 check if palette.CurrentQueue is null to avoid a crash
fixes #5624
2014-07-02 12:18:47 +02:00
Matthias Mailänder
d011438ff3 let the harvester splatter Tiberium on destruction 2014-07-02 09:42:15 +02:00
Paul Chote
0d61a1d19a Merge pull request #5786 from Mailaender/shp-ts-offset-fix
Fixed Tiberian Sun construction yard flickering
2014-07-02 17:14:03 +12:00
Paul Chote
9a167317dd Merge pull request #5742 from tomlane/sniperChurches
Remove ability for Sniper to capture churches.
2014-07-02 17:05:06 +12:00
Matthias Mailänder
ea86aac089 replace EmitCargoOnSell with Cargo.EjectOnSell 2014-07-01 22:11:44 +02:00
Matthias Mailänder
6adf453ad1 finished EmitCargoOnSell
closes #2424
2014-07-01 22:07:15 +02:00
Matthias Mailänder
e8bccc33c6 StyleCop 2014-07-01 22:07:15 +02:00
Matthias Mailänder
392b77647d this does not make any sense
with 0 HP you also can not a single dude
2014-07-01 22:07:15 +02:00
Matthias Mailänder
40cd491bff Merge pull request #5778 from pchote/isometric
Add support for diamond cell grids
2014-07-01 16:59:22 +02:00
Tom Lane
eca4504006 Remove invalid sniper actor from Poseidon map. 2014-07-01 13:23:36 +01:00
Taryn Hill
249c522c00 Merge pull request #5785 from Mailaender/ts-high-fix
Fixed Tiberian Sun artillery not shooting over walls.
2014-07-01 07:02:56 -05:00
Matthias Mailänder
f5b749e9ce fix a rounding problem in SHP(TS) offset floating point math
closes #5765
2014-07-01 13:40:00 +02:00
Matthias Mailänder
de64b31aa4 allow the RPG tower to shoot over walls 2014-07-01 11:30:16 +02:00
Matthias Mailänder
78e4e7a440 allow artillery to shoot over walls 2014-07-01 11:30:12 +02:00
Paul Chote
cf7bd75dad Merge pull request #5759 from Mailaender/ra-tech-capture
Added capturable tech to Red Alert
2014-07-01 19:24:23 +12:00
Matthias Mailänder
38dd3bbdc9 remove pill boxes and hijacker from Allies02 2014-07-01 09:12:13 +02:00
Matthias Mailänder
7cd259d2b8 add a missing space for multi line property documentation 2014-07-01 09:12:13 +02:00
Matthias Mailänder
b05e4217cf document SelfHealing prerequisites 2014-07-01 09:12:11 +02:00
Matthias Mailänder
362c86764f document the buildable and country trait 2014-07-01 09:08:08 +02:00
Matthias Mailänder
a42ac640e4 remove unused copy pasta from TD 2014-07-01 09:03:33 +02:00
Matthias Mailänder
5602e49179 capturable production queues 2014-07-01 09:03:19 +02:00
Matthias Mailänder
6436088cdb Use Prerequisites: ~disabled for unbuildable actors. 2014-07-01 09:02:41 +02:00
reaperrr
5a7dbb6529 Fix TS refinery and repair pad using snow gfx
Until we support TS theater-specific graphics, we should stick to one of the theaters, temperate in this case.
2014-07-01 01:10:55 +02:00
Igor Popov
cefe26349f Merge pull request #5780 from Mailaender/master.openra.net
Changed master server URL to openra.net subdomain
2014-06-30 19:32:08 +04:00
Matthias Mailänder
5bd3a21d34 master server has been migrated to new machine and DNS
closes #5748
2014-06-30 16:09:00 +02:00
Paul Chote
0d625b6af6 Fix sprite overlap outside the map border. 2014-07-01 00:40:42 +12:00
Paul Chote
96c9de2b96 Enable isometric perspective in TS. 2014-06-30 23:44:23 +12:00
Paul Chote
0866903f20 remove blank-testmap. 2014-06-30 23:44:23 +12:00
Paul Chote
68969203bb Extract TS blank-conquest map. 2014-06-30 23:44:23 +12:00
Paul Chote
a30c8b53a7 Add support for diamond cell grids. 2014-06-30 23:44:23 +12:00
Matthias Mailänder
43dccee1b6 Merge pull request #5779 from MustaphaTR/bleed
Level Up from Crate at D2K
2014-06-30 13:41:50 +02:00
Mustafa Alperen Seki
68f8b5073a LevelUpCrate 2014-06-30 10:51:40 +03:00
Paul Chote
af0e948a67 Use map.Contains for the observer shroud check.
Checking against the bounds directly is no longer valid.
2014-06-30 11:24:41 +12:00
obrakmann
3682bc7069 Merge pull request #5772 from pchote/d2k-parachute-fix
Fix D2K paratroopers.
2014-06-29 13:32:57 +02:00
Paul Chote
52af0d2c81 Merge pull request #5771 from Mailaender/hackyai-mcv-cleanup
Cleaned up HackyAI MCV deployment
2014-06-29 13:00:21 +12:00
Matthias Mailänder
5130723fcd remove the overly complicated configurable MCV actor name hack 2014-06-28 15:17:06 +02:00
Matthias Mailänder
aae428be2b throw with a more helpful error than NullReferenceException
closes #5622
2014-06-28 15:17:05 +02:00
Paul Chote
e6a501bb66 Fix D2K paratroopers. 2014-06-28 22:57:12 +12:00
Paul Chote
1c511ea6eb Merge pull request #5769 from Mailaender/actor-lint
Added a new OpenRA.Lint check for invalid actor definitions
2014-06-28 22:00:40 +12:00
Paul Chote
281423c8f4 Merge pull request #5766 from RoosterDragon/read-only-frames
Make sprite frames read-only lists.
2014-06-28 21:54:30 +12:00
Matthias Mailänder
dcaef3b0e9 explain the strange console message 2014-06-28 10:38:51 +02:00
Matthias Mailänder
a5ac1aa581 tell us what you are doing 2014-06-28 10:38:33 +02:00
Matthias Mailänder
95c43132c7 only display lint check name when something goes wrong 2014-06-28 10:38:14 +02:00
Matthias Mailänder
492abc0853 don't spam passed checks 2014-06-28 10:37:38 +02:00
Matthias Mailänder
f9d5a439d8 and another hit for invalid players 2014-06-28 09:52:00 +02:00
Matthias Mailänder
59c12c2a31 now that we check actors and players we can't exclude them 2014-06-28 09:51:50 +02:00
Matthias Mailänder
a6ad359914 remove legacy actors as a test case 2014-06-28 09:51:12 +02:00
Matthias Mailänder
ba1fa7cd81 new check for undefined actors 2014-06-28 09:50:50 +02:00
Matthias Mailänder
7fa51712ec Merge pull request #5758 from pchote/cell-world-conversions
Generalize cell/world coordinate conversions.
2014-06-28 08:27:18 +02:00
Paul Chote
2431c34ca9 Merge pull request #5752 from Mailaender/tank-paradrop
Removed the tank paradrop icon
2014-06-28 16:17:15 +12:00
Paul Chote
d0c3fae1a2 Merge pull request #5406 from RoosterDragon/palette-efficiency
Changed HardwarePalette.ApplyModifiers to be more efficient.
2014-06-28 16:11:43 +12:00
Paul Chote
4216f66ca4 Add Exts.ISqrt to avoid fp sqrt calculations. 2014-06-28 15:48:53 +12:00
RoosterDragon
7030d8b2b6 Changed HardwarePalette.ApplyModifiers to be more efficient.
- Add separate ImmutablePalette and MutablePalette classes since the distinction is extremely important to HardwarePalette.
- Keep a cache of palettes in HardwarePalette to avoid reallocation them every time ApplyModifiers is called.
- Palettes that are not allowed to be modified are copied to the buffer once when added, rather than every time ApplyModifiers is called.
- The AdjustPalette method now takes a read-only dictionary to prevent the dictionary being messed with.
- Added a constant for the palette size to remove its usage as a magic number in several areas.
- The ColorPreviewManagerWidget is annoying in that it needs to actually permanently update a palette after it has been added. To allow this, HardwarePalette now allows a palette to be replaced after initialization. The WorldRenderer therefore now also updates the PaletteReference it created earlier with the new palette to prevent stale data being used elsewhere.
2014-06-28 01:11:48 +01:00
RoosterDragon
19072775d4 Changes ISpriteSource.Frames to be of type IReadOnlyList<ISpriteFrame>.
- Updated implementations to return a ReadOnlyList around an array (to reduce wasted memory from exposing lists or lazy enumerators around lists).
- Protect non-public ISpriteFrame classes by making them inner classes to prevent casting.
- Added an AsReadOnly extension method for lists.
2014-06-27 23:38:34 +01:00
Chris Forbes
5c82fff0ef Merge pull request #5751 from RoosterDragon/map-cache-tileset
Cache tileset lookup in Map
2014-06-28 09:27:27 +12:00
Matthias Mailänder
000768dd4f Merge pull request #5762 from obrakmann/fix-tech-capture-fallout
Fix fallout from tech-capture changes
2014-06-27 22:24:00 +02:00
Matthias Mailänder
7fa8cc10e9 Merge pull request #5763 from obrakmann/build-shift+keypress
Make Shift+<Hotkey> queue five units/buildings. Fixes #5544.
2014-06-27 22:18:50 +02:00
Oliver Brakmann
f7e32aac60 Fix fallout from tech-capture changes 2014-06-27 21:50:03 +02:00
RoosterDragon
bcbd1c2577 Cache tileset lookup in map so GetTerrainIndex and GetTerrainInfo need not repeat it every time.
The lookup accounts for ~50-60% of the time spent in GetTerrainIndex and GetTerrainInfo, and these methods themselves can account for up to 1.3% of total CPU used so this is a small but measurable win.
2014-06-27 19:52:57 +01:00
Matthias Mailänder
e9ee4a1e15 Update ShroudRenderer.cs
fix typo
2014-06-27 13:30:57 +02:00
Paul Chote
d7f1b1c9e2 Remove CVec -> WVec conversion. 2014-06-27 23:30:41 +12:00
Paul Chote
a256e722d5 Remove conversions between legacy and world types. 2014-06-27 23:30:41 +12:00
Paul Chote
9487f49cd5 Replace WPos.ToCPos -> Map.CellContaining. 2014-06-27 23:30:40 +12:00
Paul Chote
4bc09692e0 Remove WVec.ToCVec. 2014-06-27 23:30:40 +12:00
Paul Chote
7b52fa52b6 Replace CPos.CenterPosition -> Map.CenterOfCell. 2014-06-27 23:30:40 +12:00
Paul Chote
b6d1d26eeb Add World parameter to Util.BetweenCells. 2014-06-27 23:30:40 +12:00
Paul Chote
086ec07eb6 Add World parameter to Target.FromCell. 2014-06-27 23:30:40 +12:00
Paul Chote
e4ea012b9e Add World parameter to Target.FromOrder. 2014-06-27 23:30:40 +12:00
Paul Chote
b52cdd4b45 Remove redundant FindActorsInBox helpers. 2014-06-27 23:30:40 +12:00
Matthias Mailänder
0989a5ea08 Merge pull request #5757 from pchote/tsshroud
Use TS shroud sprites.
2014-06-27 13:29:10 +02:00
Paul Chote
8cd6f05b71 Use TS shroud artwork. 2014-06-27 22:28:33 +12:00
Paul Chote
8f046c7c5a Support split sprites for fog/shroud. 2014-06-27 22:28:33 +12:00
Paul Chote
8c4dcb7fe0 Configurable ShroudRenderer palettes and readonly state. 2014-06-27 22:28:33 +12:00
Matthias Mailänder
c60f19aee0 Merge pull request #5629 from pchote/celllayers
Introduce CellLayer and CellRegion abstractions.
2014-06-27 12:27:30 +02:00
Paul Chote
78f8c94df8 Make PathDistance struct immutable. 2014-06-27 22:07:03 +12:00
Paul Chote
5560f276ca Map: Rename IsInMap -> Contains. 2014-06-27 22:07:03 +12:00
Paul Chote
e0df669de9 Bridgelayer: Keys.Contains -> ContainsKey. 2014-06-27 22:07:03 +12:00
Paul Chote
fd4d3b40d0 Simplify shroud range checks. 2014-06-27 22:07:03 +12:00
Paul Chote
2a466d08c3 Remove the now-unused ExploredBounds optimization. 2014-06-27 22:07:03 +12:00
Paul Chote
441971f6d7 Use CellLayer for pathfinding. 2014-06-27 22:07:03 +12:00
Paul Chote
435f47158f Remove unused Map.IsInMap(x,y) overload. 2014-06-27 22:07:03 +12:00
Paul Chote
c5a13d4e65 Remove CellBounds from BuildableTerrainLayer and SmudgeLayer 2014-06-27 22:07:03 +12:00
Paul Chote
997216aef0 Use CellLayer for terrain. 2014-06-27 22:07:02 +12:00
Paul Chote
ad730a44c3 Use CellLayer for resources. 2014-06-27 22:07:02 +12:00
Paul Chote
ce331a28e8 Use CellLayer for custom terrain. 2014-06-27 22:07:02 +12:00
Paul Chote
c5b4d643af Use CellLayer for BridgeLayer. 2014-06-27 22:07:02 +12:00
Paul Chote
fb3477d630 Use CellLayer for BuildingInfluence. 2014-06-27 22:07:02 +12:00
Paul Chote
7c463c414c Use CellLayer for DomainIndex. 2014-06-27 22:07:02 +12:00
Paul Chote
8dc0967d2e Use CellLayer for ActorMap. 2014-06-27 22:07:02 +12:00
Paul Chote
baf27bc4cd Use CellLayers for shroud. 2014-06-27 22:07:02 +12:00
Paul Chote
295af5741f Use CellLayers for ResourceLayer. 2014-06-27 22:07:01 +12:00
Matthias Mailänder
e733ee0434 remove tank paradrop icon 2014-06-27 09:20:55 +02:00
Paul Chote
5a00757eab Use CellLayers for pathfinder debug. 2014-06-27 19:20:46 +12:00
Paul Chote
386b71de82 Integrate CellRegion with Map, Viewport. 2014-06-27 19:20:46 +12:00
Paul Chote
52ab8f3ca1 Add CellRegion and CellLayer classes to simplify map overlays. 2014-06-27 19:20:46 +12:00
Paul Chote
97a61273dd Bring PathSearch in line with the current code style. 2014-06-27 19:20:46 +12:00
Paul Chote
2026747f2a Use Map.IsInMap(CPos) for things that are checking CPos. 2014-06-27 19:20:46 +12:00
Paul Chote
e825205542 Stylecop BridgeLayer. 2014-06-27 19:20:46 +12:00
Paul Chote
bbd1331536 Clean up actor selection in WorldInteractionControllerWidget. 2014-06-27 19:20:44 +12:00
Matthias Mailänder
ea6f76e4f6 Merge pull request #5749 from MustaphaTR/bleed
Some fixes at TS
2014-06-27 08:33:30 +02:00
Matthias Mailänder
2ad6af6801 Merge pull request #5685 from pchote/race-restriction
Add capturable technology support. Fixes #2129
2014-06-27 08:23:59 +02:00
Mustafa Alperen Seki
9a4b4f5841 Infantry Hotkeys 2014-06-26 17:43:05 +03:00
Mustafa Alperen Seki
d70e4a9e32 Defence Hotkeys 2014-06-26 17:36:11 +03:00
Mustafa Alperen Seki
02c7d727d1 Hotkeys 2014-06-26 16:41:49 +03:00
Mustafa Alperen Seki
9ddc4ddc6b Hotkeys 2014-06-26 16:29:36 +03:00
Mustafa Alperen Seki
9ddc53e3fc Harv. Spawn point 2014-06-26 16:16:55 +03:00
Paul Chote
a9635e8c4a Refund the *old* player when a production structure is captured. 2014-06-26 23:14:14 +12:00
Paul Chote
4db2cf6b2b Propagate race to produced actors. 2014-06-26 23:14:14 +12:00
Paul Chote
4b2663015b Fix CanBuild not checking DeveloperMode.AllTech. 2014-06-26 23:14:14 +12:00
Paul Chote
749a947d3f Avoid repeated queries of DeveloperMode. 2014-06-26 23:14:14 +12:00
Paul Chote
2af123034d Use ExtraData for SetStance and SetUnitStance. 2014-06-26 23:14:13 +12:00
Paul Chote
7d24053f52 Introduce Order.SuppressVisualFeedback to cleanly disable flashes. 2014-06-26 23:14:13 +12:00
Paul Chote
32e0bf3edf Fix captured tech unlocking in TD. 2014-06-26 23:14:13 +12:00
Paul Chote
d318d7c5e3 Add HackyAI support for multiple structure queues. 2014-06-26 23:14:13 +12:00
Matthias Mailänder
74be133e40 Use Prerequisites: ~disabled for unbuildable actors. 2014-06-26 23:14:13 +12:00
Paul Chote
ca082e3cec Allow ProductionQueue to filter by race. 2014-06-26 23:14:13 +12:00
Paul Chote
d9e0559c7a Remove some long-dead code. 2014-06-26 23:14:13 +12:00
Paul Chote
66d9629520 Fix remaining tech tree issues. 2014-06-26 23:14:12 +12:00
Paul Chote
7b3a0ebeb5 Tidy production traits. 2014-06-26 23:14:10 +12:00
Paul Chote
f46f71217e Pass initial race to husks and transformed actors. 2014-06-26 23:12:23 +12:00
Paul Chote
7dfc822d76 Tidy transformation trait/activity. 2014-06-26 23:12:23 +12:00
Paul Chote
6536f92b12 Allow custom prerequisites to be restricted by race. 2014-06-26 23:12:23 +12:00
Paul Chote
d4227fa13e Fix production tooltip display. 2014-06-26 23:12:23 +12:00
Paul Chote
a5cc68efee Allow production ownership test to be disabled. 2014-06-26 23:12:23 +12:00
Paul Chote
c5089db19c Allow actors to exist in multiple building queues. 2014-06-26 23:12:22 +12:00
Paul Chote
d43acfe94b Merge pull request #5679 from RoosterDragon/main-loop-alloc
Reduce memory allocation in the main loop
2014-06-26 23:10:56 +12:00
Mustafa Alperen Seki
3c891f7c45 Hervaster collects tiberium 2014-06-26 12:29:42 +03:00
Tom Lane
8d6d06fc5f Remove ability for Sniper to capture churches. 2014-06-25 21:44:50 +01:00
Matthias Mailänder
48bd67b735 Merge pull request #5735 from pavlos256/always-save-replay
Properly save replay even when the game crashes (fixes #5610)
2014-06-25 20:17:39 +02:00
Matthias Mailänder
36c910fcae Merge pull request #5731 from RoosterDragon/sequence-initialize-fix
Fix #5452
2014-06-25 20:15:08 +02:00
Paul Chote
492513a89a Merge pull request #5706 from Mailaender/lint-players
Added a new OpenRA.Lint check for invalid player definitions
2014-06-25 11:30:34 +12:00
Pavlos Touboulidis
e19dae8eec Properly save replay even when the game crashes (fixes #5610) 2014-06-24 22:40:20 +03:00
Oliver Brakmann
0ff66949fb Make Shift+<Hotkey> queue five units/buildings. Fixes #5544. 2014-06-24 19:41:20 +02:00
Matthias Mailänder
66325f4941 Merge pull request #5733 from MustaphaTR/bleed
Heavy Support + Ordos Raider for light
2014-06-24 18:42:33 +02:00
RoosterDragon
3c9f589b5e Move try-catch during creation of sequences into the function rather than around the lazy initialization.
This fixes an issue with VS breaking on the exception because it thinks it will go unhandled, even though it will be handled.
2014-06-24 17:21:41 +01:00
Mustapha
50d12ee22e Update AUTHORS 2014-06-24 16:49:14 +03:00
Mustapha
b297bb7e75 Heavy Support + Ordos Raider for light 2014-06-24 16:43:09 +03:00
Matthias Mailänder
4018da3481 Merge pull request #5732 from MustaphaTR/bleed
Closes #5726
2014-06-24 09:39:40 +02:00
Mustapha
315fad8db7 Light Unit Support for D2K. 2014-06-24 09:30:39 +03:00
obrakmann
04dbe9fc2a Merge pull request #5687 from Mailaender/missile-out-of-map
Added a check for IsInMap(cell) to missiles.
2014-06-23 20:24:28 +02:00
Matthias Mailänder
378dd66622 Merge pull request #5701 from pavlos256/dev-crash
Add /crash dev command
2014-06-23 19:42:32 +02:00
obrakmann
07fc446520 Merge pull request #5697 from Mailaender/classic-minelay
Added a classic minelay order
2014-06-23 19:01:37 +02:00
Matthias Mailänder
7f8e84848d Merge pull request #5722 from MustaphaTR/bleed
Some description changes
2014-06-23 17:38:38 +02:00
Paul Chote
177dd02cd1 Merge pull request #5628 from pavlos256/smooth-scrolling
Add smooth scrolling to the ScrollPanelWidget
2014-06-23 21:46:50 +12:00
Paul Chote
0f115b0468 Merge pull request #5330 from Mailaender/jungle
Added the JUNGLE terrain
2014-06-23 21:42:26 +12:00
Chris Forbes
87ff787f26 Merge pull request #5721 from RoosterDragon/stylecop-small-projects
Run StyleCop on the smaller projects.
2014-06-23 19:09:04 +12:00
Mustapha
2d8f0ce96e Engineer's description changes. 2014-06-23 10:02:54 +03:00
Chris Forbes
3b99e79fd0 Merge pull request #5720 from pchote/revert-fail
Revert Utility changes
2014-06-23 19:01:35 +12:00
Mustapha
4159aa4bba Trike's weaknesses. 2014-06-23 09:56:15 +03:00
RoosterDragon
38617dc0a9 Run StyleCop on the smaller projects.
Also add a copy of the rules to the CrashDialog and Irc projects.
2014-06-23 00:03:37 +01:00
Paul Chote
7cf2a32a2a Revert "export health, cost and damage per section into a CSV file"
This reverts commit 8249012e4b.

Conflicts:
	OpenRA.Utility/Command.cs
2014-06-23 09:31:40 +12:00
obrakmann
e41791568d Merge pull request #5702 from Mailaender/reslayer-cell-full
Fixed exploding harvesters spawning resources on full cells
2014-06-22 18:57:57 +02:00
Matthias Mailänder
379686a64d Merge pull request #5711 from obrakmann/flyattack-fix
Fix FlyAttack discarding the activity queue upon completion
2014-06-22 18:49:00 +02:00
RoosterDragon
8a60880cf1 Tackle the last of the low hanging fruit for memory allocations in the main game loop.
- Avoid calling string.Split twice in SprintFont.Measure.
- Change ActorsInBox method of ActorMap and ScreenMap to avoid allocating and intermediate list. As a bonus this allows the sequence to be lazily consumed. Also avoid LINQ in these methods.
- In FrozenUnderFog.TickRender, the method exits early if no players are visible so the attempt at lazy generation was not needed.
- Unwrap a LINQ Any call in ClassicProductionQueue.Tick.
- Merge some successive Where calls in ProximityCapturable into single predicates.
2014-06-22 17:29:45 +01:00
Matthias Mailänder
a5d765e100 Merge pull request #5713 from RoosterDragon/game-project-config
Fix debug info regression from #5673
2014-06-22 17:55:03 +02:00
RoosterDragon
927b0499da Produce debug output for OpenRA.Game. 2014-06-22 16:38:05 +01:00
Oliver Brakmann
cf2fad673d Fix issue with capturing enemy buildings in 'Intervention' mission
The onDamaged event handler would still fire after an enemy building had
been captured. Fixed by checking the owner before starting repairs.

Thanks to Microbit for showing me that people actually did that.
2014-06-22 14:03:57 +02:00
Oliver Brakmann
c12527e866 Remove workaround for #4482 from 'Intervention' mission 2014-06-22 14:03:57 +02:00
Oliver Brakmann
aa91020790 Do not discard activity queue when FlyAttack completes. Fixes #4482. 2014-06-22 14:03:44 +02:00
Matthias Mailänder
4587ce6cd2 fix remaining errors spotted by new player lint check 2014-06-22 13:34:09 +02:00
Matthias Mailänder
6eabd080b8 StyleCop 2014-06-22 13:30:35 +02:00
Matthias Mailänder
b70c56927f add a new Lint check for map players 2014-06-22 13:30:35 +02:00
Matthias Mailänder
2e4749680c Merge pull request #5703 from abcdefg30/mapyamls-update
Fixed non-existing enemies in mini-games.
2014-06-22 13:02:29 +02:00
abcdefg30
3260590c59 updated training-camp mapyaml 2014-06-22 12:08:57 +02:00
abcdefg30
0daf8c173e updated drop-zone mapyaml 2014-06-22 12:07:48 +02:00
abcdefg30
fad98df605 updated bomber-john mapyaml 2014-06-22 12:07:02 +02:00
Matthias Mailänder
05609399eb don't try to spawn resources when the cell is already full
fixes #5699
2014-06-22 11:49:40 +02:00
Pavlos Touboulidis
98471092f6 Add /crash dev command
Throws an exception and crashes the game. Useful to test the
shutdown sequence.
2014-06-22 12:18:13 +03:00
Matthias Mailänder
48a5c69ab8 allow to lay single mines similiar to the original
closes #5467
2014-06-22 08:31:40 +02:00
Matthias Mailänder
d3d74c4e5f StyleCop 2014-06-22 08:31:36 +02:00
reaperrr
775f707e03 Made TD jungle terrain slightly less blueish. 2014-06-21 19:13:31 +02:00
Matthias Mailänder
52e2b83069 add the JUNGLE terrain to Tiberian Dawn
http://cnc-comm.com/community/index.php?topic=2880.0
2014-06-21 19:13:31 +02:00
Matthias Mailänder
69ddcf3fee Merge pull request #5692 from obrakmann/fix5681
Fix size of force-start lobby dialogs. Fixes #5681.
2014-06-21 18:04:10 +02:00
Pavlos Touboulidis
628c524494 Add smooth scrolling to the ScrollPanelWidget 2014-06-21 16:41:56 +03:00
Oliver Brakmann
235acea70a Fix size of force-start lobby dialogs. Fixes #5681. 2014-06-21 13:55:12 +02:00
Matthias Mailänder
8bff7baf4b destroy missiles leaving the map
fixes #5582
2014-06-21 13:28:09 +02:00
Matthias Mailänder
f48b53d5b1 Merge pull request #5690 from obrakmann/fix5686
Fix breakage of old Lua api. Fixes #5686.
2014-06-21 13:26:46 +02:00
Oliver Brakmann
f8e5217b11 Fix breakage of old Lua api. Fixes #5686. 2014-06-21 13:04:31 +02:00
Paul Chote
3ed0f75ecc Merge pull request #5689 from Mailaender/ts-domainindex
Added missing DomainIndex to Tiberian Sun
2014-06-21 22:57:23 +12:00
Paul Chote
2e605ba0f7 Merge pull request #5683 from Mailaender/autotarget-stance-documentation
Documented the AutoTarget stances system
2014-06-21 22:51:16 +12:00
Matthias Mailänder
ea4cde0da8 document DomainIndex 2014-06-21 12:37:04 +02:00
Matthias Mailänder
f13c5e20b4 add missing DomainIndex to Tiberian Sun 2014-06-21 12:31:38 +02:00
Matthias Mailänder
46b08273e0 Merge pull request #5680 from pchote/lobby-fixup
Clean up MapPreviewWidget.
2014-06-21 11:32:38 +02:00
Paul Chote
5760e665d3 Clean up map previews. Fixes #5665. 2014-06-21 21:15:11 +12:00
Matthias Mailänder
b85aaa7bfa document the stance system 2014-06-21 08:34:58 +02:00
Paul Chote
5cac1ed066 Merge pull request #5674 from abcdefg30/bleed
updated drop-zone-battle-of-tikiaki map.yaml
2014-06-21 13:39:51 +12:00
Paul Chote
444380b3cf Merge pull request #5676 from pavlos256/fix-rng-division-by-zero
Fix #5675
2014-06-21 12:57:49 +12:00
Pavlos Touboulidis
b9542e0f3f Fix #5675 2014-06-20 22:54:56 +03:00
abcdefg30
b592063a26 updated drop-zone-battle-of-tikiaki map.yaml
Replaced 7x "Multi17" (not existing) with "Multi7" and 1x "Multi11" (also not existing) with "Multi1"
2014-06-20 21:00:39 +02:00
Matthias Mailänder
53930fdc81 Merge pull request #5673 from RoosterDragon/solution-config
Clean up project settings
2014-06-20 20:58:05 +02:00
RoosterDragon
e0d8d8cf80 Clean up project settings.
- Create single platform config named x86 and have all projects target x86.
- Remove Release config (broken anyway).
- For the Debug config, ensure TRACE and DEBUG constants are set and unsafe code is allowed for all projects (same as the makefile).
- Warn level 4 and optimizations off were removed from the config automatically by VS (it assumes these values by default, and these match the makefile).
- The CrashDialog project can reuse the icon from the Game project as long as the path is set correctly.
- Fix TS project so it builds (I know it's going but its annoying that the project must be unloaded).
2014-06-20 19:29:54 +01:00
Paul Chote
bc92bc1774 Merge pull request #5649 from Mailaender/upnp-polish
Made the Mono.NAT integration more robust
2014-06-21 01:31:33 +12:00
Paul Chote
57280e3eab Merge pull request #5660 from Mailaender/document-traits
Documented some order related traits
2014-06-21 01:27:11 +12:00
Paul Chote
a6cb60e583 Merge pull request #5646 from Mailaender/replay-dropdown-polish
Polished the Replay Browser dropdowns
2014-06-21 01:23:33 +12:00
Paul Chote
fd78848de2 Merge pull request #5645 from Mailaender/travis-update-wiki
Added ./update-wiki.sh to Travis CI deployment
2014-06-21 01:20:29 +12:00
Paul Chote
c8c05ea19c Merge pull request #5451 from Mailaender/csv-dps
Added CSV rule export to OpenRA.Utility.exe
2014-06-21 01:18:12 +12:00
Paul Chote
f481c04ce6 Merge pull request #5305 from Mailaender/harvester-splatter-resoures
Added resource splattering to destroyed harvesters
2014-06-21 01:15:22 +12:00
Matthias Mailänder
e607c04cce let harvester splatter resources when exploding
closes #2346
2014-06-20 11:11:31 +02:00
Matthias Mailänder
3e627d2eba rename ore to the more generic name resources everywhere 2014-06-20 11:11:31 +02:00
Matthias Mailänder
30fa8f35d8 Update AttackGarrisoned.cs
closes #5264
2014-06-20 09:01:51 +02:00
Matthias Mailänder
0e1f98c2a9 Merge pull request #5600 from RoosterDragon/auto-restart
Offer user quick restart if settings change
2014-06-20 08:56:08 +02:00
Matthias Mailänder
6e97c51530 Merge pull request #5667 from noyanbaykal/bleed
Fixed #5664
2014-06-20 08:11:26 +02:00
Matthias Mailänder
ef2e02d008 document ScaredyCat 2014-06-19 21:21:16 +02:00
Matthias Mailänder
8ff5d9ef9b document Guard 2014-06-19 21:21:16 +02:00
Matthias Mailänder
d88fc7c3f2 document CanPowerDown 2014-06-19 21:21:16 +02:00
Matthias Mailänder
cf3f79bf29 document AttackWander 2014-06-19 21:21:16 +02:00
Matthias Mailänder
1c719cb34f document D2kResourceLayer 2014-06-19 21:21:16 +02:00
Matthias Mailänder
18805779a8 document RejectsOrders 2014-06-19 21:21:14 +02:00
noyanbaykal
54e53a1306 Changed spaces to tabs 2014-06-19 13:20:55 -04:00
noyanbaykal
0ad767a05e Fixed #5664
Mission description scrolls to the top whenever a new mission is
selected to avoid out-of-bounds scrollbar
2014-06-19 13:12:12 -04:00
Matthias Mailänder
e8473990ef Merge pull request #5658 from RoosterDragon/formatting-cleanup
Remove & sort usings
2014-06-19 08:36:57 +02:00
RoosterDragon
22abf9b4c4 Remove and sort usings. 2014-06-18 21:43:35 +01:00
RoosterDragon
e8111e8ac6 Restart the process rather than reloading a new AppDomain. 2014-06-18 21:36:59 +01:00
RoosterDragon
52b09bdfe8 If changed settings require a restart, offer the user to do it now.
Add a dialog when closing the settings screen asking the user if they would like to restart the game now in order to apply any settings that are only applied after restarting the game. The game is reloaded in-process by spinning up a new AppDomain in order to reset state.
2014-06-18 21:36:56 +01:00
Matthias Mailänder
6d2f180cd4 Merge pull request #5635 from RoosterDragon/traits
TraitDictionary cleanup
2014-06-18 11:09:50 +02:00
RoosterDragon
85734defec Improve trait enumeration speed for All and GetMultiple.
Use a hand-rolled enumerators to avoid the overhead from compiler generated enumerable blocks. This trades terseness for some minor performance gains.
2014-06-17 22:11:23 +01:00
RoosterDragon
909c5c7037 Some minor cleanup in TraitDictionary and affected callsites. 2014-06-17 22:10:41 +01:00
Paul Chote
50d3929862 Merge pull request #5616 from RoosterDragon/syncreport-simplify
Rewrite SyncReport for clarity and performance
2014-06-17 22:54:48 +12:00
Matthias Mailänder
3be26e4cda Merge pull request #5617 from pchote/attack-moveadjacent
Improve unit-attack movement
2014-06-17 10:03:49 +02:00
Matthias Mailänder
1f7b0ad5d4 time limit the port forwarding if possible 2014-06-16 16:42:06 +02:00
Matthias Mailänder
a8c029f130 check if we really found a UPnP compatible NAT device 2014-06-16 16:35:33 +02:00
Matthias Mailänder
4d2412f4b8 this can't throw 2014-06-16 16:34:44 +02:00
Matthias Mailänder
d25fd654bc NatUtility.DeviceLost is never fired 2014-06-16 16:33:57 +02:00
Matthias Mailänder
db319f8f0b this will never happen 2014-06-16 16:33:16 +02:00
Matthias Mailänder
521ca70254 set the git user and email to avoid problems 2014-06-16 10:30:14 +02:00
Matthias Mailänder
83e33b99e8 StyleCop 2014-06-16 10:22:10 +02:00
Matthias Mailänder
88480e0dc2 make it clear that this does not need to match content height 2014-06-16 10:17:30 +02:00
Matthias Mailänder
44ab94f03a limit replay browser dropdown box height to something sane
closes #5641
2014-06-16 10:16:54 +02:00
Matthias Mailänder
6928a828e8 pushd and popd is safer here to not confuse Travis 2014-06-16 09:34:17 +02:00
Matthias Mailänder
eb27c9ef9d run ./update-wiki.sh again after release deployment
closes #5643
2014-06-16 09:29:17 +02:00
Matthias Mailänder
1d276e4186 add a pure data export for non-spreadsheet applications 2014-06-15 20:13:14 +02:00
Matthias Mailänder
6d2dfabb41 factor in burst delay 2014-06-15 20:12:47 +02:00
Matthias Mailänder
e0ba2046b5 add weapon name 2014-06-15 20:12:24 +02:00
Matthias Mailänder
de005c284c add armor types and move calculation into spreadsheet 2014-06-15 20:11:41 +02:00
Matthias Mailänder
8249012e4b export health, cost and damage per section into a CSV file
closes #3855
2014-06-15 20:10:51 +02:00
Matthias Mailänder
60d973aab4 Merge pull request #5634 from pchote/supportpower-prereqs
Allow support powers to require tech prerequisites.
2014-06-15 13:10:39 +02:00
Paul Chote
a220182c9e Remove cruft from RA airfield rules. 2014-06-15 22:51:42 +12:00
Paul Chote
1db1a1b324 Fix a typo in ITechTreeElement. 2014-06-15 22:49:52 +12:00
Paul Chote
2180e1f3f1 Allow support powers to require tech prerequisites. 2014-06-15 22:49:52 +12:00
Paul Chote
afa3fc8143 Simplify MoveAdjacentTo pathfinding. 2014-06-15 22:48:44 +12:00
Paul Chote
2141656460 Only inset range for mobile targets. 2014-06-15 22:48:43 +12:00
Paul Chote
58c3f9ad0c Use MoveWithinRange for attack activities.
Fixes #2104. Fixes #2923. Fixes #4455.
2014-06-15 22:48:43 +12:00
Paul Chote
64ab0a77a9 Added MoveWithinRange activity for Mobile units. 2014-06-15 22:48:43 +12:00
Paul Chote
887a515e14 Add MinRange plumbing to attack activities. 2014-06-15 22:48:43 +12:00
Paul Chote
f5a44f3c41 Merge pull request #5633 from ScottNZ/refactor
Some R# refactoring
2014-06-15 22:33:30 +12:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
ScottNZ
23f0e00bcc Now that we're on .NET 4 again, reintroduce optional parameter for RegisterNewSquad 2014-06-15 22:14:40 +12:00
ScottNZ
5e641750aa Use Any() instead of Count() == 0 2014-06-15 22:14:39 +12:00
ScottNZ
831b9b3ca3 Remove some stray semicolons 2014-06-15 22:14:39 +12:00
ScottNZ
6b85660d7d Compact lambda expressions in some (not all) places 2014-06-15 22:14:38 +12:00
ScottNZ
375fc1c5f1 Remove redundant constructors 2014-06-15 22:14:38 +12:00
ScottNZ
91bc1acca3 Fixed selectedAuthor in ModBrowserLogic not being the correct value if mod.Author is null 2014-06-15 22:14:37 +12:00
Paul Chote
1169211893 Merge pull request #5579 from Mailaender/frozen-C4
Fixed C4 target inconsistencies with Fog of War and Husks
2014-06-15 22:01:04 +12:00
Paul Chote
cc3e9b55a8 Merge pull request #5596 from Mailaender/opengl-version
Fixed crash when OpenGL version parse fails
2014-06-15 21:45:32 +12:00
Paul Chote
91236b2ca0 Merge pull request #5639 from Mailaender/editor-stylecop
Fixed some minor StyleCop issues
2014-06-15 21:39:29 +12:00
Matthias Mailänder
8f64835898 StyleCop 2014-06-15 10:51:57 +02:00
Matthias Mailänder
0679940c77 Merge pull request #5637 from pchote/ready-blink
Restore the blinking ready text in TD.
2014-06-14 13:58:49 +02:00
Paul Chote
3ee54fd00a Restore the blinking ready text in TD. 2014-06-14 22:37:44 +12:00
Matthias Mailänder
88757eccfa Merge pull request #5517 from deniz1a/blink-ready
New alternating colors blink option for build palette widget
2014-06-14 12:00:26 +02:00
Matthias Mailänder
dac12839fd Merge pull request #5630 from pavlos256/map-helpers
Move map helpers from WorldUtils to Map
2014-06-14 11:49:19 +02:00
Matthias Mailänder
fe0d7ab00e Merge pull request #5627 from pchote/frozen-cloak-fix
Invalidate FrozenActors that don’t have any sprites.
2014-06-14 11:41:49 +02:00
Matthias Mailänder
b3a2f81706 Merge pull request #5470 from Kanar/AirfieldRP
Closes #5592
2014-06-14 11:03:17 +02:00
Matthias Mailänder
1ebfc6bb06 Merge pull request #5631 from pavlos256/dev-iddqd
Add "/all" dev command
2014-06-14 10:27:58 +02:00
Matthias Mailänder
ee0df9c1cb make C4 Demolition frozen actor aware 2014-06-14 09:35:38 +02:00
Matthias Mailänder
fa0e4c3d0d what if there is no vendor info to remove from version string 2014-06-14 08:25:46 +02:00
Matthias Mailänder
2cc1d34078 remove redundant OpenGL version check to avoid NREs 2014-06-14 08:25:46 +02:00
Matthias Mailänder
7b5476aca7 don't crash there yet when OpenGL version parsing fails
closes #5595
2014-06-14 08:25:26 +02:00
Paul Chote
479feadef3 Merge pull request #5469 from Mailaender/fort-lonestar-lua
Ported Fort Lonestar to Lua
2014-06-14 17:47:06 +12:00
Matthias Mailänder
525a0c4ff1 port Fort Lonestar to Lua 2014-06-14 07:40:52 +02:00
Matthias Mailänder
b7ca65fb7b update Lua project files 2014-06-14 07:32:47 +02:00
Matthias Mailänder
473ca13b17 dos2unix 2014-06-14 07:32:47 +02:00
Paul Chote
c58d737400 Merge pull request #5597 from Happy0/mouse_window_focus
Removing requirement to restart game after applying changes to mouse focus option
2014-06-14 17:30:02 +12:00
Paul Chote
f115dda5df Merge pull request #5550 from pavlos256/reload-chrome
Add developer shortcut to reload chrome files
2014-06-14 17:25:18 +12:00
Paul Chote
5e986b3079 Merge pull request #5615 from RoosterDragon/minor-alloc
Minor allocation tweaks
2014-06-14 12:26:39 +12:00
Pavlos Touboulidis
ee4f3e5642 Always allow cheats on single player games 2014-06-13 17:18:12 +03:00
Pavlos Touboulidis
d22658011b Add "/all" dev command 2014-06-13 16:26:48 +03:00
Pavlos Touboulidis
3f2425f1d6 StyleCop 2014-06-13 15:55:48 +03:00
Pavlos Touboulidis
86febed0ce Move ChooseRandomEdgeCell from WorldUtils to Map 2014-06-13 14:31:01 +03:00
Pavlos Touboulidis
060d5326ed Move FindTilesInCircle from WorldUtils to Map 2014-06-13 14:24:53 +03:00
Pavlos Touboulidis
03b8096807 Move DistanceToMapEdge from WorldUtils to Map 2014-06-13 14:04:36 +03:00
Pavlos Touboulidis
f0c672b70c Move ChooseRandomCell from WorldUtils to Map 2014-06-13 14:02:51 +03:00
Pavlos Touboulidis
77fb188585 Move ClampToWorld from WorldUtils to Map 2014-06-13 13:59:40 +03:00
Pavlos Touboulidis
c282fa1077 Move GetTerrainIndex/Info from WorldUtils to Map 2014-06-13 13:57:32 +03:00
Paul Chote
0cf2d608e4 Merge pull request #5463 from pavlos256/perf-terrain-movement
Change terrain type from string based dictionaries to arrays
2014-06-13 21:19:29 +12:00
Paul Chote
96477b7c1a Invalidate FrozenActors that don’t have any sprites. Fixes #4809. 2014-06-13 21:07:39 +12:00
Pavlos Touboulidis
db53f8e648 Add developer shortcut to reload chrome files
Hitting Ctrl+Shift+C will re-initialize the chrome provider,
reloading all chrome files instantly. Useful when changing the
UI.

Note: A new "RootWidget" was created to trap top-level (global)
shortcuts instead of putting everything in Widget.
2014-06-13 11:31:09 +03:00
Pavlos Touboulidis
092352729f Change terrain type from string based dictionaries to arrays 2014-06-13 11:20:54 +03:00
Paul Chote
ea276d466d Merge pull request #5621 from chrisforbes/travis-update-before-installing
Adjust travis config to update package lists before installing dependencies
2014-06-13 10:45:11 +12:00
Chris Forbes
83fc5085e3 Adjust travis config to update package lists before installing dependencies 2014-06-13 10:29:22 +12:00
Gordon Martin
89c9499909 Removing requirement to restart game after applying changes to mouse focus option. The setting now defaults to 'false' as it is likely to be disruptive to players who are used to the usual behaviour in windowed mode. 2014-06-12 22:57:25 +01:00
RoosterDragon
6f5fbeceb1 Use expressions to generate fast member access code rather than using the slower reflection based methods. 2014-06-12 08:32:26 +01:00
RoosterDragon
3e24e89477 Rewrite SyncReport for clarity and performance.
- Drop the impressive but inscrutable dynamically generated code in favour of some plain old code.
- Cache type information so costly reflection need not be performed each time.
- Only capture values from a sync object into an array rather than a dictionary lookup of both names and values for efficiency.
- Throw if the sync attribute is used on a property that cannot be read or that uses index parameters.
2014-06-12 08:30:27 +01:00
Paul Chote
b8cdb224d1 Merge pull request #5540 from RoosterDragon/begin-frame-cache-viewport
Avoid redundancy in BeginFrame.
2014-06-12 18:15:47 +12:00
Paul Chote
f6f366c4b3 Merge pull request #5401 from RoosterDragon/nodesdict
Changed MiniYaml.NodesDict property into a method.
2014-06-12 17:34:59 +12:00
RoosterDragon
b8b8b1e2df Minor changes to reduce allocation.
- Cache a predicate in ActorMap.
- Use short circuiting to skip a call to HasTrait in AttackBase.
- In AutoTarget.ScanForTarget, move the check for the scan time above the calculations since we can skip them if it's not time yet.
- In AutoTarget.ChooseTarget, merge four Where calls into one.
2014-06-12 05:32:44 +01:00
Paul Chote
e0c59511fb Merge pull request #5152 from Mailaender/auto-l10n
Automated translation string extraction
2014-06-12 10:31:07 +12:00
Chris Forbes
1c5c2b576c Merge pull request #5601 from RoosterDragon/sheet-perf
Speed up some loops with Marshal.Copy
2014-06-12 10:07:29 +12:00
Chris Forbes
ecb7b5056c Merge pull request #5602 from RoosterDragon/perfsample-streamline
Streamline PerfSample
2014-06-12 10:05:31 +12:00
RoosterDragon
4ce8a4a648 Use Marshal.Copy for faster array copying.
- Rewrite several methods to use Marshal.Copy to copy data faster and more succinctly compared to doing it manually.
- Rewrite Sheet.AsBitmap(TextureChannel, Palette) with a faster and more self descriptive loop.
2014-06-11 05:02:38 +01:00
RoosterDragon
783fd8eb32 Streamline PerfSample.
- Avoid memory allocations by making PerfSample a struct, and tracking ticks manually rather than creating a Stopwatch instance.
2014-06-11 03:52:16 +01:00
Paul Chote
e347cdfb32 Merge pull request #5410 from RoosterDragon/IDisposable
Disposable fixup
2014-06-11 10:55:44 +12:00
RoosterDragon
a2ed4fd5f9 Avoid redundantly setting viewport parameters in BeginFrame.
- Cache the old resolution, scroll and zoom in BeginFrame, and don't bother updating the viewport parameters again until they change.
- Pass around scroll as an int2 to reduce the number of back-and-forth casts.
2014-06-10 17:06:25 +01:00
Kanar
6fdb9e688a Adds RallyPoint to Airfield, queues TakeOff 2014-06-10 18:02:04 +02:00
Paul Chote
ccb34adb04 Merge pull request #5503 from RoosterDragon/map-preview-perf
Faster map preview generation.
2014-06-11 00:05:10 +12:00
RoosterDragon
9dbbc23967 Make map preview generation fast.
- Change Map.LoadMapTiles and Map.LoadResourceTiles to read the whole stream into memory before processing individual bytes. This removes the cost of significant overhead from repeated calls to ReadUInt8/16.
- Remove significant UI jank caused by the map chooser by not including the placeholder widget. The maps render fast enough that it is no longer worthwhile and it was causing a lot of flushes which were the source of the jank.
- Trigger async generation for all maps when the chooser is loaded. This means in practice all previews will be ready by the time the user begins to scroll the selection. Since generation is fast, there is no issue with scrolling straight to the bottom and having to wait for the backlog to clear.
2014-06-10 11:46:39 +01:00
RoosterDragon
a598a01108 Fixed IDisposable implementation and usage.
- Implement IDisposable interface correctly, with sealed classes where possible for simplicity.
- Add using statement around undisposed local variables.
2014-06-10 11:23:55 +01:00
deniz1a
1821c52db0 Make "Ready" text alternate between red and white
Make color of "Ready" text alternate between red and white.

Made the code cleaner.

Whitespace correction.

Whitespace correction again.

Change color from red to green and make it moddable

Use enum for ReadyTextStyle

Use enum for cnc

Made variables public and simplified if statements

fix enum

fix enum and )

ReadyText settings in ra yaml

ReadyText settings in cnc yaml

Move values from code to ra yaml

Move values from code to cnc yaml

revert code changes cnc

revert code changes ra

move around a bit in ra yaml

move around a bit in cnc yaml

Add values to d2k yaml
2014-06-10 12:00:57 +03:00
Matthias Mailänder
8093942913 fix bogus label descriptors 2014-06-10 09:24:35 +02:00
Matthias Mailänder
69d86cfcf2 add automated language string extraction to utility 2014-06-10 09:24:28 +02:00
Matthias Mailänder
c9a49538d6 translatable tooltips 2014-06-10 09:18:46 +02:00
Paul Chote
ee7573d01c Merge pull request #5484 from RoosterDragon/startup-efficiency
Improved efficiency of startup methods.
2014-06-10 18:28:25 +12:00
Paul Chote
373529e110 Merge pull request #5505 from pavlos256/map-preview-generation
Map preview generation
2014-06-10 17:56:21 +12:00
Chris Forbes
00b95f754f Merge pull request #5593 from RobotCaleb/misc_fixes
Expanded credits window a bit
2014-06-10 10:39:50 +12:00
Caleb Anderson
3b9f1ed43c expand credits window a bit to fit the text better. 2014-06-09 16:06:45 -06:00
Caleb Anderson
49def655c9 add sublime text project/workspace to ignore 2014-06-09 16:06:44 -06:00
Matthias Mailänder
9df00ad8f9 Merge pull request #5590 from Happy0/sd2windowgrab
Closes #4977
2014-06-09 20:29:29 +02:00
Gordon Martin
5eab479c34 Adding SDL2 window grab on loading the game. Made this behaviour configurable in the 'Input' tab of the Settings menu
Updated settings file for TD to expose the new 'Lock mouse to window' display configuration option

A text label notes that modifying the 'Lock mouse' check box requires a restart
2014-06-09 19:10:05 +01:00
RoosterDragon
e63f330717 Improved efficiency of startup methods.
- ShpReader will copy the input stream into memory just once rather than for every header.
- ShpReader.CopyImageData switched to use Array.Copy since that uses some unsafe magic for speed.
- In ActorInfo, cache a GetType call and prevent needless materialization in PrerequisitesOf.
- In ObjectCreator, cache type and ctor lookups since these are expensive and often repeated.
- Implement IReadOnlyDictionary<T, U> on Cache<T, U> to provide some supplementary functions.
- In TechTree.GatherOwnedPrerequisites, rearrange a Boolean 'and' expression to evaluate expensive functions later in the chain, and use ContainsKey to speed up name check.
2014-06-09 17:13:01 +01:00
RoosterDragon
2e992a7310 Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary.
- Cached a few invocations into locals which should prevent some redundant evaluation.
- Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
2014-06-09 17:06:42 +01:00
Matthias Mailänder
334a210231 Merge pull request #5564 from Kanar/MinibibsRework
Adds/reworks some minibibs
2014-06-09 16:54:35 +02:00
Matthias Mailänder
13fad65c19 Merge pull request #5539 from deniz1a/repair-pause
Closes #5322
2014-06-09 16:24:34 +02:00
Matthias Mailänder
7216688baf Merge pull request #5567 from ScottNZ/perf
Refactor AutoTarget scan and GPS interaction
2014-06-09 12:01:05 +02:00
Paul Chote
decdcf44d4 Merge pull request #5504 from RoosterDragon/frozen-fog-lookup-locals
Cache some dictionary lookups
2014-06-09 17:50:38 +12:00
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
Chris Forbes
033f631f28 Merge pull request #5508 from pavlos256/read-only-list
Add IReadOnlyList
2014-06-09 17:36:40 +12:00
Paul Chote
1c8a8ca6ff Merge pull request #5400 from RoosterDragon/equatable
Implemented IEquatable<T>
2014-06-09 17:32:17 +12:00
Paul Chote
ea9601b128 Merge pull request #5509 from RoosterDragon/stream-exts-fixes
Fixes to StreamExts.
2014-06-09 17:25:25 +12:00
Chris Forbes
1051728790 Merge pull request #5541 from RoosterDragon/enumerate-armaments-once
Avoid repeated work in AttackBase.
2014-06-09 17:07:51 +12:00
Matthias Mailänder
799966d376 don't target or demolish oil derrick husks 2014-06-08 11:18:14 +02:00
Matthias Mailänder
a35d84bf5a don't remove and add a trait at the same time 2014-06-08 11:17:10 +02:00
Matthias Mailänder
80a4f33730 document MoveIntoWorld 2014-06-08 11:12:05 +02:00
Matthias Mailänder
bc103f8ffd Merge pull request #5577 from pchote/production-fix
Don’t queue rallypoint move if MoveIntoWorld:false.
2014-06-08 10:38:12 +02:00
Paul Chote
2c5f1de780 Don’t queue rallypoint move if MoveIntoWorld:false. Fixes #5576. 2014-06-08 11:52:39 +12:00
Paul Chote
9762ef8119 Merge pull request #5573 from Mailaender/replay-hotkeys
Fixed pixel doubling and health bar hotkeys unavailable in spectator mode
2014-06-07 23:24:02 +12:00
Matthias Mailänder
3a1c41c8ce move pixel doubling and health bar hotkeys to shared widget
closes #5572
2014-06-07 12:26:58 +02:00
Paul Chote
f06cbfa5fe Merge pull request #5571 from Mailaender/invisible-gems
Fixed single resources being spawned at 0 density
2014-06-07 22:08:46 +12:00
Matthias Mailänder
0dee8208a8 never spawn with density 0 because that is not rendered 2014-06-07 11:56:54 +02:00
Matthias Mailänder
1c92737798 Merge pull request #5570 from pchote/arch-packaging
Fix arch packaging (attempt two).
2014-06-07 11:02:13 +02:00
Paul Chote
a0723bfec3 Fix pacman installation. 2014-06-07 20:58:08 +12:00
Matthias Mailänder
ffef0e97b6 Merge pull request #5569 from pchote/arch-packaging
Fix arch packaging.
2014-06-07 10:30:57 +02:00
Paul Chote
c811be1795 Fix arch package building on Travis. 2014-06-07 20:27:38 +12:00
Kanar
bf47543a0a Adds/reworks some minibibs 2014-06-07 09:24:08 +02:00
ScottNZ
7e6f7c51e1 Refactor AutoTarget scan and GPS interaction, and cache trait lookup for a slight performance boost 2014-06-07 12:01:50 +12:00
RoosterDragon
531e3b7861 Fixes to StreamExts.
- Almost all calls to Stream.Read were broken. These have been patched to all go through ReadBytes which itself has been fixed to function correctly. The key thing to note is that Stream.Read is very much allowed to return less than the requested number of bytes. If this happens and you're not checking the return result, you'll be working with partially initialized arrays and really bad stuff happens when you do that.
- Call CopyTo rather than copying between streams manually.
- Peek and ReadUInt8 have been changed to avoid a pointless array allocation which is significant overhead for such simple calls.
2014-06-07 00:49:25 +01:00
Paul Chote
5784444720 Merge pull request #5561 from Mailaender/rpm-file-listed-twice
Fixed rpmbuild warning: File listed twice
2014-06-06 00:50:18 +12:00
Matthias Mailänder
66bc649d75 fix rpmbuild warning: File listed twice 2014-06-05 14:36:37 +02:00
Paul Chote
6d1a46a2fe Merge pull request #5560 from Mailaender/travis-silence
Reduced the verbosity of the packaging build
2014-06-06 00:19:38 +12:00
Matthias Mailänder
92e5ea42db silence NSIS 2014-06-05 14:08:51 +02:00
Matthias Mailänder
8b1b50e9b3 silence zip 2014-06-05 14:08:43 +02:00
Paul Chote
59837f7a8d Merge pull request #5559 from Mailaender/travis-pedantic-braces
Fixed not being pedantic enough with curly braces
2014-06-05 23:57:09 +12:00
Matthias Mailänder
645b0f4da7 less verbose rpmbuild output 2014-06-05 13:51:41 +02:00
Matthias Mailänder
71e58fce30 be overly pedantic with ${}
because bash
2014-06-05 13:47:58 +02:00
Paul Chote
732d2da721 Merge pull request #5558 from Mailaender/travis-fixups
Fixed RPM deployment on Travis CI
2014-06-05 23:29:30 +12:00
Matthias Mailänder
76da946075 fix /home/travis/rpmbuild/SPECS/openra.spec: No such directory 2014-06-05 13:21:25 +02:00
Matthias Mailänder
354353814e fix RPM filename 2014-06-05 13:18:07 +02:00
Matthias Mailänder
6e289a549d deploy on all branches again 2014-06-05 13:02:10 +02:00
Paul Chote
90dbf3b5cd Merge pull request #5557 from Mailaender/travis-deploy-fixes
Fixed Linux packaging failing Travis CI deployment
2014-06-05 22:24:18 +12:00
Matthias Mailänder
4b3935b010 enforce bash usage to avoid problems on Ubuntu with dash 2014-06-05 12:20:54 +02:00
Matthias Mailänder
87ddbddf2f try an absolute path instead 2014-06-05 11:58:01 +02:00
Matthias Mailänder
83f11745f7 remove the wait so that CI can finish 2014-06-05 11:45:25 +02:00
Matthias Mailänder
7c28351ce3 fix /home/travis/rpmbuild/*: No such file or directory 2014-06-05 11:39:23 +02:00
Matthias Mailänder
2ca6bb5102 only install packaging tools before deploying 2014-06-05 11:34:04 +02:00
Matthias Mailänder
bdc50241ac don't build on bleed and fail because $TRAVIS_TAG is empty 2014-06-05 11:17:10 +02:00
Paul Chote
05aec743d3 Merge pull request #5555 from Mailaender/travis-release-polish
Tweaked Travis CI deployment
2014-06-05 20:56:47 +12:00
Matthias Mailänder
fd6a769511 special Linux version name scheme 2014-06-05 10:51:09 +02:00
Matthias Mailänder
e6dea1335b avoid an error when building from clean CI environment 2014-06-05 10:32:56 +02:00
Matthias Mailänder
dd7e92112e one at a time 2014-06-05 10:27:40 +02:00
Matthias Mailänder
4c38a881b4 don't dump into package.log 2014-06-05 10:19:16 +02:00
Matthias Mailänder
366b49f050 fix directory
we seem to be already in cd packaging
2014-06-05 10:18:09 +02:00
Paul Chote
e50af4ca67 Merge pull request #5554 from Mailaender/travis-openra-oauth
Updated the Travis CI OAuth token (again)
2014-06-05 19:49:20 +12:00
Matthias Mailänder
1eea78551b new OAuth new luck 2014-06-05 09:39:39 +02:00
Paul Chote
963003fddb Merge pull request #5545 from Mailaender/travis-oauth
Tried to get Travis deployment under control
2014-06-05 19:06:06 +12:00
Matthias Mailänder
d514344e39 whitelist pkgtest branches 2014-06-05 09:02:53 +02:00
Paul Chote
991e287173 Merge pull request #5548 from bountysource-support/patch-1
Add Bountysource badge to README
2014-06-05 10:17:40 +12:00
bountysource-support
8e2b9e7cc7 Add Bountysource badge to README
Because you have some open bounties, we thought you might want to display this badge in your README!
2014-06-04 14:41:20 -07:00
Deniz Ayıkol
5055764e04 Make repair animation pause if player has no money.
use anim.Paused

removed the using line
2014-06-04 22:15:18 +03:00
Matthias Mailänder
051317b1d9 Merge pull request #5537 from obrakmann/more-lua-crash-fixes
More lua crash fixes
2014-06-04 11:03:19 +02:00
Matthias Mailänder
4d4be9caf2 update encrypted OAuth 2014-06-04 09:24:41 +02:00
Matthias Mailänder
305412ae3d pacman does not exist on Ubuntu 2014-06-04 09:24:39 +02:00
RoosterDragon
0027434fbd Avoid multiple enumerations of armaments in AttackBase.
- Avoid enumerating the collection more than once in a method as it is not trivial.
2014-06-04 02:17:44 +01:00
Oliver Brakmann
89b25c10d6 Remove now redundant Actor.IsDead checks from mission scripts 2014-06-03 20:20:48 +02:00
Oliver Brakmann
3a2bb75e01 Check team members' health in Team.Do function 2014-06-03 20:19:49 +02:00
Matthias Mailänder
ff8e19e9e2 /usr/bin/openra needs make install-linux-shortcuts 2014-06-03 10:58:04 +02:00
Matthias Mailänder
17753ac6e2 complete the Gentoo dependencies via @cerebrum 2014-06-02 20:01:26 +02:00
Matthias Mailänder
bae893a5d3 fixed syntax errors 2014-06-02 19:54:35 +02:00
Matthias Mailänder
e547b71f20 document Lua 5.1 for Windows 2014-06-02 19:19:03 +02:00
Matthias Mailänder
69fe6f1349 update Debian/Ubuntu and SUSE build dependencies 2014-06-02 19:16:06 +02:00
Matthias Mailänder
da5ec9911a Slackware 13.37 is way too old for us now 2014-06-02 19:09:33 +02:00
Matthias Mailänder
3dc409fde0 Merge pull request #5532 from obrakmann/random-fixes
Random fixes
2014-06-02 16:20:43 +02:00
Oliver Brakmann
3586f9ad70 Fix issues in 'intervention' mission
* Fix an InvalidOperationException due to querying traits on a dead
  actor (fixes #5530)
* remove a gap in the SAM belt that shouldn't be there
2014-06-02 15:30:10 +02:00
Oliver Brakmann
3566abeba4 Remove incriminating evidence from the RA preview image
Addresses Scott's concern about the wrong explosion type on the sub pen.
2014-06-02 15:30:10 +02:00
Paul Chote
3803efb161 Merge pull request #5523 from Mailaender/dead-repair-indicator
avoid InvalidOperation and NullReferenceException
2014-06-02 22:36:56 +12:00
Paul Chote
6e921d8436 Merge pull request #5529 from Mailaender/rare-pillbox-nre
Fixed a rare NullReferenceException in CanUnload
2014-06-02 21:31:53 +12:00
Matthias Mailänder
e66358792e fix a rare NullReferenceException in CanUnload
closes #5528
2014-06-02 10:18:09 +02:00
Matthias Mailänder
1700a36286 avoid InvalidOperation and NullReferenceException
fixes #5522
2014-06-02 09:27:36 +02:00
Matthias Mailänder
4f79ce0459 Merge pull request #5527 from pchote/spy-fix
Make RenderSprites aware of EffectiveOwner.
2014-06-02 09:22:49 +02:00
Paul Chote
c0d7c7d840 Make RenderSprites aware of EffectiveOwner. Fixes #5526. 2014-06-02 18:21:06 +12:00
Paul Chote
ca9148c2d5 Merge pull request #5521 from Mailaender/travis-tagged-branches-errr-whatever
Fixed $TRAVIS_TAG being empty on release branches
2014-06-02 10:29:14 +12:00
Matthias Mailänder
4327169aaf was useful, but is kinda spammy 2014-06-01 18:20:06 +02:00
Matthias Mailänder
248ba4a4d7 fix the Travis deployment 2014-06-01 16:57:43 +02:00
Paul Chote
366bda5fca Merge pull request #5519 from Mailaender/travis-deploy-debug
Try to debug what is going on with $TRAVIS_TAG
2014-06-01 23:26:29 +12:00
Matthias Mailänder
4d8942a79d try to debug what is going on with $TRAVIS_TAG 2014-06-01 13:23:36 +02:00
Matthias Mailänder
17e6bc1824 Merge pull request #5518 from obrakmann/ra-preview-img
closes #5333
2014-06-01 13:11:46 +02:00
Oliver Brakmann
4fa2e36af8 New mod chooser preview image for Red Alert 2014-06-01 13:08:57 +02:00
Paul Chote
84c021f861 Merge pull request #5512 from Mailaender/d2k-repair-indicator-offset
Fixed the Dune 2000 repair indicator offset
2014-06-01 21:52:06 +12:00
Paul Chote
395aa5d29a Merge pull request #5515 from Mailaender/tolower-invariant
Fixed Dune 2000 crashing when placing buildings and using strange locale settings in latest playtest
2014-06-01 21:50:01 +12:00
Matthias Mailänder
75e19ca281 use ToLowerInvariant everywhere 2014-06-01 11:24:39 +02:00
Paul Chote
193325fbfa Merge pull request #5514 from Mailaender/d2k-arrakis-categories
Recatorized 3 tiles from Rock-Cliff-Sand to Rock-Cliff-Rock
2014-06-01 20:42:08 +12:00
Matthias Mailänder
e69e2b856b these don't show any sand 2014-06-01 10:12:16 +02:00
Paul Chote
adf8df5303 Merge pull request #5506 from Mailaender/openra.net
Replaced open-ra.org with openra.net in-game
2014-06-01 19:34:55 +12:00
Matthias Mailänder
9f0c7ea4d1 set repair indicator offset
fixes #5423
2014-06-01 09:15:18 +02:00
Paul Chote
7d33b353b7 Merge pull request #5511 from Mailaender/d2k-preview
Updated preview picture for Dune 2000
2014-06-01 19:12:50 +12:00
Paul Chote
104272cee5 Merge pull request #5476 from Mailaender/production-rallypoint-cache
Moved RallyPoint trait lookup into the constructor of Production
2014-06-01 19:04:58 +12:00
Matthias Mailänder
918fa879b6 update preview for d2k 2014-06-01 08:44:37 +02:00
Paul Chote
6dc83cf325 Merge pull request #5497 from Mailaender/map-rule-status-after-download
Fixed automatic map upload not refreshing map rule status
2014-06-01 18:29:39 +12:00
Paul Chote
1cc01a3a96 Merge pull request #5460 from Mailaender/system-libraries
Added support for SDL2 and Lua 5.1 system libraries
2014-06-01 18:14:05 +12:00
Matthias Mailänder
8a008447b3 Merge pull request #5489 from pchote/transport-fix
Simplify MoveAdjacentTo logic. Fixes #4449
2014-06-01 07:12:36 +02:00
Matthias Mailänder
00662fe391 also do a local rule check after map download 2014-06-01 06:01:41 +02:00
Matthias Mailänder
778f03baea add the new Lua API to make docs 2014-06-01 05:17:22 +02:00
Matthias Mailänder
e5c746df15 remove OpenRA.TilesetBuilder.exe from Linux packages 2014-06-01 05:16:53 +02:00
Matthias Mailänder
fe859c6fef rename everything freedesktop.org related install-linux-* 2014-06-01 05:15:30 +02:00
Matthias Mailänder
9e4713dc0a simplify startup scripts and configurable install directory 2014-06-01 05:10:25 +02:00
Matthias Mailänder
ff5ac155eb bring back install-shortcuts and add install-startup-scripts 2014-06-01 05:10:25 +02:00
Matthias Mailänder
b85610fcdd rename libexecdir to libdir 2014-06-01 05:10:25 +02:00
Matthias Mailänder
8e05243097 separate into icons and desktop from install-shortcuts 2014-06-01 05:10:25 +02:00
Matthias Mailänder
7c6cba889f strip unused dll map entries 2014-06-01 05:10:25 +02:00
Matthias Mailänder
77ed2ca331 add support for Debian multiarch 2014-06-01 05:10:25 +02:00
Matthias Mailänder
25933b012e add a hard-coded bundled library dllmap config to osx 2014-06-01 05:10:24 +02:00
Matthias Mailänder
3e53e84c1a abort earlier and harden against syntax errors 2014-06-01 05:10:24 +02:00
Matthias Mailänder
14429f6c11 be more verbose about success and handle failure with an error 2014-06-01 05:10:24 +02:00
Matthias Mailänder
dedafd1c22 also search /usr/local/lib and /opt/lib 2014-06-01 05:10:24 +02:00
Matthias Mailänder
99f6fce526 ralint is core and crashdialog (winform) tools 2014-06-01 05:10:24 +02:00
Matthias Mailänder
6c762f9c55 separate make dependencies into CLI and bundled native ones 2014-06-01 05:10:24 +02:00
Matthias Mailänder
6dfd89ce0d add configure script to workaround library naming differences 2014-06-01 05:10:24 +02:00
Paul Chote
883837a83c Merge pull request #5498 from Mailaender/invalid-map-key-download
Fixed KeyNotFoundException in ServerBrowser
2014-06-01 14:05:08 +12:00
Paul Chote
40eff95a10 Simplify MoveAdjacentTo logic. Fixes #5445. 2014-06-01 10:58:44 +12:00
Pavlos Touboulidis
7d352fdad1 MapCache performance improvements 2014-05-31 23:49:04 +03:00
RoosterDragon
f180f44542 Cache some dictionary lookups in FrozenUnderFog.Tick.
Since FrozenUnderFog.Tick gets called a lot, these dictionary lookups were actually getting repeated a fair amount. Avoiding the repeated work is a minor performance improvement.
2014-05-31 18:29:31 +01:00
Pavlos Touboulidis
e083b392ba Add IReadOnlyList 2014-05-31 18:37:03 +03:00
Matthias Mailänder
5b86a8a6a8 open-ra.org → openra.net
closes #5500
2014-05-31 17:14:33 +02:00
Pavlos Touboulidis
441d602a6d Fix thread synchronization problem with Sheet.dirty 2014-05-31 17:26:24 +03:00
Matthias Mailänder
a900f24466 calculate exitLocation before FrameEndTask
and add more null and dead checks to be safe
2014-05-31 16:11:50 +02:00
Matthias Mailänder
61d576ec6e harden map search preview against invalid data
fixes #5492
2014-05-31 15:19:22 +02:00
Matthias Mailänder
bb57ccd5bb update MapRuleStatus after download
fixes #5479
2014-05-31 13:14:53 +02:00
Matthias Mailänder
266240a3c1 Merge pull request #5502 from pchote/support-beacons
Support beacon polish fixes.
2014-05-31 10:35:48 +02:00
Paul Chote
e1501d5b7c Add clock overlay to support power beacons. 2014-05-31 18:41:02 +12:00
Paul Chote
91126b9c48 Move support power beacons into Airstrike/Nuke.
This allows each instance to close over the individual beacons. Fixes #5455.
2014-05-31 17:10:46 +12:00
Paul Chote
67f1207ef5 Merge pull request #5408 from RoosterDragon/perftimer-tick
Changed logging in DoTimed/RunActivity to create less overhead
2014-05-31 16:55:47 +12:00
Phrohdoh
4ef82f2863 Merge pull request #5488 from aaroncampf/bleed
Fixing issue #5308
2014-05-29 20:35:46 -05:00
Aaron Campf
6223b0f97d Fixing issue #5308 2014-05-29 18:16:34 -07:00
Matthias Mailänder
922c935d1a Merge pull request #5483 from obrakmann/some-map
Add a lua-powered single-player mission
2014-05-29 13:55:56 +02:00
Oliver Brakmann
e9e32b703e Add single-player mission 'Intervention' 2014-05-29 11:51:48 +02:00
Phrohdoh
8be4f02847 Merge pull request #5480 from Mailaender/d2k-concrete-color
Fixed concrete having the same radar color as sand.
2014-05-28 15:03:03 -05:00
RoosterDragon
d1b3d77662 Changed logging in DoTimed/RunActivity to create less overhead.
- Refactored PerfTimer to use less memory.
- Avoid using the PerfTimer in highly called methods DoTimed and RunActivity, instead tracking long ticks manually to reduce overhead and avoid memory allocations.
- Added some helper methods in PerfTimer to output information when a tick takes too long.
- Changed PerfTimer logging to output the time at the start of the line, and no longer truncate output per line.
- Settings.LongTickThreshold changed from TimeSpan to float and renamed to LongTickThresholdMs.
2014-05-28 16:38:05 +01:00
Matthias Mailänder
446884fec2 Merge pull request #5481 from Generalcamo/patch-8
Small Correction to one of the music names.
2014-05-28 16:18:48 +02:00
Cody Brittain
9a789a1e76 Small Correction to one of the music names.
Taken from Frank Klepacki's Website
2014-05-28 09:38:52 -04:00
Matthias Mailänder
4adaf9fa2d give concrete a color that is distinguishing from sand 2014-05-28 14:03:19 +02:00
Matthias Mailänder
c1f8a8e315 move RallyPoint lookup into a Lazy 2014-05-28 10:51:53 +02:00
Paul Chote
7eb2244f4b Merge pull request #5412 from RoosterDragon/formatting
Formatting
2014-05-28 12:09:47 +12:00
Paul Chote
ae7ab8f9e0 Merge pull request #5449 from Mailaender/nsis-lua-outpath-breakage
Fixed the OpenRA.Game.exe start menu link
2014-05-28 11:45:27 +12:00
Paul Chote
409e3a5ffc Merge pull request #5456 from Mailaender/travis-next-master
Adjustments to Travis CI
2014-05-28 11:32:41 +12:00
Paul Chote
59292e5b88 Merge pull request #5461 from Mailaender/sle-libraries
Replaced libraries with SUSE Linux Enterprise 11 SP3 binaries
2014-05-28 11:32:06 +12:00
Matthias Mailänder
4c50757b18 catch trait lookup in constructor
closes #5472
2014-05-27 17:17:02 +02:00
RoosterDragon
0c8bdff5be Formatting fixes.
Spaces to tabs, indents, etc.
2014-05-26 18:10:59 +01:00
obrakmann
d6fe3c5fc3 Merge pull request #5447 from Mailaender/pickany-snow
Fixed broken random tiles in map editor for RA snow tileset
2014-05-26 17:03:34 +02:00
Matthias Mailänder
af9e85b18a Merge pull request #5462 from obrakmann/gdi04
Add remaining alternative gdi04 missions
2014-05-26 16:18:31 +02:00
Matthias Mailänder
baca227940 replace libraries with SUSE Linux Enterprise 11 SP3 binaries 2014-05-26 12:33:14 +02:00
Matthias Mailänder
87c506f241 Merge pull request #5420 from NukemBro/bleed
New Maps
2014-05-26 08:23:04 +02:00
Matthias Mailänder
1d2bde3a01 Merge pull request #5453 from Kanar/AirStopVoices
Small Polish: Adds voices for aircraft's stop-orders
2014-05-26 07:59:01 +02:00
Matthias Mailänder
b304f4754c we don't support SDL 1.2 anymore 2014-05-26 07:50:12 +02:00
Matthias Mailänder
f6657b3049 also watch master and next for deployment 2014-05-26 07:49:54 +02:00
Kanar
b6a758494b Small Polish: Adds voices for aircraft's stop-orders 2014-05-26 03:28:51 +02:00
Matthias Mailänder
3cc8c31d36 remove tile templates for non-existing sprites 2014-05-25 21:36:41 +02:00
Matthias Mailänder
76b7b3b18e add unused sprites to rv05 tile 2014-05-25 21:36:14 +02:00
Matthias Mailänder
1926588349 unbreak the OpenRA.Game.exe start menu link
fixes #5448
2014-05-25 17:39:04 +02:00
Matthias Mailänder
a585ce5f17 fix broken random tiles in map editor for RA snow tileset 2014-05-25 15:59:36 +02:00
Matthias Mailänder
4d933481ce Merge pull request #5444 from ScottNZ/bleed
Closes #5439
2014-05-25 14:10:57 +02:00
ScottNZ
40e9fb93d6 Revert project file changes by RoosterDragon which would cause the TD mod to fail to load for some reason on Windows (de7a837d94, #5403).
VS will also generate a warning if it tries to source an icon from somewhere not in the project directory, so added it to the CrashDialog folder.
2014-05-26 00:07:30 +12:00
Paul Chote
a7aa5bebe5 Merge pull request #5429 from psydev/map
fixed a tib tree in Rogue States + polish
2014-05-25 23:38:04 +12:00
Paul Chote
cde015ec4d Merge pull request #5442 from Mailaender/frozen-actor-regression
Fixed frozen actors not visible under fog
2014-05-25 23:33:13 +12:00
Matthias Mailänder
fd185a5ca0 Merge pull request #5441 from ScottNZ/news
Closes #5438
2014-05-25 09:14:06 +02:00
Matthias Mailänder
683edd2c37 fix frozen actors not visible under fog 2014-05-25 09:07:25 +02:00
ScottNZ
157a42a3d5 Revert "Move cnc perf graph out of the way of the news button"
This reverts commit 8fc3870656.
2014-05-25 15:13:05 +12:00
Grant H.
0f49b402ef Map fixes
-Fixed/balanced "Man to Man" 1v1 map.
-Made minor alterations to "Singles" 1v1 map.
2014-05-24 21:30:58 -05:00
Chris Forbes
5eb61dbdd2 Merge pull request #5411 from RoosterDragon/general-clean
General Cleanup
2014-05-25 11:03:03 +12:00
Chris Forbes
51b70777bd Merge pull request #5432 from Mailaender/replay-filter-nre
Fixed NullReferenceException when there are no replays
2014-05-25 10:56:02 +12:00
Chris Forbes
2d90032ce9 Merge pull request #5404 from RoosterDragon/remove-as-hashset
Changed removeActorPosition field in ActorMap into a set.
2014-05-25 10:53:19 +12:00
Chris Forbes
f7c91a9932 Merge pull request #5433 from RoosterDragon/main-loop-alloc
Reduce memory allocations in the main loop.
2014-05-25 10:38:27 +12:00
Matthias Mailänder
7cb8d0fef0 Merge pull request #5435 from reaperrr/ra-polish
Fixed RA camo pillbox desert art and aircraft selection boxes
2014-05-24 21:25:46 +02:00
reaperrr
0c109ed3ea Tweaks aircraft selection box bounds.
Closes #5208.
2014-05-24 20:45:37 +02:00
reaperrr
b3aaa6b1f1 Fixes camo box desert art.
Removes swimming pixel effect and bogus remap pixels. Closes #4796.
2014-05-24 20:44:24 +02:00
Matthias Mailänder
f83e27ae9a Merge pull request #5403 from RoosterDragon/solution-config
Unify settings for solution and project setups.
2014-05-24 17:13:43 +02:00
Matthias Mailänder
ca0fe59c41 make sure replays is always initialized
fixes #5431
2014-05-24 17:10:13 +02:00
Oliver Brakmann
d6f3d1035e Add port of scg04wb mission 2014-05-24 14:35:45 +02:00
Oliver Brakmann
668e5318fb Add port of scg04wa mission 2014-05-24 14:35:44 +02:00
Matthias Mailänder
5a3e333570 Merge pull request #5426 from pchote/replayfix
Save the replay metadata block when quitting.
2014-05-24 13:55:24 +02:00
Matthias Mailänder
2b555623fb Merge pull request #5425 from pchote/pingfix
Separate ping lifetime from beacons.
2014-05-24 13:51:08 +02:00
Matthias Mailänder
b33dbe2f7c Merge pull request #5396 from reaperrr/ts-update
TS mod fixes and additions
2014-05-24 13:36:17 +02:00
Paul Chote
910db14ee8 Save the replay metadata block when quitting. 2014-05-24 23:13:19 +12:00
Psydev
81c72e622d fixed a tib tree in Rogue States + polish 2014-05-24 04:12:46 -07:00
reaperrr
e1b78bc728 Tweaks Mammoth Mk.2 firing offsets 2014-05-24 13:12:32 +02:00
reaperrr
4aafd4ecf4 Adds TODO comments to GDI placeholder defenses 2014-05-24 13:12:31 +02:00
reaperrr
ee77be25d6 adds disabled voxel sequences for various unused voxels for possible use later on 2014-05-24 13:12:31 +02:00
reaperrr
37f831ca9c Adds defenses and advanced Nod power plant, fixes GDI radar dish animation
Additionally tweaks offsets for deployed artillery and tick tank.
2014-05-24 13:12:30 +02:00
Paul Chote
cb13335b8d Separate ping lifetime from beacons. Fixes #5424. 2014-05-24 23:05:22 +12:00
Paul Chote
f5badcfc98 Merge pull request #5415 from pavlos256/replayrecorder-disposing-crash
Fix #5414
2014-05-24 20:55:38 +12:00
Matthias Mailänder
5826c41741 Merge pull request #5422 from pchote/but-I-do-have-shroud
Avoid a loop closure issue that caused incorrect sequence lookups.
2014-05-24 10:48:14 +02:00
Paul Chote
51c5797a42 Avoid a loop closure issue that caused incorrect sequence lookups. 2014-05-24 20:32:42 +12:00
Matthias Mailänder
aed5c0d4ce Merge pull request #5419 from pchote/news
Ingame news tweaks
2014-05-24 10:19:20 +02:00
Paul Chote
59993653aa Point news url at the website. 2014-05-24 20:08:48 +12:00
Paul Chote
932765d0c4 Adjust news dialog layout. 2014-05-24 20:08:48 +12:00
Grant H.
260966649f New Maps
-Added Updated/Balanced version of Doubles
-Added "Singles," 1v1 version of Doubles
-Added "Synergy," 3v3 Ground, Naval, and Air
2014-05-24 01:17:46 -05:00
Paul Chote
ccd9797caf Fix TD spawn dialog dropdown background. 2014-05-24 18:06:40 +12:00
Matthias Mailänder
cb1a222fd5 Merge pull request #5418 from pchote/bullet-contrails
Remove contrails from AA Gun and Sniper.
2014-05-24 06:52:41 +02:00
Paul Chote
6cdd89a2e6 Remove contrails from AA Gun and Sniper. Fixes #5417. 2014-05-24 16:34:58 +12:00
Paul Chote
83f742c679 Merge pull request #5399 from Squiggles211/spawn_choices
Fixes #5394 Spawnpoint dropdown count
2014-05-24 16:13:31 +12:00
Paul Chote
0c44ae0265 Merge pull request #5413 from psydev/patch-1
Reduce Grenadier dmg vs. heavy from 50% -> 35%
2014-05-24 16:10:57 +12:00
RoosterDragon
e07c9fc791 Deduplicate OpenRA.ico.
Use a path with backslashes to satisfy VS2012.
2014-05-23 21:22:06 +01:00
Matthias Mailänder
9ff1a317fd Merge pull request #5402 from RoosterDragon/traitdictionary-contains
Fixed TraitDictionary.Contains to use Any() rather than Count() != 0.
2014-05-23 19:43:48 +02:00
Matthias Mailänder
dea15a0ffe Merge pull request #5407 from psydev/maps
Maps: 1 new map, 2 map updates
2014-05-23 19:30:41 +02:00
Pavlos Touboulidis
5a286ef15e Fix #5414 2014-05-23 19:08:45 +03:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
psydev
6c46f9d198 Reduce Grenadier dmg vs. heavy from 50% -> 35%
Grenadier is a wee bit too powerful vs. everything. 
This will keep its value vs. heavy armor still very high, but not OP like it is for the cost. 
(Grenadier will still have highest DPS vs. heavy as a function of cost, after this nerf).
2014-05-23 07:20:41 -07:00
RoosterDragon
a0db80cb6a Changes to reduce allocations in the main loop.
Targeted some methods that generated allocated a lot of memory in the main game loop:
- Actor.Render - Changed LINQ calls into equivalent loops. No allocation for delegates.
- Animation.Render - Returned an array rather than a yield expression. The array uses less memory than the complier generated enumerable.
- FrozenActor and FrozenUnderFog - Materialize the footprint into an array: The enumerable is not-trivial to evaluate is and evaluated many times inside the Tick function. The memory needed is minimal. Changed LINQ into equivalent loops to prevent delegate allocation. Should result in overall much faster calls.
- Widget.GetEventBounds - Changed LINQ calls into equivalent loops.
- MobileInfo.CanEnterCell - Changed LINQ calls into equivalent loops. Don't materialize list of blocking actors every time, instead enumerate them and only when they need to be checked.
- FrozenUnderFog.TickRender - Generate the renderables lazily and also remove a no-op Select call.
2014-05-23 14:48:11 +01:00
Psydev
11a3b3d4fc minor: removed "C&C" from the title of Haos Ridges 2014-05-23 06:14:12 -07:00
Psydev
fd0287cec0 improved "Deterring Democracy". Better tib.
Changed layout of tiberium, especially blue tib.
Removed hospitals.
2014-05-23 06:12:09 -07:00
RoosterDragon
b1d5f4edd9 Also implemented on the Bits<T> struct. 2014-05-23 13:53:56 +01:00
Psydev
13483f797a new map: "Profit Over People" (1vs1) 2014-05-23 05:23:57 -07:00
Psydev
15e7b098d1 re-add 8-player version of HoS, with "8P" title
Includes same minor aesthetic fixes as 4P version.
2014-05-23 05:22:28 -07:00
Psydev
5c38fcee27 fix + replace Hegemony or Survival with 4p version
There were a few leftover minor aesthetic issues with the map which I
quickly fixed.
I decided that not many people would play the 8P version of this map, so I
made the 4P version the one included. It's actually fun.
2014-05-23 05:20:56 -07:00
reaperrr
467d1b6137 Adds Scorch and Crater marks to world, adds Heavy start unit support for testing purposes 2014-05-23 13:39:51 +02:00
reaperrr
06fc2a31d6 Fixes offsets, adds muzzles and Turret ROT values for several vehicles.
Adds cloak sound to stealth tank.
2014-05-23 13:39:50 +02:00
reaperrr
21625f5650 Fixes bounds, offsets, FireDelays and weapons for some infantry 2014-05-23 13:39:50 +02:00
reaperrr
425d02e86b Adds several previously missing weapons, resets Versus values to original TS values
Fixes flameall.shp to cover 8 directions instead of only 4
2014-05-23 13:39:49 +02:00
RoosterDragon
2bd8778c55 Changed removeActorPosition field in ActorMap into a set.
This is because it's purpose is to be queried via Contains when actors needed to be removed.
2014-05-23 08:30:45 +01:00
RoosterDragon
da6b5c1ce4 Fixed TraitDictionary.Contains to use Any() rather than Count() != 0.
This means it can bail early if a match is found.
2014-05-23 08:25:47 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
RoosterDragon
de7a837d94 Unify settings for solution and project setups.
Create a single solution platform named x86.
Ensure both Debug and Release configs build to the root for all projects.
Ensure all Release configs generate pdbs.
2014-05-23 08:16:09 +01:00
Squiggles211
7e2599c898 Fixes #5394 Spawnpoint dropdown count
Fixes where the spawn point dropdown would show the same number of spawn
points as the number of players rather than the actual number of
available spawn points.
2014-05-23 02:14:16 -05:00
RoosterDragon
67594b844a Implemented IEquatable<T> to speed up equality comparisons.
Actor, CPos, CVec, WAngle, WPos, WRange, WRot and WVec structs now implement IEquatable<T> which means unboxing/casting costs can be eliminated.

Also simplified the ToString method by concatenating components directly rather than using a format string since the overhead is a bit high for simple cases like this.
2014-05-23 08:04:43 +01:00
Paul Chote
db08357e36 Merge pull request #5215 from pavlos256/replay-meta
Replay meta
2014-05-23 11:30:12 +12:00
reaperrr
9d5228d141 Set Tick value for various TS infantry sequences to 80 2014-05-22 22:27:55 +02:00
reaperrr
887ec938cc adds muzzle sequences for vehicles 2014-05-22 22:27:54 +02:00
reaperrr
dc143d0967 Adds sequences for flameall, scorch and crater marks, and smoke placeholder 2014-05-22 22:27:53 +02:00
reaperrr
3fcd77eb41 Adds various crate effect sequences, removes levelup ra backfall. 2014-05-22 21:50:05 +02:00
reaperrr
077efb5884 Fixes two music track titles 2014-05-22 21:46:11 +02:00
reaperrr
e4b37c1b5d Reduce speed penalty for vehicles on certain terrain types.
The old one were a bit harsh.
2014-05-22 21:36:24 +02:00
reaperrr
a5eb398840 Merge pull request #5379 from Mailaender/alpha-lamb
Added the Tiberian Sun light post
2014-05-22 21:20:48 +02:00
Pavlos Touboulidis
b8bbd55598 Misc changes
* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
2014-05-22 21:57:07 +03:00
Pavlos Touboulidis
fe1eb1f3e0 Use the stream extensions instead of the BinaryReader/Writer 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
39cc4cc014 Use "debug" channel to report loading exceptions 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
38a5e326f6 Fix crash when trying to read empty replay files
It was crashing because it tried to seek 8 bytes before the end
of a file that was empty (zero length).

I also added a few more checks and another try/catch to prevent
any more crashes related to damaged files.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
f4c52eefae Change date labels
Change "Last Week" to "Last 7 days" and "Last Month" to "Last 30 days".
Also added a "Last 14 days" option.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
042910bd5e New common dialog: TextInputPrompt to get a string from the user
For both ra and cnc
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
713141cf4d Support for input validation on TextFieldWidgets
See OnTextEdited(), IsValid(), TextColorInvalid (with the default in metrics.yaml).
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
ce8c42b552 Style & nit fixes 2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
a80c4f086a Add filters to the replay browser dialog
This closes issue #2152. The filters added are:

* Game type (singleplayer / multiplayer)
* Date
* Duration
* Outcome
* Player name

Other changes:

* Added a 'CollapseHiddenChildren' option to the ScrollPanelWidget to
make hidden children take up no space.
* Removed the extension (.rep) from the replay filenames in the
replay browser.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
98a05b61b3 Add metadata block to replays
The replay files are just streams all network communication so to
get any info out of them it is necessary to play back the stream
until the wanted information is reached.

This introduces a new metadata block placed at the end of the
replay files and logic to read the new block, or fall back to
playing back the stream for older files.

The replay browser is also updated to use the metadata information
instead of reading the replay stream directly.
2014-05-22 21:54:14 +03:00
Matthias Mailänder
20a441a1f4 add the Tiberian Sun light post 2014-05-22 14:59:43 +02:00
Paul Chote
4454c0c2f8 Merge pull request #5372 from Mailaender/desert-tree-exclude
Fixed temperat trees showing up in the Tiberian Dawn DESERT tileset
2014-05-23 00:57:27 +12:00
Paul Chote
d252d1cf18 Merge pull request #5366 from Mailaender/rpmlint-duplicates
Removed duplicates identified by RPMlint
2014-05-23 00:56:01 +12:00
Matthias Mailänder
4eaeff8ccb Merge pull request #5393 from pchote/palettehax
Support per-animation palettes in RenderSprites.
2014-05-22 14:54:39 +02:00
Paul Chote
892f3c834c Merge pull request #5365 from Mailaender/tools-shortcuts
Separated tools and /usr/bin shortcuts
2014-05-23 00:53:42 +12:00
Paul Chote
ab1ce4554d Fix star port and repair depot lights. 2014-05-23 00:37:21 +12:00
Paul Chote
8e18e34a8b Fix D2K construction yard overlays. 2014-05-23 00:37:20 +12:00
Paul Chote
46a7c9c469 Add custom palette support to With*Overlay. 2014-05-23 00:37:20 +12:00
Paul Chote
900f5bffb5 Change Bib to use RenderSprites. 2014-05-23 00:37:20 +12:00
Paul Chote
4c92c5da99 Support per-animation palettes. 2014-05-23 00:37:20 +12:00
Paul Chote
15f63fb5ea RenderSprites.anims is finally private.
Followup to #3348.
2014-05-23 00:37:20 +12:00
Paul Chote
4aa7376994 Add wrappers for RenderSprites anims dictionary. 2014-05-22 23:35:10 +12:00
Paul Chote
475aa93271 Merge pull request #5373 from Mailaender/repair-overlay
Added the Dune 2000 repair depot active overlay
2014-05-22 23:29:53 +12:00
Paul Chote
2b5667d5b0 Merge pull request #5376 from Mailaender/airdrop-overlay
Added the Dune 2000 starport lights
2014-05-22 23:27:32 +12:00
Matthias Mailänder
ecf199560a Merge pull request #5392 from reaperrr/levelup-palette
Adds separate LevelUpPalette to GainsExperience
2014-05-22 13:19:14 +02:00
reaperrr
61edd6bc89 Adds separate LevelUpPalette to GainsExperience.
Needed for TS mod, as TS veteran crate effect anim uses a different palette than the rank chevrons.
2014-05-22 13:01:35 +02:00
Matthias Mailänder
e80eb7e0ee Merge pull request #5353 from pchote/map-validation
Disable maps with invalid rules
2014-05-22 09:55:06 +02:00
Matthias Mailänder
6081a4f16b Merge pull request #5390 from Squiggles211/hpad_reserved
Fixes #4955 aircraft reservation crash
2014-05-22 09:50:08 +02:00
Matthias Mailänder
7fad385d8c Merge pull request #5381 from Squiggles211/bridge_targeting
Lower BridgeHut Selectable Priority
2014-05-22 09:09:59 +02:00
Squiggles211
0e4b1d28aa Fixes #4955 aircraft reservation crash
Fixes the specific cause of the crash reported in #4955 with HeliReturn
and adds an UnReserve call while attempting to reserve spawn building in
Aircraft.cs
2014-05-22 01:38:08 -05:00
Paul Chote
a040abd539 Merge pull request #5389 from pavlos256/preload-sequences
Preload sequences
2014-05-22 17:45:38 +12:00
Pavlos Touboulidis
531338a955 Preload sequences and fix #5382 2014-05-22 03:45:28 +03:00
Pavlos Touboulidis
df0d1360dd Give PerfTimer the ability to write only slow operations to the log
This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
2014-05-22 03:40:36 +03:00
Paul Chote
df7e82ee96 Merge pull request #5388 from reaperrr/shp-fixes
Various RA/TD mod shp fixes
2014-05-22 11:09:00 +12:00
reaperrr
a8cf41dba3 Compressed/re-compressed cnc mod shps. 2014-05-21 22:35:03 +02:00
reaperrr
40baf8e450 Compressed some more uncompressed shps in ra bits folder. 2014-05-21 21:51:50 +02:00
reaperrr
e01596034b Minor shp fixes.
Removed green pixels from mine.int, fixed a few non-remapable red pixels on afldidle.shp.
2014-05-21 21:50:34 +02:00
Matthias Mailänder
ad2ee2e75f Merge pull request #5385 from reaperrr/sniper-fix
Replaces uncompressed sniper.shp with a  XCC-Mixer-compressed version
2014-05-21 19:50:48 +02:00
Matthias Mailänder
daa58e150b Merge pull request #5367 from psydev/mapfix
Updated 2 of psydev's recent TD maps -- minor fixes
2014-05-21 19:27:36 +02:00
reaperrr
ada6df279b Replaces uncompressed sniper.shp with a XCC-Mixer-compressed version. 2014-05-21 18:26:56 +02:00
Psydev
ab7a3bd986 updated pirates & emperors - no TEMPERAT trees
All trees are from the original C&C Desert tileset. Made a few tiny
changes to layout as a result.

The dense tree/cactus/rock areas near the bases have been thinned out
slightly.
2014-05-21 03:55:35 -07:00
Squiggles211
099d2a5400 Lower BridgeHut Selectable Priority
Fixes #4738 where player was unable unable to attack units/buildings that
are next to or on a bridge.
2014-05-21 00:40:48 -05:00
Chris Forbes
65c990c274 Merge pull request #5380 from pavlos256/strategic-replay-crash
Fix strategic map replay exception
2014-05-21 16:32:10 +12:00
Pavlos Touboulidis
b38542643d Fix strategic map replay exception 2014-05-21 00:57:21 +03:00
Matthias Mailänder
d80edcd4e8 add Tiberian Sun repair depot 2014-05-20 20:52:47 +02:00
Matthias Mailänder
5274776d55 add the Dune 2000 repair depot active overlay 2014-05-20 11:48:52 +02:00
Matthias Mailänder
ddb0d70fd2 add the starport active animation 2014-05-20 11:41:41 +02:00
Matthias Mailänder
d4a64386c3 exclude temperat trees in the desert tileset 2014-05-20 08:36:03 +02:00
Matthias Mailänder
4dda29a138 removed duplicates identified by rpmlint 2014-05-20 07:18:47 +02:00
Paul Chote
f1d144bfe8 Merge pull request #5370 from pavlos256/lua-dispose-crash
Possible fix for lua crash #5269
2014-05-20 12:38:40 +12:00
Paul Chote
72095c7fef Merge pull request #5280 from WolfGaming/techleveltraits
TechTreeTrait system has been made
2014-05-20 12:35:26 +12:00
Paul Chote
791d4c9e9e Merge pull request #5342 from ScottNZ/winmake
Use MSBuild to improve make.ps1's clean function
2014-05-20 12:19:44 +12:00
Paul Chote
7cc78c1dcd Merge pull request #5345 from Squiggles211/ammo_reload_timing
Fixes inconsistency in reload times for Cnc Aircraft
2014-05-20 12:04:11 +12:00
Paul Chote
32373e84c8 Merge pull request #5346 from reaperrr/heli-watercrash
Changed Combat WaterExplosion check to trigger below 0 as well
2014-05-20 11:51:15 +12:00
Paul Chote
66398d85f7 Merge pull request #5339 from Mailaender/tesla-instant-kill-hack-removal
Removed TeslaInstantKills
2014-05-20 11:49:07 +12:00
Pavlos Touboulidis
a8b2187d93 Possible fix for lua crash #5269
Check if this instance has been disposed and don't call 'tick'
if it has.

Also remove the finalizer that was broken and wrong anyway.
'runtime' would never become null because it's readonly and
managed resources are freed automatically or may have already
been freed by then.
2014-05-19 23:37:23 +03:00
reaperrr
b85ea7cb3a Changes isWater check to trigger at pos.Z at or below 0, not just at 0. 2014-05-19 18:00:40 +02:00
Psydev
77c355422f updated pirates_and_emperors
Moved start location, added many trees.
2014-05-19 05:13:54 -07:00
Psydev
956b5db8af fixed letters_from_lexington and narrowed map 2014-05-19 05:12:03 -07:00
Matthias Mailänder
67b6d1dbda separate tools and /usr/bin shortcuts 2014-05-19 11:32:18 +02:00
Matthias Mailänder
638b0d8008 Merge pull request #5334 from ForNeVeR/encoding-patch
Closes #5261
2014-05-19 08:17:35 +02:00
Matthias Mailänder
111fcdb86e Merge pull request #5354 from pchote/fading
Add TD fade to/from black behavior to other mods.
2014-05-19 08:11:44 +02:00
Matthias Mailänder
04991cca78 Merge pull request #5362 from pchote/td-ui-polish
Update TD chrome.svg (again)
2014-05-19 07:42:53 +02:00
WolfGaming
c873cac6e7 Added needed yaml files 2014-05-19 04:29:29 +00:00
WolfGaming
75e13592b2 Adding to the Authors file 2014-05-19 03:29:25 +00:00
WolfGaming
00698cefff Added in code for Tech Levels using prereqs
and fixed up some kinks of the old system
2014-05-19 03:29:25 +00:00
Paul Chote
f7c0416b2e Merge pull request #5359 from Mailaender/mersenne-twister
Renamed OpenRA.Support.Random aka XRandom to MersenneTwister
2014-05-19 11:07:21 +12:00
Paul Chote
2995a7dd55 Merge pull request #5341 from Mailaender/travis-deploy
Setup Travis CI to deploy GitHub releases
2014-05-19 10:52:36 +12:00
Paul Chote
cfdbc06a31 Add fade in/out effects to RA and TS.
The palette effect interacts badly with the multiplicative blending in D2K.
2014-05-19 10:32:51 +12:00
Paul Chote
b3313be217 Remove the now-redundant CncWidgetUtils.cs 2014-05-19 10:24:22 +12:00
Paul Chote
05eb56b1e2 Simplify MenuPaletteEffect activation. 2014-05-19 10:24:09 +12:00
Paul Chote
eb840d868c Update chrome.svg to match the generated png. 2014-05-19 10:19:55 +12:00
Matthias Mailänder
187362e80e rename OpenRA.Support.Random aka XRandom to MersenneTwister 2014-05-18 21:53:21 +02:00
Matthias Mailänder
c674fc2f72 Merge pull request #5357 from pchote/td-ui-polish
UI polish fixup
2014-05-18 12:16:42 +02:00
Paul Chote
52e9c58d1a Update colorpicker circle to match spawn points. 2014-05-18 21:40:53 +12:00
Matthias Mailänder
9a609099bf Merge pull request #5343 from Saticmotion/bleed
Fixes #5050
2014-05-18 11:02:15 +02:00
Matthias Mailänder
ff5ec00edc Merge pull request #5348 from reaperrr/ra-shroud-cheatlabel
Closes #5167
2014-05-18 10:52:23 +02:00
Matthias Mailänder
2d56376705 Merge pull request #5356 from pchote/td-ui-polish
TD UI Polish
2014-05-18 10:37:05 +02:00
Paul Chote
417736cdac Merge pull request #5355 from Mailaender/missing-bot-slot-sync
Fixed closing slots not removing bots properly
2014-05-18 20:05:59 +12:00
Paul Chote
2e2a264c22 Use smaller spawn points. 2014-05-18 19:53:06 +12:00
Matthias Mailänder
1147a572da fix closing slots not removing bots properly 2014-05-18 09:49:29 +02:00
Paul Chote
411964c1c2 Go back to the smaller circle for the colorpicker. 2014-05-18 19:14:42 +12:00
Paul Chote
948b10aca1 Fix incorrect font in spawn selector. 2014-05-18 19:09:42 +12:00
Paul Chote
d548b88a57 Adjust the singleplayer menu button positions to remove unnecessary mouse movement. 2014-05-18 19:07:22 +12:00
Matthias Mailänder
09e5cf2d03 whitespace cleanup 2014-05-18 08:16:51 +02:00
Matthias Mailänder
09fb435d45 automatic rule upgrade 2014-05-18 08:12:22 +02:00
Matthias Mailänder
2c38f3ede9 remove TeslaInstantKills 2014-05-18 08:09:56 +02:00
Paul Chote
69e87b0057 Disable maps with broken rules in the lobby. Fixes #4334. 2014-05-18 17:41:36 +12:00
Paul Chote
657ade7221 Add map folder types. Fixes #4635. 2014-05-18 17:29:42 +12:00
Paul Chote
e6d1f30cf0 Use an IReadOnlyDictionary for package definitions. 2014-05-18 17:29:42 +12:00
Paul Chote
d7c445b117 Merge pull request #5352 from Squiggles211/mp_lobby_fix
Fixes lobby crash when joining MP game
2014-05-18 17:29:09 +12:00
Squiggles211
5a60dc6a56 Fixes crash when joining multiplayer lobby
Fixes crash when joining a multiplayer lobby caused by recent spawn
choice changes.
2014-05-17 23:37:54 -05:00
reaperrr
63641bb4d9 Renamed Developer Mode to Cheats for consistency.
Added notion that it disables FoW as well to Disable Shroud cheat option.
2014-05-18 01:32:35 +02:00
Paul Chote
3beabfd205 Merge pull request #5335 from Mailaender/travis-cache
Try to cache the build dependencies for Travis CI
2014-05-18 11:02:06 +12:00
Paul Chote
53be4e36ea Merge pull request #5344 from obrakmann/remove-lua-deprecation-notice
Remove the deprecation notice from the old Lua interface
2014-05-18 11:01:28 +12:00
reaperrr
52816dcc3b Adds WaterExplosion and WaterImpactSound to UnitExplodeSmall.
Fixes #4515.
2014-05-18 00:29:34 +02:00
Saticmotion
1ead9bb7fd Added a description to the pillbox 2014-05-17 22:17:59 +02:00
Squiggles211
0503ed7119 Fixes inconsistency in reload times for Cnc Aircraft
Fixes reload time inconsistency caused by always running the reload
counter even when not needing to reload.  Also adds the ability to
specify that the reload counter restarts when firing a shot.
2014-05-17 13:52:52 -05:00
Oliver Brakmann
b90e6ccae5 Remove the deprecation notice from the old Lua interface
Fixes #5332.  The impending deprecation should probably still be
mentioned in the release notes.
2014-05-17 19:34:57 +02:00
obrakmann
a15564f54d Merge pull request #5337 from Mailaender/explodes-infdeath-null
Fixed Explodes never triggering
2014-05-17 19:25:21 +02:00
Matthias Mailänder
a0ac95ebf7 Merge pull request #5340 from obrakmann/fix5338
Check proc's health before (un)docking. Fixes #5338
2014-05-17 18:05:49 +02:00
ScottNZ
1f34e40b14 Use MSBuild to improve make.ps1's clean function 2014-05-18 03:28:23 +12:00
Matthias Mailänder
96d39d4dee use Travis CI to deploy GitHub releases
closes #3775
2014-05-17 17:24:55 +02:00
Oliver Brakmann
062e7f5298 Check proc's health before (un)docking. Fixes #5338 2014-05-17 17:09:46 +02:00
Matthias Mailänder
0f15274151 don't require InfDeath for Explodes
closes #5336
2014-05-17 16:31:08 +02:00
Matthias Mailänder
83034845ef Update README.md
https://github.com/OpenRA/OpenRA-Resources
2014-05-17 15:25:15 +02:00
Matthias Mailänder
7769a3a0e9 try to cache the build dependencies 2014-05-17 14:29:23 +02:00
Paul Chote
578b071fd4 Merge pull request #5318 from WolfGaming/cloak
Added UncloakOnAttack variable to Cloak
2014-05-18 00:28:50 +12:00
Paul Chote
9a0248bbb9 Merge pull request #5302 from Mailaender/console-commands
Added pause and surrender console commands
2014-05-18 00:28:10 +12:00
Matthias Mailänder
8e79879ee8 merged Pause/Surrender into PlayerCommands 2014-05-17 14:13:44 +02:00
Matthias Mailänder
98c2a7e591 Merge pull request #5331 from obrakmann/mission-fixes
Mission fixes
2014-05-17 14:02:23 +02:00
Paul Chote
31ac2340fe Merge pull request #5234 from pavlos256/startup
Improve startup speed
2014-05-17 23:50:45 +12:00
Pavlos Touboulidis
f651cb3677 Final style & rebase fixes 2014-05-17 14:34:52 +03:00
Pavlos Touboulidis
df6159f12b Do not use the map's rules when rendering the minimap in the map chooser
Using the mod's rules is *a lot* faster because we don't have to load
each map's rules.
2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
ca44be7b2e Only update the loading screen from the main thread
Fixes the crash experienced by pchote. It's a hack but it's easy
to get rid of and it will have to do for now, until the messy
LoadScreen gets fixed.
2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
a845947e0f Minor style & nit fixes 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
d2ba50fe19 Add null perf channel to Editor 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
0eac2afff4 Assign world from the constructor and make the field readonly 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
e0628b5f24 Change IngameChatLogic & MusicPlayerLogic to use the mod's rules, not the map's 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
6f3d9e9c97 Remove unused "Manifest" argument from World constructor 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
b560268495 Change animations to use the proper SequenceProvider
Remove references to the global "Game" and use the SequenceProvider
of the current world/map.
2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
6eabc6adf5 Remove one line of forgotten commented-out code 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
49ec533481 Better distinction between Widgets using the mod's DefaultRules or the map's Rules 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
3eefcc69f8 Use proper map rules in ProductionTooltipLogic.cs 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
d9db1c1854 Revert replacing generic Ui.OpenWindow with static method in MusicPlayerLogic 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
10b8093d5a Rename ModInformation to ModMetadata 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
0e15ce1b88 Replace catch(KeyNotFoundException) with TryGetValue() 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
5bbf442cd0 Remove reference to Game.modData 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
cb30553000 Remove stray newlines 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
894db95d58 Move Ruleset.cs from Map/ to GameRules/ 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
44c01bbaa2 Remove TileSetData and separate TileSet from Sequences 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
750fc4e02c Merge ModRuleset and MapRuleset into Ruleset 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
48d1dde8a7 Change comment about delayed actions 2014-05-17 14:32:03 +03:00
Pavlos Touboulidis
63ec6d60e7 Refactoring to remove static Rules & SequenceProvider 2014-05-17 14:32:03 +03:00
Pavlos Touboulidis
c68427eaa6 Less aggressive rules caching
ActorInfo instances depend on the whole set of ActorInfos
2014-05-17 14:26:54 +03:00
Pavlos Touboulidis
693186e1eb Fix caching by making the tileset part of the key 2014-05-17 14:26:54 +03:00
Pavlos Touboulidis
495ad989d8 Add dummy "perf" log channel to Utility 2014-05-17 14:26:54 +03:00
Pavlos Touboulidis
2b3d5f1544 Better caching for Rules and Sequences
Refactored the Rules and SequenceProvider classes to be parts of ModData and
maintain a cache of the instances used in the mod.

The caching reduced the load times a lot, especially after the first load.
Some lazy loading in sequences also helped lower the startup time..

Note: The static classes were left behind to redirect the existing code's
calls.
2014-05-17 14:26:53 +03:00
Pavlos Touboulidis
77d0199384 Convert ActorReference field to Lazy
Makes LoadMaps 40% faster
2014-05-17 14:26:53 +03:00
Paul Chote
2acba2ce47 Merge pull request #5242 from reaperrr/deathsounds-followup
Made DeathSounds and their InfDeath relation fully customizable
2014-05-17 23:24:44 +12:00
Paul Chote
1619df77a8 Merge pull request #5252 from Mailaender/zenity
Added native Gtk+ crash dialogs on Linux
2014-05-17 22:45:05 +12:00
Matthias Mailänder
fcc49b2cf4 clean up old Changelog files 2014-05-17 12:13:59 +02:00
Matthias Mailänder
c17aa2f467 don't ship OpenRA.CrashDialog.exe on Mac/Linux 2014-05-17 12:13:58 +02:00
Matthias Mailänder
991ddf035a put all remaining WinForms targets together
so it is easier to get rid of them
2014-05-17 12:13:58 +02:00
Matthias Mailänder
65829bb58c GitHub URLs have changed
https://developer.github.com/changes/2014-04-25-user-content-security/
2014-05-17 12:13:58 +02:00
Matthias Mailänder
a9664691e6 always spawn the native error dialog 2014-05-17 12:13:58 +02:00
Matthias Mailänder
0a5d78bbf1 fix missing hard-coded native deps after make install 2014-05-17 12:13:58 +02:00
Matthias Mailänder
8dd0c34a56 document the launch scripts 2014-05-17 12:13:58 +02:00
Matthias Mailänder
73704a2a84 copy launch scripts during Linux make install 2014-05-17 12:13:58 +02:00
Matthias Mailänder
46230e2a81 condense into one graphical crash dialog
make it more robust against missing dependencies
2014-05-17 12:13:58 +02:00
Matthias Mailänder
bae47ff3c9 use native Gtk2 crash dialogs on Linux
closes #3872
closes #3849
2014-05-17 12:13:50 +02:00
ForNeVeR
06671c8aa4 Fix encoding problems with ZipFile.
Without setting the DefaultCodePage it may cause problems on systems without 866 code page installed.
2014-05-17 17:11:29 +07:00
Oliver Brakmann
c0610ad1e7 Various fixes to gdi04a
* Remove support for difficulty levels
* Fix victory conditions for the enemy player
* Adjust difficulty due to the recent balance changes
2014-05-17 11:00:33 +02:00
Oliver Brakmann
b1c0a1fb11 Fix gunboat/turret battle in gdi01 2014-05-17 10:17:47 +02:00
Paul Chote
97ac0c494b Merge pull request #5266 from pavlos256/utility-globbing
Fixes #4615: OpenRA.Utility should expand wildcards in paths
2014-05-17 18:42:09 +12:00
Paul Chote
0458b932a0 Merge pull request #5115 from Mailaender/split-lobby-sync
Splitted LobbyInfo updates into smaller chunks
2014-05-17 18:37:36 +12:00
Paul Chote
2c0c56b6b4 Merge pull request #5327 from Mailaender/idle-orderlines
Removed flickering order lines when selecting idle actors
2014-05-17 18:19:44 +12:00
Paul Chote
12767b7f21 Merge pull request #5328 from Mailaender/superpower-cleanup
IronCurtain/ChronoShift code cleanup
2014-05-17 18:05:43 +12:00
Matthias Mailänder
7b90d321a7 don't show order lines when selecting idle (attackmoving) actors
closes #5039
2014-05-17 08:03:48 +02:00
Paul Chote
28c0310357 Merge pull request #5192 from matija-hustic/spawnchoice
Spawnchoice
2014-05-17 17:53:00 +12:00
Paul Chote
ce7fb707b2 Merge pull request #5297 from Saticmotion/betterScrolling
Better scrolling
2014-05-17 17:43:38 +12:00
Paul Chote
e3e7d35812 Merge pull request #5326 from Mailaender/wall-types
Fixed sandbags connecting to concrete walls
2014-05-17 17:36:48 +12:00
WolfGaming
ff313a3886 Added UncloakOnAttack variable to Cloak 2014-05-17 00:42:45 +00:00
Matthias Mailänder
f265201fa8 Merge pull request #5329 from reaperrr/nuke-ion-fix
Closes #5239
2014-05-16 20:35:41 +02:00
reaperrr
d5023e376d Fixes units hunting Advanced Comm. Center after being damaged by Ion Cannon.
Additionally made weapon, effect animation and effect palette customizable.
2014-05-16 18:38:12 +02:00
Pavlos Touboulidis
5fc7ef02bf Fixes #4615: OpenRA.Utility should expand wildcards in paths
The path to be expanded. It can be a relative or an absolute path.
Wildcards can appear as part of the path and as part of the file name/extension.

Example:

	Expand("./mods/*/mod.?aml");
2014-05-16 19:36:05 +03:00
reaperrr
bbf2364bba Fixes AI units hunting down Missile Silo/Temple of Nod after being damaged by nuke 2014-05-16 17:43:22 +02:00
Matthias Mailänder
db77c7b45d code cleanup 2014-05-16 17:27:49 +02:00
Matthias Mailänder
86c0614558 fix neighbored walls connecting to everyhing
closes #5232
2014-05-16 16:39:04 +02:00
Saticmotion
1bf3f3e03e The engine now uses the SDL2.0 scroll events properly.
Scroll speed is now a user preference.
2014-05-16 13:56:22 +02:00
matija-hustic
6eac7a3e05 Smaller spawns+letters. Map dialog width. Unavailable spawns disabled. 2014-05-16 11:23:23 +01:00
Matthias Mailänder
bad6a99caf Merge pull request #5324 from Squiggles211/apc_load_crash
Fixes #4790
Fixes #5270
2014-05-16 09:00:03 +02:00
Squiggles211
03e2c77b09 Minor style nit fix
Minor style nit fix
2014-05-16 00:22:00 -05:00
Squiggles211
a0458eeb24 Fix crashes related to transports
Fixes two specific causes of transport related crashes, one prevents
infantry from continuing to take damage by Tiberium if loaded into the
transport over Tiberium, and one fixes the edge case where an infantry
dies in the same tick cycle as it was loaded into the transport.
2014-05-15 20:27:44 -05:00
Matthias Mailänder
86271c3dd1 use List<MiniYamlNode> instead of System.Text.StringBuilder
add Deserialize methods for everything in Network.Session
2014-05-15 11:36:24 +02:00
Matthias Mailänder
c7fad3a693 StyleCop and TODO 2014-05-15 10:04:21 +02:00
Matthias Mailänder
f68a6bbd76 split latency from Client into ClientPing
closes #4282
2014-05-15 10:04:21 +02:00
Matthias Mailänder
f365f9da2b split lobby SyncInfo order into smaller chunks
closes #4594
2014-05-15 10:04:03 +02:00
Matthias Mailänder
0f591bb3ba Merge pull request #5316 from reaperrr/int-mine-fix
Add ore mine graphics to interior tileset
2014-05-15 08:07:55 +02:00
reaperrr
e59d4568b0 Adds ore mine graphics to interior tileset 2014-05-14 20:04:59 +02:00
Matthias Mailänder
667f92bc75 add a console command to surrender the game 2014-05-14 15:59:53 +02:00
Matthias Mailänder
83a3835802 add a new /pause command 2014-05-14 15:59:53 +02:00
Matthias Mailänder
e647712003 move all console traits into one folder 2014-05-14 15:59:53 +02:00
reaperrr
98e48ae991 Converts InfDeath from integer to string.
Wire up updated DeathSounds for all mods.
2014-05-14 15:24:06 +02:00
reaperrr
12b3bc37f3 Fixes PlayVoiceLocal so it actually works as intended, bring DeathSounds in line with suggestions. 2014-05-14 15:24:05 +02:00
Paul Chote
b471e02776 Merge pull request #5312 from WolfGaming/CamoFix
Fixes #5049 Camo Pillbox not decloaking when attacking
2014-05-15 00:44:29 +12:00
Paul Chote
14df5a3bc3 Merge pull request #5279 from ScottNZ/news
Add news
2014-05-15 00:20:35 +12:00
Paul Chote
e8896be1c0 Merge pull request #5315 from reaperrr/patch-2
Make Reset button font bold in RA Settings menu
2014-05-14 23:55:02 +12:00
ScottNZ
8fc3870656 Move cnc perf graph out of the way of the news button 2014-05-14 23:51:46 +12:00
ScottNZ
c7d8024522 Add a news panel to each mod 2014-05-14 23:51:41 +12:00
reaperrr
698b326378 Make Reset button font bold in RA settings
Fixes #5314.
2014-05-14 13:48:01 +02:00
Paul Chote
5f5cc10c96 Merge pull request #5307 from pavlos256/lobby-chat-scroll
Fixes #3036
2014-05-14 23:34:56 +12:00
Paul Chote
bca006934a Merge pull request #5313 from WolfGaming/BugFixes
Fixes #5059 force fire not working on pillboxes
2014-05-14 23:23:06 +12:00
WolfGaming
018c2f0c63 Fixes force fire not working on pillboxes 2014-05-14 10:55:46 +00:00
WolfGaming
5496636933 Fixes Camo Pillbox not decloaking when attacking 2014-05-14 10:54:29 +00:00
Paul Chote
a420fa7d28 Merge pull request #5119 from Mailaender/spice-smoke-overlay
Added smoke to the spice refineries
2014-05-14 22:20:27 +12:00
Matthias Mailänder
ba309a3367 add spice refinery smoke overlay when harvester docked 2014-05-14 09:39:45 +02:00
ScottNZ
6218fedbae Merge pull request #5296 from Unit158/win-make-test-fix
Added "make test" to Windows' make script.
2014-05-14 19:08:13 +12:00
Matthias Mailänder
18bbf3c603 Merge pull request #5306 from reaperrr/ra-proc-husk
Fixes #5087
2014-05-14 08:33:51 +02:00
Matthias Mailänder
cce7cdd36c Merge pull request #5309 from pavlos256/sam-site-starting-state
Fixes #5278: SAM site on the TD shellmap starts open
2014-05-14 08:25:58 +02:00
Matthias Mailänder
a69ac2eb68 Merge pull request #5310 from Unit158/console
Patched the console PR as requested by xanax`
2014-05-14 08:20:44 +02:00
Chicken man
d84a6e5897 Patched the console PR as requested by xanax` 2014-05-13 19:29:35 -04:00
Pavlos Touboulidis
558924f265 Fixes #5278: SAM site on the TD shellmap starts open 2014-05-14 00:17:24 +03:00
Pavlos Touboulidis
03a5be4f0d Fixes #3036
See also #5149, #5191
2014-05-13 23:08:00 +03:00
Chicken man
84cb2e921d Added "make test" to Windows' make script. 2014-05-13 15:46:19 -04:00
reaperrr
edceb4e502 Fixes harvester husk Z sorting on refinery. 2014-05-13 20:29:12 +02:00
Matthias Mailänder
6029890ed8 Merge pull request #5303 from reaperrr/win-warnings
Fixes warning message when compiling under Windows (MSBuild/VS)
2014-05-13 16:04:17 +02:00
reaperrr
f7506b8a79 Fix warning message when compiling under Windows (MSBuild/VS). 2014-05-13 14:45:53 +02:00
Paul Chote
b4298982a0 Merge pull request #5262 from Mailaender/parse-invariant-culture
Added checks for NumberFormatInfo.InvariantInfo everywhere
2014-05-14 00:20:35 +12:00
Matthias Mailänder
59ace5d01b new shorthand Exts.(Try)ParseIntegerInvariant 2014-05-13 14:16:41 +02:00
Paul Chote
c1e94489f8 Merge pull request #5233 from Squiggles211/BuildLimitTech
Fix TechTree prerequisite bug for buildings with a build limit.
2014-05-13 20:43:55 +12:00
Matthias Mailänder
12bc472cc6 Merge pull request #5253 from Unit158/console
Closes #4131
2014-05-13 09:09:47 +02:00
Matthias Mailänder
9de070c7fd Merge pull request #5289 from psydev/tiles
Fix rock passability in snow, winter, temperat
2014-05-13 08:30:55 +02:00
Matthias Mailänder
ad08d17f01 Merge pull request #5275 from psydev/maps
4 new maps; some map updates
2014-05-13 08:12:03 +02:00
Psydev
287721dc11 fixed many blemishes on Hegemony or Survival 2014-05-12 21:02:32 -07:00
Matthias Mailänder
18621aefb5 Merge pull request #5260 from JordanGlue/bleed
closes #4779 Deploy hotkey F not repairing orcas/apaches in cnc/td
2014-05-12 22:35:21 +02:00
Chicken man
1389313e46 Added default behaviour to all mods 2014-05-12 16:30:54 -04:00
Chicken man
fa4b157b42 Added ConsoleCommand, and an example to go with it 2014-05-12 16:30:53 -04:00
Matthias Mailänder
0783f60ba1 Merge pull request #5285 from pavlos256/d2k-theater-slow
Fix strange d2k loading slowness
2014-05-12 20:23:24 +02:00
Matthias Mailänder
f8ce8fd90f Merge pull request #5286 from psydev/patch-1
Balance adjust: Return LTNK dmg. vs. wood to 75%
2014-05-12 19:54:10 +02:00
Squiggles211
ce69ea2237 Fix sold tech bug on build limited structures
Fixes where if a structure with a build limit was sold, it was not
properly removed from the buildables prerequisite list until next
update.
2014-05-12 08:42:44 -05:00
psydev
0d9b84af51 Fixed the rocks in desert tileset
They were all set to inherit defaults, few of them were set properly. You could drive through most of them.
2014-05-12 02:05:48 -07:00
Psydev
186e49aaee did same changes to desert tileset 2014-05-11 23:34:03 -07:00
Psydev
687e3bff87 applied same changes to winter.yaml 2014-05-11 23:15:37 -07:00
Psydev
42b56de4b8 did same changes as snow tile, except 1 rock
(the rock is different in the snow tile, which is why it looked funny)
2014-05-11 23:07:54 -07:00
Psydev
e9fabbe955 fix template 14 (snow) 2014-05-11 23:01:20 -07:00
Psydev
da048fffe4 fix template 35 (snow) passability 2014-05-11 22:45:03 -07:00
Psydev
ba85d33e09 fix passability of Template 49 (snow) 2014-05-11 22:38:55 -07:00
Psydev
6264784c1a fix template 84 (rock) 2014-05-11 22:30:13 -07:00
psydev
e3b56db21e Reduce grenadier vs. wood 75% -> 50%
Grenadiers actually do more damage than flamethrowers vs. buildings, which is counter-intuitive and not in keeping with flavour and design intent. They should be good vs. buildings, but not quite this good, especially given that they are cheaper than flamethrowers. This nerf still allows them to be effective at taking out buildings, but not quite as blindingly fast at destroying them.
2014-05-11 16:47:54 -07:00
Psydev
04468725c7 fixed map name of Year_501 2014-05-11 16:32:26 -07:00
psydev
1aef5ea115 Balance adjust: Return LTNK dmg. vs. wood to 75%
It seemed that the tanks were inept at hurting buildings and needed a boost. However, after playtesting, it's clear that Nod's flame tank is already exceptional at destroying buildings, and the recon bikes are quite decent at it, too. Thus, the light tank's effectiveness at killing buildings is overlapping with the flame tank (same tech level & cost), making most Nod units effective at hurting buildings. So, I think this is in order to preserve distinct roles among the vehicles.
2014-05-11 15:59:38 -07:00
Psydev
aadad6256e New map: Pirates_and_Emperors (1vs1) 2014-05-11 15:41:46 -07:00
Psydev
aa97b96a74 New map: Letters_from_Lexington (1vs1) 2014-05-11 15:41:11 -07:00
Psydev
02a4a0613f removed original dead_in_motion map
This map is a bit out of date, especially because of the build radius
which makes the starting positions a bit impractical. All the tiberium is
also in the middle, making this map a "rush for the middle". Since it's so
small, this limits gameplay considerably.
Dead_in_motion_2 addresses these issues and spreads the tiberium out a
bit, while also putting starting locations to one corner of the map. It
also adds blue tiberium.
I will add the old map on Resource.openra.net if anyone still wants to
play it.
2014-05-11 14:30:47 -07:00
Psydev
2ab36b0f08 renamed and updated credits for dead_in_motion_2 2014-05-11 14:29:42 -07:00
Psydev
060644bd6f updated credits for dettering_democracy maps 2014-05-11 14:26:39 -07:00
Psydev
437e50ec47 updated map credits for Nullpeter by Petrenko 2014-05-11 14:20:03 -07:00
Psydev
8446f2ddc6 updated map credits for Llamas 2 2014-05-11 14:18:28 -07:00
Psydev
7c64b0b862 updated map credits for minus_two by petrenko 2014-05-11 14:17:14 -07:00
Pavlos Touboulidis
2ec6df9680 Fix strange d2k loading slowness
There is a strange issue that appears* when Theater calls
ISpriteFrame.Frames on the R8Reader. The R8Reader uses
IEnumerable.Cast<> which behaves slower and slower, which
makes map loading become 10+ times slower.

The changes here simply avoid the casting.

[*] This happens at least on Linux x86_64 with Mono 3.2.8.

See https://bugzilla.xamarin.com/show_bug.cgi?id=19668
2014-05-11 06:38:19 +03:00
Matthias Mailänder
17d3bc27ce Update ingame-player.yaml
followup of 4c4f7ab31f
2014-05-10 14:48:41 +02:00
Paul Chote
80477b65ff Merge pull request #5246 from psydev/patch-1
tweaks to balance: artillery min. range & more
2014-05-11 00:17:26 +12:00
Paul Chote
e55d53626e Merge pull request #5277 from Ripsn/authorfix
Authors file Typo fixed
2014-05-10 19:09:51 +12:00
Ripsn
713586b7f6 Authors file Typo fixed 2014-05-10 18:25:10 +12:00
psydev
68c7976966 Simplified chem warrior description. 2014-05-09 16:09:28 -07:00
Psydev
499df0e088 tiny fix to road for Dead in Motion redux 2014-05-09 16:00:04 -07:00
Psydev
d109453b2d New map: White Acres. 2vs2, FFA. 2014-05-09 15:54:15 -07:00
Psydev
ad4a066eea Updated hegemony_or_survival map.
More tiberium in middle, less in base.
2014-05-09 15:51:54 -07:00
Psydev
e7dd0c7244 New map: Year 501 (3vs3) 2014-05-09 15:50:48 -07:00
Paul Chote
ac99afaaec Merge pull request #5248 from Mailaender/sdl2-opentk
Ported Tao.OpenAL/OpenGL to SDL2/OpenTK
2014-05-09 20:24:40 +12:00
Paul Chote
71f0913da0 Merge pull request #5273 from Mailaender/support-random-bitrot
OpenRA.Thirdparty is now OpenRA.Support
2014-05-09 20:14:58 +12:00
Matthias Mailänder
1124d55224 OpenRA.Thirdparty is now OpenRA.Support 2014-05-09 10:04:16 +02:00
Paul Chote
fab1c9e7b9 Merge pull request #4843 from Mailaender/local-mirrors
Moved mirror selection to the client
2014-05-09 19:51:52 +12:00
Matthias Mailänder
bd55ffc10d StyleCop 2014-05-09 08:44:50 +02:00
Matthias Mailänder
aace818f43 remove unused OpenRA.Server extensions 2014-05-09 08:44:37 +02:00
Matthias Mailänder
f01db755b8 Merge pull request #5256 from Unit158/winforms-patch-2
Fixed removal of winforms for x86
2014-05-08 19:16:36 +02:00
Matthias Mailänder
f8bb956496 check for OpenGL version 2.0+ 2014-05-08 06:38:09 +02:00
Matthias Mailänder
ce78683782 give a hint when someone forgot to install drivers on Windows 2014-05-08 06:38:09 +02:00
Matthias Mailänder
a5422feced only query for the extension we need 2014-05-08 06:38:09 +02:00
Matthias Mailänder
dc2d1287a7 port Tao.OpenGl to OpenTK.Graphics.OpenGL and avoid Arb
closes #4540
2014-05-08 06:38:05 +02:00
Paul Chote
37849b7d31 Merge pull request #5254 from psydev/patch-3
buff HeliGun vs. light armor 50% -> 75%
2014-05-07 18:48:06 +12:00
Paul Chote
a6e79bb732 Merge pull request #5155 from Mailaender/ts-tiberium
Added Tiberium crystals and refinery to Tiberian Sun
2014-05-07 18:30:27 +12:00
psydev
98c7741907 Updated vehicle descriptions. Changed AA desc.
"Weak vs. Aircraft" is kind of ambiguous, so I replaced it. Instead, I specified which units can attack aircraft by giving them a separate line reading "Can attack Aircraft". All entries of "weak vs. aircraft" have been removed.
2014-05-06 19:27:29 -07:00
psydev
2a2ad267c1 Updated structure descriptions
Provided more explanation, eliminated ambiguity.

Where necessary, I wrote "cannot target aircraft" instead of "weak vs. aircraft", since the latter is ambiguous.
2014-05-06 19:14:40 -07:00
psydev
931fa9233e Updated infantry unit descriptions
There were a few misconceptions.
2014-05-06 18:45:27 -07:00
psydev
345e77a284 Increase ScanRadius of Commando & Rocket Soldiers
Making ScanRadius value equal their range (6).
2014-05-06 18:36:03 -07:00
psydev
be5c35aab8 Nerf Chem warrior vs. Wood, 50% -> 35%
Since Chem warriors are awesome vs. everything, I think it would make sense to make them not quite as awesome vs. buildings. There is a bit of a lack of dinstinction between chem and flamers, and right now it doesn't appear to players like it makes much sense to build flamers when you can build chems instead. This will keep "burning buildings down" as the forte of the flame throwers. 
The chems will still be decent vs. wood, but not as crazy as they have been.
2014-05-06 18:23:10 -07:00
psydev
134403fcee Reduce RangeLimit of Rockets, BikeRockets
To give some units a chance to escape, limiting RangeLimit of these rockets. Basically it is because if you get within range with a vehicle, but then quickly turn around to get out of range, the missile will follow you for quite a long ways, well beyond its initial range. There is currently no way to escape the missile. This allows a unit which is very fast to stand a chance of escaping a shot instead of having no chance.
2014-05-06 18:17:38 -07:00
Chicken man
704ae5fa2e Fixed removal of winforms for x86 2014-05-06 17:37:13 -04:00
Matthias Mailänder
f5093522cd fix trailing comma 2014-05-06 18:31:51 +02:00
Matthias Mailänder
b19d286f56 parse with NumberFormatInfo.InvariantInfo everywhere
closes #5240
2014-05-06 18:31:48 +02:00
Matthias Mailänder
4c8ce8afc0 StyleCop 2014-05-06 07:13:43 +02:00
Matthias Mailänder
fdf108a879 port Tao.OpenAl to OpenTK.Audio.OpenAL 2014-05-06 07:13:43 +02:00
Jordan Glue
2379d6167b closes #4779 Deploy hotkey F not repairing helis 2014-05-05 22:28:27 +10:00
Matthias Mailänder
bf9d3a8082 Merge pull request #5259 from JordanGlue/bleed
Fixing Helis taking off after rearmed but before repaired
2014-05-05 13:47:28 +02:00
Jordan Glue
84030fd3c0 Fixing Helis taking off after rearmed but before repaired 2014-05-05 20:51:44 +10:00
Matthias Mailänder
b1045dfce6 Update Command.cs
WRange is actually a 1D world distance with 1024 units = 1 cell.
2014-05-05 12:03:01 +02:00
Matthias Mailänder
7587e80484 Merge pull request #5250 from JordanGlue/bleed
Have Helis take off after repair/rearm
2014-05-05 11:37:20 +02:00
Matthias Mailänder
11f8ba0fe7 Merge pull request #5258 from psydev/patch-4
fixing some trees
2014-05-05 11:35:06 +02:00
Jordan Glue
ea32390700 closes #3091 Have Helis take off after repair/rearm 2014-05-05 19:31:57 +10:00
psydev
a21c181e2d fixing tree cluster
This tree cluster looks like it should be passable through in this cell. Looks fine in testing, even though looked like it might be wrong in map editor.
2014-05-05 01:13:09 -07:00
psydev
dcb3460267 fixing some trees
A couple of trees have a footprint that is too big. It looks like you should be able to drive by them, but you can't. They have been set overly-large.
2014-05-05 01:08:59 -07:00
psydev
3993d64ba2 Slight buff HeliGun vs. light
Apache, for all its greatness, doesn't do very well at one of the things it's supposed to do well, namely take out light vehicles quickly (humvee, artillery, MLRS, etc.). Apache is required for Nod as a reliable way to take out MLRS, but currently it doesn't do enough damage to take it out with its entire payload (which takes 4 seconds to unload, to boot). A single Apache should be able to destroy an MLRS, if it gets the chance.

If anyone thinks the Apache needs nerfing, I would suggest looking in other areas besides its damage vs. light armor. 

Also, does anyone object to removing the AG/AA distinctions for helicopters? They don't seem needed anymore.
2014-05-04 13:28:41 -07:00
Matthias Mailänder
61fbf73e2e Merge pull request #5244 from pchote/bye-bye-winforms
Remove X11 dependency from OSX.
Closes #3872
Closes #4348
2014-05-04 07:02:28 +02:00
Matthias Mailänder
1bd052d43b Merge pull request #5238 from reaperrr/more-palettes02
More palette un-hardcoding
2014-05-04 06:58:39 +02:00
psydev
a58a353915 tweak: artillery min. range slight increase
Artillery was recently buffed, but I think this makes the fact that they can currently fire at close range is not appropriate. I think artillery should be vulnerable to units that are able to get quite close, instead of being able to fire at them and do massive damage.

The reason min. range of 2c896 was picked is that when you set min. range to 3c0, it is not able to fire exactly 3 cells away. Perhaps the behaviour should change so that 3c0 = 3 cells away. 

(For comparison, MLRS has minimum range of 3).
2014-05-03 18:03:32 -07:00
Paul Chote
3965535f3f Remove Windows.Forms dependencies from game and utility. Fixes #4348. 2014-05-04 09:37:25 +12:00
Paul Chote
6b8bd47143 Add a native crash dialog for OSX. 2014-05-04 09:37:25 +12:00
Paul Chote
fe6831a095 Move winforms crash dialog into an external helper. 2014-05-04 09:37:25 +12:00
matija-hustic
ae149c420e Bigger spawn points, numbers within. 2014-05-03 19:08:56 +01:00
reaperrr
7ba00ced5a Make MuzzleFlash palette customizable. 2014-05-03 15:38:34 +02:00
reaperrr
9f0f11db54 Make TeslaZap color palette customizable. 2014-05-03 15:19:36 +02:00
Matthias Mailänder
8b3f15155e remappable resource types 2014-05-03 09:02:19 +02:00
Paul Chote
5b8b01950f Reference mono's libfreetype under osx. 2014-05-03 12:20:14 +12:00
Paul Chote
401e7cf1b2 Remove an outdated hack from Renderer. 2014-05-03 11:40:55 +12:00
Matthias Mailänder
26ae11c155 Merge pull request #5235 from pchote/sdl2
Remove SDL 1.2 and Cg support
2014-05-02 18:30:44 +02:00
Matthias Mailänder
2b3f75d073 Merge pull request #5236 from reaperrr/deathsound
Closes #2392
Closes #4680
2014-05-02 16:38:08 +02:00
Matthias Mailänder
fd4cb59799 add Tiberium to Tiberian Sun 2014-05-02 15:35:10 +02:00
Matthias Mailänder
c6663f7505 add Tiberian Sun refinery 2014-05-02 15:35:09 +02:00
Squiggles211
a495d9d552 Rewrite for better efficiency
uses a single, more concise statement rather than an if statement, and
checks buildLimit before attempting to check if the buildables cache
contains the key.
2014-05-02 08:26:36 -05:00
reaperrr
3fe20a1520 Removes rank signs from ships on desert shellmap.
Closes #4963.
2014-05-02 15:16:12 +02:00
reaperrr
18e37e4216 Drags death sounds out of RenderInfantry into a separate DeathSounds trait.
Play death sounds with a new PlayVoiceLocal so they don't use full volume regardless of position relative to camera.
Adds option for alternative burn and zap death sounds.
Renames RenderInfantry's UseInfantryDeath trait to SpawnsCorpse.

Removes hack from ra desert shellmap.
2014-05-02 15:14:29 +02:00
Paul Chote
03c3c3ae9b Remove legacy renderers. 2014-05-02 23:38:47 +12:00
Paul Chote
189f23e442 Switch linux to packaged SDL2 2.0.2. Fixes #5228. 2014-05-02 23:38:47 +12:00
Paul Chote
39daddfc4c Switch windows to SDL2. Fixes #4945. 2014-05-02 23:38:46 +12:00
Matthias Mailänder
1a432e9e9e Merge pull request #5190 from pchote/new-lua
New Lua API.
2014-05-02 13:29:28 +02:00
Paul Chote
aa8695dd24 Merge pull request #5191 from pavlos256/chat-window-improvements
Chat window improvements
2014-05-02 22:56:39 +12:00
Paul Chote
e0e79fc84c Merge pull request #5212 from psydev/patch-1
Some minor tweaks
2014-05-02 22:37:09 +12:00
Paul Chote
91fc04b2fd Merge pull request #5213 from Mailaender/unl10n-cnc-requires-tooltip
Fixed missing un-l10n of C&C Requires: production tooltip
2014-05-02 22:28:49 +12:00
Paul Chote
7356654d8b Merge pull request #5231 from Mailaender/nsis-dotnet4
Fixed the .NET version check failing
2014-05-02 22:27:21 +12:00
Paul Chote
bbd5d7a1e6 Fix deb dependencies. 2014-05-02 22:18:35 +12:00
Paul Chote
d1c2c6b745 move windows-specific deps to thirdparty/windows. 2014-05-02 22:18:35 +12:00
Paul Chote
c61c9592b1 Include platform-specific dependencies under osx/linux. 2014-05-02 22:18:35 +12:00
Paul Chote
ab06e6998c Replace OSX SDL with i386-only non-framework build.
Compiled using ./configure CFLAGS="-m32 -mmacosx-version-min=10.5" LDFLAGS="-m32 -mmacosx-version-min=10.5" --without-x
2014-05-02 22:18:35 +12:00
Paul Chote
18af74f745 Package Lua 5.1.5 for all platforms. 2014-05-02 22:18:35 +12:00
Paul Chote
af83a1b341 Update lua docs when packaging a new build. 2014-05-02 22:18:35 +12:00
Paul Chote
06f162ad57 Add initial standard library, and port shellmaps. 2014-05-02 22:18:34 +12:00
Paul Chote
d73af0190f Add a new native-lua implementation. 2014-05-02 22:18:34 +12:00
Paul Chote
f6efc9c5bc Add deprecation notice to the original api. 2014-05-02 22:08:42 +12:00
Paul Chote
fdd4437c52 Re-enable shellmaps. 2014-05-02 22:08:41 +12:00
Paul Chote
e83a21808f Produce actors in a FrameEndTask. 2014-05-02 22:08:41 +12:00
Paul Chote
097d6ad47c Merge pull request #5163 from Mailaender/prettify-trait-documentation
Beautified the trait documentation
2014-05-02 21:32:24 +12:00
Chris Forbes
b05297d350 Merge pull request #5227 from Phrohdoh/MultiEnumYaml
Enum yaml fix.
2014-05-02 12:55:38 +12:00
Squiggles211
11c9bd7bc8 Fix TechTree prerequisite bug for buildings with a build limit.
Fixes where a building/unit whose prereq is a build limited structure
was always available to be built even when the prereq was not satisfied.
2014-05-01 18:28:21 -05:00
Matthias Mailänder
0e96dc75ff check for .NET 4 Client or Full profile
fixes #5224
2014-05-01 07:12:54 +02:00
Matthias Mailänder
f28edf9d89 Merge pull request #5226 from pchote/changelog-fix
Fix changelog url in the packaging script.
2014-05-01 06:55:09 +02:00
Paul Chote
afa194dfb2 Fix ubuntu packages dependencies for .NET4. 2014-05-01 09:56:27 +12:00
Matthias Mailänder
066168fdb9 Merge pull request #5223 from obrakmann/fix5210
Repaired gdi03 mission. Fixes #5210.
2014-04-30 21:44:57 +02:00
Taryn
e828541dc9 Allow multiple enum values to be parsed from yaml with the same syntax as a string[]. 2014-04-30 07:15:09 -05:00
Paul Chote
6015bbeaf6 Fix changelog url in the packaging script. 2014-04-30 23:51:28 +12:00
Oliver Brakmann
801b38dd52 Repaired gdi03 mission. Fixes #5210.
I opted to lower the power consumption for SAM instead of restoring the
original power values for FACT and PROC since those two are available to
the player as well and they would behave slightly different in this
mission than in other ones.
2014-04-30 11:40:46 +02:00
Matthias Mailänder
fa150db4a7 Merge pull request #5221 from reaperrr/ts-camerapitch
Fix voxel angle of TS units
2014-04-29 21:03:23 +02:00
reaperrr
e885a7195e Adjusts TS unit CameraPitch to align voxels with perspective. 2014-04-29 19:25:18 +02:00
Matthias Mailänder
cb93e8cb70 Merge pull request #5218 from reaperrr/crateeffect-palette
Made CrateEffect color palette customizable
2014-04-29 11:17:57 +02:00
Matthias Mailänder
e456368ed5 Merge pull request #5219 from ScottNZ/balance
Closes #5179
2014-04-29 11:01:01 +02:00
Matthias Mailänder
be5b50abae Merge pull request #5217 from reaperrr/pip-palette
Un-hardcoded pip/tag/group palettes
2014-04-29 10:59:08 +02:00
ScottNZ
b0610e39fb Make ra 4tnk weapons work more similarly to how they did in the original 2014-04-29 17:32:42 +12:00
ScottNZ
d545759ca1 Nerf ra 4tnk a bit; it was too unstoppable 2014-04-29 17:08:50 +12:00
reaperrr
a422f03c0a Makes CrateEffect color palette customizable.
CrateAction can now define a custom Palette, levelup effect of GainsExperience uses ChevronPalette.
2014-04-28 21:03:59 +02:00
reaperrr
c8815e1413 Un-hardcodes pip/tag/group palettes.
-Palette for decorations can now be defined under SelectionDecorations trait.
-Adds pip types Ammo and AmmoEmpty.
-LimitedAmmo PipTypes are now customizable.
-Adds art, sequences and rules entries for TS mod decorations that were missing/using a wrong palette.
-Adds PrimaryBuilding trait to TS weapon factories and helipads.
2014-04-28 20:03:00 +02:00
Matthias Mailänder
589c7642d1 add a table of contents 2014-04-28 10:28:17 +02:00
Matthias Mailänder
abf5c5a0eb remove brackets from float2.ToString conversion 2014-04-28 09:41:24 +02:00
Matthias Mailänder
e861e7c07e port harvester documentation to the new inline Desc format 2014-04-28 09:41:24 +02:00
Matthias Mailänder
5120cdf6d4 more non-technical type names 2014-04-28 09:41:22 +02:00
Matthias Mailänder
d9bd5f4d7f tabular view, sorted by namespace and given headers 2014-04-28 09:38:11 +02:00
Matthias Mailänder
8ba9f3dea7 fix missing un-l10n of C&C Requires: production tooltip
closes #5209
2014-04-28 08:30:12 +02:00
Matthias Mailänder
0162cac91a Merge pull request #5207 from reaperrr/ts-weapon-pal-fix1
Fixed palette of all TS weapons that don't use the effect palette
2014-04-28 08:01:05 +02:00
Matthias Mailänder
41f6318413 Merge pull request #5206 from reaperrr/ts-mechfix1
Added UseInfantryDeath option to RenderInfantry trait
2014-04-28 07:56:52 +02:00
psydev
a42886c952 Small buff for Humvee/buggy machine gun
Machine gun seems to be under-performing vs. infantry
Give it 5 bursts instead of 4. Will allow it to kill E3s more effectively.

Despite this change, overall damage vs. Light armor is not increased since Release.
2014-04-27 19:36:41 -07:00
psydev
e9ba43faaa Reducing spread of GrenadierExplode
GrenadierExplode is a good idea, but right now its damage is too high.
Reducing spread from 8 -> 6.
2014-04-27 18:20:58 -07:00
psydev
f9675b2d15 Grenade slightly faster again. 100% vs. none.
After playtesting, it seems the grenade is a *bit* too slow. Keeping it slow, but bringing its speed from 5 -> 7. (Original value was 12)

Looks reasonable.

Also giving 100% vs. infantry instead of 90%.
2014-04-27 16:57:09 -07:00
psydev
d6aba2e6af Make MCV crush infantry 2014-04-27 15:54:27 -07:00
reaperrr
e0c6ef1030 Fixes palette of all TS weapons that don't use the effect palette. 2014-04-27 23:32:22 +02:00
reaperrr
49b35dca6e Add UseInfantryDeath option to RenderInfantry trait.
This allows the use of RenderInfantry for units that do not have a Die voice or die sequences.

Additionally fixed Wolverine stand and shoot sequences.
2014-04-27 22:56:23 +02:00
Matthias Mailänder
7517cbb941 Merge pull request #5197 from pavlos256/minor-cleanup
Minor cleanup
2014-04-27 18:33:13 +02:00
Matthias Mailänder
34bdb504c6 Merge pull request #5194 from psydev/patch-8
Certain units can no longer target walls
2014-04-27 18:22:11 +02:00
Matthias Mailänder
c8d9609400 Merge pull request #5198 from reaperrr/tibtree-fix
Closes #3107
2014-04-27 18:16:00 +02:00
Matthias Mailänder
0da6ab6c20 Merge pull request #5185 from reaperrr/rank-palette
Makes rank chevron palette customizable
2014-04-27 18:04:20 +02:00
Matthias Mailänder
8da0d3fac8 Merge pull request #5199 from reaperrr/shok-fix
Closes #5195
2014-04-27 17:46:40 +02:00
reaperrr
8f09a2d6e0 Adds work-in-progress test map to TS mod.
Creeps-owned units and buildings can be used to test rank signs etc.
2014-04-27 13:49:45 +02:00
reaperrr
ce2809c7a0 Adds die-crushed sequence to Shock Trooper. 2014-04-27 13:37:09 +02:00
reaperrr
b62c43a90f TD Blossom Trees now emit tiberium from base.
Dimension set to 1x1, art position fixed via sequence Offsets.
2014-04-27 13:31:54 +02:00
Paul Chote
9cf923343f Merge pull request #5186 from psydev/patch-7
balance tweak - make turret armor heavy
2014-04-27 12:57:01 +12:00
Paul Chote
0822d1ce11 Merge pull request #5181 from psydev/maps
Updated psydev's maps
2014-04-27 12:56:00 +12:00
Paul Chote
cd1fcfabd7 Merge pull request #5188 from obrakmann/buildlimit+shift-click-fix
Fix build palette showing too many queued items when BuildLimit is reached
2014-04-27 12:52:24 +12:00
Pavlos Touboulidis
45944a053c Replace (and remove) custom Set<T> with HashSet<T> 2014-04-27 00:01:33 +03:00
Pavlos Touboulidis
c28faffa45 Remove custom Stopwatch wrapper
Remove the redirection (that doesn't offer any new functionality)
and replace it with the familiar System.Diagnostics.Stopwatch.
2014-04-26 23:58:18 +03:00
Pavlos Touboulidis
275f6683c6 Remove unused and obsolete Cached.cs
This was similar to Lazy<T>
2014-04-26 23:28:23 +03:00
psydev
b0dcdf81a4 Adjust air strike so it kills turret
The recent armor change for turrets made airstrike no longer killed it. 

Made Napalm do more damage to Heavy (and light); made Vulcan do less damage to Heavy so that airstrikes don't do too much damage to advanced towers, obelisks and SAM sites.
2014-04-26 10:03:45 -07:00
psydev
5867bb3985 Certain units can no longer target walls
Units which cannot target walls (sandbags, chain-link fence or concrete) any longer:
Minigunner
Flamethrower
Hum-vee/Nod Buggy 
Flame Tank (can still run over sand bags and chain-link fences)
Civilian
[sniper--already so]
2014-04-26 09:25:47 -07:00
psydev
a624afe739 Make Wall its own TargetType
Going to make some units (machineguns, etc.) unable to fire at walls.
2014-04-26 09:19:09 -07:00
Oliver Brakmann
63f4a0646f Fix build palette showing too many queued items when BuildLimit is reached
When a BuildLimit on an actor type is set and nearly reached, you could
shift-click the build palette and it would show it had five more items
queued when really less are allowed to be built. This fixes it so that
only the allowed number of items is enqueued, and thus showing the
correct number on the build palette.
2014-04-26 16:27:02 +02:00
Pavlos Touboulidis
af48626020 Fix scroll offsets
This is not a full fix, it merely restores the functionality
already present. The ScrollPanelWidget does not work right if
Align is set to Bottom but ScrollToBottom() isn't called after
adding items and there's not enough content to scroll.
2014-04-26 17:21:42 +03:00
Pavlos Touboulidis
c099e6d09b Fix overlay chat lines expiration
It wasn't working right when the widget was hidden because it
wasn't receiving any Ticks. Instead of counting, we're now using
Game.LocalTick as the tick source.
2014-04-26 03:18:46 +03:00
Pavlos Touboulidis
ddabe080cd Style fixes 2014-04-26 03:18:12 +03:00
Paul Chote
e572c0dcb6 Merge pull request #5184 from pavlos256/loading-perf
Loading performance measurements
2014-04-26 11:17:21 +12:00
Pavlos Touboulidis
e6dddf3704 Style fixes 2014-04-26 02:05:06 +03:00
Matija H
a0f6038ea6 Facilitated spawn choice at game setup screen. 2014-04-25 23:27:16 +01:00
Pavlos Touboulidis
e5e97c9a11 Fix issue #5149: Make chat window not autoscroll
It will autoscroll unless the chat window is open and the scroll
position is not at the bottom.
2014-04-25 16:16:54 +03:00
Pavlos Touboulidis
ef066560ad Fix text-wrapping special case
If a line of text contained a whole word that was longer than the
allotted space, it would fail to wrap that line completely, even
if it was possible to wrap at other locations.

Fixing this uncovered a second issue, where it would drop the last
line if the input had more than one lines and one of the first ones
was wider than the specified width.
2014-04-25 13:54:14 +03:00
Pavlos Touboulidis
4f12882706 Minor clean up 2014-04-25 10:50:28 +03:00
Pavlos Touboulidis
fa5c8d083e Fix chat line expiration
The chat display overlay would remove one chat line every X ticks.
It will now keep track of the time each chat line has to be removed
and act accordingly.

For example, if 3 chat lines are added with 1 second difference
from each other, they will be removed one after the other, with the
same 1 second difference.
2014-04-25 10:34:23 +03:00
Sebastien Kerguen
a7c77d4155 Fixes the speed of the blinking READY text (in RA & TD). 2014-04-24 20:22:22 +02:00
reaperrr
6ae4b74535 Makes rank chevron palette customizable.
Adds levelup crate-effect and art.
2014-04-24 19:25:30 +02:00
Pavlos Touboulidis
603dd1d866 Style fixes 2014-04-24 13:46:06 +03:00
psydev
db544a6ca9 balance tweak - make turret armor heavy
Since turrets have wood armor, they can get killed by flame tanks uber fast. It might be best if turrets are a counter to flame tanks, rather than their prey. If they have heavy armor, they will take far less damage, and not die instantly to a flame tank rush, making them able to contribute to some defense.
2014-04-23 18:14:32 -07:00
Psydev
3910e54aa1 fixed tiberium tree in lessons_from_kosovo 2014-04-23 08:55:56 -07:00
Pavlos Touboulidis
c17f706772 Prettier PerfTimer output 2014-04-23 16:52:52 +03:00
Pavlos Touboulidis
36a660385c Fix OpenRA.Lint throwing because "perf" log channel does not exist
Slightly modified the Log class to allow dummy channels that don't
write anywhere, then use it on Lint because map loading writes to
the "perf" channel.
2014-04-23 13:22:14 +03:00
Pavlos Touboulidis
9dc2b3cd76 Optimize ComputeHash by removing Concat() and ToArray() calls 2014-04-23 03:48:49 +03:00
Pavlos Touboulidis
2d8cd8299f Add more perf measurements 2014-04-23 03:43:46 +03:00
Pavlos Touboulidis
c44d73d581 Improve PerfTimer output 2014-04-23 03:42:27 +03:00
Pavlos Touboulidis
60732bd9bd Repurpose unused Timer.cs and add some loading perf metrics 2014-04-23 01:58:30 +03:00
Pavlos Touboulidis
035834978d Make Stopwatch.ElapsedTime() a property and TimeSpan 2014-04-23 00:56:07 +03:00
Matthias Mailänder
082667eeea Merge pull request #5180 from pavlos256/abort-mission-confirmation
Closes #4650
2014-04-22 22:09:48 +02:00
Pavlos Touboulidis
e3a12f0f97 Update license headers 2014-04-22 22:49:51 +03:00
Pavlos Touboulidis
6ed6288e53 Hide ingame menu before showing the confirmation dialog
As a bonus, don't show the confirmation dialog if the game is over.
2014-04-22 22:20:45 +03:00
Pavlos Touboulidis
a4b5e25087 Add confirmation-dialogs.yaml to d2k's and ts's mod.yaml or they crash 2014-04-22 21:50:15 +03:00
Matthias Mailänder
ae481bc748 Merge pull request #5178 from pchote/get-blinkin-ready
Make the ready overlay blink.
2014-04-22 18:27:27 +02:00
Psydev
dbb8f7af71 Adding "pressure" map. 2014-04-22 08:45:42 -07:00
Psydev
84b9e797c7 renamed skull valley. now 4p. bridges fixed. 2014-04-22 08:23:25 -07:00
Psydev
0837279d66 Updated & renamed no_escapism. added trees. 2014-04-22 08:17:53 -07:00
Pavlos Touboulidis
12e3ee9fda Issue #4650: Abort Mission Confirmation
Adapted the confirmation dialog from the CnC mod and wired it to
the "Abort" and "Surrender" buttons.
2014-04-22 17:42:24 +03:00
Psydev
b8b5ff5cc1 Renamed slippery_slopes. Added blue tib markers. 2014-04-22 07:37:14 -07:00
Psydev
07efd377bc Updated Manufacturing Consent map. Fewer start loc 2014-04-22 07:17:40 -07:00
Psydev
0acc3e9bab Updated Lessons From Kosovo map 2014-04-22 07:17:14 -07:00
Psydev
751e799750 Updated map Dead_in_Motion_redux. Now 2p. 2014-04-22 07:16:19 -07:00
Psydev
938215e4ce Updated Deterring Democracy Plus map 2014-04-22 07:15:30 -07:00
Psydev
79e8391189 Updated Deterring Democracy map. Now 2p. 2014-04-22 07:14:30 -07:00
Paul Chote
1a69118f02 Make the ready overlay blink. Fixes #3032. 2014-04-22 23:49:24 +12:00
Paul Chote
bef3439055 Merge pull request #5160 from porzell/bleed
* Fixed Bug #5072: RenderLandingCraft doesn't do an IsInMap check
2014-04-22 22:57:33 +12:00
Paul Chote
18359c56b1 Merge pull request #5177 from ScottNZ/bleed
Remove support for .NET 3.5 from make.ps1 since we need .NET 4 now
2014-04-22 22:54:18 +12:00
ScottNZ
09c8fe43a5 Remove support for .NET 3.5 from make.ps1 since we need .NET 4 now 2014-04-22 22:22:10 +12:00
Paul Chote
a5fb437d07 Merge pull request #5170 from Smilex/issue5169
Added SupportsMapsFrom to mod.yaml for all mods
2014-04-22 11:32:33 +12:00
Paul Chote
3c6993f7fa Merge pull request #5162 from Mailaender/pre-auto-l10n
Prerequisites to automated translation string extraction
2014-04-22 11:29:23 +12:00
Ian T. Jacobsen
1de3b20b90 Added SupportsMapsFrom to mod.yaml for all mods 2014-04-21 20:50:09 +01:00
Matthias Mailänder
5632265d36 Merge pull request #5161 from reaperrr/ts-fixes02
Fixed Cyborg Commando walk/crawl sequences
2014-04-21 15:02:24 +02:00
Matthias Mailänder
ef07cdeaa8 unambigitous naming 2014-04-21 13:49:00 +02:00
Matthias Mailänder
27a73d810f auto reformatting to key: value 2014-04-21 13:49:00 +02:00
Matthias Mailänder
4c4f7ab31f revert back to untranslated for uniform auto-generation 2014-04-21 13:49:00 +02:00
reaperrr
59d3a7faf4 Converted electro.shp to correct palette. 2014-04-21 13:46:31 +02:00
reaperrr
a40159bdf0 Fixed Cyborg Commando walk/crawl sequence. 2014-04-21 13:37:59 +02:00
Paul Chote
e7a16b0c75 Merge pull request #5154 from Mailaender/production-edge-fixes
Added the production bar edge fixes
2014-04-21 23:05:03 +12:00
Paul Chote
b595001364 Merge pull request #5096 from Cr0s/bleed
Fixed #3826
2014-04-21 22:48:11 +12:00
Paul Chote
24374b1394 Merge pull request #5132 from psydev/patch-6
Nerfing guard towers & other balance changes
2014-04-21 22:43:17 +12:00
Paul Chote
ae7b5e9f3c Merge pull request #4613 from Mailaender/bot-cleanup
Reduced the amount of redundant AI definitions
2014-04-21 22:34:29 +12:00
Matthias Mailänder
d9626597b3 removed unmaintained AI definitions optimized for legacy AI code
closes #4543
2014-04-21 11:30:19 +02:00
Matthias Mailänder
1dfdeb8d8b bring it in line with the other naming 2014-04-21 11:26:26 +02:00
Matthias Mailänder
2320a7d571 avoid easy/hard classification as they are identical 2014-04-21 11:24:04 +02:00
Matthias Mailänder
dc74ce9678 backported the edge fixes to XCF source files 2014-04-21 10:50:31 +02:00
Peter Orzell
115df0a828 * Fixed whitespace issue. 2014-04-20 23:12:47 -04:00
Peter Orzell
27ab36d266 * Fixed Bug #5072: RenderLandingCraft doesn't do an IsInMap check
https://github.com/OpenRA/OpenRA/issues/5072
2014-04-20 22:05:33 -04:00
psydev
43c05b4c94 Minor: adjusting tiberium storage in refinery/silo
It seemed from playing noobs that lack of tiberium storage was an issue for them, because I saw them often building silos, often many of them, and they were usually full. Granted, an experienced player should spend that money faster, but I think it's reasonable to give them $2000 worth of storage in their refinery. 

It seems that how pips are displayed has changed from before, so someone set silos to have 10 pips instead of 12 so that it fits the reticle. That's fine. But maybe it would make sense to just change that to an even $2000 capacity also.
2014-04-20 10:16:29 -07:00
psydev
7bd6c01096 Speed up Orca missiles
Orca missiles are quite slow, travelling about the same speed as them. 

Their speed is now up to the same as Bazookas, BikeRockets, and TowerMissiles.
2014-04-20 08:00:04 -07:00
psydev
6929a1ab21 Low power slowdown reduced for ConYard
Since C&C has no power-down button (and since price of power plant went up), low-power is extra painful in TD vs. RA. Also, since the cost is higher for power plants now, it means you will be in low-power mode longer since you cannot build a power plant as fast.

So, the solution is to make the low power slowdown 1/2 speed instead of 1/3 speed for Conyard. 

This does not apply to the support queue, only the building queue.
2014-04-20 07:41:55 -07:00
Matthias Mailänder
7e31637fd1 production bar edge fixes by @MicroGraphics
followup of #5107
2014-04-20 15:44:54 +02:00
Paul Chote
44d57204d0 Merge pull request #4999 from Mailaender/start-game-notification
Moved StartGameNotification into its own trait
2014-04-21 01:32:29 +12:00
Paul Chote
a3ae84bfdc Merge pull request #5134 from Mailaender/production-overlay
Fixed welding animations playing when there are no vehicles produced
2014-04-21 01:27:42 +12:00
Matthias Mailänder
f19fbb1794 StyleCop 2014-04-20 15:26:33 +02:00
Matthias Mailänder
a8a3036bc4 moved StartGameNotification into its own trait 2014-04-20 15:25:43 +02:00
Paul Chote
595e56c08b Merge pull request #5143 from Mailaender/skirmish-bots-forbidden-slots
Fixed bots being added when the map disallows it
2014-04-21 01:13:03 +12:00
Matthias Mailänder
e53fee7d0c added production overlay to Tiberian Sun factories 2014-04-20 15:07:44 +02:00
Matthias Mailänder
eb6d9f6f69 only show welding overlays when factories are producing
closes #3756
2014-04-20 15:07:22 +02:00
Matthias Mailänder
fcca5a7683 StyleCop 2014-04-20 15:05:43 +02:00
Paul Chote
048289e6a9 Merge pull request #5138 from Mailaender/disable-idle-overlay
Fixed the Dune 2000 outpost radar dish rotating when powered down
2014-04-21 00:59:38 +12:00
Matthias Mailänder
ab3dc92554 only add bots when the map allows it
fixes #5110
2014-04-20 14:58:57 +02:00
Paul Chote
17889c3729 Merge pull request #5128 from Mailaender/force-clean
Don't spit errors if directories to be cleaned are missing
2014-04-21 00:50:40 +12:00
Matthias Mailänder
a229e224d1 stop spinning the radar dishes in Tiberian Sun on low power 2014-04-20 14:50:00 +02:00
Matthias Mailänder
01a3162725 allow animations to pause on low power
closes #2949
2014-04-20 14:47:53 +02:00
Paul Chote
8e05cc9171 Merge pull request #5124 from Mailaender/crane-overlay
Added crane build animation to construction yards in Dune 2000 and Tiberian Sun
2014-04-21 00:46:23 +12:00
Paul Chote
adff453927 Merge pull request #5146 from reaperrr/mbd-fix
Removed MustBeDestroyed from CnC Civ/Tech buildings
2014-04-21 00:28:08 +12:00
Paul Chote
e125e4ab26 Merge pull request #5142 from Mailaender/pixeldouble-hotkey
Added a new hotkey to trigger pixel doubling
2014-04-21 00:15:25 +12:00
Paul Chote
f75e0bc929 Merge pull request #5150 from Mailaender/mv-changelog-wiki
Moved CHANGELOG into GitHub wiki
2014-04-20 23:39:59 +12:00
Matthias Mailänder
9d02118e51 don't rotate the radar dish when it is powered down
closes #3755
2014-04-20 13:30:22 +02:00
Matthias Mailänder
4beceb3403 Update README.md
PNG → SVG
2014-04-20 08:08:25 +02:00
psydev
5e9f9c1792 Increase Barracks cost from $300 -> $500
I've been trying to increase the diversity of available early-game build order choices. To do this, I've increased the cost of early-game buildings like Power Plant and Barracks, while increasing the power consumption of the Refinery. This forces players to make choices with more significant consequences. The cost (money=time spent building) of power and barracks are so low right now that the time you spend building them is totally inconsequential to the build order. This leaves very few options, and most people simply pick Barracks, Refinery, Refinery.

Giving some non-trivial time cost to Power and Barracks will allow people to have more possibilities for different openings.
2014-04-19 22:28:02 -07:00
psydev
a60e7472c0 Reduce chem warrior damage vs. wood
The Chem Warrior still does good damage vs. wood, but this will allow more distinction between Flamethrower infantry and Chems. People have been complaining there's no reason not to use chem warriors, which is a claim that has some merit.

Currently, the Chem actually does more damage than Flamethrower vs. wood, which doesn't make a lot of sense. This will make the Flamer do a bit more. Chem damage will be at the level of Bazooka now.

After this change, Flamethrower will have double the economic efficiency in damage per dollar vs. wood. (It already had superior efficiency, but not by much).
2014-04-19 21:09:06 -07:00
psydev
1e9cc41dd7 TowerMissle only fires at ground now. Adjust ROF.
SAM Missile will fire at air targets now.

Adjusting ROF to match SAMMissile's; adjusting damage to keep DPS roughly the same.
2014-04-19 06:11:41 -07:00
psydev
0aad37396d Give ATWR the SAM Missile
This is so that the Advanced Guard Tower can have separate values for range and damage for ground-based and anti-air missiles.
2014-04-19 06:03:42 -07:00
psydev
6fc5c061be Increase spread on Artillery a bit.
It really needs the boost, given that it is slow and inaccurate.
When it finally hits, it will at least do some damage to infantry. 256 is inadequate.
2014-04-19 04:24:07 -07:00
psydev
3176b731a5 Minor: increasing missile rotation speed
So they don't spin around in circles around an unmoving target.
2014-04-19 04:15:30 -07:00
Matthias Mailänder
00ca5516fc add crane animation to Dune 2000 and Tiberian Sun
closes #3754
2014-04-19 13:12:32 +02:00
Matthias Mailänder
b1fe497197 fixed a packaging regression during the GeoIP2 update
followup of #4666
2014-04-19 11:58:33 +02:00
Matthias Mailänder
9839d433aa fixed packaging regressions from upgrade to SDL 2.0.3
followup of #5073
2014-04-19 11:58:33 +02:00
Matthias Mailänder
1c32b7d529 moved CHANGELOG into GitHub wiki 2014-04-19 11:58:10 +02:00
Paul Chote
f532c743fa Merge pull request #5148 from Mailaender/install-markdown
Converted INSTALL to Markdown
2014-04-19 19:56:24 +12:00
Matthias Mailänder
3daa02ece5 converted INSTALL to Markdown
moved licensing information to the README
2014-04-19 09:40:42 +02:00
Paul Chote
48753bdae8 Merge pull request #5133 from ScottNZ/new-menu
Add singleplayer mission menu to ra/td
2014-04-19 19:38:36 +12:00
Paul Chote
f63a6bce64 Merge pull request #5137 from reaperrr/gravitybomb-palette
Made GravityBomb palette customizable
2014-04-19 19:23:53 +12:00
Paul Chote
754efaf3af Merge pull request #5144 from Mailaender/cnc-lowpower-buildtime-tooltip
Fixed C&C build palette tooltip not taking low power slowdown into account
2014-04-19 19:03:32 +12:00
Matthias Mailänder
b6f2c119a7 take low power slowdown into account
fixes #4840
2014-04-19 08:58:47 +02:00
Paul Chote
326d28a084 Merge pull request #5140 from Mailaender/enemy-controlgroups
Added checks to prevent adding enemy units to control groups
2014-04-19 18:52:36 +12:00
Paul Chote
2b65af13c4 Merge pull request #5141 from Mailaender/production-locationinit
Fixed 0,0 shroud reveal when producing units on maps with tiny cordons
2014-04-19 18:46:02 +12:00
Matthias Mailänder
9f386e81a5 disallow adding actors from other players to control groups
closes #4949
2014-04-19 08:39:41 +02:00
ScottNZ
22dd2b0a92 Add singleplayer mission menu to ra/td 2014-04-19 15:54:55 +12:00
reaperrr
1a530ec39b Added a ^BaseBuilding default that Inherits ^Building to CnC mod.
Moved some traits, including MustBeDestroyed, from ^Building to ^BaseBuilding.

Removed some now superflous traits and trait negations from ^CivBuilding.

Changed Inheritances of all buildable structures to ^BaseBuilding.
2014-04-19 02:52:38 +02:00
reaperrr
9115395fb8 GravityBomb palette can now be customized the same way as for Bullets and Missiles.
Update CHANGELOG.

Also mentioned Bullets and Missiles since it seems there wasn't an entry for that before.
2014-04-18 23:53:03 +02:00
Matthias Mailänder
9c483a912e added a new hotkey to trigger pixel doubling
closes #5122
2014-04-18 17:49:55 +02:00
Matthias Mailänder
cce7d6d7e6 fixed missing LocationInit
closes #5076
2014-04-18 17:30:04 +02:00
psydev
edb9a488f8 Minor: HPAD only requires PROC instead of barracks
Not everyone will necessarily want to build a barracks early, so this gives some flexibility.
2014-04-18 07:58:20 -07:00
psydev
b336ae89f7 Infantry run 90% speed on clear terrain again
This was the old default setting.
2014-04-18 07:55:48 -07:00
psydev
88af1bca57 Grenade range/speed/spread adjustment
Grenade range reduced from 5 -> 4
Grenade speed reduced considerably, from 204 -> 85 (this was its old speed, long ago).
Grenade spread increased to compensate.

Grenadiers are now the fastest infantry. Their weapon is quite powerful but they cannot hit moving targets well. You will have to plan your tactics accordingly.
2014-04-18 07:52:47 -07:00
psydev
72a2946299 Buff tank guns, esp. vs. buildings
Tanks are a bit underwhelming in their ability to take down turrets and buildings during an attack. Their ROF has been upped, and their damage vs. wood has been increased.

Their damage % vs. infantry has been lowered to keep it the same DPS. 

Light tank bullet speed reduced a bit to make it possible to miss. It's now the same speed as the turret, and still faster than MTNK/HTNK's bullets.
2014-04-18 07:48:09 -07:00
psydev
6aa1b37563 Minor: adjust building HP for airstrike/ion
Nuke power plants and HPAD made more resilient vs. airstrike.

Communications Centre made more vulnerable to Ion Cannon. (Used to blow it up, but no more due to spread issue).
2014-04-18 07:38:26 -07:00
Matthias Mailänder
c7693b0e10 don't spit errors if directories to be cleaned are missing
closes #5126
2014-04-18 16:38:23 +02:00
psydev
bb149cb3e6 Updating Airstrike - destroys guard tower/turret
Airstrike now destroys basic turrets/GT.
Should not destroy most buildings, though. (Apparently some people were complaining about it being usde for "sniping" buildings too much).
To make damage vs. buildings relatively consistent regardless of how many tiles they occupy, napalm has far less spread now, but much more damage.

Vulcan cannon does more damage vs. heavy armor, but does not damage buildings much. This is because damage it did to buildings varied too much based on building footprint.
2014-04-18 07:35:48 -07:00
psydev
02d7f99005 Increase Ion Cannon spread
Ion Cannon has been a little weak lately. Increasing its spread to make it more effective.

This should maybe be revisited if/when #5120 gets looked at.
2014-04-18 07:30:41 -07:00
psydev
cfeeea4d64 Fix Nuke
Nuke was nerfed into oblivion. Bringing it back.
These values are approximately right. One might ask how much the nuke should be able to destroy adjacent buildings, rather than ones it doesn't hit.
2014-04-18 07:29:37 -07:00
Matthias Mailänder
bf4f58b5c7 StyleCop 2014-04-18 15:38:42 +02:00
psydev
2be06945c0 Buff stealth tank rockets vs. Wood
The Stealth Tank does pretty poor damage vs. buildings, especially for its price/tech level, and compared to recon bikes. Buffing a bit.
2014-04-18 06:24:23 -07:00
psydev
585800c953 Fix Obelisk Laser's ROF
The ROF specified in Laser: is cumulative with the delays specified in structures.yaml.
Removing the delay here because it is redundant and interferes, making the ROF slower than intended.
2014-04-18 06:21:19 -07:00
psydev
26f076ffd3 Minor: Chem warriors walk @ normal speed thru tib
This is to make it so that other units are not faster than them through tib or same speed.
2014-04-18 06:19:36 -07:00
psydev
66ea585f5f Increase Guard Tower cost from $500 -> $600 2014-04-18 06:18:09 -07:00
psydev
5d0ee09f74 Fix Obelisk ROF
Obelisk ROF wasn't working properly. Its delay between shots was far higher than the 90 intended.
I think the programming for AttackCharge doesn't work as whoever put the data in thought. It works now. 
It now has a ROF of 90 ticks, as intended. For its first shot in a series, the delay is only 50 ticks. 

I think the problem might be that FireDelay and ReloadTime were counted cumulatively.
2014-04-18 06:10:55 -07:00
psydev
918ac2d64c Minor: ConYard no longer produces 15 power
This is kind of useless and doesn't make much sense. Cutting it out in order to make intended early build order design possibilities fit better.
2014-04-18 05:59:54 -07:00
psydev
cc0d9d4a2c Increase cost of power plant from $300 -> $500
To give a fair shot to other early build orders, this will make it take a bit longer to build your second refinery by increasing the cost of building a power plant.
2014-04-18 05:58:27 -07:00
psydev
2c94615814 Increase PROC power consumption 30 -> 50
Refinery costs more energy, forcing player to build a 2nd power plant before second refinery (unless they built nothing else but their first refinery).
This makes other build orders possible early game instead of building 2 refineries + barracks being the only sensible one.
2014-04-18 05:47:16 -07:00
psydev
b22569e810 Increasing tower sight range +1
Tower weapon ranges shouldn't be too high, but I like the idea of them providing far vision.
The visual range of Guard Tower, Advanced Guard Tower and Obelisk is now +1 more than their weapon range. (8, 8, and 7 respectively).
2014-04-18 05:44:24 -07:00
psydev
52a91c23fa Minor: chg PROC sale value due to harv price chg
Harvesters now $1000, so this is to reflect that.
2014-04-18 05:41:05 -07:00
psydev
235e188692 Minor: increase SAM site vision
SAM didn't seem to be firing at targets all the time, even when they were visible. Increasing its visual range to match its weapon range.
2014-04-18 05:39:43 -07:00
psydev
163b1e2af2 Reduce DetectCloaked range on towers, HQ
The detect cloaked range is too high, especially for simple guard towers.

The HQ and Advanced Comm. Ctr.'s range of 8 is also absurdly high, and many players don't know about it. The Stealth Tanks ought to be able to sneak through a gap in a base's defenses. Towers should not have unbeatable detection range.
2014-04-18 05:38:38 -07:00
psydev
9510e9caaf Reduce Flamethrower speed to match rifle infantry
Given that Flamethrowers are quite powerful and tough (90 HP), I don't see why it makes sense to also have them be super fast. It seems they should walk at normal speed, especially given how much of a threat to buildings they are.

Reducing their speed will give Grenadiers the distinction of being a fast infantry unit.

If you think this hurts them too much, then their range should be increased, not their speed.
2014-04-18 05:35:11 -07:00
psydev
cbd88d0bd4 Minor: increase E3 scanradius to match vision 2014-04-18 05:32:35 -07:00
psydev
64c631fa2b Minor: remove DetectCloaked for individual units
Now set by default in ^Infantry.

Range is supposed to be 1 as well, not 2.
2014-04-18 05:31:01 -07:00
psydev
658525a169 Minor: increase odds infantry will survive crush
Someone complained that infantry are crushed too easily.
So they will have a 2/3rds chance to escape now.
2014-04-18 05:28:15 -07:00
psydev
41ce58ace2 Minor: ^Infantry detect cloaked by default 2014-04-18 05:27:03 -07:00
psydev
e0c3bc67cd Make infantry more likely to walk through Tiberium
Reduced pathing cost so that units will sometimes walk through tiberium if it's a valuable shortcut. This was done since the damage Tiberium does now has been reduced.
2014-04-18 05:23:05 -07:00
psydev
be2355bcc5 Fix Tiberium & make do slightly more damage
Tiberium wasn't hurting veteran units. I think it was because it only did 1 damage at a time. Set to do 2 damage now.

Increased the net rate of tiberium damage slightly. It still doesn't do that much compared to before though, and it typically won't kill your infantry.
2014-04-18 05:21:09 -07:00
Matthias Mailänder
657141bce0 Merge pull request #5135 from pchote/production-bar
Improve ProductionBar performance.
2014-04-18 14:13:14 +02:00
psydev
693668e977 Minor: reduce recoil for Mammoth Missiles 2014-04-18 05:08:37 -07:00
psydev
69b848d2e2 Make refineries unload harvesters faster
The values for loading and unloading time for harvesters are swapped.
This will keep the total amount of time for the harvest/unload cycle, but they will spend less time at the refinery. This will allow a refinery to support 3 harvesters operating from a nearby field, instead of the current 2. 

One effect of this is that it will make buying a factory early game a bit more economical  (though still a bit less so than buying only refineries with no factory), since more harvesters can be used per refinery, increasing demand for harvester production.
2014-04-18 05:07:21 -07:00
psydev
c26c4a45d7 Buffing Light/Med. tank HP
Tanks seem to die quickly in this game.
Giving them a buff in HP to increase their usefulness in the role of "tank".
2014-04-18 05:03:46 -07:00
psydev
6c7da795a7 Minor: adjusting sight ranges
Artillery, MLRS and Mobile SAM all have visual range capped at 8. This makes scouts more useful to fire beyond visual range.
Buggy given visual range of 8 to match Humvee and Bike.
2014-04-18 05:02:32 -07:00
Paul Chote
59da851d71 Improve ProductionBar performance.
Also adds an explicit second bar for construction yards.
2014-04-19 00:01:59 +12:00
psydev
271a5b78b8 Minor: Adjusting ROT speeds
Capping light vehicle rotation speeds at 10.
Light Tank turret rotation will match vehicle rotation.
Stealth Tank rotation increased to keep it maneuverable vs. tough enemies like Mammoth.
2014-04-18 04:59:29 -07:00
psydev
ec29cc61b0 Mammoth Tank HP reduced from 900 -> 800.
Mammoth was a bit OP and kind of impossible to kill. This keeps it tough but makes it possible to defeat.
2014-04-18 04:55:07 -07:00
psydev
3e3e0471de Flame Tank armor now Heavy. Cost reduced to $600.
HP reduced to 300 to compensate for new Heavy armor.
Flame tank does good damage but often dies before it can be cost-effective.
Since it is supposed to hunt infantry and light vehicles, this will help it do its job better. It will also be more resistant to flame infantry, which seems fitting. ;)
2014-04-18 04:53:58 -07:00
psydev
6153ad1d9f Reduce Harvester cost from $1200 to $1000
This is to make opening with a factory instead of more refineries a bit more feasible. 

Given that there is a maximum limit of how many harvesters can operate from a refinery in TD, lowering the price shouldn't be a problem, since there can't be harvester spam. How many refineries you have will limit how many harvesters you can effectively use. 
By comparison, RA harvester is $1100.
2014-04-18 04:49:56 -07:00
psydev
cc841f3ceb A10 is no longer a targetable unit.
Units on the ground were pursuing A10s until they left the map. Seems inappropriate.
2014-04-18 04:46:59 -07:00
psydev
a1e1f296cf Reduce Orca reload speed, from 24s -> 12s
Orca's reloading is so slow it can barely do anything. It's painful. 

This will make it non-useless in smaller groups. 
I am not concerned that this will make Orca OP, since air defense power has generally been buffed in the last year considerably.
2014-04-18 04:45:07 -07:00
psydev
ca8dd073b6 Increase Chinook sight range 8 -> 10 2014-04-18 04:42:21 -07:00
psydev
6c342cd04e Buff Orca dmg. vs. Heavy. Nerf vs. Air
Orca damage vs. heavy currently is pretty abysmal. Needs buff to define unit as anti-vehicle (instead of being equal to Apache vs. vehicles/armor).

Orca nerfed a bit vs. air to put it on even footing with Apache in air-to-air combat.

ROF slightly increased.
2014-04-18 04:41:02 -07:00
psydev
1558c23c18 Nerf mammoth missiles
Mammoth missiles are a bit crazy, especially vs. buildings. Nerfing them a bit.
To compensate, increasing their spread a bit.

To increase missile efficiency (avoid extra missiles being wasted on overkill), their damage has been reduced from 75 to 45. They can still kill orcas in 2 shots.
To further avoid wasteful firing of missiles, the burst delay was increased, and the speed of the missiles was increased.
2014-04-18 04:30:58 -07:00
psydev
3d69931912 MLRS buff vs. buildings, infantry
Artillery is weak vs. buildings in CNC, so this needs a slight buff (ARTY also buffed). 
MLRS needs a slight boost vs. infantry, since GDI relies on it to. 
Spread increased from 15 to 16.
2014-04-18 04:18:09 -07:00
psydev
7a890aeda6 Nerf APC gun.
Reducing damage vs. light vehicles & buildings, since APCs are kind of hard to kill early game.
Increasing damage vs. heavy slightly so they are non-useless.
2014-04-18 04:13:46 -07:00
psydev
bdeaf3a194 Flamethrower buff vs. vehicles
Flamethrower should be good vs. light  vehicles. Buffing them vs. light, and changing damage to kill most vehicles with 3 hits instead of 4. 
They are also getting an increase vs. infantry from 90% to 100%.
Their speed will be getting reduced to normal infantry, so I dont think we have to worry about them being OP. 
Slight nerf to damage vs. heavy to better define the unit as not a mid-game anti-armor unit.
2014-04-18 03:42:10 -07:00
psydev
00404c1a3a Mobile SAM: Damage buffed. Range reduced -1.
Given that SAM sites have range of 8, that it would be appropriate if mobile SAMs also had a range reduction. Choosing 9 for now, since battlefield conditions are a bit different than for static defenses, and because turrets sometimes behave funny with respect to range and firing.
2014-04-18 03:36:47 -07:00
psydev
ef072c6041 Nod Artillery buffed. Esp. vs. Heavy armor
If you want to consider increasing the price as a result of this, that might be OK.
But as far as the unit's tactical effectiveness is concerned, I think these changes are necessary, vs. buildings and heavy armor in particular.

In order to keep Arty from being OP, its gun remains inaccurate. It's also slow and vulnerable to exploding.
2014-04-18 03:33:36 -07:00
psydev
bb6e97700f BikeRockets buff vs. wood. Nerf vs. infantry. 2014-04-18 03:28:02 -07:00
psydev
f2fdbe4e77 Flame Tank damage vs. light increased 2014-04-18 03:23:06 -07:00
psydev
12827b27bf Improve Hum-vee/Buggy machine gun vs. infantry
Hum-vee/buggy machinegun buffed to make them more useful vs. infantry. Currently they are rather weak. 
Damage vs. other types of armor reduced to compensate.
2014-04-18 03:13:02 -07:00
psydev
0c117775b3 Nerfing guard towers
Range of obelisk, Adv. Guard Tower and SAM site reduced.
Damage of Guard Tower reduced vs. infantry and light vehicles; spread increased to compensate a bit.
Damage of Advanced Guard Tower nerfed, especially against light vehicles. Damage vs. infantry increased (though it's still low DPS). Spread also increased to compensate for its lack of power vs. infantry.
Turret damage mostly unchanged, but does less damage per shot. Damage vs. light vehicles increased to match damage vs. heavy armor. Damage vs. infantry slightly reduced.
2014-04-18 03:03:39 -07:00
Paul Chote
abe06b24b4 Merge pull request #5129 from Mailaender/csproj-reference-xml-error
Fixed Reference is expected Line 89 position 6
2014-04-18 20:25:23 +12:00
Matthias Mailänder
a7b401e981 Mods.RA also requires MaxMind.GeoIP2 2014-04-18 09:44:00 +02:00
Matthias Mailänder
5d6b26b971 fixed Reference is expected Line 89 position 6 2014-04-18 09:36:22 +02:00
Matthias Mailänder
c825cb6aca Merge pull request #5066 from pchote/weapon-cameras
Superweapon tweaks
2014-04-18 09:00:49 +02:00
Paul Chote
4f070cd0fc Update changelog. 2014-04-18 18:55:35 +12:00
Paul Chote
7c166449c3 Fix GDI03 airstrike power. 2014-04-18 18:55:34 +12:00
Paul Chote
86f5a39d86 Persist the nuke beacon until detonation. 2014-04-18 18:55:34 +12:00
Paul Chote
3ad35cb803 Support indefinite beacon duration for support powers that remove the beacon on completion. 2014-04-18 18:55:34 +12:00
Paul Chote
b74a0734c8 Change D2K airstrike shroud reveal to match TD. 2014-04-18 18:55:34 +12:00
Paul Chote
56586cb4b5 Add a camera to the nuke. 2014-04-18 18:55:34 +12:00
Paul Chote
51363fd724 Make nuke flight time independent from map size. 2014-04-18 18:55:34 +12:00
Paul Chote
84a346d4b6 Merge pull request #4666 from Mailaender/geoip2
Updated to GeoIP2
2014-04-18 18:52:28 +12:00
Matthias Mailänder
9099e987d3 update to GeoIP2 and parse the database only once
closes #4227
2014-04-18 07:48:13 +02:00
Paul Chote
14eab38f0b Add a camera to the Ion Cannon. Fixes #5058. 2014-04-18 14:17:15 +12:00
Paul Chote
c5ccb0ef4a Merge pull request #5125 from reaperrr/explosion-palette
Added ExplosionPalette and WaterExplosionPalette traits to Warheads
2014-04-18 14:04:32 +12:00
Paul Chote
45507d4b3b Merge pull request #5123 from Mailaender/clean-openra-game-dll
Additions to Makefile for cleaning up OpenRA.Game/*.dll left-overs
2014-04-18 13:38:22 +12:00
reaperrr
c9b162ec3c Added ExplosionPalette and WaterExplosionPalette traits to Warheads.
This is needed for TS water splashes, for example (they use unit*.pal instead of anim.pal).
Defaults to "effect".
2014-04-18 01:23:09 +02:00
Matthias Mailänder
6a31e2cc14 clean up OpenRA.Game/*.dll left-overs 2014-04-17 17:12:10 +02:00
Matthias Mailänder
18381f178b Merge pull request #5114 from reaperrr/ts-fixes01
Lots of TS mod fixes & additions
2014-04-17 06:58:49 +02:00
reaperrr
9fa3a1cc1f Fix uppercase prerequisites. 2014-04-16 21:50:34 +02:00
Matthias Mailänder
dcfd0c0b5d Merge pull request #5112 from pchote/fileformats
Merge FileFormats dll into Game and reorganise namespaces.
2014-04-16 20:52:04 +02:00
reaperrr
04220f50a1 Tweaked build palette positions of some GDI units. 2014-04-16 19:02:58 +02:00
reaperrr
1f26fa0389 Made InfDeath less arbitrary.
Rule of thumb:
Small calibers = InfDeath 1
Anti-tank weapons = InfDeath 2
Explosive weapons = InfDeath 3
2014-04-16 19:02:14 +02:00
reaperrr
c204fd0b26 Tons of sequence fixes for infantry.
Added a fixed version of infdie.shp, converted to unit*.pal.
Added an infexpl.shp for Cyborg Commando death 3, converted to unit*.pal.
2014-04-16 19:00:27 +02:00
reaperrr
e5a4eadb37 Added Radars, Tech Centers and Walls to both sides.
Added idle animations to weapon factories.
Added some general prerequisites (FACTORY, RADAR, TECH).
2014-04-16 18:56:58 +02:00
reaperrr
0f79022ed0 Changed Cyborg armor type to Light, to make it less OP against other infantry. 2014-04-16 18:38:19 +02:00
reaperrr
f7e627f653 Added build/deploy, damage and destruction sounds to buildings and MCV.
Moved ^Wall default right below ^Building inside defaults.yaml.
2014-04-16 18:37:05 +02:00
reaperrr
ff0efd89ac Added some notifications, fixed Cyborg/Cyborg Commando death sounds. 2014-04-16 18:33:32 +02:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
MicroGraphics
5a698d612f Fixed dialog.png for RedAlert 2014-04-15 08:00:39 +02:00
Matthias Mailänder
5e1e45631a Merge pull request #5102 from pchote/volume-slider-fix
Fix volume slider order in the settings panel.
2014-04-14 08:07:12 +02:00
Paul Chote
1178910aa1 Fix volume slider order in the settings panel. Fixes #5088. 2014-04-14 17:00:02 +12:00
Paul Chote
0651f02827 Merge pull request #5089 from Mailaender/clean-msbuild
Enhanced Makefile to clean up after IDE mess
2014-04-14 12:15:59 +12:00
Paul Chote
415a5bbddd Merge pull request #5093 from Mailaender/beacon-buttons
Added the Beacon button artwork for Red Alert, Dune 2000 and Tiberian Sun
2014-04-14 12:06:15 +12:00
Cr0s
f5f9436c8b Update structures.yaml
Removed CanPowerDown trait
2014-04-13 11:11:21 -07:00
Matthias Mailänder
2f14dca378 Merge pull request #5073 from pchote/sdl-spaces-yaaaaaaay
Upgrade to SDL 2.0.3
2014-04-13 08:05:43 +02:00
Paul Chote
ad9d4c0c85 Add changelog entry. 2014-04-13 12:05:38 +12:00
Paul Chote
a92cf920c6 Fix a visual glitch in OSX. 2014-04-13 12:05:38 +12:00
Paul Chote
f62721bdd6 Upgrade to SDL 2.0.3 and latest SDL2-CS (e8731ef). 2014-04-13 12:05:37 +12:00
Cr0s
b7241924f9 Fixed #3826 2014-04-12 20:38:12 +04:00
Matthias Mailänder
27d78574f8 Merge pull request #5091 from reaperrr/ra-vehicle-explosions
Add RA vehicle explosions
Fixes #5077
2014-04-12 15:05:58 +02:00
reaperrr
fd0d97e55d Fix typos in vehicles.yaml 2014-04-12 12:50:43 +02:00
reaperrr
5576e72b65 Fix stupid typo, use UnitExplodeSubmarine for MSUB. 2014-04-12 12:10:43 +02:00
Matthias Mailänder
5b016997e9 add the beacon button artwork to RA, D2k and TS
thanks to @xanax
2014-04-12 09:20:49 +02:00
Matthias Mailänder
7366c0b7b0 don't play crumble sound when placing concrete 2014-04-12 09:14:02 +02:00
Matthias Mailänder
6f22ba4811 fixed Dune 2000 powerdown cursor palette 2014-04-12 09:13:43 +02:00
reaperrr
87fa857a60 Adds Explosions to all vehicles that didn't have one. 2014-04-12 01:52:46 +02:00
reaperrr
ae700bf6bf Adds visible explosions to ships and submarines 2014-04-12 01:49:33 +02:00
reaperrr
4245766b8d Adds Explode weapons for ships and submarines 2014-04-12 01:48:43 +02:00
reaperrr
98fe3e6d65 Minor explosion weapon sound fixes 2014-04-12 01:47:51 +02:00
Matthias Mailänder
cf09ecc4de Update INSTALL
we now require a .NET 4.0 compatible compiler
2014-04-11 20:05:00 +02:00
Matthias Mailänder
40b805046f Update INSTALL
* .NET 4.0 #5082
* SDL 2 #3315
* avoid trademarks
2014-04-11 20:03:15 +02:00
Matthias Mailänder
50f194b96f clean up after MonoDevelop/Visual Studio 2014-04-11 19:45:13 +02:00
Matthias Mailänder
900ec08cdf Merge pull request #5086 from ScottNZ/balance
More RA balance tweaks
2014-04-11 19:43:36 +02:00
Matthias Mailänder
771638c8e8 decide which mirror to choose locally and display result
closes #3904
2014-04-11 10:30:12 +02:00
ScottNZ
2e3293dba8 Increase ra husk hp from 140 to 280 and increase burn damage 2014-04-11 19:35:04 +12:00
Matthias Mailänder
9c499cc9e5 Merge pull request #5082 from pchote/dotnetfour
Upgrade to .NET 4.0
2014-04-11 09:17:50 +02:00
ScottNZ
d66c005253 Reduce hijacker hp from 80 to 50 2014-04-11 18:14:48 +12:00
Paul Chote
81d7c3a038 Merge pull request #5069 from cjshmyr/shok
Revert removing TakeCover from Shock Trooper and make them Crushable
2014-04-09 20:34:23 +12:00
Paul Chote
257147df27 Merge pull request #5070 from ScottNZ/mrj
Make mrj not jam allied missiles
2014-04-09 20:33:40 +12:00
Paul Chote
9706b1cfc3 Merge pull request #5071 from ScottNZ/winmake
Added a counterpart to the Makefile for Windows users
2014-04-09 20:33:09 +12:00
Paul Chote
e9a14291a3 Merge pull request #5048 from Unit158/shrapnel
Shrapnel
2014-04-09 20:29:07 +12:00
Paul Chote
1b2a90c00c Migrate to System.Lazy. 2014-04-09 20:20:41 +12:00
Matthias Mailänder
67cd0645a4 update to .NET 4.0 2014-04-09 20:20:26 +12:00
Chicken man
bcde32f7c4 Edited CHANGLOG 2014-04-08 20:21:05 -04:00
Chicken man
e6c0a00604 Closes #4463. Added Shrapnel, as well as variable velocity and arc for bullets 2014-04-07 17:09:52 -04:00
ScottNZ
e47bd5d85f Added a counterpart to the Makefile for Windows users 2014-04-07 23:12:54 +12:00
ScottNZ
c9d81934a5 Make mrj not jam allied missiles 2014-04-07 11:24:11 +12:00
Curtis Shmyr
8a660b5ed6 Revert removing TakeCover from Shock Trooper and make them Crushable 2014-04-06 11:52:06 -06:00
Paul Chote
4d08093d1d Merge pull request #5044 from Mailaender/better-rule-naming
Renamed old system.yaml descendened files
2014-04-06 20:23:24 +12:00
Paul Chote
a010a0b914 Merge pull request #5065 from Mailaender/hey-bale-unboom
Made hay bales non C4 targetable
2014-04-06 20:21:55 +12:00
Matthias Mailänder
8de154573b renamed old system.yaml descendened files 2014-04-06 08:15:13 +02:00
Matthias Mailänder
bad4ee0d38 non-explosive hay-bales 2014-04-06 07:58:38 +02:00
Matthias Mailänder
4195e683a6 Merge pull request #5063 from pchote/commando-fix
Restrict commando weapon to infantry
2014-04-06 07:51:55 +02:00
Matthias Mailänder
6afc05e5f6 Merge pull request #5056 from pchote/makefile-fix
Set the modchooser version during packaging.
2014-04-06 07:38:23 +02:00
Paul Chote
21f44c22fb Merge pull request #5045 from Mailaender/d2k-map-players
Reduced player numbers in Dune 2000 maps with too few space to build
2014-04-06 16:38:06 +12:00
Paul Chote
098e802a24 Merge pull request #5046 from Mailaender/ra-maps-metadata-overflow
Shortened map titles and author credits to combat overflow
2014-04-06 16:31:12 +12:00
Paul Chote
9b27cac69b Remove redundant versus from ion cannon weapon. 2014-04-06 16:07:55 +12:00
Paul Chote
ce785da592 Limit the commando's sniper rifle to infantry only. 2014-04-06 16:07:55 +12:00
Paul Chote
4280835439 Add additional TargetTypes to C&C. 2014-04-06 16:07:47 +12:00
Paul Chote
b94b48c843 Set the modchooser version during packaging. Fixes #5055. 2014-04-06 11:39:07 +12:00
Matthias Mailänder
7562540a2e shorter Map.Name and Map.Author fields 2014-04-05 19:56:30 +02:00
Matthias Mailänder
2484e0b779 Merge pull request #5042 from cjshmyr/seasidefix
Fix missing ore well on bottom right spawn of Seaside 2
2014-04-05 19:48:35 +02:00
Matthias Mailänder
8fc6fe10f2 Death Depths: 6 players to 2 2014-04-05 19:41:33 +02:00
Matthias Mailänder
1eabbdf8b9 Merge pull request #5043 from cjshmyr/gemmines
Fix Gem Mine footprint
2014-04-05 19:32:52 +02:00
Matthias Mailänder
c5be6b9877 Venac Ditch: 4 players to 2 players 2014-04-05 19:28:59 +02:00
Curtis Shmyr
a15e4f675b Fix Gem Mine footprint 2014-04-05 11:05:07 -06:00
Curtis Shmyr
1eea9d5efc Fix missing ore well on bottom right spawn of seaside 2 2014-04-05 10:39:55 -06:00
1796 changed files with 63335 additions and 39775 deletions

7
.gitignore vendored
View File

@@ -52,7 +52,12 @@ OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
# auto-generated documentation
DOCUMENTATION.md
Lua-API.md
*.html
# StyleCop
*.Cache
*.Cache
# SublimeText
*.sublime-project
*.sublime-workspace

View File

@@ -6,19 +6,27 @@ language: c
# Make sure build dependencies are installed.
install:
- sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6 dpkg rpm nsis markdown
- sudo apt-get update -qq
- sudo apt-get install -qq mono-gmcs cli-common-dev libgl1-mesa-glx libopenal1 libfreetype6
cache: apt
# Run the build script
# call RALint to check for YAML errors
# Test run the packaging scripts for all platforms
script:
- make dependencies
- make all
- make test
- cd packaging && mkdir temp &&./package-all.sh travis-build temp
# Only watch the development branch.
# Automatically update the trait documentation and Lua API
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && make docs && cd packaging && ./update-wiki.sh
# Only watch the development branch and tagged release.
branches:
only:
- /^release-.*$/
- /^playtest-.*$/
- /^pkgtest-.*$/
- bleed
# Notify developers when build passed/failed.
@@ -30,3 +38,30 @@ notifications:
- "irc.freenode.net#openra"
use_notice: true
skip_join: true
before_deploy:
- sudo apt-get install nsis markdown dpkg rpm libarchive-dev m4 fakeroot bsdtar
- wget ftp://ftp.archlinux.org/other/pacman/pacman-4.0.3.tar.gz -O /tmp/pacman-4.0.3.tar.gz
- pushd /tmp
- tar -xzvf pacman-4.0.3.tar.gz
- cd pacman-4.0.3 && ./configure --disable-doc --prefix=/usr && make && sudo make install
- popd
- DOTVERSION=`echo ${TRAVIS_TAG} | sed "s/-/\\./g"`
- cd packaging
- mkdir build
- ./package-all.sh ${TRAVIS_TAG} ${PWD}/build/
deploy:
provider: releases
api_key:
secure: "cMC68erxuf0jb4Pe0sOH4m1f7I2LWPUatD9BC0WeZ9PwTnWOzrm0hnjZIES4TTKVo8WIfZIiCfxpdAFeoh6bomG2MsKwSKMc8qHGhfNGqPnyzYh6zdPZaA+4Q3TDQI3DrziyDnQUFeH1h/7UZLDLxtDrOtcYcGdNg5VjvV9fJ7g="
file:
- build/OpenRA-${TRAVIS_TAG}.exe
- build/OpenRA-${TRAVIS_TAG}.zip
- build/openra_${DOTVERSION}_all.deb
- build/openra-${DOTVERSION}-1-any.pkg.tar.gz
- build/openra-${DOTVERSION}-1.noarch.rpm
skip_cleanup: true
on:
all_branches: true
tags: true
repo: OpenRA/OpenRA

33
AUTHORS
View File

@@ -5,6 +5,7 @@ The OpenRA developers are:
* Chris Forbes (chrisf)
* Curtis Shmyr (hamb)
* Matthias Mailänder (Mailaender)
* Oliver Brakmann (obrakmann)
* Paul Chote (pchote)
* ScottNZ
@@ -17,7 +18,10 @@ Previous developers included:
* Robert Pepperell (ytinasni)
Also thanks to:
* Adam Valy (Tschokky)
* Akseli Virtanen (RAGEQUIT)
* Alexander Fast (mizipzor)
* Allen262
* Andrew Aldridge (i80and)
* Andrew Perkins
* Andrew Riedi
@@ -31,13 +35,21 @@ Also thanks to:
* D2k Sardaukar
* Daniel Derejvanik (Harisson)
* Danny Keary (Dan9550)
* DeadlySurprise
* Erasmus Schroder (rasco)
* Fahrradkette
* Frank Razenberg (zzattack)
* Gareth Needham (Ripley`)
* Gordon Martin (Happy0)
* Guido Lipke (LipkeGu)
* Huw Pascoe
* Ian T. Jacobsen (Smilex)
* Igor Popov (ihptru)
* Imago
* Iran
* Jacob Dufault (jacobdufault)
* James Dunne (jsd)
* Jason (atlimit8)
* Jeff Harris (jeff_1amstudios)
* Jes
* Joakim Lindberg (booom3)
@@ -49,31 +61,39 @@ Also thanks to:
* Lesueur Benjamin (Valkirie)
* Maarten Meuris (Nyerguds)
* Mark Olson (markolson)
* Matija Hustic (matija-hustic)
* Matthew Gatland (mgatland)
* Matthew Uzzell (MUzzell)
* Max621
* Max Ugrumov (katzsmile)
* Mustafa Alperen Seki (MustaphaTR)
* Neil Shivkar (havok13888)
* Nukem
* Okunev Yu Dmitry (xaionaro)
* Olaf van der Spek
* Paolo Chiodi (paolochiodi)
* Paul Dovydaitis (pdovy)
* Pavlos Touboulidis (pav)
* Pizzaoverhead
* Psydev
* Raymond Bedrossian (Squiggles211)
* Raymond Martineau (mart0258)
* Reaperrr
* Riderr3
* Rikhardur Bjarni Einarsson (WolfGaming)
* Sascha Biedermann (bidifx)
* Sebastien Kerguen (xanax)
* Shawn Collins (UberWaffe)
* Simon Verbeke (Saticmotion)
* Taryn Hill (Phrohdoh)
* Teemu Nieminen (Temeez)
* Tim Mylemans (gecko)
* Tirili
* Tom Roostan (RoosterDragon)
* Tristan Keating (Kilkakon)
* Tristan Mühlbacher (MicroBit)
* Vladimir Komarov (VrKomarov)
* Wuschel
* Ian T. Jacobsen (Smilex)
Using Simple DirectMedia Layer distributed under
the terms of the zlib license.
@@ -83,7 +103,10 @@ FreeType License.
Using OpenAL Soft distributed under the GNU LGPL.
Using GeoLite data created by MaxMind and
Using MaxMind GeoIP2 .NET API distributed under
the Apache 2.0 license.
Using GeoLite2 data created by MaxMind and
distributed under the CC BY-SA 3.0 license.
Using KopiLua created by Mark Feldman and
@@ -96,8 +119,8 @@ distributed under the MIT license.
Using SharpFont created by Robert Rouhani and
distributed under the MIT license.
Using the Tao framework and distributed under
the MIT license.
Using the Open Toolkit distributed under the
MIT license.
Using SDL2# created by Ethan Lee and released
under the zlib license.
@@ -108,7 +131,7 @@ Kaluzhny and released under the GNU GPL terms.
Using Mono.Nat by Alan McGovern and Ben
Motmans and distributed under the MIT license.
Using ICSharpCode.SharpZipLib intially by Mike
Using ICSharpCode.SharpZipLib initially by Mike
Krueger and distributed under the GNU GPL terms.

1725
CHANGELOG

File diff suppressed because it is too large Load Diff

View File

@@ -16,4 +16,8 @@ Please `git rebase` to the latest revision of the bleed branch.
Don't forget to add youself to [AUTHORS](https://github.com/OpenRA/OpenRA/blob/bleed/AUTHORS).
While your pull-request is in review it will be helpful if you join [IRC](irc://chat.freenode.net/openra) to discuss the changes.
Please propose a [CHANGELOG](https://github.com/OpenRA/OpenRA/wiki/CHANGELOG) entry in the pull-request comments.
While your pull-request is in review it will be helpful if you join [IRC](irc://chat.freenode.net/openra) to discuss the changes.
See also the in-depth guide on [contributing](https://github.com/OpenRA/OpenRA/wiki/Contributing) to the OpenRA project.

BIN
GeoIP.dat

Binary file not shown.

View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,62 +0,0 @@
#region Copyright & License Information
/*
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#endregion
using System;
namespace GeoIP
{
public class Country
{
String code;
String name;
/*
* Creates a new Country.
*
* @param code the country code.
* @param name the country name.
*/
public Country(String code, String name)
{
this.code = code;
this.name = name;
}
/*
* Returns the ISO two-letter country code of this country.
*
* @return the country code.
*/
public String getCode()
{
return code;
}
/*
* Returns the name of this country.
*
* @return the country name.
*/
public String getName()
{
return name;
}
}
}

View File

@@ -1,105 +0,0 @@
#region Copyright & License Information
/*
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#endregion
using System;
namespace GeoIP
{
public class DatabaseInfo
{
public static int COUNTRY_EDITION = 1;
public static int REGION_EDITION_REV0 = 7;
public static int REGION_EDITION_REV1 = 3;
public static int CITY_EDITION_REV0 = 6;
public static int CITY_EDITION_REV1 = 2;
public static int ORG_EDITION = 5;
public static int ISP_EDITION = 4;
public static int PROXY_EDITION = 8;
public static int ASNUM_EDITION = 9;
public static int NETSPEED_EDITION = 10;
public static int DOMAIN_EDITION = 11;
public static int COUNTRY_EDITION_V6 = 12;
public static int ASNUM_EDITION_V6 = 21;
public static int ISP_EDITION_V6 = 22;
public static int ORG_EDITION_V6 = 23;
public static int DOMAIN_EDITION_V6 = 24;
public static int CITY_EDITION_REV1_V6 = 30;
public static int CITY_EDITION_REV0_V6 = 31;
public static int NETSPEED_EDITION_REV1 = 32;
public static int NETSPEED_EDITION_REV1_V6 = 33;
private String info;
/**
* Creates a new DatabaseInfo object given the database info String.
* @param info
*/
public DatabaseInfo(String info)
{
this.info = info;
}
public int getType()
{
if ((info == null) | (info == ""))
{
return COUNTRY_EDITION;
}
else
{
// Get the type code from the database info string and then
// subtract 105 from the value to preserve compatability with
// databases from April 2003 and earlier.
return Convert.ToInt32(info.Substring(4, 3)) - 105;
}
}
/**
* Returns the date of the database.
*
* @return the date of the database.
*/
public DateTime getDate()
{
for (int i=0; i<info.Length-9; i++)
{
if (Char.IsWhiteSpace(info[i]) == true)
{
var dateString = info.Substring(i+1, 8);
try
{
return DateTime.ParseExact(dateString,"yyyyMMdd",null);
}
catch (Exception e)
{
Console.Write(e.Message);
}
break;
}
}
return DateTime.Now;
}
public String toString()
{
return info;
}
}
}

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{021DDD6A-A608-424C-9A9A-252D8A9989E0}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GeoIP</RootNamespace>
<AssemblyName>GeoIP</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>..</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Country.cs" />
<Compile Include="DatabaseInfo.cs" />
<Compile Include="Location.cs" />
<Compile Include="LookupService.cs" />
<Compile Include="Region.cs" />
<Compile Include="RegionName.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,66 +0,0 @@
#region Copyright & License Information
/*
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#endregion
using System;
namespace GeoIP
{
public class Location
{
public String countryCode;
public String countryName;
public String region;
public String city;
public String postalCode;
public double latitude;
public double longitude;
public int dma_code;
public int area_code;
public String regionName;
public int metro_code;
private static double EARTH_DIAMETER = 2 * 6378.2;
private static double PI = 3.14159265;
private static double RAD_CONVERT = PI / 180;
public double distance (Location loc)
{
double delta_lat, delta_lon;
double temp;
double lat1 = latitude;
double lon1 = longitude;
double lat2 = loc.latitude;
double lon2 = loc.longitude;
// convert degrees to radians
lat1 *= RAD_CONVERT;
lat2 *= RAD_CONVERT;
// find the deltas
delta_lat = lat2 - lat1;
delta_lon = (lon2 - lon1) * RAD_CONVERT;
// Find the great circle distance
temp = Math.Pow(Math.Sin(delta_lat/2), 2) + Math.Cos(lat1) * Math.Cos(lat2) * Math.Pow(Math.Sin(delta_lon/2), 2);
return EARTH_DIAMETER * Math.Atan2(Math.Sqrt(temp), Math.Sqrt(1-temp));
}
}
}

View File

@@ -1,999 +0,0 @@
#region Copyright & License Information
/*
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#endregion
using System;
using System.IO;
using System.Net;
using System.Runtime.CompilerServices;
namespace GeoIP
{
public class LookupService
{
private FileStream file = null;
private DatabaseInfo databaseInfo = null;
private Object ioLock = new Object();
byte databaseType = Convert.ToByte(DatabaseInfo.COUNTRY_EDITION);
int[] databaseSegments;
int recordLength;
int dboptions;
byte[] dbbuffer;
private static Country UNKNOWN_COUNTRY = new Country("--", "Unknown Location");
private static int COUNTRY_BEGIN = 16776960;
private static int STRUCTURE_INFO_MAX_SIZE = 20;
private static int DATABASE_INFO_MAX_SIZE = 100;
private static int FULL_RECORD_LENGTH = 100;//???
private static int SEGMENT_RECORD_LENGTH = 3;
private static int STANDARD_RECORD_LENGTH = 3;
private static int ORG_RECORD_LENGTH = 4;
private static int MAX_RECORD_LENGTH = 4;
private static int MAX_ORG_RECORD_LENGTH = 1000;//???
private static int FIPS_RANGE = 360;
private static int STATE_BEGIN_REV0 = 16700000;
private static int STATE_BEGIN_REV1 = 16000000;
private static int US_OFFSET = 1;
private static int CANADA_OFFSET = 677;
private static int WORLD_OFFSET = 1353;
public static int GEOIP_STANDARD = 0;
public static int GEOIP_MEMORY_CACHE = 1;
public static int GEOIP_UNKNOWN_SPEED = 0;
public static int GEOIP_DIALUP_SPEED = 1;
public static int GEOIP_CABLEDSL_SPEED = 2;
public static int GEOIP_CORPORATE_SPEED = 3;
private static String[] countryCode = {
"--",
"AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "CW",
"AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB",
"BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO",
"BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD",
"CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR",
"CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO",
"DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ",
"FK", "FM", "FO", "FR", "SX", "GA", "GB", "GD", "GE", "GF",
"GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT",
"GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID",
"IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO",
"JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW",
"KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT",
"LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML",
"MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV",
"MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI",
"NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF",
"PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW",
"PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD",
"SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO",
"SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH",
"TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW",
"TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE",
"VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "RS", "ZA",
"ZM", "ME", "ZW", "A1", "A2", "O1", "AX", "GG", "IM", "JE",
"BL", "MF", "BQ", "SS", "O1" };
private static String[] countryName = {
"Unknown Location",
"Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Curacao",
"Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", "Barbados",
"Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia",
"Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the",
"Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica",
"Cuba", "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic",
"Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji",
"Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", "France", "Sint Maarten (Dutch part)", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana",
"Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala",
"Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia",
"Ireland", "Israel", "India", "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", "Iceland", "Italy", "Jamaica", "Jordan",
"Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait",
"Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania",
"Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova, Republic of", "Madagascar", "Marshall Islands", "Macedonia", "Mali",
"Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives",
"Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua",
"Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia",
"Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory", "Portugal", "Palau",
"Paraguay", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan",
"Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname",
"Sao Tome and Principe", "El Salvador", "Syrian Arab Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand",
"Tajikistan", "Tokelau", "Turkmenistan", "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan",
"Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", "Venezuela",
"Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Serbia", "South Africa",
"Zambia", "Montenegro", "Zimbabwe", "Anonymous Proxy", "Satellite Provider", "Other", "Aland Islands", "Guernsey", "Isle of Man", "Jersey",
"Saint Barthelemy", "Saint Martin", "Bonaire, Saint Eustatius and Saba", "South Sudan", "Other" };
public LookupService(String databaseFile, int options)
{
try
{
lock (ioLock)
this.file = new FileStream(databaseFile, FileMode.Open, FileAccess.Read);
dboptions = options;
init();
}
catch(System.SystemException)
{
Console.WriteLine("cannot open file " + databaseFile);
}
}
public LookupService(String databaseFile):this(databaseFile, GEOIP_STANDARD) { }
private void init()
{
int i, j;
byte[] delim = new byte[3];
byte[] buf = new byte[SEGMENT_RECORD_LENGTH];
databaseType = (byte)DatabaseInfo.COUNTRY_EDITION;
recordLength = STANDARD_RECORD_LENGTH;
lock (ioLock)
{
file.Seek(-3,SeekOrigin.End);
for (i = 0; i < STRUCTURE_INFO_MAX_SIZE; i++)
{
file.Read(delim,0,3);
if (delim[0] == 255 && delim[1] == 255 && delim[2] == 255)
{
databaseType = Convert.ToByte(file.ReadByte());
if (databaseType >= 106)
{
// Backward compatibility with databases from April 2003 and earlier
databaseType -= 105;
}
// Determine the database type.
if (databaseType == DatabaseInfo.REGION_EDITION_REV0)
{
databaseSegments = new int[1];
databaseSegments[0] = STATE_BEGIN_REV0;
recordLength = STANDARD_RECORD_LENGTH;
}
else if (databaseType == DatabaseInfo.REGION_EDITION_REV1)
{
databaseSegments = new int[1];
databaseSegments[0] = STATE_BEGIN_REV1;
recordLength = STANDARD_RECORD_LENGTH;
}
else if (databaseType == DatabaseInfo.CITY_EDITION_REV0 ||
databaseType == DatabaseInfo.CITY_EDITION_REV1 ||
databaseType == DatabaseInfo.ORG_EDITION ||
databaseType == DatabaseInfo.ORG_EDITION_V6 ||
databaseType == DatabaseInfo.ISP_EDITION ||
databaseType == DatabaseInfo.ISP_EDITION_V6 ||
databaseType == DatabaseInfo.ASNUM_EDITION ||
databaseType == DatabaseInfo.ASNUM_EDITION_V6 ||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1 ||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1_V6 ||
databaseType == DatabaseInfo.CITY_EDITION_REV0_V6 ||
databaseType == DatabaseInfo.CITY_EDITION_REV1_V6)
{
databaseSegments = new int[1];
databaseSegments[0] = 0;
if (databaseType == DatabaseInfo.CITY_EDITION_REV0 ||
databaseType == DatabaseInfo.CITY_EDITION_REV1 ||
databaseType == DatabaseInfo.ASNUM_EDITION_V6 ||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1 ||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1_V6 ||
databaseType == DatabaseInfo.CITY_EDITION_REV0_V6 ||
databaseType == DatabaseInfo.CITY_EDITION_REV1_V6 ||
databaseType == DatabaseInfo.ASNUM_EDITION)
{
recordLength = STANDARD_RECORD_LENGTH;
}
else
{
recordLength = ORG_RECORD_LENGTH;
}
file.Read(buf,0,SEGMENT_RECORD_LENGTH);
for (j = 0; j < SEGMENT_RECORD_LENGTH; j++)
databaseSegments[0] += (unsignedByteToInt(buf[j]) << (j * 8));
}
break;
}
else
{
file.Seek(-4,SeekOrigin.Current);
}
}
if ((databaseType == DatabaseInfo.COUNTRY_EDITION) ||
(databaseType == DatabaseInfo.COUNTRY_EDITION_V6) ||
(databaseType == DatabaseInfo.PROXY_EDITION) ||
(databaseType == DatabaseInfo.NETSPEED_EDITION))
{
databaseSegments = new int[1];
databaseSegments[0] = COUNTRY_BEGIN;
recordLength = STANDARD_RECORD_LENGTH;
}
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
{
int l = (int) file.Length;
dbbuffer = new byte[l];
file.Seek(0,SeekOrigin.Begin);
file.Read(dbbuffer,0,l);
}
}
}
public void close()
{
try
{
lock (ioLock) { file.Close(); }
file = null;
}
catch (Exception) { }
}
public Country getCountry(IPAddress ipAddress)
{
return getCountry(bytestoLong(ipAddress.GetAddressBytes()));
}
public Country getCountryV6(String ipAddress)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(ipAddress);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return UNKNOWN_COUNTRY;
}
return getCountryV6(addr);
}
public Country getCountry(String ipAddress)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(ipAddress);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return UNKNOWN_COUNTRY;
}
return getCountry(bytestoLong(addr.GetAddressBytes()));
}
public Country getCountryV6(IPAddress ipAddress)
{
if (file == null)
{
throw new Exception("Database has been closed.");
}
if ((databaseType == DatabaseInfo.CITY_EDITION_REV1) |
(databaseType == DatabaseInfo.CITY_EDITION_REV0))
{
var l = getLocation(ipAddress);
if (l == null)
return UNKNOWN_COUNTRY;
else
return new Country(l.countryCode, l.countryName);
}
else
{
int ret = SeekCountryV6(ipAddress) - COUNTRY_BEGIN;
if (ret == 0)
return UNKNOWN_COUNTRY;
else
return new Country(countryCode[ret], countryName[ret]);
}
}
public Country getCountry(long ipAddress)
{
if (file == null)
throw new Exception("Database has been closed.");
if ((databaseType == DatabaseInfo.CITY_EDITION_REV1) |
(databaseType == DatabaseInfo.CITY_EDITION_REV0))
{
var l = getLocation(ipAddress);
if (l == null)
return UNKNOWN_COUNTRY;
else
return new Country(l.countryCode, l.countryName);
}
else
{
var ret = SeekCountry(ipAddress) - COUNTRY_BEGIN;
if (ret == 0)
return UNKNOWN_COUNTRY;
else
return new Country(countryCode[ret], countryName[ret]);
}
}
public int getID(String ipAddress)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(ipAddress);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return 0;
}
return getID(bytestoLong(addr.GetAddressBytes()));
}
public int getID(IPAddress ipAddress)
{
return getID(bytestoLong(ipAddress.GetAddressBytes()));
}
public int getID(long ipAddress)
{
if (file == null)
throw new Exception("Database has been closed.");
int ret = SeekCountry(ipAddress) - databaseSegments[0];
return ret;
}
public DatabaseInfo getDatabaseInfo()
{
if (databaseInfo != null)
return databaseInfo;
try
{
// Synchronize since we're accessing the database file.
lock (ioLock)
{
bool hasStructureInfo = false;
byte [] delim = new byte[3];
// Advance to part of file where database info is stored.
file.Seek(-3,SeekOrigin.End);
for (int i=0; i<STRUCTURE_INFO_MAX_SIZE; i++)
{
file.Read(delim,0,3);
if (delim[0] == 255 && delim[1] == 255 && delim[2] == 255)
{
hasStructureInfo = true;
break;
}
file.Seek(-4,SeekOrigin.Current);
}
if (hasStructureInfo)
file.Seek(-6,SeekOrigin.Current);
else
{
// No structure info, must be pre Sep 2002 database, go back to end.
file.Seek(-3,SeekOrigin.End);
}
// Find the database info string.
for (int i=0; i<DATABASE_INFO_MAX_SIZE; i++)
{
file.Read(delim,0,3);
if (delim[0]==0 && delim[1]==0 && delim[2]==0)
{
byte[] dbInfo = new byte[i];
char[] dbInfo2 = new char[i];
file.Read(dbInfo,0,i);
for (int a0 = 0;a0 < i;a0++)
dbInfo2[a0] = Convert.ToChar(dbInfo[a0]);
// Create the database info object using the string.
this.databaseInfo = new DatabaseInfo(new String(dbInfo2));
return databaseInfo;
}
file.Seek(-4,SeekOrigin.Current);
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return new DatabaseInfo("");
}
public Region getRegion(IPAddress ipAddress)
{
return getRegion(bytestoLong(ipAddress.GetAddressBytes()));
}
public Region getRegion(String str)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(str);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
return getRegion(bytestoLong(addr.GetAddressBytes()));
}
[MethodImpl(MethodImplOptions.Synchronized)]
public Region getRegion(long ipnum)
{
Region record = new Region();
int seek_region = 0;
if (databaseType == DatabaseInfo.REGION_EDITION_REV0)
{
seek_region = SeekCountry(ipnum) - STATE_BEGIN_REV0;
char [] ch = new char[2];
if (seek_region >= 1000)
{
record.countryCode = "US";
record.countryName = "United States";
ch[0] = (char)(((seek_region - 1000)/26) + 65);
ch[1] = (char)(((seek_region - 1000)%26) + 65);
record.region = new String(ch);
}
else
{
record.countryCode = countryCode[seek_region];
record.countryName = countryName[seek_region];
record.region = "";
}
}
else if (databaseType == DatabaseInfo.REGION_EDITION_REV1)
{
seek_region = SeekCountry(ipnum) - STATE_BEGIN_REV1;
char [] ch = new char[2];
if (seek_region < US_OFFSET)
{
record.countryCode = "";
record.countryName = "";
record.region = "";
} else if (seek_region < CANADA_OFFSET)
{
record.countryCode = "US";
record.countryName = "United States";
ch[0] = (char)(((seek_region - US_OFFSET)/26) + 65);
ch[1] = (char)(((seek_region - US_OFFSET)%26) + 65);
record.region = new String(ch);
} else if (seek_region < WORLD_OFFSET)
{
record.countryCode = "CA";
record.countryName = "Canada";
ch[0] = (char)(((seek_region - CANADA_OFFSET)/26) + 65);
ch[1] = (char)(((seek_region - CANADA_OFFSET)%26) + 65);
record.region = new String(ch);
}
else
{
record.countryCode = countryCode[(seek_region - WORLD_OFFSET) / FIPS_RANGE];
record.countryName = countryName[(seek_region - WORLD_OFFSET) / FIPS_RANGE];
record.region = "";
}
}
return record;
}
public Location getLocation(IPAddress addr)
{
return getLocation(bytestoLong(addr.GetAddressBytes()));
}
public Location getLocationV6(String str)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(str);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
return getLocationV6(addr);
}
public Location getLocation(String str)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(str);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
return getLocation(bytestoLong(addr.GetAddressBytes()));
}
[MethodImpl(MethodImplOptions.Synchronized)]
public Location getLocationV6(IPAddress addr)
{
int record_pointer;
byte[] record_buf = new byte[FULL_RECORD_LENGTH];
char[] record_buf2 = new char[FULL_RECORD_LENGTH];
int record_buf_offset = 0;
Location record = new Location();
int str_length = 0;
int j, Seek_country;
double latitude = 0, longitude = 0;
try
{
Seek_country = SeekCountryV6(addr);
if (Seek_country == databaseSegments[0])
return null;
record_pointer = Seek_country + ((2 * recordLength - 1) * databaseSegments[0]);
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
Array.Copy(dbbuffer, record_pointer, record_buf, 0, Math.Min(dbbuffer.Length - record_pointer, FULL_RECORD_LENGTH));
else
{
lock (ioLock)
{
file.Seek(record_pointer,SeekOrigin.Begin);
file.Read(record_buf,0,FULL_RECORD_LENGTH);
}
}
for (int a0 = 0;a0 < FULL_RECORD_LENGTH;a0++)
record_buf2[a0] = Convert.ToChar(record_buf[a0]);
// get country
record.countryCode = countryCode[unsignedByteToInt(record_buf[0])];
record.countryName = countryName[unsignedByteToInt(record_buf[0])];
record_buf_offset++;
// get region
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.region = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += str_length + 1;
str_length = 0;
// get region_name
record.regionName = RegionName.getRegionName( record.countryCode, record.region );
// get city
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.city = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += (str_length + 1);
str_length = 0;
// get postal code
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.postalCode = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += (str_length + 1);
// get latitude
for (j = 0; j < 3; j++)
latitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.latitude = (float)latitude/10000 - 180;
record_buf_offset += 3;
// get longitude
for (j = 0; j < 3; j++)
longitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.longitude = (float)longitude/10000 - 180;
record.metro_code = record.dma_code = 0;
record.area_code = 0;
if (databaseType == DatabaseInfo.CITY_EDITION_REV1
||databaseType == DatabaseInfo.CITY_EDITION_REV1_V6)
{
// get metro_code
int metroarea_combo = 0;
if (record.countryCode == "US")
{
record_buf_offset += 3;
for (j = 0; j < 3; j++)
metroarea_combo += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.metro_code = record.dma_code = metroarea_combo/1000;
record.area_code = metroarea_combo % 1000;
}
}
}
catch (IOException)
{
Console.WriteLine("IO Exception while seting up segments");
}
return record;
}
[MethodImpl(MethodImplOptions.Synchronized)]
public Location getLocation(long ipnum)
{
int record_pointer;
byte[] record_buf = new byte[FULL_RECORD_LENGTH];
char[] record_buf2 = new char[FULL_RECORD_LENGTH];
int record_buf_offset = 0;
Location record = new Location();
int str_length = 0;
int j, Seek_country;
double latitude = 0, longitude = 0;
try
{
Seek_country = SeekCountry(ipnum);
if (Seek_country == databaseSegments[0])
return null;
record_pointer = Seek_country + ((2 * recordLength - 1) * databaseSegments[0]);
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
Array.Copy(dbbuffer, record_pointer, record_buf, 0, Math.Min(dbbuffer.Length - record_pointer, FULL_RECORD_LENGTH));
else
{
lock (ioLock)
{
file.Seek(record_pointer,SeekOrigin.Begin);
file.Read(record_buf,0,FULL_RECORD_LENGTH);
}
}
for (int a0 = 0;a0 < FULL_RECORD_LENGTH;a0++)
record_buf2[a0] = Convert.ToChar(record_buf[a0]);
// get country
record.countryCode = countryCode[unsignedByteToInt(record_buf[0])];
record.countryName = countryName[unsignedByteToInt(record_buf[0])];
record_buf_offset++;
// get region
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.region = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += str_length + 1;
str_length = 0;
// get region_name
record.regionName = RegionName.getRegionName(record.countryCode, record.region);
// get city
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.city = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += (str_length + 1);
str_length = 0;
// get postal code
while (record_buf[record_buf_offset + str_length] != '\0')
str_length++;
if (str_length > 0)
record.postalCode = new String(record_buf2, record_buf_offset, str_length);
record_buf_offset += (str_length + 1);
// get latitude
for (j = 0; j < 3; j++)
latitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.latitude = (float) latitude/10000 - 180;
record_buf_offset += 3;
// get longitude
for (j = 0; j < 3; j++)
longitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.longitude = (float) longitude/10000 - 180;
record.metro_code = record.dma_code = 0;
record.area_code = 0;
if (databaseType == DatabaseInfo.CITY_EDITION_REV1)
{
// get metro_code
int metroarea_combo = 0;
if (record.countryCode == "US"){
record_buf_offset += 3;
for (j = 0; j < 3; j++)
metroarea_combo += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
record.metro_code = record.dma_code = metroarea_combo/1000;
record.area_code = metroarea_combo % 1000;
}
}
}
catch (IOException)
{
Console.WriteLine("IO Exception while seting up segments");
}
return record;
}
public String getOrg(IPAddress addr)
{
return getOrg(bytestoLong(addr.GetAddressBytes()));
}
public String getOrgV6(String str)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(str);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
return getOrgV6(addr);
}
public String getOrg(String str)
{
IPAddress addr;
try
{
addr = IPAddress.Parse(str);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
return getOrg(bytestoLong(addr.GetAddressBytes()));
}
[MethodImpl(MethodImplOptions.Synchronized)]
public String getOrgV6( IPAddress addr)
{
int Seek_org;
int record_pointer;
int str_length = 0;
byte[] buf = new byte[MAX_ORG_RECORD_LENGTH];
char[] buf2 = new char[MAX_ORG_RECORD_LENGTH];
String org_buf;
try
{
Seek_org = SeekCountryV6(addr);
if (Seek_org == databaseSegments[0])
return null;
record_pointer = Seek_org + (2 * recordLength - 1) * databaseSegments[0];
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
Array.Copy(dbbuffer, record_pointer, buf, 0, Math.Min(dbbuffer.Length - record_pointer, MAX_ORG_RECORD_LENGTH));
else
{
lock (ioLock)
{
file.Seek(record_pointer,SeekOrigin.Begin);
file.Read(buf,0,MAX_ORG_RECORD_LENGTH);
}
}
while (buf[str_length] != 0)
{
buf2[str_length] = Convert.ToChar(buf[str_length]);
str_length++;
}
buf2[str_length] = '\0';
org_buf = new String(buf2,0,str_length);
return org_buf;
}
catch (IOException)
{
Console.WriteLine("IO Exception");
return null;
}
}
[MethodImpl(MethodImplOptions.Synchronized)]
public String getOrg(long ipnum)
{
int Seek_org;
int record_pointer;
int str_length = 0;
byte [] buf = new byte[MAX_ORG_RECORD_LENGTH];
char [] buf2 = new char[MAX_ORG_RECORD_LENGTH];
String org_buf;
try
{
Seek_org = SeekCountry(ipnum);
if (Seek_org == databaseSegments[0])
return null;
record_pointer = Seek_org + (2 * recordLength - 1) * databaseSegments[0];
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
Array.Copy(dbbuffer, record_pointer, buf, 0, Math.Min(dbbuffer.Length - record_pointer, MAX_ORG_RECORD_LENGTH));
else
{
lock (ioLock)
{
file.Seek(record_pointer,SeekOrigin.Begin);
file.Read(buf,0,MAX_ORG_RECORD_LENGTH);
}
}
while (buf[str_length] != 0)
{
buf2[str_length] = Convert.ToChar(buf[str_length]);
str_length++;
}
buf2[str_length] = '\0';
org_buf = new String(buf2, 0, str_length);
return org_buf;
}
catch (IOException)
{
Console.WriteLine("IO Exception");
return null;
}
}
[MethodImpl(MethodImplOptions.Synchronized)]
int SeekCountryV6(IPAddress ipAddress)
{
byte [] v6vec = ipAddress.GetAddressBytes();
byte [] buf = new byte[2 * MAX_RECORD_LENGTH];
int [] x = new int[2];
int offset = 0;
for (int depth = 127; depth >= 0; depth--)
{
try
{
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
{
for (int i = 0;i < (2 * MAX_RECORD_LENGTH);i++)
buf[i] = dbbuffer[i+(2 * recordLength * offset)];
}
else
{
lock (ioLock)
{
file.Seek(2 * recordLength * offset,SeekOrigin.Begin);
file.Read(buf,0,2 * MAX_RECORD_LENGTH);
}
}
}
catch (IOException)
{
Console.WriteLine("IO Exception");
}
for (int i = 0; i<2; i++)
{
x[i] = 0;
for (int j = 0; j<recordLength; j++)
{
int y = buf[(i*recordLength)+j];
if (y < 0)
{
y+= 256;
}
x[i] += (y << (j * 8));
}
}
int bnum = 127 - depth;
int idx = bnum >> 3;
int b_mask = 1 << ( bnum & 7 ^ 7 );
if ((v6vec[idx] & b_mask) > 0)
{
if (x[1] >= databaseSegments[0])
{
return x[1];
}
offset = x[1];
}
else
{
if (x[0] >= databaseSegments[0])
{
return x[0];
}
offset = x[0];
}
}
// shouldn't reach here
Console.WriteLine("Error Seeking country while Seeking " + ipAddress);
return 0;
}
[MethodImpl(MethodImplOptions.Synchronized)]
int SeekCountry(long ipAddress)
{
byte [] buf = new byte[2 * MAX_RECORD_LENGTH];
int [] x = new int[2];
int offset = 0;
for (int depth = 31; depth >= 0; depth--)
{
try
{
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
{
for (int i = 0;i < (2 * MAX_RECORD_LENGTH);i++)
{
buf[i] = dbbuffer[i+(2 * recordLength * offset)];
}
}
else
{
lock (ioLock)
{
file.Seek(2 * recordLength * offset,SeekOrigin.Begin);
file.Read(buf, 0, 2 * MAX_RECORD_LENGTH);
}
}
}
catch (IOException)
{
Console.WriteLine("IO Exception");
}
for (int i = 0; i<2; i++)
{
x[i] = 0;
for (int j = 0; j<recordLength; j++)
{
int y = buf[(i*recordLength)+j];
if (y < 0)
y+= 256;
x[i] += (y << (j * 8));
}
}
if ((ipAddress & (1 << depth)) > 0)
{
if (x[1] >= databaseSegments[0])
return x[1];
offset = x[1];
}
else
{
if (x[0] >= databaseSegments[0])
return x[0];
offset = x[0];
}
}
// shouldn't reach here
Console.WriteLine("Error Seeking country while Seeking " + ipAddress);
return 0;
}
static long swapbytes(long ipAddress)
{
return (((ipAddress>>0) & 255) << 24) | (((ipAddress>>8) & 255) << 16)
| (((ipAddress>>16) & 255) << 8) | (((ipAddress>>24) & 255) << 0);
}
static long bytestoLong(byte [] address)
{
long ipnum = 0;
for (int i = 0; i < 4; ++i)
{
long y = address[i];
if (y < 0)
y += 256;
ipnum += y << ((3-i)*8);
}
return ipnum;
}
static int unsignedByteToInt(byte b)
{
return (int) b & 0xFF;
}
}
}

View File

@@ -1,52 +0,0 @@
#region Copyright & License Information
/*
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#endregion
using System;
public class Region
{
public String countryCode;
public String countryName;
public String region;
public Region() { }
public Region(String countryCode,String countryName,String region)
{
this.countryCode = countryCode;
this.countryName = countryName;
this.region = region;
}
public String getcountryCode()
{
return countryCode;
}
public String getcountryName()
{
return countryName;
}
public String getregion()
{
return region;
}
}

File diff suppressed because it is too large Load Diff

BIN
GeoLite2-Country.mmdb Normal file

Binary file not shown.

77
INSTALL
View File

@@ -1,77 +0,0 @@
Copyright 2007-2013 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.
To run OpenRA, several files are needed from the original game disks.
A minimal asset pack can also be downloaded and installed by the game.
Windows
-------
* .NET Framework >= 3.5-SP1
(http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en)
* Cg Toolkit >= 2.2 (optional, for Cg renderer)
(https://developer.nvidia.com/cg-toolkit-download)
* SDL 1.2 (included)
(http://libsdl.org/download-1.2.php)
* FreeType (included)
(http://gnuwin32.sourceforge.net/packages/freetype.htm)
* zlib (included)
(http://gnuwin32.sourceforge.net/packages/zlib.htm)
* OpenAL (included)
(http://kcat.strangesoft.net/openal.html)
To compile OpenRA, open the OpenRA.sln solution in the main folder,
or build it from the command-line with MSBuild.
Copy both the native DLLs from .\packaging\windows
and the CLI images from .\thirdparty to the main folder.
Run the game with `OpenRA.Game.exe Game.Mod=ra` for Red Alert
or `OpenRA.Game.exe Game.Mod=cnc` for Command & Conquer
Debian/Ubuntu
-------------
* mono-gmcs
* libmono-winforms2.0-cil
* cli-common-dev (>= 2.10)
* freetype
* openal
* sdl
* nvidia-cg-toolkit (optional, for Cg renderer)
To compile OpenRA, run `make all' from the command line.
To grab the bundled CLI DLLs type `make dependencies'
Run with either `launch-game.sh' or `mono --debug OpenRA.Game.exe'.
Type 'sudo make install-all' for system wide installation. You
can then run from the `openra` shortcut.
Slackware
---------
The following packages from slackbuilds.org are required, on 13.37 32-bit:
* libgdiplus
* mono
* openAL
* nvidia-cg-toolkit (optional, for Cg renderer)
openSUSE
--------
* mono-devel
* openal
* freetype2
* SDL
* cg (optional, for Cg renderer)
Gentoo
------
* dev-lang/mono
* dev-dotnet/libgdiplus
* media-libs/openal
* media-gfx/nvidia-cg-toolkit (optional, for Cg renderer)

72
INSTALL.md Normal file
View File

@@ -0,0 +1,72 @@
To run OpenRA, several files are needed from the original game disks.
A minimal asset pack can also be downloaded and installed by the game.
The following lists per-platform dependencies required to build from source.
Windows
=======
* [.NET Framework >= 4.0 (Client Profile)](http://www.microsoft.com/en-us/download/details.aspx?id=17113)
* [SDL 2 (included)](http://www.libsdl.org/download-2.0.php)
* [FreeType (included)](http://gnuwin32.sourceforge.net/packages/freetype.htm)
* [zlib (included)](http://gnuwin32.sourceforge.net/packages/zlib.htm)
* [OpenAL (included)](http://kcat.strangesoft.net/openal.html)
* [liblua 5.1 (included)](http://luabinaries.sourceforge.net/download.html)
To compile OpenRA, open the `OpenRA.sln` solution in the main folder,
or build it from the command-line with MSBuild.
Copy both the native DLLs from `.\thirdparty\windows`
and the CLI images from `.\thirdparty` to the main folder.
Run the game with `OpenRA.Game.exe Game.Mod=ra` for Red Alert
or `OpenRA.Game.exe Game.Mod=cnc` for Tiberian Dawn.
Linux
=====
Run `./configure` to map the native libraries to your system.
To compile OpenRA, run `make all` from the command line.
Run with either `launch-game.sh` or `mono --debug OpenRA.Game.exe`.
Type `sudo make install-all` for system wide installation. Run `make install-linux-shortcuts` to get startup scripts, icons and desktop files. You can then run from the `openra` shortcut.
Debian/Ubuntu
-------------
* mono-dmcs
* libmono-system-windows-forms4.0-cil
* cli-common-dev (>= 2.10)
* libfreetype6
* libopenal1
* liblua5.1-0
* libsdl2-2.0-0
* xdg-utils
* zenity
openSUSE
--------
* mono-devel
* openal
* freetype2
* SDL2
* lua51
* xdg-utils
* zenity
Gentoo
------
* dev-lang/mono
* dev-dotnet/libgdiplus
* media-libs/freetype:2
* media-libs/libsdl2
* media-libs/openal
* virtual/jpeg
* virtual/opengl
* dev-lang/lua-5.1.5
* x11-misc/xdg-utils
* gnome-extra/zenity

224
Makefile
View File

@@ -18,8 +18,8 @@
# to install with development tools, run:
# make [prefix=/foo] [bindir=/bar/bin] install-all
#
# to install Linux desktop files and icons:
# make install-shortcuts
# to install Linux startup scripts, desktop files and icons:
# make install-linux-shortcuts
#
# to uninstall, run:
# make uninstall
@@ -34,10 +34,10 @@
############################## TOOLCHAIN ###############################
#
CSC = gmcs
CSC = dmcs
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
DEFINE = DEBUG;TRACE
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll
COMMON_LIBS = System.dll System.Core.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
@@ -48,15 +48,17 @@ prefix ?= /usr/local
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
bindir ?= $(prefix)/bin
libexecdir ?= $(prefix)/lib
libdir ?= $(prefix)/lib
gameinstalldir ?= $(libdir)/openra
BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
# TODO: separate data and binaries properly
DATA_INSTALL_DIR = $(DESTDIR)$(libexecdir)/openra
DATA_INSTALL_DIR = $(DESTDIR)$(gameinstalldir)
# install tools
RM = rm
RM_R = $(RM) -r
RM_F = $(RM) -f
RM_RF = $(RM) -rf
CP = cp
CP_R = $(CP) -r
INSTALL = install
@@ -65,8 +67,8 @@ INSTALL_PROGRAM = $(INSTALL) -m755
INSTALL_DATA = $(INSTALL) -m644
# program targets
CORE = fileformats rcg rgl rsdl rsdl2 rnull game utility geoip irc
TOOLS = editor tsbuild ralint
CORE = rsdl2 rnull game utility irc ralint
TOOLS = editor tsbuild crashdialog
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
@@ -75,25 +77,11 @@ VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev
######################## PROGRAM TARGET RULES ##########################
#
# Core binaries
fileformats_SRCS := $(shell find OpenRA.FileFormats/ -iname '*.cs')
fileformats_TARGET = OpenRA.FileFormats.dll
fileformats_KIND = library
fileformats_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Sdl.dll System.Windows.Forms.dll
PROGRAMS = fileformats
fileformats: $(fileformats_TARGET)
geoip_SRCS := $(shell find GeoIP/ -iname '*.cs')
geoip_TARGET = GeoIP.dll
geoip_KIND = library
geoip_LIBS = $(COMMON_LIBS)
PROGRAMS += geoip
geoip: $(geoip_TARGET)
game_SRCS := $(shell find OpenRA.Game/ -iname '*.cs')
game_TARGET = OpenRA.Game.exe
game_KIND = winexe
game_DEPS = $(fileformats_TARGET)
game_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll $(game_DEPS) thirdparty/Tao/Tao.OpenAl.dll thirdparty/SharpFont.dll
game_LIBS = $(COMMON_LIBS) $(game_DEPS) thirdparty/SDL2-CS.dll thirdparty/SharpFont.dll
game_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico
PROGRAMS += game
game: $(game_TARGET)
@@ -101,56 +89,47 @@ game: $(game_TARGET)
irc_SRCS := $(shell find OpenRA.Irc/ -iname '*.cs')
irc_TARGET = OpenRA.Irc.dll
irc_KIND = library
irc_DEPS = $(fileformats_TARGET) $(game_TARGET)
irc_DEPS = $(game_TARGET)
irc_LIBS = $(COMMON_LIBS) $(irc_DEPS)
PROGRAMS += irc
irc: $(irc_TARGET)
# Renderer dlls
rsdl_SRCS := $(shell find OpenRA.Renderer.SdlCommon/ -iname '*.cs')
rsdl_TARGET = OpenRA.Renderer.SdlCommon.dll
rsdl_KIND = library
rsdl_DEPS = $(fileformats_TARGET) $(game_TARGET)
rsdl_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll $(rsdl_DEPS)
rcg_SRCS := $(shell find OpenRA.Renderer.Cg/ -iname '*.cs')
rcg_TARGET = OpenRA.Renderer.Cg.dll
rcg_KIND = library
rcg_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET)
rcg_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll $(rcg_DEPS)
rgl_SRCS := $(shell find OpenRA.Renderer.Gl/ -iname '*.cs')
rgl_TARGET = OpenRA.Renderer.Gl.dll
rgl_KIND = library
rgl_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET)
rgl_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll $(rgl_DEPS)
rsdl2_SRCS := $(shell find OpenRA.Renderer.Sdl2/ -iname '*.cs')
rsdl2_TARGET = OpenRA.Renderer.Sdl2.dll
rsdl2_KIND = library
rsdl2_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET) $(rgl_TARGET)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/SDL2\#.dll $(rsdl2_DEPS)
rsdl2_DEPS = $(game_TARGET)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/SDL2-CS.dll $(rsdl2_DEPS)
rnull_SRCS := $(shell find OpenRA.Renderer.Null/ -iname '*.cs')
rnull_TARGET = OpenRA.Renderer.Null.dll
rnull_KIND = library
rnull_DEPS = $(fileformats_TARGET) $(game_TARGET)
rnull_DEPS = $(game_TARGET)
rnull_LIBS = $(COMMON_LIBS) $(rnull_DEPS)
PROGRAMS += rcg rgl rsdl2 rnull rsdl
renderers: $(rcg_TARGET) $(rgl_TARGET) $(rsdl2_TARGET) $(rnull_TARGET) $(rsdl_TARGET)
PROGRAMS += rsdl2 rnull
renderers: $(rsdl2_TARGET) $(rnull_TARGET)
# Mods Common
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)
PROGRAMS += mod_common
mod_common: $(mod_common_TARGET)
##### Official Mods #####
STD_MOD_LIBS = $(fileformats_TARGET) $(game_TARGET) thirdparty/KopiLua.dll thirdparty/NLua.dll
STD_MOD_LIBS = $(game_TARGET) thirdparty/KopiLua.dll thirdparty/NLua.dll
STD_MOD_DEPS = $(STD_MOD_LIBS) $(ralint_TARGET)
# Red Alert
mod_ra_SRCS := $(shell find OpenRA.Mods.RA/ -iname '*.cs')
mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
mod_ra_KIND = library
mod_ra_DEPS = $(STD_MOD_DEPS) $(geoip_TARGET) $(irc_TARGET)
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(geoip_TARGET) $(irc_TARGET)
mod_ra_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) $(irc_TARGET)
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) $(irc_TARGET)
PROGRAMS += mod_ra
mod_ra: $(mod_ra_TARGET)
@@ -158,8 +137,8 @@ mod_ra: $(mod_ra_TARGET)
mod_cnc_SRCS := $(shell find OpenRA.Mods.Cnc/ -iname '*.cs')
mod_cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll
mod_cnc_KIND = library
mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) $(mod_ra_TARGET)
PROGRAMS += mod_cnc
mod_cnc: $(mod_cnc_TARGET)
@@ -176,8 +155,8 @@ mod_d2k: $(mod_d2k_TARGET)
mod_ts_SRCS := $(shell find OpenRA.Mods.TS/ -iname '*.cs')
mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll
mod_ts_KIND = library
mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) $(mod_ra_TARGET)
mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) $(mod_ra_TARGET)
PROGRAMS += mod_ts
mod_ts: $(mod_ts_TARGET)
@@ -187,8 +166,8 @@ mod_ts: $(mod_ts_TARGET)
editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs')
editor_TARGET = OpenRA.Editor.exe
editor_KIND = winexe
editor_DEPS = $(fileformats_TARGET) $(game_TARGET)
editor_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll System.Data.dll $(editor_DEPS)
editor_DEPS = $(game_TARGET)
editor_LIBS = System.Windows.Forms.dll System.Data.dll System.Drawing.dll $(editor_DEPS) thirdparty/Eluant.dll
editor_EXTRA = -resource:OpenRA.Editor.Form1.resources -resource:OpenRA.Editor.MapSelect.resources
editor_FLAGS = -win32icon:OpenRA.Editor/OpenRA.Editor.Icon.ico
@@ -203,7 +182,7 @@ editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor
ralint_SRCS := $(shell find OpenRA.Lint/ -iname '*.cs')
ralint_TARGET = OpenRA.Lint.exe
ralint_KIND = exe
ralint_DEPS = $(fileformats_TARGET) $(game_TARGET)
ralint_DEPS = $(game_TARGET)
ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS)
PROGRAMS += ralint
ralint: $(ralint_TARGET)
@@ -222,7 +201,7 @@ test:
tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_TARGET = OpenRA.TilesetBuilder.exe
tsbuild_KIND = winexe
tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET)
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
@@ -237,12 +216,21 @@ tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormN
##### Launchers / Utilities #####
crashdialog_SRCS := $(shell find OpenRA.CrashDialog/ -iname '*.cs')
crashdialog_TARGET = OpenRA.CrashDialog.exe
crashdialog_KIND = exe
crashdialog_DEPS = $(game_TARGET)
crashdialog_LIBS = $(COMMON_LIBS) $(crashdialog_DEPS) System.Windows.Forms.dll
crashdialog_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico
PROGRAMS += crashdialog
crashdialog: $(crashdialog_TARGET)
# Backend for the launcher apps - queries game/mod info and applies actions to an install
utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs')
utility_TARGET = OpenRA.Utility.exe
utility_KIND = exe
utility_DEPS = $(fileformats_TARGET) $(game_TARGET)
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll
utility_DEPS = $(game_TARGET)
utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll
PROGRAMS += utility
utility: $(utility_TARGET)
@@ -274,28 +262,39 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
########################## MAKE/INSTALL RULES ##########################
#
default: dependencies core
default: cli-dependencies core
core: game renderers mods utility
core: game renderers mods utility ralint
tools: editor tsbuild ralint
tools: editor tsbuild crashdialog
package: dependencies core editor docs version
package: dependencies core editor crashdialog docs version
mods: mod_ra mod_cnc mod_d2k mod_ts
mods: mod_common mod_ra mod_cnc mod_d2k mod_ts
all: dependencies core tools
all: cli-dependencies core tools
clean:
@-$(RM_F) *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
@-$(RM_F) *.exe *.dll ./OpenRA*/*.dll ./OpenRA*/*.mdb *.mdb mods/**/*.dll mods/**/*.mdb *.resources
@-$(RM_RF) ./*/bin ./*/obj
distclean: clean
dependencies:
@ $(CP_R) thirdparty/*.dl* .
@ $(CP_R) thirdparty/Tao/* .
platformdeps = "linux"
ifeq ($(shell uname),Darwin)
platformdeps = "osx"
endif
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml
dependencies: cli-dependencies native-dependencies
cli-dependencies:
@ $(CP_R) thirdparty/*.dll .
@ $(CP_R) thirdparty/*.dll.config .
native-dependencies:
@ $(CP_R) thirdparty/${platformdeps}/* .
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml
@for i in $? ; do \
awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $${i} > $${i}.tmp && \
mv -f $${i}.tmp $${i} ; \
@@ -303,18 +302,22 @@ version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml
# Documentation (d2k depends on all mod libraries)
docs: utility
@mono --debug OpenRA.Utility.exe --docs d2k > DOCUMENTATION.md
@mono --debug OpenRA.Utility.exe d2k --docs > DOCUMENTATION.md
@mono --debug OpenRA.Utility.exe ra --lua-docs > Lua-API.md
install: install-core
install-all: install-core install-tools
install-linux-shortcuts: install-linux-scripts install-linux-icons install-linux-desktop
install-core: default
@-echo "Installing OpenRA to $(DATA_INSTALL_DIR)"
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)"
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)/mods"
@$(CP_R) mods/common "$(DATA_INSTALL_DIR)/mods/"
@$(INSTALL_PROGRAM) $(mod_common_TARGET) "$(DATA_INSTALL_DIR)/mods/common"
@$(CP_R) mods/cnc "$(DATA_INSTALL_DIR)/mods/"
@$(INSTALL_PROGRAM) $(mod_cnc_TARGET) "$(DATA_INSTALL_DIR)/mods/cnc"
@$(CP_R) mods/ra "$(DATA_INSTALL_DIR)/mods/"
@@ -324,59 +327,60 @@ 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) "GeoIP.dat" "$(DATA_INSTALL_DIR)/GeoIP.dat"
@$(INSTALL_DATA) "GeoLite2-Country.mmdb" "$(DATA_INSTALL_DIR)/GeoLite2-Country.mmdb"
@$(INSTALL_DATA) AUTHORS "$(DATA_INSTALL_DIR)/AUTHORS"
@$(INSTALL_DATA) CHANGELOG "$(DATA_INSTALL_DIR)/CHANGELOG"
@$(INSTALL_DATA) COPYING "$(DATA_INSTALL_DIR)/COPYING"
@$(CP_R) glsl "$(DATA_INSTALL_DIR)"
@$(CP_R) cg "$(DATA_INSTALL_DIR)"
@$(CP_R) lua "$(DATA_INSTALL_DIR)"
@$(CP) *.ttf "$(DATA_INSTALL_DIR)"
@$(CP) thirdparty/Tao/* "$(DATA_INSTALL_DIR)"
@$(CP) thirdparty/SDL2\#* "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/ICSharpCode.SharpZipLib.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/FuzzyLogicLibrary.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/SharpFont.dll "$(DATA_INSTALL_DIR)"
@$(CP) thirdparty/SharpFont.dll.config "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/Mono.Nat.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/KopiLua.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) thirdparty/NLua.dll "$(DATA_INSTALL_DIR)"
@$(CP) SDL2-CS* "$(DATA_INSTALL_DIR)"
@$(CP) Eluant* "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) ICSharpCode.SharpZipLib.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) FuzzyLogicLibrary.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) SharpFont.dll "$(DATA_INSTALL_DIR)"
@$(CP) SharpFont.dll.config "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) Mono.Nat.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) KopiLua.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) NLua.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) MaxMind.Db.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) MaxMind.GeoIP2.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) Newtonsoft.Json.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) RestSharp.dll "$(DATA_INSTALL_DIR)"
@echo "#!/bin/sh" > openra
@echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra
@echo 'ROOTDIR="$${BINDIR%'"$(bindir)"'}"' >> openra
@echo 'EXECDIR="$${ROOTDIR}'"$(libexecdir)"'"' >> openra
@echo 'cd "$${EXECDIR}/openra"' >> openra
@echo 'exec mono OpenRA.Game.exe "$$@"' >> openra
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
@$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)"
@-$(RM) openra
ifeq ($(shell uname),Linux)
@$(CP) *.sh "$(DATA_INSTALL_DIR)"
endif
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)"
install-linux-icons:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/"
@$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons"
install-linux-desktop:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications"
install-linux-scripts:
@echo "#!/bin/sh" > openra
@echo 'cd "$(gameinstalldir)"' >> openra
@echo 'exec mono OpenRA.Game.exe "$$@"' >> openra
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
@$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)"
@-$(RM) openra
@echo "#!/bin/sh" > openra-editor
@echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra-editor
@echo 'ROOTDIR="$${BINDIR%'"$(bindir)"'}"' >> openra-editor
@echo 'EXECDIR="$${ROOTDIR}'"$(libexecdir)"'"' >> openra-editor
@echo 'cd "$${EXECDIR}/openra"' >> openra-editor
@echo 'cd "$(gameinstalldir)"' >> openra-editor
@echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
@$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)"
@-$(RM) openra-editor
install-shortcuts:
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/"
@$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons"
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
@$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications"
uninstall:
@-$(RM_R) "$(DATA_INSTALL_DIR)"
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra"
@@ -410,8 +414,8 @@ help:
@echo to install with development tools, run:
@echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install-all
@echo
@echo to install Linux desktop files and icons
@echo \ \ make install-shortcuts
@echo to install Linux startup scripts, desktop files and icons
@echo \ \ make install-linux-shortcuts
@echo
@echo to uninstall, run:
@echo \ \ make uninstall

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{47F1B0EE-EB35-47F2-93E4-273C70909157}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>OpenRA</RootNamespace>
<AssemblyName>OpenRA.CrashDialog</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>..\OpenRA.Game\OpenRA.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRA.Game</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -11,15 +11,21 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Media;
using System.Reflection;
using System.Windows.Forms;
namespace OpenRA
namespace OpenRA.CrashDialog
{
public static class FatalErrorDialog
class FatalErrorDialog
{
public static void Show()
static Settings settings;
[STAThread]
public static void Main(string[] args)
{
settings = new Settings(Platform.SupportDir + "settings.yaml", new Arguments());
var form = new Form
{
Size = new Size(315, 140),
@@ -27,7 +33,8 @@ namespace OpenRA
MinimizeBox = false,
MaximizeBox = false,
FormBorderStyle = FormBorderStyle.FixedDialog,
StartPosition = FormStartPosition.CenterScreen
StartPosition = FormStartPosition.CenterScreen,
Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location)
};
var notice = new Label
@@ -76,8 +83,8 @@ namespace OpenRA
form.FormClosed += (sender, e) =>
{
Game.Settings.Debug.ShowFatalErrorDialog = !dontShowAgain.Checked;
Game.Settings.Save();
settings.Debug.ShowFatalErrorDialog = !dontShowAgain.Checked;
settings.Save();
};
SystemSounds.Exclamation.Play();
@@ -88,7 +95,7 @@ namespace OpenRA
{
try
{
Process.Start(Log.LogPath);
Process.Start(Platform.SupportDir + "Logs" + Path.DirectorySeparatorChar);
}
catch { }
}
@@ -97,7 +104,7 @@ namespace OpenRA
{
try
{
Process.Start(Game.Settings.Debug.FatalErrorDialogFaq);
Process.Start(settings.Debug.FatalErrorDialogFaq);
}
catch { }
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -11,7 +11,6 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using OpenRA.FileFormats;
namespace OpenRA.Editor
{

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -9,8 +9,6 @@
#endregion
using System.Linq;
using OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
@@ -40,7 +38,7 @@ namespace OpenRA.Editor
};
}
string NextActorName(Surface surface)
static string NextActorName(Surface surface)
{
var id = 0;
for (;;)

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -11,8 +11,6 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
@@ -39,16 +37,15 @@ namespace OpenRA.Editor
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
{
if (surface.Map.IsInMap(new CVec(u, v) + pos))
var cell = pos + new CVec(u, v);
if (surface.Map.Contains(cell))
{
var z = u + v * template.Size.X;
if (tile[z].Length > 0)
surface.Map.MapTiles.Value[u + pos.X, v + pos.Y] =
new TileReference<ushort, byte>
{
Type = brushTemplate.N,
Index = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4) * 4) : (byte)z,
};
{
var index = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4) * 4) : (byte)z;
surface.Map.MapTiles.Value[cell] = new TerrainTile(brushTemplate.N, index);
}
var ch = new int2((pos.X + u) / Surface.ChunkSize, (pos.Y + v) / Surface.ChunkSize);
if (surface.Chunks.ContainsKey(ch))
@@ -64,7 +61,7 @@ namespace OpenRA.Editor
{
g.DrawImage(brushTemplate.Bitmap,
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
brushTemplate.Bitmap.Width * surface.Zoom,
brushTemplate.Bitmap.Height * surface.Zoom);
}
@@ -72,14 +69,15 @@ namespace OpenRA.Editor
void FloodFillWithBrush(Surface s, CPos pos)
{
var queue = new Queue<CPos>();
var replace = s.Map.MapTiles.Value[pos.X, pos.Y];
var replace = s.Map.MapTiles.Value[pos];
var touched = new bool[s.Map.MapSize.X, s.Map.MapSize.Y];
Action<int, int> maybeEnqueue = (x, y) =>
{
if (s.Map.IsInMap(x, y) && !touched[x, y])
var c = new CPos(x, y);
if (s.Map.Contains(c) && !touched[x, y])
{
queue.Enqueue(new CPos(x, y));
queue.Enqueue(c);
touched[x, y] = true;
}
};
@@ -88,7 +86,7 @@ namespace OpenRA.Editor
while (queue.Count > 0)
{
var p = queue.Dequeue();
if (s.Map.MapTiles.Value[p.X, p.Y].Type != replace.Type)
if (s.Map.MapTiles.Value[p].Type != replace.Type)
continue;
var a = FindEdge(s, p, new CVec(-1, 0), replace);
@@ -96,10 +94,10 @@ namespace OpenRA.Editor
for (var x = a.X; x <= b.X; x++)
{
s.Map.MapTiles.Value[x, p.Y] = new TileReference<ushort, byte> { Type = brushTemplate.N, Index = (byte)0 };
if (s.Map.MapTiles.Value[x, p.Y - 1].Type == replace.Type)
s.Map.MapTiles.Value[new CPos(x, p.Y)] = new TerrainTile(brushTemplate.N, (byte)0);
if (s.Map.MapTiles.Value[new CPos(x, p.Y - 1)].Type == replace.Type)
maybeEnqueue(x, p.Y - 1);
if (s.Map.MapTiles.Value[x, p.Y + 1].Type == replace.Type)
if (s.Map.MapTiles.Value[new CPos(x, p.Y + 1)].Type == replace.Type)
maybeEnqueue(x, p.Y + 1);
}
}
@@ -109,13 +107,13 @@ namespace OpenRA.Editor
s.Chunks.Clear();
}
CPos FindEdge(Surface s, CPos p, CVec d, TileReference<ushort, byte> replace)
static CPos FindEdge(Surface s, CPos p, CVec d, TerrainTile replace)
{
for (;;)
{
var q = p + d;
if (!s.Map.IsInMap(q)) return p;
if (s.Map.MapTiles.Value[q.X, q.Y].Type != replace.Type) return p;
if (!s.Map.Contains(q)) return p;
if (s.Map.MapTiles.Value[q].Type != replace.Type) return p;
p = q;
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -14,7 +14,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Traits;
@@ -25,11 +25,11 @@ namespace OpenRA.Editor
public Form1(string[] args)
{
InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
AppDomain.CurrentDomain.AssemblyResolve += GlobalFileSystem.ResolveAssembly;
currentMod = args.FirstOrDefault() ?? "ra";
toolStripComboBox1.Items.AddRange(Mod.AllMods.Keys.ToArray());
toolStripComboBox1.Items.AddRange(ModMetadata.AllMods.Keys.ToArray());
toolStripComboBox1.SelectedIndexChanged += (_, e) =>
{
@@ -47,8 +47,8 @@ namespace OpenRA.Editor
currentMod = toolStripComboBox1.SelectedItem as string;
Game.modData = new ModData(currentMod);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
GlobalFileSystem.LoadFromManifest(Game.modData.Manifest);
Program.Rules = Game.modData.RulesetCache.LoadDefaultRules();
var mod = Game.modData.Manifest.Mod;
Text = "{0} Mod Version: {1} - OpenRA Editor".F(mod.Title, mod.Version);
@@ -69,7 +69,8 @@ namespace OpenRA.Editor
void OnMapChanged()
{
MakeDirty();
miniMapBox.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
var tileSet = Program.Rules.TileSets[surface1.Map.Tileset];
miniMapBox.Image = Minimap.RenderMapPreview(tileSet, surface1.Map, true);
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
}
@@ -84,10 +85,14 @@ namespace OpenRA.Editor
var objSaved = kv.Value.Save();
// TODO: make this work properly
foreach (var init in Rules.Info[kv.Value.Type].GetInitKeys())
foreach (var init in Program.Rules.Actors[kv.Value.Type].GetInitKeys())
apd.AddRow(init.First,
apd.MakeEditorControl(init.Second,
() => objSaved.NodesDict.ContainsKey(init.First) ? objSaved.NodesDict[init.First].Value : null,
() =>
{
var nodesDict = objSaved.ToDictionary();
return nodesDict.ContainsKey(init.First) ? nodesDict[init.First].Value : null;
},
_ => { }));
apd.ShowDialog();
@@ -120,7 +125,7 @@ namespace OpenRA.Editor
if (map.Players.Count == 0)
map.MakeDefaultPlayers();
PrepareMapResources(Game.modData.Manifest, map);
PrepareMapResources(Game.modData, map);
// Calculate total net worth of resources in cash
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
@@ -135,23 +140,24 @@ namespace OpenRA.Editor
resourcePalette.Controls.Clear();
loadedMapName = null;
PrepareMapResources(Game.modData.Manifest, map);
PrepareMapResources(Game.modData, map);
MakeDirty();
}
// this code is insanely stupid, and mostly my fault -- chrisf
void PrepareMapResources(Manifest manifest, Map map)
void PrepareMapResources(ModData modData, Map map)
{
Rules.LoadRules(manifest, map);
tileset = Rules.TileSets[map.Tileset];
tilesetRenderer = new TileSetRenderer(tileset, manifest.TileSize);
Program.Rules = map.Rules;
tileset = Program.Rules.TileSets[map.Tileset];
tilesetRenderer = new TileSetRenderer(tileset, modData.Manifest.TileSize);
var shadowIndex = new int[] { 3, 4 };
var palette = new Palette(FileSystem.Open(tileset.Palette), shadowIndex);
var palette = new ImmutablePalette(GlobalFileSystem.Open(tileset.Palette), shadowIndex);
// required for desert terrain in RA
var playerPalette = tileset.PlayerPalette ?? tileset.Palette;
var shadowedPalette = new Palette(FileSystem.Open(playerPalette), shadowIndex);
var shadowedPalette = new ImmutablePalette(GlobalFileSystem.Open(playerPalette), shadowIndex);
surface1.Bind(map, tileset, tilesetRenderer, palette, shadowedPalette);
@@ -160,7 +166,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 => templateOrder.ToList().IndexOf(t.Key)))
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category).OrderBy(t => Array.IndexOf(templateOrder, t.Key)))
{
var category = tc.Key ?? "(Uncategorized)";
var categoryHeader = new Label
@@ -208,12 +214,12 @@ namespace OpenRA.Editor
var actorTemplates = new List<ActorTemplate>();
foreach (var a in Rules.Info.Keys)
foreach (var a in Program.Rules.Actors.Keys)
{
try
{
var info = Rules.Info[a];
if (!info.Traits.Contains<RenderSimpleInfo>()) continue;
var info = Program.Rules.Actors[a];
if (!info.Traits.Contains<ILegacyEditorRenderInfo>()) continue;
var etf = info.Traits.GetOrDefault<EditorTilesetFilterInfo>();
if (etf != null && etf.ExcludeTilesets != null
@@ -222,10 +228,10 @@ namespace OpenRA.Editor
&& !etf.RequireTilesets.Contains(tileset.Id)) continue;
var templatePalette = shadowedPalette;
var rsi = info.Traits.GetOrDefault<RenderSimpleInfo>();
var rsi = info.Traits.GetOrDefault<ILegacyEditorRenderInfo>();
// exception for desert buildings
if (rsi != null && rsi.Palette != null && rsi.Palette.Contains("terrain"))
if (rsi != null && rsi.EditorPalette != null && rsi.EditorPalette.Contains("terrain"))
templatePalette = palette;
var template = RenderUtils.RenderActor(info, tileset, templatePalette);
@@ -253,7 +259,7 @@ namespace OpenRA.Editor
var resourceTemplates = new List<ResourceTemplate>();
foreach (var a in Rules.Info["world"].Traits.WithInterface<ResourceTypeInfo>())
foreach (var a in Program.Rules.Actors["world"].Traits.WithInterface<ResourceTypeInfo>())
{
try
{
@@ -286,7 +292,7 @@ namespace OpenRA.Editor
p.ResumeLayout();
}
miniMapBox.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
miniMapBox.Image = Minimap.RenderMapPreview(tileset, surface1.Map, true);
propertiesToolStripMenuItem.Enabled = true;
toolStripMenuItemProperties.Enabled = true;
@@ -305,7 +311,7 @@ namespace OpenRA.Editor
actorOwnerChooser.Items.Clear();
actorOwnerChooser.Items.AddRange(surface1.Map.Players.Values.ToArray());
actorOwnerChooser.SelectedIndex = 0;
surface1.NewActorOwner = (actorOwnerChooser.SelectedItem as PlayerReference).Name;
surface1.NewActorOwner = ((PlayerReference)actorOwnerChooser.SelectedItem).Name;
}
void ResizeClicked(object sender, EventArgs e)
@@ -379,7 +385,7 @@ namespace OpenRA.Editor
nms.ButtonOkay.Text = "Open";
if (DialogResult.OK == nms.ShowDialog())
LoadMap(nms.NewText.Tag as string);
LoadMap((string)nms.NewText.Tag);
}
}
@@ -388,12 +394,12 @@ namespace OpenRA.Editor
using (var nmd = new NewMapDialog())
{
nmd.TheaterBox.Items.Clear();
nmd.TheaterBox.Items.AddRange(Rules.TileSets.Select(a => a.Value.Id).ToArray());
nmd.TheaterBox.Items.AddRange(Program.Rules.TileSets.Select(a => a.Value.Id).ToArray());
nmd.TheaterBox.SelectedIndex = 0;
if (DialogResult.OK == nmd.ShowDialog())
{
var tileset = OpenRA.Rules.TileSets[nmd.TheaterBox.SelectedItem as string];
var tileset = Program.Rules.TileSets[nmd.TheaterBox.SelectedItem as string];
var map = Map.FromTileset(tileset);
map.Resize((int)nmd.MapWidth.Value, (int)nmd.MapHeight.Value);
@@ -402,7 +408,7 @@ namespace OpenRA.Editor
map.Players.Clear();
map.MakeDefaultPlayers();
map.FixOpenAreas();
map.FixOpenAreas(Program.Rules);
NewMap(map);
}
@@ -485,7 +491,7 @@ namespace OpenRA.Editor
void FixOpenAreas(object sender, EventArgs e)
{
dirty = true;
surface1.Map.FixOpenAreas();
surface1.Map.FixOpenAreas(Program.Rules);
surface1.Chunks.Clear();
surface1.Invalidate();
}
@@ -505,7 +511,7 @@ namespace OpenRA.Editor
void DrawPlayerListItem(object sender, DrawItemEventArgs e)
{
// color block
var player = e.Index >= 0 ? (PlayerReference)(sender as ComboBox).Items[e.Index] : null;
var player = e.Index >= 0 ? (PlayerReference)((ComboBox)sender).Items[e.Index] : null;
e.DrawBackground();
e.DrawFocusRectangle();
@@ -533,17 +539,17 @@ namespace OpenRA.Editor
void OpenRAWebsiteToolStripMenuItemClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://www.open-ra.org");
System.Diagnostics.Process.Start("http://www.openra.net");
}
void OpenRAResourcesToolStripMenuItemClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://content.open-ra.org");
System.Diagnostics.Process.Start("http://resource.openra.net");
}
void WikiDocumentationToolStripMenuItemClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/wiki");
System.Diagnostics.Process.Start("http://wiki.openra.net");
}
void DiscussionForumsToolStripMenuItemClick(object sender, EventArgs e)
@@ -553,7 +559,7 @@ namespace OpenRA.Editor
void IssueTrackerToolStripMenuItemClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/issues");
System.Diagnostics.Process.Start("http://bugs.openra.net");
}
void DeveloperBountiesToolStripMenuItemClick(object sender, EventArgs e)
@@ -576,7 +582,7 @@ namespace OpenRA.Editor
void HelpToolStripButton_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/wiki/Mapping");
System.Diagnostics.Process.Start("http://wiki.openra.net/Mapping");
}
void ToolStripMenuItemNewClick(object sender, EventArgs e)
@@ -631,11 +637,12 @@ namespace OpenRA.Editor
public int CalculateTotalResource()
{
int totalResource = 0;
for (int i = 0; i < surface1.Map.MapSize.X; i++)
for (int j = 0; j < surface1.Map.MapSize.Y; j++)
var totalResource = 0;
for (var i = 0; i < surface1.Map.MapSize.X; i++)
for (var j = 0; j < surface1.Map.MapSize.Y; j++)
{
if (surface1.Map.MapResources.Value[i, j].Type != 0)
var cell = new CPos(i, j);
if (surface1.Map.MapResources.Value[cell].Type != 0)
totalResource += GetResourceValue(i, j);
}
@@ -644,13 +651,16 @@ namespace OpenRA.Editor
int GetAdjecentCellsWith(int resourceType, int x, int y)
{
int sum = 0;
var sum = 0;
for (var u = -1; u < 2; u++)
for (var v = -1; v < 2; v++)
{
if (!surface1.Map.IsInMap(new CPos(x + u, y + v)))
var cell = new CPos(x + u, y + v);
if (!surface1.Map.Contains(cell))
continue;
if (surface1.Map.MapResources.Value[x + u, y + v].Type == resourceType)
if (surface1.Map.MapResources.Value[cell].Type == resourceType)
++sum;
}
@@ -659,15 +669,15 @@ namespace OpenRA.Editor
int GetResourceValue(int x, int y)
{
int imageLength = 0;
int type = surface1.Map.MapResources.Value[x, y].Type;
var imageLength = 0;
var type = surface1.Map.MapResources.Value[new CPos(x, y)].Type;
var template = surface1.ResourceTemplates.FirstOrDefault(a => a.Value.Info.ResourceType == type).Value;
if (type == 1)
imageLength = 12;
else if (type == 2)
imageLength = 3;
int density = (GetAdjecentCellsWith(type, x, y) * imageLength - 1) / 9;
int value = template.Info.ValuePerUnit;
var density = (GetAdjecentCellsWith(type, x, y) * imageLength - 1) / 9;
var value = template.Info.ValuePerUnit;
return density * value;
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -47,7 +47,7 @@ namespace OpenRA.Editor
foreach (var map in MapCache.FindMapsIn(MapFolderPath))
{
ListViewItem map1 = new ListViewItem();
var map1 = new ListViewItem();
map1.Tag = map;
map1.Text = Path.GetFileNameWithoutExtension(map);
map1.ImageIndex = 0;
@@ -66,7 +66,7 @@ namespace OpenRA.Editor
NewText.Text = MapList.SelectedItems[0].Text;
NewText.Tag = MapList.SelectedItems[0].Tag;
var map = new Map(NewText.Tag as string);
var map = new Map((string)NewText.Tag);
TitleText.Text = map.Title;
AuthorText.Text = map.Author;
TheaterText.Text = map.Tileset;
@@ -75,7 +75,8 @@ namespace OpenRA.Editor
try
{
MiniMapBox.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
var tileset = Program.Rules.TileSets[map.Tileset];
MiniMapBox.Image = Minimap.RenderMapPreview(tileset, map, true);
}
catch (Exception ed)
{

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Editor</RootNamespace>
<AssemblyName>OpenRA.Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
<FileUpgradeFlags>
@@ -33,45 +32,35 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Eluant">
<HintPath>..\thirdparty\Eluant.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ActorPropertiesDialog.cs">
@@ -167,10 +156,6 @@
<Compile Include="TileSetRenderer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRA.Game</Name>

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -10,18 +10,19 @@
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
namespace OpenRA.Editor
{
static class Program
{
public static Ruleset Rules;
[STAThread]
static void Main(string[] args)
{
Log.AddChannel("perf", null);
Application.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,18 +8,19 @@
*/
#endregion
using System.Collections;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Editor
{
static class RenderUtils
{
static Bitmap RenderShp(ISpriteSource shp, Palette p)
static Bitmap RenderShp(ISpriteSource shp, IPalette p)
{
var frame = shp.Frames.First();
@@ -32,7 +33,7 @@ namespace OpenRA.Editor
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var q = (byte*)data.Scan0.ToPointer();
var stride2 = data.Stride;
for (var i = 0; i < frame.Size.Width; i++)
@@ -44,18 +45,17 @@ namespace OpenRA.Editor
return bitmap;
}
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, Palette p)
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, IPalette p)
{
var image = RenderSprites.GetImage(info);
using (var s = FileSystem.OpenWithExts(image, tileset.Extensions))
var image = info.Traits.Get<ILegacyEditorRenderInfo>().EditorImage(info);
using (var s = GlobalFileSystem.OpenWithExts(image, tileset.Extensions))
{
var shp = new ShpReader(s);
var bitmap = RenderShp(shp, p);
try
{
using (var s2 = FileSystem.OpenWithExts(image + "2", tileset.Extensions))
using (var s2 = GlobalFileSystem.OpenWithExts(image + "2", tileset.Extensions))
{
var shp2 = new ShpReader(s2);
var roofBitmap = RenderShp(shp2, p);
@@ -75,10 +75,10 @@ namespace OpenRA.Editor
}
}
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, string[] exts, Palette p)
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, string[] exts, IPalette p)
{
var image = info.EditorSprite;
using (var s = FileSystem.OpenWithExts(image, exts))
using (var s = GlobalFileSystem.OpenWithExts(image, exts))
{
// TODO: Do this properly
var shp = new ShpReader(s) as ISpriteSource;
@@ -91,7 +91,7 @@ namespace OpenRA.Editor
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var q = (byte*)data.Scan0.ToPointer();
var stride = data.Stride;
for (var i = 0; i < frame.Size.Width; i++)
@@ -100,7 +100,7 @@ namespace OpenRA.Editor
}
bitmap.UnlockBits(data);
return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.Frames.Count() - 1 };
return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.Frames.Count - 1 };
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -9,8 +9,6 @@
#endregion
using System;
using OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
@@ -23,12 +21,9 @@ namespace OpenRA.Editor
public void Apply(Surface surface)
{
surface.Map.MapResources.Value[surface.GetBrushLocation().X, surface.GetBrushLocation().Y]
= new TileReference<byte, byte>
{
Type = (byte)resourceTemplate.Info.ResourceType,
Index = (byte)random.Next(resourceTemplate.Info.MaxDensity)
};
var type = (byte)resourceTemplate.Info.ResourceType;
var index = (byte)random.Next(resourceTemplate.Info.MaxDensity);
surface.Map.MapResources.Value[surface.GetBrushLocation()] = new ResourceTile(type, index);
var ch = new int2(surface.GetBrushLocation().X / Surface.ChunkSize,
surface.GetBrushLocation().Y / Surface.ChunkSize);

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -14,7 +14,8 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Primitives;
using OpenRA.Traits;
using SGraphics = System.Drawing.Graphics;
@@ -44,8 +45,8 @@ namespace OpenRA.Editor
public Map Map { get; private set; }
public TileSet TileSet { get; private set; }
public TileSetRenderer TileSetRenderer { get; private set; }
public Palette Palette { get; private set; }
public Palette PlayerPalette { get; private set; }
public IPalette Palette { get; private set; }
public IPalette PlayerPalette { get; private set; }
public int2 Offset;
public int2 GetOffset() { return Offset; }
@@ -61,8 +62,8 @@ namespace OpenRA.Editor
public bool ShowRuler;
public bool IsPaste { get { return TileSelection != null && ResourceSelection != null; } }
public TileReference<ushort, byte>[,] TileSelection;
public TileReference<byte, byte>[,] ResourceSelection;
public TerrainTile[,] TileSelection;
public ResourceTile[,] ResourceSelection;
public CPos SelectionStart;
public CPos SelectionEnd;
@@ -80,7 +81,7 @@ namespace OpenRA.Editor
public Keys GetModifiers() { return ModifierKeys; }
public void Bind(Map m, TileSet ts, TileSetRenderer tsr, Palette p, Palette pp)
public void Bind(Map m, TileSet ts, TileSetRenderer tsr, IPalette p, IPalette pp)
{
Map = m;
TileSet = ts;
@@ -205,9 +206,9 @@ namespace OpenRA.Editor
var key = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == brushLocation);
if (key.Key != null) Map.Actors.Value.Remove(key.Key);
if (Map.MapResources.Value[brushLocation.X, brushLocation.Y].Type != 0)
if (Map.MapResources.Value[brushLocation].Type != 0)
{
Map.MapResources.Value[brushLocation.X, brushLocation.Y] = new TileReference<byte, byte>();
Map.MapResources.Value[brushLocation] = new ResourceTile(0, 0);
var ch = new int2(brushLocation.X / ChunkSize, brushLocation.Y / ChunkSize);
if (Chunks.ContainsKey(ch))
{
@@ -264,13 +265,14 @@ namespace OpenRA.Editor
unsafe
{
int* p = (int*)data.Scan0.ToPointer();
var p = (int*)data.Scan0.ToPointer();
var stride = data.Stride >> 2;
for (var i = 0; i < ChunkSize; i++)
for (var j = 0; j < ChunkSize; j++)
{
var tr = Map.MapTiles.Value[u * ChunkSize + i, v * ChunkSize + j];
var cell = new CPos(u * ChunkSize + i, v * ChunkSize + j);
var tr = Map.MapTiles.Value[cell];
var tile = TileSetRenderer.Data(tr.Type);
var index = (tr.Index < tile.Count) ? tr.Index : (byte)0;
var rawImage = tile[index];
@@ -278,13 +280,13 @@ namespace OpenRA.Editor
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();
if (Map.MapResources.Value[u * ChunkSize + i, v * ChunkSize + j].Type != 0)
if (Map.MapResources.Value[cell].Type != 0)
{
var resourceImage = ResourceTemplates[Map.MapResources.Value[u * ChunkSize + i, v * ChunkSize + j].Type].Bitmap;
var resourceImage = ResourceTemplates[Map.MapResources.Value[cell].Type].Bitmap;
var srcdata = resourceImage.LockBits(resourceImage.Bounds(),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int* q = (int*)srcdata.Scan0.ToPointer();
var q = (int*)srcdata.Scan0.ToPointer();
var srcstride = srcdata.Stride >> 2;
for (var x = 0; x < TileSetRenderer.TileSize; x++)
@@ -343,10 +345,10 @@ namespace OpenRA.Editor
float2 GetDrawPosition(CPos location, Bitmap bmp, bool centered)
{
float offsetX = centered ? bmp.Width / 2 - TileSetRenderer.TileSize / 2 : 0;
float drawX = TileSetRenderer.TileSize * location.X * Zoom + Offset.X - offsetX;
var drawX = TileSetRenderer.TileSize * location.X * Zoom + Offset.X - offsetX;
float offsetY = centered ? bmp.Height / 2 - TileSetRenderer.TileSize / 2 : 0;
float drawY = TileSetRenderer.TileSize * location.Y * Zoom + Offset.Y - offsetY;
var drawY = TileSetRenderer.TileSize * location.Y * Zoom + Offset.Y - offsetY;
return new float2(drawX, drawY);
}
@@ -377,9 +379,9 @@ namespace OpenRA.Editor
ColorPalette GetPaletteForPlayerInner(string name)
{
var pr = Map.Players[name];
var pcpi = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
var pcpi = Program.Rules.Actors["player"].Traits.Get<PlayerColorPaletteInfo>();
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.Color, pcpi.Ramp);
return new Palette(PlayerPalette, remap).AsSystemPalette();
return new ImmutablePalette(PlayerPalette, remap).AsSystemPalette();
}
Cache<string, ColorPalette> playerPalettes;
@@ -416,8 +418,8 @@ namespace OpenRA.Editor
var drawX = TileSetRenderer.TileSize * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
var drawY = TileSetRenderer.TileSize * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
RectangleF sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
RectangleF destRect = new RectangleF(drawX, drawY, bmp.Width * Zoom, bmp.Height * Zoom);
var sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
var destRect = new RectangleF(drawX, drawY, bmp.Width * Zoom, bmp.Height * Zoom);
e.Graphics.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
}
@@ -466,20 +468,20 @@ namespace OpenRA.Editor
if (ShowRuler && Zoom > 0.2)
{
for (int i = Map.Bounds.Left; i <= Map.Bounds.Right; i += 8)
for (var i = Map.Bounds.Left; i <= Map.Bounds.Right; i += 8)
{
if (i % 8 == 0)
{
PointF point = new PointF(i * TileSetRenderer.TileSize * Zoom + Offset.X, (Map.Bounds.Top - 8) * TileSetRenderer.TileSize * Zoom + Offset.Y);
var point = new PointF(i * TileSetRenderer.TileSize * Zoom + Offset.X, (Map.Bounds.Top - 8) * TileSetRenderer.TileSize * Zoom + Offset.Y);
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
}
}
for (int i = Map.Bounds.Top; i <= Map.Bounds.Bottom; i += 8)
for (var i = Map.Bounds.Top; i <= Map.Bounds.Bottom; i += 8)
{
if (i % 8 == 0)
{
PointF point = new PointF((Map.Bounds.Left - 8) * TileSetRenderer.TileSize * Zoom + Offset.X, i * TileSetRenderer.TileSize * Zoom + Offset.Y);
var point = new PointF((Map.Bounds.Left - 8) * TileSetRenderer.TileSize * Zoom + Offset.X, i * TileSetRenderer.TileSize * Zoom + Offset.Y);
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
}
}
@@ -504,19 +506,20 @@ namespace OpenRA.Editor
if (start == end) return;
int width = Math.Abs((start - end).X);
int height = Math.Abs((start - end).Y);
var width = Math.Abs((start - end).X);
var height = Math.Abs((start - end).Y);
TileSelection = new TileReference<ushort, byte>[width, height];
ResourceSelection = new TileReference<byte, byte>[width, height];
TileSelection = new TerrainTile[width, height];
ResourceSelection = new ResourceTile[width, height];
for (int x = 0; x < width; x++)
for (var x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
for (var y = 0; y < height; y++)
{
// TODO: crash prevention
TileSelection[x, y] = Map.MapTiles.Value[start.X + x, start.Y + y];
ResourceSelection[x, y] = Map.MapResources.Value[start.X + x, start.Y + y];
var cell = new CPos(start.X + x, start.Y + y);
TileSelection[x, y] = Map.MapTiles.Value[cell];
ResourceSelection[x, y] = Map.MapResources.Value[cell];
}
}
}
@@ -527,16 +530,17 @@ namespace OpenRA.Editor
var width = Math.Abs((SelectionStart - SelectionEnd).X);
var height = Math.Abs((SelectionStart - SelectionEnd).Y);
for (int x = 0; x < width; x++)
for (var x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
for (var y = 0; y < height; y++)
{
var mapX = loc.X + x;
var mapY = loc.Y + y;
var cell = new CPos(mapX, mapY);
// TODO: crash prevention for outside of bounds
Map.MapTiles.Value[mapX, mapY] = TileSelection[x, y];
Map.MapResources.Value[mapX, mapY] = ResourceSelection[x, y];
Map.MapTiles.Value[cell] = TileSelection[x, y];
Map.MapResources.Value[cell] = ResourceSelection[x, y];
var ch = new int2(mapX / ChunkSize, mapY / ChunkSize);
if (Chunks.ContainsKey(ch))

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -12,17 +12,17 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
using OpenRA.Graphics;
namespace OpenRA.Editor
{
public class TileSetRenderer
{
public readonly int TileSize;
public TileSet TileSet;
Dictionary<ushort, List<byte[]>> templates;
public readonly int TileSize;
// Extract a square tile that the editor can render
byte[] ExtractSquareTile(ISpriteFrame frame)
@@ -49,7 +49,7 @@ namespace OpenRA.Editor
ISpriteSource source;
if (!sourceCache.ContainsKey(filename))
{
using (var s = FileSystem.OpenWithExts(filename, exts))
using (var s = GlobalFileSystem.OpenWithExts(filename, exts))
source = SpriteSource.LoadSpriteSource(s, filename);
if (source.CacheWhenLoadingTileset)
@@ -61,7 +61,7 @@ namespace OpenRA.Editor
if (frames != null)
{
var ret = new List<byte[]>();
var srcFrames = source.Frames.ToArray();
var srcFrames = source.Frames;
foreach (var i in frames)
ret.Add(ExtractSquareTile(srcFrames[i]));
@@ -82,7 +82,7 @@ namespace OpenRA.Editor
templates.Add(t.Key, LoadTemplate(t.Value.Image, tileset.Extensions, sourceCache, t.Value.Frames));
}
public Bitmap RenderTemplate(ushort id, Palette p)
public Bitmap RenderTemplate(ushort id, IPalette p)
{
var template = TileSet.Templates[id];
var templateData = templates[id];

View File

@@ -1,76 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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.Drawing;
namespace OpenRA
{
/// <summary>
/// Cell coordinate position in the world (coarse).
/// </summary>
public struct CPos
{
public readonly int X, Y;
public CPos(int x, int y) { X = x; Y = y; }
public static readonly CPos Zero = new CPos(0, 0);
public static explicit operator CPos(int2 a) { return new CPos(a.X, a.Y); }
public static CPos operator +(CVec a, CPos b) { return new CPos(a.X + b.X, a.Y + b.Y); }
public static CPos operator +(CPos a, CVec b) { return new CPos(a.X + b.X, a.Y + b.Y); }
public static CPos operator -(CPos a, CVec b) { return new CPos(a.X - b.X, a.Y - b.Y); }
public static CVec operator -(CPos a, CPos b) { return new CVec(a.X - b.X, a.Y - b.Y); }
public static bool operator ==(CPos me, CPos other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(CPos me, CPos other) { return !(me == other); }
public static CPos Max(CPos a, CPos b) { return new CPos(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static CPos Min(CPos a, CPos b) { return new CPos(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public float2 ToFloat2() { return new float2(X, Y); }
public int2 ToInt2() { return new int2(X, Y); }
public WPos CenterPosition { get { return new WPos(1024 * X + 512, 1024 * Y + 512, 0); } }
public WPos TopLeft { get { return new WPos(1024 * X, 1024 * Y, 0); } }
public WPos BottomRight { get { return new WPos(1024 * X + 1023, 1024 * Y + 1023, 0); } }
public CPos Clamp(Rectangle r)
{
return new CPos(Math.Min(r.Right, Math.Max(X, r.Left)),
Math.Min(r.Bottom, Math.Max(Y, r.Top)));
}
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public override bool Equals(object obj)
{
var o = obj as CPos?;
return o != null && o == this;
}
public override string ToString() { return "{0},{1}".F(X, Y); }
}
public static class RectangleExtensions
{
public static CPos TopLeftAsCPos(this Rectangle r) { return new CPos(r.Left, r.Top); }
public static CPos BottomRightAsCPos(this Rectangle r) { return new CPos(r.Right, r.Bottom); }
}
public static class WorldCoordinateExtensions
{
public static CPos ToCPos(this WPos a) { return new CPos(a.X / 1024, a.Y / 1024); }
public static CVec ToCVec(this WVec a) { return new CVec(a.X / 1024, a.Y / 1024); }
}
}

View File

@@ -1,78 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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.FileFormats
{
public static class Format40
{
public static int DecodeInto( byte[] src, byte[] dest )
{
var ctx = new FastByteReader(src);
int destIndex = 0;
while( true )
{
byte i = ctx.ReadByte();
if( ( i & 0x80 ) == 0 )
{
int count = i & 0x7F;
if( count == 0 )
{
// case 6
count = ctx.ReadByte();
byte value = ctx.ReadByte();
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] ^= value;
}
else
{
// case 5
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[destIndex] ^= ctx.ReadByte();
}
}
else
{
int count = i & 0x7F;
if( count == 0 )
{
count = ctx.ReadWord();
if( count == 0 )
return destIndex;
if( ( count & 0x8000 ) == 0 )
{
// case 2
destIndex += ( count & 0x7FFF );
}
else if( ( count & 0x4000 ) == 0 )
{
// case 3
for( int end = destIndex + ( count & 0x3FFF ) ; destIndex < end ; destIndex++ )
dest[destIndex] ^= ctx.ReadByte();
}
else
{
// case 4
byte value = ctx.ReadByte();
for( int end = destIndex + ( count & 0x3FFF ) ; destIndex < end ; destIndex++ )
dest[ destIndex ] ^= value;
}
}
else
{
// case 1
destIndex += count;
}
}
}
}
}
}

View File

@@ -1,74 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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;
namespace OpenRA.FileFormats
{
public class WavLoader
{
public readonly int FileSize;
public readonly string Format;
public readonly int FmtChunkSize;
public readonly int AudioFormat;
public readonly int Channels;
public readonly int SampleRate;
public readonly int ByteRate;
public readonly int BlockAlign;
public readonly int BitsPerSample;
public readonly int DataSize;
public readonly byte[] RawOutput;
public WavLoader(Stream s)
{
while (s.Position < s.Length)
{
if ((s.Position & 1) == 1)
s.ReadByte(); // Alignment
var type = s.ReadASCII(4);
switch (type)
{
case "RIFF":
FileSize = s.ReadInt32();
Format = s.ReadASCII(4);
if (Format != "WAVE")
throw new NotSupportedException("Not a canonical WAVE file.");
break;
case "fmt ":
FmtChunkSize = s.ReadInt32();
if (FmtChunkSize != 16)
throw new NotSupportedException("{0} fmt chunk size is not a supported encoding scheme.".F(FmtChunkSize));
AudioFormat = s.ReadInt16();
if (AudioFormat != 1)
throw new NotSupportedException("Non-PCM compression is not supported.");
Channels = s.ReadInt16();
SampleRate = s.ReadInt32();
ByteRate = s.ReadInt32();
BlockAlign = s.ReadInt16();
BitsPerSample = s.ReadInt16();
break;
case "data":
DataSize = s.ReadInt32();
RawOutput = s.ReadBytes(DataSize);
break;
default:
// Ignore unknown chunks
var chunkSize = s.ReadInt32();
s.ReadBytes(chunkSize);
break;
}
}
}
}
}

View File

@@ -1,78 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
class R8Image : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get; private set; }
public float2 Offset { get; private set; }
public byte[] Data { get; set; }
public R8Image(Stream s)
{
// Scan forward until we find some data
var type = s.ReadUInt8();
while (type == 0)
type = s.ReadUInt8();
var width = s.ReadInt32();
var height = s.ReadInt32();
var x = s.ReadInt32();
var y = s.ReadInt32();
Size = new Size(width, height);
Offset = new int2(width/2 - x, height/2 - y);
/*var imageOffset = */s.ReadInt32();
var paletteOffset = s.ReadInt32();
var bpp = s.ReadUInt8();
if (bpp != 8)
throw new InvalidDataException("Error: {0} bits per pixel are not supported.".F(bpp));
var frameHeight = s.ReadUInt8();
var frameWidth = s.ReadUInt8();
FrameSize = new Size(frameWidth, frameHeight);
// Skip alignment byte
s.ReadUInt8();
Data = s.ReadBytes(width*height);
// Ignore palette
if (type == 1 && paletteOffset != 0)
s.Seek(520, SeekOrigin.Current);
}
}
public class R8Reader : ISpriteSource
{
readonly List<R8Image> frames = new List<R8Image>();
public IEnumerable<ISpriteFrame> Frames { get { return frames.Cast<ISpriteFrame>(); } }
public bool CacheWhenLoadingTileset { get { return true; } }
public readonly int ImageCount;
public R8Reader(Stream stream)
{
while (stream.Position < stream.Length)
{
frames.Add(new R8Image(stream));
ImageCount++;
}
}
}
}

View File

@@ -1,114 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
[Flags] enum FormatFlags : int
{
PaletteTable = 1,
SkipFormat80 = 2,
VariableLengthTable = 4
}
class Frame : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get { return Size; } }
public float2 Offset { get { return float2.Zero; } }
public byte[] Data { get; set; }
public Frame(Stream s)
{
var flags = (FormatFlags)s.ReadUInt16();
s.Position += 1;
var width = s.ReadUInt16();
var height = s.ReadUInt8();
Size = new Size(width, height);
// Subtract header size
var dataLeft = s.ReadUInt16() - 10;
var dataSize = s.ReadUInt16();
byte[] table;
if ((flags & FormatFlags.PaletteTable) != 0)
{
var n = (flags & FormatFlags.VariableLengthTable) != 0 ? s.ReadUInt8() : (byte)16;
table = new byte[n];
for (var i = 0; i < n; i++)
table[i] = s.ReadUInt8();
dataLeft -= n;
}
else
{
table = new byte[256];
for (var i = 0; i < 256; i++)
table[i] = (byte)i;
table[1] = 0x7f;
table[2] = 0x7e;
table[3] = 0x7d;
table[4] = 0x7c;
}
Data = new byte[width * height];
// Decode image data
var compressed = s.ReadBytes(dataLeft);
if ((flags & FormatFlags.SkipFormat80) == 0)
{
var temp = new byte[dataSize];
Format80.DecodeInto(compressed, temp);
compressed = temp;
}
Format2.DecodeInto(compressed, Data, 0);
// Lookup values in lookup table
for (var j = 0; j < Data.Length; j++)
Data[j] = table[Data[j]];
}
}
public class ShpD2Reader : ISpriteSource
{
List<Frame> headers = new List<Frame>();
public IEnumerable<ISpriteFrame> Frames { get { return headers.Cast<ISpriteFrame>(); } }
public bool CacheWhenLoadingTileset { get { return false; } }
public ShpD2Reader(Stream s)
{
var imageCount = s.ReadUInt16();
// Last offset is pointer to end of file.
var offsets = new uint[imageCount + 1];
var temp = s.ReadUInt32();
// If fourth byte in file is non-zero, the offsets are two bytes each.
var twoByteOffset = (temp & 0xFF0000) > 0;
s.Position = 2;
for (var i = 0; i < imageCount + 1; i++)
offsets[i] = (twoByteOffset ? s.ReadUInt16() : s.ReadUInt32()) + 2;
for (var i = 0; i < imageCount; i++)
{
s.Position = offsets[i];
headers.Add(new Frame(s));
}
}
}
}

View File

@@ -1,99 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
class FrameHeader : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get; private set; }
public float2 Offset { get; private set; }
public byte[] Data { get; set; }
public readonly uint FileOffset;
public readonly byte Format;
public FrameHeader(Stream stream, Size frameSize)
{
var x = stream.ReadUInt16();
var y = stream.ReadUInt16();
var width = stream.ReadUInt16();
var height = stream.ReadUInt16();
Offset = new float2(x + 0.5f * (width - frameSize.Width), y + 0.5f * (height - frameSize.Height));
Size = new Size(width, height);
FrameSize = frameSize;
Format = stream.ReadUInt8();
stream.Position += 11;
FileOffset = stream.ReadUInt32();
}
}
public class ShpTSReader : ISpriteSource
{
readonly List<FrameHeader> frames = new List<FrameHeader>();
public IEnumerable<ISpriteFrame> Frames { get { return frames.Cast<ISpriteFrame>(); } }
public bool CacheWhenLoadingTileset { get { return false; } }
public ShpTSReader(Stream stream)
{
stream.ReadUInt16();
var width = stream.ReadUInt16();
var height = stream.ReadUInt16();
var size = new Size(width, height);
var frameCount = stream.ReadUInt16();
for (var i = 0; i < frameCount; i++)
frames.Add(new FrameHeader(stream, size));
for (var i = 0; i < frameCount; i++)
{
var f = frames[i];
if (f.FileOffset == 0)
continue;
stream.Position = f.FileOffset;
// Uncompressed
if (f.Format == 1 || f.Format == 0)
f.Data = stream.ReadBytes(f.Size.Width * f.Size.Height);
// Uncompressed scanlines
else if (f.Format == 2)
{
f.Data = new byte[f.Size.Width * f.Size.Height];
for (var j = 0; j < f.Size.Height; j++)
{
var length = stream.ReadUInt16() - 2;
stream.Read(f.Data, f.Size.Width * j, length);
}
}
// RLE-zero compressed scanlines
else if (f.Format == 3)
{
f.Data = new byte[f.Size.Width * f.Size.Height];
for (var j = 0; j < f.Size.Height; j++)
{
var length = stream.ReadUInt16() - 2;
Format2.DecodeInto(stream.ReadBytes(length), f.Data, j * f.Size.Width);
}
}
}
}
}
}

View File

@@ -1,93 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
// Describes what is to be loaded in order to run a mod
public class Manifest
{
public readonly Mod Mod;
public readonly string[]
Folders, MapFolders, Rules, ServerTraits,
Sequences, VoxelSequences, Cursors, Chrome, Assemblies, ChromeLayout,
Weapons, Voices, Notifications, Music, Movies, Translations, TileSets,
ChromeMetrics, PackageContents, LuaScripts, MapCompatibility;
public readonly Dictionary<string, string> Packages;
public readonly MiniYaml LoadScreen;
public readonly MiniYaml LobbyDefaults;
public readonly Dictionary<string, Pair<string, int>> Fonts;
public readonly Size TileSize = new Size(24, 24);
public Manifest(string mod)
{
var path = new[] { "mods", mod, "mod.yaml" }.Aggregate(Path.Combine);
var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).NodesDict;
Mod = FieldLoader.Load<Mod>(yaml["Metadata"]);
Mod.Id = mod;
// TODO: Use fieldloader
Folders = YamlList(yaml, "Folders");
MapFolders = YamlList(yaml, "MapFolders");
Packages = yaml["Packages"].NodesDict.ToDictionary(x => x.Key, x => x.Value.Value);
Rules = YamlList(yaml, "Rules");
ServerTraits = YamlList(yaml, "ServerTraits");
Sequences = YamlList(yaml, "Sequences");
VoxelSequences = YamlList(yaml, "VoxelSequences");
Cursors = YamlList(yaml, "Cursors");
Chrome = YamlList(yaml, "Chrome");
Assemblies = YamlList(yaml, "Assemblies");
ChromeLayout = YamlList(yaml, "ChromeLayout");
Weapons = YamlList(yaml, "Weapons");
Voices = YamlList(yaml, "Voices");
Notifications = YamlList(yaml, "Notifications");
Music = YamlList(yaml, "Music");
Movies = YamlList(yaml, "Movies");
Translations = YamlList(yaml, "Translations");
TileSets = YamlList(yaml, "TileSets");
ChromeMetrics = YamlList(yaml, "ChromeMetrics");
PackageContents = YamlList(yaml, "PackageContents");
LuaScripts = YamlList(yaml, "LuaScripts");
LoadScreen = yaml["LoadScreen"];
LobbyDefaults = yaml["LobbyDefaults"];
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key,
x => Pair.New(x.Value.NodesDict["Font"].Value,
int.Parse(x.Value.NodesDict["Size"].Value)));
if (yaml.ContainsKey("TileSize"))
TileSize = FieldLoader.GetValue<Size>("TileSize", yaml["TileSize"].Value);
// Allow inherited mods to import parent maps.
var compat = new List<string>();
compat.Add(mod);
if (yaml.ContainsKey("SupportsMapsFrom"))
foreach (var c in yaml["SupportsMapsFrom"].Value.Split(','))
compat.Add(c.Trim());
MapCompatibility = compat.ToArray();
}
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
{
if (!yaml.ContainsKey(key))
return new string[] { };
return yaml[key].NodesDict.Keys.ToArray();
}
}
}

View File

@@ -1,26 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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.FileFormats
{
public struct TileReference<T, U>
{
public T Type;
public U Index;
public TileReference(T t, U i)
{
Type = t;
Index = i;
}
public override int GetHashCode() { return Type.GetHashCode() ^ Index.GetHashCode(); }
}
}

View File

@@ -1,143 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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;
using System.Reflection;
namespace OpenRA.FileFormats
{
public class TerrainTypeInfo
{
public string Type;
public string[] TargetTypes = { };
public string[] AcceptsSmudgeType = { };
public bool IsWater = false; // TODO: Remove this
public Color Color;
public string CustomCursor;
public TerrainTypeInfo() { }
public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); }
public MiniYaml Save() { return FieldSaver.Save(this); }
}
public class TileTemplate
{
public ushort Id;
public string Image;
public int[] Frames;
public int2 Size;
public bool PickAny;
public string Category;
[FieldLoader.LoadUsing("LoadTiles")]
public Dictionary<byte, string> Tiles = new Dictionary<byte, string>();
public TileTemplate() { }
public TileTemplate(MiniYaml my) { FieldLoader.Load(this, my); }
static object LoadTiles(MiniYaml y)
{
return y.NodesDict["Tiles"].NodesDict.ToDictionary(
t => byte.Parse(t.Key),
t => t.Value.Value);
}
static readonly string[] Fields = { "Id", "Image", "Frames", "Size", "PickAny" };
public MiniYaml Save()
{
var root = new List<MiniYamlNode>();
foreach (var field in Fields)
{
FieldInfo f = this.GetType().GetField(field);
if (f.GetValue(this) == null)
continue;
root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f)));
}
root.Add(new MiniYamlNode("Tiles", null,
Tiles.Select(x => new MiniYamlNode(x.Key.ToString(), x.Value)).ToList()));
return new MiniYaml(null, root);
}
}
public class TileSet
{
public string Name;
public string Id;
public int SheetSize = 512;
public string Palette;
public string PlayerPalette;
public string[] Extensions;
public int WaterPaletteRotationBase = 0x60;
public Dictionary<string, TerrainTypeInfo> Terrain = new Dictionary<string, TerrainTypeInfo>();
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
public string[] EditorTemplateOrder;
static readonly string[] Fields = { "Name", "Id", "SheetSize", "Palette", "Extensions" };
public TileSet() { }
public TileSet(string filepath)
{
var yaml = MiniYaml.DictFromFile(filepath);
// General info
FieldLoader.Load(this, yaml["General"]);
// TerrainTypes
Terrain = yaml["Terrain"].NodesDict.Values
.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type);
// Templates
Templates = yaml["Templates"].NodesDict.Values
.Select(y => new TileTemplate(y)).ToDictionary(t => t.Id);
}
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("Terrain", null,
Terrain.Select(t => new MiniYamlNode("TerrainType@{0}".F(t.Value.Type), t.Value.Save())).ToList()));
root.Add(new MiniYamlNode("Templates", null,
Templates.Select(t => new MiniYamlNode("Template@{0}".F(t.Value.Id), t.Value.Save())).ToList()));
root.WriteToFile(filepath);
}
public string GetTerrainType(TileReference<ushort, byte> r)
{
var tt = Templates[r.Type].Tiles;
string ret;
if (!tt.TryGetValue(r.Index, out ret))
return "Clear"; // Default walkable
return ret;
}
}
}

View File

@@ -1,186 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.FileFormats</RootNamespace>
<AssemblyName>OpenRA.FileFormats</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Tao.Sdl, Version=1.2.13.0, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\Tao\Tao.Sdl.dll</HintPath>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Evaluator.cs" />
<Compile Include="Exts.cs" />
<Compile Include="FieldLoader.cs" />
<Compile Include="FieldSaver.cs" />
<Compile Include="FileFormats\AudLoader.cs" />
<Compile Include="FileFormats\Blast.cs" />
<Compile Include="FileFormats\Blowfish.cs" />
<Compile Include="FileFormats\BlowfishKeyProvider.cs" />
<Compile Include="FileFormats\CRC32.cs" />
<Compile Include="FileFormats\Format2.cs" />
<Compile Include="FileFormats\Format40.cs" />
<Compile Include="FileFormats\Format80.cs" />
<Compile Include="FileFormats\IniFile.cs" />
<Compile Include="Graphics\IGraphicsDevice.cs" />
<Compile Include="Graphics\IInputHandler.cs" />
<Compile Include="Graphics\PngLoader.cs" />
<Compile Include="Graphics\ShpReader.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="Graphics\VqaReader.cs" />
<Compile Include="InstallUtils.cs" />
<Compile Include="Manifest.cs" />
<Compile Include="Map\PlayerReference.cs" />
<Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\TileReference.cs" />
<Compile Include="Map\TileSet.cs" />
<Compile Include="MiniYaml.cs" />
<Compile Include="Mod.cs" />
<Compile Include="PackageEntry.cs" />
<Compile Include="Palette.cs" />
<Compile Include="Platform.cs" />
<Compile Include="PlayerColorRemap.cs" />
<Compile Include="Primitives\ActionQueue.cs" />
<Compile Include="Primitives\Bits.cs" />
<Compile Include="Primitives\Cache.cs" />
<Compile Include="Primitives\Cached.cs" />
<Compile Include="Primitives\DisposableAction.cs" />
<Compile Include="Primitives\IObservableCollection.cs" />
<Compile Include="Primitives\Lazy.cs" />
<Compile Include="Primitives\ObservableCollection.cs" />
<Compile Include="Primitives\ObservableDictionary.cs" />
<Compile Include="Primitives\Pair.cs" />
<Compile Include="Primitives\PriorityQueue.cs" />
<Compile Include="Primitives\Set.cs" />
<Compile Include="Primitives\float2.cs" />
<Compile Include="Primitives\int2.cs" />
<Compile Include="Support\Log.cs" />
<Compile Include="Support\Stopwatch.cs" />
<Compile Include="Support\Timer.cs" />
<Compile Include="Random.cs" />
<Compile Include="TypeDictionary.cs" />
<Compile Include="WPos.cs" />
<Compile Include="WVec.cs" />
<Compile Include="WAngle.cs" />
<Compile Include="WRot.cs" />
<Compile Include="WRange.cs" />
<Compile Include="HSLColor.cs" />
<Compile Include="Graphics\ShpTSReader.cs" />
<Compile Include="FileFormats\XccLocalDatabase.cs" />
<Compile Include="FileFormats\XccGlobalDatabase.cs" />
<Compile Include="Graphics\VxlReader.cs" />
<Compile Include="Graphics\HvaReader.cs" />
<Compile Include="StreamExts.cs" />
<Compile Include="FileFormats\WavLoader.cs" />
<Compile Include="Graphics\R8Reader.cs" />
<Compile Include="Keycode.cs" />
<Compile Include="Hotkey.cs" />
<Compile Include="FileSystem\FileSystem.cs" />
<Compile Include="FileSystem\Folder.cs" />
<Compile Include="FileSystem\InstallShieldPackage.cs" />
<Compile Include="FileSystem\MixFile.cs" />
<Compile Include="FileSystem\ZipFile.cs" />
<Compile Include="FileSystem\D2kSoundResources.cs" />
<Compile Include="Graphics\SpriteSource.cs" />
<Compile Include="Graphics\TmpRAReader.cs" />
<Compile Include="Graphics\TmpTDReader.cs" />
<Compile Include="Graphics\ShpD2Reader.cs" />
<Compile Include="FileSystem\Pak.cs" />
<Compile Include="CPos.cs" />
<Compile Include="CVec.cs" />
<Compile Include="Graphics\TmpTSReader.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,126 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2012 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.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
namespace OpenRA.FileFormats
{
public class Palette
{
public static Palette Load(string filename, int[] remap)
{
using (var s = File.OpenRead(filename))
return new Palette(s, remap);
}
uint[] colors;
public Color GetColor(int index)
{
return Color.FromArgb((int)colors[index]);
}
public void SetColor(int index, Color color)
{
colors[index] = (uint)color.ToArgb();
}
public void SetColor(int index, uint color)
{
colors[index] = (uint)color;
}
public uint[] Values
{
get { return colors; }
}
public void ApplyRemap(IPaletteRemap r)
{
for (int i = 0; i < 256; i++)
colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)colors[i]), i).ToArgb();
}
public Palette(Stream s, int[] remapShadow)
{
colors = new uint[256];
using (BinaryReader reader = new BinaryReader(s))
{
for (int i = 0; i < 256; i++)
{
byte r = (byte)(reader.ReadByte() << 2);
byte g = (byte)(reader.ReadByte() << 2);
byte b = (byte)(reader.ReadByte() << 2);
colors[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
}
colors[0] = 0; // convert black background to transparency
foreach (int i in remapShadow)
colors[i] = 140u << 24;
}
public Palette(Palette p, IPaletteRemap r)
{
colors = (uint[])p.colors.Clone();
ApplyRemap(r);
}
public Palette(Palette p)
{
colors = (uint[])p.colors.Clone();
}
public Palette(uint[] data)
{
if (data.Length != 256)
throw new InvalidDataException("Attempting to create palette with incorrect array size");
colors = (uint[])data.Clone();
}
public ColorPalette AsSystemPalette()
{
ColorPalette pal;
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
pal = b.Palette;
for (var i = 0; i < 256; i++)
pal.Entries[i] = GetColor(i);
// hack around a mono bug -- the palette flags get set wrong.
if (Platform.CurrentPlatform != PlatformType.Windows)
typeof(ColorPalette).GetField("flags",
BindingFlags.Instance | BindingFlags.NonPublic).SetValue(pal, 1);
return pal;
}
public Bitmap AsBitmap()
{
var b = new Bitmap(256, 1, PixelFormat.Format32bppArgb);
var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
uint* c = (uint*)data.Scan0;
for (var x = 0; x < 256; x++)
*(c + x) = colors[x];
}
b.UnlockBits(data);
return b;
}
}
public interface IPaletteRemap { Color GetRemappedColor(Color original, int index); }
}

View File

@@ -1,53 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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;
using System.Collections.Generic;
namespace OpenRA.FileFormats
{
public class Cache<T, U> : IEnumerable<KeyValuePair<T, U>>
{
Dictionary<T, U> hax;
Func<T,U> loader;
public Cache(Func<T,U> loader, IEqualityComparer<T> c)
{
hax = new Dictionary<T, U>(c);
if (loader == null)
throw new ArgumentNullException();
this.loader = loader;
}
public Cache(Func<T, U> loader)
: this(loader, EqualityComparer<T>.Default) { }
public U this[T key]
{
get
{
U result;
if (!hax.TryGetValue(key, out result))
hax.Add(key, result = loader(key));
return result;
}
}
public IEnumerator<KeyValuePair<T, U>> GetEnumerator() { return hax.GetEnumerator(); }
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
public IEnumerable<T> Keys { get { return hax.Keys; } }
public IEnumerable<U> Values { get { return hax.Values; } }
}
}

View File

@@ -1,55 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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;
namespace OpenRA.FileFormats
{
public class Cached<T>
{
Func<T> p;
T value;
bool hasValue;
public Cached(Func<T> p)
{
if (p == null)
throw new ArgumentNullException();
this.p = p;
}
public T Value
{
get
{
if (hasValue)
return value;
value = p();
hasValue = true;
return value;
}
}
public T Force() { return Value; }
public void Invalidate()
{
hasValue = false;
}
}
public static class Cached
{
public static Cached<T> New<T>(Func<T> p) { return new Cached<T>(p); }
}
}

View File

@@ -1,48 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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;
namespace OpenRA.FileFormats
{
public class Lazy<T>
{
Func<T> p;
T value;
public Lazy(Func<T> p)
{
if (p == null)
throw new ArgumentNullException();
this.p = p;
}
public T Value
{
get
{
if (p == null)
return value;
value = p();
p = null;
return value;
}
}
public T Force() { return Value; }
}
public static class Lazy
{
public static Lazy<T> New<T>(Func<T> p) { return new Lazy<T>(p); }
}
}

View File

@@ -1,56 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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;
using System.Collections.Generic;
namespace OpenRA.FileFormats
{
public class Set<T> : IEnumerable<T>
{
Dictionary<T, bool> data = new Dictionary<T, bool>();
public void Add( T obj )
{
data.Add( obj, false );
if( OnAdd != null )
OnAdd( obj );
}
public void Remove( T obj )
{
data.Remove( obj );
if( OnRemove != null )
OnRemove( obj );
}
public event Action<T> OnAdd;
public event Action<T> OnRemove;
public IEnumerator<T> GetEnumerator()
{
return data.Keys.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public bool Contains( T obj ) { return data.ContainsKey(obj); }
public Set( params T[] ts )
{
foreach( var t in ts )
Add(t);
}
}
}

View File

@@ -1,349 +0,0 @@
<StyleCopSettings Version="105">
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="ElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="EnumerationItemsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustContainValidXml">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="VoidReturnValueMustNotBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustNotBeEmpty">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustContainWhitespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustMeetCharacterPercentage">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludedDocumentationXPathDoesNotExist">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveCopyrightText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="TabsMustNotBeUsed">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StatementMustNotBeOnSingleLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementMustNotBeOnSingleLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CurlyBracketsMustNotBeOmitted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeSeparatedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ChainedStatementBlocksMustNotBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseStringEmptyForEmptyStrings">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixCallsCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterMustFollowComma">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="AccessModifierMustBeDeclared">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldsMustBePrivate">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>

View File

@@ -1,31 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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.Support
{
public class Stopwatch
{
System.Diagnostics.Stopwatch sw;
public Stopwatch ()
{
Reset();
}
public double ElapsedTime()
{
return sw.Elapsed.TotalMilliseconds / 1000.0;
}
public void Reset()
{
sw = System.Diagnostics.Stopwatch.StartNew();
}
}
}

View File

@@ -1,27 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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.Support
{
public static class Timer
{
static Stopwatch sw = new Stopwatch();
static double lastTime = 0;
public static void Time( string message )
{
var time = sw.ElapsedTime();
var dt = time - lastTime;
if( dt > 0.0001 )
Log.Write("perf", message, dt );
lastTime = time;
}
}
}

View File

@@ -1,99 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 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
{
/// <summary>
/// 1d world distance - 1024 units = 1 cell.
/// </summary>
public struct WRange : IComparable, IComparable<WRange>
{
public readonly int Range;
public WRange(int r) { Range = r; }
public static readonly WRange Zero = new WRange(0);
public static WRange FromCells(int cells) { return new WRange(1024*cells); }
public static WRange operator +(WRange a, WRange b) { return new WRange(a.Range + b.Range); }
public static WRange operator -(WRange a, WRange b) { return new WRange(a.Range - b.Range); }
public static WRange operator -(WRange a) { return new WRange(-a.Range); }
public static WRange operator /(WRange a, int b) { return new WRange(a.Range / b); }
public static WRange operator *(WRange a, int b) { return new WRange(a.Range * b); }
public static WRange operator *(int a, WRange b) { return new WRange(a * b.Range); }
public static bool operator ==(WRange me, WRange other) { return (me.Range == other.Range); }
public static bool operator !=(WRange me, WRange other) { return !(me == other); }
// Sampled a N-sample probability density function in the range [-1024..1024]
// 1 sample produces a rectangular probability
// 2 samples produces a triangular probability
// ...
// N samples approximates a true gaussian
public static WRange FromPDF(Thirdparty.Random r, int samples)
{
return new WRange(Exts.MakeArray(samples, _ => r.Next(-1024, 1024))
.Sum() / samples);
}
public static bool TryParse(string s, out WRange result)
{
s = s.ToLowerInvariant();
var components = s.Split('c');
int cell = 0;
int subcell = 0;
result = WRange.Zero;
switch (components.Length)
{
case 2:
if (!int.TryParse(components[0], out cell) ||
!int.TryParse(components[1], out subcell))
return false;
break;
case 1:
if (!int.TryParse(components[0], out subcell))
return false;
break;
default: return false;
}
// Propagate sign to fractional part
if (cell < 0)
subcell = -subcell;
result = new WRange(1024*cell + subcell);
return true;
}
public override int GetHashCode() { return Range.GetHashCode(); }
public override bool Equals(object obj)
{
var o = obj as WRange?;
return o != null && o == this;
}
public int CompareTo(object obj)
{
var o = obj as WRange?;
if (o == null)
return 1;
return Range.CompareTo(o.Value.Range);
}
public int CompareTo(WRange other) { return Range.CompareTo(other.Range); }
public override string ToString() { return "{0}".F(Range); }
}
}

95
OpenRA.Game/Actor.cs Executable file → Normal file
View File

@@ -12,13 +12,16 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using Eluant;
using Eluant.ObjectBinding;
using OpenRA.Graphics;
using OpenRA.Primitives;
using OpenRA.Scripting;
using OpenRA.Traits;
namespace OpenRA
{
public class Actor
public class Actor : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILuaEqualityBinding, ILuaToStringBinding, IEquatable<Actor>
{
public readonly ActorInfo Info;
@@ -62,30 +65,27 @@ namespace OpenRA
if (initDict.Contains<OwnerInit>())
Owner = init.Get<OwnerInit, Player>();
occupySpace = Lazy.New(() => TraitOrDefault<IOccupySpace>());
occupySpace = Exts.Lazy(() => TraitOrDefault<IOccupySpace>());
if (name != null)
{
if (!Rules.Info.ContainsKey(name.ToLowerInvariant()))
if (!world.Map.Rules.Actors.ContainsKey(name.ToLowerInvariant()))
throw new NotImplementedException("No rules definition for unit {0}".F(name.ToLowerInvariant()));
Info = Rules.Info[name.ToLowerInvariant()];
Info = world.Map.Rules.Actors[name.ToLowerInvariant()];
foreach (var trait in Info.TraitsInConstructOrder())
AddTrait(trait.Create(init));
}
facing = Lazy.New(() => TraitOrDefault<IFacing>());
health = Lazy.New(() => TraitOrDefault<Health>());
effectiveOwner = Lazy.New(() => TraitOrDefault<IEffectiveOwner>());
facing = Exts.Lazy(() => TraitOrDefault<IFacing>());
health = Exts.Lazy(() => TraitOrDefault<Health>());
effectiveOwner = Exts.Lazy(() => TraitOrDefault<IEffectiveOwner>());
applyIRender = (x, wr) => x.Render(this, wr);
applyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m);
Bounds = Lazy.New(() =>
Bounds = Exts.Lazy(() =>
{
var si = Info.Traits.GetOrDefault<SelectableInfo>();
var size = (si != null && si.Bounds != null) ? new int2(si.Bounds[0], si.Bounds[1]) :
TraitsImplementing<IAutoSelectionSize>().Select(x => x.SelectionSize(this)).FirstOrDefault();
TraitsImplementing<IAutoSelectionSize>().Select(x => x.SelectionSize(this)).FirstOrDefault();
var offset = -size / 2;
if (si != null && si.Bounds != null && si.Bounds.Length > 2)
@@ -109,14 +109,19 @@ namespace OpenRA
get { return currentActivity == null; }
}
// note: these delegates are cached to avoid massive allocation.
Func<IRender, WorldRenderer, IEnumerable<IRenderable>> applyIRender;
Func<IEnumerable<IRenderable>, IRenderModifier, WorldRenderer, IEnumerable<IRenderable>> applyRenderModifier;
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
var mods = TraitsImplementing<IRenderModifier>();
var sprites = TraitsImplementing<IRender>().SelectMany(x => applyIRender(x, wr));
return mods.Aggregate(sprites, (m, p) => applyRenderModifier(m, p, wr));
var renderables = Renderables(wr);
foreach (var modifier in TraitsImplementing<IRenderModifier>())
renderables = modifier.ModifyRender(this, wr, renderables);
return renderables;
}
IEnumerable<IRenderable> Renderables(WorldRenderer wr)
{
foreach (var render in TraitsImplementing<IRender>())
foreach (var renderable in render.Render(this, wr))
yield return renderable;
}
public bool IsInWorld { get; internal set; }
@@ -155,7 +160,12 @@ namespace OpenRA
public override bool Equals(object obj)
{
var o = obj as Actor;
return o != null && o.ActorID == ActorID;
return o != null && Equals(o);
}
public bool Equals(Actor other)
{
return ActorID == other.ActorID;
}
public override string ToString()
@@ -194,9 +204,12 @@ namespace OpenRA
{
World.AddFrameEndTask(w =>
{
if (Destroyed) return;
if (Destroyed)
return;
if (IsInWorld)
World.Remove(this);
World.Remove(this);
World.traitDict.RemoveActor(this);
Destroyed = true;
});
@@ -207,6 +220,9 @@ namespace OpenRA
{
World.AddFrameEndTask(w =>
{
if (this.Destroyed)
return;
var oldOwner = Owner;
// momentarily remove from world so the ownership queries don't get confused
@@ -240,5 +256,40 @@ namespace OpenRA
health.Value.InflictDamage(this, attacker, health.Value.MaxHP, null, true);
}
#region Scripting interface
Lazy<ScriptActorInterface> luaInterface;
public void OnScriptBind(ScriptContext context)
{
luaInterface = Exts.Lazy(() => new ScriptActorInterface(context, this));
}
public LuaValue this[LuaRuntime runtime, LuaValue keyValue]
{
get { return luaInterface.Value[runtime, keyValue]; }
set { luaInterface.Value[runtime, keyValue] = value; }
}
public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right)
{
Actor a, b;
if (!left.TryGetClrValue<Actor>(out a) || !right.TryGetClrValue<Actor>(out b))
return false;
return a == b;
}
public LuaValue ToString(LuaRuntime runtime)
{
return "Actor ({0})".F(this);
}
public bool HasScriptProperty(string name)
{
return luaInterface.Value.ContainsKey(name);
}
#endregion
}
}

104
OpenRA.Game/CPos.cs Normal file
View File

@@ -0,0 +1,104 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.Drawing;
using Eluant;
using Eluant.ObjectBinding;
using OpenRA.Scripting;
namespace OpenRA
{
public struct CPos : IScriptBindable, ILuaAdditionBinding, ILuaSubtractionBinding, ILuaEqualityBinding, ILuaTableBinding, IEquatable<CPos>
{
public readonly int X, Y;
public CPos(int x, int y) { X = x; Y = y; }
public static readonly CPos Zero = new CPos(0, 0);
public static explicit operator CPos(int2 a) { return new CPos(a.X, a.Y); }
public static CPos operator +(CVec a, CPos b) { return new CPos(a.X + b.X, a.Y + b.Y); }
public static CPos operator +(CPos a, CVec b) { return new CPos(a.X + b.X, a.Y + b.Y); }
public static CPos operator -(CPos a, CVec b) { return new CPos(a.X - b.X, a.Y - b.Y); }
public static CVec operator -(CPos a, CPos b) { return new CVec(a.X - b.X, a.Y - b.Y); }
public static bool operator ==(CPos me, CPos other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(CPos me, CPos other) { return !(me == other); }
public static CPos Max(CPos a, CPos b) { return new CPos(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static CPos Min(CPos a, CPos b) { return new CPos(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public CPos Clamp(Rectangle r)
{
return new CPos(Math.Min(r.Right, Math.Max(X, r.Left)),
Math.Min(r.Bottom, Math.Max(Y, r.Top)));
}
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public bool Equals(CPos other) { return other == this; }
public override bool Equals(object obj) { return obj is CPos && Equals((CPos)obj); }
public override string ToString() { return X + "," + Y; }
#region Scripting interface
public LuaValue Add(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CPos a;
CVec b;
if (!left.TryGetClrValue<CPos>(out a) || !right.TryGetClrValue<CVec>(out b))
throw new LuaException("Attempted to call CPos.Add(CPos, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name));
return new LuaCustomClrObject(a + b);
}
public LuaValue Subtract(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CPos a;
CVec b;
if (!left.TryGetClrValue<CPos>(out a) || !right.TryGetClrValue<CVec>(out b))
throw new LuaException("Attempted to call CPos.Subtract(CPos, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name));
return new LuaCustomClrObject(a - b);
}
public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CPos a, b;
if (!left.TryGetClrValue<CPos>(out a) || !right.TryGetClrValue<CPos>(out b))
return false;
return a == b;
}
public LuaValue this[LuaRuntime runtime, LuaValue key]
{
get
{
switch (key.ToString())
{
case "X": return X;
case "Y": return Y;
default: throw new LuaException("CPos does not define a member '{0}'".F(key));
}
}
set
{
throw new LuaException("CPos is read-only. Use CPos.New to create a new value");
}
}
#endregion
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -10,24 +10,19 @@
using System;
using System.Drawing;
using Eluant;
using Eluant.ObjectBinding;
using OpenRA.Scripting;
namespace OpenRA
{
/// <summary>
/// Cell coordinate vector (coarse).
/// </summary>
public struct CVec
public struct CVec : IScriptBindable, ILuaAdditionBinding, ILuaSubtractionBinding, ILuaUnaryMinusBinding, ILuaEqualityBinding, ILuaTableBinding, IEquatable<CVec>
{
public readonly int X, Y;
public CVec(int x, int y) { X = x; Y = y; }
public CVec(Size p) { X = p.Width; Y = p.Height; }
public static readonly CVec Zero = new CVec(0, 0);
public static explicit operator CVec(int2 a) { return new CVec(a.X, a.Y); }
public static explicit operator CVec(float2 a) { return new CVec((int)a.X, (int)a.Y); }
public static CVec operator +(CVec a, CVec b) { return new CVec(a.X + b.X, a.Y + b.Y); }
public static CVec operator -(CVec a, CVec b) { return new CVec(a.X - b.X, a.Y - b.Y); }
public static CVec operator *(int a, CVec b) { return new CVec(a * b.X, a * b.Y); }
@@ -47,11 +42,7 @@ namespace OpenRA
public CVec Sign() { return new CVec(Math.Sign(X), Math.Sign(Y)); }
public CVec Abs() { return new CVec(Math.Abs(X), Math.Abs(Y)); }
public int LengthSquared { get { return X * X + Y * Y; } }
public int Length { get { return (int)Math.Sqrt(LengthSquared); } }
public float2 ToFloat2() { return new float2(X, Y); }
public int2 ToInt2() { return new int2(X, Y); }
public WVec ToWVec() { return new WVec(X*1024, Y*1024, 0); }
public int Length { get { return Exts.ISqrt(LengthSquared); } }
public CVec Clamp(Rectangle r)
{
@@ -63,13 +54,10 @@ namespace OpenRA
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public override bool Equals(object obj)
{
var o = obj as CVec?;
return o != null && o == this;
}
public bool Equals(CVec other) { return other == this; }
public override bool Equals(object obj) { return obj is CVec && Equals((CVec)obj); }
public override string ToString() { return "{0},{1}".F(X, Y); }
public override string ToString() { return X + "," + Y; }
public static readonly CVec[] directions =
{
@@ -82,5 +70,59 @@ namespace OpenRA
new CVec(1, 0),
new CVec(1, 1),
};
#region Scripting interface
public LuaValue Add(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CVec a, b;
if (!left.TryGetClrValue<CVec>(out a) || !right.TryGetClrValue<CVec>(out b))
throw new LuaException("Attempted to call CVec.Add(CVec, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name));
return new LuaCustomClrObject(a + b);
}
public LuaValue Subtract(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CVec a, b;
if (!left.TryGetClrValue<CVec>(out a) || !right.TryGetClrValue<CVec>(out b))
throw new LuaException("Attempted to call CVec.Subtract(CVec, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name));
return new LuaCustomClrObject(a - b);
}
public LuaValue Minus(LuaRuntime runtime)
{
return new LuaCustomClrObject(-this);
}
public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right)
{
CVec a, b;
if (!left.TryGetClrValue<CVec>(out a) || !right.TryGetClrValue<CVec>(out b))
return false;
return a == b;
}
public LuaValue this[LuaRuntime runtime, LuaValue key]
{
get
{
switch (key.ToString())
{
case "X": return X;
case "Y": return Y;
default: throw new LuaException("CVec does not define a member '{0}'".F(key));
}
}
set
{
throw new LuaException("WVec is read-only. Use CVec.New to create a new value");
}
}
#endregion
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -28,7 +28,9 @@ namespace OpenRA
switch (ex.Status)
{
case WebExceptionStatus.NameResolutionFailure:
return "DNS lookup failed";
case WebExceptionStatus.Timeout:
return "Connection timeout";
case WebExceptionStatus.ConnectFailure:
return "Cannot connect to remote server";
case WebExceptionStatus.ProtocolError:
@@ -70,7 +72,8 @@ namespace OpenRA
{
Game.OnQuit -= Cancel;
wc.CancelAsync();
wc.Dispose();
cancelled = true;
}
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -18,15 +18,13 @@ namespace OpenRA.Effects
{
Actor target;
Player player;
int remainingTicks = 4;
int remainingTicks;
public FlashTarget(Actor target)
: this(target, null) { }
public FlashTarget(Actor target, Player asPlayer)
public FlashTarget(Actor target, Player asPlayer = null, int ticks = 4)
{
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);
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -13,15 +13,17 @@ using OpenRA.Graphics;
namespace OpenRA.Effects
{
public class MoveFlash : IEffect
public class SpriteEffect : IEffect
{
string palette;
Animation anim;
WPos pos;
public MoveFlash(WPos pos, World world)
public SpriteEffect(WPos pos, World world, string sprite, string palette)
{
this.pos = pos;
anim = new Animation("moveflsh");
this.palette = palette;
anim = new Animation(world, sprite);
anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this)));
}
@@ -32,7 +34,7 @@ namespace OpenRA.Effects
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
return anim.Render(pos, WVec.Zero, 0, wr.Palette("moveflash"), 1f / wr.Viewport.Zoom);
return anim.Render(pos, WVec.Zero, 0, wr.Palette(palette), 1f / wr.Viewport.Zoom);
}
}
}

175
OpenRA.FileFormats/Exts.cs → OpenRA.Game/Exts.cs Executable file → Normal file
View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -11,13 +11,20 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Reflection;
using OpenRA.Support;
namespace OpenRA
{
public static class Exts
{
public static bool IsUppercase(this string str)
{
return string.Compare(str.ToUpperInvariant(), str, false) == 0;
}
public static string F(this string fmt, params object[] args)
{
return string.Format(fmt, args);
@@ -35,6 +42,8 @@ namespace OpenRA
fn(ee);
}
public static Lazy<T> Lazy<T>(Func<T> p) { return new Lazy<T>(p); }
public static IEnumerable<string> GetNamespaces(this Assembly a)
{
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);
@@ -97,13 +106,16 @@ namespace OpenRA
return ret;
}
public static T Random<T>(this IEnumerable<T> ts, Thirdparty.Random r)
public static T Random<T>(this IEnumerable<T> ts, MersenneTwister r)
{
var xs = ts.ToArray();
return xs[r.Next(xs.Length)];
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)];
}
public static T RandomOrDefault<T>(this IEnumerable<T> ts, Thirdparty.Random r)
public static T RandomOrDefault<T>(this IEnumerable<T> ts, MersenneTwister r)
{
if (!ts.Any())
return default(T);
@@ -127,6 +139,54 @@ namespace OpenRA
for (;;) { yield return t; t = f(t); }
}
public static T MinBy<T, U>(this IEnumerable<T> ts, Func<T, U> selector)
{
return ts.CompareBy(selector, 1, true);
}
public static T MaxBy<T, U>(this IEnumerable<T> ts, Func<T, U> selector)
{
return ts.CompareBy(selector, -1, true);
}
public static T MinByOrDefault<T, U>(this IEnumerable<T> ts, Func<T, U> selector)
{
return ts.CompareBy(selector, 1, false);
}
public static T MaxByOrDefault<T, U>(this IEnumerable<T> ts, Func<T, U> selector)
{
return ts.CompareBy(selector, -1, false);
}
static T CompareBy<T, U>(this IEnumerable<T> ts, Func<T, U> selector, int modifier, bool throws)
{
var comparer = Comparer<U>.Default;
T t;
U u;
using (var e = ts.GetEnumerator())
{
if (!e.MoveNext())
if (throws)
throw new ArgumentException("Collection must not be empty.", "ts");
else
return default(T);
t = e.Current;
u = selector(t);
while (e.MoveNext())
{
var nextT = e.Current;
var nextU = selector(nextT);
if (comparer.Compare(nextU, u) * modifier < 0)
{
t = nextT;
u = nextU;
}
}
return t;
}
}
public static int NextPowerOf2(int v)
{
--v;
@@ -145,9 +205,94 @@ namespace OpenRA
public static Size NextPowerOf2(this Size s) { return new Size(NextPowerOf2(s.Width), NextPowerOf2(s.Height)); }
public enum ISqrtRoundMode { Floor, Nearest, Ceiling }
public static int ISqrt(int number, ISqrtRoundMode round = ISqrtRoundMode.Floor)
{
if (number < 0)
throw new InvalidOperationException("Attempted to calculate the square root of a negative integer: {0}".F(number));
return (int)ISqrt((uint)number, round);
}
public static uint ISqrt(uint number, ISqrtRoundMode round = ISqrtRoundMode.Floor)
{
var divisor = 1U << 30;
var root = 0U;
var remainder = number;
// Find the highest term in the divisor
while (divisor > number)
divisor >>= 2;
// Evaluate the root, two bits at a time
while (divisor != 0)
{
if (root + divisor <= remainder)
{
remainder -= root + divisor;
root += 2 * divisor;
}
root >>= 1;
divisor >>= 2;
}
// Adjust for other rounding modes
if (round == ISqrtRoundMode.Nearest && remainder > root)
root += 1;
else if (round == ISqrtRoundMode.Ceiling && root * root < number)
root += 1;
return root;
}
public static long ISqrt(long number, ISqrtRoundMode round = ISqrtRoundMode.Floor)
{
if (number < 0)
throw new InvalidOperationException("Attempted to calculate the square root of a negative integer: {0}".F(number));
return (long)ISqrt((ulong)number, round);
}
public static ulong ISqrt(ulong number, ISqrtRoundMode round = ISqrtRoundMode.Floor)
{
var divisor = 1UL << 62;
var root = 0UL;
var remainder = number;
// Find the highest term in the divisor
while (divisor > number)
divisor >>= 2;
// Evaluate the root, two bits at a time
while (divisor != 0)
{
if (root + divisor <= remainder)
{
remainder -= root + divisor;
root += 2 * divisor;
}
root >>= 1;
divisor >>= 2;
}
// Adjust for other rounding modes
if (round == ISqrtRoundMode.Nearest && remainder > root)
root += 1;
else if (round == ISqrtRoundMode.Ceiling && root * root < number)
root += 1;
return root;
}
public static string JoinWith<T>(this IEnumerable<T> ts, string j)
{
return string.Join(j, ts.Select(t => t.ToString()).ToArray());
return string.Join(j, ts);
}
public static IEnumerable<T> Append<T>(this IEnumerable<T> ts, params T[] moreTs)
@@ -171,8 +316,8 @@ namespace OpenRA
var d = new Dictionary<TKey, TElement>();
foreach (var item in source)
{
TKey key = keySelector(item);
TElement element = elementSelector(item);
var key = keySelector(item);
var element = elementSelector(item);
// Check for a key conflict:
if (d.ContainsKey(key))
@@ -217,8 +362,8 @@ namespace OpenRA
public static T[] MakeArray<T>(int count, Func<int, T> f)
{
T[] result = new T[count];
for (int i = 0; i < count; i++)
var result = new T[count];
for (var i = 0; i < count; i++)
result[i] = f(i);
return result;
@@ -249,6 +394,16 @@ namespace OpenRA
throw new InvalidOperationException("ToBits only accepts up to 32 values.");
return result;
}
public static int ParseIntegerInvariant(string s)
{
return int.Parse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
}
public static bool TryParseIntegerInvariant(string s, out int i)
{
return int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out i);
}
}
public static class Enum<T>

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -10,13 +10,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using OpenRA.Graphics;
using OpenRA.Primitives;
namespace OpenRA.FileFormats
namespace OpenRA
{
public static class FieldLoader
{
@@ -32,38 +35,44 @@ namespace OpenRA.FileFormats
public static void Load(object self, MiniYaml my)
{
var loadDict = typeLoadInfo[self.GetType()];
var loadInfo = typeLoadInfo[self.GetType()];
foreach (var kv in loadDict)
Dictionary<string, MiniYaml> md = null;
foreach (var fli in loadInfo)
{
object val;
if (kv.Value != null)
val = kv.Value(kv.Key.Name, kv.Key.FieldType, my);
else if (!TryGetValueFromYaml(kv.Key, my, out val))
continue;
kv.Key.SetValue(self, val);
if (fli.Loader != null)
val = fli.Loader(my);
else
{
if (md == null)
md = my.ToDictionary();
if (!TryGetValueFromYaml(fli.YamlName, fli.Field, md, out val))
continue;
}
fli.Field.SetValue(self, val);
}
}
static bool TryGetValueFromYaml(FieldInfo field, MiniYaml yaml, out object ret)
static bool TryGetValueFromYaml(string yamlName, FieldInfo field, Dictionary<string, MiniYaml> md, out object ret)
{
ret = null;
var n = yaml.Nodes.Where(x => x.Key == field.Name).ToList();
if (n.Count == 0)
MiniYaml yaml;
if (!md.TryGetValue(yamlName, out yaml))
return false;
if (n.Count == 1 && n[0].Value.Nodes.Count == 0)
if (yaml.Nodes.Count == 0)
{
ret = GetValue(field.Name, field.FieldType, n[0].Value.Value, field);
ret = GetValue(field.Name, field.FieldType, yaml.Value, field);
return true;
}
else if (n.Count > 1)
{
throw new InvalidOperationException("The field {0} has multiple definitions:\n{1}"
.F(field.Name, n.Select(m => "\t- " + m.Location).JoinWith("\n")));
}
throw new InvalidOperationException("TryGetValueFromYaml: unable to load field {0} (of type {1})".F(field.Name, field.FieldType));
throw new InvalidOperationException("TryGetValueFromYaml: unable to load field {0} (of type {1})".F(yamlName, field.FieldType));
}
public static T Load<T>(MiniYaml y) where T : new()
@@ -74,27 +83,31 @@ namespace OpenRA.FileFormats
}
static readonly object[] NoIndexes = { };
public static void LoadField(object self, string key, string value)
public static void LoadField(object target, string key, string value)
{
var field = self.GetType().GetField(key.Trim());
const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
key = key.Trim();
var field = target.GetType().GetField(key, flags);
if (field != null)
{
if (!field.HasAttribute<FieldFromYamlKeyAttribute>())
field.SetValue(self, GetValue(field.Name, field.FieldType, value, field));
var sa = field.GetCustomAttributes<SerializeAttribute>(false).DefaultIfEmpty(SerializeAttribute.Default).First();
if (!sa.FromYamlKey)
field.SetValue(target, GetValue(field.Name, field.FieldType, value, field));
return;
}
var prop = self.GetType().GetProperty(key.Trim());
var prop = target.GetType().GetProperty(key, flags);
if (prop != null)
{
if (!prop.HasAttribute<FieldFromYamlKeyAttribute>())
prop.SetValue(self, GetValue(prop.Name, prop.PropertyType, value, prop), NoIndexes);
var sa = prop.GetCustomAttributes<SerializeAttribute>(false).DefaultIfEmpty(SerializeAttribute.Default).First();
if (!sa.FromYamlKey)
prop.SetValue(target, GetValue(prop.Name, prop.PropertyType, value, prop), NoIndexes);
return;
}
UnknownFieldAction(key.Trim(), self.GetType());
UnknownFieldAction(key, target.GetType());
}
public static T GetValue<T>(string field, string value)
@@ -114,7 +127,7 @@ namespace OpenRA.FileFormats
if (fieldType == typeof(int))
{
int res;
if (int.TryParse(value, out res))
if (Exts.TryParseIntegerInvariant(value, out res))
return res;
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -122,7 +135,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(ushort))
{
ushort res;
if (ushort.TryParse(value, out res))
if (ushort.TryParse(value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out res))
return res;
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -130,7 +143,7 @@ namespace OpenRA.FileFormats
if (fieldType == typeof(long))
{
long res;
if (long.TryParse(value, out res))
if (long.TryParse(value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out res))
return res;
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -138,7 +151,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(float))
{
float res;
if (float.TryParse(value.Replace("%", ""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
if (float.TryParse(value.Replace("%", ""), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out res))
return res * (value.Contains('%') ? 0.01f : 1f);
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -146,7 +159,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(decimal))
{
decimal res;
if (decimal.TryParse(value.Replace("%", ""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
if (decimal.TryParse(value.Replace("%", ""), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out res))
return res * (value.Contains('%') ? 0.01m : 1m);
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -162,9 +175,16 @@ namespace OpenRA.FileFormats
{
var parts = value.Split(',');
if (parts.Length == 3)
return Color.FromArgb(int.Parse(parts[0]).Clamp(0, 255), int.Parse(parts[1]).Clamp(0, 255), int.Parse(parts[2]).Clamp(0, 255));
return Color.FromArgb(
Exts.ParseIntegerInvariant(parts[0]).Clamp(0, 255),
Exts.ParseIntegerInvariant(parts[1]).Clamp(0, 255),
Exts.ParseIntegerInvariant(parts[2]).Clamp(0, 255));
if (parts.Length == 4)
return Color.FromArgb(int.Parse(parts[0]).Clamp(0, 255), int.Parse(parts[1]).Clamp(0, 255), int.Parse(parts[2]).Clamp(0, 255), int.Parse(parts[3]).Clamp(0, 255));
return Color.FromArgb(
Exts.ParseIntegerInvariant(parts[0]).Clamp(0, 255),
Exts.ParseIntegerInvariant(parts[1]).Clamp(0, 255),
Exts.ParseIntegerInvariant(parts[2]).Clamp(0, 255),
Exts.ParseIntegerInvariant(parts[3]).Clamp(0, 255));
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -175,9 +195,9 @@ namespace OpenRA.FileFormats
// Allow old ColorRamp format to be parsed as HSLColor
if (parts.Length == 3 || parts.Length == 4)
return new HSLColor(
(byte)int.Parse(parts[0]).Clamp(0, 255),
(byte)int.Parse(parts[1]).Clamp(0, 255),
(byte)int.Parse(parts[2]).Clamp(0, 255));
(byte)Exts.ParseIntegerInvariant(parts[0]).Clamp(0, 255),
(byte)Exts.ParseIntegerInvariant(parts[1]).Clamp(0, 255),
(byte)Exts.ParseIntegerInvariant(parts[2]).Clamp(0, 255));
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -213,6 +233,27 @@ namespace OpenRA.FileFormats
return InvalidValueAction(value, fieldType, fieldName);
}
else if (fieldType == typeof(WVec[]))
{
var parts = value.Split(',');
if (parts.Length % 3 != 0)
return InvalidValueAction(value, fieldType, fieldName);
var vecs = new WVec[parts.Length / 3];
for (var i = 0; i < vecs.Length; ++i)
{
WRange rx, ry, rz;
if (WRange.TryParse(parts[3 * i], out rx)
&& WRange.TryParse(parts[3 * i + 1], out ry)
&& WRange.TryParse(parts[3 * i + 2], out rz))
vecs[i] = new WVec(rx, ry, rz);
}
return vecs;
}
else if (fieldType == typeof(WPos))
{
var parts = value.Split(',');
@@ -229,7 +270,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(WAngle))
{
int res;
if (int.TryParse(value, out res))
if (Exts.TryParseIntegerInvariant(value, out res))
return new WAngle(res);
return InvalidValueAction(value, fieldType, fieldName);
}
@@ -240,8 +281,10 @@ namespace OpenRA.FileFormats
if (parts.Length == 3)
{
int rr, rp, ry;
if (int.TryParse(value, out rr) && int.TryParse(value, out rp) && int.TryParse(value, out ry))
return new WRot(new WAngle(rr), new WAngle(rp), new WAngle(ry));
if (Exts.TryParseIntegerInvariant(value, out rr)
&& Exts.TryParseIntegerInvariant(value, out rp)
&& Exts.TryParseIntegerInvariant(value, out ry))
return new WRot(new WAngle(rr), new WAngle(rp), new WAngle(ry));
}
return InvalidValueAction(value, fieldType, fieldName);
@@ -250,20 +293,29 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(CPos))
{
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new CPos(int.Parse(parts[0]), int.Parse(parts[1]));
return new CPos(
Exts.ParseIntegerInvariant(parts[0]),
Exts.ParseIntegerInvariant(parts[1]));
}
else if (fieldType == typeof(CVec))
{
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new CVec(int.Parse(parts[0]), int.Parse(parts[1]));
return new CVec(
Exts.ParseIntegerInvariant(parts[0]),
Exts.ParseIntegerInvariant(parts[1]));
}
else if (fieldType.IsEnum)
{
if (!Enum.GetNames(fieldType).Select(a => a.ToLower()).Contains(value.ToLower()))
try
{
return Enum.Parse(fieldType, value, true);
}
catch (ArgumentException)
{
return InvalidValueAction(value, fieldType, fieldName);
return Enum.Parse(fieldType, value, true);
}
}
else if (fieldType == typeof(bool))
@@ -277,7 +329,7 @@ namespace OpenRA.FileFormats
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var ret = Array.CreateInstance(fieldType.GetElementType(), parts.Length);
for (int i = 0; i < parts.Length; i++)
for (var i = 0; i < parts.Length; i++)
ret.SetValue(GetValue(fieldName, fieldType.GetElementType(), parts[i].Trim(), field), i);
return ret;
}
@@ -285,13 +337,17 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(Size))
{
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new Size(int.Parse(parts[0]), int.Parse(parts[1]));
return new Size(
Exts.ParseIntegerInvariant(parts[0]),
Exts.ParseIntegerInvariant(parts[1]));
}
else if (fieldType == typeof(int2))
{
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
return new int2(
Exts.ParseIntegerInvariant(parts[0]),
Exts.ParseIntegerInvariant(parts[1]));
}
else if (fieldType == typeof(float2))
@@ -300,9 +356,9 @@ namespace OpenRA.FileFormats
float xx = 0;
float yy = 0;
float res;
if (float.TryParse(parts[0].Replace("%", ""), out res))
if (float.TryParse(parts[0].Replace("%", ""), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out res))
xx = res * (parts[0].Contains('%') ? 0.01f : 1f);
if (float.TryParse(parts[1].Replace("%", ""), out res))
if (float.TryParse(parts[1].Replace("%", ""), NumberStyles.Float, NumberFormatInfo.InvariantInfo, out res))
yy = res * (parts[1].Contains('%') ? 0.01f : 1f);
return new float2(xx, yy);
}
@@ -310,7 +366,11 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(Rectangle))
{
var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new Rectangle(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
return new Rectangle(
Exts.ParseIntegerInvariant(parts[0]),
Exts.ParseIntegerInvariant(parts[1]),
Exts.ParseIntegerInvariant(parts[2]),
Exts.ParseIntegerInvariant(parts[3]));
}
else if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Bits<>))
@@ -328,6 +388,30 @@ namespace OpenRA.FileFormats
return fieldType.GetConstructor(new[] { innerType }).Invoke(new[] { innerValue });
}
else if (fieldType == typeof(DateTime))
{
DateTime dt;
if (DateTime.TryParseExact(value, "yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dt))
return dt;
return InvalidValueAction(value, fieldType, fieldName);
}
else
{
var conv = TypeDescriptor.GetConverter(fieldType);
if (conv.CanConvertFrom(typeof(string)))
{
try
{
return conv.ConvertFromInvariantString(value);
}
catch
{
return InvalidValueAction(value, fieldType, fieldName);
}
}
}
UnknownFieldAction("[Type] {0}".F(value), fieldType);
return null;
}
@@ -342,49 +426,101 @@ namespace OpenRA.FileFormats
return InvalidValueAction(p, fieldType, field);
}
static Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>> typeLoadInfo = new Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>>(GetTypeLoadInfo);
static Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>> GetTypeLoadInfo(Type type)
public sealed class FieldLoadInfo
{
var ret = new Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>();
public readonly FieldInfo Field;
public readonly SerializeAttribute Attribute;
public readonly string YamlName;
public readonly Func<MiniYaml, object> Loader;
foreach (var ff in type.GetFields())
internal FieldLoadInfo(FieldInfo field, SerializeAttribute attr, string yamlName, Func<MiniYaml, object> loader = null)
{
Field = field;
Attribute = attr;
YamlName = yamlName;
Loader = loader;
}
}
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));
}
static Cache<Type, List<FieldLoadInfo>> typeLoadInfo = new Cache<Type, List<FieldLoadInfo>>(BuildTypeLoadInfo);
static List<FieldLoadInfo> BuildTypeLoadInfo(Type type)
{
var ret = new List<FieldLoadInfo>();
foreach (var ff in type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
{
var field = ff;
var ignore = field.GetCustomAttributes<IgnoreAttribute>(false);
var loadUsing = field.GetCustomAttributes<LoadUsingAttribute>(false);
var fromYamlKey = field.GetCustomAttributes<FieldFromYamlKeyAttribute>(false);
if (loadUsing.Length != 0)
ret[field] = (_1, fieldType, yaml) => loadUsing[0].LoaderFunc(field)(yaml);
else if (fromYamlKey.Length != 0)
ret[field] = (f, ft, yaml) => GetValue(f, ft, yaml.Value, field);
else if (ignore.Length == 0)
ret[field] = null;
var sa = field.GetCustomAttributes<SerializeAttribute>(false).DefaultIfEmpty(SerializeAttribute.Default).First();
if (!sa.Serialize)
continue;
var yamlName = string.IsNullOrEmpty(sa.YamlName) ? field.Name : sa.YamlName;
var loader = sa.GetLoader(type);
if (loader == null && sa.FromYamlKey)
loader = (yaml) => GetValue(yamlName, field.FieldType, yaml.Value, field);
var fli = new FieldLoadInfo(field, sa, yamlName, loader);
ret.Add(fli);
}
return ret;
}
[AttributeUsage(AttributeTargets.Field)]
public class IgnoreAttribute : Attribute { }
public sealed class IgnoreAttribute : SerializeAttribute
{
public IgnoreAttribute()
: base(false) { }
}
[AttributeUsage(AttributeTargets.Field)]
public class LoadUsingAttribute : Attribute
public sealed class LoadUsingAttribute : SerializeAttribute
{
Func<MiniYaml, object> loaderFuncCache;
public readonly string Loader;
public LoadUsingAttribute(string loader)
{
Loader = loader;
}
}
internal Func<MiniYaml, object> LoaderFunc(FieldInfo field)
[AttributeUsage(AttributeTargets.Field)]
public class SerializeAttribute : Attribute
{
public static readonly SerializeAttribute Default = new SerializeAttribute(true);
public bool IsDefault { get { return this == Default; } }
public readonly bool Serialize;
public string YamlName;
public string Loader;
public bool FromYamlKey;
public SerializeAttribute(bool serialize = true)
{
const BindingFlags BindingFlag = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
if (loaderFuncCache == null)
loaderFuncCache = (Func<MiniYaml, object>)Delegate.CreateDelegate(typeof(Func<MiniYaml, object>), field.DeclaringType.GetMethod(Loader, BindingFlag));
return loaderFuncCache;
Serialize = serialize;
}
internal Func<MiniYaml, object> GetLoader(Type type)
{
const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy;
if (!string.IsNullOrEmpty(Loader))
{
var method = type.GetMethod(Loader, flags);
if (method == null)
throw new InvalidOperationException("{0} does not specify a loader function '{1}'".F(type.Name, Loader));
return (Func<MiniYaml, object>)Delegate.CreateDelegate(typeof(Func<MiniYaml, object>), method);
}
return null;
}
}
@@ -404,12 +540,19 @@ namespace OpenRA.FileFormats
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class TranslateAttribute : Attribute { }
public sealed class TranslateAttribute : Attribute { }
public class FieldFromYamlKeyAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class FieldFromYamlKeyAttribute : FieldLoader.SerializeAttribute
{
public FieldFromYamlKeyAttribute()
{
FromYamlKey = true;
}
}
// mirrors DescriptionAttribute from System.ComponentModel but we dont want to have to use that everywhere.
public class DescAttribute : Attribute
public sealed class DescAttribute : Attribute
{
public readonly string[] Lines;
public DescAttribute(params string[] lines) { Lines = lines; }

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -10,40 +10,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Reflection;
namespace OpenRA.FileFormats
namespace OpenRA
{
public static class FieldSaver
{
public static MiniYaml Save(object o)
public static MiniYaml Save(object o, bool includePrivateByDefault = false)
{
var nodes = new List<MiniYamlNode>();
string root = null;
foreach (var f in o.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
foreach (var info in FieldLoader.GetTypeLoadInfo(o.GetType(), includePrivateByDefault))
{
if (f.HasAttribute<FieldFromYamlKeyAttribute>())
root = FormatValue(o, f);
if (info.Attribute.FromYamlKey)
root = FormatValue(o, info.Field);
else
nodes.Add(new MiniYamlNode(f.Name, FormatValue(o, f)));
nodes.Add(new MiniYamlNode(info.YamlName, FormatValue(o, info.Field)));
}
return new MiniYaml(root, nodes);
}
public static MiniYaml SaveDifferences(object o, object from)
public static MiniYaml SaveDifferences(object o, object from, bool includePrivateByDefault = false)
{
if (o.GetType() != from.GetType())
throw new InvalidOperationException("FieldLoader: can't diff objects of different types");
var fields = o.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance)
.Where(f => FormatValue(o, f) != FormatValue(from, f));
var fields = FieldLoader.GetTypeLoadInfo(o.GetType(), includePrivateByDefault)
.Where(info => FormatValue(o, info.Field) != FormatValue(from, info.Field));
return new MiniYaml(null, fields.Select(f => new MiniYamlNode(f.Name, FormatValue(o, f))).ToList());
return new MiniYaml(
null,
fields.Select(info => new MiniYamlNode(info.YamlName, FormatValue(o, info.Field))).ToList()
);
}
public static MiniYamlNode SaveField(object o, string field)
@@ -66,9 +70,13 @@ namespace OpenRA.FileFormats
((int)c.B).Clamp(0, 255));
}
// Don't save floats in settings.yaml using country-specific decimal separators which can be misunderstood as group seperators.
// Don't save using country-specific decimal separators which can be misunderstood as group seperators.
if (t == typeof(float))
return ((float)v).ToString(CultureInfo.InvariantCulture);
if (t == typeof(decimal))
return ((decimal)v).ToString(CultureInfo.InvariantCulture);
if (t == typeof(double))
return ((double)v).ToString(CultureInfo.InvariantCulture);
if (t == typeof(Rectangle))
{
@@ -79,7 +87,26 @@ namespace OpenRA.FileFormats
if (t.IsArray)
{
var elems = ((Array)v).OfType<object>();
return elems.JoinWith(",");
return elems.JoinWith(", ");
}
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>))
return ""; // TODO
if (t == typeof(DateTime))
return ((DateTime)v).ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture);
// Try the TypeConverter
var conv = TypeDescriptor.GetConverter(t);
if (conv.CanConvertTo(typeof(string)))
{
try
{
return conv.ConvertToInvariantString(v);
}
catch
{
}
}
return v.ToString();

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -36,7 +36,7 @@ namespace OpenRA.FileFormats
Chunk c;
c.CompressedSize = s.ReadUInt16();
c.OutputSize = s.ReadUInt16();
if (0xdeaf != s.ReadUInt32())
if (s.ReadUInt32() != 0xdeaf)
throw new InvalidDataException("Chunk header is bogus");
return c;
}
@@ -45,17 +45,19 @@ namespace OpenRA.FileFormats
public static class AudLoader
{
static int[] indexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 };
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,
97, 107, 118, 130, 143, 157, 173, 190, 209,
230, 253, 279, 307, 337, 371, 408, 449, 494,
544, 598, 658, 724, 796, 876, 963, 1060, 1166,
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 };
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,
97, 107, 118, 130, 143, 157, 173, 190, 209,
230, 253, 279, 307, 337, 371, 408, 449, 494,
544, 598, 658, 724, 796, 876, 963, 1060, 1166,
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
};
static short DecodeSample(byte b, ref int index, ref int current)
{
@@ -131,7 +133,7 @@ namespace OpenRA.FileFormats
while (dataSize > 0)
{
var chunk = Chunk.Read(s);
for (int n = 0; n < chunk.CompressedSize; n++)
for (var n = 0; n < chunk.CompressedSize; n++)
{
var b = s.ReadUInt8();

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -92,7 +92,7 @@ namespace OpenRA.FileFormats
// Magic number for "done"
if (len == 519)
{
for (int i = 0; i < next; i++)
for (var i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
break;
}
@@ -135,7 +135,7 @@ namespace OpenRA.FileFormats
// Flush window to outstream
if (next == MAXWIN)
{
for (int i = 0; i < next; i++)
for (var i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
next = 0;
first = false;
@@ -149,7 +149,7 @@ namespace OpenRA.FileFormats
outBuffer[next++] = (byte)symbol;
if (next == MAXWIN)
{
for (int i = 0; i < next; i++)
for (var i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
next = 0;
first = false;
@@ -236,7 +236,7 @@ namespace OpenRA.FileFormats
var s = 0; // current symbol
// convert compact repeat counts into symbol bit length list
foreach (byte code in rep)
foreach (var code in rep)
{
var num = (code >> 4) + 1; // Number of codes (top four bits plus 1)
var len = (byte)(code & 15); // Code length (low four bits)
@@ -250,7 +250,7 @@ namespace OpenRA.FileFormats
// count number of codes of each length
Count = new short[Blast.MAXBITS + 1];
for (int i = 0; i < n; i++)
for (var i = 0; i < n; i++)
Count[length[i]]++;
// no codes!
@@ -259,7 +259,7 @@ namespace OpenRA.FileFormats
// check for an over-subscribed or incomplete set of lengths
var left = 1; // one possible code of zero length
for (int len = 1; len <= Blast.MAXBITS; len++)
for (var len = 1; len <= Blast.MAXBITS; len++)
{
left <<= 1; // one more bit, double codes left
left -= Count[len]; // deduct count from possible codes
@@ -269,7 +269,7 @@ namespace OpenRA.FileFormats
// generate offsets into symbol table for each length for sorting
var offs = new short[Blast.MAXBITS + 1];
for (int len = 1; len < Blast.MAXBITS; len++)
for (var len = 1; len < Blast.MAXBITS; len++)
offs[len + 1] = (short)(offs[len] + Count[len]);
// put symbols in table sorted by length, by symbol order within each length

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -26,15 +26,15 @@ namespace OpenRA.FileFormats
uint l = 0, r = 0;
for (int i = 0; i < 18; )
for (var i = 0; i < 18; )
{
Encrypt(ref l, ref r);
m_p[i++] = l;
m_p[i++] = r;
}
for (int i = 0; i < 4; ++i)
for (int j = 0; j < 256; )
for (var i = 0; i < 4; ++i)
for (var j = 0; j < 256; )
{
Encrypt(ref l, ref r);
m_s[i, j++] = l;
@@ -47,16 +47,16 @@ namespace OpenRA.FileFormats
delegate void CipherFunc( ref uint a, ref uint b );
uint[] RunCipher(uint[] data, CipherFunc f)
static uint[] RunCipher(uint[] data, CipherFunc f)
{
uint[] result = new uint[data.Length];
var result = new uint[data.Length];
int size = data.Length / 2;
int i = 0;
var size = data.Length / 2;
var i = 0;
while (size-- > 0)
{
uint a = SwapBytes(data[i]);
uint b = SwapBytes(data[i+1]);
var a = SwapBytes(data[i]);
var b = SwapBytes(data[i+1]);
f(ref a, ref b);
@@ -72,8 +72,8 @@ namespace OpenRA.FileFormats
uint _a = a, _b = b;
_a ^= m_p[0];
bool x = false;
for( int i = 1; i <= 16; i++, x ^= true)
var x = false;
for( var i = 1; i <= 16; i++, x ^= true)
{
if (x)
Round(ref _a, _b, i);
@@ -91,8 +91,8 @@ namespace OpenRA.FileFormats
uint _a = a, _b = b;
_a ^= m_p[17];
bool x = false;
for (int i = 16; i >= 1; i--, x ^= true)
var x = false;
for (var i = 16; i >= 1; i--, x ^= true)
{
if (x)
Round(ref _a, _b, i);
@@ -120,7 +120,7 @@ namespace OpenRA.FileFormats
a ^= bf_f(b) ^ m_p[n];
}
uint SwapBytes(uint i)
static uint SwapBytes(uint i)
{
i = (i << 16) | (i >> 16);
i = ((i << 8) & 0xff00ff00) | ((i >> 8) & 0x00ff00ff);

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -35,13 +35,13 @@ namespace OpenRA.FileFormats
uint glob1_hi_bitlen;
uint glob1_hi_inv_lo, glob1_hi_inv_hi;
void init_bignum(uint[] n, uint val, uint len)
static void init_bignum(uint[] n, uint val, uint len)
{
for (int i = 0; i < len; i++) n[i] = 0;
for (var i = 0; i < len; i++) n[i] = 0;
n[0] = val;
}
void move_key_to_big(uint[] n, byte[] key, uint klen, uint blen)
static void move_key_to_big(uint[] n, byte[] key, uint klen, uint blen)
{
byte sign;
@@ -52,20 +52,20 @@ namespace OpenRA.FileFormats
{
fixed (uint* _pn = &n[0])
{
byte* pn = (byte*)_pn;
uint i = blen * 4;
var pn = (byte*)_pn;
var i = blen * 4;
for (; i > klen; i--) pn[i - 1] = (byte)sign;
for (; i > 0; i--) pn[i - 1] = key[klen - i];
}
}
}
void key_to_bignum(uint[] n, byte[] key, uint len)
static void key_to_bignum(uint[] n, byte[] key, uint len)
{
uint keylen;
int i;
int j = 0;
var j = 0;
if (key[j] != 2) return;
j++;
@@ -85,7 +85,7 @@ namespace OpenRA.FileFormats
move_key_to_big(n, key.Skip(j).ToArray(), keylen, len);
}
uint len_bignum(uint[] n, uint len)
static uint len_bignum(uint[] n, uint len)
{
uint i;
i = len - 1;
@@ -93,7 +93,7 @@ namespace OpenRA.FileFormats
return i + 1;
}
uint bitlen_bignum(uint[] n, uint len)
static uint bitlen_bignum(uint[] n, uint len)
{
uint ddlen, bitlen, mask;
ddlen = len_bignum(n, len);
@@ -118,11 +118,11 @@ namespace OpenRA.FileFormats
uint len_predata()
{
uint a = (pubkey.len - 1) / 8;
var a = (pubkey.len - 1) / 8;
return (55 / a + 1) * (a + 1);
}
int cmp_bignum(uint[] n1, uint[] n2, uint len)
static int cmp_bignum(uint[] n1, uint[] n2, uint len)
{
while (len > 0)
@@ -134,14 +134,14 @@ namespace OpenRA.FileFormats
return 0;
}
void mov_bignum(uint[] dest, uint[] src, uint len)
static void mov_bignum(uint[] dest, uint[] src, uint len)
{
Array.Copy(src, dest, len);
}
void shr_bignum(uint[] n, int bits, int len)
static void shr_bignum(uint[] n, int bits, int len)
{
int i; int i2 = bits / 32;
int i; var i2 = bits / 32;
if (i2 > 0)
{
@@ -155,7 +155,7 @@ namespace OpenRA.FileFormats
n[i] = n[i] >> bits;
}
void shl_bignum(uint[] n, int bits, int len)
static void shl_bignum(uint[] n, int bits, int len)
{
int i, i2;
@@ -172,7 +172,7 @@ namespace OpenRA.FileFormats
n[0] <<= bits;
}
uint sub_bignum(uint[] dest, uint[] src1, uint[] src2, uint carry, int len)
static uint sub_bignum(uint[] dest, uint[] src1, uint[] src2, uint carry, int len)
{
uint i1, i2;
@@ -183,9 +183,9 @@ namespace OpenRA.FileFormats
fixed (uint* _ps2 = &src2[0])
fixed (uint* _pd = &dest[0])
{
ushort* ps1 = (ushort*)_ps1;
ushort* ps2 = (ushort*)_ps2;
ushort* pd = (ushort*)_pd;
var ps1 = (ushort*)_ps1;
var ps2 = (ushort*)_ps2;
var pd = (ushort*)_pd;
while (--len != -1)
{
@@ -199,15 +199,15 @@ namespace OpenRA.FileFormats
return carry;
}
unsafe uint sub_bignum(uint* dest, uint* src1, uint* src2, uint carry, int len)
static unsafe uint sub_bignum(uint* dest, uint* src1, uint* src2, uint carry, int len)
{
uint i1, i2;
len += len;
ushort* ps1 = (ushort*)src1;
ushort* ps2 = (ushort*)src2;
ushort* pd = (ushort*)dest;
var ps1 = (ushort*)src1;
var ps2 = (ushort*)src2;
var pd = (ushort*)dest;
while (--len != -1)
{
@@ -220,13 +220,13 @@ namespace OpenRA.FileFormats
return carry;
}
void inv_bignum(uint[] n1, uint[] n2, uint len)
static void inv_bignum(uint[] n1, uint[] n2, uint len)
{
uint[] n_tmp = new uint[64];
var n_tmp = new uint[64];
uint n2_bytelen, bit;
int n2_bitlen;
int j = 0;
var j = 0;
init_bignum(n_tmp, 0, len);
init_bignum(n1, 0, len);
@@ -255,9 +255,9 @@ namespace OpenRA.FileFormats
init_bignum(n_tmp, 0, len);
}
void inc_bignum(uint[] n, uint len)
static void inc_bignum(uint[] n, uint len)
{
int i = 0;
var i = 0;
while ((++n[i] == 0) && (--len > 0)) i++;
}
@@ -282,14 +282,14 @@ namespace OpenRA.FileFormats
glob1_hi_inv_hi = (ushort)(glob1_hi_inv[0] >> 16);
}
unsafe void mul_bignum_word(ushort *pn1, uint[] n2, uint mul, uint len)
static unsafe void mul_bignum_word(ushort* pn1, uint[] n2, uint mul, uint len)
{
uint i, tmp;
unsafe
{
fixed (uint* _pn2 = &n2[0])
{
ushort* pn2 = (ushort*)_pn2;
var pn2 = (ushort*)_pn2;
tmp = 0;
for (i = 0; i < len; i++)
@@ -305,7 +305,7 @@ namespace OpenRA.FileFormats
}
}
void mul_bignum(uint[] dest, uint[] src1, uint[] src2, uint len)
static void mul_bignum(uint[] dest, uint[] src1, uint[] src2, uint len)
{
uint i;
@@ -314,8 +314,8 @@ namespace OpenRA.FileFormats
fixed( uint * _psrc2 = &src2[0] )
fixed(uint* _pdest = &dest[0])
{
ushort* psrc2 = (ushort*)_psrc2;
ushort* pdest = (ushort*)_pdest;
var psrc2 = (ushort*)_psrc2;
var pdest = (ushort*)_pdest;
init_bignum(dest, 0, len * 2);
for (i = 0; i < len * 2; i++)
@@ -324,13 +324,13 @@ namespace OpenRA.FileFormats
}
}
void not_bignum(uint[] n, uint len)
static void not_bignum(uint[] n, uint len)
{
uint i;
for (i = 0; i < len; i++) n[i] = ~n[i];
}
void neg_bignum(uint[] n, uint len)
static void neg_bignum(uint[] n, uint len)
{
not_bignum(n, len);
inc_bignum(n, len);
@@ -338,8 +338,8 @@ namespace OpenRA.FileFormats
unsafe uint get_mulword(uint* n)
{
ushort* wn = (ushort*)n;
uint i = (uint)((((((((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_lo + 0x10000) >> 1)
var wn = (ushort*)n;
var i = (uint)((((((((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_lo + 0x10000) >> 1)
+ (((*(wn - 2) ^ 0xffff) * glob1_hi_inv_hi + glob1_hi_inv_hi) >> 1) + 1)
>> 16) + ((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_hi) >> 1) +
(((*wn ^ 0xffff) * glob1_hi_inv_lo) >> 1) + 1) >> 14) + glob1_hi_inv_hi
@@ -348,9 +348,9 @@ namespace OpenRA.FileFormats
return i & 0xffff;
}
void dec_bignum(uint[] n, uint len)
static void dec_bignum(uint[] n, uint len)
{
int i = 0;
var i = 0;
while ((--n[i] == 0xffffffff) && (--len > 0))
i++;
}
@@ -371,12 +371,12 @@ namespace OpenRA.FileFormats
inc_bignum(glob2, len * 2 + 1);
neg_bignum(glob2, len * 2 + 1);
len_diff = g2_len_x2 + 1 - glob1_len_x2;
ushort* esi = ((ushort*)g2) + (1 + g2_len_x2 - glob1_len_x2);
ushort* edi = ((ushort*)g2) + (g2_len_x2 + 1);
var esi = ((ushort*)g2) + (1 + g2_len_x2 - glob1_len_x2);
var edi = ((ushort*)g2) + (g2_len_x2 + 1);
for (; len_diff != 0; len_diff--)
{
edi--;
uint tmp = get_mulword((uint*)edi);
var tmp = get_mulword((uint*)edi);
esi--;
if (tmp > 0)
{
@@ -410,7 +410,7 @@ namespace OpenRA.FileFormats
void calc_a_key(uint[] n1, uint[] n2, uint[] n3, uint[] n4, uint len)
{
uint[] n_tmp = new uint[64];
var n_tmp = new uint[64];
uint n3_len, n4_len;
int n3_bitlen;
uint bit_mask;
@@ -419,7 +419,7 @@ namespace OpenRA.FileFormats
{
fixed (uint* _pn3 = &n3[0])
{
uint* pn3 = _pn3;
var pn3 = _pn3;
init_bignum(n1, 1, len);
n4_len = len_bignum(n4, len);
@@ -450,17 +450,17 @@ namespace OpenRA.FileFormats
}
}
unsafe void memcpy(byte* dest, byte* src, int len)
static unsafe void memcpy(byte* dest, byte* src, int len)
{
while (len-- != 0) *dest++ = *src++;
}
unsafe void process_predata(byte* pre, uint pre_len, byte *buf)
{
uint[] n2 = new uint[64];
uint[] n3 = new uint[64];
var n2 = new uint[64];
var n3 = new uint[64];
uint a = (pubkey.len - 1) / 8;
var a = (pubkey.len - 1) / 8;
while (a + 1 <= pre_len)
{
init_bignum(n2, 0, 64);
@@ -480,7 +480,7 @@ namespace OpenRA.FileFormats
public byte[] DecryptKey(byte[] src)
{
init_pubkey();
byte[] dest = new byte[256];
var dest = new byte[256];
unsafe
{

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -98,8 +98,8 @@ namespace OpenRA.FileFormats
/// </returns>
public static uint Calculate(byte[] data, uint polynomial)
{
uint crc = polynomial;
for (int i = 0; i < data.Length; i++)
var crc = polynomial;
for (var i = 0; i < data.Length; i++)
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ data[i]];
crc ^= polynomial;
return crc;
@@ -119,8 +119,8 @@ namespace OpenRA.FileFormats
/// <returns>The calculated checksum.</returns>
public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
{
uint crc = polynomial;
for (int i = 0; i < len; i++)
var crc = polynomial;
for (var i = 0; i < len; i++)
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ *data++];
crc ^= polynomial;
return crc;

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -0,0 +1,78 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.FileFormats
{
public static class Format40
{
public static int DecodeInto(byte[] src, byte[] dest, int srcOffset)
{
var ctx = new FastByteReader(src, srcOffset);
var destIndex = 0;
while (true)
{
var i = ctx.ReadByte();
if ((i & 0x80) == 0)
{
var count = i & 0x7F;
if (count == 0)
{
// case 6
count = ctx.ReadByte();
var value = ctx.ReadByte();
for (var end = destIndex + count; destIndex < end; destIndex++)
dest[destIndex] ^= value;
}
else
{
// case 5
for (var end = destIndex + count; destIndex < end; destIndex++)
dest[destIndex] ^= ctx.ReadByte();
}
}
else
{
var count = i & 0x7F;
if (count == 0)
{
count = ctx.ReadWord();
if (count == 0)
return destIndex;
if ((count & 0x8000) == 0)
{
// case 2
destIndex += (count & 0x7FFF);
}
else if ((count & 0x4000) == 0)
{
// case 3
for (var end = destIndex + (count & 0x3FFF); destIndex < end; destIndex++)
dest[destIndex] ^= ctx.ReadByte();
}
else
{
// case 4
var value = ctx.ReadByte();
for (var end = destIndex + (count & 0x3FFF); destIndex < end; destIndex++)
dest[destIndex] ^= value;
}
}
else
{
// case 1
destIndex += count;
}
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -16,11 +16,12 @@ namespace OpenRA.FileFormats
class FastByteReader
{
readonly byte[] src;
int offset = 0;
int offset;
public FastByteReader(byte[] src)
public FastByteReader(byte[] src, int offset = 0)
{
this.src = src;
this.offset = offset;
}
public bool Done() { return offset >= src.Length; }
@@ -59,9 +60,9 @@ namespace OpenRA.FileFormats
}
}
public static int DecodeInto(byte[] src, byte[] dest)
public static int DecodeInto(byte[] src, byte[] dest, int srcOffset = 0)
{
var ctx = new FastByteReader(src);
var ctx = new FastByteReader(src, srcOffset);
var destIndex = 0;
while (true)
@@ -125,26 +126,78 @@ namespace OpenRA.FileFormats
}
}
static int CountSame(byte[] src, int offset, int maxCount)
{
maxCount = Math.Min(src.Length - offset, maxCount);
if (maxCount <= 0)
return 0;
var first = src[offset++];
var count = 1;
while (count < maxCount && src[offset++] == first)
count++;
return count;
}
static void WriteCopyBlocks(byte[] src, int offset, int count, MemoryStream output)
{
while (count > 0)
{
var writeNow = Math.Min(count, 0x3F);
output.WriteByte((byte)(0x80 | writeNow));
output.Write(src, offset, writeNow);
count -= writeNow;
offset += writeNow;
}
}
// Quick and dirty Format80 encoder version 2
// Uses raw copy and RLE compression
public static byte[] Encode(byte[] src)
{
/* quick & dirty format80 encoder -- only uses raw copy operator, terminated with a zero-run. */
/* this does not produce good compression, but it's valid format80 */
var ctx = new FastByteReader(src);
var ms = new MemoryStream();
do
using (var ms = new MemoryStream())
{
var len = Math.Min(ctx.Remaining(), 0x3F);
ms.WriteByte((byte)(0x80 | len));
while (len-- > 0)
ms.WriteByte(ctx.ReadByte());
var offset = 0;
var left = src.Length;
var blockStart = 0;
while (offset < left)
{
var repeatCount = CountSame(src, offset, 0xFFFF);
if (repeatCount >= 4)
{
// Write what we haven't written up to now
WriteCopyBlocks(src, blockStart, offset - blockStart, ms);
// Command 4: Repeat byte n times
ms.WriteByte(0xFE);
// Low byte
ms.WriteByte((byte)(repeatCount & 0xFF));
// High byte
ms.WriteByte((byte)(repeatCount >> 8));
// Value to repeat
ms.WriteByte(src[offset]);
offset += repeatCount;
blockStart = offset;
}
else
{
offset++;
}
}
// Write what we haven't written up to now
WriteCopyBlocks(src, blockStart, offset - blockStart, ms);
// Write terminator
ms.WriteByte(0x80);
return ms.ToArray();
}
while (!ctx.Done());
ms.WriteByte(0x80); // terminator -- 0-length run.
return ms.ToArray();
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -0,0 +1,99 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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;
namespace OpenRA.FileFormats
{
struct ImaAdpcmChunk
{
public int CompressedSize;
public int OutputSize;
public static ImaAdpcmChunk Read(Stream s)
{
ImaAdpcmChunk c;
c.CompressedSize = s.ReadUInt16();
c.OutputSize = s.ReadUInt16();
if (s.ReadUInt32() != 0xdeaf)
throw new InvalidDataException("Chunk header is bogus");
return c;
}
}
public static class ImaAdpcmLoader
{
static readonly int[] indexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 };
static readonly 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,
97, 107, 118, 130, 143, 157, 173, 190, 209,
230, 253, 279, 307, 337, 371, 408, 449, 494,
544, 598, 658, 724, 796, 876, 963, 1060, 1166,
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
};
static short DecodeImaAdpcmSample(byte b, ref int index, ref int current)
{
var sb = (b & 8) != 0;
b &= 7;
var delta = (stepTable[index] * b) / 4 + stepTable[index] / 8;
if (sb) delta = -delta;
current += delta;
if (current > short.MaxValue) current = short.MaxValue;
if (current < short.MinValue) current = short.MinValue;
index += indexAdjust[b];
if (index < 0) index = 0;
if (index > 88) index = 88;
return (short)current;
}
public static byte[] LoadImaAdpcmSound(byte[] raw, ref int index)
{
var currentSample = 0;
return LoadImaAdpcmSound(raw, ref index, ref currentSample);
}
public static byte[] LoadImaAdpcmSound(byte[] raw, ref int index, ref int currentSample)
{
var s = new MemoryStream(raw);
var dataSize = raw.Length;
var outputSize = raw.Length * 4;
var output = new byte[outputSize];
var offset = 0;
while (dataSize-- > 0)
{
var b = s.ReadUInt8();
var t = DecodeImaAdpcmSample(b, ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
t = DecodeImaAdpcmSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
}
return output;
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -33,7 +33,7 @@ namespace OpenRA.FileFormats
public void Load(Stream s)
{
StreamReader reader = new StreamReader(s);
var reader = new StreamReader(s);
IniSection currentSection = null;
while (!reader.EndOfStream)
@@ -55,10 +55,10 @@ namespace OpenRA.FileFormats
IniSection ProcessSection(string line)
{
Match m = sectionPattern.Match(line);
var m = sectionPattern.Match(line);
if (!m.Success)
return null;
string sectionName = m.Groups[1].Value.ToLowerInvariant();
var sectionName = m.Groups[1].Value.ToLowerInvariant();
IniSection ret;
if (!sections.TryGetValue(sectionName, out ret))
@@ -66,7 +66,7 @@ namespace OpenRA.FileFormats
return ret;
}
bool ProcessEntry(string line, IniSection currentSection)
static bool ProcessEntry(string line, IniSection currentSection)
{
var comment = line.IndexOf(';');
if (comment >= 0)
@@ -78,7 +78,7 @@ namespace OpenRA.FileFormats
var key = line;
var value = "";
int eq = line.IndexOf('=');
var eq = line.IndexOf('=');
if (eq >= 0)
{
key = line.Substring(0, eq);

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -18,7 +18,7 @@ using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace OpenRA.FileFormats.Graphics
namespace OpenRA.FileFormats
{
public static class PngLoader
{
@@ -39,7 +39,7 @@ namespace OpenRA.FileFormats.Graphics
Bitmap bitmap = null;
Color[] palette = null;
List<byte> data = new List<byte>();
var data = new List<byte>();
for (; ; )
{

View File

@@ -0,0 +1,80 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.IO;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
public class R8Reader : ISpriteSource
{
class R8Image : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get; private set; }
public float2 Offset { get; private set; }
public byte[] Data { get; set; }
public R8Image(Stream s)
{
// Scan forward until we find some data
var type = s.ReadUInt8();
while (type == 0)
type = s.ReadUInt8();
var width = s.ReadInt32();
var height = s.ReadInt32();
var x = s.ReadInt32();
var y = s.ReadInt32();
Size = new Size(width, height);
Offset = new int2(width / 2 - x, height / 2 - y);
/*var imageOffset = */
s.ReadInt32();
var paletteOffset = s.ReadInt32();
var bpp = s.ReadUInt8();
if (bpp != 8)
throw new InvalidDataException("Error: {0} bits per pixel are not supported.".F(bpp));
var frameHeight = s.ReadUInt8();
var frameWidth = s.ReadUInt8();
FrameSize = new Size(frameWidth, frameHeight);
// Skip alignment byte
s.ReadUInt8();
Data = s.ReadBytes(width * height);
// Ignore palette
if (type == 1 && paletteOffset != 0)
s.Seek(520, SeekOrigin.Current);
}
}
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return true; } }
public readonly int ImageCount;
public R8Reader(Stream stream)
{
var frames = new List<R8Image>();
while (stream.Position < stream.Length)
{
frames.Add(new R8Image(stream));
ImageCount++;
}
Frames = frames.ToArray().AsReadOnly();
}
}
}

View File

@@ -0,0 +1,123 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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 System.Text;
namespace OpenRA.FileFormats
{
public class ReplayMetadata
{
// Must be an invalid replay 'client' value
public const int MetaStartMarker = -1;
public const int MetaEndMarker = -2;
public const int MetaVersion = 0x00000001;
public readonly GameInformation GameInfo;
public string FilePath { get; private set; }
public ReplayMetadata(GameInformation info)
{
if (info == null)
throw new ArgumentNullException("info");
GameInfo = info;
}
ReplayMetadata(FileStream fs, string path)
{
FilePath = path;
// Read start marker
if (fs.ReadInt32() != MetaStartMarker)
throw new InvalidOperationException("Expected MetaStartMarker but found an invalid value.");
// Read version
var version = fs.ReadInt32();
if (version != MetaVersion)
throw new NotSupportedException("Metadata version {0} is not supported".F(version));
// Read game info (max 100K limit as a safeguard against corrupted files)
var data = fs.ReadString(Encoding.UTF8, 1024 * 100);
GameInfo = GameInformation.Deserialize(data);
}
public void Write(BinaryWriter writer)
{
// Write start marker & version
writer.Write(MetaStartMarker);
writer.Write(MetaVersion);
// Write data
var dataLength = 0;
{
// Write lobby info data
writer.Flush();
dataLength += writer.BaseStream.WriteString(Encoding.UTF8, GameInfo.Serialize());
}
// Write total length & end marker
writer.Write(dataLength);
writer.Write(MetaEndMarker);
}
public void RenameFile(string newFilenameWithoutExtension)
{
var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".rep";
File.Move(FilePath, newPath);
FilePath = newPath;
}
public static ReplayMetadata Read(string path)
{
using (var fs = new FileStream(path, FileMode.Open))
return Read(fs, path);
}
static ReplayMetadata Read(FileStream fs, string path)
{
if (!fs.CanSeek)
return null;
if (fs.Length < 20)
return null;
try
{
fs.Seek(-(4 + 4), SeekOrigin.End);
var dataLength = fs.ReadInt32();
if (fs.ReadInt32() == MetaEndMarker)
{
// go back by (end marker + length storage + data + version + start marker) bytes
fs.Seek(-(4 + 4 + dataLength + 4 + 4), SeekOrigin.Current);
try
{
return new ReplayMetadata(fs, path);
}
catch (InvalidOperationException ex)
{
Log.Write("debug", ex.ToString());
}
catch (NotSupportedException ex)
{
Log.Write("debug", ex.ToString());
}
}
}
catch (IOException ex)
{
Log.Write("debug", ex.ToString());
}
return null;
}
}
}

View File

@@ -0,0 +1,113 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.Drawing;
using System.IO;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
public class ShpD2Reader : ISpriteSource
{
[Flags] enum FormatFlags : int
{
PaletteTable = 1,
SkipFormat80 = 2,
VariableLengthTable = 4
}
class Frame : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get { return Size; } }
public float2 Offset { get { return float2.Zero; } }
public byte[] Data { get; set; }
public Frame(Stream s)
{
var flags = (FormatFlags)s.ReadUInt16();
s.Position += 1;
var width = s.ReadUInt16();
var height = s.ReadUInt8();
Size = new Size(width, height);
// Subtract header size
var dataLeft = s.ReadUInt16() - 10;
var dataSize = s.ReadUInt16();
byte[] table;
if ((flags & FormatFlags.PaletteTable) != 0)
{
var n = (flags & FormatFlags.VariableLengthTable) != 0 ? s.ReadUInt8() : (byte)16;
table = new byte[n];
for (var i = 0; i < n; i++)
table[i] = s.ReadUInt8();
dataLeft -= n;
}
else
{
table = new byte[256];
for (var i = 0; i < 256; i++)
table[i] = (byte)i;
table[1] = 0x7f;
table[2] = 0x7e;
table[3] = 0x7d;
table[4] = 0x7c;
}
Data = new byte[width * height];
// Decode image data
var compressed = s.ReadBytes(dataLeft);
if ((flags & FormatFlags.SkipFormat80) == 0)
{
var temp = new byte[dataSize];
Format80.DecodeInto(compressed, temp);
compressed = temp;
}
Format2.DecodeInto(compressed, Data, 0);
// Lookup values in lookup table
for (var j = 0; j < Data.Length; j++)
Data[j] = table[Data[j]];
}
}
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public ShpD2Reader(Stream s)
{
var imageCount = s.ReadUInt16();
// Last offset is pointer to end of file.
var offsets = new uint[imageCount + 1];
var temp = s.ReadUInt32();
// If fourth byte in file is non-zero, the offsets are two bytes each.
var twoByteOffset = (temp & 0xFF0000) > 0;
s.Position = 2;
for (var i = 0; i < imageCount + 1; i++)
offsets[i] = (twoByteOffset ? s.ReadUInt16() : s.ReadUInt32()) + 2;
var frames = new Frame[imageCount];
Frames = frames.AsReadOnly();
for (var i = 0; i < frames.Length; i++)
{
s.Position = offsets[i];
frames[i] = new Frame(s);
}
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,62 +8,67 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
enum Format { Format20 = 0x20, Format40 = 0x40, Format80 = 0x80 }
class ImageHeader : ISpriteFrame
{
public Size Size { get { return reader.Size; } }
public Size FrameSize { get { return reader.Size; } }
public float2 Offset { get { return float2.Zero; } }
public byte[] Data { get; set; }
public uint FileOffset;
public Format Format;
public uint RefOffset;
public Format RefFormat;
public ImageHeader RefImage;
ShpReader reader;
// Used by ShpWriter
public ImageHeader() { }
public ImageHeader(Stream stream, ShpReader reader)
{
this.reader = reader;
var data = stream.ReadUInt32();
FileOffset = data & 0xffffff;
Format = (Format)(data >> 24);
RefOffset = stream.ReadUInt16();
RefFormat = (Format)stream.ReadUInt16();
}
public void WriteTo(BinaryWriter writer)
{
writer.Write(FileOffset | ((uint)Format << 24));
writer.Write((ushort)RefOffset);
writer.Write((ushort)RefFormat);
}
}
public class ShpReader : ISpriteSource
{
readonly List<ImageHeader> headers = new List<ImageHeader>();
public IEnumerable<ISpriteFrame> Frames { get { return headers.Cast<ISpriteFrame>(); } }
enum Format { Format20 = 0x20, Format40 = 0x40, Format80 = 0x80 }
class ImageHeader : ISpriteFrame
{
public Size Size { get { return reader.Size; } }
public Size FrameSize { get { return reader.Size; } }
public float2 Offset { get { return float2.Zero; } }
public byte[] Data { get; set; }
public uint FileOffset;
public Format Format;
public uint RefOffset;
public Format RefFormat;
public ImageHeader RefImage;
ShpReader reader;
// Used by ShpWriter
public ImageHeader() { }
public ImageHeader(Stream stream, ShpReader reader)
{
this.reader = reader;
var data = stream.ReadUInt32();
FileOffset = data & 0xffffff;
Format = (Format)(data >> 24);
RefOffset = stream.ReadUInt16();
RefFormat = (Format)stream.ReadUInt16();
}
public void WriteTo(BinaryWriter writer)
{
writer.Write(FileOffset | ((uint)Format << 24));
writer.Write((ushort)RefOffset);
writer.Write((ushort)RefFormat);
}
}
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public readonly Size Size;
int recurseDepth = 0;
readonly int imageCount;
readonly long shpBytesFileOffset;
readonly byte[] shpBytes;
public ShpReader(Stream stream)
{
imageCount = stream.ReadUInt16();
@@ -73,8 +78,10 @@ namespace OpenRA.FileFormats
Size = new Size(width, height);
stream.Position += 4;
for (var i = 0; i < imageCount; i++)
headers.Add(new ImageHeader(stream, this));
var headers = new ImageHeader[imageCount];
Frames = headers.AsReadOnly();
for (var i = 0; i < headers.Length; i++)
headers[i] = new ImageHeader(stream, this);
// Skip eof and zero headers
stream.Position += 16;
@@ -85,28 +92,18 @@ namespace OpenRA.FileFormats
var h = headers[i];
if (h.Format == Format.Format20)
h.RefImage = headers[i - 1];
else if (h.Format == Format.Format40 && !offsets.TryGetValue(h.RefOffset, out h.RefImage))
throw new InvalidDataException("Reference doesnt point to image data {0}->{1}".F(h.FileOffset, h.RefOffset));
}
shpBytesFileOffset = stream.Position;
shpBytes = stream.ReadBytes((int)(stream.Length - stream.Position));
foreach (var h in headers)
Decompress(stream, h);
Decompress(h);
}
static byte[] ReadCompressedData(Stream stream, ImageHeader h)
{
stream.Position = h.FileOffset;
// Actually, far too big. There's no length field with the correct length though :(
var compressedLength = (int)(stream.Length - stream.Position);
var compressedBytes = new byte[compressedLength];
stream.Read(compressedBytes, 0, compressedLength);
return compressedBytes;
}
void Decompress(Stream stream, ImageHeader h)
void Decompress(ImageHeader h)
{
// No extra work is required for empty frames
if (h.Size.Width == 0 || h.Size.Height == 0)
@@ -123,19 +120,19 @@ namespace OpenRA.FileFormats
if (h.RefImage.Data == null)
{
++recurseDepth;
Decompress(stream, h.RefImage);
Decompress(h.RefImage);
--recurseDepth;
}
h.Data = CopyImageData(h.RefImage.Data);
Format40.DecodeInto(ReadCompressedData(stream, h), h.Data);
Format40.DecodeInto(shpBytes, h.Data, (int)(h.FileOffset - shpBytesFileOffset));
break;
}
case Format.Format80:
{
var imageBytes = new byte[Size.Width * Size.Height];
Format80.DecodeInto(ReadCompressedData(stream, h), imageBytes);
Format80.DecodeInto(shpBytes, imageBytes, (int)(h.FileOffset - shpBytesFileOffset));
h.Data = imageBytes;
break;
}
@@ -148,9 +145,7 @@ namespace OpenRA.FileFormats
byte[] CopyImageData(byte[] baseImage)
{
var imageData = new byte[Size.Width * Size.Height];
for (var i = 0; i < Size.Width * Size.Height; i++)
imageData[i] = baseImage[i];
Array.Copy(baseImage, imageData, imageData.Length);
return imageData;
}

View File

@@ -0,0 +1,103 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.Drawing;
using System.IO;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
public class ShpTSReader : ISpriteSource
{
class FrameHeader : ISpriteFrame
{
public Size Size { get; private set; }
public Size FrameSize { get; private set; }
public float2 Offset { get; private set; }
public byte[] Data { get; set; }
public readonly uint FileOffset;
public readonly byte Format;
public FrameHeader(Stream stream, Size frameSize)
{
var x = stream.ReadUInt16();
var y = stream.ReadUInt16();
var width = stream.ReadUInt16();
var height = stream.ReadUInt16();
// Note: the mixed Integer / fp division is intentional, and required for calculating the correct offset.
Offset = new float2(x + width / 2 - 0.5f * frameSize.Width, y + height / 2 - 0.5f * frameSize.Height);
Size = new Size(width, height);
FrameSize = frameSize;
Format = stream.ReadUInt8();
stream.Position += 11;
FileOffset = stream.ReadUInt32();
}
}
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public ShpTSReader(Stream stream)
{
stream.ReadUInt16();
var width = stream.ReadUInt16();
var height = stream.ReadUInt16();
var size = new Size(width, height);
var frameCount = stream.ReadUInt16();
var frames = new FrameHeader[frameCount];
Frames = frames.AsReadOnly();
for (var i = 0; i < frames.Length; i++)
frames[i] = new FrameHeader(stream, size);
for (var i = 0; i < frameCount; i++)
{
var f = frames[i];
if (f.FileOffset == 0)
continue;
stream.Position = f.FileOffset;
var frameSize = f.Size.Width * f.Size.Height;
// Uncompressed
if (f.Format == 1 || f.Format == 0)
f.Data = stream.ReadBytes(frameSize);
// Uncompressed scanlines
else if (f.Format == 2)
{
f.Data = new byte[frameSize];
for (var j = 0; j < f.Size.Height; j++)
{
var length = stream.ReadUInt16() - 2;
var offset = f.Size.Width * j;
stream.ReadBytes(f.Data, offset, length);
}
}
// RLE-zero compressed scanlines
else if (f.Format == 3)
{
f.Data = new byte[frameSize];
for (var j = 0; j < f.Size.Height; j++)
{
var length = stream.ReadUInt16() - 2;
var offset = f.Size.Width * j;
Format2.DecodeInto(stream.ReadBytes(length), f.Data, offset);
}
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,17 +8,15 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
public class TmpRAReader : ISpriteSource
{
readonly List<TmpTile> tiles = new List<TmpTile>();
public IEnumerable<ISpriteFrame> Frames { get { return tiles.Cast<ISpriteFrame>(); } }
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public TmpRAReader(Stream s)
@@ -35,15 +33,19 @@ namespace OpenRA.FileFormats
var indexStart = s.ReadInt32();
s.Position = indexStart;
foreach (byte b in s.ReadBytes(indexEnd - indexStart))
var count = indexEnd - indexStart;
var tiles = new TmpTile[count];
Frames = tiles.AsReadOnly();
var tilesIndex = 0;
foreach (var b in s.ReadBytes(count))
{
if (b != 255)
{
s.Position = imgStart + b * width * height;
tiles.Add(new TmpTile(s.ReadBytes(width * height), size));
tiles[tilesIndex++] = new TmpTile(s.ReadBytes(width * height), size);
}
else
tiles.Add(new TmpTile(null, size));
tiles[tilesIndex++] = new TmpTile(null, size);
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,10 +8,9 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.IO;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
@@ -36,8 +35,7 @@ namespace OpenRA.FileFormats
public class TmpTDReader : ISpriteSource
{
readonly List<TmpTile> tiles = new List<TmpTile>();
public IEnumerable<ISpriteFrame> Frames { get { return tiles.Cast<ISpriteFrame>(); } }
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public TmpTDReader(Stream s)
@@ -53,15 +51,19 @@ namespace OpenRA.FileFormats
var indexStart = s.ReadInt32();
s.Position = indexStart;
foreach (byte b in s.ReadBytes(indexEnd - indexStart))
var count = indexEnd - indexStart;
var tiles = new TmpTile[count];
Frames = tiles.AsReadOnly();
var tilesIndex = 0;
foreach (var b in s.ReadBytes(count))
{
if (b != 255)
{
s.Position = imgStart + b * width * height;
tiles.Add(new TmpTile(s.ReadBytes(width * height), size));
tiles[tilesIndex++] = new TmpTile(s.ReadBytes(width * height), size);
}
else
tiles.Add(new TmpTile(null, size));
tiles[tilesIndex++] = new TmpTile(null, size);
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,11 +8,10 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
namespace OpenRA.FileFormats
{
@@ -40,7 +39,7 @@ namespace OpenRA.FileFormats
for (var j = 0; j < width; j++)
Data[start + j] = s.ReadUInt8();
width += (i < size.Height / 2 - 1? 1 : -1) * 4;
width += (i < size.Height / 2 - 1 ? 1 : -1) * 4;
}
// Ignore Z-data for now
@@ -50,8 +49,7 @@ namespace OpenRA.FileFormats
public class TmpTSReader : ISpriteSource
{
readonly List<TmpTSTile> tiles = new List<TmpTSTile>();
public IEnumerable<ISpriteFrame> Frames { get { return tiles.Cast<ISpriteFrame>(); } }
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }
public bool CacheWhenLoadingTileset { get { return false; } }
public TmpTSReader(Stream s)
@@ -65,11 +63,14 @@ namespace OpenRA.FileFormats
for (var i = 0; i < offsets.Length; i++)
offsets[i] = s.ReadUInt32();
var tiles = new List<TmpTSTile>();
for (var i = 0; i < offsets.Length; i++)
{
s.Position = offsets[i];
tiles.Add(new TmpTSTile(s, size));
}
Frames = tiles.ToArray().AsReadOnly();
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -101,7 +101,7 @@ namespace OpenRA.FileFormats
// Frame offsets
offsets = new UInt32[Frames];
for (int i = 0; i < Frames; i++)
for (var i = 0; i < Frames; i++)
{
offsets[i] = stream.ReadUInt32();
if (offsets[i] > 0x40000000)
@@ -125,7 +125,7 @@ namespace OpenRA.FileFormats
var ms = new MemoryStream();
var adpcmIndex = 0;
bool compressed = false;
var compressed = false;
for (var i = 0; i < Frames; i++)
{
stream.Seek(offsets[i], SeekOrigin.Begin);
@@ -201,7 +201,7 @@ namespace OpenRA.FileFormats
// Chunks are aligned on even bytes; may be padded with a single null
if (s.Peek() == 0) s.ReadByte();
var type = s.ReadASCII(4);
int subchunkLength = (int)int2.Swap(s.ReadUInt32());
var subchunkLength = (int)int2.Swap(s.ReadUInt32());
switch(type)
{
@@ -235,11 +235,11 @@ namespace OpenRA.FileFormats
// Palette
case "CPL0":
for (int i = 0; i < numColors; i++)
for (var i = 0; i < numColors; i++)
{
byte r = (byte)(s.ReadUInt8() << 2);
byte g = (byte)(s.ReadUInt8() << 2);
byte b = (byte)(s.ReadUInt8() << 2);
var r = (byte)(s.ReadUInt8() << 2);
var g = (byte)(s.ReadUInt8() << 2);
var b = (byte)(s.ReadUInt8() << 2);
palette[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
break;
@@ -257,7 +257,7 @@ namespace OpenRA.FileFormats
int cachedFrame = -1;
void DecodeFrameData( int frame )
void DecodeFrameData()
{
cachedFrame = currentFrame;
for (var y = 0; y < blocks.Y; y++)
@@ -269,7 +269,7 @@ namespace OpenRA.FileFormats
for (var i = 0; i < blockWidth; i++)
{
var cbfi = (mod*256 + px)*8 + j*blockWidth + i;
byte color = (mod == 0x0f) ? px : cbf[cbfi];
var color = (mod == 0x0f) ? px : cbf[cbfi];
frameData[y*blockHeight + j, x*blockWidth + i] = palette[color];
}
}
@@ -280,7 +280,7 @@ namespace OpenRA.FileFormats
get
{
if (cachedFrame != currentFrame)
DecodeFrameData(currentFrame);
DecodeFrameData();
return frameData;
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -40,7 +40,7 @@ namespace OpenRA.FileFormats
uint BodySize;
void ReadVoxelData(Stream s, VxlLimb l)
static void ReadVoxelData(Stream s, VxlLimb l)
{
var baseSize = l.Size[0]*l.Size[1];
var colStart = new int[baseSize];
@@ -79,8 +79,8 @@ namespace OpenRA.FileFormats
s.Seek(dataStart + colStart[i], SeekOrigin.Begin);
byte x = (byte)(i % l.Size[0]);
byte y = (byte)(i / l.Size[0]);
var x = (byte)(i % l.Size[0]);
var y = (byte)(i / l.Size[0]);
byte z = 0;
l.VoxelMap[x,y] = new Dictionary<byte, VxlElement>();
do

View File

@@ -0,0 +1,178 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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;
namespace OpenRA.FileFormats
{
public class WavLoader
{
public readonly int FileSize;
public readonly string Format;
public readonly int FmtChunkSize;
public readonly int AudioFormat;
public readonly int Channels;
public readonly int SampleRate;
public readonly int ByteRate;
public readonly int BlockAlign;
public readonly int BitsPerSample;
public readonly int UncompressedSize;
public readonly int DataSize;
public readonly byte[] RawOutput;
public enum WaveType { Pcm = 0x1, ImaAdpcm = 0x11 };
public static WaveType Type { get; private set; }
public WavLoader(Stream s)
{
while (s.Position < s.Length)
{
if ((s.Position & 1) == 1)
s.ReadByte(); // Alignment
var type = s.ReadASCII(4);
switch (type)
{
case "RIFF":
FileSize = s.ReadInt32();
Format = s.ReadASCII(4);
if (Format != "WAVE")
throw new NotSupportedException("Not a canonical WAVE file.");
break;
case "fmt ":
FmtChunkSize = s.ReadInt32();
AudioFormat = s.ReadInt16();
Type = (WaveType)AudioFormat;
if (Type != WaveType.Pcm && Type != WaveType.ImaAdpcm)
throw new NotSupportedException("Compression type is not supported.");
Channels = s.ReadInt16();
SampleRate = s.ReadInt32();
ByteRate = s.ReadInt32();
BlockAlign = s.ReadInt16();
BitsPerSample = s.ReadInt16();
s.ReadBytes(FmtChunkSize - 16);
break;
case "fact":
{
var chunkSize = s.ReadInt32();
UncompressedSize = s.ReadInt32();
s.ReadBytes(chunkSize - 4);
}
break;
case "data":
DataSize = s.ReadInt32();
RawOutput = s.ReadBytes(DataSize);
break;
default:
// Ignore unknown chunks
{
var chunkSize = s.ReadInt32();
s.ReadBytes(chunkSize);
}
break;
}
}
if (Type == WaveType.ImaAdpcm)
{
RawOutput = DecodeImaAdpcmData();
BitsPerSample = 16;
}
}
public static float WaveLength(Stream s)
{
s.Position = 12;
var fmt = s.ReadASCII(4);
if (fmt != "fmt ")
return 0;
s.Position = 22;
var channels = s.ReadInt16();
var sampleRate = s.ReadInt32();
s.Position = 34;
var bitsPerSample = s.ReadInt16();
var length = s.Length * 8;
return length / (channels * sampleRate * bitsPerSample);
}
public byte[] DecodeImaAdpcmData()
{
var s = new MemoryStream(RawOutput);
var numBlocks = DataSize / BlockAlign;
var blockDataSize = BlockAlign - (Channels * 4);
var outputSize = UncompressedSize * Channels * 2;
var outOffset = 0;
var output = new byte[outputSize];
var predictor = new int[Channels];
var index = new int[Channels];
// 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
for (var c = 0; c < Channels; c++)
{
predictor[c] = s.ReadInt16();
index[c] = s.ReadUInt8();
/* unknown/reserved */ s.ReadUInt8();
// Output first sample from input
output[outOffset++] = (byte)predictor[c];
output[outOffset++] = (byte)(predictor[c] >> 8);
if (outOffset >= outputSize)
return output;
}
// Decode and output remaining data in this block
var blockOffset = 0;
while (blockOffset < blockDataSize)
{
for (var c = 0; c < Channels; c++)
{
// Decode 4 bytes (to 16 bytes of output) per channel
var chunk = s.ReadBytes(4);
var decoded = ImaAdpcmLoader.LoadImaAdpcmSound(chunk, ref index[c], ref predictor[c]);
// Interleave output, one sample per channel
var outOffsetChannel = outOffset + (2 * c);
for (var i = 0; i < decoded.Length; i += 2)
{
var outOffsetSample = outOffsetChannel + i;
if (outOffsetSample >= outputSize)
return output;
output[outOffsetSample] = decoded[i];
output[outOffsetSample + 1] = decoded[i + 1];
outOffsetChannel += 2 * (Channels - 1);
}
blockOffset += 4;
}
outOffset += 16 * Channels;
}
}
return output;
}
}
}

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,

View File

@@ -0,0 +1,111 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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.IO;
using System.Linq;
namespace OpenRA.FileSystem
{
public class BigFile : IFolder
{
public string Name { get; private set; }
public int Priority { get; private set; }
readonly Dictionary<string, Entry> entries = new Dictionary<string, Entry>();
public BigFile(string filename, int priority)
{
Name = filename;
Priority = priority;
var s = GlobalFileSystem.Open(filename);
if (s.ReadASCII(4) != "BIGF")
throw new InvalidDataException("Header is not BIGF");
// Total archive size.
s.ReadUInt32();
var entryCount = s.ReadUInt32();
if (BitConverter.IsLittleEndian)
entryCount = int2.Swap(entryCount);
// First entry offset? This is apparently bogus for EA's .big files
// and we don't have to try seeking there since the entries typically start next in EA's .big files.
s.ReadUInt32();
for (var i = 0; i < entryCount; i++)
{
var entry = new Entry(s);
entries.Add(entry.Path, entry);
}
}
class Entry
{
readonly Stream s;
readonly uint offset;
readonly uint size;
public readonly string Path;
public Entry(Stream s)
{
this.s = s;
offset = s.ReadUInt32();
size = s.ReadUInt32();
if (BitConverter.IsLittleEndian)
{
offset = int2.Swap(offset);
size = int2.Swap(size);
}
Path = s.ReadASCIIZ();
}
public Stream GetData()
{
s.Position = offset;
return new MemoryStream(s.ReadBytes((int)size));
}
}
public Stream GetContent(string filename)
{
return entries[filename].GetData();
}
public bool Exists(string filename)
{
return entries.ContainsKey(filename);
}
public IEnumerable<uint> ClassicHashes()
{
return entries.Keys.Select(filename => PackageEntry.HashFilename(filename, PackageHashType.Classic));
}
public IEnumerable<uint> CrcHashes()
{
return Enumerable.Empty<uint>();
}
public IEnumerable<string> AllFileNames()
{
return entries.Keys;
}
public void Write(Dictionary<string, byte[]> contents)
{
throw new NotImplementedException();
}
}
}

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