Compare commits

...

2798 Commits

Author SHA1 Message Date
Paul Chote
0d2a692d8d Fix bogus prereqs in ra. 2011-03-18 11:27:16 +13:00
Paul Chote
e043f38c00 Whoops, forgot to commit the changelog 2011-03-18 11:01:57 +13:00
alzeih
53f4337129 Don't change mods if the same one is selected in the dropdown 2011-03-18 10:49:29 +13:00
Paul Chote
eb69b697b1 Fix bogus handling of special keyboard characters everywhere else. Textfields now only accept valid characters, support right-delete. 2011-03-18 10:48:12 +13:00
Paul Chote
7d6d488176 Fix #549 - Shift + tab doesn't cycle build tabs backwards. 2011-03-18 09:44:28 +13:00
Paul Chote
c568759e49 Fix #595 - IDisposable crash. 2011-03-17 22:26:28 +13:00
Paul Chote
d05b979e53 Tweak cnc proc cashtick 2011-03-17 22:26:28 +13:00
Paul Chote
86e8c3974f Fix #611 - prereqs handled by traits. Make both cnc power plants valid for prereqs. 2011-03-17 22:26:28 +13:00
Paul Chote
6d1defc53e Use CashTick on harv unloading. 2011-03-17 22:24:17 +13:00
Paul Chote
ffac0221cf CashTick IEffect for Oil Derricks. 2011-03-17 22:24:17 +13:00
Chris Forbes
a3994df925 queries dies 2011-03-17 22:09:10 +13:00
Chris Forbes
caa52b2780 remove CachedView 2011-03-17 22:09:09 +13:00
Chris Forbes
149324ea92 remove most of the crap from queries 2011-03-17 22:09:08 +13:00
Chris Forbes
eba7641125 remove old Sell handler from Building 2011-03-17 22:08:53 +13:00
Chris Forbes
da36ce19e2 fix sellable compile fail 2011-03-17 20:09:43 +13:00
Chris Forbes
7e25947689 yaml changes for sellable 2011-03-17 19:14:20 +13:00
Chris Forbes
4eaa7d5cf2 split out Sellable into its own trait; yaml requires update 2011-03-17 19:14:17 +13:00
Chris Forbes
ff44e34d89 dont be detected by friendly detectors 2011-03-16 20:48:34 +13:00
Chris Forbes
8bef8d5a72 have spies appear a convincing color on radar too 2011-03-16 20:30:23 +13:00
Chris Forbes
048386e6fa add ExperienceInit (MapActor's 'Experience:' key, int) 2011-03-16 19:30:58 +13:00
Chris Forbes
f3dfc422ab fixed #635 2011-03-16 19:16:38 +13:00
Chris Forbes
3b89110202 fix some bogosity in MasterServerPinger (still not right) 2011-03-16 11:02:17 +13:00
Chris Forbes
73d27c822e add IgnoresDisguise; support it in AppearsHostileTo / AppearsFriendlyTo 2011-03-16 09:51:26 +13:00
Chris Forbes
a21deea60b spam the CellInfo messages into the debug log, not the chat 2011-03-15 12:18:08 +13:00
Chris Forbes
981e57bde8 some more overloads etc 2011-03-15 12:18:03 +13:00
Chris Forbes
c313920c7c include the utility in the core target, since the game needs it for package download now 2011-03-15 10:14:56 +13:00
Chris Forbes
cf9e81ea29 fix #645 2011-03-15 09:41:46 +13:00
Chris Forbes
4f79aca484 fix #643 2011-03-15 09:32:25 +13:00
Chris Forbes
5ad196acc3 fix #646 2011-03-15 09:30:24 +13:00
Chris Forbes
e66ebef73c some more bits for .gitignore 2011-03-15 09:29:19 +13:00
Paul Chote
c00d20e3c0 Update changelog 2011-03-13 21:22:13 +13:00
Paul Chote
795101aac9 Grenadiers explode on death 2011-03-13 21:21:16 +13:00
Paul Chote
0dd9a437b8 support power charge bars in cnc 2011-03-13 21:18:39 +13:00
Chris Forbes
febd92341f patched pchote's map 2011-03-13 15:54:33 +13:00
Chris Forbes
1368bc0731 missing project file change 2011-03-13 15:46:43 +13:00
alzeih
f4e4f987be RA - AppearsFriendlyTo and AppearsHostileTo actor extensions 2011-03-13 15:44:27 +13:00
alzeih
cf8cfdc42d SpyToolTip - Display tooltip of disguised unit to other players, and a modified one for the local player. 2011-03-13 14:14:32 +13:00
alzeih
26f1452930 text / text2 / text3 dies 2011-03-13 14:14:32 +13:00
alzeih
544befb553 Move disguise into Spy from RenderSpy 2011-03-13 14:14:32 +13:00
alzeih
b5efc97996 Fix #604 2011-03-13 12:26:37 +13:00
alzeih
22aa1308ce give GameServer some UsefulMods so we have the remote mod version in the ServerBrowser. 2011-03-13 12:26:27 +13:00
Chris Forbes
900e55900a fix boxes tooltip 'Tree' 2011-03-13 12:12:58 +13:00
Chris Forbes
116ef15fdb GotoNextBase dies in a fire; INotifyKeyPress dies 2011-03-13 12:12:57 +13:00
Paul Chote
3c41efea04 Check for GL extensions before we try to use things that may fail. 2011-03-13 02:46:16 +13:00
Paul Chote
c7d25bb991 Fix a crash with null textfields. 2011-03-13 02:32:48 +13:00
Chris Forbes
a33cca57ec fix a crash in perf graph 2011-03-13 02:27:32 +13:00
Chris Forbes
16eefe6280 increase strength of chrono effect 2011-03-13 00:44:31 +13:00
Chris Forbes
c9be0f44f4 spoilers: cursor dies 2011-03-13 00:39:37 +13:00
Chris Forbes
911ecb2ffa add missing copyright header to Mod.cs 2011-03-13 00:00:27 +13:00
Chris Forbes
56a8653bc6 #582 dont use water explosions for impacts ABOVE water 2011-03-12 23:41:28 +13:00
Chris Forbes
f58e9a2a99 do transport unload on 'f' 2011-03-12 23:34:59 +13:00
Chris Forbes
2eec1b2016 dont show yellow selection boxen 2011-03-12 23:34:58 +13:00
Paul Chote
d1dd3a64f8 Fix evw3 crash. 2011-03-12 23:32:41 +13:00
Chris Forbes
82dea40261 provide a way to grab the laggy clients 2011-03-12 22:55:40 +13:00
Chris Forbes
606873a09e fix warnings in Selectable.cs 2011-03-12 22:33:29 +13:00
Chris Forbes
fe90cbdab8 blah 2011-03-12 22:33:28 +13:00
Chris Forbes
8a14662bc1 remove unitinfluence debug, not needed anymore 2011-03-12 22:33:27 +13:00
Chris Forbes
cf6a1583c6 fix bogosity in SupportPowerManager 2011-03-12 22:33:26 +13:00
Chris Forbes
c3728ce674 blah 2011-03-12 22:33:25 +13:00
Chris Forbes
1e3f365cf2 move all the Game.Exts junk either down into FileFormats or into WorldUtils 2011-03-12 22:33:24 +13:00
Paul Chote
f4494d67b2 Kill chrome.xml. 2011-03-12 22:23:46 +13:00
Paul Chote
0cfbeab864 Export chrome.xml to yaml 2011-03-12 21:54:19 +13:00
Paul Chote
0084566478 Standalone radar widget for new sidebar 2011-03-12 18:58:42 +13:00
Paul Chote
631630fbff Custom button widget for new sidebar 2011-03-12 18:58:42 +13:00
Chris Forbes
19b2e3e521 #601 fixed -- dont require explicit port on Direct Connect 2011-03-12 18:52:35 +13:00
Chris Forbes
ed0ae15d49 fix interior boxes 2011-03-09 22:04:54 +13:00
Chris Forbes
fbc7200472 fix #572 crash when switching mods while playing music 2011-03-08 20:24:52 +13:00
Chris Forbes
0770524c05 add support power charge bar 2011-03-08 20:02:02 +13:00
Chris Forbes
6d36272134 #597 fix crash when spawning mapactors if there is no player in the slot. said actors are not spawned now. 2011-03-08 19:40:16 +13:00
Chris Forbes
e9a1c3f477 fix indent; make this work for Cg renderer too 2011-03-08 19:28:57 +13:00
Chris Forbes
16cb275a5f fix rendering of very large maps 2011-03-08 19:24:15 +13:00
Chris Forbes
682cfcd466 wire up BuildAnywhere so it actually works 2011-03-07 20:25:05 +13:00
Chris Forbes
14a2b68b7d add chrome + plumbing for BuildAnywhere devhack 2011-03-07 20:20:44 +13:00
Chris Forbes
7cf07f5765 make forcing evaluation of lazyness explicit 2011-03-07 19:53:39 +13:00
Chris Forbes
ae58da10bf remove some silly allocation from InvisibleToOthers 2011-03-06 11:35:31 +13:00
Chris Forbes
d7ed0233b0 fix crash with cloaking units and replays 2011-03-06 11:34:19 +13:00
Chris Forbes
020c2a8a4a fix a rare crash in cnc docking 2011-03-06 11:31:54 +13:00
Chris Forbes
d4f58015c7 issue the right order for deploy 2011-03-06 10:36:07 +13:00
Chris Forbes
10a546d3ae remap tsla to 'u' to remove conflict 2011-03-06 10:35:48 +13:00
Chris Forbes
65a54ba13a add audio feedback to stop/scatter/deploy junk 2011-03-06 10:22:40 +13:00
Chris Forbes
1a6ff61836 clean up dumb mess of exit-flags in WorldInteractionControllerWidget 2011-03-06 10:15:31 +13:00
Chris Forbes
d2d425731f change hotkey for ftur to 't' to free up 'f' for deploy/special 2011-03-06 10:14:51 +13:00
Chris Forbes
69ea44310b remove another 40M/min of boxing junk by specializing the key comparer on SpriteFont's dict 2011-03-06 08:59:25 +13:00
Chris Forbes
8d1a69e8ff enhance Cache to allow specializing the key comparer 2011-03-06 08:56:39 +13:00
Chris Forbes
516efa1dc8 remove another 11M/min from GainsExperience.ModifyRender 2011-03-05 22:17:51 +13:00
Chris Forbes
6971d6dbbb remove another 50M/min of delegates being constructed as part of the render 2011-03-05 22:15:03 +13:00
Chris Forbes
0480f1e984 Avoid constructing a delegate on every TraitDict query -- saving 250M/min 2011-03-05 21:53:23 +13:00
Chris Forbes
ea022a0e06 change PlayThen and PlayRepeating definitions to not allocate Action objects like crazy 2011-03-05 21:52:34 +13:00
Chris Forbes
269347ef01 specialize pair's comparison to do something sensible with <char,Color> saving 16M. 2011-03-05 21:51:49 +13:00
Chris Forbes
feecc70a4f remove another bit of insignificant but silly allocation 2011-03-05 18:49:50 +13:00
Chris Forbes
03bda8b511 strip all the allocation out of WaterPaletteRotation too (saves ~25M/min) 2011-03-05 18:34:52 +13:00
Chris Forbes
c1ad99bb99 dont allocate a full new palette texture every frame in HardwarePalette.Update 2011-03-05 18:29:30 +13:00
Chris Forbes
533df844d8 pool CellInfo[,] to save massive amounts of memory (now uses only 512K for CellInfos on default-sized maps) 2011-03-05 18:28:59 +13:00
Chris Forbes
9f92f50597 fix missing unload on jeep 2011-03-05 14:03:33 +13:00
Chris Forbes
94766263c5 add one passenger slot to jeep 2011-03-05 13:23:37 +13:00
Chris Forbes
298baac061 add rollovers for health/production 2011-03-05 13:19:13 +13:00
Chris Forbes
d9881885aa fix bots getting stuck in ra 2011-03-05 13:10:43 +13:00
Chris Forbes
a1f1b5882e fix crates dropping on buildings etc 2011-03-05 12:00:28 +13:00
Chris Forbes
a676bdae71 grenadiers have a 50% chance of exploding on death 2011-03-05 11:27:24 +13:00
Chris Forbes
d6c8bbd52a use Target stuff for Reservables 2011-03-05 11:16:33 +13:00
Chris Forbes
b7b9b68cc0 add Chance (%) value to Explodes: 2011-03-05 11:14:43 +13:00
Chris Forbes
85fe83d608 ignore reservations being collected in worlds other than the one the OM is attached to. 2011-03-05 11:09:56 +13:00
Chris Forbes
7c6d35e318 remove productionbar info leak 2011-03-05 10:10:42 +13:00
Chris Forbes
68de6a8f8b fix cnc tab art 2011-03-02 23:23:09 +13:00
Chris Forbes
43dccb073d support ProductionBar properly in cnc too 2011-03-02 23:22:57 +13:00
Chris Forbes
0bfcb4585c fix glitchy vis on exiting a transport 2011-03-02 23:13:32 +13:00
Chris Forbes
d1b632a4a0 normalize the handling of flares in paradrop and airstrike cases 2011-03-02 23:05:58 +13:00
Chris Forbes
9b2fe9fead make ftur suck less 2011-03-02 22:59:45 +13:00
Chris Forbes
604c8c590b fix vehicle speed on ore being insane 2011-03-02 22:51:05 +13:00
Chris Forbes
df5cb1ddf8 slightly reduce cost of 3tnk 2011-03-02 22:49:36 +13:00
Chris Forbes
1a599cb8c2 dont give ground control with defenses 2011-03-02 22:48:55 +13:00
Chris Forbes
89a96a9fe7 make ProductionBar actually work for all RA stuff 2011-03-02 22:35:44 +13:00
Chris Forbes
c62e025c45 add temp hacked ProductionBar -- not wired to ProductionQueue properly yet. 2011-03-02 22:20:34 +13:00
Chris Forbes
770dbcee52 tweak; save a bit of memory 2011-03-02 22:18:16 +13:00
Chris Forbes
036800531c add support for aux. bars in selection 2011-03-02 22:16:47 +13:00
Chris Forbes
338cff3c45 adjust DisplayHp EWMA 2011-03-02 22:11:00 +13:00
Chris Forbes
e122debc7a remove tent prereq on apc (made it useless) 2011-03-02 22:03:39 +13:00
Chris Forbes
0da7009eea shiny healthbars 2011-03-02 22:03:10 +13:00
Chris Forbes
4a71672a5f fix ftrk not firing over walls 2011-03-02 21:39:57 +13:00
Chris Forbes
9d91dba2d6 fix AA not firing over walls 2011-03-02 21:39:33 +13:00
Chris Forbes
662cf91bdc improve accuracy of arty 2011-03-02 21:37:38 +13:00
Chris Forbes
46987e1688 2/3/4tnk require fix 2011-03-02 21:30:09 +13:00
Chris Forbes
aec1724387 arty requires dome; apc buffed and goes to soviet 2011-03-02 21:29:04 +13:00
Chris Forbes
9ebf880158 increase dome cost to 1.4k 2011-03-02 21:27:40 +13:00
Chris Forbes
8dba72ecfa increase fix cost to 1k 2011-03-02 21:27:09 +13:00
Chris Forbes
a954d21210 tweaks to heli/hind 2011-03-02 21:20:11 +13:00
Chris Forbes
ad72c80bab actors without Health are not dead. 2011-03-02 20:56:46 +13:00
Chris Forbes
11384f692b remove bogus resx 2011-02-28 22:47:39 +13:00
Chris Forbes
772b3a2f9d only add Neutral player if it doesnt exist in the map definition. 2011-02-28 22:46:24 +13:00
Chris Forbes
8aaaf1e44c center error dialog 2011-02-28 22:36:45 +13:00
Chris Forbes
b878bde331 add graceful handling of bogus actor types in import 2011-02-28 22:36:23 +13:00
Chris Forbes
ea40cb015d fix dumb bug in map importer 2011-02-28 22:29:11 +13:00
Chris Forbes
12f8200a0b rename another handler in editor 2011-02-28 22:24:02 +13:00
Chris Forbes
4b853ca9e8 fix another issue with the importer -- it didnt bother to restore the current directory if canceled 2011-02-28 22:23:16 +13:00
Chris Forbes
88436bda45 add ability to throw nonfatal errors in the map importer, and display them. 2011-02-28 22:19:02 +13:00
Chris Forbes
c2b0cec2ea add a sensible error when trying to save a map using a bogus tileset 2011-02-28 22:18:44 +13:00
Chris Forbes
ba949126ab fix the other half of the prox desync 2011-02-28 20:39:24 +13:00
Chris Forbes
8d99652eea add option to show actor names in the editor 2011-02-28 20:36:33 +13:00
Chris Forbes
e1c0c24a47 fix lobby showing Closed with bot in some cases 2011-02-28 20:36:32 +13:00
Chris Forbes
42b88276b1 blah 2011-02-28 20:36:12 +13:00
Chris Forbes
39fef604c2 fix desync in ProximityCapturable 2011-02-28 20:36:02 +13:00
Chris Forbes
c5684fcba5 fix crash on startup 2011-02-28 20:35:09 +13:00
Paul Chote
ced2247af8 Add more info to Reservable dispose exception. 2011-02-26 13:05:58 +13:00
Paul Chote
f74d2318d8 Unreserve helipads on heli death. 2011-02-26 12:57:25 +13:00
Paul Chote
2ffc66416b Update INSTALL. 2011-02-26 00:58:55 +13:00
Paul Chote
05979a7a72 Remove cnc Wargames and Yellowstone II maps. 2011-02-25 11:29:43 +13:00
Chris Forbes
e5ef334941 fix noob error in TakeCover 2011-02-24 20:10:29 +13:00
Paul Chote
8e8b80ba85 Update seaside map by nudalz. 2011-02-24 20:08:32 +13:00
Chris Forbes
252d3e7981 move DefaultShellmapScript.cs into Missions/ 2011-02-24 18:50:17 +13:00
Chris Forbes
ad2ae8b763 report memory usage for textures 2011-02-24 18:48:55 +13:00
Chris Forbes
a8d849a1cb support TrailInterval on bullets too 2011-02-24 18:48:55 +13:00
Chris Forbes
551c94b77c add TrailInterval support for Missile 2011-02-24 18:48:55 +13:00
Chris Forbes
b90a90f8cc refactor texture code a bit 2011-02-24 18:48:54 +13:00
Paul Chote
869448296a Sync RTB path hash. 2011-02-24 17:51:41 +13:00
Paul Chote
7f39909dc8 Throw an exception if a reservation is eaten by the GC. Better to die early with a known error than to desync later. 2011-02-24 17:26:14 +13:00
Paul Chote
fa6a98cca3 Unreserve reservation on death. 2011-02-24 17:17:20 +13:00
Paul Chote
0723723b30 Upgrade maps to v5. 2011-02-23 22:02:48 +13:00
Paul Chote
1df42a7d5e Give upgraded mpspawns an owner. 2011-02-23 21:56:58 +13:00
Chris Forbes
e90177ca58 blah 2011-02-23 21:55:52 +13:00
Paul Chote
0f78fb22e5 add WIP evw3 map. 2011-02-23 21:55:52 +13:00
Paul Chote
ecf866f28a Allow editor to load a map via commandline. 2011-02-23 21:55:52 +13:00
Paul Chote
05e5ee7ca4 Update Rubicon, add new ra map by Arcturus 2011-02-23 21:55:49 +13:00
Paul Chote
5a30750e33 Fix VICE. 2011-02-23 21:54:58 +13:00
Paul Chote
754e45094c Remove ProximityCaptor from cnc. 2011-02-23 21:54:57 +13:00
Paul Chote
0bc8d37bdf Hacky fix for map upgrading 2011-02-17 22:31:07 +13:00
Paul Chote
89b7f3d725 Fix ra rules. 2011-02-17 22:17:00 +13:00
Paul Chote
169baf6df9 Fix ra sequences 2011-02-17 22:05:10 +13:00
Paul Chote
eb9054a4d6 Fix default ColorRamp 2011-02-17 21:50:16 +13:00
Paul Chote
d6e8b554d2 Only save non-default PlayerReference fields 2011-02-17 21:48:36 +13:00
Paul Chote
18d73aef53 Split out RenderInfantryPanic. 2011-02-17 21:38:04 +13:00
Paul Chote
06bf38b526 Split out RenderInfantryProne 2011-02-17 21:10:44 +13:00
Paul Chote
6b80cfc9d4 Refactoring 2011-02-17 20:52:47 +13:00
Paul Chote
9a04a7fa9f Move IdleAnimation into RenderInfantry 2011-02-17 20:15:20 +13:00
Paul Chote
4a3d254c0c Start RenderInfantry rework. TODO: fix ra sequences, split Prone/Panicked into RenderInfantry* overrides, integrate idle anims. 2011-02-17 19:53:58 +13:00
Chris Forbes
437caf9c12 fix map saving 2011-02-16 20:38:26 +13:00
Chris Forbes
30f05fb359 add another thirdparty map 2011-02-16 19:22:19 +13:00
Chris Forbes
618d109a49 embed the correct icon for the editor 2011-02-16 16:56:51 +13:00
Chris Forbes
40647b41e7 remove some crap 2011-02-16 11:51:05 +13:00
Paul Chote
266e2717f5 Remove AvoidUnitsNear pathfinding heuristic (causes problems with crates and crushing). 2011-02-15 22:51:32 +13:00
Paul Chote
3c9de06db0 Remove redundant sequences 2011-02-15 22:41:55 +13:00
Paul Chote
b6328b356c ScaredyCat trait for civilians. 2011-02-15 22:38:13 +13:00
Paul Chote
fa86502795 Emit e6,e1 on sell. 2011-02-15 22:17:43 +13:00
Paul Chote
df4a860dfe Fix crash on surrender 2011-02-15 22:17:25 +13:00
Chris Forbes
3e28fce7ba remove various leftover crap from editor 2011-02-15 16:18:14 +13:00
Chris Forbes
5bd9273a7d fix issues with mpspawn and waypoint sprites 2011-02-15 16:09:53 +13:00
Chris Forbes
2b85c7e0b9 fix stack overflow in Map.Resize() 2011-02-15 15:46:16 +13:00
Chris Forbes
786eafd7fa fix ra production (oops) 2011-02-15 08:28:50 +13:00
Chris Forbes
dd54f3b88b fix install script 2011-02-15 08:20:17 +13:00
Chris Forbes
d80f581e98 fix div-by-zero with empty minefield 2011-02-15 08:09:31 +13:00
Chris Forbes
99bbd0ec7a fixup bogus non-reinit of Producable in ProductionQueue; make initial race of a building sticky 2011-02-15 08:02:56 +13:00
Chris Forbes
7e4550e628 blah 2011-02-14 21:17:46 +13:00
Chris Forbes
d8b68a3250 #543 sam sites should start closed, when placed as mapactors 2011-02-14 21:15:28 +13:00
Chris Forbes
ce4b938ce5 #526 fixed (FIX speed increased) 2011-02-14 21:01:13 +13:00
Chris Forbes
bc32d32d54 remove FP from RepairableBuilding 2011-02-13 22:12:46 +13:00
Chris Forbes
0f0facedd1 #540 move 'allow cheats' to lobby from prelobby 2011-02-13 17:28:40 +13:00
Chris Forbes
447b34ab38 blah 2011-02-13 16:27:30 +13:00
Chris Forbes
c1aebff8a8 refresh GPS on stance change 2011-02-13 16:26:06 +13:00
Chris Forbes
6281fa481f add hook for stance change notifications 2011-02-13 16:22:34 +13:00
Chris Forbes
cbf95e8f1a fix #348 crash with blank game name 2011-02-13 16:16:40 +13:00
Chris Forbes
508130a87f only elevate on windows 6+ 2011-02-13 15:52:11 +13:00
Chris Forbes
c50b6f47f7 blah 2011-02-13 15:50:06 +13:00
Chris Forbes
f894705568 add chrisf's PNG loader for use by modding tools 2011-02-13 15:31:10 +13:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Paul Chote
ea5e2c0588 Blue tib should damage inf too. 2011-02-12 10:17:41 +13:00
Paul Chote
c5cf51185b define liedown, standup, cheer, die6 sequences for all cnc infantry (where applicable) 2011-02-12 10:13:26 +13:00
Paul Chote
8e87c63b0f Viceroids shouldn't smoke 2011-02-11 23:15:37 +13:00
Paul Chote
ab08273412 Improved death anim speeds 2011-02-11 23:11:06 +13:00
Paul Chote
03f014ffb9 Visceroid spawning. Add tib death anims for e1 and e2. Others will crash. 2011-02-11 23:05:01 +13:00
Paul Chote
51138fcdc3 Give VICE Chemspray weapon. Fix bogus armor assignments (will unbalance nearly everything, but give a better start for fixing things). 2011-02-11 22:25:16 +13:00
Paul Chote
1d1d0e8bd2 Lazy smudges, fix importer. 2011-02-11 21:50:11 +13:00
Paul Chote
79f3fccceb Lazy actor loading 2011-02-11 21:50:11 +13:00
Paul Chote
c2db816837 Kill MapStub 2011-02-11 21:50:11 +13:00
Paul Chote
73020a9419 Make binary info loading lazy 2011-02-11 21:50:11 +13:00
Paul Chote
b134ba41f4 Convert Waypoints to actors 2011-02-11 21:50:11 +13:00
Paul Chote
4a7be2e0c8 Remove redundant MapStub fields. 2011-02-11 21:50:11 +13:00
Paul Chote
c5d410938d Foo 2011-02-11 21:50:11 +13:00
Paul Chote
5f6d2df503 Drop support for older map formats. 2011-02-11 21:50:11 +13:00
Paul Chote
37ebda2847 Upgrade maps to format 4 2011-02-11 21:50:11 +13:00
Paul Chote
e761ce4998 Fix editor 2011-02-11 21:50:10 +13:00
Paul Chote
db770eb997 Bake PickAny tiles on map save. Translate maxvalue index to random tile for backwards compat. 2011-02-11 21:50:10 +13:00
Paul Chote
9407c55262 Drop TopLeft and BottomRight from MapFormat 5. Use Bounds directly. 2011-02-11 21:50:10 +13:00
Paul Chote
7332c5a6df Fix editor conversion 2011-02-11 21:50:10 +13:00
Paul Chote
6ef330c357 Fix Waypoint == Startpoint assumption in MapFormat 5. 2011-02-11 21:50:10 +13:00
Paul Chote
8844ca0fdd Add (laser-)viceroids. Needs a proper weapon. 2011-02-11 21:50:10 +13:00
Paul Chote
48482cf09a Add an AttackWander trait for creeps. Remove a pile of bogosity from AttackMove. 2011-02-11 21:50:10 +13:00
Paul Chote
fae355f5b6 Add support for a "Creeps" faction that is hostile to all combatant players. Add a mod field to be used for map installation. 2011-02-11 21:50:10 +13:00
Chris Forbes
56952c1ab8 put RA AA structures in their own group for range circles 2011-02-11 07:11:30 +13:00
Chris Forbes
a515f95aed adjust range circle rendering 2011-02-11 07:11:29 +13:00
Chris Forbes
bfa38e3058 display range circles for other actors owned by us, and having a compatible RenderRangeCircleInfo.RangeCircleType during building placement 2011-02-11 07:11:29 +13:00
Chris Forbes
b0beee6b7b fetch the max range from AttackBaseInfo rather than making it up completely 2011-02-11 07:11:28 +13:00
Chris Forbes
3369373879 initial setup for decorating the PlaceBuilding OG 2011-02-11 07:11:28 +13:00
Paul Chote
9d73299595 Append CHANGELOG to debian changelog. 2011-02-10 20:24:02 +13:00
Paul Chote
d9fe383ce6 Remove obsoleted code 2011-02-10 20:24:01 +13:00
Paul Chote
2559092983 Place a minimum requirement on mono-runtime to prevent fail on ubuntu 10.04. 2011-02-10 20:24:01 +13:00
Paul Chote
bb8c1912ca Delicious copy pastas 2011-02-10 20:24:01 +13:00
Paul Chote
9da906d751 Fix a typo 2011-02-10 20:24:01 +13:00
Paul Chote
734c90f85e Write a utility wrapper for linux. Untested / Unfinished. 2011-02-10 20:24:01 +13:00
Caleb Anderson
03bbe8d0a0 Windowed mode defaults to center of screen 2011-02-10 19:26:49 +13:00
Paul Chote
7402f8e4f7 Follow suit with rpm and arch packages. Untested. 2011-02-08 16:32:01 +13:00
Paul Chote
695ca4a23b Simplify the uploader script. Untested. 2011-02-08 16:27:02 +13:00
Paul Chote
627d275e84 Don't pass ftp user/pass on the commandline. openra user on the build machine has a .netrc setup with the correct credentials. 2011-02-08 15:54:59 +13:00
Paul Chote
5f8e2ccf5c Fix a typo in the upload script. 2011-02-08 15:39:39 +13:00
Paul Chote
3794a6b5f2 Use debian naming conventions for .deb. 2011-02-08 14:44:56 +13:00
Paul Chote
501155da0d Remove unnecessary renaming of windows and mac packages. 2011-02-08 14:18:46 +13:00
Paul Chote
5f6dd59743 Packaging changes: Include CHANGELOG, use full tag as version string. 2011-02-08 14:08:31 +13:00
Paul Chote
65b580374e Update CHANGELOG 2011-02-07 22:52:47 +13:00
Paul Chote
a4f1e5f103 Add Rubicon map by Arcturus 2011-02-07 22:45:00 +13:00
Paul Chote
0bd733d7a0 Fix bogus rebase 2011-02-07 20:10:52 +13:00
Chris Forbes
23c0524738 fix utility elevation 2011-02-07 18:51:12 +13:00
Paul Chote
e2af08f812 Add a scatter key 2011-02-06 13:15:47 +13:00
Paul Chote
47aad3b04b Remove unused LocalStorage from proc. 2011-02-06 13:10:09 +13:00
Paul Chote
e3fda8c68e Remove unused stance code 2011-02-06 13:06:39 +13:00
Paul Chote
7f8e75c089 Update changelog with current changes. 2011-02-06 11:11:42 +13:00
Paul Chote
b3967a3d8d Add a CHANGELOG file containing release history. 2011-02-06 10:30:31 +13:00
Chris Forbes
1ee788f095 fix uploader so it actually works 2011-02-06 09:38:19 +13:00
Matthew Bowra-Dean
700b6d6d5e Packaging changes for new website. 2011-02-06 09:38:19 +13:00
geckosoft
0f17fa34a8 Added ProximityCaptor and filtering of possible captors for KOTH 2011-02-05 19:22:06 +13:00
Paul Chote
de26b63fd2 Fix capturing etc 2011-02-05 18:13:30 +13:00
Paul Chote
4b0ab1c461 Remove detectors from subs (prevents them from revealing themselves) 2011-02-05 12:45:32 +13:00
Paul Chote
0c954367a0 Fix installing ra from disk 2011-02-05 12:44:33 +13:00
Paul Chote
8765e986b1 Fix cnc download size 2011-02-05 12:34:05 +13:00
Chris Forbes
ed6a83db89 reduce scope of OpenRA.Utility.Program.actions 2011-02-05 11:54:33 +13:00
Chris Forbes
6afbb5550a fix some more stuff in utility 2011-02-05 11:54:33 +13:00
Chris Forbes
8d41f0d680 blah 2011-02-05 11:54:32 +13:00
Chris Forbes
3d5f00fbe9 more cleanup 2011-02-05 11:54:32 +13:00
Chris Forbes
c3c16c4fd8 remove some duplication in Utility 2011-02-05 11:54:31 +13:00
Chris Forbes
2fa4285281 fix crap init of constant dict in utility 2011-02-05 11:54:31 +13:00
Paul Chote
7693f3d16a Craters and scorches smoke. 2011-02-05 09:19:31 +13:00
Paul Chote
afcb724793 Fix subcell crushing properly. 2011-02-05 08:47:53 +13:00
Paul Chote
639a7e316b Fix crates 2011-02-04 21:49:18 +13:00
Paul Chote
fdb85d67eb Disable map and music install until they can be finished. 2011-02-04 20:36:18 +13:00
Paul Chote
0ddcff7ec7 Apply some misc balance stick to cnc 2011-02-04 20:17:58 +13:00
Paul Chote
c79ac2f504 Fix dead actor crash 2011-02-04 20:05:42 +13:00
Chris Forbes
39a9bd7e20 Fix GPS being given to *everyone* 2011-02-04 18:45:47 +13:00
Paul Chote
504fe9e427 Fix infantry group damage 2011-02-04 18:39:04 +13:00
Paul Chote
45e89491d7 Work around a crash. 2011-02-04 18:39:04 +13:00
Paul Chote
b69388b5e7 Fix jerky movement 2011-02-04 18:39:03 +13:00
Paul Chote
e28ed916aa Improve spacing 2011-02-04 18:39:03 +13:00
Paul Chote
310556877f Fix GDI01 2011-02-04 18:39:03 +13:00
Paul Chote
9c63292a83 Allow units to move between subcells. Visually not quite right. 2011-02-04 18:39:03 +13:00
Chris Forbes
4aaafd18f1 fix compile failure 2011-02-04 18:39:03 +13:00
Paul Chote
73a08624ef Hacky fix for group movement 2011-02-04 18:39:03 +13:00
Paul Chote
7c2a7db794 Fold SharesCell into Mobile 2011-02-04 18:39:03 +13:00
Paul Chote
4b3c6cc62a Add a SubCell field to UIM. Allow UIM to query for units by subcell. 2011-02-04 18:39:03 +13:00
Paul Chote
451e06190f Sync harvester contents. Add ISync to ProductionQueue. 2011-02-03 08:27:35 +13:00
Paul Chote
bf2f3cacd9 Sync ProductionQueue 2011-02-02 10:33:33 +13:00
Paul Chote
8002ed0893 (cnc) Support structures don't grant build radius. 2011-02-02 09:22:23 +13:00
Paul Chote
d85411f816 SAM and ATWR require power (#518 and #519). 2011-02-02 09:12:51 +13:00
Paul Chote
2daeb45bfe Fix a subtle bug with flying units in spatialbins. Fixes #489. 2011-02-01 22:06:09 +13:00
Paul Chote
467c2a969d Fix missiles 2011-02-01 18:19:38 +13:00
Chris Forbes
ee144373a0 Fix unshareable GPS 2011-02-01 18:08:21 +13:00
Paul Chote
e234816c13 Extract parameters into Info for mods to tweak. 2011-02-01 17:11:17 +13:00
Paul Chote
8fca705077 Sam sites take 50% damage when closed. 2011-01-31 21:21:38 +13:00
Paul Chote
5f65d4102b cnc sams rotate to home position before closing, lower ROT to something sane. 2011-01-31 21:17:07 +13:00
Paul Chote
cd5e7409ef First attempt. Problems: doesn't move back to zero-facing before closing. Flickers turret-up frame sometimes when being attacked. 2011-01-30 23:11:16 +13:00
Chris Forbes
0c4bf5b2b3 split Target out into its own file 2011-01-30 21:47:04 +13:00
Chris Forbes
51ab2b4969 fix targets staying valid across owner changes 2011-01-30 21:45:08 +13:00
Paul Chote
6e1cb23f10 "Repairing" eva notification for ra and cnc. 2011-01-30 18:35:44 +13:00
Chris Forbes
d595b36cf5 add note in legacymapimporter about colorramp bitrot 2011-01-30 17:47:44 +13:00
Chris Forbes
c8a68659a0 add INotifyOtherCaptured, for reacting to other units changing ownership 2011-01-30 17:43:25 +13:00
Chris Forbes
a0926a49ec hack around bad interaction between firing anims and idle anims finishing 2011-01-30 17:38:34 +13:00
Paul Chote
ccf04240cf Fix some more cases of stale Player references after capture. 2011-01-30 17:35:40 +13:00
Paul Chote
7f3f783187 Update cached PlayerResources when a silo is captured. 2011-01-30 17:35:40 +13:00
Chris Forbes
7a4380e7bd fix exploitable SetStance order 2011-01-30 17:33:04 +13:00
Chris Forbes
79a46272ac remove some crap from viewport 2011-01-30 17:27:39 +13:00
Chris Forbes
1c8cd44465 fix bogosity in SpecialPowerBinWidget (manifests as crash after mod change) 2011-01-30 16:53:20 +13:00
Chris Forbes
3c9891cdea blah 2011-01-30 15:55:46 +13:00
Matthew Bowra-Dean
7b7900bda2 [windows] Fix mod sections in installer to not show expansion buttons. 2011-01-30 14:29:26 +13:00
Chris Forbes
39aa171425 fix visibility of perf graph in ingame and observer roots too. 2011-01-30 14:23:09 +13:00
Chris Forbes
5fce6ec2c4 blah 2011-01-30 14:23:08 +13:00
Chris Forbes
4be20e7aac move waypoint namer into WaypointTool 2011-01-30 14:23:07 +13:00
Chris Forbes
40f88e5c47 clean up editor drawing code some more 2011-01-30 14:23:07 +13:00
Chris Forbes
81468a5190 yet more duplication removal 2011-01-30 14:23:06 +13:00
Chris Forbes
c3b08a60b8 more cleanup 2011-01-30 14:23:06 +13:00
Chris Forbes
8874b6ef72 remove an unused function 2011-01-30 14:23:05 +13:00
Chris Forbes
1dc8de3fc1 split out hardcoded editor tools into ITool impls 2011-01-30 14:23:05 +13:00
Paul Chote
4b538fd2fe Fix palette issues with Oil Derricks and walls (fixes #501). 2011-01-29 13:21:55 +13:00
Paul Chote
9b17bfe697 Fix AFLD production eva (#494). 2011-01-29 13:04:26 +13:00
Paul Chote
d45db9eb9c Shift production audio onto ProductionQueue. 2011-01-29 12:58:56 +13:00
Paul Chote
9a4fb0a5b9 Fix RMBO c4 2011-01-29 12:10:07 +13:00
Chris Forbes
4d7cf23521 updated Nuclear Winter maps from nudalz 2011-01-28 18:40:54 +13:00
Chris Forbes
1e241ebd56 fix editor init 2011-01-28 18:37:00 +13:00
Chris Forbes
add5c0ee6d restore ability to force mod on commandline in editor 2011-01-28 18:10:40 +13:00
Chris Forbes
95e259db3b slightly clean up usings 2011-01-28 18:07:07 +13:00
Chris Forbes
ce8d787a9c fix crash in build palette keyboard handler after winning/losing 2011-01-28 17:32:35 +13:00
Chris Forbes
a8d848b3c4 fix LockTeams checkbox by not using the binder 2011-01-28 17:31:24 +13:00
Paul Chote
0f3b6a7cd4 Add nuclear winter' and seaside' maps by nudalz. 2011-01-28 17:18:06 +13:00
Paul Chote
22c146d056 Fix mod selector visibility on returning to main menu. 2011-01-28 16:42:07 +13:00
Paul Chote
1185386f96 [windows] Remove mod-specific start menu shortcuts and don't download packages in the installer. 2011-01-28 09:15:38 +13:00
Paul Chote
08fd311c4b Hide cnc install `From CD' button. 2011-01-28 09:10:14 +13:00
Paul Chote
687406ccbd Remove mod.html 2011-01-28 09:01:06 +13:00
Paul Chote
37f26c652b Fix installing from cd 2011-01-28 08:59:55 +13:00
Matthew Bowra-Dean
3aac953522 Removed outdated debian menu file. 2011-01-28 08:49:33 +13:00
Matthew Bowra-Dean
5d623b6ca8 Add mod selector to map editor. 2011-01-28 08:49:33 +13:00
Chris Forbes
e543c3b8c1 fix cursors in ra mod 2011-01-28 08:22:23 +13:00
Chris Forbes
6ddce1c171 remove shared 'window' field, fix crashes in GameIniDelegate 2011-01-28 07:34:57 +13:00
Chris Forbes
d3ddefbaa3 add ActionQueue, rather than leaving random variables lying around in Game.cs 2011-01-27 21:46:36 +13:00
Chris Forbes
c1fefe0b96 fix projectfile so it compiles 2011-01-27 21:25:07 +13:00
Paul Chote
8470399a0c [osx] Load packages from the support dir. 2011-01-27 20:50:04 +13:00
Paul Chote
492c025844 Load last mod on startup. 2011-01-27 20:50:04 +13:00
Paul Chote
38b98bf358 Hide the menubar only when going fullscreen. 2011-01-27 20:50:04 +13:00
Paul Chote
746c3d068c Use the existing settings mechanism for --settings-value. Allows the defaults to be queried. 2011-01-27 20:50:04 +13:00
Paul Chote
562d07f11a Fix sln 2011-01-27 20:50:03 +13:00
Paul Chote
ef462c5164 Take SpecialPackageRoot into account when installing packages 2011-01-27 20:50:03 +13:00
Paul Chote
817ac42954 Call as non-admin if gksudo and kdesu aren't available. 2011-01-27 20:50:03 +13:00
Matthew Bowra-Dean
1474cd147a Executable permissions on openra-bin 2011-01-27 20:50:03 +13:00
Matthew Bowra-Dean
d74c93c66e Fixed syntax error in package-all.sh. 2011-01-27 20:50:03 +13:00
Matthew Bowra-Dean
4eaf97f90e Reverted packaging changes from launchers. 2011-01-27 20:50:03 +13:00
Paul Chote
a81c865620 Install Music button - installing not implemented. 2011-01-27 20:50:03 +13:00
Paul Chote
1c67242210 Fix prompt title. 2011-01-27 20:50:03 +13:00
Paul Chote
96a6bda142 Remove obsolete maps dir 2011-01-27 20:50:03 +13:00
Paul Chote
580b9014b3 Install map button (does not verify that maps are valid). 2011-01-27 20:50:03 +13:00
Matthew Bowra-Dean
4c053dae24 Elevation for utility app on unix platforms that have gksudo or kdesudo. Small change to Folder.cs to create empty folder if it doesn't exist. 2011-01-27 20:50:03 +13:00
Paul Chote
1bdadb6631 Clear widgets on mod change 2011-01-27 20:50:03 +13:00
Paul Chote
646863b85b Remove unused InitDelegates() method. Don't mutate the Children list directly. 2011-01-27 20:50:03 +13:00
Paul Chote
3fe549d0a4 don't fork bomb. 2011-01-27 20:50:02 +13:00
Paul Chote
5353ae32a6 Authenticate windows commands. Untested. 2011-01-27 20:50:02 +13:00
Paul Chote
a6900c256d Implement --display-filepicker in OpenRA.Utility. Remove all the functionality that windows doesn't support. 2011-01-27 20:50:02 +13:00
Paul Chote
44d8e83773 Rework OpenRA.Utility 2011-01-27 20:50:02 +13:00
Paul Chote
c93bdf73aa Have a single utility app per platform. Route zip extraction and ra package install to the .net utility app under osx. 2011-01-27 20:50:02 +13:00
Paul Chote
8e5f307ba8 Remove some duplication 2011-01-27 20:50:02 +13:00
Paul Chote
724a72c98e Show the mod switcher during the initial install screen. 2011-01-27 20:50:02 +13:00
Paul Chote
a3f26cec46 Fix sound after mod switching. 2011-01-27 20:50:02 +13:00
Paul Chote
aa319ee403 Begin refactoring utility process launching. 2011-01-27 20:50:02 +13:00
Paul Chote
388e5df377 Show mod version in the main menu. 2011-01-27 20:50:02 +13:00
Paul Chote
d39adf67b2 Indeterminate progress bar 2011-01-27 20:50:02 +13:00
Paul Chote
3609de8ca5 Fix compile warnings 2011-01-27 20:50:02 +13:00
Paul Chote
be9d8d96ce Fix the utility app 2011-01-27 20:50:02 +13:00
Paul Chote
2c0a928b48 Fix terrain being drawn using the cursor palette. 2011-01-27 20:50:02 +13:00
Paul Chote
11aab8705e Display the selector in all menus. Fix information leakage from previous mod. 2011-01-27 20:50:01 +13:00
Paul Chote
37fc836b46 Ingame mod selector ui. 2011-01-27 20:50:01 +13:00
Paul Chote
f44903b50f Support ingame mod switching. 2011-01-27 20:50:01 +13:00
Paul Chote
d32e2be941 Extract zips using background thread. 2011-01-27 20:50:01 +13:00
Paul Chote
84cc94bcb6 Implement install from cd for ra (the cnc installshield decompressor is bugged, so not implementing it yet). 2011-01-27 20:50:01 +13:00
Paul Chote
9227e09f18 Refactoring. Add a missing file. 2011-01-27 20:50:01 +13:00
Paul Chote
b7357b1711 Fix crash when canceling download, fix a runtime warning in osx. 2011-01-27 20:50:01 +13:00
Paul Chote
792c82c2d4 Automatically extract packages. Fix ra. 2011-01-27 20:50:01 +13:00
Paul Chote
5ce5d48b04 Extracting packages 2011-01-27 20:50:01 +13:00
Paul Chote
775ccc112b Progress bars. 2011-01-27 20:50:01 +13:00
Paul Chote
421058866d Better install menu and package downloading. 2011-01-27 20:50:01 +13:00
Paul Chote
7dad013b31 Fix cnc. 2011-01-27 20:50:01 +13:00
Paul Chote
42a5b0a993 Fix the hyperspeed shellmap by setting the initial tick time *after* we're done loading. 2011-01-27 20:50:00 +13:00
Paul Chote
ea9003d6fc Port cursors to yaml. 2011-01-27 20:50:00 +13:00
Paul Chote
827a19adef Fix the cursor during init. 2011-01-27 20:50:00 +13:00
Paul Chote
6a90f00298 Start tidying things up 2011-01-27 20:50:00 +13:00
Paul Chote
abcc43222a Add missing files. 2011-01-27 20:50:00 +13:00
Paul Chote
908a927929 Add "Install from web" "Install from CD" and "Quit" buttons to the install menu. "From CD" prompts a system file picker (osx only). 2011-01-27 20:50:00 +13:00
Paul Chote
6c14b78b7c Load the game into an intermediate state where RAInitDelegate can install packages, etc (an even bigger hack). 2011-01-27 20:50:00 +13:00
Paul Chote
6776d6f906 Load the main menu without loading mixes or creating a shellmap world. A giant hack. 2011-01-27 20:50:00 +13:00
Paul Chote
8d2a78abc6 Expose a native filepicker dialog. 2011-01-27 20:50:00 +13:00
Paul Chote
108b90f192 Allow the ra/cnc package dir to be overridden at launch-time. 2011-01-27 20:50:00 +13:00
Paul Chote
3c1f5e18f9 Use Pseudofullscreen under all platforms by default. 2011-01-27 20:50:00 +13:00
Paul Chote
cae65ddd05 Gut the osx launcher of everything except for the necessary platform shims (Ensure mono is installed, set DYLD_LIBRARY_PATH, Hide dock/menubar if running in fullscreen).
TODO: Parse the yaml to disable menubar only if running fullscreen, register openra:// urls.
2011-01-27 20:50:00 +13:00
Chris Forbes
8cda9d6d8b restore previous sequence after IdleAnimation; apply randomness to idle animation wait 2011-01-27 18:36:36 +13:00
Paul Chote
0bd466a9e9 Use a lookup table for fvecs. 2011-01-27 12:05:13 +13:00
Paul Chote
9db41f5638 Remove fp from facing calculation. 2011-01-27 12:01:02 +13:00
Chris Forbes
ad0e0a18bd fix format80 encoder to actually work 2011-01-26 21:47:54 +13:00
Chris Forbes
6f807c4501 fix bogus writing of EOF header 2011-01-26 21:47:53 +13:00
Chris Forbes
1b3f769f34 shp writer 2011-01-26 21:47:53 +13:00
Chris Forbes
848622054d unstatic SpriteLoader 2011-01-26 21:09:07 +13:00
Chris Forbes
f032322948 remove System.Xml using from SequenceProvider 2011-01-26 21:07:54 +13:00
Chris Forbes
1d7f57941e rename SpriteSheetBuilder to SpriteLoader; it's dumb otherwise 2011-01-26 21:07:54 +13:00
Chris Forbes
0f84ac5215 RenderBuilding.BuildingPreview pushed down to RenderSimple and renamed to .RenderPreview() 2011-01-26 21:06:05 +13:00
Chris Forbes
e6c6e8aa96 remove a bit of dumb duplication 2011-01-26 21:06:05 +13:00
Chris Forbes
180d58c35a only bother hashing traits that have ISync 2011-01-26 21:00:31 +13:00
Chris Forbes
f52620f6fc add ISync to all traits that have [Sync] members 2011-01-26 21:00:28 +13:00
Chris Forbes
b7ea695f0c better error when no sequences defined at all 2011-01-26 20:55:23 +13:00
Paul Chote
272ba08c21 Likewise for PlayerResources 2011-01-25 18:26:15 +13:00
Paul Chote
58f1589f95 Add debug traits to Aircraft so we can see what is desyncing. 2011-01-25 18:19:36 +13:00
Paul Chote
b9e32e5c06 Load maps from <support dir>/maps/<mod>/ too. 2011-01-21 17:38:28 +13:00
Paul Chote
2fca9b0b19 Fix broken first tick rendering in BuildPaletteWidget. 2011-01-20 00:51:13 +13:00
Paul Chote
1fb42f47b6 Remove redundant serverbrowser checks (these are now handled by the handshake process). 2011-01-20 00:32:43 +13:00
Paul Chote
481cc7807b Don't require a WorldRenderer to draw non-world-rendering widgets. 2011-01-19 20:41:32 +13:00
Paul Chote
e3c090a201 More drop messages. 2011-01-15 13:56:52 +13:00
Paul Chote
2f31928a53 Fix packaging clean script. 2011-01-15 13:51:38 +13:00
Paul Chote
06612d0f68 Add a mechanism for custom drop messages. Implement for kick. 2011-01-15 13:49:46 +13:00
Chris Forbes
d835c14988 fix crash in windows launcher 2011-01-11 11:25:50 +13:00
Chris Forbes
a25087a9f3 fix weap door crash in cnc 2011-01-09 17:32:59 +13:00
Chris Forbes
b362d9f9fc fix bogus interpretation of range parameter 2011-01-09 16:09:58 +13:00
Chris Forbes
cb3eca9d5f remove unused NukeLaunch.Silo field 2011-01-09 14:26:32 +13:00
Chris Forbes
4b3f0e9a4b fix breakage in ServerBrowserDelegate which prevented any joins 2011-01-09 14:23:50 +13:00
Chris Forbes
808cc59c59 fix bogus colors in chat 2011-01-09 14:02:15 +13:00
Chris Forbes
727d72123f sync GpsPower.Granted 2011-01-09 13:35:25 +13:00
Chris Forbes
c76822531e shareable, revokable gps 2011-01-09 13:31:53 +13:00
Chris Forbes
9387029b51 remove some sillyness in PlayerResources.Tick 2011-01-09 13:24:54 +13:00
Chris Forbes
b4109b12ca less dumb PlayerResources init 2011-01-09 13:23:29 +13:00
Chris Forbes
70afea85a9 new map format introduced: 4. format3 player colors are automatically upgraded to ColorRamp 2011-01-08 18:17:19 +13:00
Chris Forbes
3426b52247 add ColorRamp type; change everything to use it; maps not yet upgraded 2011-01-08 18:17:18 +13:00
Chris Forbes
e2ff40dc7f better fix for chrono bug 2011-01-08 17:30:29 +13:00
Chris Forbes
07abeffc5e #363 tabs should change color visibly when a building is ready 2011-01-08 16:22:18 +13:00
Chris Forbes
126e200e2e fix chronoshift/shroud interaction desync 2011-01-08 16:08:05 +13:00
alzeih
5c343caeaf Mod version validation
- Game.CurrentMods property to query the current mods when no orderManager accessible
- Server sends mod versions to master server on ping
- Client sends mod versions on handshake response
- Validate match on server side of handshake, not client side
2011-01-08 16:00:29 +13:00
Paul Chote
8264c6c8dc Play "Unable to build more" eva when the production exit is blocked. Also fixes #484. 2011-01-08 13:15:30 +13:00
Chris Forbes
db63724aeb add contrast surround to timer & chat which are displayed straight over the world 2011-01-08 12:21:12 +13:00
Chris Forbes
303525a5ba be fast by default; add 'Check Sync around Unsynced Code' option in debug panel 2011-01-08 11:49:31 +13:00
Chris Forbes
93a56f9a18 #250 resources should have a list of allowed terrain types 2011-01-08 09:31:36 +13:00
Chris Forbes
712eb437ea blah 2011-01-07 20:38:36 +13:00
Paul Chote
e46b00f9c4 Missed a file when unmangling a dirty rebase. 2011-01-07 20:33:14 +13:00
Paul Chote
9f38df013e Target uses int2. 2011-01-07 20:21:47 +13:00
Paul Chote
60e3f7621f Remove fp from CenterLocation and aircraft. 2011-01-07 20:14:22 +13:00
Paul Chote
d395c5e05d Remove dead helicopter instability code, and some unnecessary fp. 2011-01-07 20:00:53 +13:00
Chris Forbes
975682c57b fix silly debug popup in JSBridge 2011-01-07 15:34:28 +13:00
Matthew Bowra-Dean
e50dc9a550 Remove arch 64 package for the moment until packaging tools are sorted out 2011-01-07 15:29:50 +13:00
Matthew Bowra-Dean
63ee3ebf9f Make sure build root is correct (no override from rpmmacros). 2011-01-07 15:29:50 +13:00
Matthew Bowra-Dean
a993116085 Few more changes to rpm. 2011-01-07 15:29:49 +13:00
Matthew Bowra-Dean
eb158e6d21 pkgbuild and RPM fixes 2011-01-07 15:29:48 +13:00
Matthew Bowra-Dean
6a7c968e25 More fixes. 2011-01-07 15:29:47 +13:00
Matthew Bowra-Dean
5665d40e29 Separate root dirs for different architectures. 2011-01-07 15:29:47 +13:00
Matthew Bowra-Dean
3aff455fba Fix some syntax errors 2011-01-07 15:29:46 +13:00
Matthew Bowra-Dean
0d038f00ba 64bit linux packages 2011-01-07 15:29:45 +13:00
Paul Chote
8dcba13491 Fix osx launcher. 2011-01-06 18:51:40 +13:00
Paul Chote
0cef2e4f53 CheckboxWidget delegate methods. 2011-01-06 11:40:06 +13:00
Paul Chote
7443b3ce89 Fix button MouseUp handling. 2011-01-05 23:19:37 +13:00
Paul Chote
7cabe920db Restrict ClickThrough to what it was originally intended for. 2011-01-05 23:15:03 +13:00
Paul Chote
5254deedcb Remove some bogosity from widget mouse handling. 2011-01-05 23:01:17 +13:00
Paul Chote
df460d7407 Add extension methods to Rectangle/RectangleF, remove a pile of ToPoint()'s. 2011-01-05 22:24:11 +13:00
Paul Chote
3e1db3e8ae Move MapPreviewWidget.HandleInputInner to the lobby delegate. 2011-01-05 22:23:23 +13:00
Paul Chote
7b5b84b1b7 Unstatic MakeButton and MakeModifiers. Fixes mouse clicks in vs `Release' builds. 2011-01-05 15:32:21 +13:00
Paul Chote
2e9a0b8162 Fix for nonstandard mono paths. 2011-01-05 15:26:47 +13:00
Paul Chote
22bf9e7aff Further refactoring of Repair. 2011-01-05 13:29:38 +13:00
Paul Chote
40b0408ce7 Fix #453. Bogus crash when desyncing. 2011-01-05 13:09:25 +13:00
Paul Chote
c6fb1b641e Fix MouseButton orthogonality and remove unnecessary winforms dep. 2011-01-05 12:56:11 +13:00
Matthew Bowra-Dean
6998871adf Fix GTK launcher to change to correct working directory. 2011-01-05 09:13:53 +13:00
Matthew Bowra-Dean
2885fbb99b Few more tweaks to packaging 2011-01-05 09:13:37 +13:00
Chris Forbes
cc1c183d66 fix initial placement and facing of mig/yak on afld 2011-01-05 09:12:29 +13:00
Chris Forbes
418284672c clean up some potential fp misbehavior in Repair.cs 2011-01-05 09:12:29 +13:00
Chris Forbes
558647b987 blah 2011-01-05 09:12:28 +13:00
Chris Forbes
f03e6e6258 make it sortof work 2011-01-05 09:12:28 +13:00
Chris Forbes
f44ac769bf use a closure for the request state rather than dicts 2011-01-05 09:12:27 +13:00
Paul Chote
e02ed86088 Content mix files may be inside main.mix. redalert.mix should always be there. 2011-01-04 20:18:54 +13:00
Chris Forbes
dcbb6ee4eb small tweak to HttpUtil - we don't support 1.1, so dont pretend we do; also, set WebClient.Proxy everywhere to null 2011-01-04 20:02:23 +13:00
Chris Forbes
fe720186f5 add fast HttpUtil.DownloadData() 2011-01-04 17:53:00 +13:00
Matthew Bowra-Dean
0803d10746 Changed linux package target platforms to i686 (due to gtklauncher) 2011-01-04 17:50:55 +13:00
Matthew Bowra-Dean
d26ee1094a Rework GTK launcher and linux packages slightly 2011-01-04 17:35:50 +13:00
Matthew Bowra-Dean
68a38c85f9 Uses process IDs in dictionary for httpRequests 2011-01-04 17:34:07 +13:00
Matthew Bowra-Dean
4de390d173 Fix missed call to Call function in Windows launcher. 2011-01-04 17:34:07 +13:00
Matthew Bowra-Dean
fb8812a7fd Fix for concurrent child processes while using pipes for IPC. 2011-01-04 17:34:07 +13:00
Paul Chote
c8a74ef05a fix make install. 2011-01-04 17:12:03 +13:00
Paul Chote
de562939d4 Hacky fix for LabelWidget eating our MouseMove events. 2011-01-04 14:42:38 +13:00
Paul Chote
cc356bcfee Refactoring. 2011-01-04 14:34:00 +13:00
Paul Chote
ece50b0d57 RA Harvester docking sequence. 2011-01-04 14:34:00 +13:00
Paul Chote
76216b8dd9 Move damage sounds and shaking from Building/RenderBuilding into their own traits. Fix wall damage/death sounds under cnc. 2011-01-04 14:34:00 +13:00
Paul Chote
4a47641656 Tweak cnc wall sounds. 2011-01-04 14:34:00 +13:00
Paul Chote
03185fe46b Fix #429. Capturable Oil Derricks. 2011-01-04 14:34:00 +13:00
Paul Chote
cbd3baa6d4 Fix #469. C&C Nuke detonation sound. 2011-01-04 14:33:59 +13:00
Paul Chote
6287b132a0 #438. Show # Players in the map selector. 2011-01-04 14:33:59 +13:00
Paul Chote
6e7156e023 Mousewheel scrolls ScrollPanel. 2011-01-04 14:33:59 +13:00
Paul Chote
1ced0d7ab9 Require LMB for common widget interactions. 2011-01-04 14:33:59 +13:00
Chris Forbes
abeffbbbf7 fix a bunch of errors in the editor; fix minimap export to not suck 2011-01-04 13:45:10 +13:00
Chris Forbes
7f7c7217ba fix missing includes in gtklaunch 2011-01-04 12:53:33 +13:00
Matthew Bowra-Dean
a4de4cc266 Added renderer selection to GTK launcher. 2011-01-02 16:12:07 +13:00
Matthew Bowra-Dean
8ead8635c2 Updated dependencies for gtk launcher, statically link libmicrohttpd 2011-01-02 16:12:07 +13:00
Matthew Bowra-Dean
ecea2471ca Updated linux packaging scripts to remove the need for post install actions and to use the launcher. 2011-01-02 16:12:06 +13:00
Matthew Bowra-Dean
a3e67611e6 Use graphical sudo client for operations that potentially require elevation in gtk launcher. 2011-01-02 16:12:05 +13:00
Matthew Bowra-Dean
562ab0eee0 httpRequest implemented properly in Windows launcher. 2011-01-02 16:12:05 +13:00
Matthew Bowra-Dean
ad478e8872 httpRequest JS bridge function implemented in gtk launcher. 2011-01-02 16:12:04 +13:00
Matthew Bowra-Dean
ec572635b7 metadata JS bridge function implemented. 2011-01-02 16:12:04 +13:00
Matthew Bowra-Dean
44fae60dbd String handling in JS bridge changed to safer glib functions. Added path sanitization. 2011-01-02 16:12:03 +13:00
Matthew Bowra-Dean
0a1e6d16bd Converted most of GTK launcher to use glib's string functions. 2011-01-02 16:12:03 +13:00
Matthew
9739e7f51f Download extraction in GTK+ Launcher. 2011-01-02 16:12:02 +13:00
Matthew
1e4196e8d3 Download cancellation 2011-01-02 16:12:02 +13:00
Matthew Bowra-Dean
2e309b46e8 Downloading works. Still to come: cancelling downloads and extraction. 2011-01-02 16:12:01 +13:00
Matthew Bowra-Dean
5991ecdcf5 Makefile target for gtklauncher. 2011-01-02 16:12:01 +13:00
Matthew Bowra-Dean
360c572e14 launchMod working in JS bridge. 2011-01-02 16:12:00 +13:00
Matthew Bowra-Dean
16a84ba86e Selects last played mod in launcher. 2011-01-02 16:12:00 +13:00
Matthew Bowra-Dean
fcec3cb590 Updated utility app for better compatibility with GTK launcher. 2011-01-02 16:11:59 +13:00
Matthew Bowra-Dean
61f7e1df7f Generate mod tree in GTK tree view. 2011-01-02 16:11:59 +13:00
Matthew Bowra-Dean
650195e31c Utility app helper functions for listing mods in the GTK+ launcher. 2011-01-02 16:11:58 +13:00
Matthew Bowra-Dean
6fbc7bc7c4 Print mod list in an order where dependencies come after prerequisites. 2011-01-02 16:11:58 +13:00
Matthew Bowra-Dean
7e41e75643 Made existsInMod work, added stub for launchMod. 2011-01-02 16:11:57 +13:00
Matthew Bowra-Dean
df00b8cf23 Some refactoring. 2011-01-02 16:11:57 +13:00
Matthew Bowra-Dean
69ee1399b9 Bind to JavaScriptCore. Serve files through embedded web server. 2011-01-02 16:11:56 +13:00
Matthew Bowra-Dean
a561dd376e Proof of concept browser + embedded web server communicating via XMLHttpRequest.
Compile with "gcc -Wall `pkg-config --cflags --libs gtk+-2.0 webkit-1.0 libmicrohttpd` -o launcher main.c server.c"
Requires GTK, libwebkit and libmicrohttpd.
2011-01-02 16:11:55 +13:00
Matthew Bowra-Dean
c9bd3e8a1f Start of GTK launcher in C.
Webkit embedded in GTK window.
2011-01-02 16:11:55 +13:00
Matthew Bowra-Dean
a4493f48d5 httpRequest in win launcher uses utility program. Clean up usings and add missing license notices. 2011-01-02 16:11:54 +13:00
Paul Chote
de5d9abec3 Delayed unloading. Remove LocalStorage from proc. 2011-01-02 15:27:29 +13:00
Paul Chote
3674accd0c Improved cnc proc/harv docking. 2011-01-02 14:56:29 +13:00
Paul Chote
9ffdce7957 Fix #439; Dropdowns stay open when the host force-starts the game. 2011-01-02 14:54:25 +13:00
Paul Chote
38df0a28cd Remove fp from building refund calculation. 2011-01-02 14:54:25 +13:00
Paul Chote
f659f55801 Sync StoresOre.Stored 2011-01-02 14:54:25 +13:00
Paul Chote
f3da258763 Remove GetSiloFullness. 2011-01-02 14:54:25 +13:00
Chris Forbes
2048900c10 fix some dumbness in Production/ITeleportable 2011-01-02 14:41:48 +13:00
Chris Forbes
7b5a8cf089 #394 nuke without a launch site crashes -- fixed 2011-01-01 21:52:43 +13:00
Chris Forbes
a4bbce32b8 cleanup SyncReport.cs header 2011-01-01 21:43:37 +13:00
Chris Forbes
19aed01822 show real player names in syncreport 2011-01-01 21:42:57 +13:00
Chris Forbes
ba2ec557bc fix another dumb bug in ZipFile 2011-01-01 21:24:42 +13:00
Paul Chote
a8b4e640e7 Fix dropdown lists. Visual tweaks. 2011-01-01 17:54:09 +13:00
Paul Chote
d1966ab476 Improved scrollpanel thumb behavior. 2011-01-01 17:21:40 +13:00
Paul Chote
d90dec9c8e Remove a pile of unnecessary state management from Scrollpanels. 2011-01-01 16:47:52 +13:00
Chris Forbes
e2b739cd3e fix bogus spawn on central-conflict 2011-01-01 15:29:45 +13:00
Chris Forbes
dffb5293d0 hack up ZipFile to fix #464; filesystem needs rework to be sane 2011-01-01 15:28:07 +13:00
Chris Forbes
cf2ad68a7c add very basic Format80 encoder 2011-01-01 09:27:39 +13:00
Chris Forbes
119b0c063d don't show a kick button for the host while ready 2011-01-01 00:20:04 +13:00
Paul Chote
b948b9d2b7 Draggable thumbs 2010-12-31 23:59:23 +13:00
Paul Chote
d98e09e096 Draw scrollbar thumbs. 2010-12-31 23:19:13 +13:00
Chris Forbes
cf17bc7e5c clean up perf graph a bit 2010-12-31 20:31:57 +13:00
Paul Chote
42096cc5c9 Foo 2010-12-31 18:26:03 +13:00
Paul Chote
1d3b2334d0 Drop any remaining connections on gamestart. 2010-12-31 17:47:44 +13:00
Paul Chote
64304635b7 Fix dropping unvalidated clients. 2010-12-31 16:52:17 +13:00
Paul Chote
dc9de20553 Fix packaging scripts for BSD sed. 2010-12-31 13:36:37 +13:00
Paul Chote
486fa9a978 Handshake mod versions and map. Bump the protocol version. 2010-12-31 13:35:21 +13:00
Paul Chote
e2d1eec56e Shift Client creation to the client, sent in the handshake response. Fixes the `Newbie' bug and removes a lot of fragmented behaviour on player join. 2010-12-31 12:51:19 +13:00
Paul Chote
8f9e32dcc0 Client/server handshake. Only checks that the correct mods are active. 2010-12-31 11:41:25 +13:00
Paul Chote
dc012c0faf Fix server shutdown crash under mono. 2010-12-30 20:29:11 +13:00
Paul Chote
4f6f3eb80d Upgrade maps to oramap format. Save type field. 2010-12-30 18:00:44 +13:00
Paul Chote
fd49ca75d7 Forgot launcher files. 2010-12-30 17:51:23 +13:00
Paul Chote
cb50182fac Bugfixes: ZipFile.GetInputStream().GetAllBytes/.Length doesn't work; Divide by zero when no shellmaps are available; UseAsShellmap isn't saved by the editor; Duplicate maps crashes game. 2010-12-30 17:43:44 +13:00
Paul Chote
47bbc3a6de Wire up the rest of saving. Save-as will now properly overwrite existing contents. 2010-12-30 17:43:44 +13:00
Paul Chote
39ed6087cb Use utility app for http requests; Make them async. 2010-12-30 15:17:56 +13:00
Matthew Bowra-Dean
428999fc0b Create an empty zip file if it doesn't exist. 2010-12-30 02:21:39 +13:00
Paul Chote
b7975031bc Wire up most of saving again. 2010-12-29 22:13:51 +13:00
Paul Chote
e652a15b01 Remove some duplication 2010-12-29 21:41:04 +13:00
Paul Chote
fc6438e311 Use Filepaths instead of IFolders where possible. 2010-12-29 21:25:43 +13:00
Paul Chote
829fe6530a Start fixing the editor 2010-12-29 19:03:45 +13:00
Paul Chote
58797c0d37 packaging cleanup script. 2010-12-29 17:52:16 +13:00
Paul Chote
f6d9923305 Add SharpZipLib dep to INSTALL. 2010-12-29 11:51:29 +13:00
Paul Chote
c3ff679f3a Make map saving independent of Container type. Saving zip/oramap/mix untested as the editor cannot load non-folder maps. 2010-12-29 11:39:26 +13:00
Chris Forbes
fa36c71023 fix game failing to load compressed maps; convert 'a path beyond.' 2010-12-29 00:55:10 +13:00
Matthew
d4033f57bc Fix Makefile for Ubuntu. 2010-12-28 23:10:44 +13:00
Matthew Bowra-Dean
13f6a13ad9 Write maps to zip file from editor 2010-12-28 22:36:08 +13:00
Chris Forbes
44e668e804 choose a random map with MapStub.UseAsShellmap as the shellmap, rather than hardcoding a sha1 in mod.yaml; add editor support for the new flag too. 2010-12-28 19:13:56 +13:00
Chris Forbes
aecf19ed64 fix hash of RA shellmap 2010-12-28 19:04:33 +13:00
Chris Forbes
2a0c0bb991 remove unused Game.ConnectedToLobby event 2010-12-28 18:54:10 +13:00
Chris Forbes
99a0bd9609 remove legacy .uid junk 2010-12-28 18:53:15 +13:00
Chris Forbes
c20b3b90f4 dont use the .uid file hack -- compute them on demand 2010-12-28 18:52:19 +13:00
Chris Forbes
1cee570207 blah 2010-12-28 18:44:44 +13:00
Chris Forbes
382435e629 blah 2010-12-28 18:42:46 +13:00
Chris Forbes
637dbee32f remove support for loading from maps/ 2010-12-28 18:41:46 +13:00
Chris Forbes
81f6843791 bind .oramap -> ZipFile; search for .zip and .oramap in the map enumerator 2010-12-28 18:40:52 +13:00
Chris Forbes
cc6d445ef1 blah 2010-12-28 18:32:18 +13:00
Chris Forbes
cc2efdfa4a start reworking map enumerator 2010-12-28 18:27:40 +13:00
Chris Forbes
f7b34e1c5e #339 heli spawn offset is wrong fixed, and ReservableProduction folded back into Production 2010-12-28 18:27:00 +13:00
Chris Forbes
4d0f3b1554 #447 lock teams by default 2010-12-28 17:33:16 +13:00
Chris Forbes
ae1710896a add a tiny font; add labels in PerfGraphWidget 2010-12-28 17:24:20 +13:00
Chris Forbes
6425fc8a4b #268 fixed 2010-12-28 17:01:01 +13:00
Chris Forbes
38d267e439 fix sln file 2010-12-28 16:34:49 +13:00
Chris Forbes
95cf0bb827 fix bogus version subst. 2010-12-28 14:53:31 +13:00
Chris Forbes
d42bdfa102 show replays most recent first 2010-12-27 21:22:32 +13:00
Chris Forbes
5a7c62e24a fix bogus formatstring in ChooseReplayFilename() 2010-12-27 21:19:38 +13:00
Chris Forbes
29818ba60c remove dead RejoinLobby function 2010-12-27 21:10:58 +13:00
Chris Forbes
1c4f4b7886 removing some duplication 2010-12-27 21:03:51 +13:00
Chris Forbes
e127095437 remove some dumb state-tracking from OreRefinery 2010-12-27 20:03:19 +13:00
Chris Forbes
d8eaa7c841 shuffle exits 2010-12-27 19:43:32 +13:00
Chris Forbes
888fe35f08 make repath much less aggressive while attacking, to fix perf 2010-12-27 19:17:02 +13:00
Chris Forbes
59fdbe8725 CanTargetUnit -> CanTargetUnit 2010-12-27 18:43:32 +13:00
Chris Forbes
24a5b3ba03 simplification 2010-12-27 18:42:28 +13:00
Chris Forbes
9d768fa1c1 move some MobileInfo-related bits onto MobileInfo 2010-12-27 18:41:07 +13:00
Chris Forbes
31b98c0eb4 fix misleading name 2010-12-27 18:36:06 +13:00
Chris Forbes
3dd52a59c9 work around a verifier limitation 2010-12-27 18:30:24 +13:00
Chris Forbes
f3997ba3bd blah 2010-12-27 18:26:13 +13:00
Chris Forbes
4a94cf656b remove a redundant method from queries. 2010-12-27 18:26:12 +13:00
Chris Forbes
439bb7d02f multiplying by 0 makes the world hard to sync 2010-12-27 18:26:11 +13:00
Chris Forbes
9ad23b10f0 fix chronoshift being hard to cancel 2010-12-27 18:26:11 +13:00
Chris Forbes
e2a0134c5b not java. 2010-12-27 18:26:10 +13:00
Chris Forbes
c6f1740875 add a note for later 2010-12-27 18:26:09 +13:00
Chris Forbes
50834911fe don't disable everyone's shroud when someone's GPS goes up 2010-12-27 18:26:08 +13:00
Chris Forbes
2cce1ce23c fix warnings, and bogosity in projectfiles 2010-12-27 18:26:07 +13:00
Chris Forbes
3d47584cd8 use bidi pathing for moving into range (MoveToAdjacent-style hack) 2010-12-27 15:33:59 +13:00
Chris Forbes
3ce055da80 fix cnc mod script the same way 2010-12-24 14:13:12 +13:00
Chris Forbes
51d3743b18 fix ra mod script 2010-12-24 14:12:06 +13:00
Chris Forbes
ce609195cd make kicking actually work 2010-12-24 12:31:37 +13:00
Chris Forbes
54cf2e7993 add kick command to LobbyCommands 2010-12-24 12:31:36 +13:00
Paul Chote
b5b6b47e95 Implement metadata and httpRequest in the windows launcher. Untested. 2010-12-24 12:13:28 +13:00
Paul Chote
6ff0e41650 Remove fp from Aircraft. 2010-12-24 12:01:39 +13:00
Paul Chote
fcdb3b536d Latest version and MOTD in osx launcher. 2010-12-24 11:41:35 +13:00
Paul Chote
14ad5099a0 Show the mod version in the launcher 2010-12-24 11:41:35 +13:00
Paul Chote
dc3bf2515a Remove VERSION file, and version / motd display from the ingame menu. Write git-version into the individual mod versions. 2010-12-24 11:41:35 +13:00
Paul Chote
275dfc43be New launch mechanism: removes wrapper app bundle, and supports paths with spaces. 2010-12-24 11:41:34 +13:00
Chris Forbes
3149f3efa2 fix up some of the capturing duplication 2010-12-23 14:25:39 +13:00
Chris Forbes
e8a85db309 squash some warnings 2010-12-23 08:50:07 +13:00
Chris Forbes
c1fb6c2732 remove ability to not save syncreports 2010-12-23 08:48:54 +13:00
Chris Forbes
68e8565561 reduce size of attack forces to reduce base blockages 2010-12-23 08:42:45 +13:00
Chris Forbes
92e6570f50 fix a crash, add a normal bot (harder) 2010-12-23 08:42:45 +13:00
Chris Forbes
e94e21fd32 add name to cnc bot too 2010-12-23 08:42:44 +13:00
Chris Forbes
d320a689a2 wire up bot creation properly in CreateMPPlayers etc 2010-12-23 08:42:44 +13:00
Chris Forbes
29fbeb2c5d add enumeration of bots 2010-12-23 08:42:43 +13:00
Paul Chote
7ef884532d Fix osx launcher crash when there is a space in the launcher path. Launching the game still doesn't work in this case. 2010-12-22 20:35:43 +13:00
Paul Chote
54c49dfa15 OS X launcher: Create download directory if it doesn't exist. 2010-12-21 21:29:50 +13:00
Chris Forbes
8809cbb4f1 blah 2010-12-21 18:00:42 +13:00
Chris Forbes
112dd3b1f6 remove some random crap 2010-12-21 17:59:41 +13:00
Chris Forbes
92b0f77867 #381 fixed (thanks, [Arcturus]) 2010-12-20 20:00:41 +13:00
Chris Forbes
dcec748911 fix #436 bridges in wrong place in render sequence 2010-12-20 19:43:25 +13:00
Chris Forbes
7d61e75862 #413 fixed 2010-12-20 19:38:28 +13:00
Chris Forbes
2d2bb58054 fix #451 2010-12-20 19:32:00 +13:00
Chris Forbes
bd0b3edccb fix AI jamming up its base by enforcing 1-cell gaps 2010-12-20 19:19:54 +13:00
Chris Forbes
d66439aa0c fix cnc rules bug so it loads 2010-12-20 17:36:29 +13:00
Chris Forbes
c85dbfb53d fix dumb bug in replay viewer 2010-12-19 20:49:14 +13:00
Chris Forbes
d6c71c6618 fix crash in RA music dialog 2010-12-19 19:14:00 +13:00
Chris Forbes
7802931e54 SAM requires power to operate 2010-12-19 18:51:14 +13:00
Chris Forbes
14737cc1dc nerf 1tnk pretty hard; add more hp for 2tnk but increase price slightly 2010-12-19 18:48:51 +13:00
Matthew Bowra-Dean
d8d33811e4 Added minimize button to launcher. 2010-12-19 18:41:36 +13:00
Chris Forbes
c99f89c987 fix crash on server overfill, fix another problem preventing spec slots from autofilling 2010-12-19 18:40:10 +13:00
Chris Forbes
7c76b25a44 blah 2010-12-19 18:40:09 +13:00
Chris Forbes
4fdc8222e8 blah 2010-12-19 18:40:09 +13:00
Chris Forbes
07d2e54bcc fix another crash in replay browser 2010-12-19 17:48:53 +13:00
Chris Forbes
f3d0e4b8ed fix a crash in the replay browser 2010-12-19 17:48:53 +13:00
Chris Forbes
2fad6f3bf1 move replay viewer delegate into mod 2010-12-19 17:48:52 +13:00
Chris Forbes
9482955a83 blah, cleanup 2010-12-19 17:48:51 +13:00
Chris Forbes
9d75c8d820 fix breakage 2010-12-19 17:48:51 +13:00
Chris Forbes
e3925b752d add support for replay viewer to cnc 2010-12-19 17:48:50 +13:00
Chris Forbes
f990006587 hack around the local player being set in replays 2010-12-19 17:48:50 +13:00
Chris Forbes
0b7bee480c extract [final] lobbyinfo from replay order stream; show map name & preview in replay browser 2010-12-19 17:48:49 +13:00
Chris Forbes
05f4aeea9f show duration in the replay browser 2010-12-19 17:48:49 +13:00
Chris Forbes
5f37b9e7d2 fix crash in replay playback (no world) 2010-12-19 17:48:48 +13:00
Chris Forbes
734b464de3 wire up replay browser to actually start a game. doesnt work. 2010-12-19 17:48:48 +13:00
Chris Forbes
4206cf1b09 refactor game joining; add replay joining support 2010-12-19 17:48:47 +13:00
Chris Forbes
17e3ef131c actually populate the replay browser; fix listbox ContentHeight not being reset. 2010-12-19 17:48:47 +13:00
Chris Forbes
2c13ebc6e7 wire cancel button for replay viewer 2010-12-19 17:48:46 +13:00
Chris Forbes
4f3b16cab2 add non-functional replay browser 2010-12-19 17:48:46 +13:00
Chris Forbes
25ebdea758 hack in stop order support to various classes. not happy with this. 2010-12-19 17:48:18 +13:00
Paul Chote
8b82df8298 Remove broken powered-techtree hack. 2010-12-07 22:35:40 +13:00
Paul Chote
0298a9e3a9 Remove debug logging from ChronoshiftPower. 2010-12-07 22:27:16 +13:00
Paul Chote
f2f60fb1f7 Don't apply palette effects to shroud/fog. 2010-12-07 22:26:27 +13:00
Paul Chote
b07eb9b8a1 Fast charge devhack. 2010-12-07 22:21:52 +13:00
Paul Chote
f5bffc4da9 Restore sane timings. 2010-12-07 22:19:58 +13:00
Paul Chote
55d60bd466 Don't crash if two powers have the same icon. 2010-12-07 22:00:26 +13:00
Paul Chote
c2a945b7ed Fix Spy infiltration. 2010-12-07 22:00:26 +13:00
Paul Chote
48b7cdad44 InfiltrateForSupportPower / Sonar pulse. 2010-12-07 22:00:20 +13:00
Paul Chote
c7500084df Parabomb crates. Multiple can be collected and queued. Support uncharged powers (0 charge time) with appropriate tooltip. 2010-12-07 21:50:33 +13:00
Paul Chote
d1850e8b4b Fix a time format bug. Fix subsequent gps bug. 2010-12-07 21:49:33 +13:00
Paul Chote
c465a58976 Sonar Pulse power. It still doesn't do anything. 2010-12-07 21:49:26 +13:00
Paul Chote
6b05b2c2f0 Iron Curtain. 2010-12-07 21:45:04 +13:00
Paul Chote
cd10fb1db0 GPS Satellite. 2010-12-07 21:45:04 +13:00
Paul Chote
172e1eb295 Paratroopers, Spyplane. 2010-12-07 21:45:04 +13:00
Paul Chote
9e16eb513f Reimplemented chronoshift. (still has desync) 2010-12-07 21:45:04 +13:00
Paul Chote
24b322053c Fix ra shellmap; reimplement ra nuke. 2010-12-07 21:45:04 +13:00
Paul Chote
e52771c367 Reimplement Ion Cannon and cnc nuke. Disable ra shellmap nukes. 2010-12-07 21:45:04 +13:00
Paul Chote
76f792bfdf New special powers mechanism. Only cnc Airstrike has been reimplemented so far. Special power crates, and spy bonuses have also been disabled. 2010-12-07 21:45:03 +13:00
Paul Chote
c6fad7fe98 Render IPreRenderSelection independently of OG. 2010-12-07 21:45:03 +13:00
Paul Chote
915cb589b3 Fix some more special power exploits 2010-12-07 21:45:03 +13:00
Chris Forbes
664692cef9 #398 c4 vs friendly buildings goes through the motions, but does nothing 2010-12-06 20:46:44 +13:00
Chris Forbes
220579ff85 wire 's' (default binding) to issue 'Stop' order to each selected actor 2010-12-06 20:43:09 +13:00
Chris Forbes
1a8e964c04 clean up usings 2010-12-06 14:35:37 +13:00
Chris Forbes
3a309ec916 remap hotkeys 's' -> 'y' in prep for adding 'stop' order 2010-12-05 12:29:11 +13:00
Chris Forbes
d46c64fad5 blah 2010-12-05 12:24:11 +13:00
Chris Forbes
3f47715c36 harvesters show colors for each resource type 2010-12-05 12:10:52 +13:00
Chris Forbes
94715a1561 add AutoTargetIgnore to ^Wall in ra and cnc 2010-12-05 11:41:14 +13:00
Chris Forbes
a752c47b5a allow marking things with AutoTargetIgnore so AutoTarget won't go for them 2010-12-05 11:39:44 +13:00
Chris Forbes
4d0535daa9 fix exploit in sonar pulse power 2010-12-05 11:36:05 +13:00
Chris Forbes
a3e64d1733 add AutoTargetIgnore 2010-12-05 11:32:30 +13:00
Chris Forbes
2618a7dadc fix perf of floodfill in editor 2010-12-05 11:31:24 +13:00
Chris Forbes
5617465294 remove sync attribute from DisplayCash/DisplayOre 2010-12-04 11:14:40 +13:00
Chris Forbes
9c20fba4a0 fix spy crashing things when disguised as a unit with fewer idle anims 2010-12-04 11:02:53 +13:00
Chris Forbes
05718f9e8e #400 bogus pip color for e7 fixed 2010-12-04 10:36:01 +13:00
Chris Forbes
81dad0bd34 tidying 2010-12-04 10:35:34 +13:00
Chris Forbes
c177cf9f9a #401 bogus footprint for ATWR fixed 2010-12-03 20:49:43 +13:00
Chris Forbes
e1761d8969 cleanup some usings 2010-12-03 20:43:27 +13:00
Paul Chote
0ae464d1f7 New attack-move cursor for cnc. 2010-12-02 10:28:34 +13:00
Paul Chote
4913d82bce Autotarget sets target line 2010-12-01 21:14:10 +13:00
Paul Chote
4f6027e772 Add Autotarget to cnc helis. 2010-12-01 21:03:41 +13:00
Paul Chote
fa84cfb26e Rebalance Invulnerability and Chronoshift. 2010-12-01 18:43:12 +13:00
Paul Chote
971287e989 Fix shroud crash 2010-12-01 18:22:46 +13:00
Paul Chote
deed6c7267 Make LST unbuildable; it is completely broken. 2010-12-01 13:19:56 +13:00
Paul Chote
f58f460355 Fix copypasta bogosity that mono accepts as valid code. 2010-12-01 13:19:09 +13:00
Paul Chote
2c897d4454 Fix ra shellmap low power and broken GAP position 2010-11-30 23:16:40 +13:00
Paul Chote
b4101c03ee MSLO requires power and can be powered down. 2010-11-30 23:13:51 +13:00
Paul Chote
200e90a590 Right click cancel chronoshift targeting. 2010-11-30 23:02:45 +13:00
Paul Chote
be8f042e49 Fix autoattack target flashes 2010-11-30 22:53:11 +13:00
Paul Chote
4b1eb993e4 Swap map selector button order 2010-11-30 22:30:18 +13:00
Paul Chote
f6ce673345 Fix KOTH maps 2010-11-30 22:28:28 +13:00
Paul Chote
08eeec4d99 More lobby polish (mainly map chooser). 2010-11-30 21:20:57 +13:00
Matthew Bowra-Dean
564a4598b9 Added renderer selection to Windows launcher. 2010-11-30 19:08:34 +13:00
Matthew Bowra-Dean
7e25b6e58e Moved map description to bottom of labels. 2010-11-30 19:08:24 +13:00
Matthew Bowra-Dean
57f74606f0 Added author and description to map chooser, fixes #290. Added word wrap to the LabelWidget to support it. 2010-11-30 19:08:18 +13:00
Paul Chote
b44cb9ad57 Pulse the rally point circles when a new location is set. 2010-11-30 19:07:41 +13:00
Paul Chote
dfd5906d7f Refactor AutoHeal. 2010-11-30 14:20:15 +13:00
Paul Chote
2e7b5e8712 Fix moonwalking infantry 2010-11-30 14:17:39 +13:00
Paul Chote
eb8682fd0e Fix AutoHeal 2010-11-30 13:37:10 +13:00
Paul Chote
2d224a207c Fix idle animations / prone. 2010-11-30 12:51:25 +13:00
Paul Chote
5070a81db4 Move CancelableActivity into the Activities namespace. Remove the Idle activity. 2010-11-30 11:11:14 +13:00
Paul Chote
e97dd2ee47 make currentActivity private. 2010-11-29 13:47:50 +13:00
Paul Chote
da74c6ad23 Add some logging to see what is going on. 2010-11-29 13:43:00 +13:00
Paul Chote
c7f1d08748 Some thoughts towards improving our bogus idle handling. Untested. 2010-11-29 13:15:44 +13:00
Paul Chote
7850acc6fb Fix AttackLeap. 2010-11-29 11:52:27 +13:00
Matthew Bowra-Dean
ec5b9a1150 Select last mod at start of launcher. Don't run download action elevated. 2010-11-28 23:12:19 +13:00
Matthew Bowra-Dean
83f67a9d48 Revert Window installer to not having launcher as default. 2010-11-28 23:12:18 +13:00
Paul Chote
fb799ad436 Fix dropdown miscompile bug under mono 2.6.7. 2010-11-28 22:23:50 +13:00
Paul Chote
60186efca6 Change rpm deps to target fedora. 2010-11-28 15:35:07 +13:00
Paul Chote
20ab3b6caa Fix observers in cnc. 2010-11-28 15:26:34 +13:00
Paul Chote
32db66eb7e Normalize ra/cnc chrome yaml 2010-11-28 15:24:31 +13:00
Paul Chote
112844a9f7 Normalize lineendings. 2010-11-28 15:14:31 +13:00
Paul Chote
745df591e0 Hide the join slot buttons when ready. 2010-11-28 15:11:57 +13:00
Paul Chote
9c7759d131 More polish. 2010-11-28 15:09:25 +13:00
Paul Chote
4bb70f11e9 Tweak header positioning and scrollpanel scissoring (don't draw contents over the 1px border). 2010-11-28 13:53:38 +13:00
Paul Chote
ce5ca9dbca Color selector as a drop panel. 2010-11-28 13:44:53 +13:00
Paul Chote
0b9a984b7a Team dropdown. 2010-11-28 12:00:14 +13:00
Paul Chote
45cd6caeec Faction dropdown flags. 2010-11-28 11:46:14 +13:00
Paul Chote
4c517c0e59 Initial lobby rework progress 2010-11-28 11:25:42 +13:00
Paul Chote
7884cb310b Polish: Offset button children by pressed state. 2010-11-28 11:18:03 +13:00
Paul Chote
306bece709 Tweak ra lobby scrollpanel margins. 2010-11-28 10:41:41 +13:00
Paul Chote
748a055a24 Disable FrozenUnderFog for this release. 2010-11-28 10:29:05 +13:00
Paul Chote
240b26a265 Remove bogus WorldGameOver trait. 2010-11-28 09:54:29 +13:00
Paul Chote
ac82121460 Fix diplomacy stance cycling exploit. 2010-11-28 09:42:37 +13:00
Matthew Bowra-Dean
3189a4f457 Give sensible default range to CarpetBomb and make sure its target location is in the correct units. 2010-11-28 01:45:24 +13:00
Paul Chote
291e7588e1 Workaround for persistent dropdowns. 2010-11-27 23:55:09 +13:00
Matthew Bowra-Dean
b8e274e0f9 Revert misguided attempt at allowing preservation of user installed maps. 2010-11-27 23:25:34 +13:00
Paul Chote
e81a1f78a4 Fix visibility that mono 2.8 happily ignores. 2010-11-27 22:39:50 +13:00
Matthew Bowra-Dean
51c3455ffe Linux post install scripts brought up to date with Utility app syntax changes. 2010-11-27 22:19:40 +13:00
Matthew Bowra-Dean
583fa0aa39 Made PipeAccessRights explicit to get around Mono fail. 2010-11-27 18:54:43 +13:00
Matthew Bowra-Dean
f768f8d969 Include SharpZipLib in Windows installer. 2010-11-27 18:54:42 +13:00
Matthew Bowra-Dean
0e26f0ce26 Updated packaging scripts for winlauncher. 2010-11-27 18:54:42 +13:00
Matthew Bowra-Dean
2a8beca0f8 Updated Windows installer for launcher. 2010-11-27 18:54:42 +13:00
Matthew Bowra-Dean
b5813ebff8 Update Makefile for Winlauncher 2010-11-27 18:54:42 +13:00
Matthew Bowra-Dean
0f6f36411a Fix cnc & ra mod page layout on Windows. 2010-11-27 18:54:42 +13:00
Paul Chote
f798639125 New loadscreen artwork for cnc; needs texturing. 2010-11-27 18:54:28 +13:00
Paul Chote
6014095ab3 Untextured GDI and Nod logos. 2010-11-27 17:16:37 +13:00
Paul Chote
52e265557c Oil Derricks spurt fire when dead. 2010-11-27 15:50:46 +13:00
Paul Chote
f9f9fbf3e4 Reinit the sheetbuilder too - appending more sprites to the old sheets isn't the best of ideas. Fixes "Terrain sprites span multiple sheets" on cnc tundra map. 2010-11-27 15:11:38 +13:00
Paul Chote
d559b5cdb7 Rallypoint Polish: Improved artwork, correct positioning, doesn't disappear when the building is offscreen, targeting cursor. 2010-11-27 14:54:29 +13:00
Paul Chote
d6733e62d6 Extra sounds extracted from the c&c demo. 2010-11-27 14:08:31 +13:00
Paul Chote
00a0aac7a3 Scale is now set via a field on Render* and interacts properly with chronoshift and building previews. 2010-11-27 13:30:08 +13:00
Paul Chote
840ade5b78 Remove LineBuild preview (no preview is better than broken preview). 2010-11-27 13:18:06 +13:00
geckosoft
13d3137ae4 Fixed: Issue #376 : Captured Refineries cannot receive Ore + harv not unlinked 2010-11-27 11:28:22 +13:00
Paul Chote
62c652a645 Fix a fog information leak introduced by 8d8c6c67. 2010-11-27 11:28:22 +13:00
Paul Chote
76428cbda2 Move ShroudRenderer into Graphics. 2010-11-27 11:28:22 +13:00
Paul Chote
434ea26950 Fix cloaked units. 2010-11-27 11:28:22 +13:00
Paul Chote
9655b34e5f Fix FrozenUnderFog; add to cnc. 2010-11-27 11:28:22 +13:00
Paul Chote
e91caa4e7a Save some perf. 2010-11-27 11:28:22 +13:00
Paul Chote
3b0810a096 Simply the localplayer hack, and prevent vis dirtying when shroud is disabled. 2010-11-27 11:28:17 +13:00
Paul Chote
1d81e71bcb Allow vis to extend outside the map, but not explored. 2010-11-27 11:20:04 +13:00
Paul Chote
29ac9a594a Add a hack to support our old "no player means total vis" behavior. 2010-11-27 11:20:04 +13:00
Paul Chote
fb0e399ab9 Consolidate viewport clip calculations into one place (except for TerrainRenderer, but changing that calculation crashes my gfx card). 2010-11-27 11:20:04 +13:00
Paul Chote
7c5c989eb2 Introduce World.LocalShroud. Breaks targeting stealth tanks. Probably breaks FrozenUnderFog. 2010-11-27 11:20:04 +13:00
Paul Chote
41fd19c766 Begin refactoring Shroud. ShroudRenderer is now internal to WorldRenderer; all traits interact with Shroud directly. Gives soft-edges at the map border for free, but breaks shellmap and observers. 2010-11-27 11:20:03 +13:00
Paul Chote
b423889c06 Remove a pile of duplication from target lines.
Remove MoveFlash.
2010-11-27 11:20:03 +13:00
Paul Chote
5f43923b80 Polish: Show the "move-blocked" cursor for locations outside the map. Clamp move orders to the map bounds for these orders. 2010-11-27 11:20:03 +13:00
Paul Chote
5470264f00 Show move-blocked cursor if we can know the unit can't move there. 2010-11-27 11:20:03 +13:00
Paul Chote
06ed722b7a Render healthbars / target lines / minefield grids *above* shroud. 2010-11-27 11:20:02 +13:00
Paul Chote
8565b7be0c Always render actor selection boxes. 2010-11-27 11:20:02 +13:00
Paul Chote
a3861823c9 Fix scissoring for LocalPlayer != null. 2010-11-27 11:20:02 +13:00
Paul Chote
84fd45ad69 Scissor to map edge. 2010-11-27 11:20:02 +13:00
Paul Chote
dd6a431af2 Start scripting the cnc shellmap. 2010-11-27 11:20:02 +13:00
Paul Chote
fa31fb199f Setup factions on cnc shellmap 2010-11-27 11:20:02 +13:00
Paul Chote
fbeb638582 Center the viewport by default. 2010-11-27 11:20:01 +13:00
Paul Chote
1aebd59062 Fix some compiler warnings 2010-11-27 11:20:01 +13:00
Paul Chote
7182908728 Rename ListBoxWidget -> ScrollPanelWidget. 2010-11-27 11:20:01 +13:00
Paul Chote
58a92de5a1 Move widget delegates into Mods. 2010-11-27 11:20:01 +13:00
Paul Chote
4ea04f461a Fix license info. 2010-11-27 11:19:39 +13:00
Paul Chote
26c084cfb8 Update makefile. 2010-11-27 11:17:00 +13:00
Matthew Bowra-Dean
ac513557a1 Removed old code, made installing mods work. 2010-11-26 01:01:12 +13:00
Matthew Bowra-Dean
db5b5698a7 Implemented remaining JS bridge functions for Win launcher. 2010-11-26 00:47:22 +13:00
Paul Chote
1f61d22489 RA package download/install (copied from cnc) 2010-11-25 22:51:30 +13:00
Paul Chote
520f602f23 Disable some currently unimplemented bits (to be re-enabled later). 2010-11-25 22:51:30 +13:00
Paul Chote
8c5c63a4b5 Use the launcher in osx packaged builds. Leopard support. Fix some wording. Remove old osx launcher project. 2010-11-25 22:51:29 +13:00
Paul Chote
a0741ba26b Set the game path to the launcher resource dir. Can be overwritten using the system defaults mechanism. 2010-11-25 22:51:29 +13:00
Paul Chote
9f21d944d1 Gl renderer is now default, don't need to override it. 2010-11-25 22:51:28 +13:00
Paul Chote
10f9e3e787 Zip extraction support. 2010-11-25 22:51:28 +13:00
Paul Chote
eff5e409c0 More utility tweaks 2010-11-25 22:51:28 +13:00
Paul Chote
f108735f74 Keep the bs inside the launcher 2010-11-25 22:51:28 +13:00
Paul Chote
e62149398b Clean up after failed extraction. 2010-11-25 22:51:28 +13:00
Paul Chote
d6e831eb07 Utility changes to support extracting a zip relative to a mod. Can also be used to install new mods. 2010-11-25 22:51:28 +13:00
Paul Chote
dcf3912d24 Add mono version check 2010-11-25 22:51:28 +13:00
Paul Chote
efad699d4b Prompt user when quitting with active downloads. Remove js debug logging. 2010-11-25 22:51:28 +13:00
Paul Chote
77a35fd132 Close the app when the main window is closed. Terminate all in progress downloads when the app is closed. 2010-11-25 22:51:28 +13:00
Paul Chote
2fe7e10750 Handle download errors 2010-11-25 22:51:27 +13:00
Paul Chote
6f66a19b18 Clean up file downloading. 2010-11-25 22:51:27 +13:00
Paul Chote
2fc88e439d Progress towards in-launcher download ui. Works, but is very fragile. 2010-11-25 22:51:27 +13:00
Paul Chote
b4b05c3f4e Notify javascript when download status changes. Allow js to query information about a download. 2010-11-25 22:51:27 +13:00
Paul Chote
0ee1d39bac Refactor download mechanism to allow multiple concurrent downloads. Allow downloads to be cancelled. Allow js to query if files exist in the cache. Fix some compiler warnings. 2010-11-25 22:51:27 +13:00
Paul Chote
c3521a2490 Expose the package downloading to js. Todo: cancel support, status callbacks. 2010-11-25 22:51:27 +13:00
Paul Chote
cb93955cc5 Generalize package downloading to support arbitrary urls and download locations. 2010-11-25 22:51:27 +13:00
Matthew Bowra-Dean
666efc94d1 Bring Makefile up to date with Win launcher changes. 2010-11-25 22:51:27 +13:00
Matthew Bowra-Dean
d2a52fd529 Bring Windows launcher into line with pchote's ideas. 2010-11-25 22:51:26 +13:00
Paul Chote
085685a769 Use ~/Library/Application Support/OpenRA/ as the support dir. 2010-11-25 22:51:26 +13:00
Paul Chote
034196ddd6 Build a list of parent mods before launching. 2010-11-25 22:51:26 +13:00
Paul Chote
3dc16bdbb4 Support launching an arbitrary mod. Hook up package detection for cnc. 2010-11-25 22:51:26 +13:00
Paul Chote
f42f39f9c9 Refactor JSBridge to simplify adding new methods. Add log(message) and a stub for fileExistsInMod(file,mod). 2010-11-25 22:51:26 +13:00
Paul Chote
40235db52e Bind the js bridge properly. Display the selected mod page on load. 2010-11-25 22:51:25 +13:00
Paul Chote
810b73e1f0 Fix encoding issue with OpenRA.Utility. Refactor SidebarEntry. Add launcher pages to all mods. 2010-11-25 22:51:25 +13:00
Paul Chote
82850cf4fb Use window.external instead of Launcher in js for windows support. Tweak the OpenRA.Utility calls - still doesn't work 100%. 2010-11-25 22:51:25 +13:00
Paul Chote
21e597ca2d Hook up the "Play" button to launch the game. 2010-11-25 22:51:25 +13:00
Paul Chote
ed8203c896 Load mod.html into the right pane when clicked. Refactoring. 2010-11-25 22:51:25 +13:00
Paul Chote
de7668e8ff Add a WebView in preparation for the page info. Refactor SidebarEntry out of Mod. Add an "Other" category with links for support/credits+legal. 2010-11-25 22:51:25 +13:00
Paul Chote
7271dd5248 List installed mods in the sidebar. Changes utility mod info syntax. 2010-11-25 22:51:24 +13:00
Paul Chote
16dd07bab3 Add support for launching the game. 2010-11-25 22:51:24 +13:00
Paul Chote
5cbfc45819 Beginnings of the new mac launcher. 2010-11-25 22:51:24 +13:00
Chris Forbes
6a238ab51a open/closed/bot dropdown for cnc lobby too 2010-11-25 20:04:56 +13:00
Chris Forbes
4d9c2a30df Dropdown listboxes 2010-11-25 20:04:56 +13:00
Chris Forbes
8b18927c67 #378 crash in IdleHealActivity fixed 2010-11-25 19:48:28 +13:00
Chris Forbes
d77563bdb0 reduce coverage of UiOverlay sprites so you can see the building you're placing 2010-11-24 20:10:14 +13:00
Paul Chote
d0466714c8 Allow Chronoshifted/paradropped units to pick up crates, etc. 2010-11-24 15:55:41 +13:00
Paul Chote
08c9c1a92f Make Iron Curtain targeting consistent with Chronoshift. 2010-11-24 15:49:52 +13:00
Paul Chote
ea3943daf4 Do the same for chronoshifted units 2010-11-24 15:45:47 +13:00
Paul Chote
6ac92c45f1 Cache the sprites. Draw linebuild cells too. 2010-11-24 15:31:29 +13:00
Paul Chote
96cd0e2259 Render building previews 2010-11-24 13:43:07 +13:00
Paul Chote
fc5830a687 Added int2.Clamp(Rectangle). All queries for map geometry use map.Bounds. 2010-11-24 12:24:48 +13:00
Paul Chote
1dfe437641 Refactor Viewport. 2010-11-24 11:57:18 +13:00
Paul Chote
b8eda5a152 Tidy more uses of BottomRight/TopLeft, bogus location of FormatTime. 2010-11-24 11:37:18 +13:00
Paul Chote
de8603832f Use Map.Bounds instead. 2010-11-24 11:12:37 +13:00
Paul Chote
f11bcd27cc Kill Map.XOffset / Map.YOffset. 2010-11-24 10:26:38 +13:00
Paul Chote
00dc91cf49 Standardise Theater -> Tileset. 2010-11-24 10:09:51 +13:00
Paul Chote
8b0255e2f7 Fix the RA shellmap. 2010-11-23 22:53:14 +13:00
Paul Chote
3a2279f378 Set cursor position based on mouse click location. 2010-11-23 21:39:34 +13:00
geckosoft
8085bcb232 Textfield cursor support and forward-delete (rewritten by pchote). 2010-11-23 21:39:34 +13:00
Chris Forbes
5e6f325df1 #377 fixed 2010-11-23 21:39:34 +13:00
Chris Forbes
f892eb629e fix exploitability of nuke and ion cannon 2010-11-23 21:39:34 +13:00
Chris Forbes
1629958970 remove bogus sandbag-in-water on equal-opportunity 2010-11-23 21:39:34 +13:00
Chris Forbes
2079627030 fix APB spawn 2010-11-23 21:39:34 +13:00
Paul Chote
2072b78489 Remove duplication from PasswordFieldWidget. 2010-11-23 21:39:34 +13:00
Paul Chote
3d1d4a1aff AOE Chronosphere 2010-11-23 21:39:31 +13:00
Paul Chote
41665f7e95 AOE Iron Curtain 2010-11-23 21:38:28 +13:00
geckosoft
604aae5980 Fixed: #281 for regular (read: right-click) commands (Modified by pchote) 2010-11-23 15:59:05 +13:00
geckosoft
ac613f7bea Fixed: #334 Flares should now be destroyed if the drop plane is destroyed 2010-11-23 15:59:05 +13:00
geckosoft
46d0a6d00d Fixed: Potential exploit with ChronoshiftPower 2010-11-23 15:59:05 +13:00
geckosoft
402afc82ca Fixed: Potential exploit on Iron Curtain 2010-11-23 15:59:04 +13:00
geckosoft
1cd59a0892 Fixed: Iron Curtainable doesnt stack 'InvulnEffect' effects anymore 2010-11-23 15:59:04 +13:00
geckosoft
7b7bcf1005 Fixed: Crash when selling iron curtained' buildings 2010-11-23 15:59:04 +13:00
geckosoft
be701007df Changed: DrawRangeCircle now accepts a float instead of an int 2010-11-23 15:59:04 +13:00
geckosoft
fef6285436 Fixed: issue #277 (Surrender button no longer visible when won or lost) 2010-11-23 15:59:04 +13:00
Matthew Bowra-Dean
b3c4afa620 Bring Makefile up to date. 2010-11-23 15:59:04 +13:00
Paul Chote
8df1813afd Rework the makefile. 2010-11-23 15:59:04 +13:00
Paul Chote
6a28bcb49a GL Renderer: Print available extensions on error and test for vbos. 2010-11-23 15:59:04 +13:00
Chris Forbes
730ed8c597 finished removing ctors from Order 2010-11-23 15:33:15 +13:00
Chris Forbes
7b5be4a0ec remove more ctors 2010-11-23 15:30:21 +13:00
Chris Forbes
30fb1250b3 remove some stupid duplication in HackyAI 2010-11-23 15:27:27 +13:00
Chris Forbes
a363bf841c remove some dead code 2010-11-23 15:25:10 +13:00
Chris Forbes
da5830845b remove another ctor 2010-11-23 15:24:45 +13:00
Chris Forbes
23e6eada26 another ctor removed 2010-11-23 15:20:11 +13:00
Chris Forbes
490b0801a0 start removing weird ctors on Order 2010-11-23 15:14:48 +13:00
Chris Forbes
49ab704a84 add ctor & readonlys for required args 2010-11-23 14:04:39 +13:00
Chris Forbes
4a12b78f14 experiment -- _Order is a mutable builder-object for Order, implicitly convertible 2010-11-23 13:59:43 +13:00
Chris Forbes
656dbdcd28 add Order.ExtraLocation as a second int2 parameter 2010-11-23 13:56:04 +13:00
Chris Forbes
88398afba6 symmetry between reading and writing int2 2010-11-23 13:06:37 +13:00
Chris Forbes
2f74207bf6 tighten order encoding 2010-11-23 12:58:59 +13:00
Chris Forbes
f4f9abe4d4 import 'A Path Beyond' from original RA 2010-11-22 08:21:22 +13:00
Matthew Bowra-Dean
e50b8ec7dc Added Gecko to AUTHORS 2010-11-21 23:11:22 +13:00
Chris Forbes
70f92494b2 fixed player setup for koth-crossroads 2010-11-21 22:10:43 +13:00
Matthew Bowra-Dean
c07fee3b3b More fixes for upload scripts. 2010-11-21 20:25:50 +13:00
Matthew Bowra-Dean
07b635672e Fix upload-all.sh subscript calling. 2010-11-21 20:07:48 +13:00
Matthew Bowra-Dean
edc4c7ab2b +x on upload-all.sh 2010-11-21 19:59:57 +13:00
Matthew Bowra-Dean
6edcc36f17 Fixed upload scripts. 2010-11-21 19:51:50 +13:00
Matthew Bowra-Dean
3a2a6c231e checkout-and-build script updated. 2010-11-21 18:28:30 +13:00
Chris Forbes
cf26e4aa8a improve appearance of smoketrails 2010-11-21 18:28:29 +13:00
Paul Chote
8ca1da8828 Remove Cg dep from linux packages 2010-11-21 13:30:48 +13:00
Paul Chote
5764bc1c1c Tweak the packaging scripts. Add a starting point for the uploader. 2010-11-21 13:10:22 +13:00
Paul Chote
dba7335594 Fix a pile of compiler warnings. 2010-11-21 13:10:22 +13:00
Paul Chote
1461309dba Use the Gl renderer by default on all platforms. 2010-11-21 13:10:22 +13:00
Paul Chote
d7e8388600 Make our IFolder zip support actually work. 2010-11-21 13:10:22 +13:00
Paul Chote
e79d039aa0 Add an install from cd option for cnc. Remove music install options. 2010-11-21 13:10:21 +13:00
Paul Chote
3d8b3efb9e Don't die when installing over an existing set of packages 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
58367fdeac Fixed a case where package downloading erroring out will hang the Utility app. 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
63d54952d0 Downloading packages now shows progress to the user. Utility app no longer immediately exits after downloading packages. 2010-11-21 13:10:21 +13:00
Paul Chote
5904563653 Fix packaging scripts (OpenRA.Utility wasn't built, and SharpZipLib wasn't included). 2010-11-21 13:10:21 +13:00
Paul Chote
5d0b750a64 Hack to allow temp download dir to be specified relative to home dir. 2010-11-21 13:10:21 +13:00
Paul Chote
43e99631a8 Build all renderers on make game 2010-11-21 13:10:21 +13:00
Paul Chote
8cd6d60839 Rewrite the download status over the same console line. May break the windows launcher (which doesn't run under osx, so can't test). 2010-11-21 13:10:21 +13:00
Paul Chote
047d012fff Fix broken dependencies in the Makefile. 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
0064543989 Allow building of Winforms launcher with Mono 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
b61b7b5431 Only modify pipe ACL when running as admin 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
0c319e88c3 Utility now uses named pipe if passed --pipe. Installing mods now works properly too. 2010-11-21 13:10:21 +13:00
Matthew Bowra-Dean
da384af339 Refactoring of OpenRA.Utility. Whole lot of work on OpenRA.Launcher
Mod configuration dialog now fully functional, launch button also works.
2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
f98f3d0b39 Mod tree in configure mods dialog. 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
439c366ba2 Winforms launcher beginnings. 2010-11-21 13:10:20 +13:00
Matthew
d93c42e89c added another function to the Utility app. 2010-11-21 13:10:20 +13:00
Matthew
850d26a628 Install RA packages from CD. Fixes bug in case-sensitive filesystems for Folder.cs. 2010-11-21 13:10:20 +13:00
Matthew
c3e79405f7 Make sure mod package dir exists before extraction. 2010-11-21 13:10:20 +13:00
Paul Chote
03b23d88d2 Make the OSX packaged build use the Gl renderer. 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
d5d6cea84c More Windows installer fixes 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
fb173af647 Fixed Windows installer file list. 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
a1bc31883b Changed shaders dir to renderer specific shader dirs in file list. 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
52854c77c2 Added new files to packages, made RPM script auto-generate its file list 2010-11-21 13:10:20 +13:00
Matthew
8f58e41304 Fixed pkgbuild and reimplemented RPM scripts. 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
25525b4155 Fixed PKGBUILD 2010-11-21 13:10:20 +13:00
Matthew Bowra-Dean
66cc0bd8ff Made debian package to architecture independent. Brought arch package up to date. 2010-11-21 13:10:19 +13:00
Paul Chote
01c6127545 Remove gacutil steps from rpm and pkgbuild 2010-11-21 13:10:19 +13:00
Paul Chote
2794e1f62d Actually remove the mdb files, and simplify calling syntax 2010-11-21 13:10:19 +13:00
Paul Chote
83c9e9e6dd A few fixes when running package scripts under debian. 2010-11-21 13:10:19 +13:00
Paul Chote
39742d02bb Produce a windows installer (untested). 2010-11-21 13:10:19 +13:00
Paul Chote
f1b68a5207 Begin rework of packaging scripts. Restructure packaging system, and make osx and debian packages work.
Changed semantics:
- package upload is handled by a separate script
- dropped syntax highlighting (unnecessary, and had concurrency issues)
- `make install' is no longer used in the packaging process
- debian package changelog points to the forum, instead of showing out of date info
- debian package ships tao dlls in the game root, and doesn't insert them in the gac
- debian package refers users to the website for help manually installing packages
2010-11-21 13:10:19 +13:00
Paul Chote
493631cd90 Switch to the ARB apis and add capability and compile/link status checking. 2010-11-21 13:10:19 +13:00
Matthew Bowra-Dean
9a1ce6945b Make OpenRA.Renderer.Gl compile into the right place with VS. 2010-11-21 13:10:19 +13:00
Paul Chote
ccf66cde2f Expose Graphics.Renderer setting; Refactor Renderer.Null. 2010-11-21 13:10:19 +13:00
Paul Chote
233e9326f0 Cleanup some cruft. 2010-11-21 13:10:19 +13:00
Bob
ba97c99f98 assign texunits to samplers, instead of (wrongly) using unitid==textureid 2010-11-21 13:10:19 +13:00
Paul Chote
37edd072a6 shp shaders 2010-11-21 13:10:18 +13:00
Paul Chote
00358e9fe8 Working line shader 2010-11-21 13:10:18 +13:00
Paul Chote
888710cbc5 Enable alpha blending 2010-11-21 13:10:18 +13:00
Paul Chote
518e00c78a Fix setting uniforms; chrome-rgba shader works, but lacks alpha blending. 2010-11-21 13:10:18 +13:00
Paul Chote
f2a20a182e Begin work on the glsl renderer. Renders blue blocks for chrome-rgba. 2010-11-21 13:10:18 +13:00
Paul Chote
a058eb06b2 Duplicate the Cg renderer as a base for the glsl renderer. 2010-11-21 13:10:18 +13:00
Paul Chote
64a7592fed Rename OpenRA.Gl -> OpenRA.Renderer.Cg 2010-11-21 13:10:18 +13:00
Paul Chote
bfb076b9bc Refactor IShader to take a name instead of a stream. 2010-11-21 13:10:18 +13:00
Chris Forbes
5292272902 #186 unlimited power devhack 2010-11-21 12:36:18 +13:00
Chris Forbes
1db3ce4b59 some usings cleanup 2010-11-21 12:25:22 +13:00
Chris Forbes
060d544390 add smoke trails for damaged aircraft 2010-11-21 11:48:09 +13:00
Chris Forbes
b0e3364a77 make unit smoke optional 2010-11-21 11:28:16 +13:00
Chris Forbes
d78dde4db1 fix ModData still being bogus about custom sequences 2010-11-21 11:26:22 +13:00
Chris Forbes
a94b2df865 #361 weap doesnt play sell animation correctly -- fixed 2010-11-21 11:14:36 +13:00
Chris Forbes
e4bb788fb9 #366 only host can see AI players in a lobby -- fixed 2010-11-21 11:11:29 +13:00
Chris Forbes
6dcc401342 add missing EditorAppearance for trees & cnc rocks 2010-11-21 10:59:36 +13:00
Chris Forbes
26a7e06b40 finish initial work on koth-crossroads 2010-11-21 10:59:35 +13:00
Chris Forbes
2ba8120d79 WiP KoTH map 'crossroads' 2010-11-21 10:59:35 +13:00
geckosoft
b9b045098b Changed: People can no longer build structures near the strategic point, once they captured it, without having a regular structure near. 2010-11-21 10:59:35 +13:00
geckosoft
a0682d80c0 Fixed: koth-island-hoppers (map) now correctly sets MustBeClear 2010-11-21 10:59:34 +13:00
geckosoft
1ff39761b7 Fixed: Bug in StrategicProgressWidget.FindFirstWinningPlayer 2010-11-21 10:59:34 +13:00
geckosoft
bddd058b38 Changed: Rules for the koth map (need to hold it for 2 seconds, both poins, and it gets reset if the hold is broken) 2010-11-21 10:59:33 +13:00
geckosoft
8efb717cf4 Changed: Cleaned up the StrategicProgressWidget a bit 2010-11-21 10:59:33 +13:00
geckosoft
65ac607d90 Fixed: ProximityCaptureable now allows allies nearby 2010-11-21 10:59:33 +13:00
geckosoft
0af653b101 Changed: KotH Island Hoppers (map) should be working now! victory after holding it for 5 minutes. 2010-11-21 10:59:32 +13:00
geckosoft
175b07c0ff Added: StrategicProgressWidget to show the capturing progress (including custom gfx)
Fixed: Sync on unsyncable field type
Added: StrategicProgressWidget to both cnc & ra
2010-11-21 10:59:32 +13:00
geckosoft
585cba8af8 Added: StrategicVictoryConditions & StrategicPoint => allows 'koth' gameplay if used 2010-11-21 10:59:32 +13:00
geckosoft
2a7525122e Changed: Made ConquestVictoryConditions public (same for Surrender / Win methods) 2010-11-21 10:59:31 +13:00
geckosoft
7f7c293856 Added: Island Hoppers KoTH map (wip, not done yet) 2010-11-21 10:59:31 +13:00
geckosoft
fbb117705e Changed: Owner maps to Self.Owner now IF captured, otherwise returns the OriginalOwner 2010-11-21 10:59:30 +13:00
geckosoft
78dea9eecb Added: ProximityCaptureable 2010-11-21 10:59:30 +13:00
geckosoft
be9f52e029 Changed: Mounts the map' IFolder with least possible priority, allowing the map to has its own assets 2010-11-21 10:59:26 +13:00
geckosoft
000dd6de7b ed: Made it possible for maps to define custom & override existing voices 2010-11-21 10:57:36 +13:00
geckosoft
5e8e4dd9d5 Changed: Made it possible for maps to define custom & override existing weapons 2010-11-21 10:57:36 +13:00
geckosoft
b31a35d34b Changed: Made it possible for maps to contain custom sequences (allowing 100% custom map-specific units to be 'build') 2010-11-21 10:57:16 +13:00
Matthew Bowra-Dean
414b3a03c3 Updated docs. 2010-11-18 17:47:24 +13:00
Bob
a7f42dcf0c fix interaction between autoattack and idleanimation 2010-11-16 20:32:00 +13:00
Chris Forbes
7bd7f4e56b remove bogus AttackMoveInteraction trait from cnc 2010-11-15 20:03:49 +13:00
Chris Forbes
9584c78500 hack around ICE in gmcs-2.6.7; feature wasn't used anyway 2010-11-15 19:59:07 +13:00
Chris Forbes
bc7a9c14d0 fix helicopters landing in silly places 2010-11-14 21:27:17 +13:00
Chris Forbes
c1eacc225d fix DrawLineToTarget drawing from the ground below flying units 2010-11-14 21:27:17 +13:00
Chris Forbes
e56bbe367d add missing WorldCommand trait to cnc 2010-11-14 21:27:16 +13:00
Bob
6cf9939ab3 remove staticness on Server 2010-11-14 21:26:50 +13:00
Bob
b2f3b8f2af make AutoTarget use an activity. add AutoTarget to teslatank 2010-11-14 19:44:58 +13:00
Bob
80e897abfb add Util.RunActivity, and have Actor.Tick use it. fix medic autoheal 2010-11-14 18:36:36 +13:00
Bob
d152d21338 fix teslazap OutOfMemory exception 2010-11-14 17:32:23 +13:00
Bob
f4e04ece12 fix tesla animations and firing at multiple targets 2010-11-14 16:35:53 +13:00
Bob
e7a07ea9c3 Add target param to INotifyAttack. Remove target field from AttackOmni 2010-11-14 16:03:01 +13:00
Bob
f8e6245903 make order queuing work for buildings and turreted units, too 2010-11-14 15:48:02 +13:00
geckosoft
7c146a9d5d Changed: Made "Move" orders queueable 2010-11-13 17:54:16 +13:00
geckosoft
846286c988 Added: QueuedActivity (to be used for chaining orders) 2010-11-13 17:53:00 +13:00
geckosoft
ba25bc6df4 Added: More constructor overloads for Order (accepting a queued boolean now)
Added: Changed all IssueOrders to make use of the IOrderTargeter.IsQueued
Added: A 'hack' for SetChronoTankDestination so it also sets the queued value
2010-11-13 17:52:48 +13:00
geckosoft
622f9bfe71 Added: forceQueue to IOrderTarget' CanTargetUnit / CanTargetLocation
Added: forceQueue to all related methods
Added: Only shows the select cursor IF hovering over a unit AND the orders return the 'default' icon
2010-11-13 17:46:36 +13:00
geckosoft
8df47f5a60 Added: UnitStanceDefensive 2010-11-13 17:44:45 +13:00
geckosoft
d2a0647085 Added: OnOrder & OnTick event at UnitStance 2010-11-13 17:43:55 +13:00
geckosoft
0e750a3f25 Cleanup: Idle activity now reuses itself instead of returning null (causing another Idle object to be created) 2010-11-13 17:43:41 +13:00
geckosoft
0e6dbe28a8 Changed: Renamed UnitStanceGuard => UnitStanceHoldGround 2010-11-13 17:43:09 +13:00
geckosoft
cc0c45bceb Removed: Reference to AttackMoveInteraction.cs from the project 2010-11-13 17:42:55 +13:00
geckosoft
af3e734561 Changed: HackyAI uses AttackMove now instead of Move 2010-11-13 17:42:14 +13:00
geckosoft
1ac61c5e3e Changed: AttackMove actually works 2010-11-13 17:40:38 +13:00
geckosoft
5d3622b79d Removed: Unused AttackMoveInteraction 2010-11-13 17:39:58 +13:00
geckosoft
b3ddf1ae86 Changed: Rendering of the colored shape (adds a shadow + resizes the shape on larger actors) 2010-11-13 17:39:34 +13:00
geckosoft
17770631a2 Added: Rendering of 'SelectionColor'ed shapes at top left of the selection rectangle (using a simple format to define shapes) 2010-11-13 17:38:47 +13:00
geckosoft
05f6958286 Changed: From running on the local player, to running on all players 2010-11-13 17:38:41 +13:00
geckosoft
bd9c748b17 Fixed: SurrenderOnDisconnect (needs testing 2010-11-13 17:33:16 +13:00
geckosoft
6b40abb58c Implemented: Stances
Added: Basic stances (Aggressive, Guard (Hold Ground), Hold Fire, None (dummy), Return Fire)
Added: WorldCommandWidget (to be able to set said stances)
Added: WorldCommandWidget to ra (cnc will follow, later on)
Changed: Added support to AttackBase for firing with movement disabled + utility method ScanForTarget (used by stances)
Added: AssignUnitStance (attach this to unit-producing actors, together with what stances can be picked as 'default')
2010-11-13 17:26:42 +13:00
geckosoft
6d67ab2240 Changed: Attack-move now only triggers when you use 'a' without any modifier 2010-11-13 17:08:46 +13:00
geckosoft
8b3512e2f1 Changed: Build palette hotkeys cannot be triggered anymore when used together with a modifier 2010-11-13 17:08:30 +13:00
geckosoft
5b71bee4c8 Added: ISelectionColorModifier 2010-11-13 17:08:00 +13:00
Bob
75e7124af0 oops 2010-11-13 17:07:48 +13:00
geckosoft
9ad55d5e28 Changed: AttackMoveInteraction now uses a + the 'right' mouse button to do an attack-move (extra nice thing => it wont lose focus of the selected units!) 2010-11-13 17:04:27 +13:00
geckosoft
9e93edf336 Changed: Made GenericSelectTarget & GenericSelectTargetWithBuilding more generic (now it accepts an optional 'expected' mouse button) default => left (as it was hardcoded) 2010-11-13 17:03:24 +13:00
geckosoft
5608756a24 Moved: AutoAttack key handling out of core => RA
Added: AttackMoveInteraction to RA & CNC rules
2010-11-13 17:02:48 +13:00
geckosoft
ebca421856 Moved: BaseBuilding out of core => RA
Implemented: INotifyKeyPress for World traits (to respond on key pressed)
Moved: GotoNextBase (backspace key) out of core => RA
Added: GotoNextBase trait to both RA & CNC
2010-11-13 17:01:35 +13:00
Bob
22e61a5700 refactor QueueAttack -> GetAttackActivity 2010-11-13 16:42:13 +13:00
Bob
7306de3730 make attacks queuable 2010-11-13 15:53:10 +13:00
Bob
10ed3db71d made all orders queuable 2010-11-13 15:53:08 +13:00
Bob
04e05d9aed remove the default impl of QueueAttack; implement it in AttackFrontal and AttackLeap 2010-11-13 14:59:33 +13:00
Chris Forbes
caae95f12e make Server.Server public so it works. 2010-11-10 11:34:37 +13:00
Paul Chote
dfa14f16d3 Move ServerTraits into Mods. 2010-11-10 10:30:26 +13:00
Paul Chote
8e007131c9 Define ServerTraits in mod.yaml 2010-11-10 10:30:26 +13:00
Paul Chote
ed4c588701 Allow custom commands to be parsed when the player is in a ready state. 2010-11-10 10:30:26 +13:00
Paul Chote
d33806e932 More refactoring 2010-11-10 10:30:25 +13:00
Paul Chote
e83838e9ff Pass the client into InterpretCommand 2010-11-10 10:30:25 +13:00
Paul Chote
b77dcd476c Pull the master server communication into a ServerTrait 2010-11-10 10:30:25 +13:00
Paul Chote
836b3a598b Pull out potentially mod-specific player join code (slightly bogus, will fix properly later) 2010-11-10 10:30:25 +13:00
Paul Chote
967b16fc0e Pull LoadMap out of the server 2010-11-10 10:30:25 +13:00
Paul Chote
ee3437d0f6 Pull the traits into their own files 2010-11-10 10:30:25 +13:00
Paul Chote
e20c736e3f Handle server orders in their own traits - needs further refactoring 2010-11-10 10:30:25 +13:00
Paul Chote
a98d20ea72 Start hacking on a server traits model 2010-11-10 10:30:25 +13:00
Paul Chote
38486e8184 Move some mod-specific UI code out of Game 2010-11-10 10:30:25 +13:00
Paul Chote
047a09bbbd Excise previous server extensions code 2010-11-10 10:30:24 +13:00
Paul Chote
d55e58ea1c Map Tweaks: Remove algernon, remove hospital on chokepoint, fix broken water tiles on wargames. 2010-11-09 23:22:34 +13:00
Paul Chote
17afe80a54 Included attribution 2010-11-09 21:44:58 +13:00
Paul Chote
42bf568d80 Use Blast to decrypt data on extraction. 2010-11-09 21:17:09 +13:00
Paul Chote
50157c43de Port Blast from zlib/contribute to c# 2010-11-09 20:10:51 +13:00
Paul Chote
41988a1298 Save PackageEntries into the index so the compressed data can be extracted. 2010-11-09 14:33:02 +13:00
Paul Chote
86058ec19f Initial IFolder Installshield (.Z) package impl. Parses the package header/toc and prints a file list. 2010-11-09 13:29:37 +13:00
Paul Chote
356c750b23 Refactor Package -> MixFile; group filesystem related classes in FileFormats. 2010-11-09 11:02:13 +13:00
Bob
26cbb9d9c6 fix wrong output in Order.ToString 2010-11-07 21:17:11 +13:00
Chris Forbes
4a0b78c1e6 make all other engine widgets public, for Gecko 2010-11-07 17:16:51 +13:00
Bob
fcb7c845ba adjust Mobile so that it also can't double-add to uim 2010-11-07 17:16:17 +13:00
Bob
12f9c0bce9 fix uim-crate crash 2010-11-07 17:16:14 +13:00
Bob
47ed79b912 rename some of Mobile's Activity-builders 2010-11-07 17:16:11 +13:00
Chris Forbes
a265d11a5f make JoinServer public [at Gecko's request] 2010-11-07 08:41:16 +13:00
Bob
8a96c5f7b5 fix infantry entering buildings 2010-11-06 22:27:28 +13:00
Chris Forbes
5e5456191c fix missing assembly reference FileFormats -> System.Windows.Forms in makefile 2010-11-06 20:33:12 +13:00
Chris Forbes
aae7f56e7d extend RevealMapCrateAction to optionally reveal for allies 2010-11-06 20:18:18 +13:00
Chris Forbes
3645b3ee13 increase ParaBomb spread 3 -> 6 2010-11-06 20:02:01 +13:00
Chris Forbes
e0f357390c clean up usings in AirstrikePower 2010-11-06 19:58:41 +13:00
Chris Forbes
9c3cb62838 reduce redeye damage 50 -> 40 2010-11-06 19:55:53 +13:00
Chris Forbes
14225b8e79 reduce dragon damage from 60 to 50 2010-11-06 19:55:10 +13:00
Chris Forbes
e01bf735d9 reduce cooldown on Chronoshift and Invulnerability to 2min each; reduce invuln duration to 30 seconds 2010-11-06 19:51:57 +13:00
Chris Forbes
1904f8ced1 fix weap door never closing 2010-11-06 17:47:11 +13:00
Caleb Anderson
3caca8c323 some noise on shellmap 2010-11-06 17:00:36 +13:00
Chris Forbes
dd7ce2d45e fix dumb crash in UIM 2010-11-06 16:56:50 +13:00
geckosoft
f793f4548b Added: A PasswordField widget (based on the TextField widget) 2010-11-06 16:49:46 +13:00
Chris Forbes
56675a61f5 rationalize the mess of Sound.Play[ToPlayer] functions. 2010-11-06 16:49:08 +13:00
Bob
3dd27fcb77 fix crash involving crushing and dead walls 2010-11-06 16:35:51 +13:00
Chris Forbes
13d76f8e9c removed editor -> ra dep; added EditorAppearance for inconvenient bits that the editor must have _some_ understanding of, but can't see 2010-11-06 15:10:29 +13:00
Bob
9a2cdcde11 move Selectable.Radius into Health 2010-11-06 14:35:26 +13:00
Bob
155e7320cb add support for decimal to fieldLoader. use decimal for speedmodifiers 2010-11-06 14:10:56 +13:00
Chris Forbes
750fd84494 reinstate order validation for ra & cnc 2010-11-06 13:36:53 +13:00
Bob
924adc68a9 fix aircraft desync 2010-11-06 13:36:11 +13:00
Bob
0f8d9d7fb3 fix heli repusion from grounded helis. cleanup flight code 2010-11-06 12:44:25 +13:00
Bob
801aa1156f move aircraft code into Mods.RA/Air/ 2010-11-06 12:18:04 +13:00
Bob
aa0c14c214 Fix crash when generating a syncreport when blaming something other than Tick. 2010-11-06 12:08:33 +13:00
Bob
8fcbb670d8 rename AllowOreAt => AllowResourceAt 2010-11-06 11:53:41 +13:00
Bob
85a26ecdf7 fix invincible aircraft, infantry 2010-11-06 11:06:12 +13:00
Bob
480c5edd75 move Building et al into Mods/ 2010-11-06 11:05:45 +13:00
Bob
fdfa1ddf97 extract DrawGrid from DrawBuildingGrid 2010-11-05 19:50:18 +13:00
Bob
80caf1818b fix off-by-one in IsInRange. use CenterLocation in combat code where appropriate 2010-11-05 19:50:17 +13:00
Bob
5c0cd50797 remove unnecessary parameters from Aircraft.MovementSpeedForCell, and rename to MovementSpeed 2010-11-05 19:50:17 +13:00
Bob
8129d5d7dc use CenterLocation, not Location, to determine facing during attack 2010-11-05 19:50:17 +13:00
Bob
a77b7af5fd add Target overload for IsInRange 2010-11-05 19:50:16 +13:00
Bob
ecf41722c3 rename TargetableSquares -> TargetableCells 2010-11-05 19:50:16 +13:00
Bob
39b09780f6 refactor Targetable into Targetable{Unit,Building} and ITargetable 2010-11-05 19:50:15 +13:00
Bob
98dec6dc8e revert sanity check that building is entirely within map (trees break it) 2010-11-05 19:50:15 +13:00
Bob
50b1ba3acc attack if in range of any cell of a building 2010-11-05 19:50:15 +13:00
Bob
c3fc7b98f3 use UIM (was BIM) to determine what cells a building blocks 2010-11-05 19:50:14 +13:00
geckosoft
f5b8b18d86 Core: Added trait 'SurrenderOnDisconnect' and the core changes required to make this work 2010-11-05 19:48:32 +13:00
geckosoft
e7c61fac5c Core: Added the attacker to IDamageModifier' GetDamageModifier 2010-11-05 19:48:31 +13:00
geckosoft
2640603f6c Added 'Health' and 'PreviousHealth' to the AttackInfo (so we can know how many 'real' damage is done!) 2010-11-05 19:48:31 +13:00
Chris Forbes
1a011276bf (gecko) add more overloads for Renderable, to support scaling 2010-11-05 19:48:31 +13:00
Chris Forbes
bc7cf09287 (gecko) Add support for custom order generators 2010-11-05 19:48:30 +13:00
Chris Forbes
7762241653 (gecko) Send damage notifications to the owner's player actor too. 2010-11-05 19:48:30 +13:00
geckosoft
9489196911 Added a new trait : Scale 2010-11-05 19:48:29 +13:00
Chris Forbes
e32e060d37 (gecko) make production queue content accessible to mod code 2010-11-05 19:48:29 +13:00
Chris Forbes
5e3fce6820 (gecko) Return the ISound when playing sounds, so you can stop it later 2010-11-05 19:48:28 +13:00
Chris Forbes
6655b6ba6a (gecko) make IonCannon and NukeLaunch effects public 2010-11-05 19:48:28 +13:00
Chris Forbes
0b4b003c10 (gecko) Make Parachute public so it can be used in other mods 2010-11-05 19:48:27 +13:00
geckosoft
380e7e8b20 Core: Made stuff public so people (read: openrg) can have its own lobby, based on the core lobby 2010-11-05 19:48:27 +13:00
geckosoft
9b3533abc0 Core: Made Corpse public 2010-11-05 19:48:27 +13:00
Chris Forbes
1409016cbd (gecko) Allow mods to override order validation 2010-11-05 19:48:26 +13:00
Chris Forbes
4aa1fb4b86 refactor mouse position label hooking for Surface 2010-11-02 11:16:30 +13:00
Chris Forbes
40126c52e8 render actors using correct palettes in editor 2010-11-02 10:30:22 +13:00
Chris Forbes
dd600d4590 indent, etc 2010-11-02 09:50:58 +13:00
Chris Forbes
532f420338 build 8bpp bitmaps in OpenRA.Editor 2010-11-02 09:39:35 +13:00
Chris Forbes
e25878e78d ai: dont build defenses if in low power; dont build random stuff if no power-producing item is available on the same queue 2010-11-02 07:51:07 +13:00
Chris Forbes
002cc4842a start reducing duplication in HackyAI 2010-11-02 07:27:31 +13:00
Chris Forbes
eac548ac8b disable bot debug by default 2010-11-01 20:38:28 +13:00
Chris Forbes
3fc4d1b219 fix cnc crashing on startup 2010-11-01 20:31:12 +13:00
Chris Forbes
80e3b8be0d more cleanups 2010-11-01 20:28:28 +13:00
Chris Forbes
fa35f6caa4 cleanups 2010-11-01 20:25:03 +13:00
Chris Forbes
526cf6059a remove Misc.cs; put its contents in sensible places. 2010-11-01 20:15:32 +13:00
Caleb Anderson
1527e472b6 potential fix for bug 312 : PlaceBuilding.ResolveOrder does not validate the requested build location 2010-11-01 18:42:51 +13:00
Bob
94f7c6db97 determine which sprites to render during Render, not Tick 2010-11-01 18:39:50 +13:00
Bob
e3ddb8f757 cache world.LocalPlayer instead of fetching it repeatedly within loops 2010-11-01 18:39:44 +13:00
Chris Forbes
d7d0d371c6 (bob) refactor input dispatch; remove public Dispatch*Input from game; (chris) fix build failures due to rebase past gecko 2010-11-01 18:39:37 +13:00
Chris Forbes
527c60daa7 some cleanup on gecko's stuff 2010-11-01 18:34:44 +13:00
geckosoft
c30050396a Fixed: Possible crash 2010-11-01 17:55:33 +13:00
geckosoft
60a8acf4d4 Added: Another hook for server extensions 2010-11-01 17:55:32 +13:00
geckosoft
5164c3cd7d Hack: Changed the ChooseFreePlayerIndex (hack on its own..) to loop till 256 instead of 8 (ie increasing max player support to 256) 2010-11-01 17:55:32 +13:00
geckosoft
6276e659cd Fixed: A crash when the host disconnects 2010-11-01 17:55:31 +13:00
geckosoft
298314626e Added: Dedicated server support
Added: The ability to not render anything when using the client as a dedicated server
Added: The basic server extension (NullServerExtension)
Exposed: Made some fields public, so that the server extension can access it
2010-11-01 17:55:31 +13:00
geckosoft
0112bc4df7 Added : Some missing changes to make WorldGameOver work (ie missing RejoinLobby etc)
Warning: Please add the following manually (if you cant find it):
	in Game.cs
		find
			'case ConnectionState.Connected:'
		add
			if (ConnectedToLobby != null) ConnectedToLobby();

Tried my best to add it in the patch but it failed :(
2010-11-01 17:55:31 +13:00
geckosoft
c8dbed938a Enable: WorldGameOver at the 'ra' mod (ie after 10 second delay, it'll return all players to the lobby) 2010-11-01 17:55:30 +13:00
geckosoft
278f35e4aa Added: If the 'Owner' ('who' said something) @ chat is null or "" it'll just render the text 2010-11-01 17:55:30 +13:00
geckosoft
dd38e45f2e Added: Lobby server command "spectator" - will attempt to put the player in an available spectator slot 2010-11-01 17:55:29 +13:00
geckosoft
3e08f9b1b1 Added: LocalAssemblies / LocalRules to Manifest.cs (can be used to add a custom set of rules / assemblies to be loaded, other than the ones defined in the mod) 2010-11-01 17:55:29 +13:00
geckosoft
8392a44314 Added: Support for not-synced traits (ITraitNotSynced) 2010-11-01 17:55:28 +13:00
geckosoft
d050d1a4b9 Added : OpenRA.Renderer.Null 2010-11-01 03:50:21 +01:00
geckosoft
56598ce2ff Fixed: crash when starting a new game after disconnecting from own server 2010-11-01 03:46:38 +01:00
geckosoft
2fb72155eb Added: Missing IngameObserverChromeDelegate.cs file (for spectator)
Fixed: Some spectator gui issues (@ gamelobby.yaml / LobbyDelegate.cs)
2010-11-01 03:35:55 +01:00
geckosoft
030bd4b28d Core: Added basic support for Spectators
TODO: Someone modify the files for cnc (chrome / rules)
2010-10-31 04:03:31 +01:00
Matthew Bowra-Dean
b9c40ad3ce Cleanup
Removed OpenRAUploader (long since obsolete) and master server hack from master server upgrade.
2010-10-28 23:03:14 +13:00
Matthew Bowra-Dean
4490a90332 Changed IFolder implementations' priorities to be based on listing order in mod.yaml 2010-10-28 22:21:54 +13:00
Matthew
15d6facdb9 Fix crash in WorldInteractionControllerWidget. 2010-10-25 17:14:14 +13:00
Chris Forbes
b80962b365 fix ore/tib growth -- we can always grow in a cell that already contains our resource type. buildable/terraintype checks only come into it when growing into *new* cells 2010-10-25 11:34:31 +13:00
Chris Forbes
814c6a8713 aircraft crash nicely now 2010-10-25 11:34:30 +13:00
Chris Forbes
eea89c1d33 make FallsToEarth significantly more flexible 2010-10-25 11:34:29 +13:00
Chris Forbes
9ec0367ecb add support for an explosion on aircraft falling out of the sky 2010-10-25 11:34:28 +13:00
Bob
f5fe1013ee remove AttackDefault; use AttackFrontal instead 2010-10-25 09:51:14 +13:00
Bob
c338d28d35 fix 'decided on Attack but ordered Heal' message on medic 2010-10-25 09:14:49 +13:00
Chris Forbes
2f962452e5 fix compile failure in prev 2010-10-25 09:14:22 +13:00
Bob
10f5e68f7f fix #166 (shroud artifacting at bounds) 2010-10-25 09:06:23 +13:00
Chris Forbes
1cde37f32b update cnc to work with updated engine (AttackBase -> AttackDefault) 2010-10-25 08:45:49 +13:00
Chris Forbes
291899de8a glitch-free. 2010-10-25 08:32:14 +13:00
Caleb Anderson
cc70669f1a use player color option 2010-10-25 08:29:55 +13:00
Caleb Anderson
c568dfa486 Contrail trait 2010-10-25 08:29:54 +13:00
Caleb Anderson
ff7daf8727 MoveViewport takes a float to allow for smoother panning. Added more scripting to shellmap 2010-10-25 08:16:08 +13:00
Caleb Anderson
fc72066ed2 Fixing last mouse position commit :( 2010-10-25 08:16:08 +13:00
Caleb Anderson
253ccd6d9b Status bar with mouse position in editor 2010-10-25 08:16:07 +13:00
Bob
01accaeb38 fix cargo 2010-10-25 08:03:13 +13:00
Bob
46c3bc09a1 fix harv bug in c&c 2010-10-25 08:03:12 +13:00
Bob
2f0b7566e5 partial fix for tsla 2010-10-25 08:03:12 +13:00
Bob
9b8ec714d2 add AutoTarget to v2 2010-10-25 08:03:11 +13:00
Bob
5d408fe3c7 make AttackMove use an activity 2010-10-25 08:03:11 +13:00
Bob
aa0b7bedf0 pass target to DoAttack 2010-10-25 08:03:10 +13:00
Bob
c5358f7c82 call DoAttack from activities instead of from Tick in AttackPlane/AttackHeli 2010-10-25 08:03:10 +13:00
Bob
158d6e5647 move CheckFire in Weapon 2010-10-25 08:03:09 +13:00
Bob
e091781104 use new AttackDefault trait instead of AttackBase; make AttackBase abstract 2010-10-25 08:03:09 +13:00
Bob
25582cb9f8 move CancelableActivity into its own file 2010-10-25 08:03:08 +13:00
Bob
fece294cc6 move RemoveSelf activity into Mods/ 2010-10-25 08:03:07 +13:00
Bob
c3501f68e3 move TurnActivity into Mods/ 2010-10-25 08:03:07 +13:00
Bob
c4ee5fbd41 add self param to OnCancel 2010-10-25 08:03:06 +13:00
Caleb Anderson
9a54074b1b motd failure avoidance 2010-10-23 21:27:36 +13:00
Chris Forbes
10e918c375 increase ftrk range 6 -> 8; spread 3 -> 5 2010-10-23 19:14:53 +13:00
Chris Forbes
bbcad99fa7 increase agun range 6 -> 10; increase zsu-23 spread 3 -> 5 2010-10-23 18:52:04 +13:00
Chris Forbes
c8198a1a1c reduce hind cost 2000 -> 1500 2010-10-23 18:52:03 +13:00
Chris Forbes
8d5241f419 reduce hpad cost 1500 -> 300; increase heli,hind cost 1200 -> 2000 2010-10-23 18:52:03 +13:00
Chris Forbes
448b681c5b reduce AFLD cost 1100 -> 300; increase YAK cost 800 -> 1000; increase MIG cost 1200 -> 2000 2010-10-23 18:52:02 +13:00
Chris Forbes
826f7a29b5 remove dead .mpr maps 2010-10-23 18:52:02 +13:00
Chris Forbes
0629b1e2d2 quick hack to fix aircraft fail in prev 2010-10-23 18:49:42 +13:00
Bob
0d9cf63dd2 move Mobile et al into Mods/ 2010-10-22 11:31:13 +13:00
Bob
6513bd5fe0 don't use Move directly 2010-10-22 11:10:32 +13:00
Bob
f933e3de3f fix entering buildings from the east or south 2010-10-22 10:20:34 +13:00
Bob
88a8d84153 use new Enter activity for engy, spy, c4 2010-10-21 20:58:07 +13:00
Bob
8e4f5da791 fix ironcurtain 2010-10-21 18:29:43 +13:00
Bob
a61d21e501 fix sync-checking in replays 2010-10-21 15:33:24 +13:00
Matthew Bowra-Dean
2bcf33661a Give folders higher priority than packages in FileSystem. Also fixes bug where folder contents were not being cached with the correct hash. 2010-10-21 07:44:26 +13:00
Matthew Bowra-Dean
f6df7a06f2 fixes #323 2010-10-21 07:43:52 +13:00
Bob
de92a2fc0c remove UIM-debug from settings (now in DeveloperMode trait) 2010-10-20 20:49:10 +13:00
Bob
6012f1d592 fix a water-walk bug 2010-10-20 20:39:18 +13:00
Chris Forbes
caf676dc33 fix client quits 2010-10-20 20:33:28 +13:00
Chris Forbes
e3ae1bec75 add Yellowstone II map 2010-10-19 21:04:00 +13:00
Chris Forbes
b98b517e35 add some decent 4p cnc maps 2010-10-19 19:25:05 +13:00
Chris Forbes
5d9f25eef5 add Slendermang's 'Into the River Below' C&C map 2010-10-18 18:54:16 +13:00
Chris Forbes
5bf69eb539 strip some dead crap from UnitOrders 2010-10-18 18:44:47 +13:00
Chris Forbes
09f7778294 fix bogus base-cycler 2010-10-18 18:07:08 +13:00
Bob
c8ec5f3579 fix sync 2010-10-17 13:38:16 +13:00
Chris Forbes
a54c7ecc18 reduce ra AFLD power requirement from 50 to 20 2010-10-17 12:34:21 +13:00
Chris Forbes
0064caf1f4 fix cnc missiles a bit; add trails to cnc sam missiles 2010-10-17 12:34:02 +13:00
Chris Forbes
fc2fbd4689 nerf v2 reload slightly (250 -> 280) 2010-10-17 12:27:49 +13:00
Chris Forbes
0f0793cde5 buff arty slightly 2010-10-17 12:27:12 +13:00
Chris Forbes
2fed6f61e9 fix version string showing up twice in bottom-right corner 2010-10-17 10:42:25 +13:00
Bob
3df310df6e halve bandwidth usage 2010-10-16 22:25:31 +13:00
Bob
c2b3a749ca change IConnection interface wrt sending 2010-10-16 21:05:14 +13:00
Chris Forbes
2d2220f38f issue a warning on the debug, rather than exploding on double-quit 2010-10-16 19:09:38 +13:00
Chris Forbes
7509bf85aa #309 add Tiberian's 'chokepoint' cnc 1v1 map 2010-10-16 18:54:04 +13:00
Chris Forbes
64e8088ae4 cnc: nerf apc speed 15 -> 11 2010-10-16 18:54:03 +13:00
Chris Forbes
15584b9b34 c&c unit tuning: orca various nerfs, bggy/jeep/bike speed nerfs 2010-10-16 18:54:03 +13:00
Matthew
79c1d1b0a6 Updated linux post-install scripts to use OpenRA.Utility.exe 2010-10-16 18:48:42 +13:00
Matthew
50860614cf Downloaded packages extracted. Added SharpZipLib in order to extract them. 2010-10-16 18:48:42 +13:00
Matthew
90d1d3e053 Makefile rule for OpenRA.Utility 2010-10-16 18:48:42 +13:00
Matthew Bowra-Dean
3bf83b52fb Download packages for mods action. 2010-10-16 18:48:42 +13:00
Matthew Bowra-Dean
5f57dd7a62 Options to install scores.mix from RA and CnC CDs 2010-10-16 18:48:42 +13:00
Matthew Bowra-Dean
8e1185b56f --mod-info now accepts a comma separated list of mods. 2010-10-16 18:48:41 +13:00
Matthew Bowra-Dean
26098df2a1 Added mod metadata listing to OpenRA.Utility 2010-10-16 18:48:41 +13:00
Matthew Bowra-Dean
9ac9d83745 Moved Mod class into OpenRA.FileFormats. Added OpenRA.Utility project, a CLI program for utility actions on a game install. 2010-10-16 18:48:41 +13:00
Chris Forbes
51edd5a3f4 #314 reduce effectiveness of GUN vs unarmored, 30% -> 20% 2010-10-16 17:19:04 +13:00
Paul Chote
fc07f90f91 Fix editor 2010-10-16 12:06:29 +13:00
Paul Chote
b64dcbf502 Fix HackyAI in cnc 2010-10-16 11:49:27 +13:00
Paul Chote
5694c113be undo testing changes 2010-10-16 09:56:01 +13:00
Paul Chote
01cf5c21a7 Add `roof' to lst 2010-10-16 09:56:01 +13:00
Paul Chote
4206d2e131 Add Katzsmile's transport remake; make it controllable on GDI01 while testing. 2010-10-16 09:56:01 +13:00
Paul Chote
83968553aa Allow maps to override and enforce race/colour selection 2010-10-16 09:56:01 +13:00
Paul Chote
aa2aba1250 Allow map slots to disallow bots 2010-10-16 09:56:00 +13:00
Chris Forbes
bba9c4b976 #313 fixed -- there's unsynced code that runs in Tick, too. 2010-10-16 09:48:39 +13:00
Chris Forbes
999eef2ec9 #157 explosions weren't taking altitude into account 2010-10-16 09:30:32 +13:00
Chris Forbes
f28c8903aa #297 planes get stuck on map edge -- fixed 2010-10-16 09:09:39 +13:00
Chris Forbes
f58eabe667 fix base cycling (and free mcv logic) for cnc 2010-10-15 18:51:25 +13:00
Chris Forbes
86695dfe29 #299 Updated version of 'The Sentinel' 1v1 map 2010-10-15 18:48:39 +13:00
Chris Forbes
9ae452e8d6 make GiveMcvCrateAction less stupid, if the GiveUnitCrateAction says it can't do it. 2010-10-15 18:38:09 +13:00
Chris Forbes
3e547102d2 #217 avoid dumping tanks in the sea, and ships on dry land 2010-10-15 18:36:34 +13:00
pdovy
e883e63c87 fixed bug where cloakable units were not targetable when uncloaked. removed ITargetable interface in favor of using the Targetable trait. fixed warnings in child classes of Targetable. 2010-10-15 18:13:01 +13:00
Caleb Anderson
a904047a16 Toggle-able teamchat on shift-enter 2010-10-15 18:07:36 +13:00
Chris Forbes
ad1af792e6 add CashTrickler trait, to support oil derricks, etc 2010-10-15 17:56:28 +13:00
Chris Forbes
6c9527d9dc #304 engineer goldwrench cursors were backwards 2010-10-15 17:44:18 +13:00
Chris Forbes
da2d461aa8 use fixed missile silo icon 2010-10-15 17:36:56 +13:00
Paul Chote
49bfd69707 Fix voice crash on adding a 3rd side (thanks raminator for finding this) 2010-10-15 12:33:15 +13:00
Paul Chote
2a02df9411 Fix crash on fmv completion 2010-10-15 00:03:15 +13:00
Paul Chote
185ba80e99 Fix FMV player widget display 2010-10-14 23:30:48 +13:00
Paul Chote
127cbf3f96 Start pulling out useful scripting components - stalled by widget changes having broken the fmv player. 2010-10-14 22:16:18 +13:00
Paul Chote
4bdf675def Mute shellmap combat 2010-10-14 20:03:36 +13:00
Paul Chote
9c944924de Fix a pile of compile warnings and debug log spam. Fix <playername> (Dead) in chat 2010-10-14 19:40:00 +13:00
Paul Chote
28f79533eb Customisable mcv crates 2010-10-14 19:27:43 +13:00
Paul Chote
5a834c9500 Add mcv, napalm, nuke crates to cnc. Reduce levelup and cash shares. 2010-10-14 19:27:43 +13:00
Chris Forbes
3255218d5c #298 MINE overlaps units wrong -- fixed 2010-10-14 19:22:16 +13:00
Chris Forbes
9befe377d5 fix invisible crates in cnc (where did that patch go?) 2010-10-14 19:15:37 +13:00
Chris Forbes
f39b4f0750 fix putting units back into badr/c17 and cursors 2010-10-14 18:09:59 +13:00
Chris Forbes
1794625cea #284 double-destroy in same frame fixed 2010-10-14 18:02:15 +13:00
Chris Forbes
42092fe6dd fix #291 2010-10-14 14:41:43 +13:00
Chris Forbes
1a451fe813 fix crash in TiberiumRefineryDockAction.CancelDock 2010-10-13 22:17:55 +13:00
Paul Chote
0e845a9f3a Make tundra slightly less boring 2010-10-13 21:44:14 +13:00
Chris Forbes
2a3c149769 rename oasis map, since that wasn't what it was. 2010-10-13 21:18:26 +13:00
Chris Forbes
7cfcd94e23 #181, #286 fixed -- sharedrandom seed from server is now used. 2010-10-13 21:00:27 +13:00
Chris Forbes
247a8c9717 add Tiberian's TD map: 'The Sentinel (1v1)' 2010-10-13 20:52:40 +13:00
Chris Forbes
4afd8ad783 #289 lobby title should show servername -- fixed 2010-10-13 20:45:03 +13:00
Paul Chote
dca77956cb Revert to saving only non-default settings. 2010-10-13 19:57:53 +13:00
Paul Chote
22c6c3b3f6 Remove the default westwood maps from cnc. 2010-10-13 19:57:52 +13:00
Paul Chote
1e8e5c8f5c Remove aftermath mod - it has bitrotted beyond all usefulness. 2010-10-13 19:57:52 +13:00
Paul Chote
c0fcc862d6 Add some more mod metadata for beedee. Todo: enforce dependencies and standalone during game init. 2010-10-13 19:57:52 +13:00
Paul Chote
5a3ccdf0c5 fix ssm launcher rockets 2010-10-13 19:57:52 +13:00
Paul Chote
1bd802c386 Add tech building definitions to cnc; noncapturable map decorations until they have behavior implemented. 2010-10-13 19:57:52 +13:00
Paul Chote
3a4e2abedd Fix snow theatre 2010-10-13 19:57:18 +13:00
Paul Chote
f13343ef2e Fix tilesets colours for snow and blue tib, fix unit speed over tib, fix lst pathability. 2010-10-13 19:57:18 +13:00
Paul Chote
2b1ac6a60f WIP 1v1 map 2010-10-13 19:57:18 +13:00
Chris Forbes
8aa180c1f4 cleaned up unused bits in attackmove 2010-10-13 19:20:17 +13:00
Chris Forbes
260e420f85 fix crash in attackmove 2010-10-13 19:12:20 +13:00
Chris Forbes
1a203afd89 fix all the buggy crap around chat/teamchat... still hacked 2010-10-13 08:13:21 +13:00
max621
c150fd9475 Added attack move 2010-10-13 08:13:20 +13:00
Chris Forbes
566303a8f1 #276 fixed 2010-10-12 21:19:48 +13:00
Chris Forbes
10f8364b99 #240 declaring war should set the reciprocal state too 2010-10-12 21:19:48 +13:00
Chris Forbes
7c31f72db6 quick hack around the teamchat crash in lobby 2010-10-12 21:19:27 +13:00
Bob
6b6c9639f9 fix crash wrt chat in lobby 2010-10-12 20:37:36 +13:00
Bob
7ca9fcdac9 run the shellmap even while the lobby shows. remove Widget.SpecialOneArg 2010-10-12 18:33:16 +13:00
Bob
20276291ce move Game.world onto OrderManager. use call IssueOrder on world and/or on orderManager, not on Game 2010-10-12 17:30:27 +13:00
Bob
34fc207a6c FUCK YES 2010-10-12 17:30:24 +13:00
Bob
c974e61680 remove refs to Game.world in widgets 2010-10-12 17:30:22 +13:00
Bob
09db76f89f remove ref to Game.world in Move 2010-10-12 17:29:11 +13:00
Bob
6bbf878314 remove ref to Game.world in Viewport.ShroudBounds 2010-10-12 17:29:09 +13:00
Bob
4cd3195f9f call refreshPalette in the right place. make Game.worldRenderer PRIVATE (yay) 2010-10-12 17:29:06 +13:00
Bob
6ea2a06e4b pass WorldRenderer to Widget.Draw, DrawInner 2010-10-12 17:27:08 +13:00
Bob
597dba8584 untangling WorldRenderer from World 2010-10-12 17:24:23 +13:00
Bob
1c1483377c remove ref to Game.world in Combat 2010-10-12 17:24:19 +13:00
Bob
0873741983 don't pass world to Widget.Tick, either 2010-10-12 17:24:17 +13:00
Bob
e0afc08e5f move an access of Viewport into Game 2010-10-12 17:24:14 +13:00
Bob
cb1deacbb2 pass world into CheckSync. don't pass world into Widget.DrawInner 2010-10-12 17:24:12 +13:00
Bob
ab1e930ba3 pass worldRenderer around as necessary 2010-10-12 17:24:07 +13:00
Bob
10bf85f57e move Game.Current{Host,Port} into orderManager 2010-10-12 17:24:03 +13:00
Bob
17990ab8b7 move LobbyInfo onto OrderManager 2010-10-12 17:24:00 +13:00
Bob
beecb8aeb1 remove redundant parameter from ObjectCreator.Param attribute 2010-10-12 17:23:57 +13:00
Bob
6a25d989a7 remove many references to Game.world 2010-10-12 17:23:55 +13:00
Bob
f8776d773d extract FrameData from OrderManager. fix disconnect bug in NetworkConnection 2010-10-12 17:22:17 +13:00
Bob
3724f46a3e remove world arg to SyncLobbyInfo and HandleInput 2010-10-12 17:22:14 +13:00
Bob
915ad7fb7b extract replay saving from OrderManager 2010-10-12 17:22:12 +13:00
Chris Forbes
07023b6c35 add yaml setup for blue tiberium 2010-10-12 16:59:58 +13:00
Chris Forbes
b78b5b22a3 add blue tiberium art 2010-10-12 16:59:58 +13:00
Bob
eca098b0b4 use a getter for Aircraft.Location 2010-10-12 07:59:40 +13:00
Bob
011a20e8b4 add IHasLocation 2010-10-12 07:59:40 +13:00
Bob
9c362f7d41 remove setters on Mobile.{from,to}Cell. use SetLocation instead 2010-10-12 07:59:39 +13:00
Chris Forbes
99d92ee095 move ColorFromHSL out of the ui code 2010-10-11 19:52:46 +13:00
Chris Forbes
b905d343af fix mishandled CancelProduction 2010-10-11 19:37:45 +13:00
Chris Forbes
024b564b8c maybe this works better 2010-10-11 19:10:34 +13:00
Chris Forbes
9c0e3ac4c9 allow AppearsOnRadar to use Location rather than OccupiedCells, for things that don't occupy any cells 2010-10-11 18:54:13 +13:00
Chris Forbes
a2205e9031 fix some dumb (nonfatal) crashes in the editor with nothing loaded 2010-10-11 18:21:41 +13:00
Chris Forbes
0df9815d2c fix base-cycling for mac build, too? 2010-10-10 15:11:53 +13:00
Chris Forbes
79d6eb4a2b some widgets cleanup 2010-10-10 15:09:26 +13:00
Chris Forbes
0d8557eadb fix NRE in CancelableActivity 2010-10-10 11:04:39 +13:00
Matthew Bowra-Dean
70f6fc7a7a Removed git describe from checkout-and-build.sh 2010-10-09 22:26:17 +13:00
Paul Chote
11f6a8b945 Revert mono 2.8 deps; causes desyncs. 2010-10-09 20:05:37 +13:00
Chris Forbes
e3d71acb05 fix crash in CrateEffect 2010-10-09 13:40:57 +13:00
Chris Forbes
580f1cfe97 bot and humans hate each other, even if the host is on a team. 2010-10-09 13:40:55 +13:00
Andrew Riedi
3d7434f42e Fixed under VS 2010. 2010-10-09 13:40:52 +13:00
Chris Forbes
ef96604f9e #231 scroll jumping fixed 2010-10-09 13:40:49 +13:00
Chris Forbes
465f5d295b force master server url update, if old. 2010-10-09 13:40:47 +13:00
Chris Forbes
1feb377d43 fix bogus target lines being drawn to 0,0 2010-10-09 13:40:33 +13:00
Caleb Anderson
a065fb464e bandage to fix dogs not killing infantry in certain cases 2010-10-09 13:40:21 +13:00
Chris Forbes
e39917ca19 trim bbox for ftrk 2010-10-08 19:09:18 +13:00
Chris Forbes
318f496bf9 #202 fixed 2010-10-08 19:03:01 +13:00
Chris Forbes
ed8a155249 if c17 gets confused, just fly away 2010-10-08 18:57:14 +13:00
Chris Forbes
40ac5f7b6e FallsToEarth for cnc helis too 2010-10-08 18:45:52 +13:00
Chris Forbes
517754027e 8Inch and SubMissile minimum ranges temporarily disabled, until combat bugs are fixed 2010-10-08 18:33:38 +13:00
Caleb Anderson
ef4f478e10 Strip newlines from scrolling text. Frame-friendly update of scrolling text 2010-10-08 18:29:20 +13:00
Chris Forbes
92c30b89f8 FACT hp 1000 -> 1500 2010-10-08 18:26:25 +13:00
Chris Forbes
7331a9c4fb prevent aircraft shooting while landed 2010-10-08 18:25:26 +13:00
Chris Forbes
d2b9e150f1 add FallsToEarth for helicopters dying 2010-10-08 18:24:08 +13:00
Chris Forbes
8ba329f1be reduce cost of CA 3200 -> 2400 2010-10-08 18:03:34 +13:00
Chris Forbes
8868eab247 nerf hind chaingun from [x2] 40@3 to 20@10 2010-10-08 18:03:13 +13:00
Caleb Anderson
f12889e684 Sensible scroll cursor positions for cnc. RA seems to be totally different, didn't touch atm 2010-10-08 17:39:00 +13:00
Caleb Anderson
5c095bc174 more politic default motd text for cnc 2010-10-08 17:38:55 +13:00
Caleb Anderson
0c24a08436 sane default scroll speed 2010-10-08 17:38:48 +13:00
Chris Forbes
9762b540b0 fix bogus reverse-enter-transport (in ResolveOrder this time) 2010-10-08 17:38:07 +13:00
Paul Chote
fd34f2ba99 Fix #225 and some other uses of a.IsInWorld / a.IsDead() 2010-10-08 10:56:50 +13:00
Paul Chote
ad6481c8e8 Change master server url. Won't work until dns is set correctly. 2010-10-07 22:46:44 +13:00
Paul Chote
7426d47cd5 Fix some compile warnings 2010-10-07 22:46:44 +13:00
pdovy
761f62292f missing files from previous commit 2010-10-07 22:46:44 +13:00
unknown
63b8555bc9 Fix bug that prevented ground units from attacking landed aircraft. 2010-10-07 22:46:44 +13:00
Bob
3209da4a4a fixed PlaceBuilding and Chronosphere ordergenerators 2010-10-07 22:07:13 +13:00
Bob
aebef4f1c8 rename IIssueOrder2 -> IIssueOrder 2010-10-07 22:07:13 +13:00
Bob
d3244184c1 implement order targeter for everything else 2010-10-07 22:07:13 +13:00
Bob
39e62354a8 implement order targeter for passenger 2010-10-07 22:07:12 +13:00
Bob
f525c3808e implement order targeter for cargo 2010-10-07 22:07:12 +13:00
Bob
87a0b52ce5 more order targeters 2010-10-07 22:07:12 +13:00
Bob
4bc9e01516 use new orders system in various traits 2010-10-07 22:07:12 +13:00
Bob
711d05da98 use IIssueOrder2 in AttackBase 2010-10-07 22:07:12 +13:00
Bob
3d805ff40d added IIssueOrder2. most orders are broken, but Minelayer is fixed 2010-10-07 22:07:12 +13:00
Bob
0cd140849b fix some support powers 2010-10-07 22:07:12 +13:00
Bob
d6110b9ef0 add Sync.AssertUnsynced. use it in OrderGenerator.set 2010-10-07 22:07:12 +13:00
Bob
26d1db778e push the check-synchash-doesn't-change pattern into a utility fn. furthur reduce the number of uses on Game.world 2010-10-07 22:07:11 +13:00
Bob
f41aa474aa remove more uses of Game.world 2010-10-07 22:07:11 +13:00
Paul Chote
0002e80a19 Use new deps package, built on mono 2.8. Enable new sgen garbage collector. 2010-10-07 22:05:43 +13:00
Chris Forbes
759a52d86e fix build failure from bad merge in prev 2010-10-07 18:24:40 +13:00
max621
44fe0396bb Added shift+right click on build menu cancels 5 orders. Added ctrl+shift+right click on build menu cancels all orders 2010-10-07 18:23:26 +13:00
rasco
dd6d8d916e hackyAI 2010-10-07 07:42:40 +13:00
Chris Forbes
5af8f5e2d9 bots choose random colors 2010-10-07 07:41:14 +13:00
Caleb Anderson
c85503811c Clamp, scroll, scrollspeed, sliders
Reduced clamp duplication
Fixed scrolling speed issue
Modified scrollspeed slider to use a range
Fixed scrollspeed, volume, and sound sliders not showing current setting.
2010-10-06 20:53:56 +13:00
Chris Forbes
ab431fe9ee fix crash on warhead=null 2010-10-06 20:17:03 +13:00
Chris Forbes
7ec9958d47 hackyai should only attack humans 2010-10-06 20:04:36 +13:00
rasco
cfc74a6dee HackyAI: builds defense now. rally points are rechosen so units are more scattered in the base. builds only e1-3 and 1-3tnks. 2010-10-06 19:14:29 +13:00
Chris Forbes
cecdd73e08 destroy ore in all smudged cells 2010-10-06 18:37:32 +13:00
Chris Forbes
381e080b11 tweak nuke timing back 2010-10-06 18:32:33 +13:00
Chris Forbes
c6a047cb1a fix silent nukes 2010-10-06 18:29:05 +13:00
Chris Forbes
4c51733e04 actually add the cratenuke warhead 2010-10-06 18:25:07 +13:00
Chris Forbes
8f613b80e8 ban cloak crate on infantry 2010-10-06 18:16:09 +13:00
Chris Forbes
10de282daa add mechanism to exclude particular actor types from picking up any crate 2010-10-06 18:13:29 +13:00
Chris Forbes
915e123956 add minimum ranges for mig/yak/ca/msub/hind/v2rl/arty 2010-10-06 18:05:31 +13:00
Chris Forbes
8cb7a7b8ce add support for WeaponInfo.MinRange 2010-10-06 17:41:52 +13:00
Chris Forbes
ce5cf93077 prevent infantry going prone due to tib damage 2010-10-06 17:37:23 +13:00
Chris Forbes
1390bb7428 ra: reduce parabombs charge to 1min 2010-10-06 17:32:04 +13:00
Chris Forbes
3c5b136216 ra: reduce nuke charge time 13min -> 9 min 2010-10-06 17:29:45 +13:00
Chris Forbes
66785e606a ra: brik hp 1500 => 1000 2010-10-06 17:23:12 +13:00
Chris Forbes
e2239fa50c #215 obli misses moving units fixed 2010-10-06 17:22:11 +13:00
Chris Forbes
7f7712aa64 #203 dogs eating walls fixed 2010-10-06 17:20:20 +13:00
Chris Forbes
b1605e115a #206 badr/badr.bomber appear in tooltips 2010-10-06 17:15:52 +13:00
Chris Forbes
69b2da86be RA: +20% 4tnk HP 2010-10-06 17:13:39 +13:00
Chris Forbes
18e965e5aa fix desync on destroying ore storage buildings 2010-10-06 10:59:46 +13:00
Chris Forbes
24f0c28f56 fix massive player/client confusion after people drop 2010-10-06 10:59:45 +13:00
Paul Chote
25af51b4ac Prevent a race condition 2010-10-05 19:00:36 +13:00
Paul Chote
ecd7064cc3 Add an example mod that adds a soviet supply truck 2010-10-05 18:48:00 +13:00
Chris Forbes
477a21e782 fix 'minv/minp' showing up in tooltips 2010-10-05 17:58:30 +13:00
Chris Forbes
899d9af62b CNC: +25% HP on FACT/MCV 2010-10-05 17:58:29 +13:00
Paul Chote
17eca983ef Fix wall sell exploit 2010-10-05 17:56:30 +13:00
max621
2fc219ecd5 Fixed auto attack not working properly due to code expecting 'Idle' activity but most units use 'IdleAnimation' in RA mod 2010-10-05 17:45:29 +13:00
Chris Forbes
49a645cd2d fix ubuntu-64 support (Tao.FreeType was quite bogus.) 2010-10-05 17:42:13 +13:00
Matthew
7cb8da411d Updated git url to point to new upstream location. 2010-10-05 17:42:13 +13:00
Matthew
4bcdf3cf11 Netcode discussion from Etherpad. 2010-10-05 17:36:03 +13:00
Matthew
1b525ff809 Export FTP server and added username/password to VERSION file upload. 2010-10-05 17:36:03 +13:00
Caleb Anderson
cdec3fce26 Don't tell all players about my yaks 2010-10-05 17:25:30 +13:00
Caleb Anderson
7bdf6a953f New slider Range parameter. Palette modifications. Potential crash fix. Clamp function.
Range parameter added to slider. Supports returning a range of values
rather than just 0-1. Allows you to not have to post process the offset.
Modified palette selector to not have full range, which was causing
blown out units.
Introduced exension method Clamp<T>(min, max)
Fixed crash deserializing out of bound color value using above
extension.
2010-10-05 17:25:25 +13:00
Chris Forbes
06b20c8ba5 fix blatant wrongness in parallel builds 2010-10-02 20:55:43 +13:00
Paul Chote
9b484b53ec Show mod info in server browser 2010-10-02 20:37:25 +13:00
Paul Chote
9620b4ed46 Add mod metadata, and filter valid mods on startup. 2010-10-02 20:37:22 +13:00
Caleb Anderson
d8908c44d0 Nicer default ticker text 2010-10-02 01:13:55 -05:00
Caleb Anderson
cfe705531a Async motd grab. Client and server version in MasterServerQuery 2010-10-02 01:13:53 -05:00
Caleb Anderson
9a2fd38ab6 MOTD ticker. ScrollingText Widget 2010-10-02 01:13:51 -05:00
Chris Forbes
911e7f62de fix retardedly putting everyone in slot 0. 2010-10-02 18:33:29 +13:00
Chris Forbes
403b81bdc9 apply the balance stick to BIKE 2010-10-02 15:49:42 +13:00
Chris Forbes
a0714b00b3 a bit of cleanup 2010-10-02 15:49:42 +13:00
Chris Forbes
d5239ee77a add tib and spawns to new map 2010-10-02 15:49:41 +13:00
Chris Forbes
03ec97f302 unfinished 2v2 cnc map 2010-10-02 15:49:41 +13:00
Chris Forbes
3255f95ee9 ffs, more paths 2010-10-02 15:35:48 +13:00
Chris Forbes
4c8fd5e73d oops 2010-10-02 15:30:16 +13:00
Chris Forbes
7179ef0f45 fix packaging script 2010-10-02 15:19:14 +13:00
Alli
6d5918b11d Remove compiler warnings 2010-10-02 14:30:54 +13:00
Matthew Bowra-Dean
81c484d1c9 Fixed debian package prereqs 2010-10-02 13:28:22 +13:00
Chris Forbes
de1044c24c hack around imagelist deserialization being completely busted across platforms 2010-10-02 13:22:54 +13:00
Paul Chote
e4c31939d9 Save all settings to settings.yaml, not just non-defaults. 2010-10-02 12:15:15 +13:00
Paul Chote
7f48d6796e Fix scroll ticks 2010-10-02 12:01:11 +13:00
Matthew Bowra-Dean
4fd77aec8e Only add 'Latest:' text if query succeeds. 2010-10-02 11:39:56 +13:00
Matthew Bowra-Dean
92fece01de Added latest version information underneath current version in main menu. 2010-10-02 11:39:54 +13:00
geckosoft
d8d987f844 Fixed Settings menu issue (overlapping text) 2010-10-02 11:38:42 +13:00
unknown
de429a4c62 Added new setting : Scroll Speed (added to cnc & ra) 2010-10-02 11:38:39 +13:00
Chris Forbes
c0ca35a4ff fix AI jam in cnc 2010-10-02 11:33:50 +13:00
Chris Forbes
1bff8559fb pull HasAdequatePower out into a function 2010-10-02 11:33:47 +13:00
Chris Forbes
de98274165 fix #184 crashes while placing minefield 2010-10-02 11:33:04 +13:00
Chris Forbes
59e2228b2a shader fallback path for cg-2.1, which misinterprets 'latest' 2010-10-02 11:32:14 +13:00
geckosoft
96d1408d45 Fixed crash bug #197 2010-10-02 11:31:55 +13:00
Paul Chote
ff45ae2d16 Fix direct connect in cnc 2010-10-02 11:31:19 +13:00
Chris Forbes
47950c9113 Revert "remove setters on Mobile.{from,to}Cell. use SetLocation instead"
This reverts commit 911db3feb1.
2010-09-28 07:45:14 +13:00
Chris Forbes
f402ec7898 Revert "add IHasLocation"
This reverts commit 699b4b1154.
2010-09-28 07:43:49 +13:00
Chris Forbes
a3c0448e15 fix broken mac packaging script 2010-09-27 21:44:23 +13:00
Bob
699b4b1154 add IHasLocation 2010-09-26 18:17:23 +12:00
Bob
911db3feb1 remove setters on Mobile.{from,to}Cell. use SetLocation instead 2010-09-26 16:46:22 +12:00
Paul Chote
c790db8e84 Fix and bulletproof osx packaging script; cleanup some obsolete .gitignore entries 2010-09-26 10:18:22 +13:00
Bob
d6dd392028 use Invariant culture for float parsing (workaround a mono bug) 2010-09-26 09:11:26 +12:00
Bob
636b2a8ea7 fix Direct Connect window 2010-09-25 19:26:02 +12:00
Chris Forbes
959d3f8bd7 fix crash in giving a harv DeliverOre order after its proc has died, but it hasnt noticed yet 2010-09-25 07:34:51 +12:00
Matthew
193cb929f1 Fixing error with Windows package script launching 2010-09-24 22:12:26 +12:00
Chris Forbes
f93e270fe4 reduce v2 range and damage slightly 2010-09-24 21:49:26 +12:00
Chris Forbes
f19953c39a nerf ftrk heavily vs most ground, and reduce hp from 300 to 120 2010-09-24 21:44:57 +12:00
Matthew
59d5ce1bc8 +x permissions for checkout-and-build.sh 2010-09-24 20:42:29 +12:00
Matthew
43cf7cd074 Yet another packaging script. 2010-09-24 20:42:26 +12:00
Chris Forbes
aba76f4b50 don't look up resource type every cell for ore, too 2010-09-24 20:40:56 +12:00
Bob
8021fc3b20 Deduplicate shroud rendering code 2010-09-24 18:11:11 +12:00
Bob
7bf4cb85fa fix perf in ShroudRenderer 2010-09-24 18:11:08 +12:00
Bob
6dd03bb339 bugfix in ResourceLayer 2010-09-24 18:11:06 +12:00
Bob
14e517cab5 Autoflush renderer. Sprite.DrawAt convenience function. 2010-09-24 18:11:03 +12:00
Bob
cdcfeb6276 render perf improvement: BufferSubData, and don't use the same buffer back-to-back 2010-09-24 18:11:00 +12:00
Matthew
c77c63a380 Fix #130.
Windows installer now checks version of OpenAL32.dll and downloads and updates if necessary.
2010-09-24 16:40:55 +12:00
Matthew
9921fe8fad Linux package parallelisation. 2010-09-24 16:40:55 +12:00
Matthew
f848c5d7d4 Parallel building of packages. 2010-09-24 16:40:55 +12:00
Matthew
62c47e3b12 Reordered packaging platforms due to popular demand. 2010-09-24 16:40:55 +12:00
Matthew
094986d066 Tag prefixes change upload location for packages. 2010-09-24 16:40:55 +12:00
Chris Forbes
d87e02ab41 more tweaks, make DD a detector again (wtf?) 2010-09-23 22:23:39 +12:00
Chris Forbes
3f415a8fdf tweak torps more 2010-09-23 22:09:56 +12:00
Chris Forbes
846371cf3e homing torps, bubble trail 2010-09-23 22:09:56 +12:00
Chris Forbes
45c77e64ee fix various desyncs when using cheats 2010-09-23 22:09:55 +12:00
Bob
66493031c8 fix crash with idle units and pathdebug 2010-09-23 21:06:44 +12:00
Bob
384b26db60 fix fieldloader bug caused by foreach language-bug 2010-09-23 17:24:06 +12:00
Bob
d66dbeb312 removing unused stuff from TraitsInterfaces 2010-09-23 15:43:34 +12:00
Chris Forbes
ba9611f544 un-FP Building.cs power stuff 2010-09-22 21:43:04 +12:00
Chris Forbes
b6e56560d4 fix a crash in RepairIndicator with a dead building 2010-09-22 20:48:45 +12:00
Chris Forbes
1f047d439f back out editor icon hack -- it breaks the packaged editor on windows 2010-09-22 19:26:09 +12:00
Chris Forbes
5233ae4770 remove spam from Util.GetFacing 2010-09-22 19:21:22 +12:00
Chris Forbes
562e07264a remove lots of debug spam 2010-09-22 19:19:18 +12:00
Chris Forbes
4dab4ed73f reenable crates 2010-09-22 19:15:45 +12:00
Chris Forbes
a97ddffa53 fix cnc movement (argh) 2010-09-22 19:00:07 +12:00
Bob
8e589e3c16 fix infantry anims 2010-09-22 13:32:58 +12:00
Bob
96f72ce842 new map in ra_perf 2010-09-22 13:08:02 +12:00
Bob
d8de477edb fix IdleAnimation. add IsAttacking to AttackBase 2010-09-22 12:21:49 +12:00
Bob
694fb6831a fix target line on Move that has not yet calculated path 2010-09-22 12:03:45 +12:00
Bob
c16a515224 make more activities cancelable. remove many uses of CurrentActivity is T 2010-09-22 11:53:58 +12:00
Bob
e2eae7973b removing warning 2010-09-22 11:18:47 +12:00
Bob
9e3c938706 removing cancelable from Move. remove unnecessary qualified names from Production 2010-09-22 10:46:54 +12:00
Bob
ef665df2e9 refactor activity queueing 2010-09-22 10:13:13 +12:00
Bob
271a3eea8d fix harv 2010-09-22 08:49:56 +12:00
Bob
2f6315b816 make the pathfinder use integers 2010-09-22 08:04:52 +12:00
Bob
ac8d408ba7 allow queuing non-buildings while the queue is ready 2010-09-22 08:02:20 +12:00
Bob
0fdd49c96a MovePart becomes an Activity 2010-09-22 08:02:17 +12:00
Bob
e390cf8ab0 fix real-ra map importer when map isn't in game root 2010-09-22 08:02:15 +12:00
Bob
64d700cd70 make c&c work too 2010-09-22 08:02:12 +12:00
Bob
d3db9d3710 yes, i do want += 2010-09-22 08:02:09 +12:00
Bob
9eb05a43f9 show perf widget 2010-09-22 08:02:06 +12:00
Bob
3165ec5359 create widgets on demand 2010-09-22 08:02:03 +12:00
Bob
f4699132d6 made OpenWindow and CloseWindow static 2010-09-22 08:02:00 +12:00
Bob
086bdfb4bd new object creation logic 2010-09-22 08:01:57 +12:00
Chris Forbes
61fd12c7da oops; prev didnt run 2010-09-22 07:19:18 +12:00
Chris Forbes
9979209c34 more useful debug, less debug 2010-09-21 22:42:31 +12:00
Chris Forbes
b0c06d4cd9 force consistent conversion to float in a few places 2010-09-21 22:08:40 +12:00
Chris Forbes
3a617f8934 sync the last path generated, to try and catch this MUCH earlier 2010-09-21 21:43:16 +12:00
Chris Forbes
b35a7d9f8d stacktrace on set_Facing too 2010-09-21 21:06:37 +12:00
Chris Forbes
67fa079658 more debug 2010-09-21 21:05:28 +12:00
Chris Forbes
c9edbd8a80 report the tick in debug 2010-09-21 18:10:05 +12:00
Chris Forbes
4b49bf03dc reset local tick # at gamestart 2010-09-21 18:05:54 +12:00
Chris Forbes
6cfad6f2ab stacktrace in SetLocation 2010-09-20 22:52:28 +12:00
Chris Forbes
c0c4e7299b log changes to synced parameters in Mobile 2010-09-20 22:07:16 +12:00
Bob
afda1647fd moved more traits from engine into mods 2010-09-20 21:17:50 +12:00
Bob
aff6889995 moved traits from engine into mod 2010-09-20 20:58:42 +12:00
Bob
65515d54af fix crash where harv and linked proc get destroyed by the same bullet 2010-09-20 20:58:39 +12:00
Chris Forbes
c5b7c43d23 add pathspam in debug 2010-09-20 19:06:43 +12:00
Chris Forbes
dba5adc91c more debug 2010-09-20 18:33:48 +12:00
Chris Forbes
0073a03ca4 add debug for nudges 2010-09-20 18:27:31 +12:00
Chris Forbes
5509d0d2e9 suspecting drag instead 2010-09-20 17:55:16 +12:00
Chris Forbes
fe52e3722e more debug 2010-09-20 17:45:27 +12:00
Chris Forbes
3ddd1581f1 add debug for this desync 2010-09-20 17:28:06 +12:00
Iran
56efc3930b Pretty up HACKING and add some info 2010-09-19 23:10:33 +02:00
Iran
2f8d81a0f7 Fix OnFormClosing's MessageBox.Show under mono, unix newline and Environment.Newline didn't work, but Windows newline does work 2010-09-19 22:39:00 +02:00
Iran
46486073ab Display icon while running the Editor under mono, cant test it on windows 2010-09-19 19:31:10 +02:00
Chris Forbes
3dc11eaa05 fix crash in cnc when placing WEAP 2010-09-19 20:13:19 +12:00
Caleb Anderson
b62ee4d37c Fixed sequence crash 2010-09-19 19:13:15 +12:00
Paul Chote
532afc3ff8 Fix random logging 2010-09-19 19:03:18 +12:00
Paul Chote
9ddb2beced Apply the same to bibs and smudges 2010-09-19 18:57:42 +12:00
Matthew Bowra-Dean
1e758ec3e0 Removed website from main repository.
Moved to http://github.com/beedee/OpenRAWebsite/
2010-09-19 18:53:55 +12:00
Chris Forbes
aa1d44428d fix prev 2010-09-19 18:50:34 +12:00
Paul Chote
23da8a24bd Only render shroud/ore that is in the current viewport 2010-09-19 18:34:23 +12:00
Iran
fef291a27e don't switch production tab while selecting building not owned by you 2010-09-19 18:12:22 +12:00
Paul Chote
f49e56d660 3x faster syncreport 2010-09-19 17:13:44 +12:00
Paul Chote
927ab00f4d Use the correct number of players in the lobby team selector 2010-09-18 22:33:41 +12:00
Paul Chote
3f870e7e48 Remove yaml cruft; rename music repeat -> loop. 2010-09-18 22:19:57 +12:00
Paul Chote
f2a321186f Fix osx packaging 2010-09-18 21:53:22 +12:00
Paul Chote
410daecab6 sync SharedRandom 2010-09-18 21:53:10 +12:00
Paul Chote
966e3bb71a Remove debug spam 2010-09-18 20:47:24 +12:00
Paul Chote
652f06f604 Route the power check for support powers via the tech tree 2010-09-18 20:46:01 +12:00
Paul Chote
2a10af2007 Fix z-offset 2010-09-18 20:46:00 +12:00
Paul Chote
4cb26c0e3c Try again, with less fail. 2010-09-18 20:46:00 +12:00
Paul Chote
8455dadb3c Powerdown etc... untested 2010-09-18 20:46:00 +12:00
Paul Chote
3c19b3df73 Update power on damage 2010-09-18 20:46:00 +12:00
Paul Chote
c796e155e7 Fix UpdateTotals(); add debug info. 2010-09-18 20:46:00 +12:00
Paul Chote
ce9caec291 Begin splitting power into its own trait; incomplete and non-working. 2010-09-18 20:46:00 +12:00
Chris Forbes
0330ef2b9e blah 2010-09-18 19:57:45 +12:00
Chris Forbes
872a304714 all traits can contribute to the synchash 2010-09-18 18:34:57 +12:00
Chris Forbes
59cc50df4c hack synchash to sync the traitdict contents (just ITick impls for now) 2010-09-18 18:31:36 +12:00
Chris Forbes
a1fd84fb15 make actors collection sync order-dependent, since the actors themselves are. 2010-09-18 18:26:03 +12:00
Chris Forbes
317007f7ce temporarily disable crates (stability problem) 2010-09-18 17:23:47 +12:00
Matthew
387212d9ea Fixed RPM build script file listing 2010-09-18 16:07:10 +12:00
Matthew
c9ca5e207b Updated RPM build script to include menu, desktop and icon files. 2010-09-18 14:10:48 +12:00
Chris Forbes
ce78944a9e more editor hax 2010-09-18 13:30:12 +12:00
Chris Forbes
1fb336b7da unwtf the editor a bit 2010-09-18 13:26:45 +12:00
katzsmile
e4d05407d9 Added export minimap to PNG. Hided unfinished Tools and Bitmap import menus.
Added hack to render building roofs of they have same name but have "2" in name. (weap and weap2)

Signed-off-by: katzsmile <katzsmile@lead-games.com>
2010-09-18 12:56:08 +12:00
Chris Forbes
f7eca1157e fix walkability of sh30 template in RA temperate and snow 2010-09-18 11:56:22 +12:00
Chris Forbes
a64245fc10 fix it so it compiles with VS again 2010-09-18 11:52:51 +12:00
Paul Chote
ad8038867d PlayerProductionQueue -> ClassicProductionQueue. 2010-09-18 11:28:50 +12:00
Paul Chote
fb90400524 Rename TechTreeCache -> TechTree 2010-09-18 11:28:48 +12:00
Paul Chote
08b25d10c1 Remove dead TechTree code 2010-09-18 11:28:46 +12:00
Paul Chote
ba09bbba8e Remove TechLevel from special powers, and identify the performance problem. 2010-09-18 11:28:43 +12:00
Paul Chote
0d2e1d7de5 Hidden debug parameter for perf tick logging 2010-09-18 11:28:39 +12:00
Paul Chote
22861fca5a Sanitize ProductionQueue and fix bugs in TechTreeCache.
Gives perf win on every tick, and fixes bugs where you lose prereqs when buildings are low power.
2010-09-18 11:28:33 +12:00
Chris Forbes
692ef539f9 fix timings of infantry idle anims 2010-09-18 11:25:45 +12:00
Matthew
d07b0e4400 Linux desktop/menu entries. 2010-09-17 20:21:16 +12:00
Chris Forbes
9848d1f403 hack WEAP door z 2010-09-17 20:21:22 +12:00
Chris Forbes
83eae029b7 add explicit Z to Renderable. eating my hat, etc. 2010-09-17 20:21:21 +12:00
Paul Chote
99e225c279 Fix cnc fact footprint 2010-09-17 20:18:21 +12:00
Paul Chote
1785c4e4a8 Support for arbitrary building art offset relative to footprint 2010-09-17 20:18:14 +12:00
Chris Forbes
69753f8a08 ffs 2010-09-17 19:54:20 +12:00
Chris Forbes
5593b9ffdd start splitting up tsb; fix a wtf in the save code 2010-09-17 19:00:09 +12:00
Chris Forbes
1b66635670 fix A10 exploit 2010-09-17 19:00:08 +12:00
Chris Forbes
f1b1f3bd52 make hackyAI less of a tard 2010-09-17 19:00:08 +12:00
Chris Forbes
ff611dac32 hack BelowUnits z 2010-09-17 19:00:07 +12:00
Chris Forbes
e0a4cb4763 hack around some more z-glitches 2010-09-17 19:00:07 +12:00
Paul Chote
a3246866fb Better perf logging 2010-09-17 10:02:24 +12:00
Paul Chote
b94c2fc7c4 Fix d2k colour picker (fact doesn't exist yet) 2010-09-17 09:21:14 +12:00
Paul Chote
d530cf22da Include resources in the editor preview. 2010-09-17 09:09:36 +12:00
Chris Forbes
94e5b02a39 fix some editor weirdness (2/2) 2010-09-17 07:58:06 +12:00
Chris Forbes
40533a50c1 fix some editor weirdness (1/2) 2010-09-17 07:57:57 +12:00
Paul Chote
d4182b1929 Tweaks to minimap preview 2010-09-16 22:54:49 +12:00
Paul Chote
482129499d Fix editor makefile 2010-09-16 22:32:35 +12:00
katzsmile
366cd02761 Changed path text box to editable on save 2010-09-16 22:32:35 +12:00
katzsmile
f549e7e5a8 added map preview image on save and on load 2010-09-16 22:32:35 +12:00
katzsmile
4cab7c7fc4 added minimap preview 2010-09-16 22:32:35 +12:00
katzsmile
e3939d4805 Fixed most of bugs. Redone open/save dialog 2010-09-16 22:32:35 +12:00
katzsmile
2ae6983bc2 floater window changes 2010-09-16 22:32:34 +12:00
katzsmile
ad00193a17 Little fix for "indian" code
Signed-off-by: katzsmile <katzsmile@lead-games.com>
2010-09-16 22:32:34 +12:00
katzsmile
810667abbc changed border in open/save dialog 2010-09-16 22:32:34 +12:00
katzsmile
a66efd56f2 Title display in open/save dialogs
Signed-off-by: katzsmile <katzsmile@lead-games.com>
2010-09-16 22:32:34 +12:00
katzsmile
36ba15e7f9 Displaying map theater name in open/save dialogs 2010-09-16 22:32:34 +12:00
katzsmile
d809fb1e7b Updated Map Editor:
New Open/Save dialogs
Added icon for program
Hacked Actors Tab.
Started work on floater with tools

Signed-off-by: katzsmile <katzsmile@lead-games.com>
2010-09-16 22:32:34 +12:00
Chris Forbes
d0bc834a57 #151 fixed 2010-09-16 18:32:03 +12:00
Chris Forbes
483ca8cc4c #82 deliver to allied proc -- fixed 2010-09-16 18:22:45 +12:00
Chris Forbes
06aba5da46 fix remote engineer repair exploit 2010-09-16 18:19:06 +12:00
Chris Forbes
106fbcd5af remove some crashes 2010-09-16 18:18:16 +12:00
Chris Forbes
f456e41a45 check if a passenger is appropriate for reverse-enter-transport 2010-09-16 18:07:42 +12:00
Chris Forbes
7dc3aee4a2 #68 dog attacking ground fixed 2010-09-16 17:56:19 +12:00
Chris Forbes
c91bee8091 add option to ban attacking ground 2010-09-16 17:53:59 +12:00
Chris Forbes
82875e15f9 remove some bogosity; there will likely be regressions, but not a huge deal. 2010-09-16 17:50:52 +12:00
Chris Forbes
d6f8b7d850 fix z-order bug 2010-09-16 17:43:17 +12:00
Chris Forbes
72fe873b26 #105 fixed 2010-09-16 10:23:37 +12:00
Paul Chote
e9f34b1e21 Quick fix for #87, #88. Real fix will come when we nest activities. 2010-09-16 07:45:29 +12:00
Paul Chote
d15ab79370 Add new tileset source 2010-09-15 20:54:39 +12:00
Paul Chote
303613b052 Create valid maps for custom tilesets 2010-09-15 19:31:21 +12:00
Paul Chote
051c451867 Support custom tile size ingame 2010-09-15 19:31:21 +12:00
Paul Chote
ac8a3526a4 Custom tilesize support for editor 2010-09-15 19:31:21 +12:00
Paul Chote
be47fb55e8 Initial support for custom tile sizes 2010-09-15 19:31:21 +12:00
Paul Chote
5b8fc75d4a d2k shadows 2010-09-15 19:31:20 +12:00
Paul Chote
629e73ac29 support d2k remap range 2010-09-15 19:31:20 +12:00
Paul Chote
7e5b861caf Hacky beginnings of a standalone d2k mod 2010-09-15 19:31:20 +12:00
Chris Forbes
f3dcc14fca remove JEEP from soviet 2010-09-15 07:50:57 +12:00
Matthew
fee68d0231 Fixing permissions in deb scripts 2010-09-14 22:03:25 +12:00
Matthew Bowra-Dean
83f56d152f Updated web site for deb package 2010-09-14 21:30:55 +12:00
Matthew Bowra-Dean
a04ea789f5 Deb package building working and wired up. 2010-09-14 21:30:54 +12:00
Matthew Bowra-Dean
94becc3ddc More work on debian package 2010-09-14 21:30:53 +12:00
Matthew Bowra-Dean
8452e1bdf0 Beginning work on tying debian package together. 2010-09-14 21:30:52 +12:00
Matthew Bowra-Dean
5a513bc69d Fixing #129 and another issue with cnc packages in RPM script. 2010-09-14 21:30:52 +12:00
Paul Chote
5a173a2bd3 Fix #137 (selection cursor on non-selectable actors) 2010-09-13 17:48:05 +12:00
Chris Forbes
d29b068d59 #140 2010-09-13 07:44:11 +12:00
Chris Forbes
8dbbaca8da fix repair semantics for vehicles on FIX; fix #138 2010-09-13 07:36:53 +12:00
Paul Chote
10a1f7ec1e Fix #65; allow aircraft to receive move orders over buildings 2010-09-13 03:28:00 +12:00
Paul Chote
8286dba919 Improve semantics of selection cursor, plus free perf. 2010-09-12 19:25:05 +12:00
Paul Chote
bd735059d0 Don't leak info about resources under shroud 2010-09-12 18:51:29 +12:00
Paul Chote
147acbf096 Improve behaviour of move orders wrt shroud/fog 2010-09-12 18:48:46 +12:00
Paul Chote
91aa5302a8 Fix c4 force-firing. TODO: remove magic numbers 2010-09-12 18:20:25 +12:00
Paul Chote
2b6328f0ee Begin imposing sanity on order ordering 2010-09-12 18:10:34 +12:00
Paul Chote
1bc2136771 Nicer behaviour for edgescroll in windowed mode 2010-09-10 22:23:27 +12:00
Paul Chote
4ad0a52104 Give dog a selection voice 2010-09-10 22:10:51 +12:00
Paul Chote
b9450b0f63 Don't die when no songs are available. 2010-09-10 22:09:18 +12:00
Paul Chote
03bb74ea84 Remove unnecessary digit. 2010-09-10 21:58:07 +12:00
Paul Chote
8b4551c605 Next track / repeat on song completion. 2010-09-10 21:51:11 +12:00
Paul Chote
f645049054 shuffle music (Author: alzeih) 2010-09-10 20:59:03 +12:00
Paul Chote
aa832244fb cnc musics 2010-09-10 20:36:42 +12:00
Paul Chote
190311c68c Let the game determine song length. 2010-09-10 20:24:56 +12:00
Chris Forbes
b8ed9d7da5 (katzsmile) Added: Soviet Flak Truck with new SHP and Cameo 2010-09-10 19:46:53 +12:00
Paul Chote
ca32d51375 Enable music player 2010-09-10 19:45:22 +12:00
Matthew Bowra-Dean
b0e5bb3718 Infantry idle sequences for RA. 2010-09-10 18:52:11 +12:00
Paul Chote
96ebbfe75c fix gitignore so this isn't a problem in the future 2010-09-10 11:52:52 +12:00
Paul Chote
5c6a6ee350 Add snow.mix 2010-09-10 11:51:05 +12:00
Matthew
bbf2d68e9d Small fix to Windows installer. 2010-09-10 11:34:57 +12:00
Matthew
59cf76b4ae Retry dependency downloads in Windows installer. 2010-09-10 11:34:54 +12:00
Matthew
e97440819d Bring makefile and Windows installer in to line with pchote's mod folder structure changes. 2010-09-10 11:34:50 +12:00
Matthew
87cd37a30b Back up packages and remove mods dirs before installing. 2010-09-10 11:34:47 +12:00
Paul Chote
f406dfa277 scores.mix is optional 2010-09-10 11:27:58 +12:00
Paul Chote
24039f593c Copy the RA loadscreen for cnc 2010-09-09 23:43:29 +12:00
Paul Chote
cceb4401aa Disable unfinished default test map. 2010-09-09 23:36:30 +12:00
Paul Chote
f9445cb282 Pathfinder uses a MobileInfo instead of a specific actor 2010-09-09 23:25:58 +12:00
Paul Chote
706adb6d0b Remove cruft 2010-09-09 23:10:14 +12:00
Chris Forbes
dd7e578fe6 nearly finished laying out shellmap 2010-09-09 23:02:54 +12:00
Chris Forbes
83d1df19ba half a sensible cnc shellmap (no script yet) 2010-09-09 23:02:53 +12:00
Chris Forbes
975fa28f62 start of shellmap (dropped its actors :(); fix saving of actors from the editor 2010-09-09 23:02:52 +12:00
Paul Chote
452f7f7bff Add a local packaging script for osx 2010-09-09 20:51:10 +12:00
Paul Chote
626db661ab Remove syntax cruft and redundant comments from manifests 2010-09-09 20:48:02 +12:00
Paul Chote
9ea3a404a3 Tidy ra dir 2010-09-09 20:31:54 +12:00
Paul Chote
55c3e9d5bb Package the bits into a mix 2010-09-09 20:31:54 +12:00
Paul Chote
f616a527ee Reorganise cnc mod dir. Exposes a bug in folder/package priority. 2010-09-09 20:31:54 +12:00
Paul Chote
a594e9f830 Move the sequences files into their own dir. 2010-09-09 20:31:53 +12:00
Paul Chote
45d712d390 Fix defaultmod. 2010-09-09 20:31:53 +12:00
Paul Chote
dbbdc171d2 Use the new-format sequences. 2010-09-09 20:31:53 +12:00
Paul Chote
befe22e170 Convert sequences to yaml 2010-09-09 20:31:53 +12:00
Caleb Anderson
b284e82aa7 Added zoom to editor. Fixed crashes. Added sane tabbing to new map dialog. Added selection on tab - new map dialog 2010-09-09 20:29:42 +12:00
Matthew Bowra-Dean
ed5a3338fe Minor Windows installer fixes. 2010-09-09 20:29:40 +12:00
Bob
68dcec87c7 right-clicking a passenger with a transport loads cargo 2010-09-09 20:26:03 +12:00
Chris Forbes
39d7e54e7f fix one crash when server drops 2010-09-09 18:59:49 +12:00
Chris Forbes
404a4ad578 kill cargo when the transport dies 2010-09-09 18:52:12 +12:00
Chris Forbes
c9d0a7a301 tighten bounds on ra vehicles 2010-09-09 18:52:11 +12:00
Paul Chote
54ffdc51b4 Fix crashes with actors dying mid-projectile-flight 2010-09-09 17:20:05 +12:00
Bob
9e53774299 fix bug wrt tiberium infantry damage splashing; fix bug where Mobile+Production units didn't work right 2010-09-09 15:26:12 +12:00
Bob
f70a6aafb1 fix actor leak bug 2010-09-09 13:40:24 +12:00
Chris Forbes
c3fa9f7aa8 #120 fixed: crash in DeliverResources.Tick 2010-09-09 12:34:35 +12:00
Matthew Bowra-Dean
a73ef3affd Windows installer remembers previous install location. 2010-09-08 22:22:28 +12:00
Matthew Bowra-Dean
4e5d26a2d1 Windows installer launches browser to download .NET with user's consent. 2010-09-08 22:22:27 +12:00
Chris Forbes
4b1bc7acd4 fix bounding boxes on cnc vehicles 2010-09-08 22:19:33 +12:00
Chris Forbes
95d29c6910 fix toplevel exception handler in ralint; update cnc to use new armortypes 2010-09-08 22:11:19 +12:00
alzeih
c88ea2bd7c Fix #51 2010-09-08 21:30:32 +12:00
Paul Chote
af157867d8 merge the two INSTALL files 2010-09-08 12:24:09 +12:00
Paul Chote
9476e16df6 Update INSTALL.Ubuntu (fixes bugs 116, 117) 2010-09-08 12:19:55 +12:00
Paul Chote
9c148bf3f0 Remove unused mix files from cnc 2010-09-08 12:19:26 +12:00
Paul Chote
c8c96b9f6b Fix crash when losing fact with building ready to place 2010-09-08 03:22:05 +12:00
Paul Chote
108d7764ec Add nuke flash to cnc 2010-09-08 03:16:44 +12:00
Paul Chote
5396cad2b9 Beefier building explosions (replicates real-cnc) 2010-09-08 03:13:26 +12:00
Paul Chote
2bae3d9d2f Remove cruft from yaml; disable video player by default 2010-09-08 02:40:50 +12:00
Paul Chote
9cbaa9679d Revert to the old proc model - has 1500 local tib storage. Silos moved to defence queue. (fixes "can build on / drive through proc" bug). 2010-09-08 02:10:14 +12:00
Paul Chote
6228a962f6 Idle animations for the rest of the cnc infantry; fix a potential desync. 2010-09-08 01:55:50 +12:00
Paul Chote
1baff27553 Added snow theater for cnc mode by Jafet Kackur, aka 'Jk' and Nyerguds (katzsmile) 2010-09-08 00:49:37 +12:00
Paul Chote
4855b6bca6 Use the correct palette for sidebar icons (fixes icon glitch in cnc desert). 2010-09-08 00:34:04 +12:00
Paul Chote
ff0c66e38c Idle animations for infantry. Enabled for cnc e3. 2010-09-07 23:30:49 +12:00
alzeih
83d2ca07f1 update mirror lists 2010-09-07 21:26:15 +12:00
Chris Forbes
26152489f3 #66 fixed: attacking helipads 2010-09-07 20:57:26 +12:00
Caleb Anderson
4ca4d7b5dd GL error logging 2010-09-07 20:22:40 +12:00
Chris Forbes
0dddf12831 give gtwr and gun to both sides in cnc 2010-09-07 20:20:39 +12:00
Chris Forbes
25c098bad6 fix tesla accuracy 2010-09-07 20:17:08 +12:00
Chris Forbes
be9528dcb2 beef up hind; give it muzzle flashes 2010-09-07 20:08:45 +12:00
Chris Forbes
965385980f add muzzle flashes to yak 2010-09-07 20:01:43 +12:00
Chris Forbes
ca92cd03db slightly increase yak ammo 2010-09-07 19:23:58 +12:00
Chris Forbes
cdec95b73a fix dodgy targeting of FIX 2010-09-07 19:23:13 +12:00
Chris Forbes
76bf3077e9 give mig a sensible bounding box 2010-09-07 19:17:57 +12:00
Chris Forbes
53858a7789 give hind a sensible bounding box 2010-09-07 19:14:15 +12:00
Chris Forbes
b98e25c9a7 reduce pip counts on some units 2010-09-07 19:10:32 +12:00
Chris Forbes
be46f44bc9 polish multiple rows of pips (RA proc) 2010-09-07 19:09:18 +12:00
Chris Forbes
fee6d450e4 add ability to emit a muzzleflash from multiple weapons; make ftnk somewhat nicer 2010-09-07 19:05:14 +12:00
Chris Forbes
173dc59039 fix crash on engineer repair if the target building goes away 2010-09-07 17:37:18 +12:00
Chris Forbes
950dd4e85c fix #99 chronoshift-deploy didnt need to be charged 2010-09-07 17:33:11 +12:00
Paul Chote
6632feb696 Less perf, but avoids reinventing the wheel and searches a wider area 2010-09-07 15:58:04 +12:00
Paolo Chiodi
7b2622e67b if ordered to move to unreachable cell, find a new nearby target location 2010-09-07 15:32:28 +12:00
Chris Forbes
9e5528ef83 fix crash on shooting down aircraft which have an afld reserved. 2010-09-07 08:16:40 +12:00
Chris Forbes
3d920670e5 delay mig until afld+stek 2010-09-07 00:00:46 +12:00
Chris Forbes
4d2afd827f (for now) cut kenn, shift dog to barr 2010-09-07 00:00:45 +12:00
Matthew Bowra-Dean
9a4d0dfe5e Fix RPM package build. 2010-09-06 22:41:26 +12:00
Matthew Bowra-Dean
2a240e62aa VERSION file generation and distribution. 2010-09-06 22:20:11 +12:00
Chris Forbes
7a88adcf96 include the VERSION file in the package. 2010-09-06 21:57:14 +12:00
Paul Chote
b84d2f2c29 Allow a small amount of over-scroll so ui doesn't get in the way 2010-09-06 20:12:47 +12:00
Paolo Chiodi
2945838eef some more locking into map borders 2010-09-06 20:12:47 +12:00
Matthew Bowra-Dean
43aa8812b3 Windows installer checks for .NET v3.5 SP1 2010-09-06 20:09:27 +12:00
Matthew Bowra-Dean
9a2467dc21 .NET framework detection added to Windows install script. 2010-09-06 20:09:26 +12:00
Chris Forbes
5a75625eef don't thrash the GC quite so hard in SpatialBins 2010-09-06 18:46:47 +12:00
Chris Forbes
2f2890596d fix bug in HackyAI debug 2010-09-06 18:44:12 +12:00
Chris Forbes
01fa0b357e fix crash in prev on destroying a building (oops) 2010-09-06 18:16:32 +12:00
Chris Forbes
c5f0dad84e fix smudgelayer deepening; make biblayer work the same way (not optimal, but better) 2010-09-06 18:11:58 +12:00
Chris Forbes
7f7f4e81a5 add Give Exploration devmode option 2010-09-06 17:56:12 +12:00
Matthew Bowra-Dean
8b423908ca Added forum links. 2010-09-06 17:43:41 +12:00
Paul Chote
598fe9f956 gut perf logging - only record expensive ticks. perf.log is small enough to be useful now. 2010-09-06 15:29:34 +12:00
Paul Chote
06e8b530ea Use a dictionary for smudges 2010-09-06 14:40:22 +12:00
Matthew Bowra-Dean
d5c25f73bd Mods page. 2010-09-05 21:57:20 +12:00
Matthew
73fa306719 Bringing the docs up to date. 2010-09-05 21:52:47 +12:00
Chris Forbes
8d0cea6fe4 (RobotCaleb) fix shok death crash 2010-09-05 18:32:06 +12:00
Matthew
273b57ee69 Fixing screenshots on index page. 2010-09-05 17:36:32 +12:00
Matthew
c1578b92e1 Made mirroring script parameters more specific. 2010-09-05 16:42:30 +12:00
Matthew
c69a741c90 Expanded mirroring script to all dependencies, added new mirror (mirumu.jp) and updated download scripts. 2010-09-05 16:34:44 +12:00
Chris Forbes
f8d537c0c5 notes 2010-09-05 16:18:10 +12:00
Chris Forbes
e371159826 minor tidy-up in CrateAction 2010-09-05 16:07:35 +12:00
Chris Forbes
7d912715bc add ToString() for Pair, to make debug saner. 2010-09-05 15:20:01 +12:00
Matthew
d6449c2902 Stupid arguments ordering. 2010-09-05 00:27:28 +12:00
Matthew Bowra-Dean
8a3868abd0 Updated web pages and fixed OS X download script. 2010-09-05 00:10:07 +12:00
Matthew
112047d2b3 Changed downloading scripts to point to mirror script. Added open-ra.org to mirror list. 2010-09-04 22:42:55 +12:00
Matthew
cd9f584729 Mod package mirroring scripts. 2010-09-04 22:26:11 +12:00
Matthew
31741a1ab3 Fix rebuilding of project in packaging. 2010-09-04 20:57:34 +12:00
Matthew
eb6440694a Packaging script updated to use sub-packaging scripts in freshly checkedout copy of repo. 2010-09-04 20:57:34 +12:00
Paolo Chiodi
2c388308c7 avoid calling Viewport.Scroll on every ScreenShaker.Tick 2010-09-04 10:45:09 +02:00
Paolo Chiodi
1c8f744719 allow camera shaking to exit map borders 2010-09-04 10:45:09 +02:00
Paul Chote
dfdc893d63 Fix incorrect sequence + cnc support 2010-09-04 11:46:15 +12:00
Paolo Chiodi
669aaab6b4 change mouse sequence to blocked whene map borders are reached 2010-09-04 11:46:14 +12:00
Paolo Chiodi
73017d3f5c lock viewport scrolling into map size 2010-09-04 11:46:14 +12:00
Paolo Chiodi
38fa809656 added .DS_Store to gitignore 2010-09-04 11:46:13 +12:00
Paul Chote
0ed21a4acb Fix ra defenses 2010-09-03 21:47:25 +12:00
Paul Chote
9ae7d98193 Fix ra spawns 2010-09-03 21:47:25 +12:00
Paul Chote
07e60286f2 whoops 2010-09-03 21:47:25 +12:00
Paul Chote
7f918b8a69 fix FIX footprint 2010-09-03 21:47:24 +12:00
Paul Chote
4e0ace6ec5 Tidy production exits, cnc only 2010-09-03 21:47:24 +12:00
Paul Chote
dca5f8d27b Tidy up Mobile yaml / loading 2010-09-03 21:47:24 +12:00
alzeih
6478276064 make cnc nuke leave full area of smudge 2010-09-03 21:47:24 +12:00
alzeih
7d603f97fe cnc bib and footprint fixes (some of #83) 2010-09-03 21:47:24 +12:00
Paul Chote
112fdb32af Another dead actor crashfix 2010-09-03 17:20:30 +12:00
Paul Chote
5a78df0318 Fix flashtarget crash 2010-09-03 16:37:02 +12:00
Paul Chote
6ac4266847 Allow people to join mp games 2010-09-03 16:13:03 +12:00
Paul Chote
91487b85d0 gunboat wake 2010-08-30 22:29:47 +12:00
Paul Chote
178af8b849 cnc afld polish 2010-08-30 21:56:21 +12:00
alzeih
853ef12c8f Don't flash if already dead 2010-08-30 13:57:37 +12:00
alzeih
62cc2fa4cb unbitrot cnc wrt Projectile 2010-08-30 13:20:51 +12:00
Bob
1f4991833d use LoadAttribute in WeaponInfo 2010-08-30 12:22:13 +12:00
Bob
9fedeefdbc attribute individual fields, not the class 2010-08-30 12:22:12 +12:00
Bob
29a77f7c5c removed FieldLoader.LoadFields 2010-08-30 12:22:11 +12:00
Bob
a751b8c49d FieldLoader can run arbitrary code while loading fields 2010-08-30 12:22:11 +12:00
Bob
baacfc96bb remove unused map overrides 2010-08-30 12:22:10 +12:00
Bob
8dcd1e8fd1 line numbers work in MiniYaml.Merge, too 2010-08-30 12:22:10 +12:00
Bob
2a7857570a line numbers in yaml 2010-08-30 12:22:09 +12:00
Bob
2f92b873e8 make yaml into a list, rather than a dict 2010-08-30 12:22:09 +12:00
Chris Forbes
bce52e989f Revert "make WeaponInfo suck a bit less"
This reverts commit 7b7b9d3319.
2010-08-30 12:21:53 +12:00
Chris Forbes
a917086969 cnc: fix htnk not being able to collect crates 2010-08-28 13:56:32 +12:00
Chris Forbes
34913ab077 polish both rocket trucks 2010-08-28 13:54:03 +12:00
Paul Chote
9de22add08 Fix ra queue visibility 2010-08-28 01:29:23 +12:00
Paul Chote
b2f535d2e0 Fix ProductionQueue-on-player init 2010-08-28 00:56:15 +12:00
Paul Chote
3e7b9a7b5a Fix developer menu yaml 2010-08-28 00:55:46 +12:00
Paul Chote
29d03fb133 ra buildable/tooltip/valued fixes 2010-08-28 00:45:12 +12:00
Paul Chote
d4aeb157cc ra Category fixes 2010-08-28 00:03:51 +12:00
Paul Chote
853e60f76e Tech tree changes to support non-buildable prerequisites, capturable superweapons, "hidden tech" for tech buildings, scripted tech unlocks, "build everything" developer toggle. 2010-08-27 23:51:12 +12:00
Paul Chote
7f3e491ecc Fix AI attacking 2010-08-27 11:46:54 +12:00
Paul Chote
88dfbe657c Route "Can i build X" queries via the appropriate ProductionQueue 2010-08-27 01:18:09 +12:00
Paul Chote
226fd167e7 Category dies in a fire 2010-08-27 00:32:00 +12:00
Paul Chote
cedfeab63c PrimaryBuilding is no longer necessary in cnc; remove cruft from BuildPaletteWidget 2010-08-26 23:49:14 +12:00
Paul Chote
a882735deb Fix build tab selection 2010-08-26 23:47:03 +12:00
Paul Chote
61ebe0d0a0 Per-structure queues for cnc 2010-08-26 23:11:54 +12:00
Paul Chote
ee546750b2 Remove some duplication 2010-08-26 23:11:54 +12:00
Paul Chote
267d89a459 Remove BS from ProductionQueue. Move ProductionQueue onto a structure for queue-per-building. 2010-08-26 23:11:53 +12:00
Paul Chote
3b59afcd4f Fix ralint 2010-08-26 23:11:53 +12:00
Paul Chote
8b98448090 Restricted GDI01 tech tree 2010-08-26 23:11:53 +12:00
Paul Chote
1d7ca206f4 Clean up Buildable vs Tooltip vs Valued. cnc only. 2010-08-26 23:11:53 +12:00
Chris Forbes
7b7b9d3319 make WeaponInfo suck a bit less 2010-08-26 22:12:08 +12:00
Chris Forbes
e5d45a6961 fix spurious extra spawn in ra:Equal Opportunity 2010-08-26 21:33:07 +12:00
Chris Forbes
c7f8921cea fix crash in Missile.Tick when the target is killed while the missile is enroute 2010-08-26 21:22:23 +12:00
Chris Forbes
58ebd68478 fail to deliver ore to a proc which has just died. 2010-08-26 20:30:44 +12:00
Chris Forbes
6234f53e2c hack around the buggy AI. 2010-08-26 20:12:29 +12:00
Chris Forbes
ce0e671ac5 fix obvious failures. 2010-08-26 19:53:21 +12:00
Bob
739c38d3d8 more. doesn't run. may not compile 2010-08-26 19:33:56 +12:00
Bob
5561ac458b finished TraitDictionary. Refactored permanent actor-removal. 2010-08-26 19:33:56 +12:00
Bob
c0d0636e08 store traits differently (index on trait class rather than actor) 2010-08-26 19:32:59 +12:00
Chris Forbes
f4da83e920 start cleaning up IWorldLoadHook vs IGameStarted -- IGameStarted dies. 2010-08-25 21:53:54 +12:00
Chris Forbes
50066ec238 merge CreateMapPlayers into CreateMPPlayers 2010-08-25 21:44:54 +12:00
Paul Chote
dbd076543b Low level loadscreen displays earlier 2010-08-25 21:17:05 +12:00
Chris Forbes
2d4ed56f76 make it work, but there's some issues 2010-08-25 20:35:22 +12:00
Paul Chote
03cdcdd4aa Start cleaning up sp player init; doesn't work 2010-08-25 20:15:49 +12:00
Paul Chote
0cc440aa1f Fix ralint 2010-08-25 20:15:49 +12:00
Paul Chote
f635835b1c Refactor common fmv playing code 2010-08-25 20:15:49 +12:00
alzeih
3f08f16b9b some Nod triggers 2010-08-25 20:15:49 +12:00
alzeih
c433ca77c4 Scripted lose condition 2010-08-25 20:15:49 +12:00
alzeih
70a92b80cf Gunboat non-orderable (move)
- Give Mobile OnRails property
- Make hax Move not cancellable
2010-08-25 20:15:49 +12:00
Paul Chote
b3fbefe968 Victory conditions 2010-08-25 20:15:48 +12:00
Paul Chote
f38e4d27be Disable lane bias on gunboat and lst 2010-08-25 20:15:48 +12:00
Paul Chote
c35e3b4bd7 Fix victory conditions 2010-08-25 20:15:48 +12:00
Paul Chote
b0608936d8 Let Gunboat autotarget 2010-08-25 20:15:48 +12:00
Paul Chote
56b9d1add7 Fullscreen video 2010-08-25 20:15:48 +12:00
Paul Chote
5ce531f2d5 Begin fleshing out mission scriping 2010-08-25 20:15:48 +12:00
Paul Chote
c7e76cc26d Visible cargo for LST 2010-08-25 20:15:48 +12:00
Paul Chote
142be86934 Import infantry subcell and actor stance 2010-08-25 20:15:47 +12:00
Paul Chote
73dadbc873 Fix gunboat 2010-08-25 20:15:47 +12:00
Paul Chote
50d5936846 Scripted gdi1 mission intro 2010-08-25 20:15:47 +12:00
Paul Chote
4e86f5b252 Unbreak cnc, defaultmod 2010-08-25 20:15:46 +12:00
Paul Chote
b6b4df703a Shift loadscreen into mods 2010-08-25 20:15:46 +12:00
Paul Chote
b17e6900ec Awesome loadscreen for ra; crashfixes 2010-08-25 20:15:45 +12:00
Paul Chote
08a60ca336 Initial loadscreen impl; draws a black screen. 2010-08-25 20:15:45 +12:00
Paul Chote
d8c053253d wtf? 2010-08-25 20:15:44 +12:00
Paul Chote
e4271b35dc shader params can stay inside Renderer 2010-08-25 20:15:44 +12:00
Paul Chote
95c34c30ba Don't die after render if the world doesn't exist 2010-08-25 20:15:44 +12:00
Paul Chote
8e42dd95fc RGBASpriteRender doesn't care about palettes 2010-08-25 20:15:44 +12:00
Chris Forbes
f2dd0de1ea working game with bots; stop bots from trying to order husks around 2010-08-25 20:05:02 +12:00
Chris Forbes
701ef05562 fix one stupid crash on using bots 2010-08-25 19:36:22 +12:00
Chris Forbes
c3228cecd0 helps to get the command syntax right 2010-08-25 19:35:14 +12:00
Chris Forbes
47eacc5b80 make bot slot usage actually work 2010-08-25 19:34:20 +12:00
Chris Forbes
909152c662 move HackyAI bot from world to player context 2010-08-25 19:25:19 +12:00
Chris Forbes
0f9221dc5a mostly sensible init for real players and bots 2010-08-25 19:23:25 +12:00
Chris Forbes
cfc937e8eb add PlayerReference.DefaultStartingUnits flag (set for autogenerated playerrefs; don't set this if you have custom stuff. 2010-08-25 18:28:36 +12:00
Chris Forbes
def0580078 don't create players for playable slots which are empty 2010-08-25 18:24:23 +12:00
alzeih
3c7015567e Open/Closed toggle includes Bot now 2010-08-25 00:13:41 +12:00
alzeih
a00f0b18a0 smite some compile errors 2010-08-24 23:44:22 +12:00
alzeih
703f3b8c13 right beep in ra 2010-08-24 23:30:41 +12:00
mgatland
bf9bcfed68 bot builds units and sends them out. Crude + fragile... 2010-08-24 23:19:33 +12:00
alzeih
f6dac1fe83 Fix rebase 2010-08-24 22:56:31 +12:00
mgatland
731c64c1a7 add a bot player, make ai apply to the bot not the local player 2010-08-24 22:56:31 +12:00
Chris Forbes
19494c3262 much better ai bases 2010-08-24 22:52:41 +12:00
Chris Forbes
cf9a2ee0ef tune base fractions a bit 2010-08-24 22:52:41 +12:00
Chris Forbes
93e8bd6644 build a base successfully. 2010-08-24 22:52:40 +12:00
Chris Forbes
4d0f75353b spam powr 2010-08-24 22:52:40 +12:00
Chris Forbes
fb035756a0 better handling of 'needing power' 2010-08-24 22:52:40 +12:00
Chris Forbes
e0a00940af initial buildqueue ai 2010-08-24 22:52:40 +12:00
Chris Forbes
e74c3eeb2e hook in an ai stub. all it does for now is deploy the mcv. 2010-08-24 22:52:40 +12:00
Chris Forbes
05bf6d83f2 clean up one silly use of world.players 2010-08-24 20:02:20 +12:00
Chris Forbes
e4b65256de remove a bit of duplication from UnitOrders 2010-08-24 20:02:19 +12:00
Chris Forbes
d744cfe21b change exploit order check to cope with PlayerId not matching ClientId, because it doesnt. 2010-08-24 20:02:19 +12:00
Chris Forbes
6ae7da77ae fix wtf in PlayerResources 2010-08-24 20:02:18 +12:00
Chris Forbes
0352884205 blah 2010-08-24 20:02:18 +12:00
Chris Forbes
7c6edab04e work for ra too 2010-08-24 20:02:17 +12:00
Chris Forbes
997501bb12 ui for opening and closing slots 2010-08-24 20:02:17 +12:00
Chris Forbes
d4f43a399e add slot open/close server commands with boot on close 2010-08-24 20:02:16 +12:00
Chris Forbes
f6ec2163de fix some dumb issues 2010-08-24 20:02:16 +12:00
Chris Forbes
3428b3c4c2 add slot command 2010-08-24 20:02:15 +12:00
Chris Forbes
8ec16fdbbe fail fail fail 2010-08-24 20:02:15 +12:00
Chris Forbes
39f699916c start hacking up lobby to work with slots (cnc only) 2010-08-24 20:02:14 +12:00
Chris Forbes
4a337185f5 if there are no Playable playerrefs in the map, make as many as there are spawnpoints (hack) 2010-08-24 20:02:14 +12:00
Chris Forbes
298f5ec24f some notes 2010-08-24 20:02:13 +12:00
Chris Forbes
16402f26fe start breaking things 2010-08-24 20:02:13 +12:00
Paul Chote
825743b225 Fix packaged startup on windows and osx. 2010-08-24 19:53:05 +12:00
Paul Chote
c3b3947b9d Rename some settings 2010-08-24 19:53:05 +12:00
Paul Chote
1143f496db Part 2 of 3: Split Settings into logical units.
Syntax for command line overrides is now <section>.<setting>=<value>
eg `General.InitialMods=cnc'
2010-08-24 19:53:05 +12:00
Paul Chote
46d0ce89e9 Fix silly naming conventions 2010-08-24 19:53:05 +12:00
Chris Forbes
79ced35010 make InfiltrateForSonarPulse work for any support power 2010-08-24 17:37:06 +12:00
Chris Forbes
18a06eb3bf wtf 2010-08-23 20:58:56 +12:00
Chris Forbes
d8c5f1aed3 extract serialize code from Server; deserialize code from Game; add Slot collection. 2010-08-23 19:08:09 +12:00
Chris Forbes
3880326787 ship out ChooseInitialStance from Game 2010-08-23 18:34:47 +12:00
Chris Forbes
09d9396123 move Session back to Game 2010-08-23 18:31:43 +12:00
Chris Forbes
aeccf53e97 squash some spurious warnings 2010-08-23 18:23:55 +12:00
Chris Forbes
b1b8b2c14a remove N params from ServerMain 2010-08-23 18:19:36 +12:00
Chris Forbes
fd9a31168d server loads the map (part 1) 2010-08-23 18:09:37 +12:00
Chris Forbes
3f11c32c4a blah 2010-08-23 17:58:25 +12:00
Chris Forbes
d65626e87c move Manifest into its own file 2010-08-23 17:51:08 +12:00
Chris Forbes
ccb77dee12 rename ChoosePaletteOnSelect 2010-08-23 17:47:46 +12:00
Paul Chote
952da4efec Fix wrong-palette in first tick 2010-08-21 20:39:15 +12:00
Paul Chote
49f2bfb460 Only reload sprites on theatre change; kill cruft 2010-08-21 20:34:59 +12:00
Paul Chote
9db92ed8ba Shift the nasty bits of map loading into ModData 2010-08-21 20:23:14 +12:00
Paul Chote
4e2d76f6ed Move AvailableMaps into ModData 2010-08-21 20:11:05 +12:00
Bob
94dd73cb48 fixed world to run ALL of the frameEndActions 2010-08-21 19:24:17 +12:00
Bob
aeb9f4e441 moved call to FindMaps into ChangeMods 2010-08-21 19:20:06 +12:00
Bob
1a4e3053ce inlined InitializeEngineWithMods; cleaned trailing whitespace in Game; removed non-working Replay code 2010-08-21 19:16:43 +12:00
Bob
18914447aa fixed Renderer init (separated device creation from shader load) 2010-08-21 18:59:05 +12:00
Bob
7e67a5bb2d move calls to manifest ctor into ModData 2010-08-21 18:26:16 +12:00
Bob
9eaa0e5765 extract SyncReport class from Game 2010-08-21 17:59:17 +12:00
Bob
0e16aa339d move SheetBuilder singleton onto ModData 2010-08-21 17:44:06 +12:00
Bob
c7b650d6ec de-static'd CursorSheetBuilder 2010-08-21 17:36:58 +12:00
Bob
bcc3cd32ae merge call of FileSystem.LoadFromManifest into modData ctor 2010-08-21 17:28:51 +12:00
Bob
38ffd30b28 removing duplication wrt mounting FS packages 2010-08-21 17:27:54 +12:00
Bob
15bd58ddce extracting world-specific data from Game 2010-08-21 17:11:26 +12:00
Bob
7247bd1078 changed UIM to use less memory 2010-08-21 15:10:54 +12:00
Chris Forbes
ac31767aef some random housekeeping (ScreenShaker) 2010-08-21 15:10:53 +12:00
Bob
3f68330c70 pruning refs to Game.world 2010-08-20 17:46:58 +12:00
Bob
0e71af25f4 remove Game.skipMakeAnims 2010-08-20 17:14:20 +12:00
Chris Forbes
e610c4d7fc ffs, fix beedee's upload script so it uploads. 2010-08-19 21:07:31 +12:00
Chris Forbes
0a041fe425 use byte[] backing for Sheet. bitmap backing is still available for Chrome RGBA hack. 2010-08-19 19:22:03 +12:00
Chris Forbes
1595c6a0ed interim hack to support use of raw data in Sheet 2010-08-19 18:42:45 +12:00
Chris Forbes
db7a11e8a6 some random bits 2010-08-19 18:33:52 +12:00
Chris Forbes
53df4c4bfb remove batch fail 2010-08-19 18:10:38 +12:00
Paul Chote
1afcd2b98a Move rules and SSB init out of world 2010-08-19 00:09:48 +12:00
Paul Chote
08ffe1d44d Reload chrome images only on mod change 2010-08-18 23:57:18 +12:00
Paul Chote
66359b7058 Speed up FileSystem 2010-08-18 23:40:05 +12:00
Paul Chote
30ab5c33ea Fast checking for file existance 2010-08-18 22:56:16 +12:00
Paul Chote
0c5fb4c6b0 Kill LoadShellMap 2010-08-18 22:41:00 +12:00
Paul Chote
21b0b12948 Fix MP gamestart 2010-08-18 22:21:08 +12:00
Paul Chote
cb3f6435ad Kill broken log uploading 2010-08-18 20:45:30 +12:00
Paul Chote
235ae1fad7 osx packaging fixes: Runs when name contains spaces, fixes "Cannot connect to master server". 2010-08-18 20:35:55 +12:00
Chris Forbes
1c6470eff3 add movement-free autotarget option 2010-08-18 17:47:38 +12:00
Paul Chote
0cf51d8142 Skip movies with `esc' 2010-08-17 22:59:41 +12:00
Paul Chote
38e5f70cbe Ingame briefing support 2010-08-17 22:59:41 +12:00
Paul Chote
56b0da0b13 Singleplayer campaign support: player/world init 2010-08-17 22:59:41 +12:00
Paul Chote
d6f0a03270 Ignore orders sent to other players' actors (fixes an entire class of exploits). 2010-08-17 22:59:41 +12:00
Chris Forbes
b1b75ecf2f fix wtf in spy 2010-08-17 21:42:25 +12:00
Caleb Anderson
228852a55d Inverse Drag Scrolling 2010-08-17 21:02:51 +12:00
Chris Forbes
f6a880e524 line way too long. 2010-08-17 20:32:10 +12:00
Chris Forbes
7e82dc729b fix mouse/tree and mouse/crate interactions. 2010-08-17 19:58:51 +12:00
Matthew
d91a7c6b35 Increasing robustness of packaging script. 2010-08-16 01:03:14 +12:00
Chris Forbes
b4068f0ac7 msam polish -- contains some dirty hacks 2010-08-15 21:11:38 +12:00
Chris Forbes
b336a1e478 make cnc fact significantly harder to kill 2010-08-15 20:53:36 +12:00
Chris Forbes
55afcddce0 fix alignment on gdi rocket truck 2010-08-15 20:50:21 +12:00
Chris Forbes
ac7bb3c71b use activity cursor rather than deploy for disguise 2010-08-15 20:36:29 +12:00
Chris Forbes
3aa7ff5a6b fix various bugs in prev 2 2010-08-15 20:29:09 +12:00
Chris Forbes
0b3414c46f disguise on self to lose it. 2010-08-15 20:22:59 +12:00
Chris Forbes
fdcad8710b first cut at disguise 2010-08-15 20:21:27 +12:00
Paul Chote
02a7b092dc Use map-defined stances 2010-08-15 20:15:45 +12:00
Paul Chote
d43781c604 Import legacy players 2010-08-15 20:15:45 +12:00
Chris Forbes
cfbededcc4 a quick hack to set the 32bit flag in corheader 2010-08-15 18:26:58 +12:00
Paul Chote
9ba50a9c5e Set turret facings correctly 2010-08-15 18:03:13 +12:00
Paul Chote
6377269a14 BOAT and LST work ingame (need special render hax, but don't crash) 2010-08-15 18:00:27 +12:00
Paul Chote
a8be81ea2b Import actor facing and health from legacy maps 2010-08-15 17:47:04 +12:00
Paul Chote
50950cba22 Scripted map format docs 2010-08-15 17:23:19 +12:00
Paul Chote
210e847904 cnc BOAT template 2010-08-15 16:59:14 +12:00
Paul Chote
54f7b6430d Fix map importer 2010-08-15 16:58:46 +12:00
Paul Chote
26e823fc25 EVW2 basically playable. Needs tweaking (too much tib?) and tech structures. 2010-08-15 16:14:14 +12:00
Paul Chote
10ea035b42 Fix #41 2010-08-15 15:34:27 +12:00
Paul Chote
58fb7178ad cnc Balance tweaks 2010-08-15 07:14:10 +12:00
alzeih
cd358eb985 Fix #24 2010-08-15 06:32:12 +12:00
Paul Chote
39d4b80323 Tweak sub stats 2010-08-15 06:18:47 +12:00
Paul Chote
45a4935b01 Cannot cloak if critical health 2010-08-15 06:18:47 +12:00
Paul Chote
824e2a7b0b Auto-target detected subs 2010-08-15 06:18:47 +12:00
Paul Chote
230d59f655 Tweak visibility; hopefully allows targeting of detected units 2010-08-15 06:18:46 +12:00
Paul Chote
7f191887ec Revamp cloak model 2010-08-15 06:18:46 +12:00
Paul Chote
499613f105 Depthcharges only work against subs 2010-08-15 06:18:46 +12:00
Paul Chote
20af2b5c0a Heli's don't land when idle 2010-08-15 06:18:46 +12:00
alzeih
cbc9d66bee SYRD + SPEN have rally points 2010-08-15 05:39:45 +12:00
alzeih
c338612b9f Fully laden harv's are too slow now 2010-08-15 04:38:53 +12:00
Paul Chote
edd0a7c614 Marooned tweaks 2010-08-15 03:16:26 +12:00
Paul Chote
1d259e4bc7 Nowhere to hide tweaks 2010-08-15 03:13:47 +12:00
Paul Chote
6c651e9d02 Halve fact/mcv value 2010-08-15 03:03:05 +12:00
Paul Chote
a29e0bf4b1 Lower proc cost 2010-08-15 03:03:05 +12:00
Paul Chote
9d403d3072 Unfail `Marooned' map slightly 2010-08-15 03:03:04 +12:00
Paul Chote
184d044f26 Run packaged version with --debug on osx 2010-08-15 03:03:04 +12:00
Chris Forbes
0473aed2c3 fix crash when civilians die 2010-08-15 02:45:20 +12:00
Matthew
db5920e83a Minor fixes to packaging. 2010-08-15 02:08:49 +12:00
Matthew
80555235d7 Fixes for Windows packaging. 2010-08-15 02:08:49 +12:00
Matthew
acd842f178 Windows support added to general packager. 2010-08-15 02:08:49 +12:00
Matthew
a5dacd52e8 OSX support added to general packager. 2010-08-15 02:08:49 +12:00
Matthew
6e045e864a Further RPM fixes 2010-08-15 02:08:49 +12:00
Matthew
0541b04c3a RPM packaging fixes. 2010-08-15 02:08:49 +12:00
Matthew
07b2bcbfdf RPM support in general packaging script. 2010-08-15 02:08:49 +12:00
Matthew
0e2b4bb721 General package script works for Arch-Linux packages. 2010-08-15 02:08:49 +12:00
Paul Chote
ab3c06cd04 Fail 2010-08-15 01:59:23 +12:00
Chris Forbes
299ee7f82c remove redundant devmode checkbox in settings -- 'enable cheats' does it 2010-08-15 01:44:38 +12:00
Paul Chote
ddd56e6f9b Reveal-map crate 2010-08-15 01:43:24 +12:00
Paul Chote
839043ea1b Disable music player until its finished 2010-08-15 01:13:49 +12:00
Paul Chote
1e8aea616b Hook up music seek 2010-08-15 01:07:05 +12:00
Paul Chote
727a88d82a Listbox content shouldn't steal clicks if they're clipped 2010-08-15 00:44:19 +12:00
alzeih
1f54ad3238 Oops 2010-08-15 00:38:31 +12:00
Paul Chote
694fd84188 Clean up custom color palette 2010-08-15 00:18:06 +12:00
alzeih
271be551b0 Add Voices and DisableVariants to VoiceInfo, remove the ".aud" for die sounds. 2010-08-15 00:07:27 +12:00
alzeih
fe481d7445 Fix #36
- add to ra
- add default variant
2010-08-15 00:07:27 +12:00
alzeih
7a10ae3dea Some of fixing #36 2010-08-15 00:07:27 +12:00
Chris Forbes
8c39e372e3 throttle mouse motion events to one per frame 2010-08-14 23:48:12 +12:00
Paul Chote
af6660d6ca Fix palette remaps 2010-08-14 23:36:41 +12:00
Paul Chote
d0da9d11bf Fix palettes and all palettemods. Remap palettes broken. 2010-08-14 23:29:01 +12:00
Paul Chote
0a2d39f15b More correct, still doesn't work. 2010-08-14 22:23:22 +12:00
Paul Chote
8118a17e3c foo 2010-08-14 21:53:24 +12:00
Paul Chote
0f6564f31a more or less fail 2010-08-14 21:36:13 +12:00
Paul Chote
dda6556e17 non-working palette fail 2010-08-14 21:07:19 +12:00
Paul Chote
5c1408d4d7 cnc water palette rotation 2010-08-14 17:52:59 +12:00
Chris Forbes
aa6e671d89 cnc tran unloadfacing=initialfacing 2010-08-14 17:44:36 +12:00
alzeih
e0de1427e9 Die sanely when a widget doesn't exist. 2010-08-14 17:39:50 +12:00
alzeih
db16ab4cdc Add VideoVolume 2010-08-14 17:39:50 +12:00
Bob
ae703d50b2 Actor.traits is implementation detail 2010-08-14 17:39:49 +12:00
Paul Chote
f6c6255f64 Custom tiberium pathing cost 2010-08-14 17:37:36 +12:00
Paul Chote
a569c712f0 Video pausing support; sync video to audio nicer. 2010-08-14 17:21:54 +12:00
Paul Chote
5c8c8d5e6e Support more video types. 2010-08-14 15:59:40 +12:00
alzeih
3f4f1ff75e MusicSeekPosition 2010-08-14 14:24:25 +12:00
Paul Chote
1aa4f57a68 Prototype new music player 2010-08-14 14:05:32 +12:00
Paul Chote
3f3ac377b2 Backend changes for new music player 2010-08-13 19:46:13 +12:00
Paul Chote
de12233edc cnc movie list 2010-08-13 00:30:46 +12:00
Paul Chote
b36b101392 Soviet movie definitions 2010-08-12 21:07:38 +12:00
Chris Forbes
726449b6fb fix it so it works when have no movies 2010-08-12 20:47:38 +12:00
Paul Chote
a0d7435550 Overlay with black lines for authentic ra feel 2010-08-12 20:47:38 +12:00
Paul Chote
11aed465a8 Populate the list from yaml; Define ra-allies movies; Additional polish. 2010-08-12 20:47:37 +12:00
Paul Chote
0f953226a6 Populate and use the listbox 2010-08-12 20:47:37 +12:00
Chris Forbes
ad181544cd give cnc towers significantly more hp 2010-08-12 20:44:03 +12:00
Chris Forbes
df19163ce5 fix #18 -- harvs built at weap choose a proc when trying to return now 2010-08-12 19:54:37 +12:00
Chris Forbes
4328fbc350 fix color picker again 2010-08-12 19:35:36 +12:00
Chris Forbes
7cd9afb6d2 remove some sillyness from the masterserver -- it shouldnt hold up the works. 2010-08-12 19:27:11 +12:00
Chris Forbes
1ad8b58f1b blah 2010-08-12 18:34:48 +12:00
Matthew
62e3d548c8 Makefile generated start-up script altered to allow command line switches to be passed to executable. 2010-08-12 18:11:06 +12:00
Matthew
ea7abcb585 Makefile install target fix. 2010-08-12 18:11:06 +12:00
Chris Forbes
441bffecfc fix #262 -- harv should move slower when full 2010-08-12 18:10:23 +12:00
Paul Chote
2c1ab33893 Add a "Video Player" menu with basic impl; kill the music player widget. 2010-08-12 18:06:12 +12:00
Paul Chote
74500c369c Stop video soundtrack when video stops 2010-08-12 00:44:53 +12:00
Paul Chote
6e0158039a Support uncompressed audio (ally1.vqa) 2010-08-12 00:37:19 +12:00
Paul Chote
c600239c54 Begin making video player widget useful; steal (othewise useless) musicplayer controls for now 2010-08-12 00:31:30 +12:00
Paul Chote
93a48c0cf1 Tweaks 2010-08-12 00:06:08 +12:00
Paul Chote
b88512df43 Keep video in sync with audio 2010-08-11 23:58:30 +12:00
Chris Forbes
ca6debde66 buffer up all the audio upfront 2010-08-11 22:56:32 +12:00
Chris Forbes
8dd9848636 preserve aud codec state across blocks, so the gain isnt completely bogus 2010-08-11 22:19:49 +12:00
Chris Forbes
ec9da154ad add crap broken sound support for vqa 2010-08-11 22:04:55 +12:00
Chris Forbes
46fc0ef563 add ignore for vqas; disable the vqaplayer in the mainmenu for now 2010-08-11 21:44:42 +12:00
Paul Chote
514c92a998 FAST vqa render 2010-08-11 19:54:24 +12:00
Paul Chote
96f9f33776 Tweaks 2010-08-11 19:04:03 +12:00
Paul Chote
20553a112d Don't hide the original crash if the master server is inaccessible 2010-08-11 18:20:50 +12:00
Paul Chote
9e49cad1c2 .vqp format doc 2010-08-11 14:56:16 +12:00
Paul Chote
5c6e2a5e42 Fix crash when cnc videos loop 2010-08-11 11:53:01 +12:00
Paul Chote
44d7aa14a4 Hacky ingame video widget 2010-08-11 11:45:37 +12:00
Paul Chote
bf8e3645cb cnc support (doesn't use format80) 2010-08-11 01:34:05 +12:00
Paul Chote
6ea8d4e6d3 Test a different video; fix a stupid crash. All works except for sound. 2010-08-11 00:57:49 +12:00
Paul Chote
16c3223f3e Fix 8-frame glitch 2010-08-11 00:57:49 +12:00
Paul Chote
b98e180361 Dump the animation to a set of bitmaps; glitches every 8 frames. 2010-08-11 00:57:49 +12:00
Paul Chote
80aade857e Start removing fail 2010-08-11 00:57:49 +12:00
Paul Chote
58700e4c07 Save the hax pixels too 2010-08-11 00:57:49 +12:00
Paul Chote
d364472862 Write the pixels that don't need further hax to a bitmap 2010-08-11 00:57:49 +12:00
Paul Chote
5d688a2e27 CBFZ, CBPZ, CPL0 chunks 2010-08-11 00:57:49 +12:00
Paul Chote
f4fa053a35 Add a null parser for VQFR chunk 2010-08-11 00:57:49 +12:00
Paul Chote
90373529b0 Parse FINF and (skip) SND2 2010-08-11 00:57:49 +12:00
Paul Chote
0416b6b429 Format docs 2010-08-11 00:57:48 +12:00
Paul Chote
bd991e33ca Begin vqa support; load and display FORM header 2010-08-11 00:57:48 +12:00
Chris Forbes
f162c5956e cleanup wtf 2010-08-10 21:51:06 +12:00
Chris Forbes
e6f717ff04 FAST 2010-08-10 21:26:50 +12:00
Chris Forbes
eb0c895e2c fix prev 2010-08-10 21:26:44 +12:00
Chris Forbes
3af0d2f6a4 noise reduction 2010-08-09 17:29:50 +12:00
Chris Forbes
8f6fe8344b split PrimaryBuilding from Production 2010-08-09 17:20:34 +12:00
Paul Chote
cb5307bb17 nerf e1 (stole ra damage stats) 2010-08-08 21:47:31 +12:00
Paul Chote
d9acf1a3e5 Don't teleport into transport's. 2010-08-08 19:30:49 +12:00
Paul Chote
6fc945ac91 Fix cargo/passenger interaction 2010-08-08 19:16:37 +12:00
Paul Chote
e5878e8207 Fix Color Picker 2010-08-08 18:45:05 +12:00
Paul Chote
b982a52086 stop .net clients taking out the server on drop 2010-08-08 18:26:55 +12:00
Matthew
f28ec846e7 WindowsBase.dll added to thirdparty DLLs to work around distributions with outdated versions of Mono. 2010-08-07 16:11:18 +12:00
Chris Forbes
551814fc32 fix crash when a bridge is destroyed, and has a husk on it. 2010-08-06 21:02:46 +12:00
Chris Forbes
f64a6e273e fix sub -> ground crash 2010-08-06 20:11:49 +12:00
Matthew
1a428186e9 Minor fix to arch-linux post install script. 2010-08-06 14:15:53 +12:00
Matthew
609abb7719 Fixes to include extra mod dirs in Makefile and correct paths in post install scripts. 2010-08-06 14:03:37 +12:00
Matthew
aee0728a73 SupportDir path fixed. 2010-08-06 12:37:21 +12:00
Matthew
120a5fa66b Packaging and Makefile fixes. 2010-08-06 12:28:09 +12:00
Chris Forbes
71792a8f09 fix crash on telling {sam,agun} to attack ground 2010-08-04 18:23:06 +12:00
Chris Forbes
0f20133af0 fix crash in retry 2010-08-03 20:40:27 +12:00
Paul Chote
40b16e33ba Fix and polish all ra production structures; remove some obsoleted Production subclasses 2010-08-03 18:29:32 +12:00
Paul Chote
8e82f6fa1a Fix a retarded crash with husks; remove some debug 2010-08-03 01:16:24 +12:00
Paul Chote
053f0f5c7f Refactoring + cnc weap 2010-08-03 01:03:31 +12:00
Paul Chote
7c562059c2 Fix cnc afld 2010-08-03 00:17:11 +12:00
Paul Chote
cf5cb80c61 Restore cnc helicopters (reservable etc changes deferred) 2010-08-02 23:57:19 +12:00
Paul Chote
711378d352 Polish cnc pyle & hand inf production; lays groundwork for future polish. Likely breaks every other production structure (untested). 2010-08-02 23:35:35 +12:00
Paul Chote
7d044a9e1b Remove custom cnc behavior 2010-08-02 20:43:56 +12:00
Paul Chote
bc93e8cac0 Health as an ActorInit 2010-08-02 20:12:04 +12:00
alzeih
578d42614b Convert all CreateActor calls to use TypeDictionary 2010-08-02 01:51:13 +12:00
alzeih
4ea66ea309 Added FacingInit and AltitudeInit. Used in Mobile/Aircraft/Husks. Refactored Production, SpyPlane, Paratroopers and LeavesHusk 2010-08-02 00:49:26 +12:00
alzeih
2cc6e197fa fix makefile 2010-08-02 00:36:18 +12:00
Chris Forbes
2ea0907d66 convert ra maps to format3 2010-08-01 23:46:16 +12:00
Chris Forbes
d50d26350e upgrade caffeinated as a test. 2010-08-01 21:02:12 +12:00
Chris Forbes
b77bddddbc fix maploader to be backwards compatible. InitDict-based format is now 3. Formats 1,2 are translated on load, and will be saved back as Format 3 if saved in the editor. 2010-08-01 21:00:17 +12:00
Chris Forbes
3521319095 editor compiles again 2010-08-01 20:40:23 +12:00
Bob
dfc24233f7 fix broken rebase 2010-08-01 19:38:44 +12:00
Bob
970eb4d6e1 use the new actorinit stuff when loading map yaml 2010-08-01 19:38:42 +12:00
Bob
10b7ece62e new mapactor init stuff 2010-08-01 19:38:39 +12:00
Bob
f789aef892 map format change: move mapactor Type onto header line 2010-08-01 19:38:37 +12:00
Bob
bceaecf031 change map format to remove redundant crap 2010-08-01 19:38:35 +12:00
Bob
74155812d0 don't merge yaml in chrome; just load sequentially 2010-08-01 19:38:32 +12:00
Bob
f49ec8d6b9 don't mention rootwidget in chrome yaml 2010-08-01 19:38:30 +12:00
Chris Forbes
fd5d441086 fix all the broken maps 2010-08-01 18:46:46 +12:00
Chris Forbes
eb85189c24 transparently upgrade maps produced by buggy converter 2010-08-01 18:42:48 +12:00
Chris Forbes
9bd808fcb8 generate a neutral player 2010-08-01 18:38:38 +12:00
Chris Forbes
968387eab2 converted all the cnc maps 2010-08-01 18:28:45 +12:00
Chris Forbes
f8f1e2a531 add warning on window close with modified map 2010-08-01 18:12:03 +12:00
Chris Forbes
8707bbd569 remove standalone MapConverter 2010-08-01 18:03:03 +12:00
Chris Forbes
724df5ad54 add central-conflict and marooned-ii via new importer 2010-08-01 18:02:02 +12:00
Chris Forbes
0f33913bf6 force x86 on MapConverter project 2010-08-01 17:15:51 +12:00
Chris Forbes
d856eb5905 move bits around in MapConverter 2010-08-01 17:10:05 +12:00
Chris Forbes
ab9e7ce672 replace editor toolbar with menus 2010-08-01 16:59:19 +12:00
Chris Forbes
741e43ab14 disable vshost for editor; move tabs back to top edge 2010-08-01 16:19:35 +12:00
Chris Forbes
4b0f66496c blah 2010-08-01 16:11:47 +12:00
Chris Forbes
260fe70e5f remove 'Middle of Hell' map, it's garbage 2010-08-01 16:07:55 +12:00
Chris Forbes
ae3d7bbe24 disable vshost 2010-08-01 16:02:32 +12:00
Chris Forbes
990eeb844a ChooseAirfield chooses closest, rather than first. 2010-08-01 15:49:52 +12:00
Chris Forbes
4567bad251 make Activities.Land work with Targets. 2010-08-01 14:57:07 +12:00
Chris Forbes
aafbeed703 ffs, doing it the hard way as usual 2010-08-01 14:36:53 +12:00
Chris Forbes
002bc20d50 some improvement to alfd/plane interaction 2010-08-01 14:32:59 +12:00
Chris Forbes
19c5c56ab2 ra.ss, ra.msub, cnc.stnk all spawn cloaked/submerged 2010-08-01 14:07:15 +12:00
Chris Forbes
718b0e7613 fix mslo nuke offset 2010-08-01 13:03:53 +12:00
Chris Forbes
5b5378ae6c make tmpl capturable 2010-08-01 12:54:39 +12:00
Chris Forbes
67418e0b9d fix capturing of neutral buildings 2010-08-01 12:23:45 +12:00
Chris Forbes
ca986688a1 fix primary building & building fallback when busy 2010-08-01 12:11:48 +12:00
Chris Forbes
97e43cfe40 add ReservableProduction, to start fixing afld behavior. 2010-08-01 11:57:33 +12:00
Chris Forbes
a0ca52491e add some debug to Reservable so we can see what retardage is happening 2010-08-01 11:49:55 +12:00
Chris Forbes
039a42cfef fix spyplane (it doesnt want Mobile) 2010-08-01 11:49:23 +12:00
Chris Forbes
e2ab99c0cc remove dead crap from Plane 2010-08-01 11:49:00 +12:00
Chris Forbes
5daaa99108 start cleaning up reservations 2010-08-01 11:35:26 +12:00
Chris Forbes
13244d17f1 format and clean up DrawLineToTarget 2010-08-01 11:32:09 +12:00
Chris Forbes
e8604d172c add levelup crates to cnc 2010-08-01 11:17:27 +12:00
Chris Forbes
9e0f0d2074 fix cloaking crate 2010-08-01 10:40:26 +12:00
Chris Forbes
3dae071f41 drop aftermath support from the installer 2010-08-01 09:59:53 +12:00
Paul Chote
d5dbd1b7da Fix Monodevelop build 2010-08-01 01:48:12 +12:00
Chris Forbes
b1736e5efd fix VS build 2010-08-01 01:40:37 +12:00
Paul Chote
bd979f65b8 Kill Unit trait; Radar signature tweaks 2010-08-01 01:26:59 +12:00
Paul Chote
d416f0be5c Shift "XXX Lost" notification onto a trait. Hook up "Structure Lost" (cnc) and "Airborne Unit Lost" (ra). 2010-08-01 01:01:31 +12:00
Paul Chote
45e54e1ca8 Kill some spurious references to Unit 2010-08-01 01:01:31 +12:00
Paul Chote
d29e3f3f0e Split facing into its own interface; fix husks 2010-08-01 01:01:31 +12:00
Paul Chote
207ee49da3 Move Facing and Altitude onto IMove impls, with associated pile of cleanups 2010-08-01 01:01:31 +12:00
Paul Chote
88cb942430 Cleaner access to InitialFacing and ROT 2010-08-01 01:01:31 +12:00
Chris Forbes
765bedb592 add cloak crate action to cnc 2010-08-01 00:21:20 +12:00
Chris Forbes
2c73d8a48d remove some dead files 2010-07-31 23:37:56 +12:00
Chris Forbes
750275d08f reduce crap a little more 2010-07-31 23:24:32 +12:00
Chris Forbes
491d38cafe move Weapon & friends into own file 2010-07-31 23:21:22 +12:00
Chris Forbes
6c6da12dd6 fix local offset -> screen space transform to work as advertised 2010-07-31 23:01:56 +12:00
Chris Forbes
0b20d1366a eliminate old form of GetTurretPosition 2010-07-31 22:33:54 +12:00
Chris Forbes
fa245aaa08 introduce collection of Turrets on AttackBase, too -- turret sharing w/ recoil works again 2010-07-31 22:19:29 +12:00
Chris Forbes
9a218f7b52 GetPrimaryWeapon() dies too. 2010-07-31 21:34:24 +12:00
Chris Forbes
d202e27f79 more tesla hax? 2010-07-31 21:34:24 +12:00
Chris Forbes
960dddc048 AttackTesla hax 2010-07-31 21:34:23 +12:00
Chris Forbes
9fcc739cd5 more... Combat.GetSecondaryWeapon() dies, etc 2010-07-31 21:34:23 +12:00
Chris Forbes
449cc4a42d remove old buff crates 2010-07-31 21:34:22 +12:00
Chris Forbes
b8421ba655 move more combat bits around 2010-07-31 21:34:22 +12:00
Chris Forbes
2ac261c15b remove other param spam from CheckFire 2010-07-31 21:34:22 +12:00
Chris Forbes
2bd9cd32f6 remove WeaponInfo param from CheckFire 2010-07-31 21:34:21 +12:00
Chris Forbes
693c8d96b1 introduce a Barrel object, unhacking the local offsets. 2010-07-31 21:34:21 +12:00
Chris Forbes
42683f5966 start refactoring AttackBase 2010-07-31 21:34:20 +12:00
Chris Forbes
2478b26a05 GetOrDefault can die. 2010-07-31 12:41:11 +12:00
Chris Forbes
2608ab3bf6 fix crash on building ttnk 2010-07-31 12:23:09 +12:00
Chris Forbes
9fc8b81362 disable speed/armor/firepower crates in favour of levelup crate 2010-07-31 12:23:09 +12:00
Chris Forbes
5093d531bc tweak unit crate shares 2010-07-31 12:23:08 +12:00
Chris Forbes
08d75cb55c add GiveMcvCrateAction, and wire unit crates / mcv crates / etc 2010-07-31 12:23:08 +12:00
Chris Forbes
4c24547c26 add GiveUnitCrateAction 2010-07-31 12:23:07 +12:00
Bob
53b9b63ae5 change Mobile, Move to use Mobile.toCell instead of Actor.Location 2010-07-31 12:23:07 +12:00
Chris Forbes
cd40b27357 fix bitrot in cnc and ra 2010-07-31 12:23:06 +12:00
Chris Forbes
3c10d14f60 add shok 2010-07-31 09:27:13 +12:00
Chris Forbes
035bc96b37 various bits 2010-07-31 09:27:09 +12:00
Chris Forbes
357e74573c fix .gitignore, which banned .aud by default for some reason 2010-07-31 09:25:41 +12:00
Chris Forbes
668c5c7bdd add missing sounds 2010-07-31 09:25:41 +12:00
Chris Forbes
7a0d898b1a integrate ttnk into ra; also art for shok; all am pieces are now in ra/extras 2010-07-31 09:25:40 +12:00
alzeih
33b6f590e9 move ROT, InitialFacing and Speed to Mobile and Aircraft. 2010-07-31 02:06:30 +12:00
Paul Chote
dd7008d7ee Make crates collectable; make cnc walls targetable. 2010-07-31 01:50:14 +12:00
Paul Chote
9b051a6624 Remove some bs from buildings with multiple damage states; cnc civilian structure rubble persists after death. 2010-07-31 01:50:09 +12:00
Paul Chote
62c2c3a1c6 Fix damage transition sounds 2010-07-30 22:24:43 +12:00
Paul Chote
8528c5d3a3 Correct the ordering on DamageState 2010-07-30 22:24:43 +12:00
Paul Chote
4cf0610fd9 Change DamageState names 2010-07-30 22:24:43 +12:00
Paul Chote
1459ec483c Rename ExtendedDamageState -> DamageState 2010-07-30 22:24:43 +12:00
Paul Chote
028c5b5201 Merge the two DamageState types 2010-07-30 22:24:43 +12:00
Chris Forbes
41c0d175bd fix paradrop being broken (again!) 2010-07-30 21:20:13 +12:00
Paul Chote
9280dd9f2f Add some polish 2010-07-30 21:00:23 +12:00
Paul Chote
bde16e4e15 Remove a pile of duplication on mcv undeploy 2010-07-30 21:00:23 +12:00
Paul Chote
119f85dbf4 Unfail mcv deploy 2010-07-30 21:00:23 +12:00
Bob
ede160f1b6 move some more (gameplay related) widgets into mods/ 2010-07-30 20:55:03 +12:00
Bob
b4c84a11f2 changes to allow widgets to be in mods/; moved BuildPaletteWidget into mods/ 2010-07-30 20:15:14 +12:00
Bob
2dd558a065 move LastMousePosition et al from Widget to Viewport 2010-07-30 20:07:39 +12:00
Chris Forbes
3cd9a1e0e4 fix player color blocks not showing up in MapPreviewWidget 2010-07-30 18:54:46 +12:00
Chris Forbes
ef92e004c0 set the correct template on destroying long bridges 2010-07-30 18:48:59 +12:00
Chris Forbes
290a44440c cnc should run 'ralint cnc' after build, not 'ralint ra'. ralint no longer allows exceptions to escape. 2010-07-30 18:41:09 +12:00
Chris Forbes
5d1ee145e1 make (some) RALint errors nonfatal 2010-07-30 18:41:08 +12:00
Chris Forbes
aba9942a85 selling should not cause the building to explode first. 2010-07-30 18:39:21 +12:00
Chris Forbes
3aa2bab99f crate needs Unit. 2010-07-30 18:39:03 +12:00
Chris Forbes
d6b8b327d9 fix Bridge init 2010-07-30 18:24:12 +12:00
alzeih
e1a0d40530 RA Yaml changes 2010-07-30 18:14:00 +12:00
Paul Chote
48c5803198 Zombie prevention 2010-07-30 10:21:19 +12:00
Paul Chote
0580dc4adf Fix damaged-building artwork and don't show healthbar for dead units (cnc critical-building state) 2010-07-30 10:11:33 +12:00
Paul Chote
98ac5a036f Add an `Undamaged' damagestate to simplify things related to healing. 2010-07-30 01:22:41 +12:00
Paul Chote
87d2071007 Fix health bar colors. Todo: Merge DamageState & ExtendedDamageState 2010-07-30 00:46:00 +12:00
Paul Chote
bce9791b56 Fix building repair; Kill GlobalDefaults. 2010-07-30 00:41:55 +12:00
Paul Chote
6fba888d45 Shift Actor.Health onto a trait.
Known regressions:
 - cnc only
 - health bar colors
 - can't repair buildings
2010-07-30 00:33:44 +12:00
Chris Forbes
1e08dc6301 fix crate weirdness 2010-07-29 19:31:05 +12:00
Chris Forbes
2d4efc7942 crate should only choose water/land type on landing, not every tick. 2010-07-29 18:49:41 +12:00
Chris Forbes
bb0531b80f convert Crate to use crushable support again 2010-07-29 18:48:25 +12:00
Chris Forbes
e325b5954c split ITeleportable off as a base interface from IMove; Crate no longer pretends to be moveable. 2010-07-29 18:16:26 +12:00
Paul Chote
2be6cf35ac Add extra spawnpoints to "Middle Mayhem" 2010-07-28 23:23:39 +12:00
Paul Chote
7a4fa93ce9 Introduce a Targetable trait; Subs can attack bridges; May introduce subtle bugs due to previous stupid assumption that !selectable == !attackable. 2010-07-28 22:57:14 +12:00
Paul Chote
f9f6720437 Hook up Building.Capturable and remove unused field 2010-07-28 22:28:52 +12:00
Paul Chote
cfee4405c7 ra too 2010-07-28 22:26:30 +12:00
Paul Chote
eaa80fab74 Shift Sight onto its own trait. Only cnc for now. 2010-07-28 21:37:43 +12:00
Paul Chote
8fab45ae39 Move Cloak, HiddenUnderFog, FrozenUnderFog into Mods.RA; Simplify a pile of related stuff. 2010-07-28 21:11:50 +12:00
Paul Chote
6854d9853b Kill Crewed and move WaterBound onto building 2010-07-28 20:48:50 +12:00
Chris Forbes
5ca7218eb6 integrate scrollbar and checkbox art. fixes #215. 2010-07-28 18:16:47 +12:00
Chris Forbes
72d6a211af disable vshost 2010-07-28 11:26:46 +12:00
Paul Chote
f10e3a4d2d Always update player info on server join 2010-07-27 21:52:21 +12:00
Paul Chote
cfd0e045cb Add Edge Scroll setting 2010-07-27 21:28:40 +12:00
Chris Forbes
4386970bd3 add standalone PNGs for checkbox & scrollbar use 2010-07-27 21:19:17 +12:00
Paul Chote
c6f0b792d3 Do the right thing when stances change 2010-07-27 21:19:17 +12:00
Paul Chote
966f607230 Only show the diplomacy window if its useful 2010-07-27 21:19:17 +12:00
Paul Chote
9a704e69b2 Shift RevealsShroud onto Unit; fix "vehicles don't update shroud" regression in last 2010-07-27 21:19:16 +12:00
Paul Chote
a91ebb4eda Allies share sight 2010-07-27 11:34:28 +12:00
Paul Chote
9fe6671ace Fix retarded crash on server create; redirect server console spam into a logfile. 2010-07-27 10:48:37 +12:00
Paul Chote
386211df8c Update correct download size for deps-v2. 2010-07-26 22:40:25 +12:00
alzeih
ce513ed61a oops 2010-07-26 22:23:25 +12:00
alzeih
3f75e655ce Set Allow Cheats on server creation 2010-07-26 22:23:25 +12:00
alzeih
d9a423b596 Smite Indexdebug, tidy up dev mode 2010-07-26 22:23:24 +12:00
alzeih
30241ddccc Locate devmode code largely in the trait, reduce exploitability. 2010-07-26 22:23:24 +12:00
alzeih
10c7674433 Add to cnc, tidy up ingame menus 2010-07-26 22:23:24 +12:00
alzeih
c749fcfce3 Nearly There 2010-07-26 22:23:24 +12:00
alzeih
fe527c1297 Some of DeveloperMode trait (not working yet) 2010-07-26 22:23:24 +12:00
alzeih
3b72af2e9b AllowCheats 2010-07-26 22:23:24 +12:00
alzeih
2d916e60d9 Remove Developer Settings from Settings > Debug. Adjust Widget layout in DeveloperMode. In preparation for DeveloperMode trait. 2010-07-26 22:23:23 +12:00
Paul Chote
d8d731b321 Don't draw target line when idle 2010-07-26 22:18:40 +12:00
Chris Forbes
4cc021adfe fix dumb crash in minimap -- actors outside the map accessed memory that wasnt part of the bitmap. 2010-07-26 22:16:23 +12:00
Chris Forbes
56e929014d slightly faster again (map.IsInMap isnt free) -- but be careful 2010-07-26 21:42:11 +12:00
Chris Forbes
e0a5350ed6 slightly faster again 2010-07-26 21:39:23 +12:00
Chris Forbes
d774817b0e remaining dumbness removed. 2010-07-26 21:35:00 +12:00
Chris Forbes
3526c05dc8 a bit more 2010-07-26 21:30:23 +12:00
Chris Forbes
69a74425d9 a free 40% or so. 2010-07-26 21:23:19 +12:00
Paul Chote
eb1e325fe2 More caching 2010-07-26 20:44:47 +12:00
Paul Chote
ffa0c16ab9 Ignore opendiff files 2010-07-26 20:36:48 +12:00
Paul Chote
30f16e1a7a Fix cnc 2010-07-26 20:36:48 +12:00
Chris Forbes
0d0353f8f3 a little faster -- don't look up the Mobile every expand either. 2010-07-26 20:33:42 +12:00
Paul Chote
637fae87cd Remove a bunch of unused stuff. May help pathfinder perf a little. 2010-07-26 20:27:56 +12:00
Paul Chote
c39116df84 DefaultInputController -> WorldInteractionController; Tooltip tweaks. 2010-07-26 20:14:36 +12:00
Paul Chote
dcef8770a7 Edge scrolling 2010-07-26 20:14:36 +12:00
Paul Chote
816722256b Split viewport scrolling into its own widget 2010-07-26 20:14:36 +12:00
Chris Forbes
2b890bdb2f make backspace 'cycle bases' binding more obvious. not all of us know the whole character set, or care to. 2010-07-26 20:14:36 +12:00
Chris Forbes
882d94a22a DefaultInputControllerWidget should not ever consume input it doesnt want 2010-07-26 20:14:36 +12:00
Paul Chote
43a488ed6d Rebase fixes 2010-07-26 20:14:35 +12:00
Paul Chote
305fa03355 Kill Controller 2010-07-26 20:14:35 +12:00
Paul Chote
e677be7908 Remove more cruft from Game.controller 2010-07-26 20:14:35 +12:00
Paul Chote
eac49ca641 Refactor existing hodgepodge of hardcoded mouse/keyboard events into DefaultInputController. 2010-07-26 20:14:35 +12:00
Paul Chote
2248320af7 Move Game.Controller.HandleInput into a widget; works but is hacky 2010-07-26 20:14:35 +12:00
Chris Forbes
f61421edd0 gain ~20% faster pathing perf 2010-07-26 19:14:54 +12:00
Chris Forbes
9bb5e49058 draw building grid under actors too 2010-07-26 18:32:29 +12:00
Chris Forbes
16c9f2b873 render range circle and detection circle under actors 2010-07-26 18:27:02 +12:00
Chris Forbes
69d30ac71b RenderBeforeWorld/RenderAfterWorld split. still need to sort out which behavior belongs where. 2010-07-26 18:19:39 +12:00
Chris Forbes
9cf8ac0c3d remove dead IVictoryConditions interface 2010-07-26 18:07:48 +12:00
Chris Forbes
f1a5998049 remove dead ChooseFreePalette crap 2010-07-26 17:54:18 +12:00
Chris Forbes
41b76144da force the socket closed so the client thread will die pretty fast. dirty hack, but teh read timeout is nuts otherwise. 2010-07-26 17:49:08 +12:00
Chris Forbes
e30e97037f squash warning 2010-07-26 17:40:36 +12:00
Chris Forbes
102f1dd858 blah 2010-07-26 17:33:56 +12:00
alzeih
925ca2bb73 SetTargetSilently for DrawLineToTarget 2010-07-26 13:57:53 +12:00
alzeih
526bb3e042 Use Targets 2010-07-26 12:33:54 +12:00
Paul Chote
e8adc357e9 Draw targeting lines for player-issued orders. Can force-display targets with [alt]. 2010-07-26 12:01:13 +12:00
alzeih
130b4d29b4 Move SelectedUnit drawing stuff out of WorldRenderer into Selectable with IRenderSelection 2010-07-26 02:25:52 +12:00
alzeih
5f357288ee layout tidyup - start game now forces game start, ready checkboxes behave as before. 2010-07-25 22:16:21 +12:00
alzeih
26b5fbe9bb startgame order and lobby changes 2010-07-25 21:31:17 +12:00
Paul Chote
4650642311 Keep selection on mcv deploy/undeploy. Bonus: build tab opens on mcv deploy 2010-07-25 20:02:23 +12:00
Chris Forbes
e850cb7ff8 assign a palette to the cursor for basemod 2010-07-25 16:36:29 +12:00
alzeih
9fcb0577a5 default mod (pchote: squashed + amended) 2010-07-25 16:10:35 +12:00
Chris Forbes
df7dad8aaa add ra_perf mod, which exposes the performance test maps 2010-07-25 15:57:54 +12:00
Chris Forbes
3080e19bf2 add visualization of minefields when MNLY is selected 2010-07-25 15:56:40 +12:00
Chris Forbes
f2bfa8e2ee reinstate range circles; IRenderSelection allows arb. plugging in of these things 2010-07-25 15:56:40 +12:00
alzeih
2254e48f65 little bit better threading [pchote: picked/amended] 2010-07-25 15:56:40 +12:00
Chris Forbes
443f2bb6b9 fix msbuild project files. thanks, monodevelop: what was there worked JUST FINE 2010-07-25 15:52:09 +12:00
Paul Chote
c82cc7b301 Update osx packaging script for WindowsBase.dll and mono 2.6.7 2010-07-25 15:34:13 +12:00
Paul Chote
63951ac134 Run ralint after building 2010-07-25 15:11:08 +12:00
Paul Chote
301007e225 Fix compile errors/warnings 2010-07-25 15:02:01 +12:00
Paul Chote
5776d351b4 Fix Monodevelop build; remove Aftermath project. 2010-07-25 14:55:44 +12:00
alzeih
484bea106b OpenRA works nicely with monodevelop 2010-07-24 16:19:54 +12:00
alzeih
4fd5d9e0c3 Cloak Changes: appear semitransparent to localplayer, not at all to others. Same for mines.
( Also fix compile warning in LimitedAmmo )
2010-07-24 15:17:29 +12:00
Chris Forbes
5375692f1f remove spam on planes doing stuff 2010-07-24 00:09:54 +12:00
Paul Chote
20c0419782 Don't leak information on the underlying terrain via the mouse cursor. Cursor and voice response always "move" for terrain under shroud.
Needs pathfinder changes before being mergeable
2010-07-23 22:53:38 +12:00
Paul Chote
c74fe87fc8 Fix voice on unpathable terrain 2010-07-23 22:45:11 +12:00
Paul Chote
d5c43c9fda Remove unused code 2010-07-23 22:44:59 +12:00
Paul Chote
5344e60e3d Forgot a file 2010-07-23 22:44:48 +12:00
Paul Chote
52c8c93b30 Building capture eva + wtf on silo capture 2010-07-23 22:29:27 +12:00
Chris Forbes
31cb2081c6 rude hack to make planes associate with the airfield which spawned them 2010-07-23 21:40:07 +12:00
alzeih
cad1418199 use Range as a *range*, not as a nearenough. 2010-07-23 21:40:06 +12:00
alzeih
984e081f3b threadsafe 2010-07-23 21:40:06 +12:00
alzeih
282d26b844 Remember to disconnect ingame too, and mark the game as not started.
Also fix a compiler warning
2010-07-23 21:40:05 +12:00
alzeih
9516235707 Chat lines vanish after a set time in game
Also, Clear chat on join server
2010-07-23 21:40:05 +12:00
alzeih
409416b55c Host closing server closes all connections and closes the listener. 2010-07-23 21:40:04 +12:00
Chris Forbes
05d0e825fd unfail reservations for planes a bit 2010-07-23 21:40:04 +12:00
Paul Chote
c14f1aa996 Chronotank 2010-07-23 21:37:43 +12:00
Paul Chote
05953d0d6b Building capture 2010-07-23 21:26:26 +12:00
Paul Chote
fdf57b1e63 Cargo 2010-07-23 21:17:21 +12:00
Paul Chote
7f640fd701 MCV deploy and FIX. 2010-07-23 21:08:05 +12:00
Paul Chote
4016b81208 c4 and goldwrench voices / flashes / fixed movement 2010-07-23 20:13:41 +12:00
Paul Chote
7a06ddb8d1 Harvester voices / cursors / flashes 2010-07-23 19:56:22 +12:00
Paul Chote
c90317fb35 Aircraft/Helicopter move/dock flashing and cursor fixes 2010-07-23 19:10:10 +12:00
Paul Chote
55e59e0b53 Unhardcode voice/order interaction; reimplement for move and attack 2010-07-23 18:41:35 +12:00
Chris Forbes
1186d40fda quick hack to fix unclickable tabs on buildpalette 2010-07-23 18:26:59 +12:00
Paul Chote
1fc3ca284e Fix "Unit Lost" in cnc; remove related cruft 2010-07-23 17:33:39 +12:00
Paul Chote
f4e66a3d7a Fix power bar 2010-07-23 17:28:21 +12:00
Paul Chote
71420df0f3 Fix CursorForOrderString to work with orders + preliminary e6 fixes 2010-07-23 17:16:02 +12:00
Paul Chote
5019bb8b6e Animated move cursors for cnc 2010-07-23 16:01:53 +12:00
Paul Chote
61006ee73b For now, use ra cursors to fill some of the gaps in cnc 2010-07-23 15:15:21 +12:00
Paul Chote
9ebdef043c Allow custom/multiple cursor palettes 2010-07-23 14:49:45 +12:00
Paul Chote
93e629584b Use GoldWrench cursor for engineer repair 2010-07-23 00:29:46 +12:00
Paul Chote
1061f1138f Fix ra minimap cursors 2010-07-23 00:21:45 +12:00
Paul Chote
5c7e278b93 Draw viewport rect on radar 2010-07-23 00:03:04 +12:00
Paul Chote
a42ef6b3ea Update Minimap at ~2Hz, staggering layers. Minimap is faster than ever before. 2010-07-22 23:01:27 +12:00
Paul Chote
ac526f9762 Split the radar into multiple bitmaps 2010-07-22 22:54:12 +12:00
Paul Chote
d21e9fe093 Kill ITerrainTypeModifier for explicit updating of a custom layer in the map. Functionally equivalent, but MUCH faster. 2010-07-22 22:22:53 +12:00
Paul Chote
3e493cb93c Fix cursors over closed radarbin 2010-07-22 21:44:45 +12:00
Paul Chote
37a55715d0 Shift the hard work into Tick 2010-07-22 21:41:30 +12:00
Paul Chote
5198ced5aa Remove unnecessary check 2010-07-22 20:44:14 +12:00
Paul Chote
5ce8a643a7 ... 2010-07-22 20:40:24 +12:00
Paul Chote
53304b3de2 Cloaked units (not) on radar; untested but is simple enough that it should work 2010-07-22 20:33:54 +12:00
Paul Chote
a09a6997b4 Radar takes into account visibility under fog 2010-07-22 20:26:19 +12:00
Paul Chote
f7212ef757 Correct bridge / tree / mine color 2010-07-22 19:50:41 +12:00
Paul Chote
5f36933837 Fix custom terrain location 2010-07-22 19:50:41 +12:00
Paul Chote
a234dd4382 New interface for things that show on radar; groundwork for future patches. 2010-07-22 19:50:41 +12:00
Chris Forbes
31d5d18d65 undo ProjectileArgs stuff 2010-07-22 18:59:41 +12:00
Chris Forbes
6d527c3668 unbreak Target 2010-07-22 18:36:56 +12:00
alzeih
1497c31908 some more hax 2010-07-22 18:01:32 +12:00
alzeih
6be4e5c266 Combat.DoExplosion now takes a Target
(needs more refactoring)
2010-07-22 16:00:14 +12:00
alzeih
4e22e37192 Fix the in range check 2010-07-22 15:54:42 +12:00
alzeih
3395f97b20 Attacking is working again 2010-07-22 13:07:15 +12:00
Chris Forbes
73b6eb568b more of attack-ground (order wiring, etc); doesn't work. 2010-07-22 08:26:52 +12:00
Chris Forbes
5c61c9d3a9 migrating most things to use the Target struct rather than Actor directly. 2010-07-22 08:26:51 +12:00
Chris Forbes
88b705c8ef add Target type, in prep for allowing attack-ground 2010-07-22 08:26:51 +12:00
Chris Forbes
a78001a5cc strip some redundancy from UnitOrders, but it still sucks; fix nudges breaking everything 2010-07-22 08:03:44 +12:00
alzeih
b2454c8b8d instead, fix DumpSyncReport warning properly
(? maybe)
2010-07-22 01:40:44 +12:00
alzeih
3f9ffbac80 smite some compiler warnings, hide those that are to stay.
Hide some makefile output too
2010-07-22 01:39:44 +12:00
Paul Chote
55fd5c3b9b Halve the perf fail of custom terrain (down to ~4ms) 2010-07-22 01:21:36 +12:00
Paul Chote
db9cfb9ddd More refactoring and a TODO on custom terrain perf 2010-07-22 01:13:03 +12:00
Paul Chote
2d2362a1a6 Minimap refactoring; don't render the minimap unless we have radar. 2010-07-22 00:15:33 +12:00
Paul Chote
fdc033a63f Fix teamchat in lobby 2010-07-22 00:02:30 +12:00
Paul Chote
b8eab0614f Fix spawn point rendering 2010-07-21 23:49:24 +12:00
Paul Chote
78aff37fe4 Minimap sanity; part 1: rewrite the core radar logic 2010-07-21 23:44:23 +12:00
Paul Chote
58aed632a1 Add sanity to minimap; part 0 2010-07-21 20:50:40 +12:00
Paul Chote
3969dc9fb6 Tweak cnc walls; less extreme than ra 2010-07-21 20:50:40 +12:00
alzeih
ac27b40f7a Oops 2010-07-21 20:44:58 +12:00
alzeih
8e2d422054 Improvements to VictoryConditions, and Dead = Chat to all 2010-07-21 20:21:02 +12:00
Paul Chote
d69267f71c Remove Minimap from world 2010-07-21 19:48:43 +12:00
Chris Forbes
3a7bec1eef implement INudge on Mobile 2010-07-21 19:37:24 +12:00
Chris Forbes
8006e20dd3 however, we *do* need to know who nudged us, so we can tell them where to shove it if required. 2010-07-21 19:27:49 +12:00
Chris Forbes
5ef651ce6d return value not required. 2010-07-21 19:25:32 +12:00
Chris Forbes
e426d50cc2 add INudge interface; Move tries to nudge things that are in the way as a good first option 2010-07-21 19:24:45 +12:00
alzeih
2f9f539857 big pile of Render refactoring 2010-07-21 18:59:33 +12:00
Chris Forbes
84e1ed1cf9 fix helis landing where they shouldnt 2010-07-21 18:52:24 +12:00
Chris Forbes
8cb6e0b229 make walls sortof worth using 2010-07-21 18:42:28 +12:00
Chris Forbes
2584aad0c7 make UOG actually use FindUnitsAtMouse rather than homebrewing it 2010-07-21 18:24:29 +12:00
alzeih
4065a4f6a2 WorldRenderer now uses the global renderers too 2010-07-21 18:17:43 +12:00
Paul Chote
c2197b0adb Hopefully fix some of our pathing issues. Untested. 2010-07-21 18:01:15 +12:00
alzeih
222b29cec6 Bye Bye Chrome! 2010-07-21 17:57:06 +12:00
alzeih
0ac91d3c5e Widget IHandleInputs now 2010-07-21 16:51:00 +12:00
alzeih
d0b4761e07 actually remove the rootWidget from Chrome 2010-07-21 16:18:45 +12:00
alzeih
647252b0cb Chrome.rootWidget -> Widget.RootWidget 2010-07-21 16:14:31 +12:00
alzeih
795da1b088 unhacking IChromeButton. 2010-07-21 16:00:26 +12:00
alzeih
846971836a adjust path debug for altitude 2010-07-21 14:17:14 +12:00
Paul Chote
578f47d3b2 Fix crates. Untested but should work. 2010-07-21 12:21:56 +12:00
Paul Chote
d53a765971 Fix default cursor (cnc) 2010-07-21 11:53:47 +12:00
Paul Chote
ca2c9991fe Kill PostGameWidget 2010-07-21 11:51:15 +12:00
Paul Chote
47ca19e37d Fix cnc minimap cursors and document needed artwork 2010-07-21 11:20:42 +12:00
Paul Chote
86b66b91dd Fix seqed under mono 2010-07-21 11:20:42 +12:00
Chris Forbes
06bc14f690 fix a bunch of bad cursor hotspots in ra 2010-07-21 08:21:45 +12:00
Paul Chote
d3df8e6abd Remove debug spam 2010-07-21 00:28:14 +12:00
Paul Chote
7d02a801ad minicursors for minimap.
Bugs: ra doesn't define a sequence for move-blocked-minimap; cursor hotspot is wrong.
2010-07-21 00:26:32 +12:00
Paul Chote
bd69047e8c Fix cursor interaction with widgets 2010-07-20 23:51:55 +12:00
Paul Chote
5abe52607d Apply the same hack to BuildPaletteWidget 2010-07-20 23:30:05 +12:00
Paul Chote
46d502e053 Remove blatant abuse of RenderBounds 2010-07-20 23:22:09 +12:00
alzeih
0d489e638e send message to EVERYONE... 2010-07-20 21:48:09 +12:00
alzeih
b8a335a88f put back in --just-die 2010-07-20 21:38:21 +12:00
alzeih
0d671ae407 layout tweaks 2010-07-20 21:28:58 +12:00
alzeih
e10074d153 Actually give cash, add cheating message 2010-07-20 21:20:03 +12:00
alzeih
f92b59e6db Developer Mode (pchote: amended) 2010-07-20 21:20:03 +12:00
Chris Forbes
f39f7fc23e fix mouse input breakage on radarbin 2010-07-20 20:49:10 +12:00
Chris Forbes
02e4de61eb only play 'unit lost' etc to owner 2010-07-20 20:17:30 +12:00
Chris Forbes
cedcb3d84f fix stupid crash on husks dying 2010-07-20 19:48:54 +12:00
Chris Forbes
80d1b46c04 improve ftur a bit 2010-07-20 18:30:58 +12:00
Chris Forbes
19fda0b98e kill most of GlobalDefaults 2010-07-20 18:26:09 +12:00
Chris Forbes
1918c125ec ^Ship was a better place to put those. 2010-07-20 18:17:49 +12:00
Chris Forbes
b3aaacf16b don't drop crates in stupid places 2010-07-20 18:05:20 +12:00
alzeih
416e892897 it compiles again 2010-07-20 18:04:16 +12:00
Chris Forbes
1cbc3dd60f paradrop now asks its *cargo* whether a cell is suitable, rather than itself. 2010-07-20 17:55:10 +12:00
Chris Forbes
2684284c27 unit-lost sounds through voice 2010-07-20 17:39:35 +12:00
Chris Forbes
cb44844639 fix impotent mig 2010-07-19 19:56:11 +12:00
Chris Forbes
fa0d6b3e72 move LimitedAmmo to RA dll; reduce pips for YAK 2010-07-19 19:44:18 +12:00
Chris Forbes
92f4442941 nerf ca and msub a bit more 2010-07-19 19:34:00 +12:00
Chris Forbes
de02a374b4 add msub metadata 2010-07-19 18:02:51 +12:00
Chris Forbes
19d607489d add msub art (temp; will replace with custom art) 2010-07-19 18:02:50 +12:00
Chris Forbes
e4639adc3e cnc: much nicer msam 2010-07-19 18:02:49 +12:00
Chris Forbes
902c2c7832 fix special power bin 2010-07-19 18:02:49 +12:00
Chris Forbes
f45de5de45 throw out some unused server code 2010-07-19 12:36:48 +12:00
Chris Forbes
83dc6bd576 wire up CompressedPackage to be used if extension is .zip 2010-07-18 17:42:44 +12:00
Chris Forbes
a08dacc9c2 add support for compressed packages (zip); strip unnecessary SharpZipLib dll. req reference to WindowsBase for System.IO.Packaging support (apparently Mono has it) 2010-07-18 17:39:19 +12:00
Chris Forbes
27ef3483ec add thirdparty/ICSharpCode.SharpZipLib.dll; remove ConnectedComponents (unused); move DisposableAction into Primitives folder 2010-07-18 17:05:32 +12:00
Chris Forbes
d5f12dd8ee trim down license spam in all files 2010-07-18 16:48:21 +12:00
Paul Chote
6427a6dc33 Export tilesets into a mix 2010-07-17 19:03:05 +12:00
Paul Chote
04758bacde Create a mix file with a list of files 2010-07-17 19:01:03 +12:00
Paul Chote
a6ba5ec453 Update tilesetbuilder to new tileset format 2010-07-17 13:42:53 +12:00
Chris Forbes
8da7bfcf3c add sources for tileset 2010-07-17 12:18:07 +12:00
Paul Chote
37ba46fa54 Add TilesetBuilder to makefile 2010-07-17 12:16:53 +12:00
Paul Chote
9875a968bc Map ctor no longer assumes anything about mods (fixes cnc custom-map crash) 2010-07-17 12:03:25 +12:00
Paul Chote
239fff20f4 Fix a couple of nits 2010-07-17 11:57:59 +12:00
Paul Chote
5b333f4bba Store last color setting; hook server join in a cleaner way 2010-07-17 00:21:11 +12:00
Paul Chote
8b3a65717e Hook up the range slider 2010-07-17 00:01:29 +12:00
Paul Chote
2272b6688e cnc support 2010-07-16 23:56:01 +12:00
Paul Chote
bce5f2c681 Use custom colors ingame; requires a map format change to kill the obsoleted "palette" field 2010-07-16 23:47:33 +12:00
Paul Chote
c4442f07da Sliders change the preview palette and update client data; Need a better algorithm for picking color2 2010-07-16 23:34:42 +12:00
Paul Chote
4fb3f67a9d Hook up the HSL sliders 2010-07-16 22:34:30 +12:00
Paul Chote
44e1b8311f Color picker panel; sliders don't work yet 2010-07-16 21:54:35 +12:00
Paul Chote
8abc8e03cb Shift player palette definitions onto the player/client. Needs ui; for now everyone is teal. 2010-07-16 20:51:20 +12:00
Paul Chote
84ac8d9d16 Remove some duplication 2010-07-16 19:03:32 +12:00
Chris Forbes
4c8f85b36b split renderer into a file per class 2010-07-16 18:22:19 +12:00
Chris Forbes
d821dd011f move RALint's InitializeEngineWithMods into Game. 2010-07-16 18:15:50 +12:00
Chris Forbes
a2262df843 start stripping down MapConverter 2010-07-16 18:03:05 +12:00
Chris Forbes
e1031e36b2 some more 2010-07-16 18:01:26 +12:00
Chris Forbes
9bbb2f78de some fileformats cleanup 2010-07-16 17:50:09 +12:00
Paul Chote
ebec75be0e Fix server browser 2010-07-15 23:24:54 +12:00
Paul Chote
57a315a243 cnc tweaks 2010-07-15 23:24:54 +12:00
alzeih
96d7f8da3f Fixes
Lower cost of NUK2 to 500
Put clock in the right place
2010-07-15 23:18:29 +12:00
Chris Forbes
1242a2c39b avoid exploding in UnitOrders.cs 2010-07-15 22:09:13 +12:00
Paul Chote
59f931b2f8 Rip out preview.pngs 2010-07-15 21:47:03 +12:00
Paul Chote
b3413dc783 Faster bitmap editing 2010-07-15 21:25:02 +12:00
Paul Chote
45061cdf37 Cleaner attempt at rendering map previews on the fly 2010-07-15 21:16:35 +12:00
Chris Forbes
d274c10e95 fix missing .ini files breaking installer 2010-07-15 21:07:01 +12:00
Chris Forbes
73abf68d01 sensibly represent times >= 1h (important for game timer) 2010-07-15 21:02:28 +12:00
Chris Forbes
2622ee7171 don't overlay the timer on the perf widget; make it big; measure game time, not wallclock time 2010-07-15 20:55:01 +12:00
alzeih
69f499936b Resources are annoying 2010-07-15 20:38:13 +12:00
alzeih
db4c18b520 Timer Widget
Added a new Timer Widget
Made one to display the ingame time elapsed
Hooked up to reset on Game Start
Added a setting for it in Settings Menu (default true)
2010-07-15 20:38:12 +12:00
alzeih
80a91de1be fix prev for cnc 2010-07-15 20:38:12 +12:00
Chris Forbes
da348fa2d0 fix windows installer to include mod chrome folders 2010-07-15 20:35:28 +12:00
Chris Forbes
f6f13dd021 fix buildpalette stealing all the input 2010-07-15 20:30:45 +12:00
Chris Forbes
ea825ff2b5 proper keydown/keyup handlers 2010-07-15 20:12:57 +12:00
Chris Forbes
071c790097 clean up low-level keyboard input 2010-07-15 20:06:00 +12:00
Chris Forbes
bf50a2961e fix weirdness with modifiers being held during startup (C-F5 in particular broke things) 2010-07-15 18:49:24 +12:00
alzeih
aeefc94fe0 BuildPaletteWidget: don't click on buttons if the palette isn't open. Don't allow hotkeys unless palette is open. Move key handling into widget. 2010-07-15 18:24:54 +12:00
Chris Forbes
a02fd48597 RA does not use split ore and cash displays 2010-07-15 08:19:58 +12:00
Paul Chote
d01b3a25c4 Fix some initial nits 2010-07-14 23:39:14 +12:00
Chris Forbes
fbf94f9f43 noone needed that ctor 2010-07-14 21:14:53 +12:00
Chris Forbes
5e912a316d emulation of old chat system 2010-07-14 21:11:06 +12:00
Chris Forbes
093e445564 fix chat (1/2) 2010-07-14 20:55:07 +12:00
Chris Forbes
fed33fdb00 remove plenty of redundant junk 2010-07-14 19:00:03 +12:00
Chris Forbes
17bf4610f1 fix prev so it compiles with csc 2010-07-14 17:34:55 +12:00
alzeih
c3532fc9ea Change Settings defaults 2010-07-14 16:53:06 +12:00
alzeih
c9c2071db6 Settings Menu: Save once, and on OK 2010-07-14 13:58:13 +12:00
alzeih
6b4a193c7c SoundVolume distinct from GlobalVolume. Move sound values into UserSettings. 2010-07-14 13:57:42 +12:00
Paul Chote
f28eb7971b Split widget definitions into smaller files 2010-07-14 12:25:44 +12:00
Paul Chote
9ed57cc297 Fix spawnpoint rendering 2010-07-14 12:06:07 +12:00
Chris Forbes
65d2a5bb3c remove addpkg crap from server, since we don't use it. 2010-07-14 01:10:10 +12:00
Chris Forbes
3e0f850309 fix repair canceling itself 2010-07-14 01:10:10 +12:00
alzeih
7902a5e050 Settings menu (pchote: fix alzeihs broken world) 2010-07-14 01:09:49 +12:00
alzeih
992c1eec88 Slider Widget (thanks to pchote) 2010-07-14 00:43:12 +12:00
Paul Chote
6e8dd19800 Fancy server browser 2010-07-14 00:42:29 +12:00
Paul Chote
f7a6ed78ec You don't belong there 2010-07-13 23:19:38 +12:00
Paul Chote
7764302ac3 Fix cursor blink on mousemove 2010-07-13 20:50:35 +12:00
Paul Chote
8d2693019d Remove some unnecessary fields from chrome 2010-07-13 20:49:04 +12:00
Paul Chote
4a7c19cf93 Better temp artwork for listboxes 2010-07-12 21:16:37 +12:00
Paul Chote
7d2a5d6f42 Better listbox rows 2010-07-12 21:10:00 +12:00
Paul Chote
e23ee6d892 Better mouse input handling 2010-07-12 19:50:31 +12:00
alzeih
bd096436d9 New Command Order. GUI changes to settings no longer produce messages in chat. Can't enter commands in chat any more. 2010-07-12 19:35:08 +12:00
Paul Chote
9b5df39a04 Basic listbox for map list 2010-07-12 18:30:53 +12:00
Paul Chote
f70ac60135 Widget refactoring to support listboxes 2010-07-12 17:41:25 +12:00
alzeih
d740cf9fcd Paul, you noob 2010-07-12 03:28:31 +12:00
alzeih
5925453ab8 PaletteFromCurrentTheatre (pchote: amended) 2010-07-12 03:09:51 +12:00
alzeih
c4759b4130 Settings has Tabs (pchote: squashed + amended) 2010-07-12 03:09:14 +12:00
alzeih
89a77f7402 FileExtractor tool, remove default mod deps on mix files (pchote: squashed) 2010-07-12 03:05:56 +12:00
alzeih
dc1e36f653 smite some more compile warnings (amended to add minimap changes) 2010-07-12 00:51:58 +12:00
alzeih
7d18937415 better instance logging support 2010-07-12 00:48:29 +12:00
alzeih
d0d3f1434e Fix Perf-text 2010-07-12 00:46:37 +12:00
Paul Chote
d680956b02 Override FieldLoader to not crash on invalid input; Implemented for settings loading. 2010-07-11 17:52:01 +12:00
Paul Chote
af71f564e9 Whoops 2010-07-11 16:18:52 +12:00
Paul Chote
6d49dcece1 Remove BS from Viewport 2010-07-11 16:17:20 +12:00
Paul Chote
b4a84deb86 RA Support. Need a proper listbox widget to prevent map list overflow. 2010-07-11 15:46:10 +12:00
Paul Chote
b0e1d37789 Goodbye hardcoded chrome! 2010-07-11 15:43:32 +12:00
Paul Chote
74383fee47 Remove references to chrome.currentMap from LobbyDelegate 2010-07-11 14:42:12 +12:00
Paul Chote
7591434987 Remove hardcoded map references from MapPreviewWidget; prevents information leakage between lobby and map selector and provides groundwork for future patches 2010-07-11 14:25:29 +12:00
Paul Chote
ca07318dc5 Move the easy things from the hardcoded map chooser into widgets 2010-07-11 12:52:41 +12:00
Paul Chote
424aa5c2d2 Persist server settings 2010-07-11 12:23:24 +12:00
Paul Chote
96c80f357c Polish 2010-07-11 01:59:37 +12:00
Paul Chote
788e99fc7f Copy changes over to ra 2010-07-11 01:18:44 +12:00
Paul Chote
8c141c7b5e Expose port settings to server dialog 2010-07-11 01:08:36 +12:00
Paul Chote
900335b08c Direct Connect dialog & saves last server 2010-07-11 00:34:54 +12:00
Paul Chote
b6fc28023d Add a "Game Name" textfield to server creation 2010-07-11 00:04:42 +12:00
Paul Chote
3296cc2ec1 MaxLength on textfields 2010-07-10 23:50:42 +12:00
Paul Chote
62995ffad8 Tweak focus on name entering 2010-07-10 23:25:55 +12:00
Paul Chote
a29198c237 Layout/font weight polish 2010-07-10 23:19:55 +12:00
Paul Chote
56fb711fc6 Textfield editable names 2010-07-10 22:30:28 +12:00
Paul Chote
dcf13e52c2 Vertically align labels 2010-07-10 21:38:47 +12:00
Paul Chote
e063f5e271 Add forgotten file; teamchat polish 2010-07-10 21:26:19 +12:00
Paul Chote
d91fc0d8e7 Make TextFieldWidget generic; Hook up teamchat and make it actually work in the lobby 2010-07-10 21:15:21 +12:00
Paul Chote
50f3aecf53 Move chat display into a widget 2010-07-10 20:43:29 +12:00
Paul Chote
fdf570398a Replace the lobby chat textfield with the widget; teamchat and ingame chat don't work yet 2010-07-10 19:25:00 +12:00
Paul Chote
8c59b582d9 Handle text overflow nicely 2010-07-10 18:45:25 +12:00
Paul Chote
5dba8842de Fix focus issues and show a blinky cursor 2010-07-10 18:09:38 +12:00
Paul Chote
faf5e7bbf1 Beginnings of textfield widget 2010-07-10 17:48:46 +12:00
Chris Forbes
19f74e1d3e fix c&c crash on startup 2010-07-10 17:46:42 +12:00
Matthew
cfb37476c7 Modified packaging scripts to remove binary generation. 2010-07-10 16:27:09 +12:00
Matthew
6a3de5dee6 Have to force path to binary. 2010-07-10 16:27:09 +12:00
Matthew
bce2bcec9c Make sure bin dir exists in fake root environments. 2010-07-10 16:27:08 +12:00
Matthew
50c5c51d4b Bin path still needed fixing. 2010-07-10 16:27:07 +12:00
Matthew
ff0a90af0a Fixed bin path. 2010-07-10 16:27:07 +12:00
Matthew
2037c89cdb Binary generation moved to Makefile. 2010-07-10 16:27:06 +12:00
Chris Forbes
a372ba2080 make it work 2010-07-10 16:24:29 +12:00
Chris Forbes
2169f32a79 add (nonfunctional) checkbox for lock-teams 2010-07-10 16:24:28 +12:00
Chris Forbes
8d68bd026d add 'lock teams' feature backend -- still needs UI 2010-07-10 16:24:28 +12:00
Paul Chote
77405a7700 Fullscreen toggle & don't crash when saving null fields 2010-07-10 15:42:50 +12:00
Paul Chote
636bfd5e0a Tweaks 2010-07-10 15:05:17 +12:00
Paul Chote
0206f70ab8 Remove obsolete settings and tweak windows shortcuts 2010-07-10 15:00:00 +12:00
Paul Chote
04bb5b0a4b Load/Save settings from <support dir>/settings.yaml 2010-07-10 14:58:50 +12:00
Paul Chote
b7eb4193d4 Don't target c17 2010-07-10 13:36:18 +12:00
Paul Chote
862cab9cbe Disable Hazards and 5-per-cell infantry until they work properly 2010-07-10 13:28:52 +12:00
Paul Chote
e6d5d1492e Fix starting cash 2010-07-10 13:18:04 +12:00
Paul Chote
ce677bf3dc Package uploading script (replaces OpenRAUploader) 2010-07-10 12:40:00 +12:00
Paul Chote
529ce4bc6a Makefile tweaks 2010-07-10 00:12:48 +12:00
Paul Chote
968ab06135 makefile for build uploader 2010-07-10 00:12:48 +12:00
Chris Forbes
20785a6585 clean up bullets somewhat 2010-07-09 21:44:38 +12:00
Chris Forbes
5e1c63ebb5 change BulletInfo.Arcing to BulletInfo.Angle to allow more control over trajectories 2010-07-09 21:05:00 +12:00
Chris Forbes
40ae25c895 remove silly exploit on undeploying MCV 2010-07-08 21:49:25 +12:00
Paul Chote
3093928d95 Move lint checking to the mods themselves; don't compile aftermath (the rules have bitrotted so lint always fails) 2010-07-08 20:28:05 +12:00
Paul Chote
df3581237e Remove hardcoded cursor bs; move TransformsOnDeploy to Mods.RA. 2010-07-08 20:23:19 +12:00
Paul Chote
ac3924e660 Restore sane buildspeed to cnc 2010-07-08 19:32:37 +12:00
Paul Chote
476d40b317 Move StoresOre into Mods.RA 2010-07-08 19:32:07 +12:00
Paul Chote
d9ba7ff90c Fix packaged osx SupportDir 2010-07-08 19:12:49 +12:00
Paul Chote
a383f8873c SupportDir supports absolute or relative paths; default to ~/OpenRA 2010-07-08 19:10:34 +12:00
Paul Chote
3508e71168 Automatically run ralint when building from makefile. Also fixes external-tool logging crash 2010-07-08 18:45:54 +12:00
Paul Chote
513769f131 Remove the need for a trailing separator 2010-07-08 18:11:29 +12:00
Paul Chote
fdc85b6e48 Don't spam logs and replays all over my home directory kthx.
Logs and replays are written to subdirectories of the "Support" folder. Default location is <game dir>/Support/; Can be overridden on game start.
2010-07-08 18:11:28 +12:00
Bob
fb6c44bce3 move render{building,buildingturreted,unit} into mods.ra; move all render traits into mods.ra.render 2010-07-08 17:24:12 +12:00
Bob
281d013c3b move Combat, AttackBase, and associates into mod 2010-07-08 16:38:58 +12:00
Bob
bd74b29ea3 move projectile effects into mod 2010-07-08 16:04:18 +12:00
Bob
7a738ed6af move CYard trait and UndeployMCV activity into mod 2010-07-08 15:34:21 +12:00
Bob
1eedae2c7b fix window origin in pseudofullscreen 2010-07-08 15:20:55 +12:00
Bob
6a840dff4c move ActorGroupProxy to mod; move SupportPower traits into directory 2010-07-08 14:01:44 +12:00
Paul Chote
9054f10b83 Sane crate defaults for cnc 2010-07-07 23:16:24 +12:00
Paul Chote
d04d943fe5 Remove some redundant logging 2010-07-07 23:13:27 +12:00
Paul Chote
02e4d7d270 Remove "Version: " from the version string display 2010-07-07 23:13:27 +12:00
Paul Chote
5fba682fe0 Fullscreen -> WindowMode; defaults to pseudofullscreen which does hax on windows, falls back to normal fullscreen for everyone else. 2010-07-07 23:13:27 +12:00
Paul Chote
731e7af45a Point the downloader at the right package 2010-07-07 23:13:27 +12:00
Paul Chote
b11719d34a Re-enable zip generation 2010-07-07 23:13:27 +12:00
Paul Chote
066c28b0e8 Point the download urls at the master server 2010-07-07 23:13:27 +12:00
Paul Chote
bc016fd76d More polish; pull terminal/finder windows to the front when stuff happens; include unzip progress in terminal 2010-07-07 23:13:26 +12:00
Paul Chote
4dd25d4936 Polish 2010-07-07 23:13:26 +12:00
Paul Chote
a5d90a542b Split the functions out into their own files 2010-07-07 23:13:26 +12:00
Paul Chote
9d70bb24a6 Package osx dependencies separately from the main download; Game is now run from inside app bundle; Support dir used to cache downloads only 2010-07-07 23:13:26 +12:00
Chris Forbes
12a350b89f fix crash on selecting husks (and other things with Unit but Selectable.Voice = null) 2010-07-07 21:27:34 +12:00
Chris Forbes
fb1d37ae53 use explosion *names*, not *numbers* like RA. 2010-07-07 19:44:14 +12:00
Paul Chote
c17a63a434 Add icons to the osx launcher 2010-07-07 19:09:52 +12:00
Paul Chote
bc84e33222 Add more resolution to version string 2010-07-07 19:09:50 +12:00
Paul Chote
2835fd66fe Show version on shellmap (via alzeih) 2010-07-07 19:09:46 +12:00
Paul Chote
1b38c4a6cb Upgrade install if newer version is run 2010-07-07 19:09:41 +12:00
Paul Chote
a74705f34d Tweaks 2010-07-07 19:09:38 +12:00
Paul Chote
2fa0ac99dd Install game in ~/Library/Application Support/OpenRA/; Download packages only when needed; Display a dialog on crash 2010-07-07 19:09:36 +12:00
Paul Chote
247576277f Select mod on game start (TODO: kill this in favor of a proper ingame mod manager) 2010-07-07 19:09:34 +12:00
Paul Chote
6359674d27 Override UserSettings from the commandline 2010-07-07 19:09:30 +12:00
Paul Chote
4671e6b261 Script to package a game build into a zip 2010-07-07 19:09:27 +12:00
Paul Chote
cfa4820379 Package Cg and SDL too 2010-07-07 19:09:25 +12:00
Paul Chote
4c8575b1f5 Custom game wrapper for osx. Point it at a standard game dir, and it will run it without needing any other dependencies installed.
Internal mono works; still uses system SDL and Cg
2010-07-07 19:09:22 +12:00
Chris Forbes
ec9bdb03c5 slower-moving but much nicer v2 projectile 2010-07-07 19:00:10 +12:00
Chris Forbes
ae671369b6 fix descriptions for 2tnk/3tnk; tweak damage types for 1tnk. 2010-07-07 18:36:08 +12:00
Chris Forbes
2ed8045736 remove DeathWeapon; IExplodeModifier implemented for resource actors (and for V2, which was the original purpose) 2010-07-07 18:32:45 +12:00
Chris Forbes
68b63dc89e ralint: verify voices, support (and still verify) @-form prerequisites. 2010-07-04 14:50:26 +12:00
Chris Forbes
8e68449af1 voices are no longer tied to having Unit; default is to have no voice; defaults.yaml set up appropriately for units that should have one. 2010-07-04 14:25:34 +12:00
Chris Forbes
35b6f5c38b don't download the mixes if you already have them; split cg deps into /releases/windows/cg-win32.zip (1.5M) 2010-07-04 10:23:18 +12:00
Chris Forbes
8d88d73e53 hack windows installer to NOT reinstall freetype,zlib,sdl on upgrade 2010-07-03 10:56:06 +12:00
Chris Forbes
8018fa0aec please don't have insane options as the hardcoded default. that's what your personal settings file is for. 2010-07-01 19:04:07 +12:00
Chris Forbes
5bec019d55 add RALint checking to nearly everything 2010-07-01 18:57:10 +12:00
Chris Forbes
8974fb7ae8 hack the RALint output format so VS shows errors as errors. Source position would be nice too, but that requires actual work. 2010-07-01 18:34:27 +12:00
Chris Forbes
2d9e5c6fcd remove spam on loading RA MIX headers; add some more bits to RALint 2010-07-01 18:31:13 +12:00
Chris Forbes
c310713cd5 beginning of RALint 2010-07-01 13:11:32 +12:00
Paul Chote
521e6b8549 Log when something hits the path cache 2010-06-30 20:39:52 +12:00
Paul Chote
4c3930043e Reenable path cache to catch the most stupid path fails (doesn't help the most common fails) 2010-06-30 20:25:32 +12:00
Paul Chote
202d1a38d5 Specify valid filetypes in tilesets 2010-06-30 20:25:32 +12:00
Paul Chote
9ca9d9a47e Fix country names in lobby 2010-06-30 20:25:32 +12:00
Paul Chote
e5ce9196fa Nicer tooltips 2010-06-30 20:25:32 +12:00
Chris Forbes
51079f0876 add LevelUpCrateAction 2010-06-30 18:33:19 +12:00
Chris Forbes
c605a35ab0 only kill units on bridge death which cannot exist on their cell(s)' new terrain types 2010-06-30 18:11:39 +12:00
alzeih
aa64803f84 hacky chat line wrapping 2010-06-30 18:00:47 +12:00
Chris Forbes
7070b04cc9 new 1tnk concept; 2tnk/3tnk owners swapped back 2010-06-30 17:59:52 +12:00
Paul Chote
272e03603a Kill any units on a bridge piece when it dies. Todo: need to mask the death regions for cnc bridges 2010-06-28 13:05:52 +12:00
Paul Chote
797b1b4a84 Non-selectable fields in ra 2010-06-28 12:41:45 +12:00
Paul Chote
915c9460cf Theater specific artwork done properly 2010-06-28 12:38:35 +12:00
Paul Chote
b46cec91a8 Fix cnc shellmap uid 2010-06-28 00:24:04 +12:00
Paul Chote
15a72e893b Quick hack for theater-specific artwork. Should probably be done better; editor support required. 2010-06-28 00:23:58 +12:00
Paul Chote
560c3ce5af Regress the editor so it actually works 2010-06-27 23:59:54 +12:00
Paul Chote
dfb6d19646 Add missing road end to oasis 2010-06-27 23:19:41 +12:00
Paul Chote
4def9e0eae Fix Editor 2010-06-27 23:14:43 +12:00
Paul Chote
703d536e46 Map object polish (tooltips + pruning) 2010-06-27 23:13:30 +12:00
Paul Chote
b12b774deb Kill some obsoleted data 2010-06-27 22:39:02 +12:00
Paul Chote
f37a4ec9ed Add bridges to cnc 2010-06-27 17:50:05 +12:00
Paul Chote
25f2268f58 Bridge destruction etc works 2010-06-27 15:58:57 +12:00
Paul Chote
cdbe2d3a34 Friendly tree tooltips 2010-06-27 11:02:54 +12:00
Paul Chote
c5718456fd First half of bridge overhaul 2010-06-27 10:59:01 +12:00
Paul Chote
9a34b049a8 Reverse ra bridge metadata 2010-06-26 22:23:05 +12:00
Paul Chote
49d7833b04 Fix editor 2010-06-26 14:56:51 +12:00
Paul Chote
920b4f6856 Fix ra 2010-06-26 13:41:50 +12:00
Paul Chote
d275c72cb8 Cleaner TileSet init 2010-06-26 13:33:46 +12:00
Paul Chote
08ee425415 Fix some stupid bugs; remove hardcoded references to water/ore/tree terraintypes 2010-06-26 12:02:30 +12:00
Paul Chote
bf6b2da1a8 Unhardcode terrain types. Needs a bit more work re initialization and bridges 2010-06-26 10:55:29 +12:00
Paul Chote
8fbbaddce9 Merge all 4 tileset files together 2010-06-26 09:21:11 +12:00
Paul Chote
9cf6d8970a Merge templates.ini and tileset.til into theatre-specific yaml files.
Game doesn't use them yet.
2010-06-26 00:19:34 +12:00
Paul Chote
cf265c8b58 Fix ra 2010-06-25 23:07:11 +12:00
Paul Chote
2373528ad9 Kill UnitMovementType; bs-free crate spawning; fix "DOME crash" (caused by crate not IOccupying space); add money and hide-map crates to cnc 2010-06-25 21:58:09 +12:00
Paul Chote
7c3a10396c New crush code, now with less bs 2010-06-25 20:57:06 +12:00
Paul Chote
00b91bd7ad Reimplement ICustomTerrain with far less bs 2010-06-25 19:26:08 +12:00
Paul Chote
29fa9e3aeb Shift movement cost/speed into IMove; regressions in a few areas 2010-06-25 17:05:56 +12:00
Paul Chote
6a5869f2c6 Begin cleaning up terraintypes/movetypes 2010-06-25 15:52:12 +12:00
Paul Chote
7ac8d0cf59 Units automatically path around known hazards (eg static base defenses). Test using SAM and TRAN.
Todo: Ignore hazards when force-moving; Apply only to known enemy hazards; Implement more hazard classes

Also add a few files I forgot from previous patches
2010-06-25 13:53:37 +12:00
Paul Chote
0aeca2aadc Helicopters use pathfinder 2010-06-24 21:51:22 +12:00
Paul Chote
37cf30a097 Refactor Mobile.TeleportTo -> IMove.SetPosition 2010-06-24 21:51:22 +12:00
Paul Chote
3e664779ef Remove a bunch of unnecessary caching 2010-06-24 21:51:22 +12:00
Paul Chote
b42589b479 Fix vehicle production; Basic 5-to-a-cell logic. cnc only. Infantry stack; need to give a graphical offset. 2010-06-24 21:51:22 +12:00
Paul Chote
b7c8e55d14 Some initial hacks towards multiple-infantry-per-cell. Make the pathfinder smart enough to do what we need, and remove a *lot* of stupid duplication. Needs more work. 2010-06-24 21:51:22 +12:00
Chris Forbes
308a7b0cf6 remove hardcoded magic number 2010-06-24 21:51:22 +12:00
Chris Forbes
0cf39991db new range circle renderer; faster minefield renderer 2010-06-24 21:51:21 +12:00
Chris Forbes
b8093b7f6c removing a bunch of excessively low-level pixel -> cell conversions 2010-06-24 21:51:21 +12:00
Chris Forbes
2dcc85f608 fix aircraft so it actually works again 2010-06-24 21:51:21 +12:00
Chris Forbes
e56339897f add additional debug to WorldRenderer.DrawUnitPath so we can see waypoint density, etc 2010-06-24 21:51:21 +12:00
Paul Chote
7d717592c7 Rename IMovement -> IMove; Move GetCurrentPath from Mobile to IMove and implement for aircraft; fix regressions in Helicopter (ITick) and remove unused cruft from Aircraft (IOccupySpace). 2010-06-24 21:51:21 +12:00
Paul Chote
3be5b946ad Flesh out center of the map 2010-06-24 21:51:21 +12:00
Paul Chote
1592225855 WIP cnc map (note: editor needs better work-loss prevention) 2010-06-24 21:51:21 +12:00
Paul Chote
bdb77501f7 More Helicopter polish 2010-06-24 21:51:21 +12:00
alzeih
37ffd2207f Fix game locking up on crash. 2010-06-23 22:04:17 +12:00
Chris Forbes
5dcc7782d9 make editor use pickany metadata 2010-06-20 18:45:47 +12:00
Paul Chote
aff357db0b Actually render resources when shroud is disabled 2010-06-20 18:34:06 +12:00
Chris Forbes
c1aa25e307 add 'pickany' flag in TileTemplate 2010-06-20 18:32:21 +12:00
Chris Forbes
a4f694e51a that was horrible. beef up v2 so it can fill that role better 2010-06-20 18:15:04 +12:00
alzeih
a1ffb68e22 bugfix 2010-06-20 17:48:20 +12:00
Booom3
a00a5433e4 balance stick 2010-06-20 17:31:37 +12:00
Chris Forbes
5242854892 unfail crates 2010-06-20 13:22:23 +12:00
Chris Forbes
17a45a0d6c fix destroyer missile range 2010-06-19 20:26:29 +12:00
Booom3
0195e54c8c Updated testmap 2010-06-19 10:24:57 +02:00
Chris Forbes
04c07ed88b fix prereqs for 3tnk 2010-06-19 19:58:29 +12:00
Chris Forbes
542ec65f10 buff 3tnk hp to match its new role 2010-06-19 19:56:40 +12:00
Chris Forbes
a457b1f133 swap 2tnk and 3tnk owners 2010-06-19 19:55:17 +12:00
Chris Forbes
8f897f7840 nerf CA a bit, esp vs unarmored 2010-06-19 19:47:50 +12:00
Chris Forbes
68ce0d89e6 more jeep tuning 2010-06-19 19:33:57 +12:00
Chris Forbes
b719271f6f make jeep decent vs infantry and crap vs everything else 2010-06-19 19:24:06 +12:00
Chris Forbes
4d8238cd32 reintroduce dome for soviet 2010-06-19 19:20:55 +12:00
Chris Forbes
87973f9ef3 fix bug in prev 2010-06-19 15:23:30 +12:00
Chris Forbes
c3490fcb66 buildings under fog 2010-06-19 15:17:48 +12:00
Chris Forbes
75bfedecb2 more heli polish (paul) 2010-06-19 15:06:02 +12:00
Chris Forbes
66adbee2a6 moving Actor.Location onto the appropriate traits (bob) 2010-06-19 14:37:06 +12:00
Chris Forbes
db465e1fdd ActorInitializer, in preparation for next change (bob) 2010-06-19 14:28:30 +12:00
Chris Forbes
572cdc9dbf vacate cells earlier 2010-06-18 22:36:24 +12:00
Chris Forbes
0ef91ecc2d hack around crash on boat repair 2010-06-18 20:55:06 +12:00
Chris Forbes
0c25924789 the Tao.SDL docs are wrong; the params are backwards. working keyrepeat, kthx. 2010-06-18 20:21:45 +12:00
Booom3
d58f2de090 Test map 2010-06-18 19:58:25 +12:00
Chris Forbes
c83f78f259 fix it on nonwindows too 2010-06-18 18:34:33 +12:00
Chris Forbes
8afb17c3f5 default somewhere sensible in editor (by not failing at '\') 2010-06-18 18:33:06 +12:00
Chris Forbes
abc7b21994 add logos to cnc 2010-06-18 18:18:02 +12:00
alzeih
beec39daa4 fixing bug on loading shellmap 2010-06-18 17:42:19 +12:00
alzeih
2da06d3744 Avoid Sharing Violations in logs 2010-06-18 16:25:12 +12:00
alzeih
5922a6c446 Stop printing arrow keys etc , and print repeated keys faster 2010-06-18 16:04:30 +12:00
alzeih
981a6b65a7 Fix server crashing when server order fails to deserialise. 2010-06-18 16:03:24 +12:00
alzeih
d6c83eddbd truncate name if longer than 10 chars 2010-06-18 14:46:16 +12:00
Paul Chote
331706d75e Fix crash on repair non-buildables (fact,proc). Allow special powers to depend on them too. 2010-06-17 23:48:00 +12:00
Paul Chote
4b124950b9 Unlimit heli ammo; may make orca OP 2010-06-17 23:19:34 +12:00
Paul Chote
212b3259fe Try some tweaks 2010-06-17 22:25:30 +12:00
Chris Forbes
33971c06a6 fix crash in Activities.Repair 2010-06-16 22:42:22 +12:00
Paul Chote
81d5b9bc6a Fix stupid crash 2010-06-16 21:48:15 +12:00
Paul Chote
a0e4e40eaf Fix e6 2010-06-16 21:13:20 +12:00
Chris Forbes
1088e30158 fix small bug in BuildPaletteWidget - incorrectly used cash rather than cash+ore 2010-06-16 20:27:51 +12:00
Paul Chote
f3dc3b1da0 Recover gracefully if proc goes away while harv is docking 2010-06-16 20:22:11 +12:00
Chris Forbes
5f58379f5b reenable cash sounds; if you want to disable them for your mod, don't set those evaAlerts properties. (as done in cnc); add SplitOreAndCash property to MoneyBinWidget, restoring old RA behavior (cnc is unchanged) 2010-06-16 20:18:01 +12:00
Paul Chote
01e95b67d6 Restore ra proc behavior 2010-06-16 20:00:38 +12:00
Paul Chote
5ed8113d8e Steal docked harv on proc capture (needs multiplayer testing); framework for canceling dock on proc death/sell (needs further activity changes) 2010-06-16 19:47:15 +12:00
Paul Chote
f0a2bf128c Harvesters return to last used field 2010-06-16 19:22:59 +12:00
Paul Chote
5822caf7a8 Fix cancellation issues and animation flicker 2010-06-16 10:37:54 +12:00
Paul Chote
40ba80b1e3 Use palette indices that map to sane colors in both games. 2010-06-16 01:18:09 +12:00
Paul Chote
88df9ecaa2 Implement cnc harv/proc dock sequence and kill unnecessary duplication. Bad things happen if sequence is interrupted by another order (eg invisible harv).
Still todo: Make sequence non-interruptible; engineer steals harv docked with proc; the "right thing" if proc is sold/destroyed with harv docked.
2010-06-16 00:33:09 +12:00
Paul Chote
5f83f97747 Link harvesters with refineries. 2010-06-15 20:05:49 +12:00
Paul Chote
f4421d89ea Fix tooltip crash on non-buildable prereq 2010-06-15 18:17:40 +12:00
Paul Chote
48cf08dc7d proc comes with 2 free silos; fix silo/proc prereq 2010-06-15 11:17:36 +12:00
Paul Chote
e3de3cc0d2 Make c17 invulnerable 2010-06-15 11:17:36 +12:00
Chris Forbes
c3e15aab7d hacky fix for productionqueue desync (e3, etc) 2010-06-15 08:42:40 +12:00
Chris Forbes
0e0a8802ab enhance sync to work with nested syncable types, and properties 2010-06-15 01:15:41 +12:00
Paul Chote
06a78cd73d Deathweapon capability, refactoring, and Pip polishing on Silo, Proc, Harv. Lose ore on silo death. 2010-06-14 22:15:43 +12:00
Paul Chote
d36c8deb97 Fix Explodes 2010-06-14 21:36:52 +12:00
Paul Chote
24edba34a7 Remove thief; transfer ore along with stolen silo/proc. 2010-06-14 20:59:35 +12:00
Paul Chote
283512f314 Spend ore before cash; lose ore > capacity. 2010-06-14 20:59:35 +12:00
Chris Forbes
6f3667971a remove targeting of husks. has map design impact, since chokepoints can be filled now 2010-06-14 20:48:49 +12:00
Chris Forbes
24d9b44a66 non-crap music player buttons 2010-06-14 20:44:35 +12:00
alzeih
9425fb1def Fix unnecessary duplication and get a better UI out of it 2010-06-14 14:05:20 +12:00
alzeih
889d736d35 Use images for music player (public domain - but find better ones) 2010-06-14 01:37:58 +12:00
alzeih
7b837fd6c4 Prevent changes when marked as ready 2010-06-14 00:55:22 +12:00
alzeih
3ac0ca6a65 BuildPalette tooltips show build time (+ in red if in low power) 2010-06-14 00:18:36 +12:00
Paul Chote
fbeadb9869 Increase vehicle sight; don't crash on production 2010-06-13 22:00:39 +12:00
Paul Chote
2e094d3279 Add fuel to missiles 2010-06-13 22:00:39 +12:00
Paul Chote
a771e63603 Revamp tech tree and build palette ordering 2010-06-13 22:00:39 +12:00
Paul Chote
de6434c0f1 Use the same model for ra (but let proc hold ore as before) 2010-06-13 22:00:39 +12:00
Paul Chote
dc8178f984 Tweaks 2010-06-13 22:00:39 +12:00
Paul Chote
aba5c777db The original method worked better; take the best of both worlds 2010-06-13 22:00:39 +12:00
Paul Chote
640ac9b8e6 Trial a new resource model in cnc 2010-06-13 22:00:05 +12:00
Paul Chote
19ed7428c4 Reorder build palette 2010-06-13 21:59:10 +12:00
Paul Chote
6afc34e5c1 SAM Site 2010-06-13 21:59:10 +12:00
Paul Chote
48bc029174 Set building health to cncrules.ini values 2010-06-13 21:59:09 +12:00
Chris Forbes
09b58f46d9 remove some spikes 2010-06-13 21:42:14 +12:00
alzeih
3001d58ba0 text has colour 2010-06-13 21:39:08 +12:00
alzeih
f0ea329b2c Fix crash if no music 2010-06-13 21:10:23 +12:00
Chris Forbes
2890d29e7d ra faction flags prototype 2010-06-13 21:07:27 +12:00
Chris Forbes
5b40d4444a add soviet logo 2010-06-13 19:39:08 +12:00
Chris Forbes
215ca80713 adjust ra ui layout so flags are not flush with left of button 2010-06-13 19:15:28 +12:00
Chris Forbes
27902bc48a clickable spawnpoint polish 2010-06-13 19:09:08 +12:00
alzeih
5d66c6b7ba Tweak flag size, kill Spawn button. 2010-06-13 19:03:02 +12:00
alzeih
1a20249f44 Basic ImageButton for drawing flags 2010-06-13 18:03:17 +12:00
Paul Chote
5e630768a2 Missed a file 2010-06-13 17:01:52 +12:00
Paul Chote
a273f7f07e Defense queue 2010-06-13 17:00:18 +12:00
Paul Chote
3b4753d9a8 Fix aircraft targeting; add veterancy 2010-06-13 17:00:18 +12:00
Paul Chote
8397bc12b5 Tweak special powers 2010-06-13 17:00:18 +12:00
Paul Chote
77510b4bef STNK desc 2010-06-13 17:00:18 +12:00
Paul Chote
b0802466b2 tib tree animations 2010-06-13 17:00:18 +12:00
Chris Forbes
c4d143b729 completing alzeih's patch 2010-06-13 16:34:01 +12:00
alzeih
d2da37f026 start of clicking on spawn points, compile fail still 2010-06-13 16:17:00 +12:00
Chris Forbes
6774486027 cnc: htnk.husk looks like a htnk now, not ltnk. 2010-06-13 15:57:56 +12:00
Paul Chote
2f99bf5ba5 FACT tooltip 2010-06-13 15:42:46 +12:00
Paul Chote
e5ee2b9479 Heli pips and separation 2010-06-13 15:39:00 +12:00
Paul Chote
3edbfc3345 Fix TMPL footprint 2010-06-13 14:32:55 +12:00
Paul Chote
b168bc2365 FIX after vehicle structure; NUK2 after HQ 2010-06-13 14:25:56 +12:00
Paul Chote
196316f36c Fix tib tree sequences 2010-06-13 11:45:19 +12:00
Paul Chote
b50ad94efb Tweak helicopter movement / attack 2010-06-13 11:34:33 +12:00
Paul Chote
a7f5c4b03a Hack a screenshot key in 2010-06-13 00:33:13 +12:00
Chris Forbes
7812e1c314 don't fail with offscreen impacts 2010-06-13 00:25:14 +12:00
Chris Forbes
3c95a2886c hack hack 2010-06-13 00:04:14 +12:00
Paul Chote
7c34252cff cnc GDI gets e3, exclusive RMBO; increase building sight; starting cash to 5000 2010-06-12 23:34:49 +12:00
Chris Forbes
4c955c36e7 fix retarded crash in WorldUtils.IsVisible 2010-06-12 23:07:55 +12:00
Chris Forbes
bcf7328d77 a bit of cleanup 2010-06-12 21:48:52 +12:00
Chris Forbes
02350e6ac8 unbitrot cnc (editor); add mod name to editor title 2010-06-11 18:23:03 +12:00
Chris Forbes
ee0f90708f put perf in its own channel 2010-06-11 18:15:59 +12:00
Chris Forbes
5d823d8e6e fix some debug-channel stuff that beedee missed in rebase 2010-06-11 18:00:36 +12:00
Chris Forbes
3870be5122 fix various breakage in nuke code 2010-06-11 17:55:42 +12:00
Chris Forbes
1bd7a9b590 visualize minefields in OG 2010-06-11 17:53:35 +12:00
Chris Forbes
e60acc682a add logging to ProductionItem 2010-06-11 17:53:34 +12:00
Matthew Bowra-Dean
aa239d172d Log channels, PHP script diffs when told. 2010-06-10 12:50:22 +12:00
Matthew Bowra-Dean
5f48577ebc upload.php now groups log files into zip files by game ID. 2010-06-10 12:48:06 +12:00
Matthew Bowra-Dean
fd014e15a5 Support for master game ID. 2010-06-10 12:45:58 +12:00
Matthew Bowra-Dean
1839655eb5 Master server changes to add ID to schema. 2010-06-10 12:43:46 +12:00
Matthew Bowra-Dean
e7c7a117a8 Log uploading. 2010-06-10 12:43:45 +12:00
Chris Forbes
a6d0adbab3 fix perf of uim overlay so it's usable again 2010-06-03 20:54:44 +12:00
alzeih
52c69addc6 RA AFLD requires power and can be powered down 2010-05-31 20:28:39 +12:00
Bob
493dec031b allow queueing on Mobile 2010-05-31 14:24:35 +12:00
Bob
1e570b5edb added Queued field to order 2010-05-31 14:20:25 +12:00
unknown
f2bcf1afae Added support for keyboard scrolling 2010-05-30 14:27:53 +12:00
alzeih
b45c74fa0b meh 2010-05-30 14:12:10 +12:00
alzeih
f946382e38 Split Radar and Power widgets 2010-05-30 14:06:50 +12:00
Chris Forbes
5a5fa37397 fix up cnc nuke enough that it should WORK 2010-05-30 13:45:03 +12:00
Chris Forbes
c531343481 fix GUN sequences 2010-05-30 13:45:03 +12:00
Chris Forbes
b57ebcffea fix damaged state for agun 2010-05-30 13:45:02 +12:00
Chris Forbes
f89e9f6d06 unbitrot cnc 2010-05-30 13:45:02 +12:00
Chris Forbes
b5327a2cb7 add tire particle sprite (4 frames) 2010-05-30 13:45:01 +12:00
Chris Forbes
d379a1f78b increase barr/tent cost to 500 2010-05-30 13:45:01 +12:00
Chris Forbes
90e1e0e796 make 4tnk meatier 2010-05-30 13:45:00 +12:00
Chris Forbes
f3a0c94eb5 change starting cash to 5k 2010-05-30 13:45:00 +12:00
Chris Forbes
540a2da82a fix stupid desync in minelayer 2010-05-30 13:44:59 +12:00
Bob
8285c7d158 refactoring Widget 2010-05-29 18:01:36 +12:00
Chris Forbes
ac10ca3fad add some more logging to help track down this jealous desync bug 2010-05-29 12:13:09 +12:00
Chris Forbes
d824373853 housekeeping in paradrop 2010-05-29 11:59:55 +12:00
Chris Forbes
94e8edb1cd fix crash in TeslaInstantKills 2010-05-29 09:43:07 +12:00
Chris Forbes
b61db88402 fix sequences for hbox 2010-05-28 19:55:37 +12:00
Chris Forbes
9b11e79592 blame nuke damage on the player actor, not the silo, to prevent retaliation 2010-05-28 19:48:34 +12:00
Chris Forbes
2ca9a936a3 hack in facing management of turrets on husks, + some angular velocity 2010-05-28 19:43:45 +12:00
Chris Forbes
584a7091db add death voices for civilians 2010-05-27 22:27:03 +12:00
Chris Forbes
c1f76da011 fix U2 crashing due to GainsExperience but not prereqs 2010-05-27 22:25:41 +12:00
Chris Forbes
ba850ec3f1 improve error message in ActorInfo.TraitsInConstructOrder 2010-05-27 22:17:15 +12:00
Chris Forbes
04dceb4417 turn down veterancy bonus a bit 2010-05-27 22:04:25 +12:00
Chris Forbes
996344ea6e fix crash in EmitInfantryOnSell when destroying things that are not Valued 2010-05-27 22:02:36 +12:00
Chris Forbes
a259a0aca0 hack in rank overlay; fix last rank; add an extra (elite) rank 2010-05-27 21:40:45 +12:00
Chris Forbes
a399e0b682 strip 'locate game root' crap from game & editor; chrono both CAs 2010-05-27 21:13:35 +12:00
Chris Forbes
ce9f7666b4 make build process saner (emit binaries into root rather than spray them through /bin/Debug/) 2010-05-27 20:59:02 +12:00
Chris Forbes
4dcc65237d slightly reduce recoil again on ca 2010-05-27 20:12:40 +12:00
Chris Forbes
8ca03da277 add impact sounds to ca weapon 2010-05-27 19:10:41 +12:00
Chris Forbes
3f32275169 give ca dual barrels on each turret 2010-05-27 19:08:56 +12:00
Chris Forbes
230625897a hack CrateEffect to have a custom offset; add levelup.shp; change > to >= in GainsExperience 2010-05-27 19:02:07 +12:00
Chris Forbes
1bd9dc7536 increase default thresholds 2010-05-27 18:43:30 +12:00
Chris Forbes
294240de7f fix missing prereq on GainsExperience; List -> array; float -> int 2010-05-27 18:35:44 +12:00
Chris Forbes
0c8e8b5658 fix tk detection; fix crash on lacking ValuedInfo; fix traits being fetched twice; fix needless mutation of 'exp' 2010-05-27 18:31:42 +12:00
Paul Chote
a070820695 Hack in trait modifiers. Probably not the best approach. 2010-05-27 17:22:26 +12:00
Paul Chote
c15d721884 Units gain exp for kills and level up 2010-05-27 16:53:21 +12:00
Paul Chote
c792ce5686 Disconnect button in lobby (#191) 2010-05-26 21:39:06 +12:00
Paul Chote
49b1870eaa Nuke flash (fixes #16) 2010-05-26 21:26:49 +12:00
Paul Chote
a35d6207a9 Scriptable chronosphere + desaturate effect 2010-05-26 21:07:13 +12:00
Paul Chote
9dc8422adf Scriptable MSLO and shellmap win 2010-05-26 20:40:50 +12:00
Paul Chote
b286a71487 Add some combat to the shellmap; unfail init slightly 2010-05-26 20:40:49 +12:00
Chris Forbes
92ba40da1a floodfill in editor on holding 'shift' 2010-05-26 19:47:46 +12:00
Chris Forbes
270941cfde fix some fail desyncs in chronoshift code 2010-05-26 19:02:43 +12:00
Chris Forbes
e7b7f69caf housekeeping 2010-05-26 18:10:43 +12:00
Chris Forbes
878039fc4a fix tesla hax with a different style of tesla hax 2010-05-25 21:15:25 +12:00
Chris Forbes
fcea5bd2f0 multipath lightning - shows up some flaws in the lightning code, though 2010-05-25 20:23:50 +12:00
Chris Forbes
e8829f8e92 reduce CA damage slightly 2010-05-24 22:15:01 +12:00
Chris Forbes
081d1cdafc buff sam to be ~agun 2010-05-24 21:41:55 +12:00
Chris Forbes
f3a73fa53d slightly buff mig hp so it should survive one more rocket 2010-05-24 21:41:55 +12:00
Chris Forbes
81ccc6a0c8 nerf heli/hind hp & armortype 2010-05-24 21:41:54 +12:00
Chris Forbes
08756b7b4c reduce frequency of hidemap crate by 50% 2010-05-24 21:41:54 +12:00
Chris Forbes
5c9d6362c1 nerf money crate 2k -> 1k 2010-05-24 21:41:53 +12:00
Chris Forbes
d109dad4a2 change crate spawn interval to 2 minutes, not 20 seconds 2010-05-24 21:41:53 +12:00
Paul Chote
f5b313b5e8 blah 2010-05-24 21:29:16 +12:00
Paul Chote
7ef2ed1434 Actors as dict 2010-05-24 21:18:54 +12:00
Paul Chote
2dfa4d9db7 MapFormat = 1 and editor support 2010-05-24 21:18:54 +12:00
Paul Chote
78455a3dce IsSpecial -> NonCombatant 2010-05-24 21:18:53 +12:00
Paul Chote
35ca5f80b2 Nits. 2010-05-24 21:18:53 +12:00
Paul Chote
9837b4ce32 Fix map-player ctor. 2010-05-24 21:14:36 +12:00
Paul Chote
a6f5b12a55 world.NeutralPlayer has been defeated 2010-05-24 21:14:36 +12:00
Paul Chote
bbbd65a6eb Fix regressions. 2010-05-24 21:14:36 +12:00
Paul Chote
d9931af5ae First attempt; works, but has regressions in several areas 2010-05-24 21:14:36 +12:00
Chris Forbes
b8b3ef61aa fix dumb oversight when choosing a suitable fix 2010-05-24 21:10:13 +12:00
Chris Forbes
e850937022 make minelayer require force-attack to start minefield (otherwise move); return to fix and rearm/repair before heading out again 2010-05-24 21:10:13 +12:00
Chris Forbes
5ca590a16a working smart minelayer; needs auto-rearm though 2010-05-24 21:10:12 +12:00
Chris Forbes
f77c12e9a0 cleanup some leftover crap from StatelessTraitInfo<> fail 2010-05-24 21:10:12 +12:00
Chris Forbes
431bbe2764 remove spurious IProducer interface; add IBlocksBullets and move Wall 2010-05-24 21:10:11 +12:00
Chris Forbes
224489502e fix weird crap in ConstructionYard (badly named: just undeploys) 2010-05-24 21:10:11 +12:00
Chris Forbes
027d7e2c2b filtering of unusable cells in minefield support; rationalize mobile a bit 2010-05-24 21:10:10 +12:00
Chris Forbes
9dd1032683 generate a vaguely reasonable minefield locus 2010-05-24 21:10:10 +12:00
Chris Forbes
baf37f7d04 start of smart minelayer 2010-05-24 21:10:09 +12:00
Chris Forbes
bb289101fc improve perf somewhat for editor map loading 2010-05-24 20:59:59 +12:00
Chris Forbes
6cbebeebd5 'fix' interior for now, with the hack documented this time 2010-05-24 20:52:15 +12:00
Chris Forbes
e5bb541824 unhack some hacks in editor 2010-05-24 08:18:11 +12:00
Chris Forbes
4d7de9e790 type inference is fine too 2010-05-23 15:45:57 +12:00
Chris Forbes
87d7fd163b blah 2010-05-23 12:06:30 +12:00
Chris Forbes
b662cebfb8 clean up some old BS in SpriteSheetBuilder 2010-05-21 12:37:22 +12:00
Chris Forbes
630aee7b98 fix namespaces on stuff bob moved 2010-05-20 19:44:38 +12:00
Chris Forbes
560c41bf42 fix bad merge 2010-05-20 19:39:22 +12:00
Chris Forbes
40f981a80d blah 2010-05-20 19:35:50 +12:00
Bob
e9799ffdfa move CanPowerDown, PowerDownButton, and 3 IOGs 2010-05-20 19:33:10 +12:00
Chris Forbes
7609097f4f move render modifiers to ra 2010-05-20 19:26:09 +12:00
Chris Forbes
91a4ac5faf move victory conditions 2010-05-20 19:21:09 +12:00
Chris Forbes
586d5ec11e housekeeping 2010-05-20 19:19:28 +12:00
Chris Forbes
3276a4f557 moved Reservable to ra 2010-05-20 19:15:24 +12:00
Chris Forbes
9215fa4d28 moved CallFunc, Wait activities to ra 2010-05-20 19:14:16 +12:00
Chris Forbes
43eb4b03ea moved Follow to ra 2010-05-20 19:11:05 +12:00
Chris Forbes
1d0848466f moved most render bits to ra 2010-05-20 19:09:48 +12:00
Chris Forbes
b0d2bf2e51 moved air unit support to ra 2010-05-20 18:54:44 +12:00
Chris Forbes
7fc5007ac8 moved various other traits 2010-05-20 18:47:22 +12:00
Chris Forbes
f75a2d2fe6 moved infantry traits to ra 2010-05-20 18:41:24 +12:00
Chris Forbes
be974f7970 moved almost all Attack* to ra 2010-05-20 18:37:36 +12:00
Chris Forbes
d008fd9eed moved AutoTarget/AutoHeal to ra 2010-05-20 18:28:57 +12:00
Chris Forbes
b1327378ed moved CrateSpawner 2010-05-20 18:20:19 +12:00
Chris Forbes
7910f3fe54 moved ReturnOnIdle to ra 2010-05-20 18:18:25 +12:00
Chris Forbes
e5951b1502 moved bridge support into ra 2010-05-20 18:16:09 +12:00
Chris Forbes
4585addff2 move water & light palette manips into ra 2010-05-20 18:12:13 +12:00
Chris Forbes
d3332a7454 fix crash due to bad GeneratesGap removal 2010-05-20 18:08:56 +12:00
Chris Forbes
5deea6df93 move crate support to ra 2010-05-20 18:06:01 +12:00
Chris Forbes
561a2a86d0 moved Explodes to RA 2010-05-20 17:59:54 +12:00
Chris Forbes
99acb65502 removed GeneratesGap 2010-05-20 17:58:13 +12:00
Chris Forbes
248eba20fa EmitInfantryOnSell moved to RA 2010-05-20 17:56:44 +12:00
Chris Forbes
342ef2a498 removed SquishByTank 2010-05-20 17:47:12 +12:00
Chris Forbes
a33bb7bd8a move HasUnitOnBuild to RA 2010-05-20 17:41:07 +12:00
Chris Forbes
50cc18d1f4 moved SelfHealing to RA 2010-05-20 17:35:15 +12:00
Chris Forbes
ed21b3be8d moved cargo-related traits to ra 2010-05-20 17:28:48 +12:00
Chris Forbes
151f5acb2f remove spurious 'set' on IDisable and associated BS implementations 2010-05-20 12:55:29 +12:00
Chris Forbes
f9a2c20eee stop shooting the flares ! 2010-05-19 22:19:33 +12:00
Chris Forbes
e910ab87a1 buff turret gun to 50dps (60@30) 2010-05-19 21:06:43 +12:00
Chris Forbes
a49efda001 fix longdesc for afld 2010-05-19 20:37:47 +12:00
Chris Forbes
55a58394e4 instrument FindUnitsInCircle for perf 2010-05-19 20:13:01 +12:00
Chris Forbes
76bcd7cb26 cnc: make hq a detector, range=8 2010-05-19 19:47:38 +12:00
Chris Forbes
5adfd908c4 cnc: add range circles to defenses 2010-05-19 19:45:32 +12:00
Chris Forbes
82c895adee cnc: gtwr/atwr are now detectors 2010-05-19 19:44:17 +12:00
Chris Forbes
382636a3ba add AffectOwnUnits flag to DetectCloaked 2010-05-19 19:40:55 +12:00
Chris Forbes
3cbd62c6ec fix combat vs subs 2010-05-19 19:38:50 +12:00
Chris Forbes
7a426778d4 don't show cloaked units that are not your own, on the minimap 2010-05-19 19:35:17 +12:00
Chris Forbes
490d8d5a5f make autotarget not interested in cloaked units; make ss a normal ship (but cloaked) rather than its own unit type 2010-05-19 19:30:26 +12:00
Chris Forbes
b9ca655756 fix asymmetric stance interaction with decloak 2010-05-19 19:22:09 +12:00
Chris Forbes
47af8fc8f2 detectors 2010-05-19 19:20:31 +12:00
Chris Forbes
a6a1c1aabc if we've been forced to decloak, don't cut it short with another decloak 2010-05-19 18:40:38 +12:00
Chris Forbes
5c7838bafa sub stays uncloaked for 2s; submarine/cloak traits merged, since they do the same thing 2010-05-19 18:39:08 +12:00
Chris Forbes
56ec24a84e unbitrot cnc (due to bob's techtree changes) 2010-05-18 21:18:34 +12:00
Paul Chote
3475712075 Make PDOX/IRON worth building(?) 2010-05-18 20:18:05 +12:00
Paul Chote
78aa7bb3a9 Soviets DOME -> AFLD 2010-05-18 20:18:02 +12:00
Paul Chote
5c48465c65 Goodbye fake structures 2010-05-18 20:17:57 +12:00
Paul Chote
25a01adc27 Half of editor makefile support (resources file needs to be built manually with resgen2 OpenRA.Editor/Form1.resx Form1.resources) 2010-05-17 20:34:23 +12:00
Chris Forbes
12467b713b unhack buildspeed AGAIN 2010-05-16 22:24:03 +12:00
Bob
7deefc5246 debug (timing) spam, and perf fixed on SupportPower
Build timing (un)hacked by chrisf
2010-05-16 22:23:36 +12:00
Chris Forbes
de9ec12c8c order names stuff to remove clashes in ra-nng 2010-05-16 22:15:41 +12:00
Chris Forbes
9d5eab74b1 cnc: htnk tuning 2010-05-16 21:38:24 +12:00
Chris Forbes
69fbc68cfd add tank husks to ltnk/mtnk/htnk in cnc 2010-05-16 21:37:42 +12:00
Chris Forbes
cf76e9d893 add husk default for cnc 2010-05-16 21:34:07 +12:00
Chris Forbes
9fdc79bc49 add fire sequences to cnc 2010-05-16 21:32:39 +12:00
Chris Forbes
7e754a5590 husks should not be mobile 2010-05-16 16:30:49 +12:00
Chris Forbes
128f12e88e hack in team chat support 2010-05-16 16:18:27 +12:00
Chris Forbes
d87807809d disable group spam on console; put speed back to something sensible 2010-05-16 16:09:37 +12:00
Chris Forbes
c173dddcd5 remove AutoTarget from v2, until we have unit stances (otherwise v2 is useless) 2010-05-16 15:43:48 +12:00
Chris Forbes
362525cb94 v2 explodes with napalm if it dies while loaded 2010-05-16 15:42:59 +12:00
Chris Forbes
c7b2ac3d3f a bit of housekeeping fail 2010-05-16 15:21:42 +12:00
Chris Forbes
7c244df5d1 add burning 2010-05-16 15:20:14 +12:00
Chris Forbes
67d741e671 unfail recoil directions (wtf) 2010-05-16 15:05:01 +12:00
Chris Forbes
99e7ee23fb tanks explode much more satisfyingly 2010-05-16 14:46:07 +12:00
Chris Forbes
8e46f99ab9 make it actually sortof work 2010-05-16 12:53:20 +12:00
Chris Forbes
c20a1cc70a synced group creation 2010-05-16 12:08:37 +12:00
Chris Forbes
b871caa287 add receiving end of CreateGroup order 2010-05-16 11:41:56 +12:00
Chris Forbes
39c5877ebc mod UOG to create a group from all actors that generate orders together for a ui action 2010-05-16 11:35:02 +12:00
Chris Forbes
6c6a121746 space-to-pan (like PS) in editor, not scrollbars. 2010-05-16 09:24:30 +12:00
1229 changed files with 91578 additions and 59386 deletions

31
.gitignore vendored
View File

@@ -10,31 +10,22 @@ obj
mods/*/*.dll
# Red Alert binary files
*.[mM][iI][xX]
*.[aA][uU][dD]
# Crap generated by OpenRa
sheet-*.png
log.txt
*.rep
mods/*/packages/*.[mM][iI][xX]
#binary stuff
/*.dll
*.pdb
*.mdb
/*.exe
OpenRA
OpenRA.app
*.exe
# backup files by various editors
*~
*.orig
# dependency DLLs (different for every platform!)
cg.dll
cgGL.dll
glfw.dll
/OpenRa.Gl.dll
settings.ini
#monodevelop
*.pidb
@@ -42,6 +33,9 @@ settings.ini
packaging/windows/*.exe
# osx crap
.DS_Store
# osx build crap
packaging/osx/launcher/build/
packaging/osx/launcher/OpenRA.xcodeproj/*.pbxuser
@@ -50,3 +44,14 @@ packaging/osx/launcher/OpenRA.xcodeproj/*.mode1v3
temp.c
temp.o
temp.s
OpenRA.Launcher.Mac/build/
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.pbxuser
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.perspectivev3
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
*.config
*.resources
# other crap
Logs/
Replays/
settings.yaml

11
AUTHORS Normal file
View File

@@ -0,0 +1,11 @@
AUTHORS
The OpenRA developers are:
* Chris Forbes
* Robert Pepperell
* Matthew Bowra-Dean
* Paul Chote
* Alli Witheford
* Joakim Lindberg
* Andrew Riedi
* Tim Mylemans

598
CHANGELOG Normal file
View File

@@ -0,0 +1,598 @@
Changes as of playtest-20110318
Engine:
Display range circles when placing defenses
Support a hostile creeps player for viceroids / dinosaurs / ants / etc
General refactoring and performance fixes
Stop/Scatter/Deploy orders give audio feedback
"Allow cheats" option moved into the game lobby, visible to all players
"Build anywhere" developer mode option
Improved pathfinding when collecting crates or crushing walls.
Refactor idle / prone infantry animations
Improve missile trail effects
Actors without health are not considered as dead
Health bars show recent damage as it is inflicted
Production structures and special powers show selection bars showing progress
Mouseover units to display healthbars etc
Fix shroud glitch when units exit transports
Fix bots jamming up their production structures
Direct connect will assume port 1234 if none is given
Chrome image mapping definitions changed from xml to yaml
Water explosion animations are not used for airborne explosions over water
Fix rendering of very large maps
Report GPU memory usage to debug.log
Massive improvements in repeated allocation / deallocation of memory
Fixed a desync with repairing buildings
Fixed a desync with aircraft (it now crashes deterministically instead)
Fixed a desync with KOTH maps
Fixed a bug where a slot is shown as closed when it contains a bot
Fix crash when spawning map actors owned by a nonexisting player
Fix crash when changing mod while playing music
Fix crash with perf graph
Fix crash in replay viewer if replays directory doesn't exist
Fix crash when selling civilian buildings
Fix crashes caused by blank game title / direct connect server textfields
Oil derricks and harvester unloading shows cash indicator
Prerequisites system refactoring to allow non-building prerequisites
Fix shift+tab not cycling the build tabs
Fix bogus keyboard input in text fields
Don't change mods if the same one is selected in the dropdown
C&C:
Viceroids! Infantry killed by tiberium or chem warriors may turn into viceroids
Fixed death animations
Blue tiberium damages infantry
Map-placed SAM sites start closed
Engineers capturing enemy buildings gives enemy tech
Buildings emit minigunners and engineers when sold (no more technicians / civilians)
Civilians panic when attacked
Fix a rare crash with harvester docking
Fix a rare crash with stealth tank
New Map: East vs West 3 by pchote
Removed Maps: Wargames, Yellowstone II
RA:
Service depots repair units faster
Fix crash when telling a minelayer to create an empty minefield
Fixed interior tileset boxes
New Map: Styrian Mountains by ReFlex
New Map: Convergence by Arcturus
Updated Map: Seaside by nudalz
Longbow ammo increased from 6 to 8, description fixed
Hind cost decreased from 1500 to 1000, hp increased from 100 to 150, range decreased from 12 to 10
Service depot cost increased to from 700 to 1000
Radar dome cost increased from 1000 to 1400
Artillery now requires war factor and radar dome, inaccuracy decreased from 80 to 40
APC moved from Allies to Soviets, hp increased from 200 to 300, price increased from 800 to 850
Medium / Heavy / Mammoth tanks now require service depot to build
Heavy tank cost reduced from 1200 to 1150
Flame turret rate of fire increased from 45 to 65, fires 2 bursts
AA guns, flak trucks can now fire over walls
Jeeps can carry a single passenger
Base defenses no longer provide ground control
Vehicle speed on clear ground increased, speed on ore reduced
Grenadiers have a 50% chance of exploding when killed
Spys are ignored by enemy units when disguised, tooltips show as disguised unit
Fix crates being paradropped inside trees, buildings
Production hotkey for flame turret changed to t, tesla coil to u
Disguised spys now appear correctly on radar and tooltips
Fix GPS behavior when alliances change.
Editor:
New map format (version 5). Maps < Version 4 are no longer supported by the editor or game.
Waypoints and MP start locations are now actors
Importing C&C/RA maps fixed
New png loader to support future tools
Editor uses the correct icon under mono
Editor only saves non-default values for PlayerReferences in map files
Default player colours has been returned to neutral grey.
Maps can be loaded from the commandline
Option to show actor names
Support for veteran / elite actors to be defined in the map yaml
Packaging:
Rename .deb package to use debian naming conventions
Improve linux package installation / elevation prompts (uses zenity, require mono >= 2.6.7)
Fix package installation crash on windows xp
Windowed mode now launches in the center of the screen under Windows
20110207
Engine:
Informative drop messages - user is notified of kick vs game has started vs server unavailable
Fixed render errors with the build palette on the first game tick
Improved sync check performance
Shp writing capabilities for mod tools
Fixed desync due to floating point calculations in unit facing
Fixed idle animations
Removed launchers on all platforms
Asset download/install is now performed ingame
Mod selector is now available from the main menu
Fixed `lock teams' checkbox
Lots of misc. engine refactoring
Fixed exploit allowing stance changes when teams are locked
Fix crash when capturing last enemy silo
Fix units continuing to attack a building after it has been captured
Fix floating point issues with missiles (manifests as broken torpedos in ra)
Fix location calculation for flying units (manifests as invincible helicopters in cnc)
Infantry stack 5-to-a-cell like the original games
Craters and scorches smoke for a limited time
Added a scatter key (bound to `x')
C&C:
Fixed commando c4
Fixed Airfield production notification ("Reinforcements have arrived")
Fixed palette bugs with Oil Derricks and walls
Fixed tech tree bugs after capturing enemy productions structures
"Repairing" eva
Proper "pop up" SAM sites. Closed SAMs receive a 50% armor bonus.
SAM sites require power to operate
Advanced Guard Tower requires power to operate
Support structures no longer grant build radius
Lower Barracks/Hand health
Increase Weapons Factory health
Increase rocket bike damage
New Map: Crossing the Rubicon (Arcturus)
RA:
Game assets can be installed from one of the Red Alert cds
"Repairing" eva
GPS is now shared between allies
Submarines are no longer visible to everyone
Fixed paradrop flare, spyplane from capturing KOTH points
New Map: Nuclear Winter (nudalz)
New Map: Seaside (nudalz)
Editor:
Ability to switch mods after launch
Refactor hardcoded tools into a generic interface
20110109
Launchers:
New GTK based launcher for linux.
Mod version, version check, and MOTD moved from the main menu into the launchers.
Fixes for non-standard mono installations under OSX.
Fixes for filepaths with spaces under OSX.
Map Editor / Maps:
Fixed crash when using floodfill.
New map format (version 4). Open and resave maps with the editor to upgrade them.
Added support for compressed (.oramap or .zip) maps.
Removed .uid files from maps -- compute the hash on demand now.
General:
Mod versions are checked when joining a server. Clients with a different game version / wrong mods will not be able to join.
Added 'Stop' command on 'S'.
Stop units from autotargeting walls.
Added different pip colour for gems vs ore.
Fixed several exploits in support powers.
Continue to show selected units when firing special powers.
Fixed palette effects (nuke, chronoshift) being applied to fog / shroud.
Added a replay viewer.
Fixed building previews being rendered below bridges.
Forced the AI to leave gaps between its buildings.
Fixed captured buildings still drawing power from the original owner.
Fixed various crashes in the editor when trying to make a new map.
Support multiple bot types; added another bot difficulty.
Removed option to not save syncreports.
Fixed desync related to aircraft.
Fixed sync not being checked on World traits.
Pick a random available door on production structures with more than one (barracks, subpens, etc).
Fixed some rare Harvester-related crashes.
Added labels to the perf graph.
Locked teams by default.
Fixed "No games found" not being displayed when there was an in-progress (hidden) game detected.
Added support for multiple shellmaps. Chooses randomly.
Fixed dropdowns possibly getting stuck open when the host force-starts the game.
Improved scrollpanels - added scrollbars and mousewheel support.
Fixed potential desyncs in building refund calculation and unit repair.
Added black outline to text drawn over the world, so it can be seen in all cases.
Many performance improvements.
C&C:
Fixed footprint of ATWR.
Improved harvester docking.
Made Oil Derricks capturable.
Fixed nuke detonation sound.
RA:
Fixed Tanya not having the correct pip color.
Fixed helicopters spawning in the wrong place.
Fixed Spy-related crashes when disguising as civilians.
Allow using C4 on friendly buildings.
Improved harvester docking.
Added proper shareable/revokable GPS.
Nerf 1tnk hard.
Increase cost of 2tnk slightly, but increase its HP too.
Require power to operate SAM sites.
Fixed missing tooltips for SHOK and TTNK.
Fixed chronoshift power requiring two clicks to cancel.
Fixed desync related to chronoshift.
Fixed bogus bottom-left spawnpoint on Central Conflict.
Production tabs with an item ready now light up yellow.
Fixed crash when a WEAP is half-destroyed before it finishes deploying.
20101202
General:
New launcher for Windows and OS X (Linux coming in a later release) for downloading and installing mods, and launching the game.
Disable Surrender button when you win or lose.
Fix Minimap orders outside viewport.
Render building previews when placing a structure.
Buttons offset their contents when pressed.
Dropdown listboxes in the game lobby and diplomacy panel.
Allow moving the cursor and editing anywhere in textfields.
Don't render things outside the map.
Render selection boxes / health bars, target lines above everything else
Show "cannot move here" cursor when mousing over invalid terrain under the fog, or outside the map.
Remove move flashes (they are obsoleted by target lines).
Buildings are always visible under fog.
Captured refineries no longer give cash to the original owner.
New rally point artwork.
Fix broken airstrike / parabomb special powers.
Fix diplomacy cycling shroud exploit.
Change the .rpm package to target Fedora.
Fixed idle animations
RA:
Added "A Path Beyond" map
Fix crash when selling iron curtained buildings.
Don't stack multiple Invuln render effect on an actor.
Fix exploit in Iron Curtain, Chronosphere, Nuke.
Fix paradrop flare remaining forever if drop plane is killed.
Area of effect Iron Curtain.
Area of effect Chronoshift.
Remove sandbag in water of "Equal Opportunity" map.
Allow chronoshifted and paradropped units to collect crates.
Fixed medic crash.
Removed end of game crash.
Fix dog attack.
Missile silo requires power but can be powered down.
Fix shellmap low power and invalid gap generator position.
Removed Naval Transport until it's cargo capabilities are fixed
CNC:
Fix exploit in Ion Cannon, Nuke.
Add some basic scripting to the shellmap.
Fix invulnerable stealth tanks.
Oil derricks spurt fire when killed.
New load screen (unfinished).
Fix observers.
Helicopters automatically target enemy units
Engine:
Refactored Orders to use less network bandwidth and remove duplication.
Dump available extensions to graphics.log when GL Renderer fails to init.
Fix Makefile constantly rebuilding, and refactor for readability.
Display soft shroud around edge of map instead of hard border.
Standardise engine naming of Theatre -> Tileset.
Refactor map size queries to all use Map.Bounds.
Move all widget delegate into the RA mod dll.
Renamed ListBoxWidget -> ScrollPanelWidget.
Fix ScrollPanelWidget scrolling beyond the start by 1 velocity tick.
Removed duplication from target lines.
Extensive refactoring of shroud.
Refactor Scale trait to a property on Render*.
Refactor idle behavior
20101121-2
Bug fixes:
Fixed Tesla causing an out of memory exception
Fixed Tesla animations.
All players can now see AI players in lobby.
Weapon factory sell animation now plays correctly.
Utility app now extracts downloaded content packages properly.
Fixed helicopters landing in silly places.
New Features:
New default renderer using GLSL instead of CG. Removes the dependency on the CG toolkit and fixes issues with Radeon graphics cards using latest drivers.
Order queuing with <shift>
Unlimited power option in dev mode.
New King of the Hill game mode with two maps: Crossroads and Island Hoppers
Smoke trails for damaged aircraft.
20101107
Fix Engineer/Tanya/etc refusing to enter buildings in 2010-11-06.
20101106
Bug Fixes:
Fix crash when hosting a second game.
Fixed exploit where you could place a building anywhere.
Fix aircraft, infantry becoming invincible in some circumstances.
Fix a common aircraft desync.
Unmuted the shellmap; it's now at 25% volume.
Balance Changes:
reduce cooldown on Chronosphere to 2 minutes (was 4 minutes)
reduce cooldown on Iron Curtain to 2 minutes (was 6 minutes)
reduce invulnerable time on Iron Curtain the 30 seconds (was 45 seconds)
reduce anti-ground damage of rocket soldier to 50 (was 60) and anti-air damage to 40 (was 50)
20101025
Fix crash in C&C when harvesters return to the refinery (sorry guys)
Fix crash in both mods when transports unload
Fix ore/tiberium growth not working correctly
Fix graphical glitches on screenshake, etc
Add contrails to RA planes
Added plane crashes in RA
Added explosions on impact for all RA aircraft
Added more scripting to the RA shellmap
Fix Tesla not doing the correct amount of damage
Lots of internal cleanup
20101023
New C&C Maps:
Into the River Below (6p)
Algernon (4p)
Wargames (4p)
Yellowstone II (4p)
Bug Fixes:
Client disconnects no longer "double-quit".
Units can no longer move over certain water tiles.
Checks for destroyed actors to ensure they don't try to perform actions after death.
Loose files in mod folders take priority over ones in .mix packages.
Fixes for syncing in replays.
Fix Iron Curtain.
Fixes for units entering a building from the east or south
MOTD no longer spits out garbage when behind a proxy needing web authentication.
RA Balance Tweaks:
Airfield cost reduced from 1100 to 300
Yak cost increased from 800 to 1000
Mig cost increased from 1200 to 2000
Helipad cost reduced from 1500 to 300
Longbow cost increased from 1200 to 2000
Hind cost increased from 1200 to 1500
Anti-air gun range increased from 6 to 10, spread increased from 3 to 5
Flack truck range increased from 6 to 8, spread increased from 3 to 5
20101017
Fix crash when repair indicator was visible, but the building got destroyed or sold
Fix crash if an actor got destroyed twice (blown up & sold, etc)
Fix putting units back in BADR and C17.
Fix C&C crates being invisible
Fix bogus overlapping of MINE with ore trucks
Add MCV, napalm, nuke crates to C&C.
Fix "(dead)" tags in chat
Mute shellmap combat
Fix FMV player
Fix bug in voice system which made it impossible to add extra sides (thanks raminator)
Fixed bogus Missile Silo cameo from RA
Fixed engineer goldwrench cursors being reversed
Add support for actors that give the owner a small flow of cash (to be used with Oil Derricks)
Make teamchat toggle more flexible
Fix cloakable units being untargetable while uncloaked (thanks pdovy)
Fix crash when clicking `repair` with no MCV
Fix unit crates spawning in inappropriate places
Updated 'The Sentinel' map
Add base cycling (backspace) in C&C (it previously worked only in RA)
Fix planes getting stuck on the edge of the map
Fix explosions in air being drawn at ground level
Allow map slots to disallow bots
Allow map slots to enforce race/color selection
Replace C&C LST art (thanks, KatzSmile)
Push HackyAI setup into system.yaml, fix HackyAI for C&C
Reduce effectiveness of RA GUN vs unarmored
Improved mod content download infrastructure for Linux
Nerf C&C Orca slightly
Nerf speed of C&C bggy/jeep/bike/apc
Add new C&C 1v1 map: 'Chokepoint' (thanks Tiberian)
Reduce bandwidth usage in multiplayer (1/2)
Fix version string showing up twice in bottom-right corner after a game
Buff arty damage slightly
Nerf V2 reload slightly
Add trails to C&C SAM missiles
Increase speed of most C&C AA missiles
Reduce power requirement for RA AFLD from 50 to 20
20101013
Fix crash when ordering a helicopter to move while it was falling out of the sky
Add blue tiberium
Fix aircraft not showing up on radar
Fix canceling of production not quite working (would cancel 2 if one was half-built)
Fix base-cycling for mac
Fix leaks between shellmap world and ingame world
Fix crash when the network connection is lost
Run the shellmap behind the lobby
Fix host not being able to teamchat
Declaring war automatically breaks the alliance in both directions
Aircraft can attack from their airfields correctly now
Attack move added ('A' and then left-click)
Add Tiberian's 'The Sentinel' 1v1 C&C map
Show the server name in the lobby dialog title
Random actually means random
Fix crash when destroying a Refinery with docked harvester
Add pchote's 'Tundra' 1v1 C&C SNOW! map
Lots of internal engine improvements
20101009
Fix 64bit Linux compatibility
Nerf C&C Attack Bike
Show mod info in server browser
Show MOTD in the main menu
Fixed exploit with selling walls
Fixed auto-attack not working properly
Add an example mod, which adds a single unit to RA.
Fix dogs eating walls
Fix crash on destroying ore storage buildings
Fix Obelisk missing moving target
Ban cloak crates for infantry
Add nuke "bad" crate
Prevent aircraft from firing while landed
Reduce nuke charge time from 13min to 9min
Reduce parabombs charge time to 1min
Add support for minimum ranges on weapons
Add support for excluding specific actor types from picking up certain crates
FIx silent nukes in RA if they didn't hit a building
Fix all AI players getting the same color
Fix AI players getting the same team setting as the host
Fix AI attacking each other
Prevent most awful-looking colors
Remove most of the debug spam for aircraft
Increase construction yard health (50% in RA, 25% in CNC)
AI players now build defenses
AI players no longer attack with medics (e1/e2/e3/1tnk/2tnk/3tnk)
Much improved order targeting system
Add crash animations for helicopters
Nerf Hind chainguns
Reduce cost of Cruisers from 3.2k to 2.4k
Fix CNC airdrop planes getting stuck if the Airfield goes away
Fix phantom voices for dead units in control groups
Fix dogs sometimes not killing infantry
Fix scroll jumping if opposite scroll inputs were applied
Fix bogus targeting lines being drawn to 0,0 sometimes
Fix VS2010 compatibility
Fix the game getting screwed up when people leave
20101002
Fix various crashes
Fix CNC AI never building anything (it's still crap, but at least it does *something*)
Added shader fallbacks for Cg-2.1
Fix editor crashing on File->Open on Windows
Added scroll speed control (thanks, Gecko)
20100922 through 20100922-4
Allow queueing of buildings when a building is ready to place
Change the pathfinder to use integers instead of floating point (fixes desync)
Create ui widgets on demand instead of at gamestart
Begin refactoring activity queuing for cleaner code
Reenable crates
Remove desync debug logging
Fix editor crash
Fix crash when a building being repaired is killed
20100921 through 20100921-6
Add yet more logging to search for the packaged build desync
20100920 through 20100920-7
Fix crash when building cnc weapons factory
Fix crash when harvester and refinery are killed by the same bullet (eg nuke)
Move several traits from engine into ra mod
Fix several editor bugs
Add a lot more logging to search for the packaged build desync
20100919-2
Fix crash when un/deploying a damaged mcv
20100919
Cache the power state of buildings for large performance gains
Changes to sync logging for large performance gains
Changes to shroud and ore rendering for large performace gains
Changes to renderer to fix several z-order bugs
Fix osx version string
Rename Repeat -> Loop in the music player
Fix team selection in the game lobby
Don't change production tab when selecting enemy structures
20100918-2 through 20100918-4
Fix crashes in the map editor
Include menu and desktop shortcuts to the RPM package
Add debugging to track down a desync between packaged versions on .net vs packaged versions on mono
20100918
Fixed lots of crashes
AI only tries to attack players that exist (and not itself)
Fixed speed of idle animations
Fixed exploit with A10 (infinite napalm)
Fixed exploits with remote building capturing/destroying
Added ability to change tilesize per-mod
Fixed delivering ore to an ally's proc
Fixed dog attacking ground forever (banned)
Fixed most z-order bugs
Fixed lots of editor usability problems
Fixed bogus XML generated by TSB
Added notification when cheats are used
Fixed exploit with reverse enter-transport order (didn't check if the passenger was compatible)
Fixed a bunch of techtree bugs
Fixed walkability of north rivermouth template in RA.
Added ability to export minimap as PNG from the editor
20100914
Infantry idle sequences for ra mod
Enable music player by default (requires scores.mix to be installed manually)
Flak truck for soviets in ra mod
Give dog a selection voice
Only scroll when the game window is focused
Fixed cursor/order bugs (includes force-fire c4 on allied structures, harvesting ore under shroud, move orders for aircraft, etc)
Fixed a collection of crashes related to dead actors
Fixed broken rpm package
Create Debian packages
20100910-2
Fixed attacking helipads
Deployed more mirrors
Added idle animations in C&C
Fixed an issue with the sidebar palette in C&C Desert
Integrated Jk's C&C Snow theater
Go back to classic C&C refinery model
Improve building explosions
Add nuke flash to C&C
Fix crash when losing FACT with a building ready to place
Remove unused MIX files
Add support for custom armor types
Adjust bounding boxes on vehicles
Windows installer prompts to install .NET if you don't have it
Windows installer remembers previous location for upgrades
Fix various crashes when refineries going away
Fix serious performace issue -- Actor leak when failing to spawn units
Add support for mobile production units
Remove splash damage from Tiberium
Fix a crash with actors dying with a projectile in-flight
Correctly clean up cargo when a transport dies
Fix client crash when the server disconnects
Right-clicking on a valid passenger with a transport loads cargo
Added zoom to editor
Convert sequences to yaml
Clean up the mod folders
Add a shellmap for C&C
Make pathfinder work with a MobileInfo rather than a live actor
Add a loadscreen for C&C
Correctly back up MIX files when upgrading windows installs
20100907
Changed MiG prerequisites to AFLD+STEK
Removed KENN, build DOG directly from BARR now
Chronotank can only teleport when fully charged
Improved OpenGL error logging
Fixed targeting of FIX
Fixed crash when an engineer is trying to repair a building, but it dies/gets sold/etc.
Added muzzle flashes to Yak and Hind chainguns
Fixed bounding boxes on some units
Fixed accuracy of Tesla weapons
Changed ownership of GUN and GTWR in CNC to both
Fixed crash on destroying things that have a building reserved
If ordered to move to an unpathable cell, move somewhere nearby that is pathable instead
Fixed RPM linux package
20100906-2
Shows game version in main menu screen for windows and linux
20100906
Improvements to Render performance
Improved debugging for performance issues
"Give Exploration" developer-mode option
Check for .net framework on windows install
Allow the viewport to scroll past the map edge to prevent ui from blocking buildings

View File

@@ -0,0 +1,52 @@
using System;
using System.IO;
using OpenRA.FileFormats;
namespace FileExtractor
{
public class FileExtractor
{
int Length = 256;
public FileExtractor (string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("usage: FileExtractor mod[,mod]* filename");
return;
}
var mods = args[0].Split(',');
var manifest = new Manifest(mods);
FileSystem.LoadFromManifest( manifest );
try
{
var readStream = FileSystem.Open(args[1]);
var writeStream = new FileStream(args[1], FileMode.OpenOrCreate, FileAccess.Write);
WriteOutFile(readStream, writeStream);
}
catch (FileNotFoundException)
{
Console.WriteLine(String.Format("No Such File {0}", args[1]));
}
}
void WriteOutFile (Stream readStream, Stream writeStream)
{
Byte[] buffer = new Byte[Length];
int bytesRead = readStream.Read(buffer,0,Length);
while( bytesRead > 0 )
{
writeStream.Write(buffer,0,bytesRead);
bytesRead = readStream.Read(buffer,0,Length);
}
readStream.Close();
writeStream.Close();
}
}
}

View File

@@ -1,48 +1,43 @@
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BA2B4C61-D5EE-4C3E-9BA1-EB32C531FA36}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MapConverter</RootNamespace>
<AssemblyName>MapConverter</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MapConverter.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{210645C7-E99E-46B6-863E-E211AE6C7D70}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>FileExtractor</RootNamespace>
<AssemblyName>FileExtractor</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>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="FileExtractor.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

13
FileExtractor/Main.cs Normal file
View File

@@ -0,0 +1,13 @@
using System;
namespace FileExtractor
{
public class MainClass
{
public static void Main (string[] args)
{
new FileExtractor(args);
}
}
}

0
FreeSans.ttf Executable file → Normal file
View File

75
HACKING
View File

@@ -5,43 +5,82 @@ There are n main sections to OpenRA: UI, Rendering, unit behaviour, ...
All units/structures/most things in the map are Actors. Actors contain a collection of traits.
Traits consist of an info class and a class that does stuff
Actor assembly is done via the mod's yaml files. A section exists for each actor type, and within that section we list the traits the actor should have. These get looked up in the loaded mod DLLs. Each trait can contain properties, which are automatically loaded into the corresponding fields on the trait's ITraitInfo.
Actor assembly is done via the mod's yaml files. A section exists for each actor type,
and within that section we list the traits the actor should have.
These get looked up in the loaded mod DLLs. Each trait can contain properties,
which are automatically loaded into the corresponding fields on the trait's ITraitInfo.
- Traits: look at TraitInterfaces.cs
We've tried to make individual traits implement as self-contained a unit of functionality as possible - all cross-trait references should be in terms of an interface from TraitInterfaces.cs.
We've tried to make individual traits implement as self-contained a unit of functionality
as possible - all cross-trait references should be in terms of an interface from
TraitInterfaces.cs.
- Things an actor can be *doing* are represented as IActivity implementations. Actor has a queue of these. There's a standard set of activities in OpenRa.Game/Traits/Activities, and mods tend to define more as they need them. (RA defines various special-infantry actions as activities).
- Things an actor can be *doing* are represented as IActivity implementations.
Actor has a queue of these. There's a standard set of activities in
OpenRa.Game/Traits/Activities, and mods tend to define more as they need them. (RA
defines various special-infantry actions as activities).
- Units offer orders they can perform (given context) through traits that implement IIssueOrder. Every trait with this interface is given a chance to generate orders for the current context.
- Units offer orders they can perform (given context) through traits that implement IIssueOrder.
Every trait with this interface is given a chance to generate orders for the current context.
- For more complex things that require modal UI (like special abilities, RA-style sell/repair buttons, etc) we have IOrderGenerator implementations. This can completely replace the normal actors-provide-orders model temporarily. IOGs wiring is provided through OpenRa.Game/Controller.cs (ToggleInputMode<T>, CancelInputMode)
- For more complex things that require modal UI (like special abilities,
RA-style sell/repair buttons, etc) we have IOrderGenerator implementations. This can
completely replace the normal actors-provide-orders model temporarily. IOGs wiring is
provided through OpenRa.Game/Controller.cs (ToggleInputMode<T>, CancelInputMode)
- Things that don't affect gameplay, or (increasingly) are just transient are implemented as IEffect, rather than real Actors. This is similar to the temp ents mechanism in many other game engines.
- Things that don't affect gameplay, or (increasingly) are just transient are implemented as
IEffect, rather than real Actors. This is similar to the temp ents mechanism in many other
game engines.
- Most player-level or global-level game behavior is implemented as traits on special Player and World actors. These are accessible via Player.PlayerActor and World.WorldActor. This includes production queue support, ore/tiberium growth, various palette manipulation magic.
- Most player-level or global-level game behavior is implemented as traits on special Player
and World actors. These are accessible via Player.PlayerActor and World.WorldActor. This
includes production queue support, ore/tiberium growth, various palette manipulation magic.
- Many traits can be modified by adding an appropriate IFooModifier implementation to the unit. This includes rendering, where IRenderModifier allows you to define an arbitrary transform on the Renderables emitted by the actor's IRender implementation(s). Examples are things like cloaking, invisibility to certain players, flying units with shadows, etc. Other modifiers can affect movement speed, damage taken, weapon firepower, etc.
- Many traits can be modified by adding an appropriate IFooModifier implementation to the unit.
This includes rendering, where IRenderModifier allows you to define an arbitrary transform on
the Renderables emitted by the actor's IRender implementation(s). Examples are things like
cloaking, invisibility to certain players, flying units with shadows, etc. Other modifiers
can affect movement speed, damage taken, weapon firepower, etc.
Game code is collected into "Mod" units. Mods can be added prior to starting the game. Currently there is no dependancy mechanism, but provided you are doing additions or overrides you can add multiple mods without problem.
Game code is collected into "Mod" units. Mods can be added prior to starting the game.
Currently there is no dependancy mechanism, but provided you are doing additions or overrides
you can add multiple mods without problem.
Everything is a mod (including RA - which is loaded by default).
The contents of the mod is defined in a manifest file mod.yaml. This lists the packages containing art assets (typically .mix files), yaml files defining actor defintions, and ini files containing legacy information that have yet to be ported over to the (relatively new) yaml system.
The contents of the mod is defined in a manifest file mod.yaml. This lists the packages
containing art assets (typically .mix files), yaml files defining actor defintions,
and ini files containing legacy information that have yet to be ported over to
the (relatively new) yaml system.
The unit artwork itself must be defined in a Sequences file (typically Sequences.xml; check mod.yaml for a list of what the mod uses); the format is self explanatory. There is also the SequenceEditor tool to make this easy.
The unit artwork itself must be defined in a Sequences file (typically Sequences.xml;
check mod.yaml for a list of what the mod uses); the format is self explanatory. There is
also the SequenceEditor tool to make this easy.
Chrome artwork is similarly defined in Chrome.xml. Chrome is already mod dependent. Sortof ;) mod-dependent *behavior* would be nice too, not just skinning. This is a property of the traits however; once we port UI into traits this will become a non-issue.
Chrome artwork is similarly defined in Chrome.xml. Chrome is already mod dependent. Sortof ;)
mod-dependent *behavior* would be nice too, not just skinning. This is a property of the traits
however; once we port UI into traits this will become a non-issue.
Rendering
OpenRa.Game/Chrome.cs is the user interface.
Three renderers (SpriteRenderer, LineRenderer, Rgba?Renderer) render most stuff. Don't forget to flush the renderer (if you want to see anything).
Three renderers (SpriteRenderer, LineRenderer, Rgba?Renderer) render most stuff. Don't forget
to flush the renderer (if you want to see anything).
UserSettings stores the data loaded from settings.ini (or defaults). Eventually we need to be able to save values changed in game into settings.ini (not yet implemented)
UserSettings stores the data loaded from settings.ini (or defaults). Eventually we need to be
able to save values changed in game into settings.ini (not yet implemented)
Bugs: There is a list of known bugs and features at http://openra.res0l.net/projects/openra/issues . There's also a few at http://github.com/chrisforbes/OpenRA/issues (which won't be ported over, but no more bugs should be added here).
Bugs: There is a list of known bugs and features at http://bugs.open-ra.org/ .
We also have a website at http://www.open-ra.org/ .
As far as using git, get your own repository on github. You probably want to set up the gitbot to spam irc when you make commits (its nice to know). Push your changes into your git repository, and it will/might :P be merged into chrisforbes/OpenRA . Alli: setup howto for this?
Our IRC channel is #openra on irc.freenode.net .
As far as using git, get your own repository on github. You probably want to set up the gitbot
to spam irc when you make commits (its nice to know). Push your changes into your git
repository, and it will/might :P be merged into http://github.com/OpenRA/OpenRA .
See http://help.github.com/ for working with GitHub and see http://progit.org/ for working
with Git.
Other things we probably want to put in here:
- A guide on how to add a generic unit via yaml using existing traits
@@ -50,6 +89,6 @@ Other things we probably want to put in here:
- VFS (OpenRa.FileFormats.FileSystem, Package, Folder classes)
- Trait inheritance (and the magicness of ^ActorType)
- Removing inherited traits (prepend `-` to the trait name)
- Multiple instances of a trait (`@` and all subsequent characters are ignored for the purposes
of looking up the trait.
- Multiple instances of a trait (`@` and all subsequent characters are ignored for
the purposes of looking up the trait.

121
INSTALL
View File

@@ -1,57 +1,64 @@
Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean,
Paul Chote, Alli Witheford.
This file is part of OpenRA.
OpenRA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenRA 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
To compile OpenRA, open the OpenRA.sln solution in the main folder,
or build it from the command-line with MSBuild.
To run OpenRA, several files from the original games install need
to be copied to the root of the project directory. The required files are:
redalert.mix
conquer.mix
temperat.mix
interior.mix
snow.mix
sounds.mix
allies.mix
russian.mix
general.mix
hires1.mix
expand2.mix
Red Alert has been released by EA Games as freeware so it shouldnt
be too hard to find a legal copy of the CD images. Unfortunately the
installer is 16-bit and so wont run on 64-bit operating systems. This
can be worked around by using the Red Alert Setup Manager
(http://ra.afraid.org/html/downloads/utilities-3.html).
Make sure you apply the no-CD protection fix so all the files needed
are installed to the hard drive.
Dependencies - Make sure you have these installed, or you'll
have very strange errors.
* .NET Framework >= 3.5-SP1
(http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en)
* Tao Framework >= 2.1.0
(http://sourceforge.net/projects/taoframework/)
(required libs: Tao.OpenGL, Tao.Cg, Tao.Platform.Windows)
* OpenAL >= 1.1
(http://connect.creativelabs.com/openal/Downloads/oalinst.zip)
* Cg Toolkit >= 2.2
(http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_October2009_Setup.exe)
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.
To run OpenRA, several files are needed from the original game disks.
These files are now downloaded and installed by the game,
so so no explicit action is required.
Dependencies - Make sure you have these installed, or you'll
have very strange errors.
WINDOWS:
* .NET Framework >= 3.5-SP1
(http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en)
* Tao Framework >= 2.1.0
This is now bundled with OpenRA, copy the files in thirdparty/Tao to the game root directory.
* OpenAL >= 1.1
(http://connect.creativelabs.com/openal/Downloads/oalinst.zip)
* Cg Toolkit >= 2.2
(http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_October2009_Setup.exe)
To compile OpenRA, open the OpenRA.sln solution in the main folder,
or build it from the command-line with MSBuild.
Run the game with `OpenRA.Game.exe Game.Mods=ra` for Red Alert
or `OpenRA.Game.exe Game.Mods=cnc` for Command & Conquer
UBUNTU (substitute comparable packages for other linux distros):
* mono-runtime (>= 2.6.7),
* mono-gmcs
* freetype
* libmono-corlib1.0-cil
* libmono-winforms2.0-cil
* libopenal1
* libsdl1.2-dev
* nvidia-cg-toolkit (download the latest version from
http://developer.nvidia.com/object/cg_download.html)
OpenRA is incompatible with Compiz, please disable desktop effects when trying
to run OpenRA or the game will crash.
You will additionally need to copy the third party dependencies (.dll and .config) from the
thirdparty and thirdparty/Tao directories into the game root:
cp -v thirdparty/*.dll thirdparty/Tao/* .
Alternatively, the dlls can be installed into your system GAC. This is not
recommended because we ship a custom Tao.FreeType that can conflict with
other applications that use Tao:
gacutil -i thirdparty/Tao/Tao.Cg.dll
gacutil -i thirdparty/Tao/Tao.OpenGl.dll
gacutil -i thirdparty/Tao/Tao.OpenAl.dll
gacutil -i thirdparty/Tao/Tao.Sdl.dll
gacutil -i thirdparty/Tao/Tao.FreeType.dll
gacutil -i thirdparty/ICSharpCode.SharpZipLib.dll
To compile OpenRA, run `make' from the command line.
Run the game with `mono OpenRA.Game.exe Game.Mods=ra` for Red Alert
or `mono OpenRA.Game.exe Game.Mods=cnc` for Command & Conquer

View File

@@ -1,52 +0,0 @@
Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean,
Paul Chote, Alli Witheford.
This file is part of OpenRA.
OpenRA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenRA 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
To compile OpenRA, open the OpenRA.sln solution in the main folder,
or build it from the command-line with MSBuild.
To run OpenRA, several files from the original games install need
to be copied to the root of the project directory. The required files are:
redalert.mix
conquer.mix
temperat.mix
interior.mix
snow.mix
sounds.mix
allies.mix
russian.mix
general.mix
hires1.mix
expand2.mix
Red Alert has been released by EA Games as freeware so it shouldnt
be too hard to find a legal copy of the CD images. Unfortunately the
installer is 16-bit and so wont run on 64-bit operating systems. This
can be worked around by using the Red Alert Setup Manager
(http://ra.afraid.org/html/downloads/utilities-3.html).
Make sure you apply the no-CD protection fix so all the files needed
are installed to the hard drive.
Dependencies - Make sure you have these installed, or you'll
have very strange errors.
* mono-gmcs
* libglfw2
* nvidia-cg-toolkit
* libmono-*

296
Makefile
View File

@@ -1,123 +1,174 @@
CSC = gmcs
CSFLAGS = -nologo -warn:4 -debug:+ -debug:full -optimize- -codepage:utf8 -unsafe
DEFINE = DEBUG;TRACE
PROGRAMS =fileformats gl game ra cnc aftermath seqed mapcvtr
prefix = /usr/local
datarootdir = $(prefix)/share
datadir = $(datarootdir)
bindir = $(prefix)/bin
INSTALL_DIR = $(DESTDIR)$(datadir)/openra
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
CSC = gmcs
CSFLAGS = -nologo -warn:4 -debug:+ -debug:full -optimize- -codepage:utf8 -unsafe
DEFINE = DEBUG;TRACE
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll
PHONY = core tools package all mods clean distclean
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll
.SUFFIXES:
core: game renderers mod_ra mod_cnc utility
tools: editor ralint seqed filex tsbuild
package: fixheader core editor
mods: mod_ra mod_cnc
all: core tools
clean:
@-rm *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
distclean: clean
CORE = fileformats gl game seqed mapcvtr
#
# Core binaries
#
fileformats_SRCS = $(shell find OpenRA.FileFormats/ -iname '*.cs')
fileformats_TARGET = OpenRA.FileFormats.dll
#fileformats_DEPS = fixheader
fileformats_KIND = library
fileformats_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Sdl.dll System.Windows.Forms.dll
PROGRAMS = fileformats
fileformats: $(fileformats_TARGET)
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
gl_SRCS = $(shell find OpenRA.Gl/ -iname '*.cs')
gl_TARGET = OpenRA.Gl.dll
gl_KIND = library
gl_DEPS = $(fileformats_TARGET) $(game_TARGET)
gl_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(gl_DEPS) $(game_TARGET)
game_SRCS = $(shell find OpenRA.Game/ -iname '*.cs')
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/Tao/Tao.FreeType.dll
game_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico
PROGRAMS += game
game: $(game_TARGET)
ra_SRCS = $(shell find OpenRA.Mods.RA/ -iname '*.cs')
ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
ra_KIND = library
ra_DEPS = $(fileformats_TARGET) $(game_TARGET)
ra_LIBS = $(COMMON_LIBS) $(ra_DEPS)
#
# Renderer dlls
#
rcg_SRCS = $(shell find OpenRA.Renderer.Cg/ -iname '*.cs')
rcg_TARGET = OpenRA.Renderer.Cg.dll
rcg_KIND = library
rcg_DEPS = $(fileformats_TARGET) $(game_TARGET)
rcg_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(rcg_DEPS) $(game_TARGET)
cnc_SRCS = $(shell find OpenRA.Mods.Cnc/ -iname '*.cs')
cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll
cnc_KIND = library
cnc_DEPS = $(fileformats_TARGET) $(game_TARGET) $(ra_TARGET)
cnc_LIBS = $(COMMON_LIBS) $(cnc_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)
rgl_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(rgl_DEPS) $(game_TARGET)
aftermath_SRCS = $(shell find OpenRA.Mods.Aftermath/ -iname '*.cs')
aftermath_TARGET = mods/aftermath/OpenRA.Mods.Aftermath.dll
aftermath_KIND = library
aftermath_DEPS = $(fileformats_TARGET) $(game_TARGET) $(ra_TARGET)
aftermath_LIBS = $(COMMON_LIBS) $(aftermath_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_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
$(rnull_DEPS) $(game_TARGET)
PROGRAMS += rcg rgl rnull
renderers: $(rcg_TARGET) $(rgl_TARGET) $(rnull_TARGET)
#
# Official Mods
#
# 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 = $(fileformats_TARGET) $(game_TARGET)
mod_ra_LIBS = $(COMMON_LIBS) $(mod_ra_DEPS)
PROGRAMS += mod_ra
mod_ra: $(mod_ra_TARGET)
# mono RALint.exe ra
# Command and Conquer
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 = $(fileformats_TARGET) $(game_TARGET) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(mod_cnc_DEPS)
PROGRAMS += mod_cnc
mod_cnc: $(mod_cnc_TARGET)
# mono RALint.exe cnc
#
# Tools
#
# Sequence editor (defunct)
seqed_SRCS = $(shell find SequenceEditor/ -iname '*.cs')
seqed_TARGET = SequenceEditor.exe
seqed_KIND = winexe
seqed_DEPS = $(fileformats_TARGET)
seqed_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll $(seqed_DEPS)
seqed_EXTRA = -resource:SequenceEditor.Form1.resources
PROGRAMS += seqed
SequenceEditor.Form1.resources:
resgen2 SequenceEditor/Form1.resx SequenceEditor.Form1.resources 1> /dev/null
seqed: SequenceEditor.Form1.resources $(seqed_TARGET)
mapcvtr_SRCS = $(shell find MapConverter/ -iname '*.cs')
mapcvtr_TARGET = MapConverter.exe
mapcvtr_KIND = winexe
mapcvtr_DEPS = $(fileformats_TARGET)
mapcvtr_LIBS = $(COMMON_LIBS) $(mapcvtr_DEPS)
# Map Editor
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_EXTRA = -resource:OpenRA.Editor.Form1.resources -resource:OpenRA.Editor.MapSelect.resources
editor_FLAGS = -win32icon:OpenRA.Editor/OpenRA.Editor.Icon.ico
# -platform:x86
PROGRAMS += editor
OpenRA.Editor.MapSelect.resources:
resgen2 OpenRA.Editor/MapSelect.resx OpenRA.Editor.MapSelect.resources 1> /dev/null
OpenRA.Editor.Form1.resources:
resgen2 OpenRA.Editor/Form1.resx OpenRA.Editor.Form1.resources 1> /dev/null
editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET)
.SUFFIXES:
.PHONY: clean all default mods seqed mapcvtr install uninstall
# Analyses mod yaml for easy to detect errors
ralint_SRCS = $(shell find RALint/ -iname '*.cs')
ralint_TARGET = RALint.exe
ralint_KIND = exe
ralint_DEPS = $(fileformats_TARGET) $(game_TARGET)
ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS)
PROGRAMS += ralint
ralint: $(ralint_TARGET)
all: $(fileformats_TARGET) $(gl_TARGET) $(game_TARGET) $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) $(seqed_TARGET) $(mapcvtr_TARGET)
# Extracts files from packages (mixfiles, zips, etc)
filex_SRCS = $(shell find FileExtractor/ -iname '*.cs')
filex_TARGET = FileExtractor.exe
filex_KIND = exe
filex_DEPS = $(fileformats_TARGET)
filex_LIBS = $(COMMON_LIBS) $(filex_DEPS)
PROGRAMS += filex
filex: $(filex_TARGET)
clean:
@-rm *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb
# Builds and exports tilesets from a bitmap
tsbuild_SRCS = $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_TARGET = TilesetBuilder.exe
tsbuild_KIND = winexe
tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET)
tsbuild_LIBS = $(COMMON_LIBS) $(tsbuild_DEPS) System.Windows.Forms.dll
tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.Form1.resources
PROGRAMS += tsbuild
OpenRA.TilesetBuilder.Form1.resources:
resgen2 OpenRA.TilesetBuilder/Form1.resx OpenRA.TilesetBuilder.Form1.resources 1> /dev/null
tsbuild: OpenRA.TilesetBuilder.Form1.resources $(tsbuild_TARGET)
distclean: clean
#
# Launchers / Utilities
#
# Patches binary headers to work around a mono bug
fixheader: packaging/fixheader.cs
@$(CSC) packaging/fixheader.cs $(CSFLAGS) -out:fixheader.exe -t:exe $(COMMON_LIBS:%=-r:%)
PHONY += fixheader
install: all
@-echo "Installing OpenRA to $(INSTALL_DIR)"
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)
@$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) $(INSTALL_DIR)
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/aftermath
@$(INSTALL_PROGRAM) $(aftermath_TARGET) $(INSTALL_DIR)/mods/aftermath
@-cp $(foreach f,$(shell ls mods/aftermath --hide=*.dll),mods/aftermath/$(f)) $(INSTALL_DIR)/mods/aftermath
@cp -r mods/aftermath/packages $(INSTALL_DIR)/mods/aftermath
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/cnc
@$(INSTALL_PROGRAM) $(cnc_TARGET) $(INSTALL_DIR)/mods/cnc
@-cp $(foreach f,$(shell ls mods/cnc --hide=*.dll),mods/cnc/$(f)) $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/maps $(INSTALL_DIR)/mods/cnc
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/ra
@$(INSTALL_PROGRAM) $(ra_TARGET) $(INSTALL_DIR)/mods/ra
@-cp $(foreach f,$(shell ls mods/ra --hide=*.dll),mods/ra/$(f)) $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/maps $(INSTALL_DIR)/mods/ra
@cp -r shaders $(INSTALL_DIR)
@cp *.ttf $(INSTALL_DIR)
@-cp *.ini $(INSTALL_DIR)
@cp -r thirdparty $(INSTALL_DIR)
@echo "OpenRA is now installed. You will now want to download"
@echo "http://open-ra.org/packages/ra-packages.zip and"
@echo "http://open-ra.org/packages/cnc-packages.zip"
@echo "and extract their contents to"
@echo "$(INSTALL_DIR)/mods/ra/packages and "
@echo "$(INSTALL_DIR)/mods/cnc/packages respectively."
@echo "It is also advised to install the contents of $(INSTALL_DIR)/thirdparty to the Mono Global Assembly Cache \
with gacutil."
# 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
PROGRAMS += utility
utility: $(utility_TARGET)
uninstall:
@-rm -r $(INSTALL_DIR)
@-rm $(DESTDIR)$(bindir)/openra
mods: $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET)
seqed: $(seqed_TARGET)
mapcvtr: $(mapcvtr_TARGET)
.PHONY: $(PHONY) $(PROGRAMS)
#
# Generate build rules for each target defined above in PROGRAMS
#
define BUILD_ASSEMBLY
$$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS)
@@ -126,7 +177,66 @@ $$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS)
-out:$$(@) $(CSFLAGS) $$($(1)_FLAGS) \
-define:"$(DEFINE)" \
-t:"$$($(1)_KIND)" \
$$($(1)_EXTRA) \
$$($(1)_SRCS)
@test -e fixheader.exe && mono fixheader.exe $$(@) || ``
endef
$(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
#
# Install / Uninstall for *nix
#
prefix = /usr/local
datarootdir = $(prefix)/share
datadir = $(datarootdir)
bindir = $(prefix)/bin
BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
INSTALL_DIR = $(DESTDIR)$(datadir)/openra
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
CORE = fileformats rcg rgl rnull game editor utility
install: all
@-echo "Installing OpenRA to $(INSTALL_DIR)"
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)
@$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) $(INSTALL_DIR)
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/cnc
@$(INSTALL_PROGRAM) $(mod_cnc_TARGET) $(INSTALL_DIR)/mods/cnc
@-cp $(foreach f,$(shell ls mods/cnc --hide=*.dll),mods/cnc/$(f)) $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/maps $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/chrome $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/bits $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/rules $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/sequences $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/tilesets $(INSTALL_DIR)/mods/cnc
@cp -r mods/cnc/uibits $(INSTALL_DIR)/mods/cnc
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/ra
@$(INSTALL_PROGRAM) $(mod_ra_TARGET) $(INSTALL_DIR)/mods/ra
@-cp $(foreach f,$(shell ls mods/ra --hide=*.dll),mods/ra/$(f)) $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/maps $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/bits $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/chrome $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/rules $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/tilesets $(INSTALL_DIR)/mods/ra
@cp -r mods/ra/uibits $(INSTALL_DIR)/mods/ra
@cp -r glsl $(INSTALL_DIR)
@cp -r cg $(INSTALL_DIR)
@cp *.ttf $(INSTALL_DIR)
@cp --parents -r thirdparty/Tao $(INSTALL_DIR)
@$(INSTALL_PROGRAM) thirdparty/ICSharpCode.SharpZipLib.dll $(INSTALL_DIR)
@echo "#!/bin/sh" > openra
@echo "cd "$(datadir)"/openra" >> openra
@echo "mono "$(datadir)"/openra/OpenRA.Game.exe SupportDir=~/.openra \"$$""@\"" >> openra
@$(INSTALL_PROGRAM) -d $(BIN_INSTALL_DIR)
@$(INSTALL_PROGRAM) -m +rx openra $(BIN_INSTALL_DIR)
uninstall:
@-rm -r $(INSTALL_DIR)
@-rm $(DESTDIR)$(bindir)/openra

View File

@@ -1,13 +0,0 @@
using System;
using OpenRA.FileFormats;
namespace MapConverter
{
class MainClass
{
public static void Main (string[] args)
{
new MapConverter(args);
}
}
}

View File

@@ -1,405 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using OpenRA;
using OpenRA.FileFormats;
namespace MapConverter
{
public class MapConverter
{
// Mapping from ra overlay index to type string
static string[] raOverlayNames =
{
"sbag", "cycl", "brik", "fenc", "wood",
"gold01", "gold02", "gold03", "gold04",
"gem01", "gem02", "gem03", "gem04",
"v12", "v13", "v14", "v15", "v16", "v17", "v18",
"fpls", "wcrate", "scrate", "barb", "sbag",
};
static Dictionary< string, Pair<byte,byte> > overlayResourceMapping = new Dictionary<string, Pair<byte, byte>>()
{
// RA Gems, Gold
{ "gold01", new Pair<byte,byte>(1,0) },
{ "gold02", new Pair<byte,byte>(1,1) },
{ "gold03", new Pair<byte,byte>(1,2) },
{ "gold04", new Pair<byte,byte>(1,3) },
{ "gem01", new Pair<byte,byte>(2,0) },
{ "gem02", new Pair<byte,byte>(2,1) },
{ "gem03", new Pair<byte,byte>(2,2) },
{ "gem04", new Pair<byte,byte>(2,3) },
// cnc tiberium
{ "ti1", new Pair<byte,byte>(1,0) },
{ "ti2", new Pair<byte,byte>(1,1) },
{ "ti3", new Pair<byte,byte>(1,2) },
{ "ti4", new Pair<byte,byte>(1,3) },
{ "ti5", new Pair<byte,byte>(1,4) },
{ "ti6", new Pair<byte,byte>(1,5) },
{ "ti7", new Pair<byte,byte>(1,6) },
{ "ti8", new Pair<byte,byte>(1,7) },
{ "ti9", new Pair<byte,byte>(1,8) },
{ "ti10", new Pair<byte,byte>(1,9) },
{ "ti11", new Pair<byte,byte>(1,10) },
{ "ti12", new Pair<byte,byte>(1,11) },
};
static Dictionary<string, string> overlayActorMapping = new Dictionary<string,string>() {
// Fences
{"sbag","sbag"},
{"cycl","cycl"},
{"brik","brik"},
{"fenc","fenc"},
{"wood","wood"},
// Fields
{"v12","v12"},
{"v13","v13"},
{"v14","v14"},
{"v15","v15"},
{"v16","v16"},
{"v17","v17"},
{"v18","v18"},
// Crates
{"wcrate","crate"},
{"scrate","crate"},
};
int MapSize;
int ActorCount = 0;
Map Map = new Map();
Manifest manifest;
public MapConverter(string[] args)
{
if (args.Length != 3)
{
Console.WriteLine("usage: MapConverter mod[,mod]* input-map.ini output-map.yaml");
return;
}
var mods = args[0].Split(',');
manifest = new Manifest(mods);
foreach (var folder in manifest.Folders) FileSystem.Mount(folder);
foreach (var pkg in manifest.Packages) FileSystem.Mount(pkg);
ConvertIniMap(args[1]);
Map.DebugContents();
Save(args[2]);
}
static Dictionary<Pair<string,string>,Pair<string,string> > fileMapping = new Dictionary<Pair<string,string>,Pair<string,string> >()
{
{Pair.New("ra","TEMPERAT"),Pair.New("tem","temperat.col")},
{Pair.New("ra","SNOW"),Pair.New("sno","snow.col")},
{Pair.New("ra","INTERIOR"),Pair.New("int","temperat.col")},
{Pair.New("cnc","DESERT"),Pair.New("des","desert.col")},
{Pair.New("cnc","TEMPERAT"),Pair.New("tem","temperat.col")},
{Pair.New("cnc","WINTER"),Pair.New("win","winter.col")},
};
TerrainColorSet terrainTypeColors;
TileSet tileset;
public void ConvertIniMap(string iniFile)
{
IniFile file = new IniFile(FileSystem.Open(iniFile));
IniSection basic = file.GetSection("Basic");
IniSection map = file.GetSection("Map");
var INIFormat = int.Parse(basic.GetValue("NewINIFormat", "0"));
var XOffset = int.Parse(map.GetValue("X", "0"));
var YOffset = int.Parse(map.GetValue("Y", "0"));
var Width = int.Parse(map.GetValue("Width", "0"));
var Height = int.Parse(map.GetValue("Height", "0"));
MapSize = (INIFormat == 3) ? 128 : 64;
Map.Title = basic.GetValue("Name", "(null)");
Map.Author = "Westwood Studios";
Map.Tileset = Truncate(map.GetValue("Theater", "TEMPERAT"), 8);
Map.MapSize.X = MapSize;
Map.MapSize.Y = MapSize;
Map.TopLeft = new int2 (XOffset, YOffset);
Map.BottomRight = new int2(XOffset+Width,YOffset+Height);
Map.Selectable = true;
if (INIFormat == 3) // RA map
{
UnpackRATileData(ReadPackedSection(file.GetSection("MapPack")));
UnpackRAOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
ReadRATrees(file);
terrainTypeColors = new TerrainColorSet(fileMapping[Pair.New("ra",Map.Tileset)].Second);
tileset = new TileSet("tileSet.til","templates.ini",fileMapping[Pair.New("ra",Map.Tileset)].First);
}
else // CNC
{
UnpackCncTileData(FileSystem.Open(iniFile.Substring(0,iniFile.Length-4)+".bin"));
ReadCncOverlay(file);
ReadCncTrees(file);
terrainTypeColors = new TerrainColorSet(fileMapping[Pair.New("cnc",Map.Tileset)].Second);
tileset = new TileSet("tileSet.til","templates.ini",fileMapping[Pair.New("cnc",Map.Tileset)].First);
}
LoadActors(file, "STRUCTURES");
LoadActors(file, "UNITS");
LoadActors(file, "INFANTRY");
LoadSmudges(file, "SMUDGE");
var wp = file.GetSection("Waypoints")
.Where(kv => int.Parse(kv.Value) > 0)
.Select(kv => Pair.New(int.Parse(kv.Key), new int2(int.Parse(kv.Value) % MapSize, int.Parse(kv.Value) / MapSize)))
.Where(a => a.First < 8)
.ToArray();
Map.PlayerCount = wp.Count();
foreach (var kv in wp)
Map.Waypoints.Add("spawn"+kv.First, kv.Second);
}
static MemoryStream ReadPackedSection(IniSection mapPackSection)
{
StringBuilder sb = new StringBuilder();
for (int i = 1; ; i++)
{
string line = mapPackSection.GetValue(i.ToString(), null);
if (line == null)
break;
sb.Append(line.Trim());
}
byte[] data = Convert.FromBase64String(sb.ToString());
List<byte[]> chunks = new List<byte[]>();
BinaryReader reader = new BinaryReader(new MemoryStream(data));
try
{
while (true)
{
uint length = reader.ReadUInt32() & 0xdfffffff;
byte[] dest = new byte[8192];
byte[] src = reader.ReadBytes((int)length);
/*int actualLength =*/ Format80.DecodeInto(src, dest);
chunks.Add(dest);
}
}
catch (EndOfStreamException) { }
MemoryStream ms = new MemoryStream();
foreach (byte[] chunk in chunks)
ms.Write(chunk, 0, chunk.Length);
ms.Position = 0;
return ms;
}
static byte ReadByte( Stream s )
{
int ret = s.ReadByte();
if( ret == -1 )
throw new NotImplementedException();
return (byte)ret;
}
static ushort ReadWord(Stream s)
{
ushort ret = ReadByte(s);
ret |= (ushort)(ReadByte(s) << 8);
return ret;
}
void UnpackRATileData( MemoryStream ms )
{
Map.MapTiles = new TileReference<ushort, byte>[ MapSize, MapSize ];
for( int i = 0 ; i < MapSize ; i++ )
for( int j = 0 ; j < MapSize ; j++ )
Map.MapTiles[i,j] = new TileReference<ushort,byte>();
for( int j = 0 ; j < MapSize ; j++ )
for( int i = 0 ; i < MapSize ; i++ )
Map.MapTiles[i,j].type = ReadWord(ms);
for( int j = 0 ; j < MapSize ; j++ )
for( int i = 0 ; i < MapSize ; i++ )
{
Map.MapTiles[i,j].index = ReadByte(ms);
if( Map.MapTiles[i,j].type == 0xff || Map.MapTiles[i,j].type == 0xffff )
Map.MapTiles[i,j].index = byte.MaxValue;
}
}
void UnpackRAOverlayData( MemoryStream ms )
{
Map.MapResources = new TileReference<byte, byte>[ MapSize, MapSize ];
for( int j = 0 ; j < MapSize ; j++ )
for( int i = 0 ; i < MapSize ; i++ )
{
byte o = ReadByte( ms );
var res = Pair.New((byte)0,(byte)0);
if (o != 255 && overlayResourceMapping.ContainsKey(raOverlayNames[o]))
res = overlayResourceMapping[raOverlayNames[o]];
Map.MapResources[i,j] = new TileReference<byte,byte>(res.First, res.Second);
if (o != 255 && overlayActorMapping.ContainsKey(raOverlayNames[o]))
Map.Actors.Add("Actor"+ActorCount++, new ActorReference( overlayActorMapping[raOverlayNames[o]], new int2(i,j), "Neutral"));
}
}
void ReadRATrees( IniFile file )
{
IniSection terrain = file.GetSection( "TERRAIN", true );
if( terrain == null )
return;
foreach( KeyValuePair<string, string> kv in terrain )
{
var loc = int.Parse( kv.Key );
Map.Actors.Add("Actor"+ActorCount++, new ActorReference(kv.Value.ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), "Neutral" ) );
}
}
void UnpackCncTileData( Stream ms )
{
Map.MapTiles = new TileReference<ushort, byte>[ MapSize, MapSize ];
for( int i = 0 ; i < MapSize ; i++ )
for( int j = 0 ; j < MapSize ; j++ )
Map.MapTiles[i,j] = new TileReference<ushort,byte>();
for( int j = 0 ; j < MapSize ; j++ )
for( int i = 0 ; i < MapSize ; i++ )
{
Map.MapTiles[i,j].type = ReadByte(ms);
Map.MapTiles[i,j].index = ReadByte(ms);
if( Map.MapTiles[i,j].type == 0xff )
Map.MapTiles[i,j].index = byte.MaxValue;
}
}
void ReadCncOverlay( IniFile file )
{
IniSection overlay = file.GetSection( "OVERLAY", true );
if( overlay == null )
return;
Map.MapResources = new TileReference<byte, byte>[ MapSize, MapSize ];
foreach( KeyValuePair<string, string> kv in overlay )
{
var loc = int.Parse( kv.Key );
int2 cell = new int2(loc % MapSize, loc / MapSize);
var res = Pair.New((byte)0,(byte)0);
if (overlayResourceMapping.ContainsKey(kv.Value.ToLower()))
res = overlayResourceMapping[kv.Value.ToLower()];
Map.MapResources[ cell.X, cell.Y ] = new TileReference<byte,byte>(res.First, res.Second);
if (overlayActorMapping.ContainsKey(kv.Value.ToLower()))
Map.Actors.Add("Actor"+ActorCount++, new ActorReference( overlayActorMapping[kv.Value.ToLower()], new int2(cell.X,cell.Y), "Neutral"));
}
}
void ReadCncTrees( IniFile file )
{
IniSection terrain = file.GetSection( "TERRAIN", true );
if( terrain == null )
return;
foreach( KeyValuePair<string, string> kv in terrain )
{
var loc = int.Parse( kv.Key );
Map.Actors.Add("Actor"+ActorCount++, new ActorReference( kv.Value.Split(',')[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize),"Neutral"));
}
}
void LoadActors(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//num=owner,type,health,location,facing,...
var parts = s.Value.Split( ',' );
var loc = int.Parse(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
Map.Actors.Add("Actor"+ActorCount++, new ActorReference( parts[1].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), parts[0]));
}
}
void LoadSmudges(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//loc=type,loc,depth
var parts = s.Value.Split( ',' );
var loc = int.Parse(parts[1]);
Map.Smudges.Add(new SmudgeReference(parts[0].ToLowerInvariant(),new int2(loc % MapSize, loc / MapSize),int.Parse(parts[2])));
}
}
static string Truncate( string s, int maxLength )
{
return s.Length <= maxLength ? s : s.Substring(0,maxLength );
}
public void SavePreviewImage(string filepath)
{
var xs = Map.TopLeft.X;
var ys = Map.TopLeft.Y;
var bitmap = new Bitmap(Map.Width, Map.Height);
for (var x = 0; x < Map.Width; x++)
for (var y = 0; y < Map.Height; y++)
bitmap.SetPixel(x, y, terrainTypeColors.ColorForTerrainType(tileset.GetTerrainType(Map.MapTiles[x+xs, y+ys])));
for (var x = 0; x < Map.Width; x++)
for (var y = 0; y < Map.Height; y++)
if (Map.MapResources[x+xs, y+ys].type > 0)
bitmap.SetPixel(x, y, terrainTypeColors.ColorForTerrainType(TerrainType.Ore));
bitmap.Save(filepath,ImageFormat.Png);
}
public void Save(string filepath)
{
Directory.CreateDirectory(filepath);
Map.Package = new Folder(filepath);
SavePreviewImage(Path.Combine(filepath,"preview.png"));
Map.Save(filepath);
}
}
}

View File

@@ -1,30 +1,36 @@
using System.Drawing;
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Editor
{
class ActorTemplate
{
public Bitmap Bitmap;
public ActorInfo Info;
public bool Centered;
}
class BrushTemplate
{
public Bitmap Bitmap;
public ushort N;
}
class ResourceTemplate
{
public Bitmap Bitmap;
public ResourceTypeInfo Info;
public int Value;
}
class WaypointTemplate
{
}
}
#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.Drawing;
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Editor
{
class ActorTemplate
{
public Bitmap Bitmap;
public ActorInfo Info;
public EditorAppearanceInfo Appearance;
}
class BrushTemplate
{
public Bitmap Bitmap;
public ushort N;
}
class ResourceTemplate
{
public Bitmap Bitmap;
public ResourceTypeInfo Info;
public int Value;
}
}

View File

@@ -0,0 +1,55 @@
#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.Linq;
using OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
class ActorTool : ITool
{
ActorTemplate Actor;
public ActorTool(ActorTemplate actor) { this.Actor = actor; }
public void Preview(Surface surface, SGraphics g)
{
/* todo: include the player
* in the brush so we can color new buildings too */
surface.DrawActor(g, surface.GetBrushLocation(), Actor, null);
}
public void Apply(Surface surface)
{
if (surface.Map.Actors.Value.Any(a => a.Value.Location() == surface.GetBrushLocation()))
return;
var owner = "Neutral";
var id = NextActorName(surface);
surface.Map.Actors.Value[id] = new ActorReference(Actor.Info.Name.ToLowerInvariant())
{
new LocationInit( surface.GetBrushLocation() ),
new OwnerInit( owner)
};
}
string NextActorName(Surface surface)
{
var id = 0;
for (; ; )
{
var possible = "Actor{0}".F(id++);
if (!surface.Map.Actors.Value.ContainsKey(possible)) return possible;
}
}
}
}

123
OpenRA.Editor/BrushTool.cs Normal file
View File

@@ -0,0 +1,123 @@
#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.Generic;
using System.Windows.Forms;
using OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
class BrushTool : ITool
{
BrushTemplate Brush;
public BrushTool(BrushTemplate brush) { this.Brush = brush; }
public void Apply(Surface surface)
{
// change the bits in the map
var tile = surface.TileSet.Tiles[Brush.N];
var template = surface.TileSet.Templates[Brush.N];
var pos = surface.GetBrushLocation();
if (surface.GetModifiers() == Keys.Shift)
{
FloodFillWithBrush(surface, pos);
return;
}
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
{
if (surface.Map.IsInMap(new int2(u, v) + pos))
{
var z = u + v * template.Size.X;
if (tile.TileBitmapBytes[z] != null)
surface.Map.MapTiles.Value[u + pos.X, v + pos.Y] =
new TileReference<ushort, byte>
{
type = Brush.N,
index = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4) * 4) : (byte)z,
};
var ch = new int2((pos.X + u) / Surface.ChunkSize, (pos.Y + v) / Surface.ChunkSize);
if (surface.Chunks.ContainsKey(ch))
{
surface.Chunks[ch].Dispose();
surface.Chunks.Remove(ch);
}
}
}
}
public void Preview(Surface surface, SGraphics g)
{
g.DrawImage(Brush.Bitmap,
surface.TileSet.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
surface.TileSet.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
Brush.Bitmap.Width * surface.Zoom,
Brush.Bitmap.Height * surface.Zoom);
}
void FloodFillWithBrush(Surface s, int2 pos)
{
var queue = new Queue<int2>();
var replace = s.Map.MapTiles.Value[pos.X, pos.Y];
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])
{
queue.Enqueue(new int2(x, y));
touched[x, y] = true;
}
};
queue.Enqueue(pos);
while (queue.Count > 0)
{
var p = queue.Dequeue();
if (!s.Map.MapTiles.Value[p.X, p.Y].Equals(replace))
continue;
var a = FindEdge(s, p, new int2(-1, 0), replace);
var b = FindEdge(s, p, new int2(1, 0), replace);
for (var x = a.X; x <= b.X; x++)
{
s.Map.MapTiles.Value[x, p.Y] = new TileReference<ushort, byte> { type = Brush.N, index = (byte)0 };
if (s.Map.MapTiles.Value[x, p.Y - 1].Equals(replace))
MaybeEnqueue(x, p.Y - 1);
if (s.Map.MapTiles.Value[x, p.Y + 1].Equals(replace))
MaybeEnqueue(x, p.Y + 1);
}
}
/* todo: optimize */
foreach (var ch in s.Chunks.Values) ch.Dispose();
s.Chunks.Clear();
}
int2 FindEdge(Surface s, int2 p, int2 d, TileReference<ushort, byte> replace)
{
for (; ; )
{
var q = p + d;
if (!s.Map.IsInMap(q)) return p;
if (!s.Map.MapTiles.Value[q.X, q.Y].Equals(replace)) return p;
p = q;
}
}
}
}

View File

@@ -0,0 +1,90 @@
namespace OpenRA.Editor
{
partial class ErrorListDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(10, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(610, 23);
this.label1.TabIndex = 0;
this.label1.Text = "Your map import completed, but with errors:";
//
// listBox1
//
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(13, 30);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(607, 316);
this.listBox1.TabIndex = 1;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(545, 359);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Close";
this.button1.UseVisualStyleBackColor = true;
//
// ErrorListDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(632, 394);
this.Controls.Add(this.button1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ErrorListDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Map Import Errors";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
}
}

View File

@@ -0,0 +1,25 @@
#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.Windows.Forms;
namespace OpenRA.Editor
{
public partial class ErrorListDialog : Form
{
public ErrorListDialog( IEnumerable<string> errors )
{
InitializeComponent();
foreach (var e in errors)
listBox1.Items.Add(e);
}
}
}

544
OpenRA.Editor/Form1.Designer.cs generated Normal file → Executable file
View File

@@ -30,8 +30,9 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pmMiniMap = new System.Windows.Forms.PictureBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tilePalette = new System.Windows.Forms.FlowLayoutPanel();
@@ -40,49 +41,51 @@
this.tabPage3 = new System.Windows.Forms.TabPage();
this.resourcePalette = new System.Windows.Forms.FlowLayoutPanel();
this.surface1 = new OpenRA.Editor.Surface();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton6 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton7 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.tt = new System.Windows.Forms.ToolTip(this.components);
this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.cCRedAlertMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuExport = new System.Windows.Forms.ToolStripMenuItem();
this.mnuMinimapToPNG = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabelFiller = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelMousePosition = new System.Windows.Forms.ToolStripStatusLabel();
this.showActorNamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pmMiniMap)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// toolStripContainer1
//
//
// toolStripContainer1.ContentPanel
//
this.toolStripContainer1.ContentPanel.Controls.Add(this.splitContainer1);
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(985, 680);
this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
this.toolStripContainer1.Name = "toolStripContainer1";
this.toolStripContainer1.Size = new System.Drawing.Size(985, 705);
this.toolStripContainer1.TabIndex = 1;
this.toolStripContainer1.Text = "toolStripContainer1";
//
// toolStripContainer1.TopToolStripPanel
//
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -91,39 +94,67 @@
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tabControl1);
this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.surface1);
this.splitContainer1.Panel2.Controls.Add(this.vScrollBar1);
this.splitContainer1.Panel2.Controls.Add(this.hScrollBar1);
this.splitContainer1.Size = new System.Drawing.Size(985, 680);
this.splitContainer1.Size = new System.Drawing.Size(985, 744);
this.splitContainer1.SplitterDistance = 198;
this.splitContainer1.TabIndex = 0;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.pmMiniMap);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.tabControl1);
this.splitContainer2.Size = new System.Drawing.Size(198, 744);
this.splitContainer2.SplitterDistance = 164;
this.splitContainer2.TabIndex = 1;
//
// pmMiniMap
//
this.pmMiniMap.BackColor = System.Drawing.Color.Black;
this.pmMiniMap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pmMiniMap.Dock = System.Windows.Forms.DockStyle.Fill;
this.pmMiniMap.Location = new System.Drawing.Point(0, 0);
this.pmMiniMap.Name = "pmMiniMap";
this.pmMiniMap.Size = new System.Drawing.Size(198, 164);
this.pmMiniMap.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pmMiniMap.TabIndex = 1;
this.pmMiniMap.TabStop = false;
//
// tabControl1
//
this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.Padding = new System.Drawing.Point(6, 0);
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(198, 680);
this.tabControl1.Size = new System.Drawing.Size(198, 576);
this.tabControl1.TabIndex = 0;
this.tabControl1.Resize += new System.EventHandler(this.surface1_Resize);
//
// tabPage1
//
this.tabPage1.Controls.Add(this.tilePalette);
this.tabPage1.Location = new System.Drawing.Point(23, 4);
this.tabPage1.Location = new System.Drawing.Point(4, 20);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(171, 672);
this.tabPage1.Size = new System.Drawing.Size(190, 552);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Templates";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -135,16 +166,16 @@
this.tilePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.tilePalette.Location = new System.Drawing.Point(3, 3);
this.tilePalette.Name = "tilePalette";
this.tilePalette.Size = new System.Drawing.Size(165, 666);
this.tilePalette.Size = new System.Drawing.Size(184, 546);
this.tilePalette.TabIndex = 1;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.actorPalette);
this.tabPage2.Location = new System.Drawing.Point(23, 4);
this.tabPage2.Location = new System.Drawing.Point(4, 20);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(171, 672);
this.tabPage2.Size = new System.Drawing.Size(190, 552);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Actors";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -156,15 +187,15 @@
this.actorPalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.actorPalette.Location = new System.Drawing.Point(3, 3);
this.actorPalette.Name = "actorPalette";
this.actorPalette.Size = new System.Drawing.Size(165, 666);
this.actorPalette.Size = new System.Drawing.Size(184, 546);
this.actorPalette.TabIndex = 2;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.resourcePalette);
this.tabPage3.Location = new System.Drawing.Point(23, 4);
this.tabPage3.Location = new System.Drawing.Point(4, 20);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(171, 672);
this.tabPage3.Size = new System.Drawing.Size(190, 552);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Resources";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -176,179 +207,330 @@
this.resourcePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.resourcePalette.Location = new System.Drawing.Point(0, 0);
this.resourcePalette.Name = "resourcePalette";
this.resourcePalette.Size = new System.Drawing.Size(171, 672);
this.resourcePalette.Size = new System.Drawing.Size(190, 552);
this.resourcePalette.TabIndex = 3;
//
// surface1
//
this.surface1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.surface1.BackColor = System.Drawing.Color.Black;
this.surface1.Location = new System.Drawing.Point(2, 0);
this.surface1.Dock = System.Windows.Forms.DockStyle.Fill;
this.surface1.Location = new System.Drawing.Point(0, 0);
this.surface1.Name = "surface1";
this.surface1.Size = new System.Drawing.Size(763, 662);
this.surface1.Size = new System.Drawing.Size(783, 744);
this.surface1.TabIndex = 5;
this.surface1.Text = "surface1";
this.surface1.Resize += new System.EventHandler(this.surface1_Resize);
//
// vScrollBar1
//
this.vScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.vScrollBar1.LargeChange = 24;
this.vScrollBar1.Location = new System.Drawing.Point(766, 0);
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(16, 662);
this.vScrollBar1.SmallChange = 24;
this.vScrollBar1.TabIndex = 4;
this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);
//
// hScrollBar1
//
this.hScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.hScrollBar1.LargeChange = 24;
this.hScrollBar1.Location = new System.Drawing.Point(0, 663);
this.hScrollBar1.Name = "hScrollBar1";
this.hScrollBar1.Size = new System.Drawing.Size(765, 16);
this.hScrollBar1.SmallChange = 24;
this.hScrollBar1.TabIndex = 3;
this.hScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.hScrollBar1_Scroll);
//
// toolStrip1
//
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton3,
this.toolStripButton5,
this.toolStripButton4,
this.toolStripButton1,
this.toolStripButton6,
this.toolStripButton7,
this.toolStripButton2});
this.toolStrip1.Location = new System.Drawing.Point(3, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(480, 25);
this.toolStrip1.TabIndex = 0;
//
// toolStripButton3
//
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(51, 22);
this.toolStripButton3.Text = "New";
this.toolStripButton3.Click += new System.EventHandler(this.NewClicked);
//
// toolStripButton5
//
this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image")));
this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton5.Name = "toolStripButton5";
this.toolStripButton5.Size = new System.Drawing.Size(56, 22);
this.toolStripButton5.Text = "Open";
this.toolStripButton5.Click += new System.EventHandler(this.OpenClicked);
//
// toolStripButton4
//
this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(51, 22);
this.toolStripButton4.Text = "Save";
this.toolStripButton4.Click += new System.EventHandler(this.SaveClicked);
//
// toolStripButton1
//
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(76, 22);
this.toolStripButton1.Text = "Save As...";
this.toolStripButton1.Click += new System.EventHandler(this.SaveAsClicked);
//
// toolStripButton6
//
this.toolStripButton6.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton6.Image")));
this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton6.Name = "toolStripButton6";
this.toolStripButton6.Size = new System.Drawing.Size(59, 22);
this.toolStripButton6.Text = "Resize";
this.toolStripButton6.Click += new System.EventHandler(this.ResizeClicked);
//
// toolStripButton7
//
this.toolStripButton7.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton7.Image")));
this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton7.Name = "toolStripButton7";
this.toolStripButton7.Size = new System.Drawing.Size(80, 22);
this.toolStripButton7.Text = "Properties";
this.toolStripButton7.Click += new System.EventHandler(this.PropertiesClicked);
//
// toolStripButton2
//
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(95, 22);
this.toolStripButton2.Text = "Spawnpoints";
this.toolStripButton2.Click += new System.EventHandler(this.SpawnPointsClicked);
//
// tt
//
this.tt.ShowAlways = true;
//
// saveFileDialog
//
this.saveFileDialog.DefaultExt = "*.png";
this.saveFileDialog.Filter = "PNG Image (*.png)|";
this.saveFileDialog.Title = "Export minimap to PNG";
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.menuStrip1);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer3.Size = new System.Drawing.Size(985, 773);
this.splitContainer3.SplitterDistance = 25;
this.splitContainer3.TabIndex = 6;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.mapToolStripMenuItem,
this.toolStripComboBox1,
this.toolStripLabel1});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(985, 27);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.toolStripSeparator1,
this.openToolStripMenuItem,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripSeparator2,
this.toolStripMenuItem1,
this.mnuExport,
this.toolStripSeparator3,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 23);
this.fileToolStripMenuItem.Text = "&File";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.newToolStripMenuItem.Text = "&New...";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewClicked);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(120, 6);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.openToolStripMenuItem.Text = "&Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenClicked);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Enabled = false;
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.saveToolStripMenuItem.Text = "&Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveClicked);
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Enabled = false;
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.saveAsToolStripMenuItem.Text = "Save &As...";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsClicked);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(120, 6);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cCRedAlertMapToolStripMenuItem,
this.bitmapToolStripMenuItem});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(123, 22);
this.toolStripMenuItem1.Text = "&Import";
//
// cCRedAlertMapToolStripMenuItem
//
this.cCRedAlertMapToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cCRedAlertMapToolStripMenuItem.Image")));
this.cCRedAlertMapToolStripMenuItem.Name = "cCRedAlertMapToolStripMenuItem";
this.cCRedAlertMapToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.cCRedAlertMapToolStripMenuItem.Text = "&C&&C / Red Alert Map...";
this.cCRedAlertMapToolStripMenuItem.Click += new System.EventHandler(this.ImportLegacyMapClicked);
//
// bitmapToolStripMenuItem
//
this.bitmapToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("bitmapToolStripMenuItem.Image")));
this.bitmapToolStripMenuItem.Name = "bitmapToolStripMenuItem";
this.bitmapToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.bitmapToolStripMenuItem.Text = "&Bitmap...";
this.bitmapToolStripMenuItem.Visible = false;
//
// mnuExport
//
this.mnuExport.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuMinimapToPNG});
this.mnuExport.Name = "mnuExport";
this.mnuExport.Size = new System.Drawing.Size(123, 22);
this.mnuExport.Text = "&Export";
//
// mnuMinimapToPNG
//
this.mnuMinimapToPNG.Enabled = false;
this.mnuMinimapToPNG.Image = ((System.Drawing.Image)(resources.GetObject("mnuMinimapToPNG.Image")));
this.mnuMinimapToPNG.Name = "mnuMinimapToPNG";
this.mnuMinimapToPNG.Size = new System.Drawing.Size(163, 22);
this.mnuMinimapToPNG.Text = "Minimap to PNG";
this.mnuMinimapToPNG.Click += new System.EventHandler(this.ExportMinimap);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(120, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.CloseClicked);
//
// mapToolStripMenuItem
//
this.mapToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.propertiesToolStripMenuItem,
this.resizeToolStripMenuItem,
this.showActorNamesToolStripMenuItem});
this.mapToolStripMenuItem.Name = "mapToolStripMenuItem";
this.mapToolStripMenuItem.Size = new System.Drawing.Size(43, 23);
this.mapToolStripMenuItem.Text = "&Map";
//
// propertiesToolStripMenuItem
//
this.propertiesToolStripMenuItem.Enabled = false;
this.propertiesToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("propertiesToolStripMenuItem.Image")));
this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem";
this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
this.propertiesToolStripMenuItem.Text = "&Properties...";
this.propertiesToolStripMenuItem.Click += new System.EventHandler(this.PropertiesClicked);
//
// resizeToolStripMenuItem
//
this.resizeToolStripMenuItem.Enabled = false;
this.resizeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("resizeToolStripMenuItem.Image")));
this.resizeToolStripMenuItem.Name = "resizeToolStripMenuItem";
this.resizeToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
this.resizeToolStripMenuItem.Text = "&Resize...";
this.resizeToolStripMenuItem.Click += new System.EventHandler(this.ResizeClicked);
//
// toolStripComboBox1
//
this.toolStripComboBox1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.toolStripComboBox1.Name = "toolStripComboBox1";
this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23);
//
// toolStripLabel1
//
this.toolStripLabel1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripLabel1.Name = "toolStripLabel1";
this.toolStripLabel1.Size = new System.Drawing.Size(71, 20);
this.toolStripLabel1.Text = "Active Mod:";
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabelFiller,
this.toolStripStatusLabelMousePosition});
this.statusStrip1.Location = new System.Drawing.Point(0, 751);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(985, 22);
this.statusStrip1.TabIndex = 7;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabelFiller
//
this.toolStripStatusLabelFiller.Name = "toolStripStatusLabelFiller";
this.toolStripStatusLabelFiller.Size = new System.Drawing.Size(948, 17);
this.toolStripStatusLabelFiller.Spring = true;
//
// toolStripStatusLabelMousePosition
//
this.toolStripStatusLabelMousePosition.Name = "toolStripStatusLabelMousePosition";
this.toolStripStatusLabelMousePosition.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.toolStripStatusLabelMousePosition.Size = new System.Drawing.Size(22, 17);
this.toolStripStatusLabelMousePosition.Text = "0,0";
//
// showActorNamesToolStripMenuItem
//
this.showActorNamesToolStripMenuItem.Name = "showActorNamesToolStripMenuItem";
this.showActorNamesToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
this.showActorNamesToolStripMenuItem.Text = "Show Actor &Names";
this.showActorNamesToolStripMenuItem.Click += new System.EventHandler(this.ShowActorNamesClicked);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(985, 705);
this.Controls.Add(this.toolStripContainer1);
this.ClientSize = new System.Drawing.Size(985, 773);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.splitContainer3);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "OpenRA Editor";
this.toolStripContainer1.ContentPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.PerformLayout();
this.toolStripContainer1.ResumeLayout(false);
this.toolStripContainer1.PerformLayout();
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnFormClosing);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pmMiniMap)).EndInit();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
this.splitContainer3.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolTip tt;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.FlowLayoutPanel tilePalette;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.FlowLayoutPanel actorPalette;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.FlowLayoutPanel resourcePalette;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripButton toolStripButton5;
private System.Windows.Forms.ToolStripButton toolStripButton4;
private System.Windows.Forms.FolderBrowserDialog folderBrowser;
private System.Windows.Forms.ToolStripButton toolStripButton6;
private System.Windows.Forms.ToolStripButton toolStripButton7;
private System.Windows.Forms.VScrollBar vScrollBar1;
private System.Windows.Forms.HScrollBar hScrollBar1;
private System.Windows.Forms.FlowLayoutPanel resourcePalette;
private Surface surface1;
private System.Windows.Forms.PictureBox pmMiniMap;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SaveFileDialog saveFileDialog;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelMousePosition;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelFiller;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem cCRedAlertMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem bitmapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuExport;
private System.Windows.Forms.ToolStripMenuItem mnuMinimapToPNG;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem propertiesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem resizeToolStripMenuItem;
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
private System.Windows.Forms.ToolStripComboBox toolStripComboBox1;
private System.Windows.Forms.ToolStripMenuItem showActorNamesToolStripMenuItem;
}
}

879
OpenRA.Editor/Form1.cs Normal file → Executable file
View File

@@ -1,467 +1,424 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.GameRules;
using OpenRA.Traits;
#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.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Editor
{
public partial class Form1 : Form
{
public Form1(string[] args)
{
InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
currentMod = args.FirstOrDefault() ?? "ra";
toolStripComboBox1.Items.AddRange(Mod.AllMods.Keys.ToArray());
toolStripComboBox1.SelectedIndexChanged += (_, e) =>
{
tilePalette.SuspendLayout();
actorPalette.SuspendLayout();
resourcePalette.SuspendLayout();
tilePalette.Controls.Clear();
actorPalette.Controls.Clear();
resourcePalette.Controls.Clear();
tilePalette.ResumeLayout();
actorPalette.ResumeLayout();
resourcePalette.ResumeLayout();
surface1.Bind(null, null, null);
pmMiniMap.Image = null;
currentMod = toolStripComboBox1.SelectedItem as string;
Text = "OpenRA Editor (mod:{0})".F(currentMod);
Game.modData = new ModData(currentMod);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
loadedMapName = null;
};
toolStripComboBox1.SelectedItem = currentMod;
surface1.AfterChange += OnMapChanged;
surface1.MousePositionChanged += s => toolStripStatusLabelMousePosition.Text = s;
if (args.Length >= 2)
LoadMap(args[1]);
}
void OnMapChanged()
{
MakeDirty();
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
}
void MakeDirty() { dirty = true; }
string loadedMapName;
string currentMod = "ra";
TileSet tileset;
bool dirty = false;
void LoadMap(string mapname)
{
tilePalette.Controls.Clear();
actorPalette.Controls.Clear();
resourcePalette.Controls.Clear();
loadedMapName = mapname;
// load the map
var map = new Map(mapname);
// upgrade maps that have no player definitions. editor doesnt care,
// but this breaks the game pretty badly.
if (map.Players.Count == 0)
map.Players.Add("Neutral", new PlayerReference("Neutral",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
PrepareMapResources(Game.modData.Manifest, map);
dirty = false;
}
void NewMap(Map map)
{
tilePalette.Controls.Clear();
actorPalette.Controls.Clear();
resourcePalette.Controls.Clear();
loadedMapName = null;
PrepareMapResources(Game.modData.Manifest, map);
MakeDirty();
}
// this code is insanely stupid, and mostly my fault -- chrisf
void PrepareMapResources(Manifest manifest, Map map)
{
Rules.LoadRules(manifest, map);
tileset = Rules.TileSets[map.Tileset];
tileset.LoadTiles();
var palette = new Palette(FileSystem.Open(tileset.Palette), true);
surface1.Bind(map, tileset, palette);
// construct the palette of tiles
var palettes = new[] { tilePalette, actorPalette, resourcePalette };
foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); }
foreach (var t in tileset.Templates)
{
try
{
var bitmap = RenderUtils.RenderTemplate(tileset, (ushort)t.Key, palette);
var ibox = new PictureBox
{
Image = bitmap,
Width = bitmap.Width / 2,
Height = bitmap.Height / 2,
SizeMode = PictureBoxSizeMode.StretchImage
};
var brushTemplate = new BrushTemplate { Bitmap = bitmap, N = t.Key };
ibox.Click += (_, e) => surface1.SetTool(new BrushTool(brushTemplate));
var template = t.Value;
tilePalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{1}:{0} ({2}x{3})".F(
template.Image,
template.Id,
template.Size.X,
template.Size.Y));
}
catch { }
}
var actorTemplates = new List<ActorTemplate>();
foreach (var a in Rules.Info.Keys)
{
try
{
var info = Rules.Info[a];
if (!info.Traits.Contains<RenderSimpleInfo>()) continue;
var template = RenderUtils.RenderActor(info, tileset, palette);
var ibox = new PictureBox
{
Image = template.Bitmap,
Width = 32,
Height = 32,
SizeMode = PictureBoxSizeMode.Zoom,
BorderStyle = BorderStyle.FixedSingle
};
ibox.Click += (_, e) => surface1.SetTool(new ActorTool(template));
actorPalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{0}".F(
info.Name));
actorTemplates.Add(template);
}
catch { }
}
surface1.BindActorTemplates(actorTemplates);
var resourceTemplates = new List<ResourceTemplate>();
foreach (var a in Rules.Info["world"].Traits.WithInterface<ResourceTypeInfo>())
{
try
{
var template = RenderUtils.RenderResourceType(a, tileset.Extensions, palette);
var ibox = new PictureBox
{
Image = template.Bitmap,
Width = 32,
Height = 32,
SizeMode = PictureBoxSizeMode.Zoom,
BorderStyle = BorderStyle.FixedSingle
};
ibox.Click += (_, e) => surface1.SetTool(new ResourceTool(template));
resourcePalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{0}:{1}cr".F(
template.Info.Name,
template.Info.ValuePerUnit));
resourceTemplates.Add(template);
}
catch { }
}
surface1.BindResourceTemplates(resourceTemplates);
foreach (var p in palettes)
{
p.Visible = true;
p.ResumeLayout();
}
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
propertiesToolStripMenuItem.Enabled = true;
resizeToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
saveAsToolStripMenuItem.Enabled = true;
mnuMinimapToPNG.Enabled = true; // todo: what is this VB naming bullshit doing here?
}
void ResizeClicked(object sender, EventArgs e)
{
using (var rd = new ResizeDialog())
{
rd.width.Value = surface1.Map.MapSize.X;
rd.height.Value = surface1.Map.MapSize.Y;
rd.cordonLeft.Value = surface1.Map.Bounds.Left;
rd.cordonTop.Value = surface1.Map.Bounds.Top;
rd.cordonRight.Value = surface1.Map.Bounds.Right;
rd.cordonBottom.Value = surface1.Map.Bounds.Bottom;
if (DialogResult.OK != rd.ShowDialog())
return;
surface1.Map.ResizeCordon((int)rd.cordonLeft.Value,
(int)rd.cordonTop.Value,
(int)rd.cordonRight.Value,
(int)rd.cordonBottom.Value);
if ((int)rd.width.Value != surface1.Map.MapSize.X || (int)rd.height.Value != surface1.Map.MapSize.Y)
{
surface1.Map.Resize((int)rd.width.Value, (int)rd.height.Value);
surface1.Bind(surface1.Map, surface1.TileSet, surface1.Palette); // rebind it to invalidate all caches
}
surface1.Invalidate();
}
}
void SaveClicked(object sender, EventArgs e)
{
if (loadedMapName == null)
SaveAsClicked(sender, e);
else
{
surface1.Map.Save(loadedMapName);
dirty = false;
}
}
void SaveAsClicked(object sender, EventArgs e)
{
using (var nms = new MapSelect(currentMod))
{
nms.txtNew.ReadOnly = false;
nms.btnOk.Text = "Save";
nms.txtNew.Text = "unnamed";
nms.txtPathOut.ReadOnly = false;
if (DialogResult.OK == nms.ShowDialog())
{
if (nms.txtNew.Text == "")
nms.txtNew.Text = "unnamed";
// TODO: Allow the user to choose map format (directory vs oramap)
loadedMapName = Path.Combine(nms.MapFolderPath, nms.txtNew.Text + ".oramap");
SaveClicked(sender, e);
}
}
}
void OpenClicked(object sender, EventArgs e)
{
using (var nms = new MapSelect(currentMod))
{
nms.txtNew.ReadOnly = true;
nms.txtPathOut.ReadOnly = true;
nms.btnOk.Text = "Open";
if (DialogResult.OK == nms.ShowDialog())
LoadMap(nms.txtNew.Tag as string);
}
}
void NewClicked(object sender, EventArgs e)
{
using (var nmd = new NewMapDialog())
{
nmd.theater.Items.Clear();
nmd.theater.Items.AddRange(Rules.TileSets.Select(a => a.Value.Id).ToArray());
nmd.theater.SelectedIndex = 0;
if (DialogResult.OK == nmd.ShowDialog())
{
var map = Map.FromTileset(nmd.theater.SelectedItem as string);
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
map.Players.Add("Neutral", new PlayerReference("Neutral", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.Players.Add("Creeps", new PlayerReference("Creeps", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
NewMap(map);
}
}
}
void PropertiesClicked(object sender, EventArgs e)
{
using (var pd = new PropertiesDialog())
{
pd.title.Text = surface1.Map.Title;
pd.desc.Text = surface1.Map.Description;
pd.author.Text = surface1.Map.Author;
pd.selectable.Checked = surface1.Map.Selectable;
pd.useAsShellmap.Checked = surface1.Map.UseAsShellmap;
if (DialogResult.OK != pd.ShowDialog())
return;
surface1.Map.Title = pd.title.Text;
surface1.Map.Description = pd.desc.Text;
surface1.Map.Author = pd.author.Text;
surface1.Map.Selectable = pd.selectable.Checked;
surface1.Map.UseAsShellmap = pd.useAsShellmap.Checked;
}
}
void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = true; }
void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = false; }
void CloseClicked(object sender, EventArgs e)
{
Close();
}
void ImportLegacyMapClicked(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog { RestoreDirectory = true,
Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" })
if (DialogResult.OK == ofd.ShowDialog())
{
/* massive hack: we should be able to call NewMap() with the imported Map object,
* but something's not right internally in it, unless loaded via the real maploader */
var savePath = Path.Combine(Path.GetTempPath(), "OpenRA.Import");
Directory.CreateDirectory(savePath);
namespace OpenRA.Editor
{
public partial class Form1 : Form
{
public Form1(string[] mods)
{
InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
LocateGameRoot();
var errors = new List<string>();
currentMod = mods.FirstOrDefault() ?? "ra";
var map = LegacyMapImporter.Import(ofd.FileName, a => errors.Add(a));
var manifest = new Manifest(new[] { currentMod });
Game.LoadModAssemblies(manifest);
FileSystem.UnmountAll();
foreach (var folder in manifest.Folders) FileSystem.Mount(folder);
foreach (var pkg in manifest.Packages) FileSystem.Mount(pkg);
Rules.LoadRules(manifest, new Map());
if (errors.Count > 0)
using (var eld = new ErrorListDialog(errors))
eld.ShowDialog();
if (!map.Players.ContainsKey("Neutral"))
map.Players.Add("Neutral", new PlayerReference("Neutral",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.Players.Add("Creeps", new PlayerReference("Creeps",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.Save(savePath);
LoadMap(savePath);
loadedMapName = null; /* editor needs to think this hasnt been saved */
Directory.Delete(savePath, true);
MakeDirty();
}
}
void OnFormClosing(object sender, FormClosingEventArgs e)
{
if (!dirty) return;
switch (MessageBox.Show("The map has been modified since it was last saved. " + "\r\n" + "Save changes now?",
"Unsaved Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation))
{
case DialogResult.Yes: SaveClicked(null, EventArgs.Empty); break;
case DialogResult.No: break;
case DialogResult.Cancel: e.Cancel = true; break;
}
}
void ExportMinimap(object sender, EventArgs e)
{
saveFileDialog.InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps");
saveFileDialog.FileName = Path.ChangeExtension(loadedMapName, ".png");
if (DialogResult.OK == saveFileDialog.ShowDialog())
pmMiniMap.Image.Save(saveFileDialog.FileName);
}
string loadedMapName;
string colors;
string currentMod = "ra";
TileSet tileset;
void LoadMap(string mapname)
void ShowActorNamesClicked(object sender, EventArgs e)
{
tilePalette.Controls.Clear();
actorPalette.Controls.Clear();
resourcePalette.Controls.Clear();
loadedMapName = mapname;
var manifest = new Manifest(new[] { currentMod });
Game.LoadModAssemblies(manifest);
FileSystem.UnmountAll();
foreach (var folder in manifest.Folders) FileSystem.Mount(folder);
foreach (var pkg in manifest.Packages) FileSystem.Mount(pkg);
// load the map
var map = new Map(new Folder(mapname));
PrepareMapResources(manifest, map);
}
void NewMap(Map map)
{
tilePalette.Controls.Clear();
actorPalette.Controls.Clear();
resourcePalette.Controls.Clear();
loadedMapName = null;
var manifest = new Manifest(new[] { currentMod });
Game.LoadModAssemblies(manifest);
FileSystem.UnmountAll();
foreach (var folder in manifest.Folders) FileSystem.Mount(folder);
foreach (var pkg in manifest.Packages) FileSystem.Mount(pkg);
PrepareMapResources(manifest, map);
}
void PrepareMapResources(Manifest manifest, Map map)
{
Rules.LoadRules(manifest, map);
// we're also going to need a tileset...
var tsinfo = fileMapping[Pair.New(currentMod, map.Theater)];
tileset = new TileSet("tileset.til", "templates.ini", tsinfo.First);
colors = tsinfo.Second;
var palette = new Palette(FileSystem.Open(map.Theater.ToLowerInvariant() + ".pal"), true);
surface1.Bind(map, tileset, palette);
vScrollBar1.Maximum = map.MapSize.Y*24 - surface1.Height;
hScrollBar1.Maximum = map.MapSize.X*24 - surface1.Width;
// construct the palette of tiles
foreach (var n in tileset.tiles.Keys)
{
try
{
var bitmap = RenderTemplate(tileset, (ushort)n, palette);
var ibox = new PictureBox
{
Image = bitmap,
Width = bitmap.Width / 2,
Height = bitmap.Height / 2,
SizeMode = PictureBoxSizeMode.StretchImage
};
var brushTemplate = new BrushTemplate { Bitmap = bitmap, N = n };
ibox.Click += (_, e) => surface1.SetBrush(brushTemplate);
var template = tileset.walk[n];
tilePalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{1}:{0} ({3}x{4} {2})".F(
template.Name,
template.Index,
template.Bridge,
template.Size.X,
template.Size.Y));
}
catch { }
}
var actorTemplates = new List<ActorTemplate>();
foreach (var a in Rules.Info.Keys)
{
try
{
var info = Rules.Info[a];
var template = RenderActor(info, tsinfo.First, palette);
var ibox = new PictureBox
{
Image = template.Bitmap,
Width = template.Bitmap.Width / 2,
Height = template.Bitmap.Height / 2,
SizeMode = PictureBoxSizeMode.StretchImage
};
ibox.Click += (_, e) => surface1.SetActor(template);
actorPalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{0}:{1}".F(
info.Name,
info.Category));
actorTemplates.Add( template);
}
catch { }
}
surface1.BindActorTemplates(actorTemplates);
var resourceTemplates = new List<ResourceTemplate>();
foreach (var a in Rules.Info["world"].Traits.WithInterface<ResourceTypeInfo>())
{
try
{
var template = RenderResourceType(a, tsinfo.First, palette);
var ibox = new PictureBox
{
Image = template.Bitmap,
Width = template.Bitmap.Width,
Height = template.Bitmap.Height,
SizeMode = PictureBoxSizeMode.StretchImage
};
ibox.Click += (_, e) => surface1.SetResource(template);
resourcePalette.Controls.Add(ibox);
tt.SetToolTip(ibox,
"{0}:{1}cr".F(
template.Info.Name,
template.Info.ValuePerUnit));
resourceTemplates.Add(template);
}
catch { }
}
surface1.BindResourceTemplates(resourceTemplates);
}
void LocateGameRoot()
{
while (!Directory.Exists("mods"))
{
var current = Directory.GetCurrentDirectory();
if (Directory.GetDirectoryRoot(current) == current)
throw new InvalidOperationException("Unable to find game root.");
Directory.SetCurrentDirectory("..");
}
}
static Dictionary<Pair<string, string>, Pair<string, string>> fileMapping = new Dictionary<Pair<string, string>, Pair<string, string>>()
{
{Pair.New("ra","TEMPERAT"),Pair.New("tem","temperat.col")},
{Pair.New("ra","SNOW"),Pair.New("sno","snow.col")},
{Pair.New("ra","INTERIOR"),Pair.New("int","temperat.col")},
{Pair.New("cnc","DESERT"),Pair.New("des","desert.col")},
{Pair.New("cnc","TEMPERAT"),Pair.New("tem","temperat.col")},
{Pair.New("cnc","WINTER"),Pair.New("win","winter.col")},
};
static Bitmap RenderTemplate(TileSet ts, ushort n, Palette p)
{
var template = ts.walk[n];
var tile = ts.tiles[n];
var bitmap = new Bitmap(24 * template.Size.X, 24 * template.Size.Y);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
int* q = (int*)data.Scan0.ToPointer();
var stride = data.Stride >> 2;
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
if (tile.TileBitmapBytes[u + v * template.Size.X] != null)
{
var rawImage = tile.TileBitmapBytes[u + v * template.Size.X];
for (var i = 0; i < 24; i++)
for (var j = 0; j < 24; j++)
q[(v * 24 + j) * stride + u * 24 + i] = p.GetColor(rawImage[i + 24 * j]).ToArgb();
}
else
{
for (var i = 0; i < 24; i++)
for (var j = 0; j < 24; j++)
q[(v * 24 + j) * stride + u * 24 + i] = Color.Transparent.ToArgb();
}
}
bitmap.UnlockBits(data);
return bitmap;
}
static ActorTemplate RenderActor(ActorInfo info, string ext, Palette p)
{
var image = info.Traits.Get<RenderSimpleInfo>().Image ?? info.Name;
using (var s = FileSystem.OpenWithExts(image, "." + ext, ".shp"))
{
var shp = new ShpReader(s);
var frame = shp[0];
var bitmap = new Bitmap(shp.Width, shp.Height);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
int* q = (int*)data.Scan0.ToPointer();
var stride = data.Stride >> 2;
for (var i = 0; i < shp.Width; i++)
for (var j = 0; j < shp.Height; j++)
q[j * stride + i] = p.GetColor(frame.Image[i + shp.Width * j]).ToArgb();
}
bitmap.UnlockBits(data);
return new ActorTemplate { Bitmap = bitmap, Info = info, Centered = !info.Traits.Contains<BuildingInfo>() };
}
}
static ResourceTemplate RenderResourceType(ResourceTypeInfo info, string ext, Palette p)
{
var image = info.SpriteNames[0];
using (var s = FileSystem.OpenWithExts(image, "." + ext, ".shp"))
{
var shp = new ShpReader(s);
var frame = shp[shp.ImageCount - 1];
var bitmap = new Bitmap(shp.Width, shp.Height);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
int* q = (int*)data.Scan0.ToPointer();
var stride = data.Stride >> 2;
for (var i = 0; i < shp.Width; i++)
for (var j = 0; j < shp.Height; j++)
q[j * stride + i] = p.GetColor(frame.Image[i + shp.Width * j]).ToArgb();
}
bitmap.UnlockBits(data);
return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.ImageCount - 1 };
}
}
void ResizeClicked(object sender, EventArgs e)
{
using (var rd = new ResizeDialog())
{
rd.width.Value = surface1.Map.MapSize.X;
rd.height.Value = surface1.Map.MapSize.Y;
rd.cordonLeft.Value = surface1.Map.TopLeft.X;
rd.cordonTop.Value = surface1.Map.TopLeft.Y;
rd.cordonRight.Value = surface1.Map.BottomRight.X;
rd.cordonBottom.Value = surface1.Map.BottomRight.Y;
if (DialogResult.OK != rd.ShowDialog())
return;
surface1.Map.TopLeft = new int2((int)rd.cordonLeft.Value, (int)rd.cordonTop.Value);
surface1.Map.BottomRight = new int2((int)rd.cordonRight.Value, (int)rd.cordonBottom.Value);
if ((int)rd.width.Value != surface1.Map.MapSize.X || (int)rd.height.Value != surface1.Map.MapSize.Y)
{
surface1.Map.Resize((int)rd.width.Value, (int)rd.height.Value);
surface1.Bind(surface1.Map, surface1.TileSet, surface1.Palette); // rebind it to invalidate all caches
vScrollBar1.Maximum = surface1.Map.MapSize.Y * 24 - surface1.Height;
hScrollBar1.Maximum = surface1.Map.MapSize.X * 24 - surface1.Width;
}
surface1.Invalidate();
}
}
void SavePreviewImage(string filepath)
{
var Map = surface1.Map;
var xs = Map.TopLeft.X;
var ys = Map.TopLeft.Y;
var terrainTypeColors = new TerrainColorSet(colors);
var bitmap = new Bitmap(Map.Width, Map.Height);
for (var x = 0; x < Map.Width; x++)
for (var y = 0; y < Map.Height; y++)
bitmap.SetPixel(x, y, terrainTypeColors.ColorForTerrainType(
tileset.GetTerrainType(Map.MapTiles[x + xs, y + ys])));
for (var x = 0; x < Map.Width; x++)
for (var y = 0; y < Map.Height; y++)
if (Map.MapResources[x + xs, y + ys].type > 0)
bitmap.SetPixel(x, y, terrainTypeColors.ColorForTerrainType(TerrainType.Ore));
bitmap.Save(filepath, ImageFormat.Png);
}
void SaveClicked(object sender, EventArgs e)
{
if (loadedMapName == null)
SaveAsClicked(sender, e);
else
{
surface1.Map.PlayerCount = surface1.Map.Waypoints.Count;
surface1.Map.Package = new Folder(loadedMapName);
SavePreviewImage(Path.Combine(loadedMapName, "preview.png"));
surface1.Map.Save(loadedMapName);
}
}
void SaveAsClicked(object sender, EventArgs e)
{
folderBrowser.ShowNewFolderButton = true;
if (DialogResult.OK == folderBrowser.ShowDialog())
{
loadedMapName = folderBrowser.SelectedPath;
SaveClicked(sender, e);
}
}
void OpenClicked(object sender, EventArgs e)
{
folderBrowser.ShowNewFolderButton = true;
if (DialogResult.OK == folderBrowser.ShowDialog())
LoadMap(folderBrowser.SelectedPath);
}
void NewClicked(object sender, EventArgs e)
{
using (var nmd = new NewMapDialog())
{
nmd.theater.Items.Clear();
nmd.theater.Items.AddRange(Rules.Info["world"].Traits.WithInterface<TheaterInfo>()
.Select(a => a.Theater).ToArray());
nmd.theater.SelectedIndex = 0;
if (DialogResult.OK == nmd.ShowDialog())
{
var map = new Map();
map.MapSize = new int2(1, 1);
map.MapResources = new TileReference<byte, byte>[1, 1];
map.MapTiles = new TileReference<ushort, byte>[1, 1]
{ { new TileReference<ushort, byte> {
type = currentMod == "cnc" ? (ushort)0xffu : (ushort)0xffffu,
image = (byte)0xffu,
index = (byte)0xffu } } };
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
map.PlayerCount = 8;
map.TopLeft = new int2((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value);
map.BottomRight = new int2((int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
map.Tileset = nmd.theater.SelectedItem as string;
map.Title = "Name your map here";
map.Description = "Describe your map here";
map.Author = "Your name here";
NewMap(map);
}
}
}
void PropertiesClicked(object sender, EventArgs e)
{
using (var pd = new PropertiesDialog())
{
pd.title.Text = surface1.Map.Title;
pd.desc.Text = surface1.Map.Description;
pd.author.Text = surface1.Map.Author;
pd.selectable.Checked = surface1.Map.Selectable;
if (DialogResult.OK != pd.ShowDialog())
return;
surface1.Map.Title = pd.title.Text;
surface1.Map.Description = pd.desc.Text;
surface1.Map.Author = pd.author.Text;
surface1.Map.Selectable = pd.selectable.Checked;
}
}
void SpawnPointsClicked(object sender, EventArgs e)
{
surface1.SetWaypoint(new WaypointTemplate()); // hack
}
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
surface1.Scroll(new int2(0,e.NewValue-e.OldValue));
}
private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
surface1.Scroll(new int2(e.NewValue - e.OldValue,0));
}
private void surface1_Resize(object sender, EventArgs e)
{
if (surface1.Map == null)
return;
vScrollBar1.Maximum = surface1.Map.MapSize.Y * 24 - surface1.Height;
hScrollBar1.Maximum = surface1.Map.MapSize.X * 24 - surface1.Width;
surface1.ValidateOffset(surface1.Width,surface1.Height);
}
}
}
showActorNamesToolStripMenuItem.Checked ^= true;
surface1.ShowActorNames = showActorNamesToolStripMenuItem.Checked;
}
}
}

530
OpenRA.Editor/Form1.resx Normal file → Executable file
View File

@@ -117,119 +117,427 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>77, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton7.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="folderBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>182, 17</value>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>76, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>198, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHNSURBVDhPjZNdTxNREIb5LV54azSRxJ8gt95445XGa/8A
CU0MMVgIWNmgRSioGN0AapQaISAWrEaITQTkQyhL2WbbWtt1+7ll+7h7SDdBocskk3Mm58xzZt7JaWmx
bTdyk9/rPsz0fbYmz2JqfvSdHhJLPpxzTzMUid13F0D3k/h41V57iU+dI7/dfTqA8zKGBLUohjpurxER
7/24i/RkSnj/47csLsWOB27IZ1DmrlDQJrHIU8q8EbE63UrD7oVe09p243iIqEAPQGVOQJxKRJwfdgE9
gxO8X1wRkIWv/1Ri7A0QD5/HSrWT/HTNTgwIDapayAV0DTwXyQ0/IqwSvXU4hWQn6uwl4usPKCl9pGI+
F2DV6zwaX2BQjgjIiZPpHXrpJjU2di7lao2sXmLiwwYXL18/GeB/KP8HqJgH5Iwy++k/yDOrzQF3+p8d
AZi1A/RCleQvg81ElrHwt+aA232jLqBmWRjFKlq2wM/9HLGtFCOvPjcHdHQPCYBl1SmWTdK5IvFknu/b
GaIrKsEX880B7V1B6rZq5cqhaIqms7aT4cuqyuyygvR0xhvgiOao7Qjm9Byyyw7K80hj0wRGw94tOGPy
cs8fetoLfwGP5fd9L1vD4gAAAABJRU5ErkJggg==
</value>
</data>
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACeklE
QVQ4T6WTWUiUURiG/4suurJIjUIwskQsEANDqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
sEIoFInQcqHE1CwoKsXUUMnt6Z+RLMtA8OK5OZz3Oe/5OEcAhPWwpnBaodZZmqfjWmY5GSo98XJNwq9D
1yQIilLhFaYIMIQuxZaZJ4uy6FS1T2BUIUKdNsdPhL9pqpEp/ne18PiiE94RCjzDco0C+rs1zIzXGvkx
pmNuRI2+XEG9NjV5NYlXuBLP0DzcQwoQaiuUTI9VrQgvfC5irjeSqrJMKovTURcmU5KbxE15HAWyGNH5
e/BCtSab6a+a5ZMXxTD9cdAbsir/CG6Xyvj+qcRY2xBurss28lCfRYNOxr3KdPTqFHQlUspV17mVl0Cx
Mg5VdqyxjVBZks7k+3wMtYdaJdRXKVkYksJw6kreiWuD8dAXBa8j6Krx5UqwR4WgVqUwMZAJH+Tcr1bQ
/ki+tOnPK7wKhA5v5tvcmHnsxNsKOy6ePTohCvYKpXkSvr2RMtyWSL1OzuKgBHpClwRdwWLwNPPtHsy0
HGGy6RCjdfuQhllzxsUs1zBMoUiZyGh3LHe02XQ+E5v0RYqC89AZwOLzk8w+Pc5U82HG6h34Um1LR9pm
/N2scLAxsTEKVFlx9LQkcVebBQNJ8FKs+8KH2VZ3pp44Md7gyIjejo+a3fTKTZGE7MJ+j0Xj8lPOz4ih
tjyT3gfhdOQIy7TLN9Ai20hj8iZqEsxRx1hw4+oO/F13LjraW7ouC3JSo8mRXCAjNoj4y36GyXLO14VT
xw7gfNCO/XbW2FpZYLndjK1bTNhmarLyIa3nKxuyPwG9D9E7Fbto+QAAAABJRU5ErkJggg==
</value>
</data>
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACMklE
QVQ4T6WT3UuTcRTH9y90303QRbc1NYZrMRs86hzKsmFoIb09kqZpunxJUqxMxZYvkK1w6sTlahJOKvIF
TJEUMZaSlZkrWuJQU3QiGHz7nZ+wn0vrQh84Nw98Puc553wfBQDFXorDL18EQOXuXEGHaxlPHItoafbj
kXUW9XU/YLnnxd3yaZSWfEZR4Qfk5Y7japaHoVBwAYF9vUBd7Tq9/Oeztr4BfVIfTic95xUUuJ4tcUFl
xa//wv7FNRw3voJSKcN0yikEjrYFLigt+bmjgDoT/NW3hDCDG4UFMzhpbBUCW+McF1w3f9km2Aq/n/Lj
kORCTvYkEuJtQtDwwMcFmVfGQwR/w0MeH/ZrHZDlURgMViGorfnOBfKl0aBgJ7h35Bv2RTYj5cwbxMbW
C0FV5Qx6usFOCaSeH4bp7CDfNi2MZqbPps6bcD8STa8hSRYhuFU2hS43WAaAVvtvdvdVlN+Z50ulhdHM
GemeIByX0AmdrkIIbhRNwtkONNk2WHAC0Cdnh5TxnBnJl4t557h4Bsc4odWWCYE5b4LBQM39AO9MAgXL
WJhawtinOUxMz0POvY0T+g4Oq6Ps0GiKhYBiaX2I4GeTgOC0/Gp89C7AO7uMazctCNfaGdyC8GOPoY7M
F4KM9Hds7hU+80GdEweOSHjaNQB39xB6+kcw+HYM0QYTlJpGRDD4sKoBKlVOiCDx4oUBHk9KGIWE7kyn
om3Twmhm6kpF8NGITCGgn2K39QfkKu4LIHJHnwAAAABJRU5ErkJggg==
</value>
</data>
<data name="cCRedAlertMapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTs
AIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnpfIHomAARm7M5GSwRF4g4
JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZYu4V8bZMIUfEiK+ICzO5nCwR
3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJX3HcVyzgZAvEl3JJS8/hcxMSBXQd
li7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi2tJFRbY0tba0NDQzMv2qUP91829K3NtF
ehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti0zgAgKSobx3Xv7oPTTwviQJBuo2xcVZWlhGX
wzISF/QP/U+Hv6GvvmckPu6P8tBdOfFMYYqALq4bKy0lTcinZ6QzWRy64Z+H+B8H/nUeBkGceA6fwxNF
hImmjMtLELWbx+YKuGk8Opf3n5r4D8P+pMW5FonS+BFQY4yA1HUqQH7tBygKESDR+8Vd/6NvvvgwIH55
4SqTi3P/7zf9Z8Gl4iWDm/A5ziUohM4S8jMX98TPEqABAUgCKpAHykAd6ABDYAasgC1wBG7AG/iDEBAJ
VgMWSASpgA+yQB7YBApBMdgJ9oBqUAcaQTNoBcdBJzgFzoNL4Bq4AW6D+2AUTIBnYBa8BgsQBGEhMkSB
5CEVSBPSh8wgBmQPuUG+UBAUCcVCCRAPEkJ50GaoGCqDqqF6qBn6HjoJnYeuQIPQXWgMmoZ+h97BCEyC
qbASrAUbwwzYCfaBQ+BVcAK8Bs6FC+AdcCXcAB+FO+Dz8DX4NjwKP4PnEIAQERqiihgiDMQF8UeikHiE
j6xHipAKpAFpRbqRPuQmMorMIG9RGBQFRUcZomxRnqhQFAu1BrUeVYKqRh1GdaB6UTdRY6hZ1Ec0Ga2I
1kfboL3QEegEdBa6EF2BbkK3oy+ib6Mn0K8xGAwNo42xwnhiIjFJmLWYEsw+TBvmHGYQM46Zw2Kx8lh9
rB3WH8vECrCF2CrsUexZ7BB2AvsGR8Sp4Mxw7rgoHA+Xj6vAHcGdwQ3hJnELeCm8Jt4G749n43PwpfhG
fDf+On4Cv0CQJmgT7AghhCTCJkIloZVwkfCA8JJIJKoRrYmBRC5xI7GSeIx4mThGfEuSIemRXEjRJCFp
B+kQ6RzpLuklmUzWIjuSo8gC8g5yM/kC+RH5jQRFwkjCS4ItsUGiRqJDYkjiuSReUlPSSXK1ZK5kheQJ
yeuSM1J4KS0pFymm1HqpGqmTUiNSc9IUaVNpf+lU6RLpI9JXpKdksDJaMm4ybJkCmYMyF2TGKQhFneJC
YVE2UxopFykTVAxVm+pFTaIWU7+jDlBnZWVkl8mGyWbL1sielh2lITQtmhcthVZKO04bpr1borTEaQln
yfYlrUuGlszLLZVzlOPIFcm1yd2WeydPl3eTT5bfJd8p/1ABpaCnEKiQpbBf4aLCzFLqUtulrKVFS48v
vacIK+opBimuVTyo2K84p6Ss5KGUrlSldEFpRpmm7KicpFyufEZ5WoWiYq/CVSlXOavylC5Ld6Kn0Cvp
vfRZVUVVT1Whar3qgOqCmrZaqFq+WpvaQ3WCOkM9Xr1cvUd9VkNFw08jT6NF454mXpOhmai5V7NPc15L
Wytca6tWp9aUtpy2l3audov2Ax2yjoPOGp0GnVu6GF2GbrLuPt0berCehV6iXo3edX1Y31Kfq79Pf9AA
bWBtwDNoMBgxJBk6GWYathiOGdGMfI3yjTqNnhtrGEcZ7zLuM/5oYmGSYtJoct9UxtTbNN+02/R3Mz0z
llmN2S1zsrm7+QbzLvMXy/SXcZbtX3bHgmLhZ7HVosfig6WVJd+y1XLaSsMq1qrWaoRBZQQwShiXrdHW
ztYbrE9Zv7WxtBHYHLf5zdbQNtn2iO3Ucu3lnOWNy8ft1OyYdvV2o/Z0+1j7A/ajDqoOTIcGh8eO6o5s
xybHSSddpySno07PnU2c+c7tzvMuNi7rXM65Iq4erkWuA24ybqFu1W6P3NXcE9xb3Gc9LDzWepzzRHv6
eO7yHPFS8mJ5NXvNelt5r/Pu9SH5BPtU+zz21fPl+3b7wX7efrv9HqzQXMFb0ekP/L38d/s/DNAOWBPw
YyAmMCCwJvBJkGlQXlBfMCU4JvhI8OsQ55DSkPuhOqHC0J4wybDosOaw+XDX8LLw0QjjiHUR1yIVIrmR
XVHYqLCopqi5lW4r96yciLaILoweXqW9KnvVldUKq1NWn46RjGHGnIhFx4bHHol9z/RnNjDn4rziauNm
WS6svaxnbEd2OXuaY8cp40zG28WXxU8l2CXsTphOdEisSJzhunCruS+SPJPqkuaT/ZMPJX9KCU9pS8Wl
xqae5Mnwknm9acpp2WmD6frphemja2zW7Fkzy/fhN2VAGasyugRU0c9Uv1BHuEU4lmmfWZP5Jiss60S2
dDYvuz9HL2d7zmSue+63a1FrWWt78lTzNuWNrXNaV78eWh+3vmeD+oaCDRMbPTYe3kTYlLzpp3yT/LL8
V5vDN3cXKBVsLBjf4rGlpVCikF84stV2a9021DbutoHt5turtn8sYhddLTYprih+X8IqufqN6TeV33za
Eb9joNSydP9OzE7ezuFdDrsOl0mX5ZaN7/bb3VFOLy8qf7UnZs+VimUVdXsJe4V7Ryt9K7uqNKp2Vr2v
Tqy+XeNc01arWLu9dn4fe9/Qfsf9rXVKdcV17w5wD9yp96jvaNBqqDiIOZh58EljWGPft4xvm5sUmoqb
PhziHRo9HHS4t9mqufmI4pHSFrhF2DJ9NProje9cv+tqNWytb6O1FR8Dx4THnn4f+/3wcZ/jPScYJ1p/
0Pyhtp3SXtQBdeR0zHYmdo52RXYNnvQ+2dNt293+o9GPh06pnqo5LXu69AzhTMGZT2dzz86dSz83cz7h
/HhPTM/9CxEXbvUG9g5c9Ll4+ZL7pQt9Tn1nL9tdPnXF5srJq4yrndcsr3X0W/S3/2TxU/uA5UDHdavr
XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS
fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+
tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALDAAACwwBP0AiyAAAAN5JREFUOE+FUwEOAyEI
8+k+7X7GoFBWmZdtISYgtS3csrXsFtvzf2Mv8/8d4Hkec2SLM+IHzJsjdwVAcxQrtl8OsDgBxPMGgKJG
SQkwMlI2zSCS+cuL0YCceHEDAcBbM6gTQOhDDpnBxHqVOsmgdYvmfCxk7q+JpDZN4yQOJhOAOtmslGna
MYE3AN2HeBEmyvhYZ44mL5rRXkijgoAZAA3nCVBzbzM5vuE8x8xmbGIzqE1LkNwHOO2RZmZOjQYTjoWF
g/YYr+qn2QBQSl2ofL8oC6Wb2hIOM8WD+bXOex/mMAFDkP1eQgAAAABJRU5ErkJggg==
</value>
</data>
<data name="bitmapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACR0lE
QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL
xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S
lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V
roiLawdYu+vivwHSWcQM1THz/DQv96+ixeHlVvU71oQFAGTmP+37bdsPBf8WZ4fRFhVEXdcsBQ9srN6Z
pjqQhQUCAmcW29JZxA8fvaWyY5YcawdBOy6oANm2H9A3MMypDLNS7b1flJnFtnQWcVmrB2NhMytD9SpA
TiUA5+CYInQOjWPrH2V7RBzmijdo9x5VKr+yj6ImD9nmelZsS1UBcme/+OPIJIOfv/Gi201ZXQ/hMfFU
Peuktqnbd3QN+U/cXM6tYfmW8ypAQiKdh91TTE7PYHNOYKl6z916F3m+eSNjT1B4vxHjzWoFYrhRwbLN
51SAJOynx8vo5Ay9rimKHzu5XtJDpuU1WZY2Eg1WgrXRJOpNxKdcUyBLN6WoAInnyPh3XvW6KW/4MC9O
z2ki+Wo1CWklROkMCiT8wEm0kXEsCTmrAiTbDtcEpTVdZOS1oDfWk5xZ6RPeQZeUR8zxK0Qe1BO65xjr
t0YotXhjAEAeQ7It8ZSESUjkznIq2bYsTGYW29JZxIs2nFEdLOSdfwFwpvLxRKIY2AAAAABJRU5ErkJg
gg==
</value>
</data>
<data name="mnuMinimapToPNG.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACR0lE
QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL
xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S
lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V
roiLawdYu+vivwHSWcQM1THz/DQv96+ixeHlVvU71oQFAGTmP+37bdsPBf8WZ4fRFhVEXdcsBQ9srN6Z
pjqQhQUCAmcW29JZxA8fvaWyY5YcawdBOy6oANm2H9A3MMypDLNS7b1flJnFtnQWcVmrB2NhMytD9SpA
TiUA5+CYInQOjWPrH2V7RBzmijdo9x5VKr+yj6ImD9nmelZsS1UBcme/+OPIJIOfv/Gi201ZXQ/hMfFU
Peuktqnbd3QN+U/cXM6tYfmW8ypAQiKdh91TTE7PYHNOYKl6z916F3m+eSNjT1B4vxHjzWoFYrhRwbLN
51SAJOynx8vo5Ay9rimKHzu5XtJDpuU1WZY2Eg1WgrXRJOpNxKdcUyBLN6WoAInnyPh3XvW6KW/4MC9O
z2ki+Wo1CWklROkMCiT8wEm0kXEsCTmrAiTbDtcEpTVdZOS1oDfWk5xZ6RPeQZeUR8zxK0Qe1BO65xjr
t0YotXhjAEAeQ7It8ZSESUjkznIq2bYsTGYW29JZxIs2nFEdLOSdfwFwpvLxRKIY2AAAAABJRU5ErkJg
gg==
</value>
</data>
<data name="propertiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACCklE
QVQ4T6WT30tTUQDHz39QD0UQSpAPIkgPyR60AiUiyoGBL4qZjOyt0tZP9tBDk1AsXIhj93ILdd27DPPH
3VwrUrdK2ioJHAgVOdoPaQsarBg43L6ec+akuRsEPnw5D4fP5/vlXg4BQHaSf8LjjwdqaTA2cg+y1Ith
qxmi5Tas/SYWk+QRoPgmtNsLcPq7GYX8+XoTqaUL+KR2cAmDxeBgqeBv2NhWzwUFOBk4g5/zRxB3V8Es
38AtbzuIw/0RLMrMeyhTs2CzGdRtaOTn1dajvLkAR9VKLNvLcHmoExddzSDKzAfkcjkkEtEiOLxoQpdB
z+Er7ScQUg/DL5TD2bsfl5oPoKWnCZ3jehDZGeAC1hwL3uXNs55Jep7Gis/AJWxyTeVe1FXvhq5qH6oP
7nlw/NoxGByNIKPT77CezSEeD6Pn+jlEIiGk6X8N+F9zyfLYIZzUVUCwT0J36jy9yX83KjDq7zSADE8t
cGB7kpksFt76YDzbgMWVFLzBX0WCTcku8mjiTSm8lkUslcHnH2kK/+aw6k+UCJiESE+9XCApz2Gzu5Gk
sEVy4r6got82vRV5blVbIDyZ21rAZrPmL7w5P5s1KxQWXRFtgU15lV8ge2AbdXPY8pAuEIsXWJ6FtAVW
+SWSmXWssuZ4vnl+s5nNFl1hMLjP8U1bMGR/wS/+N9tf7o6eMpNtADko6xybtEXLAAAAAElFTkSuQmCC
</value>
</data>
<data name="resizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAADLklE
QVQ4T3WS60/ScRjFf39CL3rR1ovurduWbbU2t7ZqdlkXt7Lrym6O1VoXcdYqQ54wKlGxABE1CzWF0nIm
lZcoTbyUNJFIzDJSJK+E0qy8wInvz+i2erazfd+cz3m+zw4nTS+FLOeZNim3Vp6UU5sqvf5MSZqnyjhV
pfKUvEx54kqp8rCkWHVQVKSJPHtbs+tUgSYiOicVAMfEqfR1dVFCGSqrX94cHQeN/aXhbyD3Zz91uf3U
9tFHTQ4fzVtH9BOQVdKcW2F6/eKkWA1zcxu6vUAQMmCzk/3AErLtDyFrrY035z16T3PXin8B5LfqZE6P
HyZzKw5FX+Yh4XtjwZKZGV3lNPIkhhojplON3Uc3S9/Q7LDfADKtKYklMsgTkwV7joixKHQr2Nq2fSET
5uQwqtsyjcot45R510ozV8f/2iAhsyolCNh9WIyFoRGYHbIGfYN+SVd7Nznzk8ll0FLzKxdZO3xkaOjG
GYUxcIIfRxSlPU4N/rn1fS8JJVlU1WCT3npggVLfAIWuHjJtNRIyjIhTPEKM7D6OSop4RcXpwZ2Wl11l
gHanmze/c36ioc8jyRlFjSzljxl2daI9Pwuv1Cnw9PRjZeQ1cCcSS68Fza6+IXL2fCG7w0ssmc3o2IR8
gbc1PQU9NUp48sNRcUyAkPBL4AIlUbLk3gEvS6YXrW6p0dx9UZ5n4gHjzBmYAAPPYwRwazeiMXYWqjcs
wLSVInAHRYWq0TEf9Q+NUEsg+fr9t2nF1U71leyqn+u3vPuIl2298HZ2wnxkO5q2LYOtxoKpK86D23tW
r+7zfCVzywAVGT/QVV2LvNDo0Eo0j3mAtbUTiRnFOJ94Axp9LfIKK5Ctq0RDmw9TQuPAsW7bHYNUYLCQ
JL2GRAqjtMDYwV+8wzUAWeY9eIfHYW0fxNodxyGWZeOSPBvzl27C5OXnwG0T5irmr79wgdWTNYyVJFL8
kAeo8wyBA/rx2jGErBIH0nXPsWmPEHcM9YgURGPS0jMTZfiXGKDfM4Y0fVOgA/UgRQWECTpExaqxUyDF
wuUbJjb4H0AQfxtrDqiweLMUc8LEmLEqnv9zUMzM9B1/cM83lepxTAAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>313, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>45</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAMDAAAAEAIACoJQAAJgAAACAgAAABACAAqBAAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAQAAAAQAAAAJQAA
ADcAAAA+AAAAOAAAACoAAAAYAAAACwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAUAAAApAAAAVAAAAGIBAQFNAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAASAAAAOgAA
AFkAAAA6AAAAMQEBAUYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA
AAoAAAAkAAAAUQAAAHkAAACJAAAAhQAAAHMAAABTAAAAMAAAABUAAAAGAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAIAAAAkAAAAaQEBAZYCAgLaAAAAWgAAAAsAAAABAAAAAAAAAAAAAAAAAAAABwAA
AB8AAABMAAAAfwAAAHkAAAA8AgIAwgEBAWkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAQAAAA8AAAA9AAAAgwAAALMAAADFHRcU3QAAAMMAAACgAAAAdwAAAEUAAAAeAAAABwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAUgAAAJgDBATpAgIG/wEAAI8AAAAYAAAABAAA
AAIAAAAOAAAALgAAAGIAAACVAAAApgEAAJUEBADsAwQK/wAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABYAAABPAAAAngAAAMx3YFX3jXZv/5RuY/9mT0X2GxENygcG
BYsAAABKAAAAGgAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAKAAAAQAAAAJMBAQHRBApN/wQK
U/8CAADQAQEARwAAACkAAABIAAAAeQAAAKMAAAC5AgAA1QQGJf8FC1v/AQEHrAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABwAAACEAAABcAAAApQICAtOFc2z8hnJt/5h6
cf+hfXL/mHty/3VkXewZExGLAAAAOQAAAAwAAAABAAAAAQAAAAIAAAAFAAAACAAAABAAAAAqAAAAYwAA
AKABAAC8AwAV+QUWxv8ED4P/BgcX/AEAALAAAACWAAAAsQAAAMkEBArzBAli/wMOtf8CCVD/AwIAbAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAEAAAADQAAAB1AAAAsgcE
BNmHcGj8mYiB/6GMhf+lkIj/moiB/5qIgP9dTUfqAgICYAAAACAAAAAGAAAABAAAAAoAAAAZAAAAKgAA
AEEAAABqAQEBmgEBAbkHCw7dBgcH+QEAi/8FHf//AgG0/wIABP8GFRntBiIw6wcYHf8BAET/AgR6/wMF
X/8DACD5AAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAGwAA
AE8AAACXAAAAxQwLCuGSfHX9momC/5yLg/+cjIX/mYaA/5aGf/+MdWv/GhUSoQAAAEAAAAAXAAAAEAAA
AB8AAAA+AAAAZgAAAIwAAACtCQkJx0A5N+UYdqT/JsXu/wgdZ/8AAIr/Cyx0/x6Rwf8luf3/Jbv//yCd
3P8TYIj/FWaB/xdtjf8EDhfkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAEAAAAIAAAAKQAAAG4AAACxBwYD1HdiWPmcioL/mYiA/56Nhf+ejoX/lYV//5WGf/+Wgnv/U0M96AAA
AHUAAAA4AAAALwAAAEYAAABzAAAApAAAAMIkGRHhIBkT6F1WVfYqPUb/KM3//yOt5f8NN0b/J8r+/ybE
+P8ZfqT/G4ay/x6Tz/8hpej/IKTl/xuLwf8FExmmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAIAAAANAAAANwAAAIQAAAC+IhoW5Jt2av+Qfnf/no6G/5WHgP+vnpb/koJ7/5iG
f/+Zh4D/k4B6/kU4M8UAAABvAAAAagAAAIcAAACsAAAAzAMDAt+FW0z8fV5R/VtQS/2PgHn/UUhH/yKV
tf8z////I62//wcXX/8CBMz/AABw/w9HXv8muv3/Iq30/xh0p/8BAABfAAAABAAAAAIAAAABAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAYAAAAWAAAASAAAAJQAAADESzkz86CCd/+mlI3/rJyT/4Z5
cf+djIX/m4qD/5CAef9xZF7/jHx1/3BiWe0GBQSzAAAAsAAAAMQBAQDWCgUE5U83KfaCa2D/lH11/3hp
Y/+QgHn/noyF/xQODf8SU4X/CBuY/wUK//8BAOn/Cypv/yfC5v8luvf/IJvN/yKx+f8MKzrlAAAAIgAA
ABAAAAAHAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAwAAAAqAAAAZgAAAKgAAADMVEdA+LKg
mP+pmZH/rp+U/4Z3b/9+cGr/joB5/4R3cf9zZ1//dmhi/4p5cv8fHRjlAAAA3AYEBOQgGhfzV0U4/pqA
df+wnpX/no6F/4V1bv9yZF7/ERIX/wUNzf8AAJ//AgK+/wAA8v8LJlr/K9bh/y/w//8NO0r/EEh+/ynZ
//8SVHj/AAAAywAAAEgAAAAnAAAAEgAAAAQAAAABAAAAAAAAAAAAAAABAAAABAAAABcAAABIAAAAjwAA
AMAAAADZZlxV+rSkmv+4qZ//oZGJ/419dv+QgHn/eGlh/35waP+Nf3b/emxl/5KCe/9kVEr+GxQO+Ug9
OP2Mf3j+loZ+/52LhP+qmpH/oZGI/15STf8ICTL/CB30/wUTzv8il4j/HYac/wgcRf8qz93/NP///xZg
av8AAJb/D0W8/y3h/f8TWZ7/AQBY/wYEAPABAQCJAAAAQwAAAB0AAAAIAAAAAAAAAAAAAAABAAAACQAA
ACgAAABoAAAArQAAANCCaV74pJSN/8i4rf+omY//koF6/4t7dP9+b2j/koB5/5uJgv+UhHz/iXlx/3Bh
XP9lW1f/UEM8/4F0bf+jk4r/m4qC/52Nhf+gj4f/OjIs/wgUf/8KKv//AgDw/xlhU/87////L+b//y3g
8P8w7v//F2N//wAAqP8BAP//E1SY/y7n//8PPn//AADr/wYWv/8GCCv/AQMEuQAAAEkAAAAWAAAAAAAA
AAAAAAAEAAAAEQAAADwAAACCAAAAvCUbGOKhjoT+sKCW/7ionf+Yh4D/gHBp/3hoYP+KeHH/kYF4/5+P
h/+Xhn//h3hx/3hoYf+XhoD/cF5V/5WEff+ejYX/nYyF/21hWv8LCQz/ChmV/wop//8IJPr/Ch/z/wcS
of8eiZD/Nv///zP///8jrKD/AABe/wYZ//8CAJ3/H4+m/yrT/v8IGoz/BAzS/wUWy/8GFKX/BQYm/wUG
BOUBAQFBAAAAAAAAAAEAAAAHAAAAHgAAAFUAAACbAAAAyUc/Ou6ejYX/pJOL/6WUjP+ejoX/iXpz/4t7
cv+Xh37/mId//5+Ohv+pmI//koJ5/5GBeP+cjIP/dGNb/4t7dP+bioP/iHx2/zEtKf8hHyT/KipE/yYk
Jv8lIiX/ISEp/xkSPP8REA7/Gnh5/zb//f86//D/IqGV/wAAlf8NMYr/Nv///xhkgf8eKzT/KDg//xca
Hf8lLDP/ERUd/wYHCu0BAQFxAAAAAAAAAAEAAAAMAAAAMAAAAHQAAAC0AwMD1WleWfidjYT/pZSL/5yK
g/+OfHX/hnly/5CBef+Pfnb/m4uA/6aTiP+di4P/moqC/5mJgf+VhX3/lIN7/5eFfv+gjof/nIqE/5iH
gP+djYT/kIF4/5CAeP+Le3P/hnZv/4x9df+UhX3/SD04/xA6bf8XW6z/EESi/wYMPv8y+f//JKu7/1uA
kv+Nx+P/kcvn/1d4jv9KVmr/LD9N/xIfKacAAAAUAAAAAAAAAAIAAAAQAAAARAAAAJMAAADGKSYj5KWV
jP+woJb/pZSM/4V0b/+MfXb/nYyE/5iJgf+UhHv/pI+G/6GRh/+Qf3j/lYR9/6CRiv+ZiID/mYeA/5mI
gf+ci4P/n46G/5iIf/+KenP/gXBo/31tZf+GdG3/iHdv/4d1b/+LhYP/WGRm/wYASP8AAP//BAmf/zHr
4f8jrK3/WH6O/3y71P+JxeH/jcjj/4292f9FWWj+JC86+QkPE3EAAAANAAAAAAAAAAIAAAATAAAAUAAA
AKIAAADNh3p0/K2dk/+snZL/no2F/4N0bf+RgXr/jXx1/5yLg/+YiID/mYiA/5ODfP+NfHX/mYiB/56M
hf+Yh4D/nY2E/5CBeP+Sgnr/loZ+/5qJgf+nl47/nY2E/5SEe/+PfXb/e3Rx/1Zocv9fg5L/Pml+/x4s
Pf8OKmv/Ip6E/xhrdf9kjqD/i8zm/4HC3P+Fwdz/iL7X/32xyv8xPkn/Hiw28wUIClcAAAAMAAAAAAAA
AAIAAAARAAAATQAAAKEAAADWqZqR/6STi/+ikon/b2Nd/3xqZP9wYlr/fm5n/4p5cv+OfXb/i3t0/4V1
bv+MfHX/loR9/5qJgf+WhX3/jn53/4h3b/+Id2//mYmA/6OSiv+hkYn/qJiP/5uNhP9zdnj/T2h6/0uO
rf9UlbP/Z7LP/052hv8RMD3/CSPV/woMIf+GxOD/gsbf/3+/3P+Dvdf/erDJ/3epwv9jla//HTxM6wAD
BEQAAAAFAAAAAAAAAAMAAAAQAAAASgAAAJ4AAADQopOK/56Mhf+gj4f/kX95/4NzbP+DdG3/fGxl/35u
Z/96a2P/dGZf/4R0bf+Nfnb/i3pz/5B/d/+TgXj/nY2E/5+Ohv+di4T/o5KK/6CPiP+fjof/oJGJ/2Vw
dv8/X3T/Y6XF/1WiyP9cosb/drzY/3e51P8JD3b/Ch/e/z1WXv9/wNr/gL3W/4C92v+GxN3/baK9/4G8
1P9/wuH/ETJIlwAAABQAAAACAAAAAQAAAAYAAAAXAAAAUAAAAKIAAADMjoJ5/6iYj/+qmpH/oI+H/5GB
ev+SgXr/lYN8/5GBev+RgXn/koF6/41+dv+Le3L/jXdt/4x6c/+XhX3/mYeA/5iHgP+ejYX/opKJ/5qK
gf+NfnX/a3By/zhhdv9orsv/YKvP/0uZv/9krc3/c7zZ/3u72P8sP1P/Cg8t/2qbrv9zrsf/e7TN/4W/
2P+FwNv/erbR/3Oiwv9pqsf/AwkOUgAAAAgAAAABAAAAAwAAAA0AAAAoAAAAZQAAAKwAAADQm4yE/7Sl
mv+klIv/oI+H/5iGgP+Le3T/lIN8/5ODfP+Ug33/lIJ7/5iHf/+ch3//kX54/3JjXf+Ugnz/loV+/5WE
ff+ai4L/jHx0/4NzbP+HhYP/R2p//1iny/+Iyeb/O3Wo/0+fwv9vvNv/eL/c/3m72P9LcH7/DAoA/4jG
3v93uNH/fL3X/4zD2/9/udX/f8De/4y+1/87cJDxAQIDLgAAAAcAAAAAAAAABwAAABwAAABKAAAAiQAA
AL4AAADap5iP/66elf+hkIj/oI+I/5SDfP+Qf3j/koB5/5KAef+aioL/lYR8/56Ohf+ci4T/mIZ//4Ry
bP+RgXr/momC/458df97bmX/gGRU/4l2bP9Qh6b/XqrO/2Oozf9hp8v/Ya3O/2q72v94vdz/gcbi/3y9
2/9nnbD/U3OB/4zN5/+Bw9z/gL7a/32zyf92sMn/iMfg/3251f8pUWjIAQEBIQAAAAIAAAAAAAAADQAA
ADQAAAB1AAAAsAAAAM8pIyDsrJuS/56Nhf+ejIX/k4J7/4Z1bv+Pfnf/kYF6/4d1b/+cjIP/mouD/5qI
gf+UhH3/i3pz/4t5cv+XhX7/koB5/2teVf94fH//dK/I/2e42P9RkL7/YrDR/1qoyf9eqsv/WqbJ/3bB
3v97w9//fcTh/32+3P+DxN//g8Db/4TJ4/9/v93/gbzX/3Kmv/9qqMD/i7/b/1N/p/8ZLjp9AgQEFgAA
AAAAAAAAAAAAGAAAAEwAAACWAAAAxickIemAcWj/loV+/4t5cv9/bmf/fW1m/3BjW/96aGL/bmBZ/31t
Zv+Ne3X/koF6/4x8df+FdW7/i3t0/5SCe/+Qf3j/gnFq/2trav9rtdT/bLTU/2KjyP9tt9f/X6XI/2Ow
zf9Zp8r/Z7DQ/3m/3v+Axd//fL3b/3/B3v+IzOb/h8nk/4rL5P+ExeP/hMXe/2qeuf92scb/oc7q/0yC
pv8OHihoAQEBDQAAAAAAAAAAAAAAJwAAAGMAAACqBwYG03FjXvqTgnv/bl9Y/3dnYP91Z2D/d2dg/3Bg
W/98bGX/gnNs/3trZP+BcGj/fGxk/3NlXv+EdG3/lIV9/6COh/+NfHX/ZF5a/0p5nP9ajar/WJO9/3K+
2v9/vdz/YKPG/2muzv9cqcn/ZbHR/3K72P9+wN3/hcXi/4fI5P+Jy+T/f8Dc/4fF3/+NzOX/iMbf/3m3
0f9nlrT/b5uz/yhVb+YFCw5KAAEBCQAAAAAAAAAAAAAAQAAAAIMAAAC7CAUF21BEPv5uYFj/hndw/4l6
cv+KenT/momB/5KBev+RgXr/k4F6/5mJgv+Tgnr/iHdw/4p5c/+ThH3/m4yF/6CPiP+CdXH/TnKL/0tv
k/8hITb/M0Zh/2OjyP90u9j/abHO/2etzf9cqMn/Z7HR/3e92f95u9j/eb7b/5PV8P+Mzeb/fsPd/3/D
3f+Szeb/h8Lf/3/A3v+Mu9T/RnGF/hEiMcwAAABAAAAABwAAAAAAAAAAAAAAXgAAAKQAAADMKCUj6ZmH
gP+ejIX/lIN8/5iHf/+YiH//mYeA/5OCe/+UhH3/hXRu/4x6dP+SgHn/mYeA/5qJgf+bioP/loV+/4h3
cf9bXl//bLrc/3S/4P9LdJj/KiNI/z1ehf9mr9L/d77b/1uoy/9Vo8b/bLDN/3q/3P97vdr/hMrj/5LQ
7P+Oz+v/iMzm/4TF3/+Gwdz/hMbh/4rO6P+Oxd7/PGyF/hocHNUCAwNeAAABEQAAAAEAAAAAAAAAdQAA
ALUAAADekIB7/pODev+ejob/mIeA/6iXj/+jkor/mIZ//5KAef+RgHn/jn12/5qIgf+cioP/no2F/6OR
iv+hkYj/iHdw/2JVTf9NfJX/YqrR/3O31/93weH/VoKj/2+y0f9ppM3/ebvb/1Kfxf9nsdD/YKPG/3G3
1v96vNn/gsTg/4rL5/+FyuT/gsTh/4jK5v+Fw93/d7/b/5zT7/97r8//Y6vF/zVZaNwRGx5dAAABEgAA
AAIAAAAAAAAAiQAAAL8jHxzoq5yR/56Nhf+hkIj/rJyT/6mZkP+qmpH/m4uD/5KBev+WhX3/kH55/5WD
fP+VhH3/oo+J/6iXj/+cjIP/c2Ja/3xwaP9WncX/abLS/3O62f9qtNT/d8Hd/3vD4P+MxuP/Y6bM/1up
yv9qtdT/ZK3M/3jA3f95wN//hMrl/4rM5/+Ky+X/hcbk/4rO6P98u9v/hMni/6zZ9f9km77/K1V37gkQ
FGoBAQEHAAAAAAAAAAAAAAAAAAAAngAAAMlZUEzxoI+H/6uckv+omI//oZCJ/6STi/+ikIr/nImD/5aE
ff+aiIH/j313/4x7dP+UhH3/m4mC/6SUi/+Ugnv/cVxO/3ymuv9KibL/dLnZ/3rB3v9fpsj/b73b/3G5
1v99x+P/ZLLQ/02Xwf9rtNj/fMXh/3O52P91vt3/eb7b/37A3f+HyOL/js/p/4/Q6v+Dx+T/erPX/5XL
5/9Jl7v+GjJBrgEBAQoAAAAAAAAAAAAAAAAAAAAAAAAApw0NDdaIeHD9kX95/6qbkf+unpX/j395/459
dv+pmJD/n46H/56Ohf+gkIj/kH95/4x8dv+JeXL/kIB4/5WFfP9yZmH/b36H/2aqzv9nr8//esLe/3m/
3v9rtdT/arbW/2iz0P9rvdr/UqbG/2q41P9gqs3/crjX/2Spzf+AyeT/f8Hd/3m+2/+Cx+H/k9Ht/4rH
5P+Fx+T/mc7p/2amxP8nSF36AAAAawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqBUSEN2Ug3r9lYV8/6OT
iv+klIv/l4V+/4p6dP+omI//p5aO/56Ohf+WhX3/j394/3hoZP9uXFb/emtk/3NnXv9ydXn/bLXV/2Sp
zv92vdz/fcbh/3zE4f9xu9v/Z67Q/16kx/9QnMD/Xq/O/2Wy0f94wN3/c7jV/3q83P9encj/gsrj/33C
3v+CxN//jMjk/4bI4/+Lz+n/lM/q/0d+nf8sLiv3BQYHTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArg8P
DdqSgX38qZiQ/6WVjP+ci4P/lYR9/419d/+KeHH/opGJ/5WFfP91YlX/hGpX/2ZkY/9HUlj/OFVn/1eQ
tf9fpcj/Y6jP/3W+3f96wt7/drrX/36/3f9+x+L/bbjV/2241f9hsc7/ZrTS/2u41P92udX/h83o/4fI
5f97wd3/dr3a/3K72/+DxuL/hsfj/3jA3P+c0+//fLPT/2avyf5HfZLyHzI3SwAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAux0aGuGWhH39rp6V/6qbkf+Yh3//koB6/5B/ef+Rf3j/fWtk/4huXf+jrK//d7jX/2Ow
1v9kstb/Up3I/2Wlyv9krdD/Y6/S/2y52f9ut9b/er3Z/4PG4v99wt7/f8Xh/3jE4P91wd7/bbrW/3W9
2v99w97/hMnl/4jL5/+BxuD/i8/p/3m+3v+Izef/fbzc/4XK4/+s2fX/ZZ7C/y1dhOwTJzK9FxobTQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAxzo0Muqbi4T/saKY/7Cgl/+fjYb/kIB6/49+d/+Bcmn/fGxg/3u7
1P9sqc3/Z6vP/2Kny/9vuNf/abfW/3O72P95w9//cLjV/3C+2v9wuNX/gsTh/33A3/9wudb/db7b/2i1
0v9uutf/cLzY/4HG4v+P0er/icvk/4XH4v+Ozej/itDr/43S7P+O0Ov/hcnm/3q02P+TyeX+SZu//yNH
XKEHBwcnCgkITAAAAAEAAAAAAAAAAAAAAAAAAAABCwsNtZKEfPicjIX/sqKY/66elP+hj4n/opGJ/5GC
ef+OfnP/icbj/1qdw/9ZmL//f8Xh/3fA3f91wd3/eb7d/4PL5f+EyuP/fsbg/3e+3f93vNv/gMHe/3u9
3P9wt9T/dbnW/2m21f9rtNP/cbnW/3693f9dh7T/Ypa8/4bH4f9zp8f/gsLf/47M6P+R0On/jtDs/5jP
6v9mp8X/GTJFrgAAACYCAgISAgMDEwYGBxAAAAAAAAAAAAAAAAAAAAABExMTgJCGffWdj4f/t6ee/6iX
jv+tnJT/pZWM/5KBc/+WtML/ZqbL/2Gkyv9xvt3/fMXh/3rB3v93vdz/g8nl/37E4P90vdn/ecDd/3nA
3f97vdz/d7jV/3a71/96wd7/fr/d/3G41f9zuNX/hcfk/1yMtP9Fa5n/LUd8/2yhxP9RcJj/cqPG/4nC
3/+MyuP/hc3n/5PO6v9Hf5//AwUFYgAAAB8AAAAHBAMDCAsLDBoEBAQHAAAAAAAAAAAAAAAAAAAADwcH
BzMPDg1MPTk2ro6EevKbjYT/o5SK/6GKev95vNn/aqrO/3O61/99xOP/esLe/37E3/96xd//e8Pf/3i9
2v9qstL/a7bT/3W+2v9wtNH/dLnV/2+20/9yvdf/eLnW/36+2/+Mzur/i9Pt/16cxP85XpP/Q1mD/2CV
vf9roMP/jMfi/4nF4f+DyOL/hMnm/2yfwv5lvNn/TImj2wAAABMAAAADAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAABAAAABgAAABYAAAA4FBIQlIKCgux4qsn3dKvM/H/A3f+Ky+j/i8nl/4HG
4v94vdz/gsLf/4TI4v90u9j/dbva/3W51v9xuNf/bbXS/3O82f99vtz/ervZ/4jK5f+T1fL/iMvn/3m8
3v98vt3/TnWg/1qQvP96ttf/h8jk/1aErf9qs9P/n9Tv/2ufv/8lUoL+ECQ0jwAAAAwAAAABAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAACgAAAB4OEBFRHiktejZN
WKdagZTVaY2i4GiRpPF+ssv/kdPv/5DV8f+Fy+f/hMPf/4bI5P9/xuP/ebzb/3m92v94vNn/fMHd/4/Q
6v+W1PD/l9jy/4fF4f9HcqH/aqHI/3Ot0f9Mf6v/h8Xi/3y93f8lTIL/iL/f/3Cx1P8mTG3QAAAAHwAA
AAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAABAAAAAwAAAAcDBAQYBQYHJQYICTsNEhVlJTM8w1Buf/9Zeo7/i87q/4PE4P+SzOn/icbj/3e4
1f97wt//isbi/5PR7f+b2PX/ldPp/4S72v9hmcL/ZqHI/1mMuv+Gw+D/aaPK/1CLuf9hibj/ic3n/kh4
qf8OGCV2AAAADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAADgAAADIAAAByJzlD0Xmz
zvx/vNn/gb/e/3W20/+Exd//k8vn/5nU7/+V0Oz/mNTw/5/a8v9xrtL/UIW0/1WBsP80YJn/h8Pi/4fN
6P9nmsb/SYqz/1+WsvIHCw4+AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAQAAAAPAAAAHxAVGmwxSVajUHqN00Jkdsg8WWW2NlFewXOftfSc1PD/kc7r/4O72/9zrtH/bpzE/2OL
u/9Zi73/ib3d/2WSvf9oiLf/TYCr/z9phdIDBQcsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAAHAwQFFAEBARUAAAAUAAAAJQYHCFUyQkquUnmO7m+i
yf9oosb/cKPC/1N4rP9ZgKz/isPg/2SXwv9Yibf/OnGf/xkoSawAAAAbAAAAAQAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAA
AAcAAAAPAAAAGwUGB2UGBgiAIC40vHGbv/pnm8H+jcfg/1yJvf+Bt9f/T4Op+Q8bInUAAAANAAAAAQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAALAAAAGgkLD1UfLDWMITVCrT1ced93pMf/c6bE/BMd
IVUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAIAAAAFgID
AysUHSFgHC02gQAAAAoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/AB/gfgP
AAD8AD+AcA8AAPwAH8AADwAA/AAPgAAfAAD4AAAAAB8AAPgAAAAAHwAA8AAAAAA/AADwAAAAAD8AAPAA
AAAABwAA4AAAAAABAADgAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAIAAAAAAAAAAgAAAAAAA
AACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAA
AAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAEAAAAAAAAABwAAAAAAAAAP
AAAAAAAAAB8AAAAAAAAAHwAAAAAAAAAfAAAAAAAAAB8AAAAAAAAADgAAAAAAAAAOAAAAAAAAAAcAAAAA
AAAAPwAAwAAAAAA/AADwAAAAAH8AAP8AAAAA/wAA//gAAAD/AAD//wAAAP8AAP//wAAA/wAA///+AAD/
AAD////wAf8AAP////wB/wAAKAAAACAAAABAAAAAAQAgAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAABAAAAEQAAADsAAABeAAAAXwAAAEIAAAAeAAAACAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAFQAAAF8CAgKIAAAAMAAAAAMAAAAAAAAAAAAAAAQAAAAhAAAAXQAAAFMBAQB6AQEBLAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAmAAAAgwAAALwdFxTdAAAAsgAAAHcAAAAyAAAABwAA
AAAAAAAAAAAAAAAAAAAAAAAJAAAAUgICAsECAgb/AQAAVAAAAAQAAAAIAAAALgAAAHwAAACmAgIAwQME
Cv8AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABgAAADkAAACiQTYw5Yp0bv+ObWP9WkVA5SYg
HJQAAAAqAAAABQAAAAEAAAACAAAABAAAABIAAABSAQEBsAQFMPwEC2f0BAQLogEAAG4AAACVAQECxgMF
MeoEC2L/AwIEjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAQAAAAVQAAALJIOzbrmYiB/6OO
h/+aiIH/fGtk9QICAmAAAAATAAAABAAAABIAAAAqAAAAVgEBAZoFBgjLBgcH+QMPxf8CAbT/BAsO9gYi
MOsEDDH/AgR6/wMDP/wAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAACIAAACCAwICzWxd
V/aaiYH/nY2F/5eGgP+UgXn/Ny0nxQAAAEIAAAAgAAAARgAAAIUJBgS4FBEO2DdQXvcnyff/DkGI/xl7
uf8ho9f/IKHZ/x2Ox/8bhbP/DkZf4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAANwAA
AKEiGhbklnpx/56Ohv+ik4v/koJ7/5mHgP+TgHr+Ih0amgAAAGoAAACaAAAAzEQvJ+59XlH9dmlj/lFI
R/8rytr/I62//wUOlv8AAHD/G4Gu/yKt9P8MOlSvAAAABAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAgAA
ABUAAABXAAAAs09BOvaplIz/rZ6U/4p8dP+VhX7/f3Fq/4FybP9IQDrhAAAAxgoJB90wJh3yh29k/ZmG
ff+AcWr/WE9O/wscgP8FD6v/BQzN/xuAqP8iqsr/GHKm/xqDq/kAAAB3AAAAIgAAAAsAAAACAAAAAAAA
AAEAAAAEAAAAMAAAAI8AAADNZlxV+rannf+hkYn/j394/3hpYf+GeG//emxl/3trY/8bFA75a15Y/paG
fv+kk4v/oZGI/zMuQP8IHfT/FFWr/x2GnP8ZdpH/NP///wswgP8PRbz/IJ3O/wEAWP8EAwC9AAAAQwAA
ABMAAAAAAAAAAgAAAA0AAABUAAAAtVNGP+qqmpL/sKGX/4l5cv+Dc2z/koF5/5qJgf+IeXH/emtm/2BR
Sf+Wh3//nIuE/25iXf8iJmH/CSPe/wYQ8v8ff6H/M/P//y3f5P8MMm//AwfR/xlyn/8chcL/Agbf/wYS
l/8DBBXcAgICYgAAAAAAAAAEAAAAHgAAAHgAAADJcmZg96STi/+ikYn/iXpz/5GBeP+Yh3//pJOL/5KC
ef+Xh37/dGNb/5ODfP+IfHb/KSYn/yoqRP8mIyb/ISEp/xURJf8aeHn/OP/3/yKhlf8HGZD/Nv///xtI
W/8oOD//HiMo/xEVHf8DBQWvAAAAAAAAAAgAAAA6AAAAoRcVEt2XiH/+pZSM/49+eP+Sg3v/k4R7/6CN
g/+ejIP/mIeA/5qKgv+XhX7/nIqD/56Mhf+Whn7/iXlw/4h4cP+Hd2//jX95/1BRT/8MJpn/Cieh/yOo
s/8+laX/fLLL/4/K5f9deY//KTZD/AcMEE8AAAAAAAAACwAAAFAAAAC4h3p0/K2dk/+ejYX/int0/418
df+aioL/mYiA/5CAef+ZiIH/m4qD/52NhP+Rgnn/loZ+/6GQiP+djYT/koF5/3t0cf9bdoL/Pml+/xYr
VP8inoT/Pn2L/4vM5v+Dwtz/iL7X/1d4iv8eLDbzAwQFMgAAAAAAAAAKAAAATAAAALqml47/oZGI/4Bx
a/99bWb/fW1m/4R0bf+AcWr/iXly/5F/eP+VhHz/loZ+/5OCev+ejoX/oZGJ/6SVjP9tdXr/WYeg/1Wa
vP9vt9T/OFyE/woh2v9Teo//gcLb/4LA2/90qcP/d6/K/xc2S8EAAQEYAAAAAQAAAA8AAABQAAAAt46C
ef+pmZD/oI+H/5KBev+Vg3z/kYF6/5KBev+MfXT/jXdt/5KAeP+Zh4D/m4qD/6KSif+UhHv/a3By/1CI
of9gq8//WKPG/3O82f9UfZb/Cg8t/2+lu/97tM3/hcDa/3q20f9upsX/AwkOUgAAAAUAAAAFAAAAJwAA
AHcAAADFoZKK/6qakf+gj4j/koF6/5OCe/+VhH7/lYN8/5yKgv+Vgnz/h3dw/5iHgP+Pf3f/hnBk/3l+
gf9Tiqf/abDT/06Ru/9otdX/fcPf/2qiuf8wP0H/hMTd/36+2f+AuNH/hMTf/1uPqu4BAgIoAAAAAwAA
AA0AAABVAAAAsBUREd6sm5L/no2F/5OCe/+LenP/kYF6/5KBef+ai4P/l4Z//4t6c/+Rf3j/koB5/3Jt
av90r8j/XKTL/2Kw0f9cqcr/WqbJ/3nC3/99xOH/gMHe/4PA2/+CxOD/gbzX/26nwP+Lv9v/NlZxvgIE
BBYAAAAAAAAAIAAAAHwDAgLNal9Z+YJya/9+bmf/empj/3ZmYP94amP/gnFq/4d3b/+Dc2z/kIB5/5WD
fP9zaGL/X4qh/2Kkyf9xttb/YKTH/2GszP9msdH/e8Dd/4HB3/+GyeP/g8Xg/4nJ4/+Gxt//cKjC/4i1
z/8iQFOmAQEBCwAAAAAAAABAAAAAnwgFBdtfUkv/hndw/4p6c/+aiYH/koF6/5OBev+Whn7/iHdw/49/
eP+bjIX/kYJ9/05yi/82SGX/M0Zh/2yv0P9psc7/YqvL/2ex0f94vNn/eb7b/5DR6/9+w93/icji/4fC
3/+Gvtn/RnGF/gkRGYYAAAAHAAAAAAAAAGoAAADBXVJO9JuKgv+WhX7/n4+G/5mHgP+Tgnv/inly/5WD
ff+cioP/n46G/49+d/9lam3/Z7LX/2urzP9AU3b/X5m+/3i92/9bp8r/ZqrK/3m82v+Dx+L/jM7p/4XI
5P+GxeD/fsPe/4zG4f9QjKb/GCUqnAAAARIAAAABAAAAiREQD9SrnJH/oI+H/6yck/+qmpH/m4uD/5SD
fP+Qfnn/lYR9/6KPif+ikon/c2Ja/2mHl/9pstL/b7fX/3fB3f+ExeL/Y6bM/2Ovz/9krcz/ecDe/4TK
5f+KzOb/hcbk/4PF4v+EyeL/iLra/ytVd+4FCQs5AAAAAAAAAAAAAACjPDYz5JmHgP+rnJL/mIiB/6CP
h/+ejIX/nIuD/5B+eP+Ofnf/loV9/5CBef9wbWv/ZaPD/3e+3P9wt9b/bbrZ/3G82f9brMv/YazP/3e/
3P9zu9r/fMDc/4HE3/+R0Ov/icrm/4rB4P9blLH+DRohjQEBAQMAAAAAAAAAAAAAAKhVSkbtlYV8/6SU
i/+XhX7/mYmC/6eWjv+aioH/j394/3NiXf96a2T/c25s/2y11f9ts9X/fcbh/3fA3v9nrtD/V6DE/16v
zv9vudf/c7jV/2yt0v+CyuP/gMPf/4zI5P+JzOb/lM/q/zlWY/sFBgdPAAAAAAAAAAAAAAAAAAAAtVZM
SO2sm5P/oZGI/5SCfP+PfXf/kH53/46BeP9+kZf/Xoaa/0V5mP9gosb/Y6zR/3O82/94vNj/f8Tg/3a/
2/9vvNn/arfU/3W92f+Gy+f/g8fj/4HG4v9+xOH/gsLg/5LO6f9xqcv/PG2F5xsmKUwAAAAAAAAAAAAA
AAAAAADHa19a9bGimP+ol4//kIB6/4h4cP98bGD/dLLR/2erz/9psNH/abfW/3a/3P9wuNX/cLvY/4LE
4f93vdv/db7b/2u41f9wvNj/iMzm/4nL5P+KyuX/itDr/47R7P+Fyeb/h7/f/0mbv/8VJzJkCgkITAAA
AAEAAAAAAAAAARAQEJuXioL7taWb/6qZkP+kk4v/ko6J/3i21/9ipsv/fsXh/3jA3f9+xOH/f8bh/3zD
3/95vt3/fL3a/3e82v96vNr/brfV/3vA3f9gj7j/SG+c/26gwf96s9P/jsrl/4rP6v92sc//DhwliAEB
ARgDAwMOBgYGDQAAAAAAAAABAAAADwsLCkA9OTaulImA+aOUiv+No6r/aqrO/3i/3f96wt7/fMXf/3vD
3/9xuNb/a7bT/3O51v90udX/cbrV/3i51v+FxuP/i9Pt/0x9rP9DWYP/ZpvA/4zH4v+Gx+L/hMnm/2mu
zv9MiaPbAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAAVCgkIT0NPWJVJan27Zpas33mq
xPB4ssz8isvn/4TJ5f99v93/e8De/3O51/95vdv/e77b/5HR7f+Q0u3/ca3Q/1yLtP9lncT/h8fj/1mR
uP+Uyuf/Snuh9AgSGlcAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA
AAMCAgIQBQYHJQoND1AlMzzDVXSH/4vO6v+LyOX/icbj/3m92v+KxuL/l9Xx/5XT6f9zqs7/ZqHI/3Co
zf9po8r/WYq5/4nN5/4rSGe7AAAADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAcAAAAuFB0ieE9zhsNonLbpXo+k32SNo+CQxeD9ldHu/4K9
3P9fkbz/Un6x/4jA4P9vocn/S4Wv/ypEU4wAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABQMEBRQBAQEVAAAAJRwl
KoJSeY7ubKLI/3Cjwv9WfKz/isPg/16Qvf86cZ//DRQlZAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAEAAAABAAAABgAAAA4DAwQ+ERcaa0BccbdWfpDWZY+092GVtvsJDxE3AAAAAQAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABQAAABYLEBJGHC02gQAAAAYAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADwD4MD8AeAA+AAAAfgAAAH4AAAD+AAAAPAAAAAgAAAAIAAAACAAAAAgAAAAIAA
AACAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAwAAAAMAAAAHAAAABwAAAAIAAAACAAAAD4AA
AA/4AAAf/4AAH//wAB///gAf///wPw==
</value>
</data>
</root>

20
OpenRA.Editor/ITool.cs Normal file
View File

@@ -0,0 +1,20 @@
#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 SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
interface ITool
{
void Apply(Surface surface);
void Preview(Surface surface, SGraphics g);
}
}

View File

@@ -0,0 +1,485 @@
#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.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Editor
{
public class LegacyMapImporter
{
// Mapping from ra overlay index to type string
static string[] raOverlayNames =
{
"sbag", "cycl", "brik", "fenc", "wood",
"gold01", "gold02", "gold03", "gold04",
"gem01", "gem02", "gem03", "gem04",
"v12", "v13", "v14", "v15", "v16", "v17", "v18",
"fpls", "wcrate", "scrate", "barb", "sbag",
};
static Dictionary<string, Pair<byte, byte>> overlayResourceMapping = new Dictionary<string, Pair<byte, byte>>()
{
// RA Gems, Gold
{ "gold01", new Pair<byte,byte>(1,0) },
{ "gold02", new Pair<byte,byte>(1,1) },
{ "gold03", new Pair<byte,byte>(1,2) },
{ "gold04", new Pair<byte,byte>(1,3) },
{ "gem01", new Pair<byte,byte>(2,0) },
{ "gem02", new Pair<byte,byte>(2,1) },
{ "gem03", new Pair<byte,byte>(2,2) },
{ "gem04", new Pair<byte,byte>(2,3) },
// cnc tiberium
{ "ti1", new Pair<byte,byte>(1,0) },
{ "ti2", new Pair<byte,byte>(1,1) },
{ "ti3", new Pair<byte,byte>(1,2) },
{ "ti4", new Pair<byte,byte>(1,3) },
{ "ti5", new Pair<byte,byte>(1,4) },
{ "ti6", new Pair<byte,byte>(1,5) },
{ "ti7", new Pair<byte,byte>(1,6) },
{ "ti8", new Pair<byte,byte>(1,7) },
{ "ti9", new Pair<byte,byte>(1,8) },
{ "ti10", new Pair<byte,byte>(1,9) },
{ "ti11", new Pair<byte,byte>(1,10) },
{ "ti12", new Pair<byte,byte>(1,11) },
};
static Dictionary<string, string> overlayActorMapping = new Dictionary<string, string>() {
// Fences
{"sbag","sbag"},
{"cycl","cycl"},
{"brik","brik"},
{"fenc","fenc"},
{"wood","wood"},
// Fields
{"v12","v12"},
{"v13","v13"},
{"v14","v14"},
{"v15","v15"},
{"v16","v16"},
{"v17","v17"},
{"v18","v18"},
// Crates
// {"wcrate","crate"},
// {"scrate","crate"},
};
// todo: fix this -- will have bitrotted pretty badly.
static Dictionary<string,Pair<Color,Color>> namedColorMapping = new Dictionary<string, Pair<Color, Color>>()
{
{"gold",Pair.New(Color.FromArgb(246,214,121),Color.FromArgb(40,32,8))},
{"blue",Pair.New(Color.FromArgb(226,230,246),Color.FromArgb(8,20,52))},
{"red",Pair.New(Color.FromArgb(255,20,0),Color.FromArgb(56,0,0))},
{"neutral",Pair.New(Color.FromArgb(238,238,238),Color.FromArgb(44,28,24))},
{"orange",Pair.New(Color.FromArgb(255,230,149),Color.FromArgb(56,0,0))},
{"teal",Pair.New(Color.FromArgb(93,194,165),Color.FromArgb(0,32,32))},
{"salmon",Pair.New(Color.FromArgb(210,153,125),Color.FromArgb(56,0,0))},
{"green",Pair.New(Color.FromArgb(160,240,140),Color.FromArgb(20,20,20))},
{"white",Pair.New(Color.FromArgb(255,255,255),Color.FromArgb(75,75,75))},
{"black",Pair.New(Color.FromArgb(80,80,80),Color.FromArgb(5,5,5))},
};
int MapSize;
int ActorCount = 0;
Map Map = new Map();
List<string> Players = new List<string>();
Action<string> errorHandler;
LegacyMapImporter(string filename, Action<string> errorHandler)
{
this.errorHandler = errorHandler;
ConvertIniMap(filename);
}
public static Map Import(string filename, Action<string> errorHandler)
{
var converter = new LegacyMapImporter(filename, errorHandler);
return converter.Map;
}
enum IniMapFormat { RedAlert = 3, /* otherwise, cnc (2 variants exist, we don't care to differentiate) */ };
public void ConvertIniMap(string iniFile)
{
var file = new IniFile(FileSystem.Open(iniFile));
var basic = file.GetSection("Basic");
var map = file.GetSection("Map");
var legacyMapFormat = (IniMapFormat)int.Parse(basic.GetValue("NewINIFormat", "0"));
var XOffset = int.Parse(map.GetValue("X", "0"));
var YOffset = int.Parse(map.GetValue("Y", "0"));
var Width = int.Parse(map.GetValue("Width", "0"));
var Height = int.Parse(map.GetValue("Height", "0"));
MapSize = (legacyMapFormat == IniMapFormat.RedAlert) ? 128 : 64;
Map.Title = basic.GetValue("Name", "(null)");
Map.Author = "Westwood Studios";
Map.Tileset = Truncate(map.GetValue("Theater", "TEMPERAT"), 8);
Map.MapSize.X = MapSize;
Map.MapSize.Y = MapSize;
Map.Bounds = Rectangle.FromLTRB(XOffset, YOffset, XOffset + Width, YOffset + Height);
Map.Selectable = true;
Map.Smudges = Lazy.New(() => new List<SmudgeReference>());
Map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>());
Map.MapResources = Lazy.New(() => new TileReference<byte, byte>[MapSize, MapSize]);
Map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[MapSize, MapSize]);
if (legacyMapFormat == IniMapFormat.RedAlert)
{
UnpackRATileData(ReadPackedSection(file.GetSection("MapPack")));
UnpackRAOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
ReadRATrees(file);
}
else // CNC
{
UnpackCncTileData(FileSystem.Open(iniFile.Substring(0, iniFile.Length - 4) + ".bin"));
ReadCncOverlay(file);
ReadCncTrees(file);
}
LoadActors(file, "STRUCTURES");
LoadActors(file, "UNITS");
LoadActors(file, "INFANTRY");
LoadSmudges(file, "SMUDGE");
foreach (var p in Players)
LoadPlayer(file, p, (legacyMapFormat == IniMapFormat.RedAlert));
var wps = file.GetSection("Waypoints")
.Where(kv => int.Parse(kv.Value) > 0)
.Select(kv => Pair.New(int.Parse(kv.Key),
LocationFromMapOffset(int.Parse(kv.Value), MapSize)))
.ToArray();
// Add waypoint actors
foreach( var kv in wps )
{
var a = new ActorReference("mpspawn");
a.Add(new LocationInit(kv.Second));
Map.Actors.Value.Add("spawn" + kv.First, a);
}
}
static int2 LocationFromMapOffset(int offset, int mapSize)
{
return new int2(offset % mapSize, offset / mapSize);
}
static MemoryStream ReadPackedSection(IniSection mapPackSection)
{
StringBuilder sb = new StringBuilder();
for (int i = 1; ; i++)
{
string line = mapPackSection.GetValue(i.ToString(), null);
if (line == null)
break;
sb.Append(line.Trim());
}
byte[] data = Convert.FromBase64String(sb.ToString());
List<byte[]> chunks = new List<byte[]>();
BinaryReader reader = new BinaryReader(new MemoryStream(data));
try
{
while (true)
{
uint length = reader.ReadUInt32() & 0xdfffffff;
byte[] dest = new byte[8192];
byte[] src = reader.ReadBytes((int)length);
/*int actualLength =*/
Format80.DecodeInto(src, dest);
chunks.Add(dest);
}
}
catch (EndOfStreamException) { }
MemoryStream ms = new MemoryStream();
foreach (byte[] chunk in chunks)
ms.Write(chunk, 0, chunk.Length);
ms.Position = 0;
return ms;
}
static byte ReadByte(Stream s)
{
int ret = s.ReadByte();
if (ret == -1)
throw new NotImplementedException();
return (byte)ret;
}
static ushort ReadWord(Stream s)
{
ushort ret = ReadByte(s);
ret |= (ushort)(ReadByte(s) << 8);
return ret;
}
void UnpackRATileData(MemoryStream ms)
{
for (int i = 0; i < MapSize; i++)
for (int j = 0; j < MapSize; j++)
Map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
Map.MapTiles.Value[i, j].type = ReadWord(ms);
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
Map.MapTiles.Value[i, j].index = ReadByte(ms);
}
void UnpackRAOverlayData(MemoryStream ms)
{
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
{
byte o = ReadByte(ms);
var res = Pair.New((byte)0, (byte)0);
if (o != 255 && overlayResourceMapping.ContainsKey(raOverlayNames[o]))
res = overlayResourceMapping[raOverlayNames[o]];
Map.MapResources.Value[i, j] = new TileReference<byte, byte>(res.First, res.Second);
if (o != 255 && overlayActorMapping.ContainsKey(raOverlayNames[o]))
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(overlayActorMapping[raOverlayNames[o]])
{
new LocationInit( new int2(i, j) ),
new OwnerInit( "Neutral" )
});
}
}
void ReadRATrees(IniFile file)
{
IniSection terrain = file.GetSection("TERRAIN", true);
if (terrain == null)
return;
foreach (KeyValuePair<string, string> kv in terrain)
{
var loc = int.Parse(kv.Key);
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(kv.Value.ToLowerInvariant())
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
new OwnerInit("Neutral")
});
}
}
void UnpackCncTileData(Stream ms)
{
for (int i = 0; i < MapSize; i++)
for (int j = 0; j < MapSize; j++)
Map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
for (int j = 0; j < MapSize; j++)
for (int i = 0; i < MapSize; i++)
{
Map.MapTiles.Value[i, j].type = ReadByte(ms);
Map.MapTiles.Value[i, j].index = ReadByte(ms);
}
}
void ReadCncOverlay(IniFile file)
{
IniSection overlay = file.GetSection("OVERLAY", true);
if (overlay == null)
return;
foreach (KeyValuePair<string, string> kv in overlay)
{
var loc = int.Parse(kv.Key);
int2 cell = new int2(loc % MapSize, loc / MapSize);
var res = Pair.New((byte)0, (byte)0);
if (overlayResourceMapping.ContainsKey(kv.Value.ToLower()))
res = overlayResourceMapping[kv.Value.ToLower()];
Map.MapResources.Value[cell.X, cell.Y] = new TileReference<byte, byte>(res.First, res.Second);
if (overlayActorMapping.ContainsKey(kv.Value.ToLower()))
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(overlayActorMapping[kv.Value.ToLower()])
{
new LocationInit(cell),
new OwnerInit("Neutral")
});
}
}
void ReadCncTrees(IniFile file)
{
IniSection terrain = file.GetSection("TERRAIN", true);
if (terrain == null)
return;
foreach (KeyValuePair<string, string> kv in terrain)
{
var loc = int.Parse(kv.Key);
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(kv.Value.Split(',')[0].ToLowerInvariant())
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
new OwnerInit("Neutral")
});
}
}
void LoadActors(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//Structures: num=owner,type,health,location,turret-facing,trigger
//Units: num=owner,type,health,location,facing,action,trigger
//Infantry: num=owner,type,health,location,subcell,action,facing,trigger
try
{
var parts = s.Value.Split(',');
var loc = int.Parse(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
if (!Players.Contains(parts[0]))
Players.Add(parts[0]);
var stance = ActorStance.Stance.None;
switch (parts[5])
{
case "Area Guard":
case "Guard":
stance = ActorStance.Stance.Guard;
break;
case "Defend Base":
stance = ActorStance.Stance.Defend;
break;
case "Hunt":
case "Rampage":
case "Attack Base":
case "Attack Units":
case "Attack Civil.":
case "Attack Tarcom":
stance = ActorStance.Stance.Hunt;
break;
case "Retreat":
case "Return":
stance = ActorStance.Stance.Retreat;
break;
// do we care about `Harvest' and `Sticky'?
}
var actor = new ActorReference(parts[1].ToLowerInvariant())
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
new OwnerInit(parts[0]),
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo)/256),
new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])),
new ActorStanceInit(stance),
};
if (section == "INFANTRY")
actor.Add(new SubCellInit(int.Parse(parts[4])));
if (!Rules.Info.ContainsKey(parts[1].ToLowerInvariant()))
errorHandler("Ignoring unknown actor type: `{0}`".F(parts[1].ToLowerInvariant()));
else
Map.Actors.Value.Add("Actor" + ActorCount++, actor);
}
catch (Exception)
{
errorHandler("Malformed actor definition: `{0}`".F(s));
}
}
}
void LoadSmudges(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
{
//loc=type,loc,depth
var parts = s.Value.Split(',');
var loc = int.Parse(parts[1]);
Map.Smudges.Value.Add(new SmudgeReference(parts[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), int.Parse(parts[2])));
}
}
void LoadPlayer(IniFile file, string section, bool isRA)
{
var c = (section == "BadGuy") ? "red" :
(isRA) ? "blue" : "gold";
var color = namedColorMapping[c];
var pr = new PlayerReference
{
Name = section,
OwnsWorld = (section == "Neutral"),
NonCombatant = (section == "Neutral"),
Race = (isRA) ? ((section == "BadGuy") ? "soviet" : "allies") : ((section == "BadGuy") ? "nod" : "gdi"),
ColorRamp = new ColorRamp(
(byte)((color.First.GetHue() / 360.0f) * 255),
(byte)(color.First.GetSaturation() * 255),
(byte)(color.First.GetBrightness() * 255),
(byte)(color.Second.GetBrightness() * 255))
};
var Neutral = new List<string>(){"Neutral"};
foreach (var s in file.GetSection(section, true))
{
Console.WriteLine(s.Key);
switch(s.Key)
{
case "Credits":
pr.InitialCash = int.Parse(s.Value);
break;
case "Allies":
pr.Allies = s.Value.Split(',').Intersect(Players).Except(Neutral).ToArray();
pr.Enemies = s.Value.Split(',').SymmetricDifference(Players).Except(Neutral).ToArray();
break;
}
}
Map.Players.Add(section, pr);
}
static string Truncate(string s, int maxLength)
{
return s.Length <= maxLength ? s : s.Substring(0, maxLength);
}
}
}

375
OpenRA.Editor/MapSelect.Designer.cs generated Normal file
View File

@@ -0,0 +1,375 @@
namespace OpenRA.Editor
{
partial class MapSelect
{
/// <summary>
/// TODO
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// TODO
/// </summary>
/// <param name="disposing">TODO</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// TODO
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapSelect));
this.MapList = new System.Windows.Forms.ListView();
this.colMapName = new System.Windows.Forms.ColumnHeader("(отсутствует)");
this.MapIconsList = new System.Windows.Forms.ImageList(this.components);
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lblNew = new System.Windows.Forms.Label();
this.txtNew = new System.Windows.Forms.TextBox();
this.pbMinimap = new System.Windows.Forms.PictureBox();
this.pnlBottom = new System.Windows.Forms.Panel();
this.txtPathOut = new System.Windows.Forms.TextBox();
this.lblPathOut = new System.Windows.Forms.Label();
this.lblPath = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lblMapList = new System.Windows.Forms.Label();
this.txtDesc = new System.Windows.Forms.TextBox();
this.lblDesc = new System.Windows.Forms.Label();
this.txtTheater = new System.Windows.Forms.TextBox();
this.lblTheater = new System.Windows.Forms.Label();
this.txtAuthor = new System.Windows.Forms.TextBox();
this.lblAuthor = new System.Windows.Forms.Label();
this.txtTitle = new System.Windows.Forms.TextBox();
this.lblMapName = new System.Windows.Forms.Label();
this.lblMinimap = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).BeginInit();
this.pnlBottom.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// MapList
//
this.MapList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colMapName});
this.MapList.FullRowSelect = true;
this.MapList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.MapList.LargeImageList = this.MapIconsList;
this.MapList.Location = new System.Drawing.Point(15, 25);
this.MapList.MultiSelect = false;
this.MapList.Name = "MapList";
this.MapList.Size = new System.Drawing.Size(273, 294);
this.MapList.SmallImageList = this.MapIconsList;
this.MapList.StateImageList = this.MapIconsList;
this.MapList.TabIndex = 0;
this.MapList.UseCompatibleStateImageBehavior = false;
this.MapList.View = System.Windows.Forms.View.Details;
this.MapList.SelectedIndexChanged += new System.EventHandler(this.MapList_SelectedIndexChanged);
//
// colMapName
//
this.colMapName.Text = "Map name";
this.colMapName.Width = 240;
//
// MapIconsList
//
this.MapIconsList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.MapIconsList.ImageSize = new System.Drawing.Size(24, 24);
this.MapIconsList.TransparentColor = System.Drawing.Color.Transparent;
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(407, 35);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOk
//
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(326, 35);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 2;
this.btnOk.Text = "Open";
this.btnOk.UseVisualStyleBackColor = true;
//
// lblNew
//
this.lblNew.AutoSize = true;
this.lblNew.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblNew.Location = new System.Drawing.Point(12, 40);
this.lblNew.Name = "lblNew";
this.lblNew.Size = new System.Drawing.Size(69, 13);
this.lblNew.TabIndex = 3;
this.lblNew.Text = "Map name:";
//
// txtNew
//
this.txtNew.BackColor = System.Drawing.SystemColors.Window;
this.txtNew.Location = new System.Drawing.Point(88, 37);
this.txtNew.Name = "txtNew";
this.txtNew.ReadOnly = true;
this.txtNew.Size = new System.Drawing.Size(232, 20);
this.txtNew.TabIndex = 1;
//
// pbMinimap
//
this.pbMinimap.BackColor = System.Drawing.Color.Black;
this.pbMinimap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pbMinimap.Location = new System.Drawing.Point(32, 25);
this.pbMinimap.Name = "pbMinimap";
this.pbMinimap.Size = new System.Drawing.Size(124, 124);
this.pbMinimap.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbMinimap.TabIndex = 5;
this.pbMinimap.TabStop = false;
//
// pnlBottom
//
this.pnlBottom.Controls.Add(this.pictureBox1);
this.pnlBottom.Controls.Add(this.txtPathOut);
this.pnlBottom.Controls.Add(this.lblPathOut);
this.pnlBottom.Controls.Add(this.lblPath);
this.pnlBottom.Controls.Add(this.btnCancel);
this.pnlBottom.Controls.Add(this.btnOk);
this.pnlBottom.Controls.Add(this.txtNew);
this.pnlBottom.Controls.Add(this.lblNew);
this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlBottom.Location = new System.Drawing.Point(0, 332);
this.pnlBottom.MaximumSize = new System.Drawing.Size(0, 70);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.Size = new System.Drawing.Size(494, 70);
this.pnlBottom.TabIndex = 6;
//
// txtPathOut
//
this.txtPathOut.BackColor = System.Drawing.SystemColors.Window;
this.txtPathOut.Location = new System.Drawing.Point(55, 10);
this.txtPathOut.Name = "txtPathOut";
this.txtPathOut.ReadOnly = true;
this.txtPathOut.Size = new System.Drawing.Size(265, 20);
this.txtPathOut.TabIndex = 0;
this.txtPathOut.TextChanged += new System.EventHandler(this.txtPathOut_TextChanged);
//
// lblPathOut
//
this.lblPathOut.AutoSize = true;
this.lblPathOut.Location = new System.Drawing.Point(55, 13);
this.lblPathOut.Name = "lblPathOut";
this.lblPathOut.Size = new System.Drawing.Size(0, 13);
this.lblPathOut.TabIndex = 6;
//
// lblPath
//
this.lblPath.AutoSize = true;
this.lblPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblPath.Location = new System.Drawing.Point(12, 13);
this.lblPath.Name = "lblPath";
this.lblPath.Size = new System.Drawing.Size(37, 13);
this.lblPath.TabIndex = 5;
this.lblPath.Text = "Path:";
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lblMapList);
this.splitContainer1.Panel1.Controls.Add(this.MapList);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.txtDesc);
this.splitContainer1.Panel2.Controls.Add(this.lblDesc);
this.splitContainer1.Panel2.Controls.Add(this.txtTheater);
this.splitContainer1.Panel2.Controls.Add(this.lblTheater);
this.splitContainer1.Panel2.Controls.Add(this.txtAuthor);
this.splitContainer1.Panel2.Controls.Add(this.lblAuthor);
this.splitContainer1.Panel2.Controls.Add(this.txtTitle);
this.splitContainer1.Panel2.Controls.Add(this.lblMapName);
this.splitContainer1.Panel2.Controls.Add(this.lblMinimap);
this.splitContainer1.Panel2.Controls.Add(this.pbMinimap);
this.splitContainer1.Size = new System.Drawing.Size(494, 332);
this.splitContainer1.SplitterDistance = 300;
this.splitContainer1.TabIndex = 7;
//
// lblMapList
//
this.lblMapList.AutoSize = true;
this.lblMapList.Location = new System.Drawing.Point(12, 9);
this.lblMapList.Name = "lblMapList";
this.lblMapList.Size = new System.Drawing.Size(81, 13);
this.lblMapList.TabIndex = 1;
this.lblMapList.Text = "Available maps:";
//
// txtDesc
//
this.txtDesc.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtDesc.Location = new System.Drawing.Point(16, 289);
this.txtDesc.Name = "txtDesc";
this.txtDesc.ReadOnly = true;
this.txtDesc.Size = new System.Drawing.Size(162, 20);
this.txtDesc.TabIndex = 14;
//
// lblDesc
//
this.lblDesc.AutoSize = true;
this.lblDesc.Location = new System.Drawing.Point(13, 273);
this.lblDesc.Name = "lblDesc";
this.lblDesc.Size = new System.Drawing.Size(63, 13);
this.lblDesc.TabIndex = 13;
this.lblDesc.Text = "Description:";
//
// txtTheater
//
this.txtTheater.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTheater.Location = new System.Drawing.Point(16, 252);
this.txtTheater.Name = "txtTheater";
this.txtTheater.ReadOnly = true;
this.txtTheater.Size = new System.Drawing.Size(162, 20);
this.txtTheater.TabIndex = 12;
//
// lblTheater
//
this.lblTheater.AutoSize = true;
this.lblTheater.Location = new System.Drawing.Point(13, 236);
this.lblTheater.Name = "lblTheater";
this.lblTheater.Size = new System.Drawing.Size(47, 13);
this.lblTheater.TabIndex = 11;
this.lblTheater.Text = "Tileset:";
//
// txtAuthor
//
this.txtAuthor.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtAuthor.Location = new System.Drawing.Point(16, 214);
this.txtAuthor.Name = "txtAuthor";
this.txtAuthor.ReadOnly = true;
this.txtAuthor.Size = new System.Drawing.Size(162, 20);
this.txtAuthor.TabIndex = 10;
//
// lblAuthor
//
this.lblAuthor.AutoSize = true;
this.lblAuthor.Location = new System.Drawing.Point(13, 198);
this.lblAuthor.Name = "lblAuthor";
this.lblAuthor.Size = new System.Drawing.Size(41, 13);
this.lblAuthor.TabIndex = 9;
this.lblAuthor.Text = "Author:";
//
// txtTitle
//
this.txtTitle.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTitle.Location = new System.Drawing.Point(16, 177);
this.txtTitle.Name = "txtTitle";
this.txtTitle.ReadOnly = true;
this.txtTitle.Size = new System.Drawing.Size(162, 20);
this.txtTitle.TabIndex = 8;
//
// lblMapName
//
this.lblMapName.AutoSize = true;
this.lblMapName.Location = new System.Drawing.Point(13, 161);
this.lblMapName.Name = "lblMapName";
this.lblMapName.Size = new System.Drawing.Size(30, 13);
this.lblMapName.TabIndex = 7;
this.lblMapName.Text = "Title:";
//
// lblMinimap
//
this.lblMinimap.AutoSize = true;
this.lblMinimap.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblMinimap.Location = new System.Drawing.Point(29, 9);
this.lblMinimap.Name = "lblMinimap";
this.lblMinimap.Size = new System.Drawing.Size(71, 13);
this.lblMinimap.TabIndex = 6;
this.lblMinimap.Text = "Map preview:";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(336, -9);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(54, 35);
this.pictureBox1.TabIndex = 7;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
//
// MapSelect
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(494, 402);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.pnlBottom);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MapSelect";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select map";
this.Load += new System.EventHandler(this.MapSelect_Load);
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).EndInit();
this.pnlBottom.ResumeLayout(false);
this.pnlBottom.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.ListView MapList;
public System.Windows.Forms.Button btnCancel;
public System.Windows.Forms.Button btnOk;
public System.Windows.Forms.Label lblNew;
public System.Windows.Forms.TextBox txtNew;
public System.Windows.Forms.ColumnHeader colMapName;
public System.Windows.Forms.ImageList MapIconsList;
public System.Windows.Forms.PictureBox pbMinimap;
public System.Windows.Forms.Panel pnlBottom;
public System.Windows.Forms.SplitContainer splitContainer1;
public System.Windows.Forms.Label lblMinimap;
public System.Windows.Forms.TextBox txtTheater;
public System.Windows.Forms.Label lblTheater;
public System.Windows.Forms.TextBox txtAuthor;
public System.Windows.Forms.Label lblAuthor;
public System.Windows.Forms.TextBox txtTitle;
public System.Windows.Forms.Label lblMapName;
public System.Windows.Forms.TextBox txtDesc;
public System.Windows.Forms.Label lblDesc;
public System.Windows.Forms.Label lblMapList;
public System.Windows.Forms.Label lblPathOut;
public System.Windows.Forms.Label lblPath;
public System.Windows.Forms.TextBox txtPathOut;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.IO;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using System.Linq;
namespace OpenRA.Editor
{
public partial class MapSelect : Form
{
public string MapFolderPath;
public MapSelect(string currentMod)
{
MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
.Aggregate(Path.Combine);
InitializeComponent();
MapIconsList.Images.Add(pictureBox1.Image);
}
void MapSelect_Load(object sender, EventArgs e)
{
MapList.Items.Clear();
txtPathOut.Text = MapFolderPath;
foreach (var map in ModData.FindMapsIn(MapFolderPath))
{
ListViewItem map1 = new ListViewItem();
map1.Tag = map;
map1.Text = Path.GetFileNameWithoutExtension(map);
map1.ImageIndex = 0;
MapList.Items.Add(map1);
}
// hack
if (txtNew.Text != "unnamed")
MapList.Items[0].Selected = true;
}
void MapList_SelectedIndexChanged(object sender, EventArgs e)
{
if (MapList.SelectedItems.Count == 1)
{
txtNew.Text = MapList.SelectedItems[0].Text;
txtNew.Tag = MapList.SelectedItems[0].Tag;
var map = new Map(txtNew.Tag as string);
txtTitle.Text = map.Title;
txtAuthor.Text = map.Author;
txtTheater.Text = map.Tileset;
txtDesc.Text = map.Description;
pbMinimap.Image = null;
try
{
pbMinimap.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
}
catch (Exception ed)
{
Console.WriteLine("No map preview image found: {0}", ed.ToString());
}
finally { }
}
}
void txtPathOut_TextChanged(object sender, EventArgs e)
{
MapFolderPath = txtPathOut.Text;
}
}
}

View File

@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="MapIconsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAArjSURBVFhHrVcJUFRXFmVpkE0Wg0ZEMoIBl8RodGSMmVES
R0NiChVxCyIIAmFfhe6maeh9AZodZHFpUFQWcQmKisiuLKLEKFFEcIuljtZMYmI5Uc/c14EZYyapmpq8
qlP/9/+/373v3HPu+19P7/cf+jSlEWHCOEuzZfNn2Yvo3Pj3D/PTjCwYAwtgyeFwFk163Tos2tvtWJZw
zeUjmYFP6vL9fhw31vRPI8/9LnmMrtCWZhtPcJ7hbC/W8DwfnS0LR0t5NKoFazHcqsaprE3YGbMQLrYW
W/7fBAxogjGEd5wcXuPK4jxa60qD75VrfIbKMrYMD7VlPX/Ul49rp8RoyPbFIaEnhpuU6NRGoVa2HKuX
zEj/X8vAVmlIsDY2Nna2sjBd+ee5b7Yq4tfgfm8a7pxNw60OFa6e4uFmhxr/uFSIexfz0VsZh7PaIJzb
F42u8hAcV2/ANz3KF8Hub52kucb+Fv+jAccbm5quWOfxYX5y6Mcnq/IDh1oreX/vOcx9drdbjTudUgye
Tsb1piT0H4/DACUw0JiEh33ZePhlFi7UxOCLtI1o2x6IW2cUqM/egLtdediV9MnjSTYm60bE+Ys8rMzN
zd1c3/vLgVRV3lN1XjkqyzNoNaEUjIvrLXwMtQsw1JqEy/UxuHg0DJcp+KXj8bh0IobOucSGDA8vpqE6
+VNINixBU0kQbp5JJ8jxDSXdeyAE5arlAxTZ/BfRra2tS8Tqwh9L9tQhq6gSabm7odLkoP8oF90V/rjR
LsRgExc32oS40ZFCiQgw2Mgj+gW42pBI4OPSsUh6Jgn1mX4ojXJH865IXDzCx50uDe6fV+P8oQQ4Tx6r
pOATmVteKgdjXu/Mhk1h328rO4TMwn3gp2YhmquEX7gAfYfjcb4qGH0HQ3D5WAiunU7ApfpofH0ymhIS
UwkSqQRb6VoYvm6IZvXG7W4VBVbjwQU1/tanIQZkGDqtwOmSjzHXxXaLsZnZpy85QpdAnfunax/mllRD
ma2FQJyHxORMJAqzwBVpUJgtRLF8E7bxlqKjzA991QEYaIijgFwMt6VggJK60hCFr46F4sqprbjbLaf6
S0icIh1rwy1i3OvNQff+GEgj3r87/c1JLIGfjX1LP/F6KJDlIy1vN4SyQohVRdAU7IVIXQxuSiZ8/OOw
JYyP8EiqfV04Lh2JoHIwMSbiwoFgtO1ah97aTSTMKGIjDl/WhONWl5jKlYrbZ9OJGRWVIg/+axf8SK5a
8WoC5fPm//l2qqIIOaVVECm3QZG5C7L0HZCklYJLTCQKNUiWFYAnykJYRDRaywNxrTGRyhKNKyciiIEY
dFd743z1ZioT6eJkHK41kXDbRFSKbHzTpcJwsxoHc71fTLGzyBix+L/zUFlaWX+VTcFZ4NzSamQXV1Lw
EggkeeBRAsnSfKgyy6DKKcNnxEahIgRfHg5B/7EoDDYn4ma7FD0VAThfG4Cemi3EDI90IKWVq3GbHHKz
nUpCbrh6QokEr5mPTEw4773MQij9aPZY5fNYrC6hEhRAnrkTjJEkcS5ieWokS/IhUZdCrtlJbGQiIjQQ
/YeD0VMVhoTVbmgs8iVBctG11xtdlUHkDGpQpIN7velUAhmG2+W43spclI6K9JWY6TyxlGKOGxWjG53s
5HBMBpZ7+iI6UY44vhoiVTH4ohxCLoTyArqu1OlBll6CZHE20mI9EOjuis3L5uFCbTh6D4Wgu8offYeC
qSRccgcPD/qyMEiBb55VYahFgSuNckhjlr2YaGMqH2ntOiKmEAQGBgbnNviGPg2LFSM4UoiAUD78ghLo
yEVojBhRiQqEx0nAI5sKiBH/z+OgVfuic7c/Lh+NwZndfughDfQdCtL1hKFmEW51ymn1EjpSAh1ytFCL
Pl+nhKebY8XLTYn16DWEgzY2ttdzyI6yjB06+uP4acRANokvhzRRjBR5oe4aN4WupeYgNCIWZ2vj0b17
I/UKf3Tt34jOis9otTyyILmkORUDTRKyqxj9DSI07Y0k26Yhes38Roo3YVQH7OVhGiGR0K7O0epEqCRB
shKwRIQkQrZqMelAIM6ncihII9uQSCXZEi2HSMjDXvVqXKSGdTLbg6z6OVkwGcfLQvHB4jkYbJMS/UL0
1aeSM6So1Hg/oljTR93AupEVYSXhGE+soZa8X+cIlgALzFhg5/HJ6YhIzACXVs9EKiHRMmckSfMQGx0G
rXIldU4/dJSvJx3EoSDZC7OszHByTxTOfZGEq00y9B3lo70iElamhp4Ujy1eN8wIrEOd0BRW6DpiWEwq
giKSdYiIl5IOUskRKh39AmKECZNP7Mg0O6Ci59Pzd4O/NQK7FBvQULyGOmMUpBsX4KqjGTL5qzHQIqJy
iNG6Px5dtYlY7jqhmeKxvUE32C7FGKiP58uf5W6v0ekgPkmNrYIMor4YqcoinQBFdGQrl2ZsB4/cwBJR
Zml/+k0sxcQnQZzgDWHIIni9NQHSHU5IS15EPSEN11ok6G9UQs1dh/lvv/GdkZHR3NEETOhkIUE7zvb1
wRRFwYv0vD3UBTORJCEdSHMhydgFCXVHVnuWEGvZrDewjqmzKbHDNjHmFl5KBlasWokiFwtop5nhyL6p
2JO/CN2HBdSgMpHJ88GH82c8s7b4T1vmUPA3CFxCp19QzBPdtpxdRqon2kkDKRSYXeOJcyBUFMI7IJ70
kYsEgRLTXGbgrzNnwmWqC2Y4OsLZZjx43El4ggXI1zohy24MAFd4u9tj8YLpmD71DTiMtwGHY1A7ygB7
52N29CLULV7qeT+HnFCoPairu87/RC9rTjE8JYJoY/p4lR8lVQAp7Rc+/pHY7OKE61NN8a21MbQpfwC+
m4fbQ7MQNdcCfWMMsTPWDi2yyRgyNkDhOGPYGhpeo97jP5oAcwJjYQ4hk3DOyzvwn9v3HtUJjHXAzSFc
RHHlCAznIyAsCZa2k56u3xT2gtHPmGHCdXtnHh47mKBqjS1K5Q7ITrCjlf8RqXPM0bDUCr3bp2C9nj70
DDinKMYSwmujCbAjY4G9ZrN3tyMLP/D4IT1vP/J21CBeoKaa55MTUhAeK8J7i91v0DMdxqZmgw7Oc74N
iFQ8T5YX6ZzisWI9Uiebo8rKCOcsjLAv1Z72BydUxE5ElcTuKf2P9RunEeGzmD8bTIzsI0I7wc7xdgyf
NiayWVoueZ1qz7zPT8l5McnBqZieYZsYO/a4zF7yaKWP4HlASMKLj9xX4WrXWzhdMxUFlkaI1tPDAZE9
Htc4wWuhOas5Y/oXgUezYDdZdmK2N6zzCfuB1V1GFkulNswT5cFllms73f+QMIWwjCDjGJnUW1rbfu2z
wvXJk85pUH5gieNJdugvd8QV7RSc0TjgiMwevkvH3np1xa/+ZplZE9jecNh14UcPmO8VmnLyfzGr/feU
mB/dY7VjybItdSZhrb6+fvEYY6PuMWOMn7ZbGeILfQNYmnN+mO1o/OBdCw74HAMsMjR8NjL/r+Yx+p3H
XhjKZs93uxMZr4Z/uOb54qWf3bGf4pw3EpC1UPYsS3g0EU9K4uBsI86zYHPOY3MOp4zuRRLyDfT1O941
Mrzvb86Bob4h+0r6zcEmdiFICA2vvT55kLFBYOJhnYt9or06TOmCJ7HTbGxgADpndmaJMU29QxAQKvTo
vhnHkN1nX12/OlgCNoT3CZsIvgRWc9ao2IT/bTD3+BID7N1/zisBWCKOBB/CagKf8PboJP8CoUmu3yhA
ga8AAAAASUVORK5CYII=
</value>
</data>
</root>

24
OpenRA.Editor/NewMapDialog.Designer.cs generated Normal file → Executable file
View File

@@ -55,7 +55,7 @@
this.button2.Location = new System.Drawing.Point(229, 160);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 12;
this.button2.TabIndex = 7;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
@@ -65,7 +65,7 @@
this.button1.Location = new System.Drawing.Point(310, 160);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 13;
this.button1.TabIndex = 8;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
@@ -106,12 +106,13 @@
0});
this.cordonBottom.Name = "cordonBottom";
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
this.cordonBottom.TabIndex = 8;
this.cordonBottom.TabIndex = 5;
this.cordonBottom.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonBottom.Enter += new System.EventHandler(this.SelectText);
//
// cordonTop
//
@@ -129,6 +130,7 @@
0,
0,
0});
this.cordonTop.Enter += new System.EventHandler(this.SelectText);
//
// cordonRight
//
@@ -140,12 +142,13 @@
0});
this.cordonRight.Name = "cordonRight";
this.cordonRight.Size = new System.Drawing.Size(105, 20);
this.cordonRight.TabIndex = 5;
this.cordonRight.TabIndex = 4;
this.cordonRight.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonRight.Enter += new System.EventHandler(this.SelectText);
//
// cordonLeft
//
@@ -157,12 +160,13 @@
0});
this.cordonLeft.Name = "cordonLeft";
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
this.cordonLeft.TabIndex = 7;
this.cordonLeft.TabIndex = 2;
this.cordonLeft.Value = new decimal(new int[] {
16,
0,
0,
0});
this.cordonLeft.Enter += new System.EventHandler(this.SelectText);
//
// height
//
@@ -179,12 +183,13 @@
0});
this.height.Name = "height";
this.height.Size = new System.Drawing.Size(105, 20);
this.height.TabIndex = 6;
this.height.TabIndex = 1;
this.height.Value = new decimal(new int[] {
128,
0,
0,
0});
this.height.Enter += new System.EventHandler(this.SelectText);
//
// width
//
@@ -201,12 +206,13 @@
0});
this.width.Name = "width";
this.width.Size = new System.Drawing.Size(105, 20);
this.width.TabIndex = 4;
this.width.TabIndex = 0;
this.width.Value = new decimal(new int[] {
128,
0,
0,
0});
this.width.Enter += new System.EventHandler(this.SelectText);
//
// label4
//
@@ -215,7 +221,7 @@
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 14;
this.label4.Text = "Theater";
this.label4.Text = "Tileset";
//
// theater
//
@@ -224,7 +230,7 @@
this.theater.Location = new System.Drawing.Point(169, 121);
this.theater.Name = "theater";
this.theater.Size = new System.Drawing.Size(216, 21);
this.theater.TabIndex = 15;
this.theater.TabIndex = 6;
//
// NewMapDialog
//

46
OpenRA.Editor/NewMapDialog.cs Normal file → Executable file
View File

@@ -1,19 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OpenRA.Editor
{
public partial class NewMapDialog : Form
{
public NewMapDialog()
{
InitializeComponent();
}
}
}
#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.Windows.Forms;
namespace OpenRA.Editor
{
public partial class NewMapDialog : Form
{
public NewMapDialog()
{
InitializeComponent();
}
private void SelectText(object sender, System.EventArgs e)
{
(sender as NumericUpDown).Select(0, (sender as NumericUpDown).ToString().Length);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -12,17 +12,19 @@
<AssemblyName>OpenRA.Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -31,6 +33,8 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -44,19 +48,34 @@
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActorTemplate.cs" />
<Compile Include="ActorTool.cs" />
<Compile Include="BrushTool.cs" />
<Compile Include="ErrorListDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ErrorListDialog.Designer.cs">
<DependentUpon>ErrorListDialog.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="ITool.cs" />
<Compile Include="LegacyMapImporter.cs" />
<Compile Include="MapSelect.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MapSelect.Designer.cs">
<DependentUpon>MapSelect.cs</DependentUpon>
</Compile>
<Compile Include="NewMapDialog.cs">
<SubType>Form</SubType>
</Compile>
@@ -74,6 +93,9 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MapSelect.resx">
<DependentUpon>MapSelect.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewMapDialog.resx">
<DependentUpon>NewMapDialog.cs</DependentUpon>
</EmbeddedResource>
@@ -101,12 +123,14 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RenderUtils.cs" />
<Compile Include="ResizeDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ResizeDialog.Designer.cs">
<DependentUpon>ResizeDialog.cs</DependentUpon>
</Compile>
<Compile Include="ResourceTool.cs" />
<Compile Include="Surface.cs">
<SubType>Component</SubType>
</Compile>
@@ -121,7 +145,10 @@
<Name>OpenRA.Game</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Content Include="OpenRA.Editor.Icon.ico" />
</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">

View File

@@ -1,18 +1,59 @@
using System;
using System.Globalization;
using System.Windows.Forms;
#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.Editor
{
static class Program
{
[STAThread]
static void Main( string[] args )
{
Application.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args));
}
}
}
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
namespace OpenRA.Editor
{
static class Program
{
[STAThread]
static void Main( string[] args )
{
if (args.Length >= 2 && args[0] == "--convert")
{
Game.modData = new ModData(args[1]);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
UpgradeMaps(args[1]);
return;
}
Application.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args));
}
static void UpgradeMaps(string mod)
{
var MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" }
.Aggregate(Path.Combine);
foreach (var path in ModData.FindMapsIn(MapFolderPath))
{
var map = new Map(path);
// Touch the lazy bits to initialize them
map.Actors.Force();
map.Smudges.Force();
map.MapTiles.Force();
map.MapResources.Force();
map.Save(path);
}
}
}
}

View File

@@ -28,119 +28,131 @@
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.desc = new System.Windows.Forms.TextBox();
this.selectable = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.author = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(196, 193);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 14;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(277, 193);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 15;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Title";
//
// title
//
this.title.Location = new System.Drawing.Point(66, 47);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(286, 20);
this.title.TabIndex = 17;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 16;
this.label2.Text = "Desc";
//
// desc
//
this.desc.Location = new System.Drawing.Point(66, 73);
this.desc.Name = "desc";
this.desc.Size = new System.Drawing.Size(286, 20);
this.desc.TabIndex = 17;
//
// selectable
//
this.selectable.AutoSize = true;
this.selectable.Location = new System.Drawing.Point(118, 138);
this.selectable.Name = "selectable";
this.selectable.Size = new System.Drawing.Size(130, 17);
this.selectable.TabIndex = 18;
this.selectable.Text = "Show in Map Chooser";
this.selectable.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 102);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 16;
this.label3.Text = "Author";
//
// author
//
this.author.Location = new System.Drawing.Point(66, 99);
this.author.Name = "author";
this.author.Size = new System.Drawing.Size(286, 20);
this.author.TabIndex = 17;
//
// PropertiesDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(370, 228);
this.Controls.Add(this.selectable);
this.Controls.Add(this.author);
this.Controls.Add(this.label3);
this.Controls.Add(this.desc);
this.Controls.Add(this.label2);
this.Controls.Add(this.title);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "PropertiesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "PropertiesDialog";
this.ResumeLayout(false);
this.PerformLayout();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.desc = new System.Windows.Forms.TextBox();
this.selectable = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.author = new System.Windows.Forms.TextBox();
this.useAsShellmap = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(196, 193);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 14;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(277, 193);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 15;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Title";
//
// title
//
this.title.Location = new System.Drawing.Point(66, 47);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(286, 20);
this.title.TabIndex = 17;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 16;
this.label2.Text = "Desc";
//
// desc
//
this.desc.Location = new System.Drawing.Point(66, 73);
this.desc.Name = "desc";
this.desc.Size = new System.Drawing.Size(286, 20);
this.desc.TabIndex = 17;
//
// selectable
//
this.selectable.AutoSize = true;
this.selectable.Location = new System.Drawing.Point(118, 138);
this.selectable.Name = "selectable";
this.selectable.Size = new System.Drawing.Size(130, 17);
this.selectable.TabIndex = 18;
this.selectable.Text = "Show in Map Chooser";
this.selectable.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 102);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 16;
this.label3.Text = "Author";
//
// author
//
this.author.Location = new System.Drawing.Point(66, 99);
this.author.Name = "author";
this.author.Size = new System.Drawing.Size(286, 20);
this.author.TabIndex = 17;
//
// checkBox1
//
this.useAsShellmap.AutoSize = true;
this.useAsShellmap.Location = new System.Drawing.Point(118, 161);
this.useAsShellmap.Name = "checkBox1";
this.useAsShellmap.Size = new System.Drawing.Size(105, 17);
this.useAsShellmap.TabIndex = 18;
this.useAsShellmap.Text = "Use as Shellmap";
this.useAsShellmap.UseVisualStyleBackColor = true;
//
// PropertiesDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(370, 228);
this.Controls.Add(this.useAsShellmap);
this.Controls.Add(this.selectable);
this.Controls.Add(this.author);
this.Controls.Add(this.label3);
this.Controls.Add(this.desc);
this.Controls.Add(this.label2);
this.Controls.Add(this.title);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "PropertiesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "PropertiesDialog";
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -155,5 +167,6 @@
public System.Windows.Forms.CheckBox selectable;
private System.Windows.Forms.Label label3;
public System.Windows.Forms.TextBox author;
public System.Windows.Forms.CheckBox useAsShellmap;
}
}

View File

@@ -1,12 +1,22 @@
using System.Windows.Forms;
namespace OpenRA.Editor
{
public partial class PropertiesDialog : Form
{
public PropertiesDialog()
{
InitializeComponent();
}
}
}
#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.Windows.Forms;
namespace OpenRA.Editor
{
public partial class PropertiesDialog : Form
{
public PropertiesDialog()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,156 @@
#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;
using System.Drawing.Imaging;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Editor
{
static class RenderUtils
{
public static ColorPalette MakeSystemPalette(Palette p)
{
ColorPalette pal;
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
pal = b.Palette;
for (var i = 0; i < 256; i++)
pal.Entries[i] = p.GetColor(i);
return pal;
}
public static Bitmap RenderTemplate(TileSet ts, ushort n, Palette p)
{
var template = ts.Templates[n];
var tile = ts.Tiles[n];
var bitmap = new Bitmap(ts.TileSize * template.Size.X, ts.TileSize * template.Size.Y,
PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var stride = data.Stride;
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
if (tile.TileBitmapBytes[u + v * template.Size.X] != null)
{
var rawImage = tile.TileBitmapBytes[u + v * template.Size.X];
for (var i = 0; i < ts.TileSize; i++)
for (var j = 0; j < ts.TileSize; j++)
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = rawImage[i + ts.TileSize * j];
}
else
{
for (var i = 0; i < ts.TileSize; i++)
for (var j = 0; j < ts.TileSize; j++)
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = 0;
}
}
bitmap.UnlockBits(data);
return bitmap;
}
static Bitmap RenderShp(ShpReader shp, Palette p)
{
var frame = shp[0];
var bitmap = new Bitmap(shp.Width, shp.Height, PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var stride2 = data.Stride;
for (var i = 0; i < shp.Width; i++)
for (var j = 0; j < shp.Height; j++)
q[j * stride2 + i] = frame.Image[i + shp.Width * j];
}
bitmap.UnlockBits(data);
return bitmap;
}
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, Palette p)
{
var ri = info.Traits.Get<RenderSimpleInfo>();
var image = RenderSimple.GetImage(info, tileset.Id);
using (var s = FileSystem.OpenWithExts(image, tileset.Extensions))
{
var shp = new ShpReader(s);
var bitmap = RenderShp(shp, p);
try
{
using (var s2 = FileSystem.OpenWithExts(image + "2", tileset.Extensions))
{
var shp2 = new ShpReader(s2);
var roofBitmap = RenderShp(shp2, p);
using (var g = System.Drawing.Graphics.FromImage(bitmap))
g.DrawImage(roofBitmap, 0, 0);
}
}
catch { }
return new ActorTemplate
{
Bitmap = bitmap,
Info = info,
Appearance = info.Traits.GetOrDefault<EditorAppearanceInfo>()
};
}
}
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, string[] exts, Palette p)
{
var image = info.SpriteNames[0];
using (var s = FileSystem.OpenWithExts(image, exts))
{
var shp = new ShpReader(s);
var frame = shp[shp.ImageCount - 1];
var bitmap = new Bitmap(shp.Width, shp.Height, PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var stride = data.Stride;
for (var i = 0; i < shp.Width; i++)
for (var j = 0; j < shp.Height; j++)
q[j * stride + i] = frame.Image[i + shp.Width * j];
}
bitmap.UnlockBits(data);
return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.ImageCount - 1 };
}
}
}
}

View File

@@ -1,19 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OpenRA.Editor
{
public partial class ResizeDialog : Form
{
public ResizeDialog()
{
InitializeComponent();
}
}
}
#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.Windows.Forms;
namespace OpenRA.Editor
{
public partial class ResizeDialog : Form
{
public ResizeDialog()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,50 @@
#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 OpenRA.FileFormats;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
class ResourceTool : ITool
{
ResourceTemplate Resource;
public ResourceTool(ResourceTemplate resource) { Resource = resource; }
public void Apply(Surface surface)
{
surface.Map.MapResources.Value[surface.GetBrushLocation().X, surface.GetBrushLocation().Y]
= new TileReference<byte, byte>
{
type = (byte)Resource.Info.ResourceType,
index = (byte)random.Next(Resource.Info.SpriteNames.Length)
};
var ch = new int2((surface.GetBrushLocation().X) / Surface.ChunkSize,
(surface.GetBrushLocation().Y) / Surface.ChunkSize);
if (surface.Chunks.ContainsKey(ch))
{
surface.Chunks[ch].Dispose();
surface.Chunks.Remove(ch);
}
}
public void Preview(Surface surface, SGraphics g)
{
surface.DrawImage(g, Resource.Bitmap, surface.GetBrushLocation(), false, null);
}
Random random = new Random();
}
}

723
OpenRA.Editor/Surface.cs Normal file → Executable file
View File

@@ -1,353 +1,388 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Thirdparty;
#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.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.Traits;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
class Surface : Control
{
public Map Map { get; private set; }
public TileSet TileSet { get; private set; }
public Palette Palette { get; private set; }
public int2 Offset;
public int2 GetOffset() { return Offset; }
public float Zoom = 1.0f;
ITool Tool;
public bool IsPanning;
public bool ShowActorNames;
public event Action AfterChange = () => { };
public event Action<string> MousePositionChanged = _ => { };
Dictionary<string, ActorTemplate> ActorTemplates = new Dictionary<string, ActorTemplate>();
Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
public Keys GetModifiers() { return ModifierKeys; }
public void Bind(Map m, TileSet ts, Palette p)
{
Map = m;
TileSet = ts;
Palette = p;
PlayerPalettes = null;
Chunks.Clear();
Tool = null;
}
public void SetTool(ITool tool) { Tool = tool; }
public void BindActorTemplates(IEnumerable<ActorTemplate> templates)
{
ActorTemplates = templates.ToDictionary(a => a.Info.Name.ToLowerInvariant());
}
public void BindResourceTemplates(IEnumerable<ResourceTemplate> templates)
{
ResourceTemplates = templates.ToDictionary(a => a.Info.ResourceType);
}
public Dictionary<int2, Bitmap> Chunks = new Dictionary<int2, Bitmap>();
public Surface()
: base()
{
BackColor = Color.Black;
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
UpdateStyles();
}
static readonly Pen CordonPen = new Pen(Color.Red);
int2 MousePos;
public void Scroll(int2 dx)
{
Offset -= dx;
Invalidate();
}
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
if (Map == null) return;
Zoom *= e.Delta > 0 ? 4.0f / 3.0f : .75f;
Invalidate();
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
this.Parent.Focus();
Invalidate();
}
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseLeave(e);
this.Focus();
Invalidate();
}
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (Map == null) return;
var oldMousePos = MousePos;
MousePos = new int2(e.Location);
MousePositionChanged(GetBrushLocation().ToString());
if (e.Button == MouseButtons.Middle || (e.Button != MouseButtons.None && IsPanning))
Scroll(oldMousePos - MousePos);
else
{
if (e.Button == MouseButtons.Right)
Erase();
if (e.Button == MouseButtons.Left)
Draw();
Invalidate();
}
}
void Erase()
{
// Crash preventing
var BrushLocation = GetBrushLocation();
if (Map == null || BrushLocation.X >= Map.MapSize.X ||
BrushLocation.Y >= Map.MapSize.Y ||
BrushLocation.X < 0 ||
BrushLocation.Y < 0)
return;
Tool = null;
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)
{
Map.MapResources.Value[BrushLocation.X, BrushLocation.Y] = new TileReference<byte, byte>();
var ch = new int2((BrushLocation.X) / ChunkSize, (BrushLocation.Y) / ChunkSize);
if (Chunks.ContainsKey(ch))
{
Chunks[ch].Dispose();
Chunks.Remove(ch);
}
}
AfterChange();
}
void Draw()
{
if (Tool != null) Tool.Apply(this);
AfterChange();
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (Map == null) return;
if (!IsPanning)
{
if (e.Button == MouseButtons.Right) Erase();
if (e.Button == MouseButtons.Left) Draw();
}
Invalidate();
}
public const int ChunkSize = 8; // 8x8 chunks ==> 192x192 bitmaps.
Bitmap RenderChunk(int u, int v)
{
var bitmap = new Bitmap(ChunkSize * TileSet.TileSize, ChunkSize * TileSet.TileSize);
bitmap.SetPixel(0, 0, Color.Green);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
int* 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 tile = TileSet.Tiles[tr.type];
var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0;
var rawImage = tile.TileBitmapBytes[index];
for (var x = 0; x < TileSet.TileSize; x++)
for (var y = 0; y < TileSet.TileSize; y++)
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = Palette.GetColor(rawImage[x + TileSet.TileSize * y]).ToArgb();
if (Map.MapResources.Value[u * ChunkSize + i, v * ChunkSize + j].type != 0)
{
var resourceImage = ResourceTemplates[Map.MapResources.Value[u * ChunkSize + i, v * ChunkSize + j].type].Bitmap;
var srcdata = resourceImage.LockBits(new Rectangle(0, 0, resourceImage.Width, resourceImage.Height),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int* q = (int*)srcdata.Scan0.ToPointer();
var srcstride = srcdata.Stride >> 2;
for (var x = 0; x < TileSet.TileSize; x++)
for (var y = 0; y < TileSet.TileSize; y++)
{
var c = q[y * srcstride + x];
if ((c & 0xff000000) != 0) /* quick & dirty, i cbf doing real alpha */
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = c;
}
resourceImage.UnlockBits(srcdata);
}
}
}
bitmap.UnlockBits(data);
return bitmap;
}
public int2 GetBrushLocation()
{
var vX = (int)Math.Floor((MousePos.X - Offset.X) / Zoom);
var vY = (int)Math.Floor((MousePos.Y - Offset.Y) / Zoom);
return new int2(vX / TileSet.TileSize, vY / TileSet.TileSize);
}
public void DrawActor(SGraphics g, int2 p, ActorTemplate t, ColorPalette cp)
{
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
DrawImage(g, t.Bitmap, p, centered, cp);
}
float2 GetDrawPosition(int2 location, Bitmap bmp, bool centered)
{
float OffsetX = centered ? bmp.Width / 2 - TileSet.TileSize / 2 : 0;
float DrawX = TileSet.TileSize * location.X * Zoom + Offset.X - OffsetX;
float OffsetY = centered ? bmp.Height / 2 - TileSet.TileSize / 2 : 0;
float DrawY = TileSet.TileSize * location.Y * Zoom + Offset.Y - OffsetY;
return new float2(DrawX, DrawY);
}
public void DrawImage(SGraphics g, Bitmap bmp, int2 location, bool centered, ColorPalette cp)
{
var drawPos = GetDrawPosition(location, bmp, centered);
var sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
var destRect = new RectangleF(drawPos.X, drawPos.Y, bmp.Width * Zoom, bmp.Height * Zoom);
var restorePalette = bmp.Palette;
if (cp != null) bmp.Palette = cp;
g.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
if (cp != null) bmp.Palette = restorePalette;
}
void DrawActorBorder(System.Drawing.Graphics g, int2 p, ActorTemplate t)
{
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
var drawPos = GetDrawPosition(p, t.Bitmap, centered);
g.DrawRectangle(CordonPen,
drawPos.X, drawPos.Y,
t.Bitmap.Width * Zoom, t.Bitmap.Height * Zoom);
}
ColorPalette GetPaletteForPlayer(string name)
{
var pr = Map.Players[name];
var pcpi = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
var remap = new PlayerColorRemap(pr.ColorRamp, pcpi.PaletteFormat);
return RenderUtils.MakeSystemPalette(new Palette(Palette, remap));
}
Cache<string, ColorPalette> PlayerPalettes;
ColorPalette GetPaletteForActor(ActorReference ar)
{
if (PlayerPalettes == null)
PlayerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayer);
var ownerInit = ar.InitDict.GetOrDefault<OwnerInit>();
if (ownerInit == null)
return null;
return PlayerPalettes[ownerInit.PlayerName];
}
protected override void OnPaint(PaintEventArgs e)
{
if (Map == null) return;
if (TileSet == null) return;
for (var u = 0; u < Map.MapSize.X; u += ChunkSize)
for (var v = 0; v < Map.MapSize.Y; v += ChunkSize)
{
var x = new int2(u / ChunkSize, v / ChunkSize);
if (!Chunks.ContainsKey(x)) Chunks[x] = RenderChunk(u / ChunkSize, v / ChunkSize);
Bitmap bmp = Chunks[x];
float DrawX = TileSet.TileSize * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
float DrawY = TileSet.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);
e.Graphics.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
}
e.Graphics.DrawRectangle(CordonPen,
Map.Bounds.Left * TileSet.TileSize * Zoom + Offset.X,
Map.Bounds.Top * TileSet.TileSize * Zoom + Offset.Y,
Map.Bounds.Width * TileSet.TileSize * Zoom,
Map.Bounds.Height * TileSet.TileSize * Zoom);
namespace OpenRA.Editor
{
class Surface : Control
{
public Map Map { get; private set; }
public TileSet TileSet { get; private set; }
public Palette Palette { get; private set; }
int2 Offset;
public BrushTemplate Brush;
public ActorTemplate Actor;
public ResourceTemplate Resource;
public WaypointTemplate Waypoint;
Dictionary<string, ActorTemplate> ActorTemplates = new Dictionary<string, ActorTemplate>();
Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
public void Bind(Map m, TileSet ts, Palette p)
{
Map = m;
TileSet = ts;
Palette = p;
Brush = null;
Chunks.Clear();
}
public void SetBrush(BrushTemplate brush) { Actor = null; Brush = brush; Resource = null; Waypoint = null; }
public void SetActor(ActorTemplate actor) { Brush = null; Actor = actor; Resource = null; Waypoint = null; }
public void SetResource(ResourceTemplate resource) { Brush = null; Actor = null; Resource = resource; Waypoint = null; }
public void SetWaypoint(WaypointTemplate waypoint) { Brush = null; Actor = null; Resource = null; Waypoint = waypoint; }
public void BindActorTemplates(IEnumerable<ActorTemplate> templates)
{
ActorTemplates = templates.ToDictionary(a => a.Info.Name.ToLowerInvariant());
}
public void BindResourceTemplates(IEnumerable<ResourceTemplate> templates)
{
ResourceTemplates = templates.ToDictionary(a => a.Info.ResourceType);
}
Dictionary<int2, Bitmap> Chunks = new Dictionary<int2, Bitmap>();
public Surface()
: base()
{
BackColor = Color.Black;
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
UpdateStyles();
}
static readonly Pen CordonPen = new Pen(Color.Red);
int2 MousePos;
public void Scroll(int2 dx)
{
Offset -= dx;
Invalidate();
}
public void ValidateOffset(int width, int height)
{
Offset.X = System.Math.Max(Offset.X, width - Map.MapSize.X * 24);
Offset.Y = System.Math.Max(Offset.Y, height - Map.MapSize.Y * 24);
}
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
var oldMousePos = MousePos;
MousePos = new int2(e.Location);
if (e.Button == MouseButtons.Middle)
Scroll(oldMousePos - MousePos);
else
foreach (var ar in Map.Actors.Value)
{
if (e.Button == MouseButtons.Right)
Erase();
if (e.Button == MouseButtons.Left)
Draw();
Invalidate();
}
}
void DrawWithBrush()
{
// change the bits in the map
var tile = TileSet.tiles[Brush.N];
var template = TileSet.walk[Brush.N];
var pos = GetBrushLocation();
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
{
if (Map.IsInMap(new int2(u, v) + pos))
{
var z = u + v * template.Size.X;
if (tile.TileBitmapBytes[z] != null)
Map.MapTiles[u + pos.X, v + pos.Y] =
new TileReference<ushort, byte> { type = Brush.N, image = (byte)z, index = (byte)z };
var ch = new int2((pos.X + u) / ChunkSize, (pos.Y + v) / ChunkSize);
if (Chunks.ContainsKey(ch))
{
Chunks[ch].Dispose();
Chunks.Remove(ch);
}
}
}
}
int wpid;
string NextWpid()
{
for (; ; )
{
var a = "wp{0}".F(wpid++);
if (!Map.Waypoints.ContainsKey(a))
return a;
}
}
void DrawWithWaypoint()
{
var k = Map.Waypoints.FirstOrDefault(a => a.Value == GetBrushLocation());
if (k.Key != null) Map.Waypoints.Remove(k.Key);
Map.Waypoints.Add(NextWpid(), GetBrushLocation());
}
void Erase()
{
Actor = null;
Brush = null;
Resource = null;
Waypoint = null;
var key = Map.Actors.FirstOrDefault(a => a.Value.Location == GetBrushLocation());
if (key.Key != null) Map.Actors.Remove(key.Key);
if (Map.MapResources[GetBrushLocation().X, GetBrushLocation().Y].type != 0)
{
Map.MapResources[GetBrushLocation().X, GetBrushLocation().Y] = new TileReference<byte, byte>();
var ch = new int2((GetBrushLocation().X) / ChunkSize, (GetBrushLocation().Y) / ChunkSize);
if (Chunks.ContainsKey(ch))
{
Chunks[ch].Dispose();
Chunks.Remove(ch);
}
if (ActorTemplates.ContainsKey(ar.Value.Type))
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type],
GetPaletteForActor(ar.Value));
}
var k = Map.Waypoints.FirstOrDefault(a => a.Value == GetBrushLocation());
if (k.Key != null) Map.Waypoints.Remove(k.Key);
if (ShowActorNames)
foreach (var ar in Map.Actors.Value)
if (!ar.Key.StartsWith("Actor")) // if it has a custom name
e.Graphics.DrawStringContrast(Font, ar.Key,
(int)(ar.Value.Location().X * TileSet.TileSize * Zoom + Offset.X),
(int)(ar.Value.Location().Y * TileSet.TileSize * Zoom + Offset.Y),
Brushes.White,
Brushes.Black);
if (Tool != null)
Tool.Preview(this, e.Graphics);
if (Tool == null)
{
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
if (x.Key != null)
DrawActorBorder(e.Graphics, x.Value.Location(), ActorTemplates[x.Value.Type]);
}
}
}
static class ActorReferenceExts
{
public static int2 Location(this ActorReference ar)
{
return ar.InitDict.Get<LocationInit>().value;
}
void Draw()
public static void DrawStringContrast(this SGraphics g, Font f, string s, int x, int y, Brush fg, Brush bg)
{
if (Brush != null) DrawWithBrush();
if (Actor != null) DrawWithActor();
if (Resource != null) DrawWithResource();
if (Waypoint != null) DrawWithWaypoint();
}
g.DrawString(s, f, bg, x - 1, y - 1);
g.DrawString(s, f, bg, x + 1, y - 1);
g.DrawString(s, f, bg, x - 1, y + 1);
g.DrawString(s, f, bg, x + 1, y + 1);
int id;
string NextActorName()
{
for (; ; )
{
var possible = "Actor{0}".F(id++);
if (!Map.Actors.ContainsKey(possible)) return possible;
}
}
void DrawWithActor()
{
if (Map.Actors.Any(a => a.Value.Location == GetBrushLocation()))
return;
var owner = "Neutral";
Map.Actors[NextActorName()] = new ActorReference(Actor.Info.Name.ToLowerInvariant(), GetBrushLocation(), owner);
}
Random r = new Random();
void DrawWithResource()
{
Map.MapResources[GetBrushLocation().X, GetBrushLocation().Y]
= new TileReference<byte, byte>
{
type = (byte)Resource.Info.ResourceType,
index = (byte)r.Next(Resource.Info.SpriteNames.Length),
image = (byte)Resource.Value
};
var ch = new int2((GetBrushLocation().X) / ChunkSize, (GetBrushLocation().Y) / ChunkSize);
if (Chunks.ContainsKey(ch))
{
Chunks[ch].Dispose();
Chunks.Remove(ch);
}
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Right) Erase();
if (e.Button == MouseButtons.Left) Draw();
Invalidate();
}
const int ChunkSize = 8; // 8x8 chunks ==> 192x192 bitmaps.
Bitmap RenderChunk(int u, int v)
{
var bitmap = new Bitmap(ChunkSize * 24, ChunkSize * 24);
bitmap.SetPixel(0, 0, Color.Green);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
unsafe
{
int* 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[u * ChunkSize + i, v * ChunkSize + j];
var tile = TileSet.tiles[tr.type];
var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0;
var rawImage = tile.TileBitmapBytes[index];
for (var x = 0; x < 24; x++)
for (var y = 0; y < 24; y++)
p[ (j * 24 + y) * stride + i * 24 + x ] = Palette.GetColor(rawImage[x + 24 * y]).ToArgb();
if (Map.MapResources[u * ChunkSize + i, v * ChunkSize + j].type != 0)
{
var resourceImage = ResourceTemplates[Map.MapResources[u * ChunkSize + i, v * ChunkSize + j].type].Bitmap;
var srcdata = resourceImage.LockBits(new Rectangle(0, 0, resourceImage.Width, resourceImage.Height),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int* q = (int*)srcdata.Scan0.ToPointer();
var srcstride = srcdata.Stride >> 2;
for (var x = 0; x < 24; x++)
for (var y = 0; y < 24; y++)
{
var c = q[y * srcstride + x];
if ((c & 0xff000000) != 0) /* quick & dirty, i cbf doing real alpha */
p[(j * 24 + y) * stride + i * 24 + x] = c;
}
resourceImage.UnlockBits(srcdata);
}
}
}
bitmap.UnlockBits(data);
return bitmap;
}
int2 GetBrushLocation()
{
var v = MousePos - Offset;
return new int2(v.X / 24, v.Y / 24);
}
void DrawActor(System.Drawing.Graphics g, int2 p, ActorTemplate t)
{
g.DrawImage(t.Bitmap,
((24 * p + Offset
- (t.Centered
? new int2(t.Bitmap.Width / 2 - 12, t.Bitmap.Height / 2 - 12)
: int2.Zero)).ToPoint()));
}
void DrawActorBorder(System.Drawing.Graphics g, int2 p, ActorTemplate t)
{
var origin = (24 * p + Offset
- (t.Centered
? new int2(t.Bitmap.Width / 2 - 12, t.Bitmap.Height / 2 - 12)
: int2.Zero)).ToPoint();
g.DrawRectangle(CordonPen,
origin.X, origin.Y,
t.Bitmap.Width, t.Bitmap.Height );
}
protected override void OnPaint(PaintEventArgs e)
{
if (Map == null) return;
if (TileSet == null) return;
for( var u = 0; u < Map.MapSize.X; u += ChunkSize )
for (var v = 0; v < Map.MapSize.Y; v += ChunkSize)
{
var x = new int2(u/ChunkSize,v/ChunkSize);
if (!Chunks.ContainsKey(x)) Chunks[x] = RenderChunk(u / ChunkSize, v / ChunkSize);
e.Graphics.DrawImage(Chunks[x], (24 * ChunkSize * x + Offset).ToPoint());
}
e.Graphics.DrawRectangle(CordonPen,
new Rectangle(Map.XOffset * 24 + Offset.X, Map.YOffset * 24 + Offset.Y, Map.Width * 24, Map.Height * 24));
foreach (var ar in Map.Actors)
DrawActor(e.Graphics, ar.Value.Location, ActorTemplates[ar.Value.Name]);
foreach (var wp in Map.Waypoints)
e.Graphics.DrawRectangle(Pens.LimeGreen, new Rectangle(
24 * wp.Value.X + Offset.X + 4,
24 * wp.Value.Y + Offset.Y + 4,
16, 16));
if (Brush != null)
e.Graphics.DrawImage(Brush.Bitmap,
(24 * GetBrushLocation() + Offset).ToPoint());
if (Actor != null)
DrawActor(e.Graphics, GetBrushLocation(), Actor);
if (Resource != null)
e.Graphics.DrawImage(Resource.Bitmap,
(24 * GetBrushLocation() + Offset).ToPoint());
if (Waypoint != null)
e.Graphics.DrawRectangle(Pens.LimeGreen, new Rectangle(
24 * GetBrushLocation().X + Offset.X + 4,
24 * GetBrushLocation().Y + Offset.Y + 4,
16, 16));
if (Brush == null && Actor == null && Resource == null)
{
var x = Map.Actors.FirstOrDefault(a => a.Value.Location == GetBrushLocation());
if (x.Key != null)
DrawActorBorder(e.Graphics, x.Value.Location, ActorTemplates[x.Value.Name]);
}
}
}
g.DrawString(s, f, fg, x, y);
}
}
}

View File

@@ -0,0 +1,64 @@
#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.Drawing;
namespace OpenRA.FileFormats
{
public struct ColorRamp
{
public byte H,S,L,R;
public ColorRamp(byte h, byte s, byte l, byte r)
{
H = h; S = s; L = l; R = r;
}
/* returns a color along the Lum ramp */
public Color GetColor( float t )
{
return ColorFromHSL( H / 255f, S / 255f, float2.Lerp( L / 255f, L*R / (255f * 255f), t ) );
}
public override string ToString()
{
return "{0},{1},{2},{3}".F(H, S, L, R);
}
// hk is hue in the range [0,1] instead of [0,360]
public static Color ColorFromHSL(float hk, float s, float l)
{
// Convert from HSL to RGB
var q = (l < 0.5f) ? l * (1 + s) : l + s - (l * s);
var p = 2 * l - q;
float[] trgb = { hk + 1 / 3.0f,
hk,
hk - 1/3.0f };
float[] rgb = { 0, 0, 0 };
for (int k = 0; k < 3; k++)
{
while (trgb[k] < 0) trgb[k] += 1.0f;
while (trgb[k] > 1) trgb[k] -= 1.0f;
}
for (int k = 0; k < 3; k++)
{
if (trgb[k] < 1 / 6.0f) { rgb[k] = (p + ((q - p) * 6 * trgb[k])); }
else if (trgb[k] >= 1 / 6.0f && trgb[k] < 0.5) { rgb[k] = q; }
else if (trgb[k] >= 0.5f && trgb[k] < 2.0f / 3) { rgb[k] = (p + ((q - p) * 6 * (2.0f / 3 - trgb[k]))); }
else { rgb[k] = p; }
}
return Color.FromArgb((int)(rgb[0] * 255), (int)(rgb[1] * 255), (int)(rgb[2] * 255));
}
}
}

View File

@@ -1,97 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
namespace OpenRA.FileFormats
{
public static class ConnectedComponents
{
static readonly int2[] Neighbors
= { new int2(-1, -1), new int2(0, -1), new int2(1, -1), new int2(-1, 0) };
public static int[,] Extract(Map m, Func<int, int, int> f)
{
var result = new int[m.MapSize.X, m.MapSize.Y];
var types = new int[m.MapSize.X, m.MapSize.Y];
var d = new Dictionary<int, Node>();
var n = 1;
for( var j = m.YOffset; j < m.YOffset + m.Height; j++ )
for (var i = m.XOffset; i < m.XOffset + m.Width; i++)
{
types[i, j] = f(i, j);
var k = n;
foreach (var a in Neighbors)
if (types[i + a.X, j + a.Y] == types[i, j])
k = (k == n)
? result[i + a.X, j + a.Y]
: Union( d, k, result[i+a.X, j+a.Y] );
result[i,j] = k;
if (k == n) MakeSet(d, n++);
}
for (var j = m.YOffset; j < m.YOffset + m.Height; j++)
for (var i = m.XOffset; i < m.XOffset + m.Width; i++)
result[i, j] = Find(d, result[i, j]);
return result;
}
// disjoint-set forest stuff
class Node { public int a, b; public Node(int a, int b) { this.a = a; this.b = b; } }
static int MakeSet(Dictionary<int, Node> d, int x)
{
d[x] = new Node(x, 0);
return x;
}
static int Union(Dictionary<int, Node> d, int x, int y)
{
var xr = Find(d, x);
var yr = Find(d, y);
var xa = d[xr].b;
var ya = d[yr].b;
if (xa > ya) d[yr].a = xr;
else if (xa < ya) d[xr].a = yr;
else if (xr != yr)
{
d[yr].a = xr;
++d[xr].b;
}
return xr;
}
static int Find(Dictionary<int, Node> d, int x)
{
if (d[x].a == x) return x;
return d[x].a = Find(d, d[x].a);
}
}
}

View File

@@ -1,45 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
namespace OpenRA
{
public class DisposableAction : IDisposable
{
public DisposableAction(Action a) { this.a = a; }
Action a;
bool disposed;
public void Dispose()
{
if (disposed) return;
disposed = true;
a();
GC.SuppressFinalize(this);
}
~DisposableAction()
{
Dispose();
}
}
}

View File

@@ -1,117 +1,107 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.FileFormats
{
public static class Evaluator
{
public static int Evaluate(string expr)
{
return Evaluate(expr, new Dictionary<string, int>());
}
public static int Evaluate(string expr, Dictionary<string, int> syms)
{
var toks = Tokens(expr, "+-*/()");
var postfix = ToPostfix(toks, syms);
var s = new Stack<int>();
foreach (var t in postfix)
{
switch (t[0])
{
case '+': ApplyBinop(s, (x, y) => y + x); break;
case '-': ApplyBinop(s, (x, y) => y - x); break;
case '*': ApplyBinop(s, (x, y) => y * x); break;
case '/': ApplyBinop(s, (x, y) => y / x); break;
default: s.Push(int.Parse(t)); break;
}
}
return s.Pop();
}
static void ApplyBinop( Stack<int> s, Func<int,int,int> f )
{
var x = s.Pop();
var y = s.Pop();
s.Push( f(x,y) );
}
static IEnumerable<string> ToPostfix(IEnumerable<string> toks, Dictionary<string, int> syms)
{
var s = new Stack<string>();
foreach (var t in toks)
{
if (t[0] == '(') s.Push(t);
else if (t[0] == ')')
{
var temp = "";
while ((temp = s.Pop()) != "(") yield return temp;
}
else if (char.IsNumber(t[0])) yield return t;
else if (char.IsLetter(t[0]))
{
if (!syms.ContainsKey(t))
throw new InvalidOperationException("Substitution `{0}` undefined".F(t));
yield return syms[t].ToString();;
}
else
{
while (s.Count > 0 && Prec[t] <= Prec[s.Peek()]) yield return s.Pop();
s.Push(t);
}
}
while (s.Count > 0) yield return s.Pop();
}
static readonly Dictionary<string, int> Prec
= new Dictionary<string, int> { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 }, { "(", -1 } };
static IEnumerable<string> Tokens(string expr, string ops)
{
var s = "";
foreach (var c in expr)
{
if (char.IsWhiteSpace(c))
{
if (s != "") yield return s;
s = "";
}
else if (ops.Contains(c))
{
if (s != "") yield return s;
s = "";
yield return "" + c;
}
else
s += c;
}
if (s != "") yield return s;
}
}
}
#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.Generic;
using System.Linq;
namespace OpenRA.FileFormats
{
public static class Evaluator
{
public static int Evaluate(string expr)
{
return Evaluate(expr, new Dictionary<string, int>());
}
public static int Evaluate(string expr, Dictionary<string, int> syms)
{
var toks = Tokens(expr, "+-*/()");
var postfix = ToPostfix(toks, syms);
var s = new Stack<int>();
foreach (var t in postfix)
{
switch (t[0])
{
case '+': ApplyBinop(s, (x, y) => y + x); break;
case '-': ApplyBinop(s, (x, y) => y - x); break;
case '*': ApplyBinop(s, (x, y) => y * x); break;
case '/': ApplyBinop(s, (x, y) => y / x); break;
default: s.Push(int.Parse(t)); break;
}
}
return s.Pop();
}
static void ApplyBinop( Stack<int> s, Func<int,int,int> f )
{
var x = s.Pop();
var y = s.Pop();
s.Push( f(x,y) );
}
static IEnumerable<string> ToPostfix(IEnumerable<string> toks, Dictionary<string, int> syms)
{
var s = new Stack<string>();
foreach (var t in toks)
{
if (t[0] == '(') s.Push(t);
else if (t[0] == ')')
{
var temp = "";
while ((temp = s.Pop()) != "(") yield return temp;
}
else if (char.IsNumber(t[0])) yield return t;
else if (char.IsLetter(t[0]))
{
if (!syms.ContainsKey(t))
throw new InvalidOperationException("Substitution `{0}` undefined".F(t));
yield return syms[t].ToString();;
}
else
{
while (s.Count > 0 && Prec[t] <= Prec[s.Peek()]) yield return s.Pop();
s.Push(t);
}
}
while (s.Count > 0) yield return s.Pop();
}
static readonly Dictionary<string, int> Prec
= new Dictionary<string, int> { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 }, { "(", -1 } };
static IEnumerable<string> Tokens(string expr, string ops)
{
var s = "";
foreach (var c in expr)
{
if (char.IsWhiteSpace(c))
{
if (s != "") yield return s;
s = "";
}
else if (ops.Contains(c))
{
if (s != "") yield return s;
s = "";
yield return "" + c;
}
else
s += c;
}
if (s != "") yield return s;
}
}
}

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

@@ -1,77 +1,153 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA
{
public static class Exts
{
public static string F(this string fmt, params object[] args)
{
return string.Format(fmt, args);
#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.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA
{
public static class Exts
{
public static string F(this string fmt, params object[] args)
{
return string.Format(fmt, args);
}
public static void Do<T>(this IEnumerable<T> e, Action<T> fn)
{
foreach (var ee in e)
fn(ee);
}
public static IEnumerable<string> GetNamespaces(this Assembly a)
{
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);
}
public static string ReadAllText(this Stream s)
{
using (s)
using (var sr = new StreamReader(s))
return sr.ReadToEnd();
}
public static byte[] ReadAllBytes(this Stream s)
{
using (s)
{
var data = new byte[s.Length - s.Position];
s.Read(data, 0, data.Length);
return data;
}
}
public static void Write(this Stream s, byte[] data)
{
s.Write(data, 0, data.Length);
}
public static IEnumerable<string> ReadAllLines(this Stream s)
{
using (var sr = new StreamReader(s))
for (; ; )
{
var line = sr.ReadLine();
if (line == null)
yield break;
else
yield return line;
}
}
public static bool HasAttribute<T>(this MemberInfo mi)
{
return mi.GetCustomAttributes(typeof(T), true).Length != 0;
}
public static T[] GetCustomAttributes<T>(this MemberInfo mi, bool inherit)
where T : class
{
return (T[])mi.GetCustomAttributes(typeof(T), inherit);
}
public static T[] GetCustomAttributes<T>(this ParameterInfo mi)
where T : class
{
return (T[])mi.GetCustomAttributes(typeof(T), true);
}
public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
{
if (val.CompareTo(min) < 0)
return min;
else if (val.CompareTo(max) > 0)
return max;
else
return val;
}
public static bool Contains(this Rectangle r, int2 p)
{
return r.Contains(p.ToPoint());
}
public static bool Contains(this RectangleF r, int2 p)
{
return r.Contains(p.ToPointF());
}
public static void Do<T>( this IEnumerable<T> e, Action<T> fn )
{
foreach( var ee in e )
fn( ee );
public static bool HasModifier(this Modifiers k, Modifiers mod)
{
return (k & mod) == mod;
}
public static bool IsValidInput(this KeyInput key)
{
return char.IsLetter(key.UnicodeChar) || char.IsDigit(key.UnicodeChar) ||
char.IsSymbol(key.UnicodeChar) || char.IsSeparator(key.UnicodeChar) ||
char.IsPunctuation(key.UnicodeChar);
}
public static IEnumerable<string> GetNamespaces(this Assembly a)
{
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);
}
public static V GetOrAdd<K, V>(this Dictionary<K, V> d, K k)
where V : new()
{
return d.GetOrAdd(k, _ => new V());
}
public static string ReadAllText(this Stream s)
{
using (s)
using (var sr = new StreamReader(s))
return sr.ReadToEnd();
}
public static V GetOrAdd<K, V>(this Dictionary<K, V> d, K k, Func<K, V> createFn)
{
V ret;
if (!d.TryGetValue(k, out ret))
d.Add(k, ret = createFn(k));
return ret;
}
public static byte[] ReadAllBytes(this Stream s)
{
using (s)
{
var data = new byte[s.Length - s.Position];
s.Read(data, 0, data.Length);
return data;
}
}
public static T Random<T>(this IEnumerable<T> ts, Thirdparty.Random r)
{
var xs = ts.ToArray();
return xs[r.Next(xs.Length)];
}
public static IEnumerable<string> ReadAllLines(this Stream s)
{
using (var sr = new StreamReader(s))
for (; ; )
{
var line = sr.ReadLine();
if (line == null)
yield break;
else
yield return line;
}
}
}
}
public static float Product(this IEnumerable<float> xs)
{
return xs.Aggregate(1f, (a, x) => a * x);
}
public static IEnumerable<T> SymmetricDifference<T>(this IEnumerable<T> xs, IEnumerable<T> ys)
{
// this is probably a shockingly-slow way to do this, but it's concise.
return xs.Except(ys).Concat(ys.Except(xs));
}
}
}

452
OpenRA.FileFormats/FieldLoader.cs Normal file → Executable file
View File

@@ -1,136 +1,316 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace OpenRA.FileFormats
{
public static class FieldLoader
{
public static void Load(object self, IniSection ini)
{
foreach (var x in ini)
LoadField(self, x.Key, x.Value);
}
public static void Load(object self, MiniYaml my)
{
foreach (var x in my.Nodes)
if (!x.Key.StartsWith("-"))
LoadField( self, x.Key, x.Value.Value );
}
public static T Load<T>(MiniYaml y) where T : new()
{
var t = new T();
Load(t, y);
return t;
}
public static void LoadFields( object self, Dictionary<string,MiniYaml> my, IEnumerable<string> fields )
{
foreach (var field in fields)
{
if (!my.ContainsKey(field)) continue;
FieldLoader.LoadField(self,field,my[field].Value);
}
}
public static void LoadField( object self, string key, string value )
{
var field = self.GetType().GetField( key.Trim() );
if( field == null )
throw new NotImplementedException( "Missing field `{0}` on `{1}`".F( key.Trim(), self.GetType().Name ) );
field.SetValue( self, GetValue( field.FieldType, value ) );
}
public static object GetValue( Type fieldType, string x )
{
if (x != null) x = x.Trim();
if( fieldType == typeof( int ) )
return int.Parse( x );
else if (fieldType == typeof(float))
return float.Parse(x.Replace("%","")) * (x.Contains( '%' ) ? 0.01f : 1f);
else if (fieldType == typeof(string))
return x;
else if (fieldType.IsEnum)
return Enum.Parse(fieldType, x, true);
else if (fieldType == typeof(bool))
return ParseYesNo(x);
else if (fieldType.IsArray)
{
if (x == null)
return Array.CreateInstance(fieldType.GetElementType(), 0);
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var ret = Array.CreateInstance(fieldType.GetElementType(), parts.Length);
for (int i = 0; i < parts.Length; i++)
ret.SetValue(GetValue(fieldType.GetElementType(), parts[i].Trim()), i);
return ret;
}
else if (fieldType == typeof(int2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
}
else
throw new InvalidOperationException("FieldLoader: don't know how to load field of type " + fieldType.ToString());
}
static bool ParseYesNo( string p )
{
p = p.ToLowerInvariant();
if( p == "yes" ) return true;
if( p == "true" ) return true;
if( p == "no" ) return false;
if( p == "false" ) return false;
throw new InvalidOperationException();
}
}
public static class FieldSaver
{
public static MiniYaml Save(object o)
{
return new MiniYaml(null, o.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance)
.ToDictionary(
f => f.Name,
f => new MiniYaml(FormatValue(o, f))));
}
public static string FormatValue(object o, FieldInfo f)
{
var v = f.GetValue(o);
return f.FieldType.IsArray
? string.Join(",", ((Array)v).OfType<object>().Select(a => a.ToString()).ToArray())
: v.ToString();
}
}
}
#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.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Globalization;
namespace OpenRA.FileFormats
{
public static class FieldLoader
{
public static Func<string,Type,string,object> InvalidValueAction = (s,t,f) =>
{
throw new InvalidOperationException("FieldLoader: Cannot parse `{0}` into `{1}.{2}` ".F(s,f,t) );
};
public static Action<string,Type> UnknownFieldAction = (s,f) =>
{
throw new NotImplementedException( "FieldLoader: Missing field `{0}` on `{1}`".F( s, f.Name ) );
};
public static void Load( object self, MiniYaml my )
{
var loadDict = typeLoadInfo[ self.GetType() ];
foreach( var kv in loadDict )
{
object val;
if( kv.Value != null )
val = kv.Value( kv.Key.Name, kv.Key.FieldType, my );
else if( !TryGetValueFromYaml( kv.Key.Name, kv.Key.FieldType, my, out val ) )
continue;
kv.Key.SetValue( self, val );
}
}
static bool TryGetValueFromYaml( string fieldName, Type fieldType, MiniYaml yaml, out object ret )
{
ret = null;
var n = yaml.Nodes.Where( x=>x.Key == fieldName ).ToList();
if( n.Count == 0 )
return false;
if( n.Count == 1 && n[ 0 ].Value.Nodes.Count == 0 )
{
ret = GetValue( fieldName, fieldType, n[ 0 ].Value.Value );
return true;
}
throw new InvalidOperationException( "TryGetValueFromYaml: unable to load field {0} (of type {1})".F( fieldName, fieldType ) );
}
public static T Load<T>(MiniYaml y) where T : new()
{
var t = new T();
Load(t, y);
return t;
}
public static void LoadField( object self, string key, string value )
{
var field = self.GetType().GetField( key.Trim() );
if( field == null )
UnknownFieldAction( key.Trim(), self.GetType() );
else if( field.HasAttribute<FieldFromYamlKeyAttribute>() )
return;
else
field.SetValue( self, GetValue( field.Name, field.FieldType, value ) );
}
public static object GetValue( string field, Type fieldType, string x )
{
if (x != null) x = x.Trim();
if( fieldType == typeof( int ) )
{
int res;
if (int.TryParse(x,out res))
return res;
return InvalidValueAction(x,fieldType, field);
}
else if( fieldType == typeof( ushort ) )
{
ushort res;
if (ushort.TryParse(x,out res))
return res;
return InvalidValueAction(x,fieldType, field);
}
else if (fieldType == typeof(float))
{
float res;
if (float.TryParse(x.Replace("%",""), System.Globalization.NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
return res * (x.Contains( '%' ) ? 0.01f : 1f);
return InvalidValueAction(x,fieldType, field);
}
else if (fieldType == typeof(decimal))
{
decimal res;
if (decimal.TryParse(x.Replace("%",""), System.Globalization.NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
return res * (x.Contains( '%' ) ? 0.01m : 1m);
return InvalidValueAction(x,fieldType, field);
}
else if (fieldType == typeof(string))
return x;
else if (fieldType == typeof(Color))
{
var parts = x.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));
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 InvalidValueAction(x,fieldType, field);
}
else if (fieldType == typeof(ColorRamp))
{
var parts = x.Split(',');
if (parts.Length == 4)
return new ColorRamp(
(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)int.Parse(parts[3]).Clamp(0, 255));
return InvalidValueAction(x, fieldType, field);
}
else if (fieldType.IsEnum)
{
if (!Enum.GetNames(fieldType).Select(a => a.ToLower()).Contains(x.ToLower()))
return InvalidValueAction(x, fieldType, field);
return Enum.Parse(fieldType, x, true);
}
else if (fieldType == typeof(bool))
return ParseYesNo(x, fieldType, field);
else if (fieldType.IsArray)
{
if (x == null)
return Array.CreateInstance(fieldType.GetElementType(), 0);
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var ret = Array.CreateInstance(fieldType.GetElementType(), parts.Length);
for (int i = 0; i < parts.Length; i++)
ret.SetValue(GetValue(field, fieldType.GetElementType(), parts[i].Trim()), i);
return ret;
}
else if (fieldType == typeof(int2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
}
else if (fieldType == typeof(float2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
float xx = 0;
float yy = 0;
float res;
if (float.TryParse(parts[0].Replace("%", ""), out res))
xx = res * (parts[0].Contains('%') ? 0.01f : 1f);
if (float.TryParse(parts[1].Replace("%", ""), out res))
yy = res * (parts[1].Contains('%') ? 0.01f : 1f);
return new float2(xx, yy);
}
else if (fieldType == typeof(Rectangle))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new Rectangle(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
}
UnknownFieldAction("[Type] {0}".F(x),fieldType);
return null;
}
static object ParseYesNo( string p, System.Type fieldType, string field )
{
p = p.ToLowerInvariant();
if( p == "yes" ) return true;
if( p == "true" ) return true;
if( p == "no" ) return false;
if( p == "false" ) return false;
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 )
{
var ret = new Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>();
foreach( var ff in type.GetFields() )
{
var field = ff;
var load = field.GetCustomAttributes<LoadAttribute>( 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 );
else if( load.Length != 0 )
ret[ field ] = null;
}
if( ret.Count == 0 )
foreach( var f in type.GetFields() )
ret.Add( f, null );
return ret;
}
[AttributeUsage( AttributeTargets.Field )]
public class LoadAttribute : Attribute { }
[AttributeUsage( AttributeTargets.Field )]
public class LoadUsingAttribute : Attribute
{
Func<MiniYaml, object> loaderFuncCache;
public readonly string Loader;
public LoadUsingAttribute( string loader )
{
Loader = loader;
}
internal Func<MiniYaml, object> LoaderFunc( FieldInfo field )
{
const BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
if( loaderFuncCache == null )
loaderFuncCache = (Func<MiniYaml, object>)Delegate.CreateDelegate( typeof( Func<MiniYaml, object> ), field.DeclaringType.GetMethod( Loader, bf ) );
return loaderFuncCache;
}
}
}
public static class FieldSaver
{
public static MiniYaml Save(object o)
{
var nodes = new List<MiniYamlNode>();
string root = null;
foreach( var f in o.GetType().GetFields( BindingFlags.Public | BindingFlags.Instance ) )
{
if( f.HasAttribute<FieldFromYamlKeyAttribute>() )
root = FormatValue( o, f );
else
nodes.Add( new MiniYamlNode( f.Name, FormatValue( o, f ) ) );
}
return new MiniYaml( root, nodes );
}
public static MiniYaml SaveDifferences(object o, object from)
{
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));
return new MiniYaml( null, fields.Select( f => new MiniYamlNode(
f.Name,
FormatValue( o, f ) ) ).ToList() );
}
public static MiniYamlNode SaveField(object o, string field)
{
return new MiniYamlNode(field, FieldSaver.FormatValue( o, o.GetType().GetField(field) ));
}
public static string FormatValue(object o, FieldInfo f)
{
var v = f.GetValue(o);
if (v == null)
return "";
// Color.ToString() does the wrong thing; force it to format as an array
if (f.FieldType == typeof(Color))
{
var c = (Color)v;
return "{0},{1},{2},{3}".F(((int)c.A).Clamp(0, 255),
((int)c.R).Clamp(0, 255),
((int)c.G).Clamp(0, 255),
((int)c.B).Clamp(0, 255));
}
else if (f.FieldType == typeof(Rectangle))
{
var r = (Rectangle)v;
return "{0},{1},{2},{3}".F(r.X, r.Y, r.Width, r.Height);
}
return f.FieldType.IsArray
? string.Join(",", ((Array)v).OfType<object>().Select(a => a.ToString()).ToArray())
: v.ToString();
}
}
public class FieldFromYamlKeyAttribute : Attribute { }
}

View File

@@ -1,125 +1,155 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.IO;
namespace OpenRA.FileFormats
{
[Flags]
enum SoundFlags
{
Stereo = 0x1,
_16Bit = 0x2,
}
enum SoundFormat
{
WestwoodCompressed = 1,
ImaAdpcm = 99,
}
struct Chunk
{
public int CompressedSize;
public int OutputSize;
public static Chunk Read(BinaryReader r)
{
Chunk c;
c.CompressedSize = r.ReadUInt16();
c.OutputSize = r.ReadUInt16();
if (0xdeaf != r.ReadUInt32())
throw new InvalidDataException("Chunk header is bogus");
return c;
}
}
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 short DecodeSample(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[] LoadSound(Stream s)
{
var br = new BinaryReader(s);
/*var sampleRate =*/ br.ReadUInt16();
var dataSize = br.ReadInt32();
var outputSize = br.ReadInt32();
/*var flags = (SoundFlags)*/ br.ReadByte();
/*var format = (SoundFormat)*/ br.ReadByte();
var output = new byte[outputSize];
var offset = 0;
var index = 0;
var currentSample = 0;
while (dataSize > 0)
{
var chunk = Chunk.Read(br);
for (int n = 0; n < chunk.CompressedSize; n++)
{
var b = br.ReadByte();
var t = DecodeSample(b, ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
t = DecodeSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
}
dataSize -= 8 + chunk.CompressedSize;
}
return output;
}
}
}
#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.IO;
namespace OpenRA.FileFormats
{
[Flags]
enum SoundFlags
{
Stereo = 0x1,
_16Bit = 0x2,
}
enum SoundFormat
{
WestwoodCompressed = 1,
ImaAdpcm = 99,
}
struct Chunk
{
public int CompressedSize;
public int OutputSize;
public static Chunk Read(BinaryReader r)
{
Chunk c;
c.CompressedSize = r.ReadUInt16();
c.OutputSize = r.ReadUInt16();
if (0xdeaf != r.ReadUInt32())
throw new InvalidDataException("Chunk header is bogus");
return c;
}
}
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 short DecodeSample(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[] LoadSound(byte[] raw, ref int index)
{
var br = new BinaryReader(new MemoryStream(raw));
var dataSize = raw.Length;
var outputSize = raw.Length * 4;
var output = new byte[outputSize];
var offset = 0;
var currentSample = 0;
while (dataSize-- > 0)
{
var b = br.ReadByte();
var t = DecodeSample(b, ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
t = DecodeSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
}
return output;
}
public static float SoundLength(Stream s)
{
var br = new BinaryReader(s);
var sampleRate = br.ReadUInt16();
/*var dataSize = */ br.ReadInt32();
var outputSize = br.ReadInt32();
var flags = (SoundFlags) br.ReadByte();
var samples = outputSize;
if (0 != (flags & SoundFlags.Stereo)) samples /= 2;
if (0 != (flags & SoundFlags._16Bit)) samples /= 2;
return samples / sampleRate;
}
public static byte[] LoadSound(Stream s)
{
var br = new BinaryReader(s);
/*var sampleRate =*/ br.ReadUInt16();
var dataSize = br.ReadInt32();
var outputSize = br.ReadInt32();
/*var flags = (SoundFlags)*/ br.ReadByte();
/*var format = (SoundFormat)*/ br.ReadByte();
var output = new byte[outputSize];
var offset = 0;
var index = 0;
var currentSample = 0;
while (dataSize > 0)
{
var chunk = Chunk.Read(br);
for (int n = 0; n < chunk.CompressedSize; n++)
{
var b = br.ReadByte();
var t = DecodeSample(b, ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
t = DecodeSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
}
dataSize -= 8 + chunk.CompressedSize;
}
return output;
}
}
}

View File

@@ -0,0 +1,274 @@
#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.
*
* This file is based on the blast routines (version 1.1 by Mark Adler)
* included in zlib/contrib
*/
#endregion
using System;
using System.IO;
namespace OpenRA.FileFormats
{
public static class Blast
{
public static readonly int MAXBITS = 13; // maximum code length
public static readonly int MAXWIN = 4096; // maximum window size
static byte[] litlen = new byte[] {
11, 124, 8, 7, 28, 7, 188, 13, 76, 4,
10, 8, 12, 10, 12, 10, 8, 23, 8, 9,
7, 6, 7, 8, 7, 6, 55, 8, 23, 24,
12, 11, 7, 9, 11, 12, 6, 7, 22, 5,
7, 24, 6, 11, 9, 6, 7, 22, 7, 11,
38, 7, 9, 8, 25, 11, 8, 11, 9, 12,
8, 12, 5, 38, 5, 38, 5, 11, 7, 5,
6, 21, 6, 10, 53, 8, 7, 24, 10, 27,
44, 253, 253, 253, 252, 252, 252, 13, 12, 45,
12, 45, 12, 61, 12, 45, 44, 173
};
// bit lengths of length codes 0..15
static byte[] lenlen = new byte[] { 2, 35, 36, 53, 38, 23 };
// bit lengths of distance codes 0..63
static byte[] distlen = new byte[] { 2, 20, 53, 230, 247, 151, 248 };
// base for length codes
static short[] lengthbase = new short[] {
3, 2, 4, 5, 6, 7, 8, 9, 10, 12,
16, 24, 40, 72, 136, 264
};
// extra bits for length codes
static byte[] extra = new byte[] {
0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
3, 4, 5, 6, 7, 8
};
static Huffman litcode = new Huffman(litlen, litlen.Length, 256);
static Huffman lencode = new Huffman(lenlen, lenlen.Length, 16);
static Huffman distcode = new Huffman(distlen, distlen.Length, 64);
// Decode PKWare Compression Library stream.
public static byte[] Decompress(byte[] src)
{
BitReader br = new BitReader(src);
// Are literals coded?
int coded = br.ReadBits(8);
if (coded < 0 || coded > 1)
throw new NotImplementedException("Invalid datastream");
bool EncodedLiterals = (coded == 1);
// log2(dictionary size) - 6
int dict = br.ReadBits(8);
if (dict < 4 || dict > 6)
throw new InvalidDataException("Invalid dictionary size");
// output state
ushort next = 0; // index of next write location in out[]
bool first = true; // true to check distances (for first 4K)
byte[] outBuffer = new byte[MAXWIN]; // output buffer and sliding window
var ms = new MemoryStream();
// decode literals and length/distance pairs
do
{
// length/distance pair
if (br.ReadBits(1) == 1)
{
// Length
int symbol = Decode(lencode, br);
int len = lengthbase[symbol] + br.ReadBits(extra[symbol]);
if (len == 519) // Magic number for "done"
{
for (int i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
break;
}
// Distance
symbol = len == 2 ? 2 : dict;
int dist = Decode(distcode, br) << symbol;
dist += br.ReadBits(symbol);
dist++;
if (first && dist > next)
throw new InvalidDataException("Attempt to jump before data");
// copy length bytes from distance bytes back
do
{
int dest = next;
int source = dest - dist;
int copy = MAXWIN;
if (next < dist)
{
source += copy;
copy = dist;
}
copy -= next;
if (copy > len)
copy = len;
len -= copy;
next += (ushort)copy;
Array.Copy(outBuffer, source, outBuffer, dest, copy);
// Flush window to outstream
if (next == MAXWIN)
{
for (int i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
next = 0;
first = false;
}
} while (len != 0);
}
else // literal value
{
int symbol = EncodedLiterals ? Decode(litcode, br) : br.ReadBits(8);
outBuffer[next++] = (byte)symbol;
if (next == MAXWIN)
{
for (int i = 0; i < next; i++)
ms.WriteByte(outBuffer[i]);
next = 0;
first = false;
}
}
} while (true);
return ms.ToArray();
}
// Decode a code using huffman table h.
private static int Decode(Huffman h, BitReader br)
{
int code = 0; // len bits being decoded
int first = 0; // first code of length len
int index = 0; // index of first code of length len in symbol table
short next = 1;
while (true)
{
code |= br.ReadBits(1) ^ 1; // invert code
int count = h.Count[next++];
if (code < first + count)
return h.Symbol[index + (code - first)];
index += count;
first += count;
first <<= 1;
code <<= 1;
}
}
}
class BitReader
{
readonly byte[] src;
int offset = 0;
int bitBuffer = 0;
int bitCount = 0;
public BitReader(byte[] src)
{
this.src = src;
}
public int ReadBits(int count)
{
int ret = 0;
int filled = 0;
while (filled < count)
{
if (bitCount == 0)
{
bitBuffer = src[offset++];
bitCount = 8;
}
ret |= (bitBuffer & 1) << filled;
bitBuffer >>= 1;
bitCount--;
filled++;
}
return ret;
}
}
/*
* Given a list of repeated code lengths rep[0..n-1], where each byte is a
* count (high four bits + 1) and a code length (low four bits), generate the
* list of code lengths. This compaction reduces the size of the object code.
* Then given the list of code lengths length[0..n-1] representing a canonical
* Huffman code for n symbols, construct the tables required to decode those
* codes. Those tables are the number of codes of each length, and the symbols
* sorted by length, retaining their original order within each length.
*/
class Huffman
{
public short[] Count; // number of symbols of each length
public short[] Symbol; // canonically ordered symbols
public Huffman(byte[] rep, int n, short SymbolCount)
{
short[] length = new short[256]; // code lengths
int s = 0; // current symbol
// convert compact repeat counts into symbol bit length list
foreach (byte code in rep)
{
int num = (code >> 4) + 1; // Number of codes (top four bits plus 1)
byte len = (byte)(code & 15); // Code length (low four bits)
do
{
length[s++] = len;
} while (--num > 0);
}
n = s;
// count number of codes of each length
Count = new short[Blast.MAXBITS + 1];
for (int i = 0; i < n; i++)
Count[length[i]]++;
// no codes!
if (Count[0] == n)
return;
// check for an over-subscribed or incomplete set of lengths
int left = 1; // one possible code of zero length
for (int len = 1; len <= Blast.MAXBITS; len++)
{
left <<= 1;
// one more bit, double codes left
left -= Count[len];
// deduct count from possible codes
if (left < 0)
throw new InvalidDataException ("over subscribed code set");
}
// generate offsets into symbol table for each length for sorting
short[] offs = new short[Blast.MAXBITS + 1];
for (int 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
Symbol = new short[SymbolCount];
for (short i = 0; i < n; i++)
if (length[i] != 0)
Symbol[offs[length[i]]++] = i;
}
}
}

View File

@@ -1,416 +1,406 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
namespace OpenRA.FileFormats
{
class Blowfish
{
public Blowfish(byte[] key)
{
for (int i = 0, j = 0; i < 18; ++i)
{
uint a = key[j++ % key.Length];
uint b = key[j++ % key.Length];
uint c = key[j++ % key.Length];
uint d = key[j++ % key.Length];
m_p[i] ^= a << 24 | b << 16 | c << 8 | d;
}
uint l = 0, r = 0;
for (int 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; )
{
Encrypt(ref l, ref r);
m_s[i, j++] = l;
m_s[i, j++] = r;
}
}
public uint[] Encrypt(uint[] data) { return RunCipher(data, Encrypt); }
public uint[] Decrypt(uint[] data) { return RunCipher(data, Decrypt); }
delegate void CipherFunc( ref uint a, ref uint b );
uint[] RunCipher(uint[] data, CipherFunc f)
{
uint[] result = new uint[data.Length];
int size = data.Length / 2;
int i = 0;
while (size-- > 0)
{
uint a = SwapBytes(data[i]);
uint b = SwapBytes(data[i+1]);
f(ref a, ref b);
result[i++] = SwapBytes(a);
result[i++] = SwapBytes(b);
}
return result;
}
void Encrypt(ref uint a, ref uint b)
{
uint _a = a, _b = b;
_a ^= m_p[0];
bool x = false;
for( int i = 1; i <= 16; i++, x ^= true)
{
if (x)
Round(ref _a, _b, i);
else
Round(ref _b, _a, i);
}
_b ^= m_p[17];
a = _b;
b = _a;
}
void Decrypt(ref uint a, ref uint b)
{
uint _a = a, _b = b;
_a ^= m_p[17];
bool x = false;
for (int i = 16; i >= 1; i--, x ^= true)
{
if (x)
Round(ref _a, _b, i);
else
Round(ref _b, _a, i);
}
_b ^= m_p[0];
a = _b;
b = _a;
}
uint S(uint x, int i)
{
return m_s[i, (x >> ((3 - i) << 3)) & 0xff];
}
uint bf_f(uint x)
{
return ((S(x, 0) + S(x, 1)) ^ S(x, 2)) + S(x, 3);
}
void Round(ref uint a, uint b, int n)
{
a ^= bf_f(b) ^ m_p[n];
}
uint SwapBytes(uint i)
{
i = (i << 16) | (i >> 16);
i = ((i << 8) & 0xff00ff00) | ((i >> 8) & 0x00ff00ff);
return i;
}
uint[] m_p = new uint[] {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
};
uint[,] m_s = new uint[,] {
{
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
},
{
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
},
{
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
},
{
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
}
};
}
}
#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
{
class Blowfish
{
public Blowfish(byte[] key)
{
for (int i = 0, j = 0; i < 18; ++i)
{
uint a = key[j++ % key.Length];
uint b = key[j++ % key.Length];
uint c = key[j++ % key.Length];
uint d = key[j++ % key.Length];
m_p[i] ^= a << 24 | b << 16 | c << 8 | d;
}
uint l = 0, r = 0;
for (int 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; )
{
Encrypt(ref l, ref r);
m_s[i, j++] = l;
m_s[i, j++] = r;
}
}
public uint[] Encrypt(uint[] data) { return RunCipher(data, Encrypt); }
public uint[] Decrypt(uint[] data) { return RunCipher(data, Decrypt); }
delegate void CipherFunc( ref uint a, ref uint b );
uint[] RunCipher(uint[] data, CipherFunc f)
{
uint[] result = new uint[data.Length];
int size = data.Length / 2;
int i = 0;
while (size-- > 0)
{
uint a = SwapBytes(data[i]);
uint b = SwapBytes(data[i+1]);
f(ref a, ref b);
result[i++] = SwapBytes(a);
result[i++] = SwapBytes(b);
}
return result;
}
void Encrypt(ref uint a, ref uint b)
{
uint _a = a, _b = b;
_a ^= m_p[0];
bool x = false;
for( int i = 1; i <= 16; i++, x ^= true)
{
if (x)
Round(ref _a, _b, i);
else
Round(ref _b, _a, i);
}
_b ^= m_p[17];
a = _b;
b = _a;
}
void Decrypt(ref uint a, ref uint b)
{
uint _a = a, _b = b;
_a ^= m_p[17];
bool x = false;
for (int i = 16; i >= 1; i--, x ^= true)
{
if (x)
Round(ref _a, _b, i);
else
Round(ref _b, _a, i);
}
_b ^= m_p[0];
a = _b;
b = _a;
}
uint S(uint x, int i)
{
return m_s[i, (x >> ((3 - i) << 3)) & 0xff];
}
uint bf_f(uint x)
{
return ((S(x, 0) + S(x, 1)) ^ S(x, 2)) + S(x, 3);
}
void Round(ref uint a, uint b, int n)
{
a ^= bf_f(b) ^ m_p[n];
}
uint SwapBytes(uint i)
{
i = (i << 16) | (i >> 16);
i = ((i << 8) & 0xff00ff00) | ((i >> 8) & 0x00ff00ff);
return i;
}
uint[] m_p = new uint[] {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
};
uint[,] m_s = new uint[,] {
{
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
},
{
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
},
{
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
},
{
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
}
};
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +1,36 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
namespace OpenRA.FileFormats
{
public static class Format2
{
public static int DecodeInto(byte[] src, byte[] dest)
{
FastByteReader r = new FastByteReader(src);
int i = 0;
while (!r.Done())
{
byte cmd = r.ReadByte();
if (cmd == 0)
{
byte count = r.ReadByte();
while (count-- > 0)
dest[i++] = 0;
}
else
dest[i++] = cmd;
}
return i;
}
}
}
#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 Format2
{
public static int DecodeInto(byte[] src, byte[] dest)
{
FastByteReader r = new FastByteReader(src);
int i = 0;
while (!r.Done())
{
byte cmd = r.ReadByte();
if (cmd == 0)
{
byte count = r.ReadByte();
while (count-- > 0)
dest[i++] = 0;
}
else
dest[i++] = cmd;
}
return i;
}
}
}

View File

@@ -1,88 +1,78 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
}
}
}
}
}
}
#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,135 +1,150 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
namespace OpenRA.FileFormats
{
class FastByteReader
{
readonly byte[] src;
int offset = 0;
public FastByteReader(byte[] src)
{
this.src = src;
}
public bool Done() { return offset >= src.Length; }
public byte ReadByte() { return src[offset++]; }
public int ReadWord()
{
int x = ReadByte();
return x | (ReadByte() << 8);
}
public void CopyTo(byte[] dest, int offset, int count)
{
Array.Copy(src, this.offset, dest, offset, count);
this.offset += count;
}
}
public static class Format80
{
static void ReplicatePrevious( byte[] dest, int destIndex, int srcIndex, int count )
{
if( srcIndex > destIndex )
throw new NotImplementedException( string.Format( "srcIndex > destIndex {0} {1}", srcIndex, destIndex ) );
if( destIndex - srcIndex == 1 )
{
for( int i = 0 ; i < count ; i++ )
dest[ destIndex + i ] = dest[ destIndex - 1 ];
}
else
{
for( int i = 0 ; i < count ; i++ )
dest[ destIndex + i ] = dest[ srcIndex + i ];
}
}
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 )
{
// case 2
byte secondByte = ctx.ReadByte();
int count = ( ( i & 0x70 ) >> 4 ) + 3;
int rpos = ( ( i & 0xf ) << 8 ) + secondByte;
ReplicatePrevious( dest, destIndex, destIndex - rpos, count );
destIndex += count;
}
else if( ( i & 0x40 ) == 0 )
{
// case 1
int count = i & 0x3F;
if( count == 0 )
return destIndex;
ctx.CopyTo( dest, destIndex, count );
destIndex += count;
}
else
{
int count3 = i & 0x3F;
if( count3 == 0x3E )
{
// case 4
int count = ctx.ReadWord();
byte color = ctx.ReadByte();
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = color;
}
else if( count3 == 0x3F )
{
// case 5
int count = ctx.ReadWord();
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = dest[ srcIndex++ ];
}
else
{
// case 3
int count = count3 + 3;
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = dest[ srcIndex++ ];
}
}
}
}
}
}
#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.IO;
namespace OpenRA.FileFormats
{
class FastByteReader
{
readonly byte[] src;
int offset = 0;
public FastByteReader(byte[] src)
{
this.src = src;
}
public bool Done() { return offset >= src.Length; }
public byte ReadByte() { return src[offset++]; }
public int ReadWord()
{
int x = ReadByte();
return x | (ReadByte() << 8);
}
public void CopyTo(byte[] dest, int offset, int count)
{
Array.Copy(src, this.offset, dest, offset, count);
this.offset += count;
}
public int Remaining() { return src.Length - offset; }
}
public static class Format80
{
static void ReplicatePrevious( byte[] dest, int destIndex, int srcIndex, int count )
{
if( srcIndex > destIndex )
throw new NotImplementedException( string.Format( "srcIndex > destIndex {0} {1}", srcIndex, destIndex ) );
if( destIndex - srcIndex == 1 )
{
for( int i = 0 ; i < count ; i++ )
dest[ destIndex + i ] = dest[ destIndex - 1 ];
}
else
{
for( int i = 0 ; i < count ; i++ )
dest[ destIndex + i ] = dest[ srcIndex + i ];
}
}
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 )
{
// case 2
byte secondByte = ctx.ReadByte();
int count = ( ( i & 0x70 ) >> 4 ) + 3;
int rpos = ( ( i & 0xf ) << 8 ) + secondByte;
ReplicatePrevious( dest, destIndex, destIndex - rpos, count );
destIndex += count;
}
else if( ( i & 0x40 ) == 0 )
{
// case 1
int count = i & 0x3F;
if( count == 0 )
return destIndex;
ctx.CopyTo( dest, destIndex, count );
destIndex += count;
}
else
{
int count3 = i & 0x3F;
if( count3 == 0x3E )
{
// case 4
int count = ctx.ReadWord();
byte color = ctx.ReadByte();
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = color;
}
else if( count3 == 0x3F )
{
// case 5
int count = ctx.ReadWord();
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = dest[ srcIndex++ ];
}
else
{
// case 3
int count = count3 + 3;
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = dest[ srcIndex++ ];
}
}
}
}
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
{
var len = Math.Min(ctx.Remaining(), 0x3F);
ms.WriteByte((byte)(0x80 | len));
while (len-- > 0)
ms.WriteByte(ctx.ReadByte());
}
while (!ctx.Done());
ms.WriteByte(0x80); // terminator -- 0-length run.
return ms.ToArray();
}
}
}

View File

@@ -1,161 +1,151 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
namespace OpenRA.FileFormats
{
public class IniFile
{
Dictionary<string, IniSection> sections = new Dictionary<string, IniSection>();
public IniFile( Stream s )
{
Load( s );
}
public IniFile( params Stream[] streams )
{
foreach( var s in streams )
Load( s );
}
public void Load( Stream s )
{
StreamReader reader = new StreamReader( s );
IniSection currentSection = null;
while( !reader.EndOfStream )
{
string line = reader.ReadLine();
if( line.Length == 0 ) continue;
switch( line[ 0 ] )
{
case ';': break;
case '[': currentSection = ProcessSection( line ); break;
default: ProcessEntry( line, currentSection ); break;
}
}
}
Regex sectionPattern = new Regex( @"^\[([^]]*)\]" );
IniSection ProcessSection( string line )
{
Match m = sectionPattern.Match( line );
if( m == null || !m.Success )
return null;
string sectionName = m.Groups[ 1 ].Value.ToLowerInvariant();
IniSection ret;
if( !sections.TryGetValue( sectionName, out ret ) )
sections.Add( sectionName, ret = new IniSection( sectionName ) );
return ret;
}
bool ProcessEntry( string line, IniSection currentSection )
{
int comment = line.IndexOf( ';' );
if( comment >= 0 )
line = line.Substring( 0, comment );
line = line.Trim();
if( line.Length == 0 )
return false;
var key = line;
var value = "";
int eq = line.IndexOf( '=' );
if( eq >= 0 )
{
key = line.Substring( 0, eq );
value = line.Substring( eq + 1, line.Length - eq - 1 );
}
if( currentSection == null )
throw new InvalidOperationException( "No current INI section" );
if( !currentSection.Contains( key ) )
currentSection.Add( key, value );
return true;
}
public IniSection GetSection( string s )
{
return GetSection( s, false );
}
public IniSection GetSection( string s, bool allowFail )
{
IniSection section;
if( sections.TryGetValue( s.ToLowerInvariant(), out section ) )
return section;
if( allowFail )
return new IniSection( s );
throw new InvalidOperationException( "Section does not exist in map or rules: " + s );
}
public IEnumerable<IniSection> Sections { get { return sections.Values; } }
}
public class IniSection : IEnumerable<KeyValuePair<string, string>>
{
public string Name { get; private set; }
Dictionary<string, string> values = new Dictionary<string, string>();
public IniSection( string name )
{
Name = name;
}
public void Add( string key, string value )
{
values[key] = value;
}
public bool Contains( string key )
{
return values.ContainsKey( key );
}
public string GetValue( string key, string defaultValue )
{
string s;
return values.TryGetValue( key, out s ) ? s : defaultValue;
}
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
#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;
using System.IO;
using System.Text.RegularExpressions;
namespace OpenRA.FileFormats
{
public class IniFile
{
Dictionary<string, IniSection> sections = new Dictionary<string, IniSection>();
public IniFile( Stream s )
{
Load( s );
}
public IniFile( params Stream[] streams )
{
foreach( var s in streams )
Load( s );
}
public void Load( Stream s )
{
StreamReader reader = new StreamReader( s );
IniSection currentSection = null;
while( !reader.EndOfStream )
{
string line = reader.ReadLine();
if( line.Length == 0 ) continue;
switch( line[ 0 ] )
{
case ';': break;
case '[': currentSection = ProcessSection( line ); break;
default: ProcessEntry( line, currentSection ); break;
}
}
}
Regex sectionPattern = new Regex( @"^\[([^]]*)\]" );
IniSection ProcessSection( string line )
{
Match m = sectionPattern.Match( line );
if( m == null || !m.Success )
return null;
string sectionName = m.Groups[ 1 ].Value.ToLowerInvariant();
IniSection ret;
if( !sections.TryGetValue( sectionName, out ret ) )
sections.Add( sectionName, ret = new IniSection( sectionName ) );
return ret;
}
bool ProcessEntry( string line, IniSection currentSection )
{
int comment = line.IndexOf( ';' );
if( comment >= 0 )
line = line.Substring( 0, comment );
line = line.Trim();
if( line.Length == 0 )
return false;
var key = line;
var value = "";
int eq = line.IndexOf( '=' );
if( eq >= 0 )
{
key = line.Substring( 0, eq );
value = line.Substring( eq + 1, line.Length - eq - 1 );
}
if( currentSection == null )
throw new InvalidOperationException( "No current INI section" );
if( !currentSection.Contains( key ) )
currentSection.Add( key, value );
return true;
}
public IniSection GetSection( string s )
{
return GetSection( s, false );
}
public IniSection GetSection( string s, bool allowFail )
{
IniSection section;
if( sections.TryGetValue( s.ToLowerInvariant(), out section ) )
return section;
if( allowFail )
return new IniSection( s );
throw new InvalidOperationException( "Section does not exist in map or rules: " + s );
}
public IEnumerable<IniSection> Sections { get { return sections.Values; } }
}
public class IniSection : IEnumerable<KeyValuePair<string, string>>
{
public string Name { get; private set; }
Dictionary<string, string> values = new Dictionary<string, string>();
public IniSection( string name )
{
Name = name;
}
public void Add( string key, string value )
{
values[key] = value;
}
public bool Contains( string key )
{
return values.ContainsKey( key );
}
public string GetValue( string key, string defaultValue )
{
string s;
return values.TryGetValue( key, out s ) ? s : defaultValue;
}
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@@ -1,168 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace OpenRA.FileFormats
{
public static class FileSystem
{
static List<IFolder> mountedFolders = new List<IFolder>();
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
static void MountInner(IFolder folder)
{
mountedFolders.Add(folder);
foreach( var hash in folder.AllFileHashes() )
{
var l = allFiles[hash];
if( !l.Contains( folder ) )
l.Add( folder );
}
}
public static void Mount(string name)
{
name = name.ToLowerInvariant();
var optional = name.StartsWith("~");
if (optional) name = name.Substring(1);
var a = name.EndsWith(".mix")
? (Action)(() => FileSystem.MountInner(new Package(name)))
: () => FileSystem.MountInner(new Folder(name));
if (optional)
try { a(); }
catch { }
else
a();
}
public static void UnmountAll()
{
mountedFolders.Clear();
allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
}
static Stream GetFromCache( Cache<uint, List<IFolder>> index, string filename )
{
foreach( var folder in index[ PackageEntry.HashFilename( filename ) ] )
{
Stream s = folder.GetContent(filename);
if( s != null )
return s;
}
return null;
}
public static Stream Open(string filename)
{
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
{
var ret = GetFromCache( allFiles, filename );
if( ret != null )
return ret;
}
foreach( IFolder folder in mountedFolders )
{
Stream s = folder.GetContent(filename);
if( s != null )
return s;
}
throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename );
}
public static Stream OpenWithExts( string filename, params string[] exts )
{
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
{
foreach( var ext in exts )
{
var s = GetFromCache( allFiles, filename + ext );
if( s != null )
return s;
}
}
foreach( var ext in exts )
{
foreach( IFolder folder in mountedFolders )
{
Stream s = folder.GetContent( filename + ext );
if( s != null )
return s;
}
}
throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename );
}
public static bool Exists(string filename)
{
foreach (var folder in mountedFolders)
{
var s = folder.GetContent(filename);
if (s != null)
{
s.Dispose();
return true;
}
}
return false;
}
static Dictionary<string, Assembly> assemblyCache = new Dictionary<string, Assembly>();
public static Assembly ResolveAssembly(object sender, ResolveEventArgs e)
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
if (assembly.FullName == e.Name)
return assembly;
}
string[] frags = e.Name.Split(',');
var filename = frags[0] + ".dll";
Assembly a;
if (assemblyCache.TryGetValue(filename, out a))
return a;
if (FileSystem.Exists(filename))
using (Stream s = FileSystem.Open(filename))
{
byte[] buf = new byte[s.Length];
s.Read(buf, 0, buf.Length);
a = Assembly.Load(buf);
assemblyCache.Add(filename, a);
return a;
}
return null;
}
}
}

View File

@@ -0,0 +1,206 @@
#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.Generic;
using System.IO;
using System.Reflection;
using System.Linq;
namespace OpenRA.FileFormats
{
public static class FileSystem
{
static List<IFolder> mountedFolders = new List<IFolder>();
public static string SpecialPackageRoot = "";
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
static void MountInner(IFolder folder)
{
mountedFolders.Add(folder);
foreach( var hash in folder.AllFileHashes() )
{
var l = allFiles[hash];
if( !l.Contains( folder ) )
l.Add( folder );
}
}
static int order = 0;
static IFolder OpenPackage(string filename)
{
return OpenPackage(filename, order++);
}
public static IFolder CreatePackage(string filename, int order, Dictionary<string, byte[]> content)
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
return new MixFile(filename, order, content);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
throw new NotImplementedException("Creating .Z archives is unsupported");
else
return new Folder(filename, order, content);
}
public static IFolder OpenPackage(string filename, int order)
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
return new MixFile(filename, order);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
return new InstallShieldPackage(filename, order);
else
return new Folder(filename, order);
}
public static void Mount(string name)
{
var optional = name.StartsWith("~");
if (optional) name = name.Substring(1);
// paths starting with $ are relative to SpecialPackageRoot
if (name.StartsWith("$"))
name = SpecialPackageRoot+name.Substring(1);
var a = (Action)(() => FileSystem.MountInner(OpenPackage(name)));
if (optional)
try { a(); }
catch { }
else
a();
}
public static void UnmountAll()
{
mountedFolders.Clear();
allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
}
public static bool Unmount(IFolder mount)
{
return (mountedFolders.RemoveAll(f => f == mount) > 0);
}
public static void Mount(IFolder mount)
{
if (!mountedFolders.Contains(mount)) mountedFolders.Add(mount);
}
public static void LoadFromManifest( Manifest manifest )
{
UnmountAll();
foreach (var dir in manifest.Folders) Mount(dir);
foreach (var pkg in manifest.Packages) Mount(pkg);
}
static Stream GetFromCache( Cache<uint, List<IFolder>> index, string filename )
{
var folder = index[PackageEntry.HashFilename(filename)]
.Where(x => x.Exists(filename))
.OrderBy(x => x.Priority)
.FirstOrDefault();
if (folder != null)
return folder.GetContent(filename);
return null;
}
public static Stream Open(string filename)
{
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
{
var ret = GetFromCache( allFiles, filename );
if( ret != null )
return ret;
}
var folder = mountedFolders
.Where(x => x.Exists(filename))
.OrderByDescending(x => x.Priority)
.FirstOrDefault();
if (folder != null)
return folder.GetContent(filename);
throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename );
}
public static Stream OpenWithExts( string filename, params string[] exts )
{
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
{
foreach( var ext in exts )
{
var s = GetFromCache( allFiles, filename + ext );
if( s != null )
return s;
}
}
foreach( var ext in exts )
{
foreach( IFolder folder in mountedFolders )
if (folder.Exists(filename + ext))
return folder.GetContent( filename + ext );
}
throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename );
}
public static bool Exists(string filename)
{
foreach (var folder in mountedFolders)
if (folder.Exists(filename))
return true;
return false;
}
static Dictionary<string, Assembly> assemblyCache = new Dictionary<string, Assembly>();
public static Assembly ResolveAssembly(object sender, ResolveEventArgs e)
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
if (assembly.FullName == e.Name)
return assembly;
}
string[] frags = e.Name.Split(',');
var filename = frags[0] + ".dll";
Assembly a;
if (assemblyCache.TryGetValue(filename, out a))
return a;
if (FileSystem.Exists(filename))
using (Stream s = FileSystem.Open(filename))
{
byte[] buf = new byte[s.Length];
s.Read(buf, 0, buf.Length);
a = Assembly.Load(buf);
assemblyCache.Add(filename, a);
return a;
}
return null;
}
}
}

View File

@@ -0,0 +1,76 @@
#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.IO;
using System;
namespace OpenRA.FileFormats
{
public class Folder : IFolder
{
readonly string path;
int priority;
// Create a new folder package
public Folder(string path, int priority, Dictionary<string, byte[]> contents)
{
this.path = path;
this.priority = priority;
if (Directory.Exists(path))
Directory.Delete(path);
Write(contents);
}
public Folder(string path, int priority)
{
this.path = path;
this.priority = priority;
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
}
public Stream GetContent(string filename)
{
try { return File.OpenRead( Path.Combine( path, filename ) ); }
catch { return null; }
}
public IEnumerable<uint> AllFileHashes()
{
foreach( var filename in Directory.GetFiles( path, "*", SearchOption.TopDirectoryOnly ) )
yield return PackageEntry.HashFilename( Path.GetFileName(filename) );
}
public bool Exists(string filename)
{
return File.Exists(Path.Combine(path,filename));
}
public int Priority
{
get { return priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
foreach (var file in contents)
using (var dataStream = File.Create(Path.Combine(path, file.Key)))
using (var writer = new BinaryWriter(dataStream))
writer.Write(file.Value);
}
}
}

View File

@@ -0,0 +1,126 @@
#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.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
public class InstallShieldPackage : IFolder
{
readonly Dictionary<uint, PackageEntry> index = new Dictionary<uint, PackageEntry>();
readonly Stream s;
readonly long dataStart = 255;
int priority;
public InstallShieldPackage(string filename, int priority)
{
this.priority = priority;
s = FileSystem.Open(filename);
// Parse package header
BinaryReader reader = new BinaryReader(s);
uint signature = reader.ReadUInt32();
if (signature != 0x8C655D13)
throw new InvalidDataException("Not an Installshield package");
reader.ReadBytes(8);
/*var FileCount = */reader.ReadUInt16();
reader.ReadBytes(4);
/*var ArchiveSize = */reader.ReadUInt32();
reader.ReadBytes(19);
var TOCAddress = reader.ReadInt32();
reader.ReadBytes(4);
var DirCount = reader.ReadUInt16();
// Parse the directory list
s.Seek(TOCAddress, SeekOrigin.Begin);
BinaryReader TOCreader = new BinaryReader(s);
for (var i = 0; i < DirCount; i++)
ParseDirectory(TOCreader);
}
void ParseDirectory(BinaryReader reader)
{
// Parse directory header
var FileCount = reader.ReadUInt16();
var ChunkSize = reader.ReadUInt16();
var NameLength = reader.ReadUInt16();
reader.ReadChars(NameLength); //var DirName = new String(reader.ReadChars(NameLength));
// Skip to the end of the chunk
reader.ReadBytes(ChunkSize - NameLength - 6);
// Parse files
for (var i = 0; i < FileCount; i++)
ParseFile(reader);
}
uint AccumulatedData = 0;
void ParseFile(BinaryReader reader)
{
reader.ReadBytes(7);
var CompressedSize = reader.ReadUInt32();
reader.ReadBytes(12);
var ChunkSize = reader.ReadUInt16();
reader.ReadBytes(4);
var NameLength = reader.ReadByte();
var FileName = new String(reader.ReadChars(NameLength));
var hash = PackageEntry.HashFilename(FileName);
index.Add(hash, new PackageEntry(hash,AccumulatedData, CompressedSize));
AccumulatedData += CompressedSize;
// Skip to the end of the chunk
reader.ReadBytes(ChunkSize - NameLength - 30);
}
public Stream GetContent(uint hash)
{
PackageEntry e;
if (!index.TryGetValue(hash, out e))
return null;
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
byte[] data = new byte[ e.Length ];
s.Read( data, 0, (int)e.Length );
return new MemoryStream(Blast.Decompress(data));
}
public Stream GetContent(string filename)
{
return GetContent(PackageEntry.HashFilename(filename));
}
public IEnumerable<uint> AllFileHashes()
{
return index.Keys;
}
public bool Exists(string filename)
{
return index.ContainsKey(PackageEntry.HashFilename(filename));
}
public int Priority
{
get { return 2000 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
throw new NotImplementedException("Cannot save InstallShieldPackages.");
}
}
}

View File

@@ -1,166 +1,220 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
public interface IFolder
{
Stream GetContent(string filename);
IEnumerable<uint> AllFileHashes();
}
public class Package : IFolder
{
readonly Dictionary<uint, PackageEntry> index;
readonly bool isRmix, isEncrypted;
readonly long dataStart;
readonly Stream s;
public Package(string filename)
{
s = FileSystem.Open(filename);
BinaryReader reader = new BinaryReader(s);
uint signature = reader.ReadUInt32();
isRmix = 0 == (signature & ~(uint)(MixFileFlags.Checksum | MixFileFlags.Encrypted));
if (isRmix)
{
isEncrypted = 0 != (signature & (uint)MixFileFlags.Encrypted);
if( isEncrypted )
{
index = ParseRaHeader( s, out dataStart ).ToDictionary(x => x.Hash);
return;
}
}
else
s.Seek( 0, SeekOrigin.Begin );
isEncrypted = false;
index = ParseTdHeader(s, out dataStart).ToDictionary(x => x.Hash);
}
const long headerStart = 84;
List<PackageEntry> ParseRaHeader(Stream s, out long dataStart)
{
BinaryReader reader = new BinaryReader(s);
byte[] keyblock = reader.ReadBytes(80);
byte[] blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
uint[] h = ReadUints(reader, 2);
Blowfish fish = new Blowfish(blowfishKey);
MemoryStream ms = Decrypt( h, fish );
BinaryReader reader2 = new BinaryReader(ms);
ushort numFiles = reader2.ReadUInt16();
uint datasize = reader2.ReadUInt32();
Console.WriteLine("{0} files, {1} kb", numFiles, datasize >> 10);
s.Position = headerStart;
reader = new BinaryReader(s);
int byteCount = 6 + numFiles * PackageEntry.Size;
h = ReadUints( reader, ( byteCount + 3 ) / 4 );
ms = Decrypt( h, fish );
dataStart = headerStart + byteCount + ( ( ~byteCount + 1 ) & 7 );
long ds;
return ParseTdHeader( ms, out ds );
}
static MemoryStream Decrypt( uint[] h, Blowfish fish )
{
uint[] decrypted = fish.Decrypt( h );
MemoryStream ms = new MemoryStream();
BinaryWriter writer = new BinaryWriter( ms );
foreach( uint t in decrypted )
writer.Write( t );
writer.Flush();
ms.Position = 0;
return ms;
}
uint[] ReadUints(BinaryReader r, int count)
{
uint[] ret = new uint[count];
for (int i = 0; i < ret.Length; i++)
ret[i] = r.ReadUInt32();
return ret;
}
List<PackageEntry> ParseTdHeader(Stream s, out long dataStart)
{
List<PackageEntry> items = new List<PackageEntry>();
BinaryReader reader = new BinaryReader(s);
ushort numFiles = reader.ReadUInt16();
/*uint dataSize = */reader.ReadUInt32();
for (int i = 0; i < numFiles; i++)
items.Add(new PackageEntry(reader));
dataStart = s.Position;
return items;
}
public Stream GetContent(uint hash)
{
PackageEntry e;
if (!index.TryGetValue(hash, out e))
return null;
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
byte[] data = new byte[ e.Length ];
s.Read( data, 0, (int)e.Length );
return new MemoryStream(data);
}
public Stream GetContent(string filename)
{
return GetContent(PackageEntry.HashFilename(filename));
}
public IEnumerable<uint> AllFileHashes()
{
return index.Keys;
}
}
[Flags]
enum MixFileFlags : uint
{
Checksum = 0x10000,
Encrypted = 0x20000,
}
}
#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.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
public interface IFolder
{
Stream GetContent(string filename);
bool Exists(string filename);
IEnumerable<uint> AllFileHashes();
void Write(Dictionary<string, byte[]> contents);
int Priority { get; }
}
public class MixFile : IFolder
{
readonly Dictionary<uint, PackageEntry> index;
readonly bool isRmix, isEncrypted;
readonly long dataStart;
readonly Stream s;
int priority;
// Create a new MixFile
public MixFile(string filename, int priority, Dictionary<string, byte[]> contents)
{
this.priority = priority;
if (File.Exists(filename))
File.Delete(filename);
s = File.Create(filename);
Write(contents);
}
public MixFile(string filename, int priority)
{
this.priority = priority;
s = FileSystem.Open(filename);
BinaryReader reader = new BinaryReader(s);
uint signature = reader.ReadUInt32();
isRmix = 0 == (signature & ~(uint)(MixFileFlags.Checksum | MixFileFlags.Encrypted));
if (isRmix)
{
isEncrypted = 0 != (signature & (uint)MixFileFlags.Encrypted);
if( isEncrypted )
{
index = ParseRaHeader( s, out dataStart ).ToDictionary(x => x.Hash);
return;
}
}
else
s.Seek( 0, SeekOrigin.Begin );
isEncrypted = false;
index = ParseTdHeader(s, out dataStart).ToDictionary(x => x.Hash);
}
const long headerStart = 84;
List<PackageEntry> ParseRaHeader(Stream s, out long dataStart)
{
BinaryReader reader = new BinaryReader(s);
byte[] keyblock = reader.ReadBytes(80);
byte[] blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
uint[] h = ReadUints(reader, 2);
Blowfish fish = new Blowfish(blowfishKey);
MemoryStream ms = Decrypt( h, fish );
BinaryReader reader2 = new BinaryReader(ms);
ushort numFiles = reader2.ReadUInt16();
reader2.ReadUInt32(); /*datasize*/
s.Position = headerStart;
reader = new BinaryReader(s);
int byteCount = 6 + numFiles * PackageEntry.Size;
h = ReadUints( reader, ( byteCount + 3 ) / 4 );
ms = Decrypt( h, fish );
dataStart = headerStart + byteCount + ( ( ~byteCount + 1 ) & 7 );
long ds;
return ParseTdHeader( ms, out ds );
}
static MemoryStream Decrypt( uint[] h, Blowfish fish )
{
uint[] decrypted = fish.Decrypt( h );
MemoryStream ms = new MemoryStream();
BinaryWriter writer = new BinaryWriter( ms );
foreach( uint t in decrypted )
writer.Write( t );
writer.Flush();
ms.Position = 0;
return ms;
}
uint[] ReadUints(BinaryReader r, int count)
{
uint[] ret = new uint[count];
for (int i = 0; i < ret.Length; i++)
ret[i] = r.ReadUInt32();
return ret;
}
List<PackageEntry> ParseTdHeader(Stream s, out long dataStart)
{
List<PackageEntry> items = new List<PackageEntry>();
BinaryReader reader = new BinaryReader(s);
ushort numFiles = reader.ReadUInt16();
/*uint dataSize = */reader.ReadUInt32();
for (int i = 0; i < numFiles; i++)
items.Add(new PackageEntry(reader));
dataStart = s.Position;
return items;
}
public Stream GetContent(uint hash)
{
PackageEntry e;
if (!index.TryGetValue(hash, out e))
return null;
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
byte[] data = new byte[ e.Length ];
s.Read( data, 0, (int)e.Length );
return new MemoryStream(data);
}
public Stream GetContent(string filename)
{
return GetContent(PackageEntry.HashFilename(filename));
}
public IEnumerable<uint> AllFileHashes()
{
return index.Keys;
}
public bool Exists(string filename)
{
return index.ContainsKey(PackageEntry.HashFilename(filename));
}
public int Priority
{
get { return 1000 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
// Cannot modify existing mixfile - rename existing file and
// create a new one with original content plus modifications
FileSystem.Unmount(this);
// TODO: Add existing data to the contents list
if (index.Count > 0)
throw new NotImplementedException("Updating mix files unfinished");
// Construct a list of entries for the file header
uint dataSize = 0;
var items = new List<PackageEntry>();
foreach (var kv in contents)
{
uint length = (uint)kv.Value.Length;
uint hash = PackageEntry.HashFilename(Path.GetFileName(kv.Key));
items.Add(new PackageEntry(hash, dataSize, length));
dataSize += length;
}
// Write the new file
s.Seek(0,SeekOrigin.Begin);
using (var writer = new BinaryWriter(s))
{
// Write file header
writer.Write((ushort)items.Count);
writer.Write(dataSize);
foreach (var item in items)
item.Write(writer);
writer.Flush();
// Copy file data
foreach (var file in contents)
s.Write(file.Value);
}
}
}
[Flags]
enum MixFileFlags : uint
{
Checksum = 0x10000,
Encrypted = 0x20000,
}
}

View File

@@ -0,0 +1,117 @@
#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.IO;
using ICSharpCode.SharpZipLib.Zip;
using SZipFile = ICSharpCode.SharpZipLib.Zip.ZipFile;
namespace OpenRA.FileFormats
{
public class ZipFile : IFolder
{
string filename;
SZipFile pkg;
int priority;
public ZipFile(string filename, int priority)
{
this.filename = filename;
this.priority = priority;
try
{
// pull the file into memory, dont keep it open.
pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename)));
}
catch (ZipException e)
{
Log.Write("debug", "Couldn't load zip file: {0}", e.Message);
}
}
// Create a new zip with the specified contents
public ZipFile(string filename, int priority, Dictionary<string, byte[]> contents)
{
this.priority = priority;
this.filename = filename;
if (File.Exists(filename))
File.Delete(filename);
pkg = SZipFile.Create(filename);
Write(contents);
}
public Stream GetContent(string filename)
{
using (var z = pkg.GetInputStream(pkg.GetEntry(filename)))
{
var ms = new MemoryStream();
int bufSize = 2048;
byte[] buf = new byte[bufSize];
while ((bufSize = z.Read(buf, 0, buf.Length)) > 0)
ms.Write(buf, 0, bufSize);
ms.Seek(0, SeekOrigin.Begin);
return ms;
}
}
public IEnumerable<uint> AllFileHashes()
{
foreach(ZipEntry entry in pkg)
yield return PackageEntry.HashFilename(entry.Name);
}
public bool Exists(string filename)
{
return pkg.GetEntry(filename) != null;
}
public int Priority
{
get { return 500 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
pkg.Close();
pkg = SZipFile.Create(filename);
pkg.BeginUpdate();
// TODO: Clear existing content?
foreach (var kvp in contents)
pkg.Add(new StaticMemoryDataSource(kvp.Value), kvp.Key);
pkg.CommitUpdate();
pkg.Close();
pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename)));
}
}
class StaticMemoryDataSource : IStaticDataSource
{
byte[] data;
public StaticMemoryDataSource (byte[] data)
{
this.data = data;
}
public Stream GetSource()
{
return new MemoryStream(data);
}
}
}

View File

@@ -1,44 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.IO;
namespace OpenRA.FileFormats
{
public class Folder : IFolder
{
readonly string path;
public Folder(string path) { this.path = path; }
public Stream GetContent(string filename)
{
try { return File.OpenRead( Path.Combine( path, filename ) ); }
catch { return null; }
}
public IEnumerable<uint> AllFileHashes()
{
foreach( var filename in Directory.GetFiles( path, "*", SearchOption.TopDirectoryOnly ) )
yield return PackageEntry.HashFilename( filename );
}
}
}

View File

@@ -1,156 +1,146 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public enum Dune2ImageFlags : int
{
F80_F2 = 0,
F2 = 2,
L16_F80_F2_1 = 1,
L16_F80_F2_2 = 3,
Ln_F80_F2 = 5
}
public class Dune2ImageHeader
{
public readonly Dune2ImageFlags Flags;
public readonly int Width;
public readonly int Height;
public readonly int Slices;
public readonly int FileSize;
public readonly int DataSize;
public readonly byte[] LookupTable;
public byte[] Image;
public Dune2ImageHeader(BinaryReader reader)
{
Flags = (Dune2ImageFlags)reader.ReadUInt16();
Slices = reader.ReadByte();
Width = reader.ReadUInt16();
Height = reader.ReadByte();
FileSize = reader.ReadUInt16();
DataSize = reader.ReadUInt16();
if (Flags == Dune2ImageFlags.L16_F80_F2_1 ||
Flags == Dune2ImageFlags.L16_F80_F2_2 ||
Flags == Dune2ImageFlags.Ln_F80_F2)
{
int n = Flags == Dune2ImageFlags.Ln_F80_F2 ? reader.ReadByte() : (byte)16;
LookupTable = new byte[n];
for (int i = 0; i < n; i++)
LookupTable[i] = reader.ReadByte();
}
else
{
LookupTable = new byte[256];
for (int i = 0; i < 256; i++)
LookupTable[i] = (byte)i;
LookupTable[1] = 0x7f;
LookupTable[2] = 0x7e;
LookupTable[3] = 0x7d;
LookupTable[4] = 0x7c;
}
}
public Size Size
{
get { return new Size(Width, Height); }
}
}
public class Dune2ShpReader : IEnumerable<Dune2ImageHeader>
{
public readonly int ImageCount;
List<Dune2ImageHeader> headers = new List<Dune2ImageHeader>();
public Dune2ShpReader(Stream stream)
{
BinaryReader reader = new BinaryReader(stream);
ImageCount = reader.ReadUInt16();
//Last offset is pointer to end of file.
uint[] offsets = new uint[ImageCount + 1];
uint temp = reader.ReadUInt32();
//If fourth byte in file is non-zero, the offsets are two bytes each.
bool twoByteOffsets = (temp & 0xFF0000) > 0;
if (twoByteOffsets)
{
offsets[0] = ((temp & 0xFFFF0000) >> 16) + 2; //Offset does not account for image count bytes
offsets[1] = (temp & 0xFFFF) + 2;
}
else
offsets[0] = temp + 2;
for (int i = twoByteOffsets ? 2 : 1; i < ImageCount + 1; i++)
offsets[i] = (twoByteOffsets ? reader.ReadUInt16() : reader.ReadUInt32()) + 2;
for (int i = 0; i < ImageCount; i++)
{
reader.BaseStream.Seek(offsets[i], SeekOrigin.Begin);
Dune2ImageHeader header = new Dune2ImageHeader(reader);
byte[] imgData = reader.ReadBytes(header.FileSize);
header.Image = new byte[header.Height * header.Width];
//Decode image data
if (header.Flags != Dune2ImageFlags.F2)
{
byte[] tempData = new byte[header.DataSize];
Format80.DecodeInto(imgData, tempData);
Format2.DecodeInto(tempData, header.Image);
}
else
Format2.DecodeInto(imgData, header.Image);
//Lookup values in lookup table
if (header.LookupTable != null)
for (int j = 0; j < header.Image.Length; j++)
header.Image[j] = header.LookupTable[header.Image[j]];
headers.Add(header);
}
}
public Dune2ImageHeader this[int index]
{
get { return headers[index]; }
}
public IEnumerator<Dune2ImageHeader> GetEnumerator()
{
return headers.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
#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;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public enum Dune2ImageFlags : int
{
F80_F2 = 0,
F2 = 2,
L16_F80_F2_1 = 1,
L16_F80_F2_2 = 3,
Ln_F80_F2 = 5
}
public class Dune2ImageHeader
{
public readonly Dune2ImageFlags Flags;
public readonly int Width;
public readonly int Height;
public readonly int Slices;
public readonly int FileSize;
public readonly int DataSize;
public readonly byte[] LookupTable;
public byte[] Image;
public Dune2ImageHeader(BinaryReader reader)
{
Flags = (Dune2ImageFlags)reader.ReadUInt16();
Slices = reader.ReadByte();
Width = reader.ReadUInt16();
Height = reader.ReadByte();
FileSize = reader.ReadUInt16();
DataSize = reader.ReadUInt16();
if (Flags == Dune2ImageFlags.L16_F80_F2_1 ||
Flags == Dune2ImageFlags.L16_F80_F2_2 ||
Flags == Dune2ImageFlags.Ln_F80_F2)
{
int n = Flags == Dune2ImageFlags.Ln_F80_F2 ? reader.ReadByte() : (byte)16;
LookupTable = new byte[n];
for (int i = 0; i < n; i++)
LookupTable[i] = reader.ReadByte();
}
else
{
LookupTable = new byte[256];
for (int i = 0; i < 256; i++)
LookupTable[i] = (byte)i;
LookupTable[1] = 0x7f;
LookupTable[2] = 0x7e;
LookupTable[3] = 0x7d;
LookupTable[4] = 0x7c;
}
}
public Size Size
{
get { return new Size(Width, Height); }
}
}
public class Dune2ShpReader : IEnumerable<Dune2ImageHeader>
{
public readonly int ImageCount;
List<Dune2ImageHeader> headers = new List<Dune2ImageHeader>();
public Dune2ShpReader(Stream stream)
{
BinaryReader reader = new BinaryReader(stream);
ImageCount = reader.ReadUInt16();
//Last offset is pointer to end of file.
uint[] offsets = new uint[ImageCount + 1];
uint temp = reader.ReadUInt32();
//If fourth byte in file is non-zero, the offsets are two bytes each.
bool twoByteOffsets = (temp & 0xFF0000) > 0;
if (twoByteOffsets)
{
offsets[0] = ((temp & 0xFFFF0000) >> 16) + 2; //Offset does not account for image count bytes
offsets[1] = (temp & 0xFFFF) + 2;
}
else
offsets[0] = temp + 2;
for (int i = twoByteOffsets ? 2 : 1; i < ImageCount + 1; i++)
offsets[i] = (twoByteOffsets ? reader.ReadUInt16() : reader.ReadUInt32()) + 2;
for (int i = 0; i < ImageCount; i++)
{
reader.BaseStream.Seek(offsets[i], SeekOrigin.Begin);
Dune2ImageHeader header = new Dune2ImageHeader(reader);
byte[] imgData = reader.ReadBytes(header.FileSize);
header.Image = new byte[header.Height * header.Width];
//Decode image data
if (header.Flags != Dune2ImageFlags.F2)
{
byte[] tempData = new byte[header.DataSize];
Format80.DecodeInto(imgData, tempData);
Format2.DecodeInto(tempData, header.Image);
}
else
Format2.DecodeInto(imgData, header.Image);
//Lookup values in lookup table
if (header.LookupTable != null)
for (int j = 0; j < header.Image.Length; j++)
header.Image[j] = header.LookupTable[header.Image[j]];
headers.Add(header);
}
}
public Dune2ImageHeader this[int index]
{
get { return headers[index]; }
}
public IEnumerator<Dune2ImageHeader> GetEnumerator()
{
return headers.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@@ -1,105 +1,97 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats.Graphics
{
[AttributeUsage( AttributeTargets.Assembly )]
public class RendererAttribute : Attribute
{
public readonly Type Type;
public RendererAttribute( Type graphicsDeviceType )
{
if( !typeof( IGraphicsDevice ).IsAssignableFrom( graphicsDeviceType ) )
throw new InvalidOperationException( "Incorrect type in RendererAttribute" );
Type = graphicsDeviceType;
}
}
public interface IGraphicsDevice
{
IVertexBuffer<Vertex> CreateVertexBuffer( int length );
IIndexBuffer CreateIndexBuffer( int length );
ITexture CreateTexture( Bitmap bitmap );
IShader CreateShader( Stream stream );
#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;
using System.IO;
namespace OpenRA.FileFormats.Graphics
{
[AttributeUsage( AttributeTargets.Assembly )]
public class RendererAttribute : Attribute
{
public readonly Type Type;
public RendererAttribute( Type graphicsDeviceType )
{
if( !typeof( IGraphicsDevice ).IsAssignableFrom( graphicsDeviceType ) )
throw new InvalidOperationException( "Incorrect type in RendererAttribute" );
Type = graphicsDeviceType;
}
}
public interface IGraphicsDevice
{
IVertexBuffer<Vertex> CreateVertexBuffer( int length );
IIndexBuffer CreateIndexBuffer( int length );
ITexture CreateTexture( Bitmap bitmap );
ITexture CreateTexture();
IShader CreateShader( string name );
Size WindowSize { get; }
void Begin();
void End();
void Clear( Color color );
void Present();
void DrawIndexedPrimitives( PrimitiveType type, Range<int> vertexRange, Range<int> indexRange );
void DrawIndexedPrimitives( PrimitiveType type, int vertexPool, int numPrimitives );
void EnableScissor( int left, int top, int width, int height );
void DisableScissor();
}
public interface IVertexBuffer<T>
{
void Bind();
void SetData( T[] vertices );
}
public interface IIndexBuffer
{
void Bind();
void SetData( ushort[] indices );
}
public interface IShader
{
void SetValue( string name, float x, float y );
void SetValue( string param, ITexture texture );
void Commit();
void Render( Action a );
}
public interface ITexture
{
void SetData( Bitmap bitmap );
}
public interface IFont
{
void DrawText( string text, int2 pos, Color c );
int2 Measure( string text );
}
public enum PrimitiveType
{
PointList,
LineList,
TriangleList,
}
public struct Range<T>
{
public readonly T Start, End;
public Range( T start, T end ) { Start = start; End = end; }
}
}
int GpuMemoryUsed { get; }
void Clear( Color color );
void Present( IInputHandler inputHandler );
void DrawIndexedPrimitives( PrimitiveType type, Range<int> vertexRange, Range<int> indexRange );
void DrawIndexedPrimitives( PrimitiveType type, int vertexPool, int numPrimitives );
void EnableScissor( int left, int top, int width, int height );
void DisableScissor();
}
public interface IVertexBuffer<T>
{
void Bind();
void SetData( T[] vertices, int length );
}
public interface IIndexBuffer
{
void Bind();
void SetData( uint[] indices, int length );
}
public interface IShader
{
void SetValue( string name, float x, float y );
void SetValue( string param, ITexture texture );
void Commit();
void Render( Action a );
}
public interface ITexture
{
void SetData(Bitmap bitmap);
void SetData(uint[,] colors);
void SetData(byte[] colors, int width, int height);
}
public enum PrimitiveType
{
PointList,
LineList,
TriangleList,
}
public struct Range<T>
{
public readonly T Start, End;
public Range( T start, T end ) { Start = start; End = end; }
}
public enum WindowMode
{
Windowed,
Fullscreen,
PseudoFullscreen,
}
}

View File

@@ -0,0 +1,71 @@
#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.Generic;
using System.Linq;
namespace OpenRA
{
public interface IInputHandler
{
void ModifierKeys( Modifiers mods );
void OnKeyInput( KeyInput input );
void OnMouseInput( MouseInput input );
}
public struct MouseInput
{
public MouseInputEvent Event;
public MouseButton Button;
public int2 Location;
public Modifiers Modifiers;
public MouseInput( MouseInputEvent ev, MouseButton button, int2 location, Modifiers mods )
{
this.Event = ev;
this.Button = button;
this.Location = location;
this.Modifiers = mods;
}
}
public enum MouseInputEvent { Down, Move, Up };
[Flags]
public enum MouseButton
{
None = 0,
Left = 1,
Right = 2,
Middle = 4,
WheelDown = 8,
WheelUp = 16
}
[Flags]
public enum Modifiers
{
None = 0,
Shift = 1,
Alt = 2,
Ctrl = 4,
}
public enum KeyInputEvent { Down, Up };
public struct KeyInput
{
public KeyInputEvent Event;
public char UnicodeChar;
public string KeyName;
public Modifiers Modifiers;
public int VirtKey;
}
}

View File

@@ -0,0 +1,181 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace OpenRA.FileFormats.Graphics
{
public static class PngLoader
{
public static Bitmap Load(string filename)
{
return Load(File.OpenRead(filename));
}
public static Bitmap Load(Stream s)
{
using (var br = new BinaryReader(s))
{
var signature = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 };
foreach (var b in signature)
if (br.ReadByte() != b)
throw new InvalidDataException("PNG Signature is bogus");
Bitmap bitmap = null;
Color[] palette = null;
List<byte> data = new List<byte>();
for (; ; )
{
var length = IPAddress.NetworkToHostOrder(br.ReadInt32());
var type = Encoding.UTF8.GetString(br.ReadBytes(4));
var content = br.ReadBytes(length);
var crc = br.ReadInt32();
using (var ms = new MemoryStream(content))
using (var cr = new BinaryReader(ms))
switch (type)
{
case "IHDR":
{
var width = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var height = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var bitDepth = cr.ReadByte();
var colorType = (PngColorType)cr.ReadByte();
var compression = cr.ReadByte();
var filter = cr.ReadByte();
var interlace = cr.ReadByte();
if (compression != 0) throw new InvalidDataException("Compression method not supported");
if (interlace != 0) throw new InvalidDataException("Interlacing not supported");
bitmap = new Bitmap(width, height, MakePixelFormat(bitDepth, colorType));
}
break;
case "PLTE":
{
palette = new Color[256];
for (var i = 0; i < 256; i++)
{
var r = cr.ReadByte(); var g = cr.ReadByte(); var b = cr.ReadByte();
palette[i] = Color.FromArgb(r, g, b);
}
}
break;
case "tRNS":
{
for (var i = 0; i < length; i++)
palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]);
}
break;
case "IDAT":
{
data.AddRange(content);
}
break;
case "IEND":
{
var bits = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
using (var ns = new MemoryStream(data.ToArray()))
{
// 'zlib' flags bytes; confuses the DeflateStream.
var flags = (byte)ns.ReadByte();
var moreFlags = (byte)ns.ReadByte();
using (var ds = new DeflateStream(ns, CompressionMode.Decompress))
using (var dr = new BinaryReader(ds))
{
var prevLine = new byte[bitmap.Width]; // all zero
for (var y = 0; y < bitmap.Height; y++)
{
var filter = (PngFilter)dr.ReadByte();
var line = dr.ReadBytes(bitmap.Width);
for (var i = 0; i < bitmap.Width; i++)
line[i] = i > 0
? UnapplyFilter(filter, line[i], line[i - 1], prevLine[i], prevLine[i - 1])
: UnapplyFilter(filter, line[i], 0, prevLine[i], 0);
Marshal.Copy(line, 0, new IntPtr(bits.Scan0.ToInt64() + y * bits.Stride), line.Length);
prevLine = line;
}
}
}
bitmap.UnlockBits(bits);
using (var temp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
{
var cp = temp.Palette;
for (var i = 0; i < 256; i++)
cp.Entries[i] = palette[i]; // finalize the palette.
bitmap.Palette = cp;
return bitmap;
}
}
}
}
}
}
static byte UnapplyFilter(PngFilter f, byte x, byte a, byte b, byte c)
{
switch (f)
{
case PngFilter.None: return x;
case PngFilter.Sub: return (byte)(x + a);
case PngFilter.Up: return (byte)(x + b);
case PngFilter.Average: return (byte)(x + (a + b) / 2);
case PngFilter.Paeth: return (byte)(x + Paeth(a, b, c));
default:
throw new InvalidOperationException("Unsupported Filter");
}
}
static byte Paeth(byte a, byte b, byte c)
{
var p = a + b - c;
var pa = Math.Abs(p - a);
var pb = Math.Abs(p - b);
var pc = Math.Abs(p - c);
return (pa <= pb && pa <= pc) ? a :
(pb <= pc) ? b : c;
}
[Flags]
enum PngColorType { Indexed = 1, Color = 2, Alpha = 4 };
enum PngFilter { None, Sub, Up, Average, Paeth };
static PixelFormat MakePixelFormat(byte bitDepth, PngColorType colorType)
{
if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color))
return PixelFormat.Format8bppIndexed;
throw new InvalidDataException("Unknown pixelformat");
}
}
}

View File

@@ -1,177 +1,178 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public class ImageHeader
{
public uint Offset;
public Format Format;
public uint RefOffset;
public Format RefFormat;
public ImageHeader RefImage;
public byte[] Image;
public ImageHeader( BinaryReader reader )
{
Offset = reader.ReadUInt32();
Format = (Format)( Offset >> 24 );
Offset &= 0xFFFFFF;
RefOffset = reader.ReadUInt16();
RefFormat = (Format)reader.ReadUInt16();
}
}
public enum Format
{
Format20 = 0x20,
Format40 = 0x40,
Format80 = 0x80,
}
public class ShpReader : IEnumerable<ImageHeader>
{
public readonly int ImageCount;
public readonly ushort Width;
public readonly ushort Height;
public Size Size { get { return new Size(Width, Height); } }
private readonly List<ImageHeader> headers = new List<ImageHeader>();
int recurseDepth = 0;
public ShpReader( Stream stream )
{
BinaryReader reader = new BinaryReader( stream );
ImageCount = reader.ReadUInt16();
reader.ReadUInt16();
reader.ReadUInt16();
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
reader.ReadUInt32();
for( int i = 0 ; i < ImageCount ; i++ )
headers.Add( new ImageHeader( reader ) );
new ImageHeader( reader ); // end-of-file header
new ImageHeader( reader ); // all-zeroes header
Dictionary<uint, ImageHeader> offsets = new Dictionary<uint, ImageHeader>();
foreach( ImageHeader h in headers )
offsets.Add( h.Offset, h );
for( int i = 0 ; i < ImageCount ; i++ )
{
ImageHeader h = headers[ i ];
if( h.Format == Format.Format20 )
h.RefImage = headers[ i - 1 ];
else if( h.Format == Format.Format40 )
{
if( !offsets.TryGetValue( h.RefOffset, out h.RefImage ) )
throw new InvalidDataException( string.Format( "Reference doesnt point to image data {0}->{1}", h.Offset, h.RefOffset ) );
}
}
foreach( ImageHeader h in headers )
Decompress( stream, h );
}
public ImageHeader this[ int index ]
{
get { return headers[ index ]; }
}
void Decompress( Stream stream, ImageHeader h )
{
if( recurseDepth > ImageCount )
throw new InvalidDataException( "Format20/40 headers contain infinite loop" );
switch( h.Format )
{
case Format.Format20:
case Format.Format40:
{
if( h.RefImage.Image == null )
{
++recurseDepth;
Decompress( stream, h.RefImage );
--recurseDepth;
}
h.Image = CopyImageData( h.RefImage.Image );
Format40.DecodeInto(ReadCompressedData(stream, h), h.Image);
break;
}
case Format.Format80:
{
byte[] imageBytes = new byte[ Width * Height ];
Format80.DecodeInto( ReadCompressedData( stream, h ), imageBytes );
h.Image = imageBytes;
break;
}
default:
throw new InvalidDataException();
}
}
static byte[] ReadCompressedData( Stream stream, ImageHeader h )
{
stream.Position = h.Offset;
// Actually, far too big. There's no length field with the correct length though :(
int compressedLength = (int)( stream.Length - stream.Position );
byte[] compressedBytes = new byte[ compressedLength ];
stream.Read( compressedBytes, 0, compressedLength );
//MemoryStream ms = new MemoryStream( compressedBytes );
return compressedBytes;
}
private byte[] CopyImageData( byte[] baseImage )
{
byte[] imageData = new byte[ Width * Height ];
for( int i = 0 ; i < Width * Height ; i++ )
imageData[ i ] = baseImage[ i ];
return imageData;
}
public IEnumerator<ImageHeader> GetEnumerator()
{
return headers.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
#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;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public class ImageHeader
{
public uint Offset;
public Format Format;
public uint RefOffset;
public Format RefFormat;
public ImageHeader RefImage;
public byte[] Image;
public ImageHeader() { }
public ImageHeader( BinaryReader reader )
{
Offset = reader.ReadUInt32();
Format = (Format)( Offset >> 24 );
Offset &= 0xFFFFFF;
RefOffset = reader.ReadUInt16();
RefFormat = (Format)reader.ReadUInt16();
}
public static readonly int SizeOnDisk = 8;
public void WriteTo(BinaryWriter writer)
{
writer.Write(Offset | ((uint)Format << 24));
writer.Write((ushort)RefOffset);
writer.Write((ushort)RefFormat);
}
}
public enum Format
{
Format20 = 0x20,
Format40 = 0x40,
Format80 = 0x80,
}
public class ShpReader : IEnumerable<ImageHeader>
{
public readonly int ImageCount;
public readonly ushort Width;
public readonly ushort Height;
public Size Size { get { return new Size(Width, Height); } }
private readonly List<ImageHeader> headers = new List<ImageHeader>();
int recurseDepth = 0;
public ShpReader( Stream stream )
{
BinaryReader reader = new BinaryReader( stream );
ImageCount = reader.ReadUInt16();
reader.ReadUInt16();
reader.ReadUInt16();
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
reader.ReadUInt32();
for( int i = 0 ; i < ImageCount ; i++ )
headers.Add( new ImageHeader( reader ) );
new ImageHeader( reader ); // end-of-file header
new ImageHeader( reader ); // all-zeroes header
Dictionary<uint, ImageHeader> offsets = new Dictionary<uint, ImageHeader>();
foreach( ImageHeader h in headers )
offsets.Add( h.Offset, h );
for( int i = 0 ; i < ImageCount ; i++ )
{
ImageHeader h = headers[ i ];
if( h.Format == Format.Format20 )
h.RefImage = headers[ i - 1 ];
else if( h.Format == Format.Format40 )
{
if( !offsets.TryGetValue( h.RefOffset, out h.RefImage ) )
throw new InvalidDataException( string.Format( "Reference doesnt point to image data {0}->{1}", h.Offset, h.RefOffset ) );
}
}
foreach( ImageHeader h in headers )
Decompress( stream, h );
}
public ImageHeader this[ int index ]
{
get { return headers[ index ]; }
}
void Decompress( Stream stream, ImageHeader h )
{
if( recurseDepth > ImageCount )
throw new InvalidDataException( "Format20/40 headers contain infinite loop" );
switch( h.Format )
{
case Format.Format20:
case Format.Format40:
{
if( h.RefImage.Image == null )
{
++recurseDepth;
Decompress( stream, h.RefImage );
--recurseDepth;
}
h.Image = CopyImageData( h.RefImage.Image );
Format40.DecodeInto(ReadCompressedData(stream, h), h.Image);
break;
}
case Format.Format80:
{
byte[] imageBytes = new byte[ Width * Height ];
Format80.DecodeInto( ReadCompressedData( stream, h ), imageBytes );
h.Image = imageBytes;
break;
}
default:
throw new InvalidDataException();
}
}
static byte[] ReadCompressedData( Stream stream, ImageHeader h )
{
stream.Position = h.Offset;
// Actually, far too big. There's no length field with the correct length though :(
int compressedLength = (int)( stream.Length - stream.Position );
byte[] compressedBytes = new byte[ compressedLength ];
stream.Read( compressedBytes, 0, compressedLength );
//MemoryStream ms = new MemoryStream( compressedBytes );
return compressedBytes;
}
private byte[] CopyImageData( byte[] baseImage )
{
byte[] imageData = new byte[ Width * Height ];
for( int i = 0 ; i < Width * Height ; i++ )
imageData[ i ] = baseImage[ i ];
return imageData;
}
public IEnumerator<ImageHeader> GetEnumerator()
{
return headers.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@@ -0,0 +1,46 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats.Graphics
{
// format80-only SHP writer
public static class ShpWriter
{
public static void Write(Stream s, int width, int height, IEnumerable<byte[]> frames)
{
var compressedFrames = frames.Select(f => Format80.Encode(f)).ToArray();
// note: end-of-file and all-zeroes headers
var dataOffset = 14 + (compressedFrames.Length + 2) * ImageHeader.SizeOnDisk;
using (var bw = new BinaryWriter(s))
{
bw.Write((ushort)compressedFrames.Length);
bw.Write((ushort)0); // unused
bw.Write((ushort)0); // unused
bw.Write((ushort)width);
bw.Write((ushort)height);
bw.Write((uint)0); // unused
foreach (var f in compressedFrames)
{
var ih = new ImageHeader { Format = Format.Format80, Offset = (uint)dataOffset };
dataOffset += f.Length;
ih.WriteTo(bw);
}
var eof = new ImageHeader { Offset = (uint)dataOffset };
eof.WriteTo(bw);
var allZeroes = new ImageHeader { };
allZeroes.WriteTo(bw);
foreach (var f in compressedFrames)
bw.Write(f);
}
}
}
}

View File

@@ -1,38 +1,28 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Runtime.InteropServices;
namespace OpenRA.FileFormats.Graphics
{
[StructLayout(LayoutKind.Sequential)]
public struct Vertex
{
public float x, y, z, u, v;
public float p, c;
public Vertex(float2 xy, float2 uv, float2 pc)
{
this.x = xy.X; this.y = xy.Y; this.z = 0;
this.u = uv.X; this.v = uv.Y;
this.p = pc.X; this.c = pc.Y;
}
}
}
#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.Runtime.InteropServices;
namespace OpenRA.FileFormats.Graphics
{
[StructLayout(LayoutKind.Sequential)]
public struct Vertex
{
public float x, y, z, u, v;
public float p, c;
public Vertex(float2 xy, float2 uv, float2 pc)
{
this.x = xy.X; this.y = xy.Y; this.z = 0;
this.u = uv.X; this.v = uv.Y;
this.p = pc.X; this.c = pc.Y;
}
}
}

View File

@@ -0,0 +1,294 @@
#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.IO;
namespace OpenRA.FileFormats
{
public class VqaReader
{
public readonly ushort Frames;
public readonly byte Framerate;
public readonly ushort Width;
public readonly ushort Height;
Stream stream;
int currentFrame;
ushort numColors;
ushort blockWidth;
ushort blockHeight;
byte cbParts;
int2 blocks;
UInt32[] offsets;
uint[] palette;
// Stores a list of subpixels, referenced by the VPTZ chunk
byte[] cbf;
byte[] cbp;
int cbChunk = 0;
int cbOffset = 0;
// Top half contains block info, bottom half contains references to cbf array
byte[] origData;
// Final frame output
uint[,] frameData;
byte[] audioData; // audio for this frame: 22050Hz 16bit mono pcm, uncompressed.
public byte[] AudioData { get { return audioData; } }
public int CurrentFrame { get { return currentFrame; } }
public VqaReader( Stream stream )
{
this.stream = stream;
BinaryReader reader = new BinaryReader( stream );
// Decode FORM chunk
if (new String(reader.ReadChars(4)) != "FORM")
throw new InvalidDataException("Invalid vqa (invalid FORM section)");
/*var length = */ reader.ReadUInt32();
if (new String(reader.ReadChars(8)) != "WVQAVQHD")
throw new InvalidDataException("Invalid vqa (not WVQAVQHD)");
/* var length = */reader.ReadUInt32();
/*var version = */reader.ReadUInt16();
/*var flags = */reader.ReadUInt16();
Frames = reader.ReadUInt16();
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
blockWidth = reader.ReadByte();
blockHeight = reader.ReadByte();
Framerate = reader.ReadByte();
cbParts = reader.ReadByte();
blocks = new int2(Width / blockWidth, Height / blockHeight);
numColors = reader.ReadUInt16();
/*var maxBlocks = */reader.ReadUInt16();
/*var unknown1 = */reader.ReadUInt16();
/*var unknown2 = */reader.ReadUInt32();
// Audio
/*var freq = */reader.ReadUInt16();
/*var channels = */reader.ReadByte();
/*var bits = */reader.ReadByte();
/*var unknown3 = */reader.ReadChars(14);
var frameSize = NextPowerOf2(Math.Max(Width,Height));
cbf = new byte[Width*Height];
cbp = new byte[Width*Height];
palette = new uint[numColors];
origData = new byte[2*blocks.X*blocks.Y];
frameData = new uint[frameSize,frameSize];
var type = new String(reader.ReadChars(4));
if (type != "FINF")
{
reader.ReadBytes(27);
type = new String(reader.ReadChars(4));
}
/*var length = */reader.ReadUInt16();
/*var unknown4 = */reader.ReadUInt16();
// Frame offsets
offsets = new UInt32[Frames];
for (int i = 0; i < Frames; i++)
{
offsets[i] = reader.ReadUInt32();
if (offsets[i] > 0x40000000) offsets[i] -= 0x40000000;
offsets[i] <<= 1;
}
CollectAudioData();
Reset();
}
public void Reset()
{
currentFrame = cbOffset = cbChunk = 0;
LoadFrame();
}
void CollectAudioData()
{
var ms = new MemoryStream();
var adpcmIndex = 0;
bool compressed = false;
for (var i = 0; i < Frames; i++)
{
stream.Seek(offsets[i], SeekOrigin.Begin);
BinaryReader reader = new BinaryReader(stream);
var end = (i < Frames - 1) ? offsets[i + 1] : stream.Length;
while (reader.BaseStream.Position < end)
{
var type = new String(reader.ReadChars(4));
var length = int2.Swap(reader.ReadUInt32());
switch (type)
{
case "SND0":
case "SND2":
var rawAudio = reader.ReadBytes((int)length);
ms.Write(rawAudio);
compressed = (type == "SND2");
break;
default:
reader.ReadBytes((int)length);
break;
}
if (reader.PeekChar() == 0) reader.ReadByte();
}
}
audioData = (compressed) ? AudLoader.LoadSound(ms.ToArray(), ref adpcmIndex) : ms.ToArray();
}
public void AdvanceFrame()
{
currentFrame++;
LoadFrame();
}
void LoadFrame()
{
if (currentFrame >= Frames)
return;
// Seek to the start of the frame
stream.Seek(offsets[currentFrame], SeekOrigin.Begin);
BinaryReader reader = new BinaryReader(stream);
var end = (currentFrame < Frames - 1) ? offsets[currentFrame+1] : stream.Length;
while(reader.BaseStream.Position < end)
{
var type = new String(reader.ReadChars(4));
var length = int2.Swap(reader.ReadUInt32());
switch(type)
{
case "VQFR":
DecodeVQFR(reader);
break;
default:
// Don't parse sound here.
reader.ReadBytes((int)length);
break;
}
// Chunks are aligned on even bytes; advance by a byte if the next one is null
if (reader.PeekChar() == 0) reader.ReadByte();
}
}
// VQA Frame
public void DecodeVQFR(BinaryReader reader)
{
while(true)
{
// Chunks are aligned on even bytes; may be padded with a single null
if (reader.PeekChar() == 0) reader.ReadByte();
var type = new String(reader.ReadChars(4));
int subchunkLength = (int)int2.Swap(reader.ReadUInt32());
switch(type)
{
// Full frame-modifier
case "CBFZ":
Format80.DecodeInto( reader.ReadBytes(subchunkLength), cbf );
break;
case "CBF0":
cbf = reader.ReadBytes(subchunkLength);
break;
// frame-modifier chunk
case "CBP0":
case "CBPZ":
// Partial buffer is full; dump and recreate
if (cbChunk == cbParts)
{
if (type == "CBP0")
cbf = (byte[])cbp.Clone();
else
Format80.DecodeInto( cbp, cbf );
cbOffset = cbChunk = 0;
}
var bytes = reader.ReadBytes(subchunkLength);
bytes.CopyTo(cbp,cbOffset);
cbOffset += subchunkLength;
cbChunk++;
break;
// Palette
case "CPL0":
for (int i = 0; i < numColors; i++)
{
byte r = (byte)(reader.ReadByte() << 2);
byte g = (byte)(reader.ReadByte() << 2);
byte b = (byte)(reader.ReadByte() << 2);
palette[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
break;
// Frame data
case "VPTZ":
Format80.DecodeInto( reader.ReadBytes(subchunkLength), origData );
// This is the last subchunk
return;
default:
throw new InvalidDataException("Unknown sub-chunk {0}".F(type));
}
}
}
int cachedFrame = -1;
public uint[,] FrameData { get
{
if (cachedFrame != currentFrame)
{
cachedFrame = currentFrame;
for (var y = 0; y < blocks.Y; y++)
for (var x = 0; x < blocks.X; x++)
{
var px = origData[x + y*blocks.X];
var mod = origData[x + (y + blocks.Y)*blocks.X];
for (var j = 0; j < blockHeight; j++)
for (var i = 0; i < blockWidth; i++)
{
var cbfi = (mod*256 + px)*8 + j*blockWidth + i;
byte color = (mod == 0x0f) ? px : cbf[cbfi];
frameData[y*blockHeight + j, x*blockWidth + i] = palette[color];
}
}
}
return frameData;
}}
int NextPowerOf2(int v)
{
--v;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
++v;
return v;
}
}
}

View File

@@ -0,0 +1,97 @@
#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.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace OpenRA.FileFormats
{
public static class HttpUtil
{
public static byte[] DownloadData(string url, Action<int, int> f, int chunkSize)
{
var uri = new Uri(url);
var ip = Dns.GetHostEntry(uri.DnsSafeHost).AddressList[0];
using (var s = new TcpClient())
{
s.Connect(new IPEndPoint(ip, uri.Port));
var ns = s.GetStream();
var sw = new StreamWriter(ns);
sw.Write("GET {0} HTTP/1.0\r\nHost:{1}\r\n\r\n", uri.PathAndQuery, uri.Host);
sw.Flush();
var br = new BinaryReader(ns);
var contentLength = 0;
var offset = 0;
for (; ; )
{
var result = br.ReadLine();
var kv = result.Split(new string[] { ": " }, StringSplitOptions.RemoveEmptyEntries);
if (result == "")
{
/* data follows the blank line */
if (contentLength > 0)
{
if (f != null)
f(offset, contentLength);
var data = new byte[contentLength];
while (offset < contentLength)
{
var thisChunk = Math.Min(contentLength - offset, chunkSize);
br.Read(data, offset, thisChunk);
offset += thisChunk;
if (f != null)
f(offset, contentLength);
}
s.Close();
return data;
}
else
{
s.Close();
return new byte[] { };
}
}
else if (kv[0] == "Content-Length")
contentLength = int.Parse(kv[1]);
}
}
}
public static byte[] DownloadData(string url, Action<int, int> f)
{
return DownloadData(url, f, 4096);
}
public static byte[] DownloadData(string url)
{
return DownloadData(url, null);
}
static string ReadLine(this BinaryReader br)
{
var sb = new StringBuilder();
char c;
while ((c = br.ReadChar()) != '\n')
if (c != '\r' && c != '\n')
sb.Append(c);
return sb.ToString();
}
}
}

View File

@@ -1,29 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Drawing;
namespace OpenRA.FileFormats
{
public interface IPaletteRemap
{
Color GetRemappedColor(Color original, int index);
}
}

View File

@@ -0,0 +1,65 @@
#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.Linq;
namespace OpenRA.FileFormats
{
/* describes what is to be loaded in order to run a set of mods */
public class Manifest
{
public readonly string[]
Mods, Folders, Packages, Rules, ServerTraits,
Sequences, Cursors, Chrome, Assemblies, ChromeLayout,
Weapons, Voices, Music, Movies, TileSets;
public readonly string LoadScreen;
public readonly int TileSize = 24;
public Manifest(string[] mods)
{
Mods = mods;
var yaml = mods
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
.Aggregate(MiniYaml.Merge);
// Todo: Use fieldloader
Folders = YamlList(yaml, "Folders");
Packages = YamlList(yaml, "Packages");
Rules = YamlList(yaml, "Rules");
ServerTraits = YamlList(yaml, "ServerTraits");
Sequences = YamlList(yaml, "Sequences");
Cursors = YamlList(yaml, "Cursors");
Chrome = YamlList(yaml, "Chrome");
Assemblies = YamlList(yaml, "Assemblies");
ChromeLayout = YamlList(yaml, "ChromeLayout");
Weapons = YamlList(yaml, "Weapons");
Voices = YamlList(yaml, "Voices");
Music = YamlList(yaml, "Music");
Movies = YamlList(yaml, "Movies");
TileSets = YamlList(yaml, "TileSets");
LoadScreen = yaml.First( x => x.Key == "LoadScreen" ).Value.Value;
if (yaml.FirstOrDefault( x => x.Key == "TileSize" ) != null)
TileSize = int.Parse(yaml.First( x => x.Key == "TileSize" ).Value.Value);
}
static string[] YamlList(List<MiniYamlNode> ys, string key)
{
var y = ys.FirstOrDefault( x => x.Key == key );
if( y == null )
return new string[ 0 ];
return y.Value.NodesDict.Keys.ToArray();
}
}
}

View File

@@ -1,41 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
namespace OpenRA.FileFormats
{
public struct ActorReference
{
public readonly int2 Location;
public readonly string Name;
public readonly string Owner;
public ActorReference( string name, int2 location, string owner )
{
Name = name;
Location = location;
Owner = owner;
}
public override string ToString ()
{
return string.Format("{0} {1} {2},{3}", Name, Owner, Location.X,Location.Y);
}
}
}

View File

@@ -1,284 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
namespace OpenRA.FileFormats
{
public class Map
{
public IFolder Package;
public string Uid;
// Yaml map data
public bool Selectable = true;
public int MapFormat = 1;
public string Title;
public string Description;
public string Author;
public int PlayerCount;
public string Tileset;
public Dictionary<string, ActorReference> Actors = new Dictionary<string, ActorReference>();
public List<SmudgeReference> Smudges = new List<SmudgeReference>();
public Dictionary<string, int2> Waypoints = new Dictionary<string, int2>();
// Rules overrides
public Dictionary<string, MiniYaml> Rules = new Dictionary<string, MiniYaml>();
public Dictionary<string, MiniYaml> Weapons = new Dictionary<string, MiniYaml>();
public Dictionary<string, MiniYaml> Voices = new Dictionary<string, MiniYaml>();
public Dictionary<string, MiniYaml> Music = new Dictionary<string, MiniYaml>();
public Dictionary<string, MiniYaml> Terrain = new Dictionary<string, MiniYaml>();
// Binary map data
public byte TileFormat = 1;
public int2 MapSize;
public int2 TopLeft;
public int2 BottomRight;
public Rectangle Bounds { get { return Rectangle.FromLTRB(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y); } }
public TileReference<ushort, byte>[,] MapTiles;
public TileReference<byte, byte>[,] MapResources;
// Temporary compat hacks
public int XOffset { get { return TopLeft.X; } }
public int YOffset { get { return TopLeft.Y; } }
public int Width { get { return BottomRight.X - TopLeft.X; } }
public int Height { get { return BottomRight.Y - TopLeft.Y; } }
public string Theater { get { return Tileset; } }
public IEnumerable<int2> SpawnPoints { get { return Waypoints.Select(kv => kv.Value); } }
static List<string> SimpleFields = new List<string>() {
"Selectable", "MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "MapSize", "TopLeft", "BottomRight"
};
public Map() { }
public Map(IFolder package)
{
Package = package;
var yaml = MiniYaml.FromStream(Package.GetContent("map.yaml"));
// 'Simple' metadata
FieldLoader.LoadFields(this, yaml, SimpleFields);
// Waypoints
foreach (var wp in yaml["Waypoints"].Nodes)
{
string[] loc = wp.Value.Value.Split(',');
Waypoints.Add(wp.Key, new int2(int.Parse(loc[0]), int.Parse(loc[1])));
}
// Actors
foreach (var kv in yaml["Actors"].Nodes)
{
string[] vals = kv.Value.Value.Split(' ');
string[] loc = vals[2].Split(',');
var a = new ActorReference(vals[0], new int2(int.Parse(loc[0]), int.Parse(loc[1])), vals[2]);
Actors.Add(kv.Key, a);
}
// Smudges
foreach (var kv in yaml["Smudges"].Nodes)
{
string[] vals = kv.Key.Split(' ');
string[] loc = vals[1].Split(',');
Smudges.Add(new SmudgeReference(vals[0], new int2(int.Parse(loc[0]), int.Parse(loc[1])), int.Parse(vals[2])));
}
// Rules
Rules = yaml["Rules"].Nodes;
LoadUid();
LoadBinaryData();
}
public void Save(string filepath)
{
Dictionary<string, MiniYaml> root = new Dictionary<string, MiniYaml>();
foreach (var field in SimpleFields)
{
FieldInfo f = this.GetType().GetField(field);
if (f.GetValue(this) == null) continue;
root.Add(field, new MiniYaml(FieldSaver.FormatValue(this, f), null));
}
root.Add("Actors", MiniYaml.FromDictionary<string, ActorReference>(Actors));
root.Add("Waypoints", MiniYaml.FromDictionary<string, int2>(Waypoints));
root.Add("Smudges", MiniYaml.FromList<SmudgeReference>(Smudges));
root.Add("Rules", new MiniYaml(null, Rules));
SaveBinaryData(Path.Combine(filepath, "map.bin"));
root.WriteToFile(Path.Combine(filepath, "map.yaml"));
SaveUid(Path.Combine(filepath, "map.uid"));
}
static byte ReadByte(Stream s)
{
int ret = s.ReadByte();
if (ret == -1)
throw new NotImplementedException();
return (byte)ret;
}
static ushort ReadWord(Stream s)
{
ushort ret = ReadByte(s);
ret |= (ushort)(ReadByte(s) << 8);
return ret;
}
public void LoadBinaryData()
{
using (var dataStream = Package.GetContent("map.bin"))
{
if (ReadByte(dataStream) != 1)
throw new InvalidDataException("Unknown binary map format");
// Load header info
var width = ReadWord(dataStream);
var height = ReadWord(dataStream);
if (width != MapSize.X || height != MapSize.Y)
throw new InvalidDataException("Invalid tile data");
MapTiles = new TileReference<ushort, byte>[MapSize.X, MapSize.Y];
MapResources = new TileReference<byte, byte>[MapSize.X, MapSize.Y];
// Load tile data
for (int i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++)
{
ushort tile = ReadWord(dataStream);
byte index = ReadByte(dataStream);
byte image = (index == byte.MaxValue) ? (byte)(i % 4 + (j % 4) * 4) : index;
MapTiles[i, j] = new TileReference<ushort, byte>(tile, index, image);
}
// Load resource data
for (int i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++)
MapResources[i, j] = new TileReference<byte, byte>(ReadByte(dataStream), ReadByte(dataStream));
}
}
public void SaveBinaryData(string filepath)
{
using (var dataStream = File.Create(filepath + ".tmp"))
using (var writer = new BinaryWriter(dataStream))
{
// File header consists of a version byte, followed by 2 ushorts for width and height
writer.Write(TileFormat);
writer.Write((ushort)MapSize.X);
writer.Write((ushort)MapSize.Y);
// Tile data
for (int i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++)
{
writer.Write(MapTiles[i, j].type);
writer.Write(MapTiles[i, j].index);
}
// Resource data
for (int i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++)
{
writer.Write(MapResources[i, j].type);
writer.Write(MapResources[i, j].index);
}
}
File.Delete(filepath);
File.Move(filepath + ".tmp", filepath);
}
public void LoadUid()
{
Uid = Package.GetContent("map.uid").ReadAllText();
}
public void SaveUid(string filename)
{
// UID is calculated by taking an SHA1 of the yaml and binary data
// Read the relevant data into a buffer
var data = Exts.ReadAllBytes(Package.GetContent("map.yaml"))
.Concat(Exts.ReadAllBytes(Package.GetContent("map.bin"))).ToArray();
// Take the SHA1
using (var csp = SHA1.Create())
Uid = new string(csp.ComputeHash(data).SelectMany(a => a.ToString("x2")).ToArray());
File.WriteAllText(filename, Uid);
}
public bool IsInMap(int2 xy)
{
return IsInMap(xy.X, xy.Y);
}
public bool IsInMap(int x, int y)
{
return (x >= TopLeft.X && y >= TopLeft.Y && x < BottomRight.X && y < BottomRight.Y);
}
public void DebugContents()
{
foreach (var field in SimpleFields)
Console.WriteLine("Loaded {0}: {1}", field, this.GetType().GetField(field).GetValue(this));
Console.WriteLine("Loaded Waypoints:");
foreach (var wp in Waypoints)
Console.WriteLine("\t{0} => {1}", wp.Key, wp.Value);
Console.WriteLine("Loaded Actors:");
foreach (var wp in Actors)
Console.WriteLine("\t{0} => {1} {2} {3}", wp.Key, wp.Value.Name, wp.Value.Owner, wp.Value.Location);
Console.WriteLine("Loaded Smudges:");
foreach (var s in Smudges)
Console.WriteLine("\t{0} {1} {2}", s.Type, s.Location, s.Depth);
}
static T[,] ResizeArray<T>(T[,] ts, T t, int width, int height)
{
var result = new T[width, height];
for (var i = 0; i < width; i++)
for (var j = 0; j < height; j++)
result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
? ts[i, j] : t;
return result;
}
public void Resize(int width, int height) // editor magic.
{
MapTiles = ResizeArray(MapTiles, MapTiles[0, 0], width, height);
MapResources = ResizeArray(MapResources, MapResources[0, 0], width, height);
MapSize = new int2(width, height);
}
}
}

View File

@@ -1,97 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
namespace OpenRA.FileFormats
{
public class MapStub
{
public IFolder Package;
// Yaml map data
public string Uid;
public bool Selectable;
public string Title;
public string Description;
public string Author;
public int PlayerCount;
public string Tileset;
public Dictionary<string, int2> Waypoints = new Dictionary<string, int2>();
public int2 TopLeft;
public int2 BottomRight;
public int Width { get { return BottomRight.X - TopLeft.X; } }
public int Height { get { return BottomRight.Y - TopLeft.Y; } }
public Lazy<Bitmap> Preview;
static List<string> Fields = new List<string>() {
"Selectable", "Title", "Description", "Author", "PlayerCount", "Tileset", "TopLeft", "BottomRight"
};
public MapStub() { }
public MapStub(IFolder package)
{
Package = package;
var yaml = MiniYaml.FromStream(Package.GetContent("map.yaml"));
FieldLoader.LoadFields(this, yaml, Fields);
// Waypoints
foreach (var wp in yaml["Waypoints"].Nodes)
{
string[] loc = wp.Value.Value.Split(',');
Waypoints.Add(wp.Key, new int2(int.Parse(loc[0]), int.Parse(loc[1])));
}
Preview = Lazy.New(
() => { return new Bitmap(Package.GetContent("preview.png")); }
);
Uid = Package.GetContent("map.uid").ReadAllText();
}
public int2 ConvertToPreview(int2 point, Rectangle container)
{
float scale = Math.Min(container.Width * 1.0f / Width, container.Height * 1.0f / Height);
var size = Math.Max(Width, Height);
var dw = (int)(scale * (size - Width)) / 2;
var dh = (int)(scale * (size - Height)) / 2;
return new int2(container.X + dw + (int)(scale*(point.X - TopLeft.X)) , container.Y + dh + (int)(scale*(point.Y - TopLeft.Y)));
}
public Rectangle PreviewBounds(Rectangle container)
{
float scale = Math.Min(container.Width * 1.0f / Width, container.Height * 1.0f / Height);
var size = Math.Max(Width, Height);
var dw = (int)(scale * (size - Width)) / 2;
var dh = (int)(scale * (size - Height)) / 2;
return new Rectangle(container.X + dw, container.Y + dh, (int)(Width * scale), (int)(Height * scale));
}
}
}

View File

@@ -0,0 +1,50 @@
#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.Drawing;
using System;
namespace OpenRA.FileFormats
{
public class PlayerReference
{
public string Name;
public string Palette;
public bool OwnsWorld = false;
public bool NonCombatant = false;
public bool Playable = false;
public bool DefaultStartingUnits = false;
public bool AllowBots = true;
public bool LockRace = false;
public string Race;
public bool LockColor = false;
public ColorRamp ColorRamp = new ColorRamp(0,0,238,34);
public int InitialCash = 0;
public string[] Allies = {};
public string[] Enemies = {};
public PlayerReference() {}
public PlayerReference(MiniYaml my)
{
FieldLoader.Load(this, my);
}
public PlayerReference(string name, string race, bool ownsworld, bool noncombatant)
{
Name = name;
Race = race;
OwnsWorld = ownsworld;
NonCombatant = noncombatant;
}
}
}

View File

@@ -1,20 +1,10 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
* 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

View File

@@ -1,88 +1,76 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.IO;
namespace OpenRA.FileFormats
{
public class Terrain
{
public readonly List<byte[]> TileBitmapBytes = new List<byte[]>();
public Terrain( Stream stream )
{
// Try loading as a cnc .tem
BinaryReader reader = new BinaryReader( stream );
int Width = reader.ReadUInt16();
int Height = reader.ReadUInt16();
if( Width != 24 || Height != 24 )
throw new InvalidDataException( string.Format( "{0}x{1}", Width, Height ) );
/*NumTiles = */reader.ReadUInt16();
/*Zero1 = */reader.ReadUInt16();
/*uint Size = */reader.ReadUInt32();
uint ImgStart = reader.ReadUInt32();
/*Zero2 = */reader.ReadUInt32();
int IndexEnd, IndexStart;
if (reader.ReadUInt16() == 65535) // ID1 = FFFFh for cnc
{
/*ID2 = */reader.ReadUInt16();
IndexEnd = reader.ReadInt32();
IndexStart = reader.ReadInt32();
}
else // Load as a ra .tem
{
stream.Position = 0;
reader = new BinaryReader( stream );
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
if( Width != 24 || Height != 24 )
throw new InvalidDataException( string.Format( "{0}x{1}", Width, Height ) );
/*NumTiles = */reader.ReadUInt16();
reader.ReadUInt16();
/*XDim = */reader.ReadUInt16();
/*YDim = */reader.ReadUInt16();
/*uint FileSize = */reader.ReadUInt32();
ImgStart = reader.ReadUInt32();
reader.ReadUInt32();
reader.ReadUInt32();
IndexEnd = reader.ReadInt32();
reader.ReadUInt32();
IndexStart = reader.ReadInt32();
}
stream.Position = IndexStart;
foreach( byte b in new BinaryReader(stream).ReadBytes(IndexEnd - IndexStart) )
{
if (b != 255)
{
stream.Position = ImgStart + b * 24 * 24;
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(24 * 24));
}
else
TileBitmapBytes.Add(null);
}
}
}
}
#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.IO;
namespace OpenRA.FileFormats
{
public class Terrain
{
public readonly List<byte[]> TileBitmapBytes = new List<byte[]>();
public Terrain( Stream stream, int size )
{
// Try loading as a cnc .tem
BinaryReader reader = new BinaryReader( stream );
int Width = reader.ReadUInt16();
int Height = reader.ReadUInt16();
if( Width != size || Height != size )
throw new InvalidDataException( "{0}x{1} != {2}x{2}".F(Width, Height, size ) );
/*NumTiles = */reader.ReadUInt16();
/*Zero1 = */reader.ReadUInt16();
/*uint Size = */reader.ReadUInt32();
uint ImgStart = reader.ReadUInt32();
/*Zero2 = */reader.ReadUInt32();
int IndexEnd, IndexStart;
if (reader.ReadUInt16() == 65535) // ID1 = FFFFh for cnc
{
/*ID2 = */reader.ReadUInt16();
IndexEnd = reader.ReadInt32();
IndexStart = reader.ReadInt32();
}
else // Load as a ra .tem
{
stream.Position = 0;
reader = new BinaryReader( stream );
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
/*NumTiles = */reader.ReadUInt16();
reader.ReadUInt16();
/*XDim = */reader.ReadUInt16();
/*YDim = */reader.ReadUInt16();
/*uint FileSize = */reader.ReadUInt32();
ImgStart = reader.ReadUInt32();
reader.ReadUInt32();
reader.ReadUInt32();
IndexEnd = reader.ReadInt32();
reader.ReadUInt32();
IndexStart = reader.ReadInt32();
}
stream.Position = IndexStart;
foreach( byte b in new BinaryReader(stream).ReadBytes(IndexEnd - IndexStart) )
{
if (b != 255)
{
stream.Position = ImgStart + b * size * size;
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(size * size));
}
else
TileBitmapBytes.Add(null);
}
}
}
}

View File

@@ -1,51 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRA.FileFormats
{
public class TerrainColorSet
{
readonly Dictionary<TerrainType, Color> colors;
public TerrainColorSet(string colorFile)
{
var lines = FileSystem.Open(colorFile).ReadAllLines()
.Select(l => l.Trim())
.Where(l => !l.StartsWith(";") && l.Length > 0);
colors = lines.Select(l => l.Split('=')).ToDictionary(
kv => (TerrainType)Enum.Parse(typeof(TerrainType), kv[0]),
kv => ColorFromRgbString(kv[1]));
}
static Color ColorFromRgbString(string s)
{
var parts = s.Split(',');
return Color.FromArgb(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]));
}
public Color ColorForTerrainType(TerrainType type) { return colors[type]; }
}
}

View File

@@ -1,20 +1,10 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
* 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
@@ -24,20 +14,11 @@ namespace OpenRA.FileFormats
{
public T type;
public U index;
public U image;
public TileReference(T t, U i)
{
type = t;
index = i;
image = i;
}
public TileReference(T t, U i, U im)
{
type = t;
index = i;
image = im;
}
public override int GetHashCode() { return type.GetHashCode() ^ index.GetHashCode(); }

View File

@@ -1,110 +1,157 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace OpenRA.FileFormats
{
public class TileSet
{
public readonly Dictionary<ushort, Terrain> tiles = new Dictionary<ushort, Terrain>();
public readonly Walkability Walkability;
public readonly Dictionary<ushort, TileTemplate> walk
= new Dictionary<ushort, TileTemplate>();
string NextLine( StreamReader reader )
{
string ret;
do
{
ret = reader.ReadLine();
if( ret == null )
return null;
ret = ret.Trim();
}
while( ret.Length == 0 || ret[ 0 ] == ';' );
return ret;
}
public TileSet( string tilesetFile, string templatesFile, string suffix )
{
Walkability = new Walkability(templatesFile);
char tileSetChar = char.ToUpperInvariant( suffix[ 0 ] );
StreamReader tileIdFile = new StreamReader( FileSystem.Open(tilesetFile) );
while( true )
{
string tileSetStr = NextLine( tileIdFile );
string countStr = NextLine( tileIdFile );
string startStr = NextLine( tileIdFile );
string pattern = NextLine( tileIdFile );
if( tileSetStr == null || countStr == null || startStr == null || pattern == null )
break;
if( tileSetStr.IndexOf( tileSetChar.ToString() ) == -1 )
continue;
int count = int.Parse( countStr );
int start = int.Parse( startStr, NumberStyles.HexNumber );
for( int i = 0 ; i < count ; i++ )
{
string tilename = string.Format(pattern, i + 1);
if (!walk.ContainsKey((ushort)(start + i)))
walk.Add((ushort)(start + i), Walkability.GetTileTemplate(tilename));
using( Stream s = FileSystem.Open( tilename + "." + suffix ) )
{
if( !tiles.ContainsKey( (ushort)( start + i ) ) )
tiles.Add( (ushort)( start + i ), new Terrain( s ) );
}
}
}
tileIdFile.Close();
}
public byte[] GetBytes(TileReference<ushort,byte> r)
{
Terrain tile;
if( tiles.TryGetValue( r.type, out tile ) )
return tile.TileBitmapBytes[ r.image ];
byte[] missingTile = new byte[ 24 * 24 ];
for( int i = 0 ; i < missingTile.Length ; i++ )
missingTile[ i ] = 0x36;
return missingTile;
}
public TerrainType GetTerrainType( TileReference<ushort, byte> r )
{
var tt = walk[ r.type ].TerrainType;
TerrainType ret;
if( !tt.TryGetValue( r.image, out ret ) )
return 0;// Default zero (walkable)
return ret;
}
}
}
#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.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA.FileFormats
{
public class TerrainTypeInfo
{
public string Type;
public bool Buildable = true;
public bool AcceptSmudge = true;
public bool IsWater = false;
public Color Color;
public TerrainTypeInfo() {}
public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); }
public MiniYaml Save() { return FieldSaver.Save(this); }
}
public class TileTemplate
{
[FieldLoader.Load] public ushort Id;
[FieldLoader.Load] public string Image;
[FieldLoader.Load] public int2 Size;
[FieldLoader.Load] public bool PickAny;
[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 );
}
public MiniYaml Save()
{
var root = new List<MiniYamlNode>();
foreach (var field in new string[] {"Id", "Image", "Size", "PickAny"})
{
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 string Palette;
public int TileSize = 24;
public string[] Extensions;
public Dictionary<string, TerrainTypeInfo> Terrain = new Dictionary<string, TerrainTypeInfo>();
public Dictionary<ushort, Terrain> Tiles = new Dictionary<ushort, Terrain>();
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
static List<string> fields = new List<string>() {"Name", "TileSize", "Id", "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 LoadTiles()
{
foreach (var t in Templates)
using( Stream s = FileSystem.OpenWithExts(t.Value.Image, Extensions) )
{
if( !Tiles.ContainsKey( t.Key ) )
Tiles.Add( t.Key, new Terrain( s, TileSize ) );
}
}
public void Save(string filepath)
{
var root = new List<MiniYamlNode>();
var gen = new List<MiniYamlNode>();
foreach (var field in fields)
{
FieldInfo 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 byte[] GetBytes(TileReference<ushort,byte> r)
{
Terrain tile;
if( Tiles.TryGetValue( r.type, out tile ) )
return tile.TileBitmapBytes[ r.index ];
byte[] missingTile = new byte[ TileSize * TileSize ];
for( int i = 0 ; i < missingTile.Length ; i++ )
missingTile[ i ] = 0x36;
return missingTile;
}
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,95 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.FileFormats
{
public enum TerrainType : byte
{
Clear = 0,
Water = 1,
Road = 2,
Rock = 3,
Tree = 4,
River = 5,
Rough = 6,
Wall = 7,
Beach = 8,
Ore = 9,
Special = 10,
}
public class TileTemplate
{
public int Index; // not valid for `interior` stuff. only used for bridges.
public string Name;
public int2 Size;
public string Bridge;
public float HP;
public Dictionary<int, TerrainType> TerrainType = new Dictionary<int, TerrainType>();
}
public class Walkability
{
Dictionary<string, TileTemplate> templates
= new Dictionary<string,TileTemplate>();
public Walkability(string templatesFile)
{
var file = new IniFile( FileSystem.Open( templatesFile ) );
foreach (var section in file.Sections)
{
var name = section.GetValue("Name", null).ToLowerInvariant();
if (!section.Contains("width") || !section.Contains("height"))
throw new InvalidOperationException("no width/height for template `{0}`".F(name));
var tile = new TileTemplate
{
Name = name,
Size = new int2(
int.Parse(section.GetValue("width", "--")),
int.Parse(section.GetValue("height", "--"))),
TerrainType = section
.Where(p => p.Key.StartsWith("tiletype"))
.ToDictionary(
p => int.Parse(p.Key.Substring(8)),
p => (TerrainType)Enum.Parse(typeof(TerrainType),p.Value)),
Bridge = section.GetValue("bridge", null),
HP = float.Parse(section.GetValue("hp", "0"))
};
tile.Index = -1;
int.TryParse(section.Name.Substring(3), out tile.Index);
templates[tile.Name] = tile;
}
}
public TileTemplate GetTileTemplate(string terrainName)
{
return templates[terrainName];
}
}
}

View File

@@ -1,195 +1,240 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
using MiniYamlNodes = Dictionary<string, MiniYaml>;
public class MiniYaml
{
public string Value;
public Dictionary<string, MiniYaml> Nodes = new Dictionary<string,MiniYaml>();
public MiniYaml( string value ) : this( value, new Dictionary<string, MiniYaml>() ) { }
public MiniYaml( string value, Dictionary<string, MiniYaml> nodes )
{
Value = value;
Nodes = nodes;
}
public static MiniYaml FromDictionary<K,V>(Dictionary<K,V>dict)
{
return new MiniYaml( null, dict.ToDictionary( x=>x.Key.ToString(), x=>new MiniYaml(x.Value.ToString())));
}
public static MiniYaml FromList<T>(List<T>list)
{
return new MiniYaml( null, list.ToDictionary( x=>x.ToString(), x=>new MiniYaml(null)));
}
static Dictionary<string, MiniYaml> FromLines(string[] lines)
{
var levels = new List<Dictionary<string, MiniYaml>>();
levels.Add(new Dictionary<string, MiniYaml>());
foreach (var line in lines)
{
var t = line.TrimStart(' ', '\t');
if (t.Length == 0 || t[0] == '#')
continue;
var level = line.Length - t.Length;
if (levels.Count <= level)
throw new InvalidOperationException("Bad indent in miniyaml");
while (levels.Count > level + 1)
levels.RemoveAt(levels.Count - 1);
var colon = t.IndexOf(':');
var d = new Dictionary<string, MiniYaml>();
try
{
if (colon == -1)
levels[level].Add(t.Trim(), new MiniYaml(null, d));
else
{
var value = t.Substring(colon + 1).Trim();
if (value.Length == 0)
value = null;
levels[level].Add(t.Substring(0, colon).Trim(), new MiniYaml(value, d));
}
}
catch (ArgumentException) { throw new InvalidDataException("Duplicate Identifier:`{0}`".F(t)); }
levels.Add(d);
}
return levels[0];
}
public static Dictionary<string, MiniYaml> FromFileInPackage( string path )
{
StreamReader reader = new StreamReader( FileSystem.Open(path) );
List<string> lines = new List<string>();
while( !reader.EndOfStream )
lines.Add(reader.ReadLine());
reader.Close();
return FromLines(lines.ToArray());
}
public static Dictionary<string, MiniYaml> FromFile( string path )
{
return FromLines(File.ReadAllLines( path ));
}
public static Dictionary<string, MiniYaml> FromStream(Stream s)
{
using (var reader = new StreamReader(s))
return FromString(reader.ReadToEnd());
}
public static Dictionary<string, MiniYaml> FromString(string text)
{
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries));
}
public static Dictionary<string, MiniYaml> Merge( Dictionary<string, MiniYaml> a, Dictionary<string, MiniYaml> b )
{
if( a.Count == 0 )
return b;
if( b.Count == 0 )
return a;
var ret = new Dictionary<string, MiniYaml>();
var keys = a.Keys.Union( b.Keys ).ToList();
var noInherit = keys.Where( x => x.Length > 0 && x[ 0 ] == '-' ).Select( x => x.Substring( 1 ) ).ToList();
foreach( var key in keys )
{
MiniYaml aa, bb;
a.TryGetValue( key, out aa );
b.TryGetValue( key, out bb );
// if( key.Length > 0 && key[ 0 ] == '-' )
// continue;
// else
if( noInherit.Contains( key ) )
{
if( aa != null )
ret.Add( key, aa );
}
else
ret.Add( key, Merge( aa, bb ) );
}
return ret;
}
public static MiniYaml Merge( MiniYaml a, MiniYaml b )
{
if( a == null )
return b;
if( b == null )
return a;
return new MiniYaml( a.Value ?? b.Value, Merge( a.Nodes, b.Nodes ) );
}
public IEnumerable<string> ToLines(string name)
{
yield return name + ": " + Value;
if (Nodes != null)
foreach (var line in Nodes.ToLines(false))
yield return "\t" + line;
}
}
public static class MiniYamlExts
{
public static void WriteToFile(this MiniYamlNodes y, string filename)
{
File.WriteAllLines(filename, y.ToLines(true).Select(x => x.TrimEnd()).ToArray());
}
public static string WriteToString(this MiniYamlNodes y)
{
return string.Join("\n", y.ToLines(true).Select(x => x.TrimEnd()).ToArray());
}
public static IEnumerable<string> ToLines(this MiniYamlNodes y, bool lowest)
{
foreach (var kv in y)
{
foreach (var line in kv.Value.ToLines(kv.Key))
yield return line;
if (lowest)
yield return "";
}
}
}
}
#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.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
using MiniYamlNodes = List<MiniYamlNode>;
public class MiniYamlNode
{
public struct SourceLocation
{
public string Filename; public int Line;
}
public SourceLocation Location;
public string Key;
public MiniYaml Value;
public MiniYamlNode( string k, MiniYaml v )
{
Key = k;
Value = v;
}
public MiniYamlNode( string k, MiniYaml v, SourceLocation loc )
: this( k, v )
{
Location = loc;
}
public MiniYamlNode( string k, string v )
: this( k, v, null )
{
}
public MiniYamlNode( string k, string v, List<MiniYamlNode> n )
: this( k, new MiniYaml( v, n ) )
{
}
public MiniYamlNode( string k, string v, List<MiniYamlNode> n, SourceLocation loc )
: this( k, new MiniYaml( v, n ), loc )
{
}
}
public class MiniYaml
{
public string Value;
public List<MiniYamlNode> Nodes;
public Dictionary<string, MiniYaml> NodesDict { get { return Nodes.ToDictionary( x => x.Key, x => x.Value ); } }
public MiniYaml( string value ) : this( value, null ) { }
public MiniYaml( string value, List<MiniYamlNode> nodes )
{
Value = value;
Nodes = nodes ?? new List<MiniYamlNode>();
}
public static MiniYaml FromDictionary<K, V>( Dictionary<K, V> dict )
{
return new MiniYaml( null, dict.Select( x => new MiniYamlNode( x.Key.ToString(), new MiniYaml( x.Value.ToString() ) ) ).ToList() );
}
public static MiniYaml FromList<T>( List<T> list )
{
return new MiniYaml( null, list.Select( x => new MiniYamlNode( x.ToString(), new MiniYaml( null ) ) ).ToList() );
}
static List<MiniYamlNode> FromLines(string[] lines, string filename)
{
var levels = new List<List<MiniYamlNode>>();
levels.Add(new List<MiniYamlNode>());
var lineNo = 0;
foreach (var line in lines)
{
++lineNo;
var t = line.TrimStart(' ', '\t');
if (t.Length == 0 || t[0] == '#')
continue;
var level = line.Length - t.Length;
if (levels.Count <= level)
throw new InvalidOperationException("Bad indent in miniyaml");
while (levels.Count > level + 1)
levels.RemoveAt(levels.Count - 1);
var d = new List<MiniYamlNode>();
var rhs = SplitAtColon( ref t );
levels[ level ].Add( new MiniYamlNode( t, rhs, d, new MiniYamlNode.SourceLocation { Filename = filename, Line = lineNo } ) );
levels.Add(d);
}
return levels[ 0 ];
}
static string SplitAtColon( ref string t )
{
var colon = t.IndexOf(':');
if( colon == -1 )
return null;
var ret = t.Substring( colon + 1 ).Trim();
if( ret.Length == 0 )
ret = null;
t = t.Substring( 0, colon ).Trim();
return ret;
}
public static List<MiniYamlNode> FromFileInPackage( string path )
{
StreamReader reader = new StreamReader( FileSystem.Open(path) );
List<string> lines = new List<string>();
while( !reader.EndOfStream )
lines.Add(reader.ReadLine());
reader.Close();
return FromLines(lines.ToArray(), path);
}
public static Dictionary<string, MiniYaml> DictFromFile( string path )
{
return FromFile( path ).ToDictionary( x => x.Key, x => x.Value );
}
public static Dictionary<string, MiniYaml> DictFromStream( Stream stream )
{
return FromStream( stream ).ToDictionary( x => x.Key, x => x.Value );
}
public static List<MiniYamlNode> FromFile( string path )
{
return FromLines(File.ReadAllLines( path ), path);
}
public static List<MiniYamlNode> FromStream(Stream s)
{
using (var reader = new StreamReader(s))
return FromString(reader.ReadToEnd());
}
public static List<MiniYamlNode> FromString(string text)
{
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), "<no filename available>");
}
public static List<MiniYamlNode> Merge( List<MiniYamlNode> a, List<MiniYamlNode> b )
{
if( a.Count == 0 )
return b;
if( b.Count == 0 )
return a;
var ret = new List<MiniYamlNode>();
var aDict = a.ToDictionary( x => x.Key );
var bDict = b.ToDictionary( x => x.Key );
var keys = aDict.Keys.Union( bDict.Keys ).ToList();
var noInherit = keys.Where( x => x.Length > 0 && x[ 0 ] == '-' ).Select( x => x.Substring( 1 ) ).ToList();
foreach( var key in keys )
{
MiniYamlNode aa, bb;
aDict.TryGetValue( key, out aa );
bDict.TryGetValue( key, out bb );
if( noInherit.Contains( key ) )
{
if( aa != null )
ret.Add( aa );
}
else
{
var loc = aa == null ? default( MiniYamlNode.SourceLocation ) : aa.Location;
var merged = ( aa == null || bb == null ) ? aa ?? bb : new MiniYamlNode( key, Merge( aa.Value, bb.Value ), loc );
ret.Add( merged );
}
}
return ret;
}
public static MiniYaml Merge( MiniYaml a, MiniYaml b )
{
if( a == null )
return b;
if( b == null )
return a;
return new MiniYaml( a.Value ?? b.Value, Merge( a.Nodes, b.Nodes ) );
}
public IEnumerable<string> ToLines(string name)
{
yield return name + ": " + Value;
if (Nodes != null)
foreach (var line in Nodes.ToLines(false))
yield return "\t" + line;
}
}
public static class MiniYamlExts
{
public static void WriteToFile(this MiniYamlNodes y, string filename)
{
File.WriteAllLines(filename, y.ToLines(true).Select(x => x.TrimEnd()).ToArray());
}
public static string WriteToString(this MiniYamlNodes y)
{
return string.Join("\n", y.ToLines(true).Select(x => x.TrimEnd()).ToArray());
}
public static IEnumerable<string> ToLines(this MiniYamlNodes y, bool lowest)
{
foreach (var kv in y)
{
foreach (var line in kv.Value.ToLines(kv.Key))
yield return line;
if (lowest)
yield return "";
}
}
}
}

47
OpenRA.FileFormats/Mod.cs Normal file
View File

@@ -0,0 +1,47 @@
#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.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace OpenRA.FileFormats
{
public class Mod
{
public string Title;
public string Description;
public string Version;
public string Author;
public string Requires;
public bool Standalone = false;
public static readonly Dictionary<string, Mod> AllMods = ValidateMods(Directory.GetDirectories("mods").Select(x => x.Substring(5)).ToArray());
public static Dictionary<string, Mod> ValidateMods(string[] mods)
{
var ret = new Dictionary<string, Mod>();
foreach (var m in mods)
{
if (!File.Exists("mods" + Path.DirectorySeparatorChar + m + Path.DirectorySeparatorChar + "mod.yaml"))
continue;
var yaml = new MiniYaml(null, MiniYaml.FromFile("mods" + Path.DirectorySeparatorChar + m + Path.DirectorySeparatorChar + "mod.yaml"));
if (!yaml.NodesDict.ContainsKey("Metadata"))
continue;
ret.Add(m, FieldLoader.Load<Mod>(yaml.NodesDict["Metadata"]));
}
return ret;
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -19,7 +19,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
@@ -45,47 +45,50 @@
</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="ConnectedComponents.cs" />
<Compile Include="DisposableAction.cs" />
<Compile Include="ColorHSLR.cs" />
<Compile Include="Evaluator.cs" />
<Compile Include="Exts.cs" />
<Compile Include="FieldLoader.cs" />
<Compile Include="FileSystem.cs" />
<Compile Include="Folder.cs" />
<Compile Include="Graphics\IGraphicsDevice.cs" />
<Compile Include="Graphics\IInputHandler.cs" />
<Compile Include="Graphics\PngLoader.cs" />
<Compile Include="Graphics\ShpWriter.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="IPaletteRemap.cs" />
<Compile Include="HttpUtil.cs" />
<Compile Include="Manifest.cs" />
<Compile Include="MiniYaml.cs" />
<Compile Include="Mod.cs" />
<Compile Include="PackageEntry.cs" />
<Compile Include="Package.cs" />
<Compile Include="Palette.cs" />
<Compile Include="PlayerColorRemap.cs" />
<Compile Include="Primitives\ActionQueue.cs" />
<Compile Include="Primitives\DisposableAction.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProtocolVersion.cs" />
<Compile Include="Thirdparty\Random.cs" />
<Compile Include="Session.cs" />
<Compile Include="ShroudPaletteRemap.cs" />
<Compile Include="SingleColorRemap.cs" />
<Compile Include="Support\Log.cs" />
<Compile Include="Support\Stopwatch.cs" />
<Compile Include="Support\Timer.cs" />
<Compile Include="TypeDictionary.cs" />
<Compile Include="Map\ActorReference.cs" />
<Compile Include="Map\Map.cs" />
<Compile Include="Map\TileReference.cs" />
<Compile Include="Map\Walkability.cs" />
<Compile Include="Map\Terrain.cs" />
<Compile Include="Primitives\Cache.cs" />
<Compile Include="Primitives\float2.cs" />
<Compile Include="Primitives\Pair.cs" />
<Compile Include="Map\TerrainColorSet.cs" />
<Compile Include="Map\TileSet.cs" />
<Compile Include="Primitives\PriorityQueue.cs" />
<Compile Include="Primitives\Lazy.cs" />
@@ -100,8 +103,15 @@
<Compile Include="FileFormats\IniFile.cs" />
<Compile Include="Graphics\ShpReader.cs" />
<Compile Include="Primitives\int2.cs" />
<Compile Include="Map\MapStub.cs" />
<Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\PlayerReference.cs" />
<Compile Include="Graphics\VqaReader.cs" />
<Compile Include="Filesystem\MixFile.cs" />
<Compile Include="Filesystem\FileSystem.cs" />
<Compile Include="Filesystem\Folder.cs" />
<Compile Include="Filesystem\InstallShieldPackage.cs" />
<Compile Include="FileFormats\Blast.cs" />
<Compile Include="Filesystem\ZipFile.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -1,80 +1,85 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace OpenRA.FileFormats
{
public class PackageEntry
{
public readonly uint Hash;
public readonly uint Offset;
public readonly uint Length;
public PackageEntry(BinaryReader r)
{
Hash = r.ReadUInt32();
Offset = r.ReadUInt32();
Length = r.ReadUInt32();
}
public override string ToString()
{
string filename;
if (Names.TryGetValue(Hash, out filename))
return string.Format("{0} - offset 0x{1:x8} - length 0x{2:x8}", filename, Offset, Length);
else
return string.Format("0x{0:x8} - offset 0x{1:x8} - length 0x{2:x8}", Hash, Offset, Length);
}
public static uint HashFilename(string name)
{
if (name.Length > 12)
name = name.Substring(0, 12);
name = name.ToUpperInvariant();
if (name.Length % 4 != 0)
name = name.PadRight(name.Length + (4 - name.Length % 4), '\0');
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
BinaryReader reader = new BinaryReader(ms);
int len = name.Length >> 2;
uint result = 0;
while (len-- != 0)
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
return result;
}
static Dictionary<uint, string> Names = new Dictionary<uint,string>();
public static void AddStandardName(string s)
{
uint hash = HashFilename(s);
Names.Add(hash, s);
}
public const int Size = 12;
}
}
#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.IO;
using System.Text;
namespace OpenRA.FileFormats
{
public class PackageEntry
{
public readonly uint Hash;
public readonly uint Offset;
public readonly uint Length;
public PackageEntry(uint hash, uint offset, uint length)
{
Hash = hash;
Offset = offset;
Length = length;
}
public PackageEntry(BinaryReader r)
{
Hash = r.ReadUInt32();
Offset = r.ReadUInt32();
Length = r.ReadUInt32();
}
public void Write(BinaryWriter w)
{
w.Write(Hash);
w.Write(Offset);
w.Write(Length);
}
public override string ToString()
{
string filename;
if (Names.TryGetValue(Hash, out filename))
return string.Format("{0} - offset 0x{1:x8} - length 0x{2:x8}", filename, Offset, Length);
else
return string.Format("0x{0:x8} - offset 0x{1:x8} - length 0x{2:x8}", Hash, Offset, Length);
}
public static uint HashFilename(string name)
{
if (name.Length > 12)
name = name.Substring(0, 12);
name = name.ToUpperInvariant();
if (name.Length % 4 != 0)
name = name.PadRight(name.Length + (4 - name.Length % 4), '\0');
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
BinaryReader reader = new BinaryReader(ms);
int len = name.Length >> 2;
uint result = 0;
while (len-- != 0)
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
return result;
}
static Dictionary<uint, string> Names = new Dictionary<uint,string>();
public static void AddStandardName(string s)
{
uint hash = HashFilename(s);
Names.Add(hash, s);
}
public const int Size = 12;
}
}

View File

@@ -1,65 +1,77 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public class Palette
{
List<Color> colors = new List<Color>();
public Color GetColor(int index)
{
return colors[index];
}
public Palette(Stream s, bool remapTransparent)
{
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.Add(Color.FromArgb(r, g, b));
}
}
colors[0] = Color.FromArgb(0, 0, 0, 0);
if (remapTransparent)
{
colors[3] = Color.FromArgb(178, 0, 0, 0);
colors[4] = Color.FromArgb(140, 0, 0, 0);
}
}
public Palette(Palette p, IPaletteRemap r)
{
for (int i = 0; i < 256; i++)
colors.Add(r.GetRemappedColor(p.GetColor(i), i));
}
}
}
#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.Drawing;
using System.IO;
namespace OpenRA.FileFormats
{
public class Palette
{
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 Palette(Stream s, bool remapTransparent)
{
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;
if (remapTransparent)
{
colors[1] = 178u << 24; // Hack for d2k; may have side effects
colors[3] = 178u << 24;
colors[4] = 140u << 24;
}
}
public Palette(Palette p, IPaletteRemap r)
{
colors = new uint[256];
for(int i = 0; i < 256; i++)
colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)p.colors[i]),i).ToArgb();
}
public Palette(Palette p)
{
colors = (uint[])p.colors.Clone();
}
}
public interface IPaletteRemap { Color GetRemappedColor(Color original, int index); }
}

111
OpenRA.FileFormats/PlayerColorRemap.cs Normal file → Executable file
View File

@@ -1,58 +1,53 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
public class PlayerColorRemap : IPaletteRemap
{
Dictionary<int, Color> remapColors;
public PlayerColorRemap(Color c1, Color c2, bool useSplitRamp)
{
var baseIndex = useSplitRamp ? 0xb0 : 80;
var ramp = useSplitRamp
? new[] { 0, 2, 4, 6, 8, 10, 13, 15, 1, 3, 5, 7, 9, 11, 12, 14 }
: new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
remapColors = ramp.Select((x, i) => Pair.New(baseIndex + i, ColorLerp(x / 16f, c1, c2)))
.ToDictionary(u => u.First, u => u.Second);
}
static Color ColorLerp(float t, Color c1, Color c2)
{
return Color.FromArgb(255,
(int)(t * c2.R + (1 - t) * c1.R),
(int)(t * c2.G + (1 - t) * c1.G),
(int)(t * c2.B + (1 - t) * c1.B));
}
public Color GetRemappedColor(Color original, int index)
{
Color c;
return remapColors.TryGetValue(index, out c)
? c : original;
}
}
}
#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;
namespace OpenRA.FileFormats
{
// TODO: ship this out of here.
public enum PaletteFormat { ra, cnc, d2k }
public class PlayerColorRemap : IPaletteRemap
{
Dictionary<int, Color> remapColors;
public PlayerColorRemap(ColorRamp c, PaletteFormat fmt)
{
var c1 = c.GetColor(0);
var c2 = c.GetColor(1); /* temptemp: this can be expressed better */
var baseIndex = (fmt == PaletteFormat.cnc) ? 0xb0 : (fmt == PaletteFormat.d2k) ? 240 : 80;
var ramp = (fmt == PaletteFormat.cnc)
? new[] { 0, 2, 4, 6, 8, 10, 13, 15, 1, 3, 5, 7, 9, 11, 12, 14 }
: new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
remapColors = ramp.Select((x, i) => Pair.New(baseIndex + i, ColorLerp(x / 16f, c1, c2)))
.ToDictionary(u => u.First, u => u.Second);
}
public static Color ColorLerp(float t, Color c1, Color c2)
{
return Color.FromArgb(255,
(int)(t * c2.R + (1 - t) * c1.R),
(int)(t * c2.G + (1 - t) * c1.G),
(int)(t * c2.B + (1 - t) * c1.B));
}
public Color GetRemappedColor(Color original, int index)
{
Color c;
return remapColors.TryGetValue(index, out c)
? c : original;
}
}
}

View File

@@ -0,0 +1,40 @@
#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
{
/// <summary>
/// A thread-safe action queue, suitable for passing units of work between threads.
/// </summary>
public class ActionQueue
{
object syncRoot = new object();
Action actions = () => { };
public void Add(Action a)
{
lock (syncRoot)
actions += a;
}
public void PerformActions()
{
Action a;
lock (syncRoot)
{
a = actions;
actions = () => { };
}
a();
}
}
}

View File

@@ -1,59 +1,53 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
namespace OpenRA.FileFormats
{
public class Cache<T, U> : IEnumerable<KeyValuePair<T, U>>
#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 = new Dictionary<T, U>();
Func<T,U> loader;
public Cache(Func<T,U> loader)
{
if (loader == null)
throw new ArgumentNullException();
this.loader = loader;
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 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; } }
}
}
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

@@ -0,0 +1,40 @@
#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
{
public class DisposableAction : IDisposable
{
public DisposableAction(Action onDispose, Action onFinalize)
{
this.onDispose = onDispose;
this.onFinalize = onFinalize;
}
Action onDispose;
Action onFinalize;
bool disposed;
public void Dispose()
{
if (disposed) return;
disposed = true;
onDispose();
GC.SuppressFinalize(this);
}
~DisposableAction()
{
onFinalize();
}
}
}

View File

@@ -1,56 +1,51 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
#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 Value
{
get
{
if (p == null)
return value;
value = p();
p = null;
return value;
}
}
}
public static class Lazy
{
public static Lazy<T> New<T>(Func<T> p) { return new Lazy<T>(p); }
}
}
public void Force()
{
var ignored = Value;
}
}
public static class Lazy
{
public static Lazy<T> New<T>(Func<T> p) { return new Lazy<T>(p); }
}
}

View File

@@ -1,75 +1,90 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
#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;
namespace OpenRA.FileFormats
{
public struct Pair<T, U>
{
public T First;
public U Second;
public Pair(T first, U second)
{
First = first;
Second = second;
using System;
using System.Drawing;
namespace OpenRA.FileFormats
{
public struct Pair<T, U>
{
public T First;
public U Second;
public Pair(T first, U second)
{
First = first;
Second = second;
}
internal static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
internal static IEqualityComparer<U> uc = EqualityComparer<U>.Default;
public static bool operator ==(Pair<T, U> a, Pair<T, U> b)
{
return tc.Equals(a.First, b.First) && uc.Equals(a.Second, b.Second);
}
public static bool operator !=(Pair<T, U> a, Pair<T, U> b)
{
return !(a == b);
}
public override bool Equals(object obj)
{
if (!(obj is Pair<T, U>))
return false;
return (Pair<T, U>)obj == this;
}
public override int GetHashCode()
{
return First.GetHashCode() ^ Second.GetHashCode();
}
public Pair<T, U> WithFirst(T t) { return new Pair<T, U>(t, Second); }
public Pair<T, U> WithSecond(U u) { return new Pair<T, U>(First, u); }
public static T AsFirst(Pair<T, U> p) { return p.First; }
public static U AsSecond(Pair<T, U> p) { return p.Second; }
public override string ToString()
{
return "({0},{1})".F(First, Second);
}
static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
static IEqualityComparer<U> uc = EqualityComparer<U>.Default;
public static bool operator ==(Pair<T, U> a, Pair<T, U> b)
class PairEqualityComparer : IEqualityComparer<Pair<T, U>>
{
return tc.Equals(a.First, b.First) && uc.Equals(a.Second, b.Second);
public bool Equals(Pair<T, U> x, Pair<T, U> y) { return x == y; }
public int GetHashCode(Pair<T, U> obj) { return obj.GetHashCode(); }
}
public static bool operator !=(Pair<T, U> a, Pair<T, U> b)
{
return !(a == b);
}
public override bool Equals(object obj)
{
if (!(obj is Pair<T, U>))
return false;
return (Pair<T, U>)obj == this;
}
public override int GetHashCode()
{
return First.GetHashCode() ^ Second.GetHashCode();
}
public Pair<T, U> WithFirst(T t) { return new Pair<T, U>(t, Second); }
public Pair<T, U> WithSecond(U u) { return new Pair<T, U>(First, u); }
public static T AsFirst(Pair<T, U> p) { return p.First; }
public static U AsSecond(Pair<T, U> p) { return p.Second; }
public Pair<U, T> Swap() { return Pair.New(Second, First); }
}
public static class Pair
public static IEqualityComparer<Pair<T, U>> EqualityComparer { get { return new PairEqualityComparer(); } }
}
public static class Pair
{
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
}
}
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
static Pair()
{
Pair<char,Color>.uc = new ColorEqualityComparer();
}
// avoid the default crappy one
class ColorEqualityComparer : IEqualityComparer<Color>
{
public bool Equals(Color x, Color y) { return x.ToArgb() == y.ToArgb(); }
public int GetHashCode(Color obj) { return obj.GetHashCode(); }
}
}
}

View File

@@ -1,113 +1,103 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
namespace OpenRA.FileFormats
{
public class PriorityQueue<T>
where T : IComparable<T>
{
List<T[]> items = new List<T[]>();
int level, index;
public PriorityQueue()
{
items.Add(new T[1]);
}
public void Add(T item)
{
int addLevel = level;
int addIndex = index;
while (addLevel >= 1 && Above(addLevel, addIndex).CompareTo(item) > 0)
{
items[addLevel][addIndex] = Above(addLevel, addIndex);
--addLevel;
addIndex >>= 1;
}
items[addLevel][addIndex] = item;
if (++index >= (1 << level))
{
index = 0;
if (items.Count <= ++level)
items.Add(new T[1 << level]);
}
}
public bool Empty { get { return (level == 0); } }
T At(int level, int index) { return items[level][index]; }
T Above(int level, int index) { return items[level - 1][index >> 1]; }
T Last()
{
int lastLevel = level;
int lastIndex = index;
if (--lastIndex < 0)
lastIndex = (1 << --lastLevel) - 1;
return At(lastLevel, lastIndex);
}
public T Pop()
{
if (level == 0 && index == 0)
throw new InvalidOperationException("Attempting to pop empty PriorityQueue");
T ret = At(0, 0);
BubbleInto(0, 0, Last());
if (--index < 0)
index = (1 << --level) - 1;
return ret;
}
void BubbleInto(int intoLevel, int intoIndex, T val)
{
int downLevel = intoLevel + 1;
int downIndex = intoIndex << 1;
if (downLevel > level || (downLevel == level && downIndex >= index))
{
items[intoLevel][intoIndex] = val;
return;
}
if (downLevel <= level && downIndex < index - 1 &&
At(downLevel, downIndex).CompareTo(At(downLevel, downIndex + 1)) >= 0)
++downIndex;
if (val.CompareTo(At(downLevel, downIndex)) <= 0)
{
items[intoLevel][intoIndex] = val;
return;
}
items[intoLevel][intoIndex] = At(downLevel, downIndex);
BubbleInto(downLevel, downIndex, val);
}
}
}
#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.Generic;
namespace OpenRA.FileFormats
{
public class PriorityQueue<T>
where T : IComparable<T>
{
List<T[]> items = new List<T[]>();
int level, index;
public PriorityQueue()
{
items.Add(new T[1]);
}
public void Add(T item)
{
int addLevel = level;
int addIndex = index;
while (addLevel >= 1 && Above(addLevel, addIndex).CompareTo(item) > 0)
{
items[addLevel][addIndex] = Above(addLevel, addIndex);
--addLevel;
addIndex >>= 1;
}
items[addLevel][addIndex] = item;
if (++index >= (1 << level))
{
index = 0;
if (items.Count <= ++level)
items.Add(new T[1 << level]);
}
}
public bool Empty { get { return (level == 0); } }
T At(int level, int index) { return items[level][index]; }
T Above(int level, int index) { return items[level - 1][index >> 1]; }
T Last()
{
int lastLevel = level;
int lastIndex = index;
if (--lastIndex < 0)
lastIndex = (1 << --lastLevel) - 1;
return At(lastLevel, lastIndex);
}
public T Pop()
{
if (level == 0 && index == 0)
throw new InvalidOperationException("Attempting to pop empty PriorityQueue");
T ret = At(0, 0);
BubbleInto(0, 0, Last());
if (--index < 0)
index = (1 << --level) - 1;
return ret;
}
void BubbleInto(int intoLevel, int intoIndex, T val)
{
int downLevel = intoLevel + 1;
int downIndex = intoIndex << 1;
if (downLevel > level || (downLevel == level && downIndex >= index))
{
items[intoLevel][intoIndex] = val;
return;
}
if (downLevel <= level && downIndex < index - 1 &&
At(downLevel, downIndex).CompareTo(At(downLevel, downIndex + 1)) >= 0)
++downIndex;
if (val.CompareTo(At(downLevel, downIndex)) <= 0)
{
items[intoLevel][intoIndex] = val;
return;
}
items[intoLevel][intoIndex] = At(downLevel, downIndex);
BubbleInto(downLevel, downIndex, val);
}
}
}

View File

@@ -1,76 +1,48 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
namespace OpenRA.Collections
{
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 class CachedView<T,U> : Set<U>
{
public CachedView( Set<T> set, Func<T, bool> include, Func<T, U> store )
: this( set, include, x => new[] { store( x ) } )
{
}
public CachedView( Set<T> set, Func<T,bool> include, Func<T,IEnumerable<U>> store )
{
foreach( var t in set )
if( include( t ) )
store( t ).Do( x => Add( x ) );
set.OnAdd += obj => { if( include( obj ) ) store( obj ).Do( x => Add( x ) ); };
set.OnRemove += obj => { if( include( obj ) ) store( obj ).Do( x => Remove( x ) ); };
}
}
}
#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.Collections
{
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();
}
}
}

View File

@@ -1,113 +1,104 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace OpenRA
{
[StructLayout(LayoutKind.Sequential)]
public struct float2
{
public float X, Y;
public float2(float x, float y) { X = x; Y = y; }
public float2(PointF p) { X = p.X; Y = p.Y; }
public float2(Point p) { X = p.X; Y = p.Y; }
public float2(Size p) { X = p.Width; Y = p.Height; }
public float2(SizeF p) { X = p.Width; Y = p.Height; }
public PointF ToPointF() { return new PointF(X, Y); }
public SizeF ToSizeF() { return new SizeF(X, Y); }
public static implicit operator float2(int2 src) { return new float2(src.X, src.Y); }
public static float2 operator +(float2 a, float2 b) { return new float2(a.X + b.X, a.Y + b.Y); }
public static float2 operator -(float2 a, float2 b) { return new float2(a.X - b.X, a.Y - b.Y); }
public static float2 operator -(float2 a) { return new float2(-a.X, -a.Y); }
public static float Lerp(float a, float b, float t) { return a + t * (b - a); }
public static float2 Lerp(float2 a, float2 b, float t)
{
return new float2(
Lerp(a.X, b.X, t),
Lerp(a.Y, b.Y, t));
}
public static float2 Lerp(float2 a, float2 b, float2 t)
{
return new float2(
Lerp(a.X, b.X, t.X),
Lerp(a.Y, b.Y, t.Y));
}
public static float2 FromAngle(float a) { return new float2((float)Math.Sin(a), (float)Math.Cos(a)); }
static float Constrain(float x, float a, float b) { return x < a ? a : x > b ? b : x; }
public float2 Constrain(float2 min, float2 max)
{
return new float2(
Constrain(X, min.X, max.X),
Constrain(Y, min.Y, max.Y));
}
public static float2 operator *(float a, float2 b) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *( float2 a, float2 b ) { return new float2( a.X * b.X, a.Y * b.Y ); }
public static float2 operator /( float2 a, float2 b ) { return new float2( a.X / b.X, a.Y / b.Y ); }
public static bool operator ==(float2 me, float2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(float2 me, float2 other) { return !(me == other); }
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
float2 o = (float2)obj;
return o == this;
}
public static readonly float2 Zero = new float2(0, 0);
public static bool WithinEpsilon(float2 a, float2 b, float e)
{
float2 d = a - b;
return Math.Abs(d.X) < e && Math.Abs(d.Y) < e;
}
public float2 Sign() { return new float2(Math.Sign(X), Math.Sign(Y)); }
public static float Dot(float2 a, float2 b) { return a.X * b.X + a.Y * b.Y; }
public float2 Round() { return new float2((float)Math.Round(X), (float)Math.Round(Y)); }
public override string ToString() { return string.Format("({0},{1})", X, Y); }
public int2 ToInt2() { return new int2((int)X, (int)Y); }
public static float2 Max(float2 a, float2 b) { return new float2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static float2 Min(float2 a, float2 b) { return new float2(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public float LengthSquared { get { return X * X + Y * Y; } }
public float Length { get { return (float)Math.Sqrt(LengthSquared); } }
}
}
#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;
using System.Runtime.InteropServices;
namespace OpenRA
{
[StructLayout(LayoutKind.Sequential)]
public struct float2
{
public float X, Y;
public float2(float x, float y) { X = x; Y = y; }
public float2(PointF p) { X = p.X; Y = p.Y; }
public float2(Point p) { X = p.X; Y = p.Y; }
public float2(Size p) { X = p.Width; Y = p.Height; }
public float2(SizeF p) { X = p.Width; Y = p.Height; }
public PointF ToPointF() { return new PointF(X, Y); }
public SizeF ToSizeF() { return new SizeF(X, Y); }
public static implicit operator float2(int2 src) { return new float2(src.X, src.Y); }
public static float2 operator +(float2 a, float2 b) { return new float2(a.X + b.X, a.Y + b.Y); }
public static float2 operator -(float2 a, float2 b) { return new float2(a.X - b.X, a.Y - b.Y); }
public static float2 operator -(float2 a) { return new float2(-a.X, -a.Y); }
public static float Lerp(float a, float b, float t) { return a + t * (b - a); }
public static float2 Lerp(float2 a, float2 b, float t)
{
return new float2(
Lerp(a.X, b.X, t),
Lerp(a.Y, b.Y, t));
}
public static float2 Lerp(float2 a, float2 b, float2 t)
{
return new float2(
Lerp(a.X, b.X, t.X),
Lerp(a.Y, b.Y, t.Y));
}
public static float2 FromAngle(float a) { return new float2((float)Math.Sin(a), (float)Math.Cos(a)); }
static float Constrain(float x, float a, float b) { return x < a ? a : x > b ? b : x; }
public float2 Constrain(float2 min, float2 max)
{
return new float2(
Constrain(X, min.X, max.X),
Constrain(Y, min.Y, max.Y));
}
public static float2 operator *(float a, float2 b) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *(float2 b, float a) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *( float2 a, float2 b ) { return new float2( a.X * b.X, a.Y * b.Y ); }
public static float2 operator /( float2 a, float2 b ) { return new float2( a.X / b.X, a.Y / b.Y ); }
public static bool operator ==(float2 me, float2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(float2 me, float2 other) { return !(me == other); }
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
float2 o = (float2)obj;
return o == this;
}
public static readonly float2 Zero = new float2(0, 0);
public static bool WithinEpsilon(float2 a, float2 b, float e)
{
float2 d = a - b;
return Math.Abs(d.X) < e && Math.Abs(d.Y) < e;
}
public float2 Sign() { return new float2(Math.Sign(X), Math.Sign(Y)); }
public static float Dot(float2 a, float2 b) { return a.X * b.X + a.Y * b.Y; }
public float2 Round() { return new float2((float)Math.Round(X), (float)Math.Round(Y)); }
public override string ToString() { return string.Format("({0},{1})", X, Y); }
public int2 ToInt2() { return new int2((int)X, (int)Y); }
public static float2 Max(float2 a, float2 b) { return new float2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static float2 Min(float2 a, float2 b) { return new float2(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public float LengthSquared { get { return X * X + Y * Y; } }
public float Length { get { return (float)Math.Sqrt(LengthSquared); } }
}
}

View File

@@ -1,67 +1,85 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Drawing;
namespace OpenRA
{
public struct int2
{
public int X,Y;
public int2( int x, int y ) { this.X = x; this.Y = y; }
public int2( Point p ) { X = p.X; Y = p.Y; }
public int2( Size p ) { X = p.Width; Y = p.Height; }
public static int2 operator +(int2 a, int2 b) { return new int2(a.X + b.X, a.Y + b.Y); }
public static int2 operator -(int2 a, int2 b) { return new int2(a.X - b.X, a.Y - b.Y); }
public static int2 operator *(int a, int2 b) { return new int2(a * b.X, a * b.Y); }
public static int2 operator *(int2 b, int a) { return new int2(a * b.X, a * b.Y); }
public static bool operator ==(int2 me, int2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(int2 me, int2 other) { return !(me == other); }
public int2 Sign() { return new int2(Math.Sign(X), Math.Sign(Y)); }
public int2 Abs() { return new int2( 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 override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public static int2 Max(int2 a, int2 b) { return new int2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static int2 Min(int2 a, int2 b) { return new int2(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
int2 o = (int2)obj;
return o == this;
}
public static readonly int2 Zero = new int2(0, 0);
public Point ToPoint() { return new Point(X, Y); }
public PointF ToPointF() { return new PointF(X, Y); }
public float2 ToFloat2() { return new float2(X, Y); }
public override string ToString() { return string.Format("{0},{1}", X, Y); }
}
}
#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
{
public struct int2
{
public int X,Y;
public int2( int x, int y ) { this.X = x; this.Y = y; }
public int2( Point p ) { X = p.X; Y = p.Y; }
public int2( Size p ) { X = p.Width; Y = p.Height; }
public static int2 operator +(int2 a, int2 b) { return new int2(a.X + b.X, a.Y + b.Y); }
public static int2 operator -(int2 a, int2 b) { return new int2(a.X - b.X, a.Y - b.Y); }
public static int2 operator *(int a, int2 b) { return new int2(a * b.X, a * b.Y); }
public static int2 operator *(int2 b, int a) { return new int2(a * b.X, a * b.Y); }
public static int2 operator /(int2 a, int b) { return new int2(a.X / b, a.Y / b); }
public static int2 operator -(int2 a) { return new int2(-a.X, -a.Y); }
public static bool operator ==(int2 me, int2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(int2 me, int2 other) { return !(me == other); }
public int2 Sign() { return new int2(Math.Sign(X), Math.Sign(Y)); }
public int2 Abs() { return new int2( 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 override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public static int2 Max(int2 a, int2 b) { return new int2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static int2 Min(int2 a, int2 b) { return new int2(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
int2 o = (int2)obj;
return o == this;
}
public static readonly int2 Zero = new int2(0, 0);
public Point ToPoint() { return new Point(X, Y); }
public PointF ToPointF() { return new PointF(X, Y); }
public float2 ToFloat2() { return new float2(X, Y); }
public override string ToString() { return string.Format("{0},{1}", X, Y); }
// Change endianness of a uint32
public static uint Swap(uint orig)
{
return (uint)((orig & 0xff000000) >> 24) | ((orig & 0x00ff0000) >> 8) | ((orig & 0x0000ff00) << 8) | ((orig & 0x000000ff) << 24);
}
public static int Lerp( int a, int b, int mul, int div )
{
return a + ( b - a ) * mul / div;
}
public static int2 Lerp( int2 a, int2 b, int mul, int div )
{
return a + ( b - a ) * mul / div;
}
public int2 Clamp(Rectangle r)
{
return new int2(Math.Min(r.Right, Math.Max(X, r.Left)),
Math.Min(r.Bottom, Math.Max(Y, r.Top)));
}
public static int Dot(int2 a, int2 b) { return a.X * b.X + a.Y * b.Y; }
}
}

View File

@@ -1,28 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
namespace OpenRA.FileFormats
{
public static class ProtocolVersion
{
// you *must* increment this whenever you make an incompatible protocol change
public static readonly int Version = 4;
}
}

View File

@@ -1,94 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.FileFormats
{
public class Session
{
public List<Client> Clients = new List<Client>();
public Global GlobalSettings = new Global();
public enum ClientState
{
NotReady,
Downloading,
Ready
}
public class Client
{
public int Index;
public int PaletteIndex;
public string Country;
public int SpawnPoint;
public string Name;
public ClientState State;
public int Team;
}
public class Global
{
public string Map;
public string[] Packages = {}; // filename:sha1 pairs.
public string[] Mods = { "ra" }; // mod names
public int OrderLatency = 3;
public int RandomSeed = 0;
}
}
public class Manifest
{
public readonly string[]
Folders, Packages, Rules,
Sequences, Chrome, Assemblies, ChromeLayout,
Weapons, Voices, Music, Terrain;
public readonly string ShellmapUid;
public Manifest(string[] mods)
{
var yaml = mods
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
.Aggregate(MiniYaml.Merge);
Folders = YamlList(yaml, "Folders");
Packages = YamlList(yaml, "Packages");
Rules = YamlList(yaml, "Rules");
Sequences = YamlList(yaml, "Sequences");
Chrome = YamlList(yaml, "Chrome");
Assemblies = YamlList(yaml, "Assemblies");
ChromeLayout = YamlList(yaml, "ChromeLayout");
Weapons = YamlList(yaml, "Weapons");
Voices = YamlList(yaml, "Voices");
Music = YamlList(yaml, "Music");
Terrain = YamlList(yaml, "Terrain");
ShellmapUid = yaml["ShellmapUid"].Value;
}
static string[] YamlList(Dictionary<string, MiniYaml> ys, string key)
{
return ys.ContainsKey(key) ? ys[key].Nodes.Keys.ToArray() : new string[] { };
}
}
}

View File

@@ -1,60 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Drawing;
namespace OpenRA.FileFormats
{
public class ShroudPaletteRemap : IPaletteRemap
{
bool isFog;
public ShroudPaletteRemap(bool isFog) { this.isFog = isFog; }
public Color GetRemappedColor(Color original, int index)
{
// false-color version for debug
//return new[] {
// Color.FromArgb(64,0,0,0), Color.Green,
// Color.Blue, Color.Yellow,
// Color.Green,
// Color.Red,
// Color.Purple,
// Color.Cyan}[index % 8];
if (isFog)
return new[] {
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.FromArgb(128,0,0,0),
Color.FromArgb(128,0,0,0),
Color.FromArgb(128,0,0,0),
Color.FromArgb(64,0,0,0)}[index % 8];
else
return new[] {
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.Black,
Color.FromArgb(128,0,0,0),
Color.Transparent,
Color.Transparent}[index % 8];
}
}
}

View File

@@ -1,38 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Drawing;
namespace OpenRA.FileFormats
{
public class SingleColorRemap : IPaletteRemap
{
Color c;
public SingleColorRemap(Color c)
{
this.c = c;
}
public Color GetRemappedColor(Color original, int index)
{
return original.A > 0 ? c : original;
}
}
}

View File

@@ -1,40 +1,74 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.IO;
using System;
namespace OpenRA
{
public static class Log
{
static StreamWriter writer = File.CreateText(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + Path.DirectorySeparatorChar + "openra.log.txt");
static Log()
{
writer.AutoFlush = true;
}
public static void Write(string format, params object[] args)
{
writer.WriteLine(format, args);
}
}
}
#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.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
namespace OpenRA
{
public struct ChannelInfo
{
public string Filename;
public StreamWriter Writer;
}
public static class Log
{
static string LogPathPrefix = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + Path.DirectorySeparatorChar;
static Dictionary<string, ChannelInfo> channels = new Dictionary<string,ChannelInfo>();
public static string LogPath
{
get { return LogPathPrefix; }
set
{
LogPathPrefix = value;
if (!Directory.Exists(LogPathPrefix))
Directory.CreateDirectory(LogPathPrefix);
}
}
public static void AddChannel(string channelName, string filename)
{
if (channels.ContainsKey(channelName)) return;
var i = 0;
var f = filename;
while (File.Exists(LogPathPrefix + filename))
try
{
StreamWriter writer = File.CreateText(LogPathPrefix + filename);
writer.AutoFlush = true;
channels.Add(channelName, new ChannelInfo() { Filename = filename, Writer = writer });
return;
}
catch (IOException) { filename = f + ".{0}".F(++i); }
//if no logs exist, just make it
StreamWriter w = File.CreateText(LogPathPrefix + filename);
w.AutoFlush = true;
channels.Add(channelName, new ChannelInfo() { Filename = filename, Writer = w });
}
public static void Write(string channel, string format, params object[] args)
{
ChannelInfo info;
if (!channels.TryGetValue(channel, out info))
throw new Exception("Tried logging to non-existant channel " + channel);
info.Writer.WriteLine(format, args);
}
}
}

View File

@@ -1,41 +1,31 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#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();
}
}
}
#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();
}
}
}

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