Commit Graph

121 Commits

Author SHA1 Message Date
RoosterDragon
a0db80cb6a Changes to reduce allocations in the main loop.
Targeted some methods that generated allocated a lot of memory in the main game loop:
- Actor.Render - Changed LINQ calls into equivalent loops. No allocation for delegates.
- Animation.Render - Returned an array rather than a yield expression. The array uses less memory than the complier generated enumerable.
- FrozenActor and FrozenUnderFog - Materialize the footprint into an array: The enumerable is not-trivial to evaluate is and evaluated many times inside the Tick function. The memory needed is minimal. Changed LINQ into equivalent loops to prevent delegate allocation. Should result in overall much faster calls.
- Widget.GetEventBounds - Changed LINQ calls into equivalent loops.
- MobileInfo.CanEnterCell - Changed LINQ calls into equivalent loops. Don't materialize list of blocking actors every time, instead enumerate them and only when they need to be checked.
- FrozenUnderFog.TickRender - Generate the renderables lazily and also remove a no-op Select call.
2014-05-23 14:48:11 +01:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

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

* Rename/Delete/Detele all functionality.

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

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

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

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

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Matthias Mailänder
212cf93ca4 separate World and Ui LastTickTime 2014-03-14 10:07:54 +01:00
ScottNZ
86a3e14f2d Remove constructor base() redundancies 2013-11-12 17:31:55 +13:00
Paul Chote
d1c9c6d76d Split text input into its own event. 2013-10-30 20:08:02 +13:00
Paul Chote
b7123cda7d Route screen size queries via Game.Renderer. 2013-10-05 21:01:21 +13:00
Paul Chote
7c91d6976d Split keyboard and mouse focus.
Fixes #3304.
Fixes #2075.
Fixes C&C chat focus bug.
2013-07-27 21:02:52 +12:00
Paul Chote
ec7bbd6c18 Add Ui.LoadWidget<T> overload. 2013-06-29 13:29:39 +12:00
Sascha Biedermann
1eb7c62c62 closes #2874: improved ingame chat 2013-03-28 18:39:26 +01:00
Chris Forbes
c30d46c014 #2051 fixed -- Widget.Get() throws by default 2012-04-27 19:39:07 +12:00
Chris Forbes
5b8334b26d drop ILogicWithInit, no longer used 2012-03-16 18:43:41 +13:00
Chris Forbes
bf5be88c75 rename Ui.RootWidget to just Ui.Root 2011-12-13 23:46:58 +13:00
Chris Forbes
58f6816d84 convert silly DoXXX names to just XXX 2011-12-13 23:44:40 +13:00
Chris Forbes
ed429a3b30 split Widget static bits into Ui static class 2011-12-13 23:38:59 +13:00
Chris Forbes
83055f0a17 convert RootWidget prop back to field, now that it has trivial get/set 2011-12-13 22:30:51 +13:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
92bdec7f1d factor out layout policy for ScrollPanelWidget; add GridLayout option. 2011-10-08 18:15:24 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Paul Chote
05acdc9b98 Clean up some uses of rect.Contains(int2). 2011-07-15 21:31:47 +12:00
Paul Chote
88d68f7790 Containers shouldn't steal mouseover focus 2011-07-14 20:29:11 +12:00
Paul Chote
460451c402 Start implementing new tooltip bits. Test tooltips added for buttons and production palette. 2011-07-14 20:29:11 +12:00
Paul Chote
0c95b43c87 Save some dumb perf in Widget.RenderBounds. 2011-07-14 20:29:03 +12:00
Paul Chote
e9d67860de Proper mouseover support. 2011-07-14 20:29:02 +12:00
Paul Chote
1114293035 Apply consistent widget method names. Semantic change: Widgets that want to tick when !Visible must override TickOuter() instead of Tick(). 2011-07-14 20:29:02 +12:00
Paul Chote
193999a040 Move OnMouseUp onto ButtonWidget and drop its unnecessary plumbing. 2011-07-14 20:29:02 +12:00
Paul Chote
8189ef109e Reorganize Widget into static/nonstatic. 2011-07-14 20:29:02 +12:00
Paul Chote
bbeaf2047b Remove OnMouseDown from Widget. Define it on just the widgets that want it. 2011-07-14 20:29:02 +12:00
Paul Chote
7a69daa99c Remove Widget.OnMouseMove. 2011-07-14 20:29:01 +12:00
Paul Chote
c1f7152857 Change Widget key support: Move (unused) Widget.OnKeyPress hook onto ButtonWidget; Buttons will respond to keys with modifiers. 2011-07-14 20:28:35 +12:00
Chris Forbes
0e45968573 remove 'private' keyword where possible 2011-06-29 09:15:39 +12:00
Paul Chote
ad3f378545 Add a hook for widgets being removed, and ensure widgets are removed consistently. 2011-06-01 18:50:59 +12:00
Paul Chote
81515705ec Add keyboard shortcut support to ButtonWidgets.
Hook up 'escape' and 'return' as appropriate for moving through menus.
2011-05-30 22:15:14 +12:00
Chris Forbes
ef03d46f13 eradicate 'delegate' misuse 2011-05-22 22:02:09 +12:00
Chris Forbes
e839ae33d8 hax 2011-05-22 20:41:34 +12:00
Paul Chote
d7a0445e59 Remove ContainerWidget.Background 2011-05-22 18:41:32 +12:00
Paul Chote
5bc0ef69ad Pass WidgetArgs to Widget.Initialize. Use this to allow for custom substitutions. 2011-05-21 17:26:20 +12:00
Paul Chote
ab423fbe8c Mark some bits obsolete 2011-05-21 17:26:18 +12:00
Paul Chote
1526b6ff37 Make Game.LoadWidget / Widget.LoadWidget consistent. 2011-05-21 17:26:16 +12:00
Paul Chote
f4ea4c5daa Add a WidgetArgs type to work around gmcs not understanding lambda -> Action -> object. 2011-05-21 17:26:16 +12:00
Paul Chote
372d2f5426 Saner load code for cnc. Installing not yet implemented. 2011-05-21 17:26:10 +12:00
Paul Chote
8957caeaca Basic ingame menu reimplemented. 2011-05-21 17:25:44 +12:00
Paul Chote
845b32281d Reimplement server browser 2011-05-21 16:27:37 +12:00
Paul Chote
a3b430c24a Remove engine references to MAINMENU_BG. Don't push the menu background onto the window list. Crashes whenever a delegate tries to open MAINMENU_BG. 2011-05-21 16:27:37 +12:00
Chris Forbes
178e4664c7 790 fixed -- Widget.EventHandler was never used, removed 2011-05-21 16:27:06 +12:00
Paul Chote
b0425aff3b Renormalize line endings and fix copyright headers again. 2011-04-07 21:15:42 +12:00
Chris Forbes
1af23079eb make it crash nicely when you inherit from a bogus actor type 2011-04-04 11:14:07 +12:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +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
481cc7807b Don't require a WorldRenderer to draw non-world-rendering widgets. 2011-01-19 20:41:32 +13:00