From 1ac89a627dbf3bb843139c7074fe7e8f76e05a72 Mon Sep 17 00:00:00 2001 From: bryanedds Date: Thu, 1 Jan 2015 13:51:30 -0500 Subject: [PATCH] TODOs, NOTEs, and bits of clean-up. Former-commit-id: 35b5889b84c95e42f6bb01f8e9aa99f91681ede7 --- .../InfinityRpg/InfinityRpg/GameplayDispatcher.fs | 8 ++++++-- Nu/Nu/Nu/Entity.fs | 2 +- Nu/Nu/Nu/Program.fs | 9 +++++---- Nu/Nu/Nu/Serialization.fs | 2 +- Nu/Nu/Nu/Simulation.fs | 2 +- Nu/Nu/Nu/WorldPrimitives.fs | 3 ++- Nu/Nu/Nu/Xtension.fs | 3 ++- Prime/Prime/Prime/Interactive.fsx | 1 + 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/InfinityRpg/InfinityRpg/InfinityRpg/GameplayDispatcher.fs b/InfinityRpg/InfinityRpg/InfinityRpg/GameplayDispatcher.fs index da70fa26b9..648c8e274b 100644 --- a/InfinityRpg/InfinityRpg/InfinityRpg/GameplayDispatcher.fs +++ b/InfinityRpg/InfinityRpg/InfinityRpg/GameplayDispatcher.fs @@ -39,7 +39,8 @@ module GameplayDispatcherModule = type GameplayDispatcher () = inherit ScreenDispatcher () - // hud addresses + (* Hud Addresses *) + static let getHudAddress address = satoga address HudName static let getHudHaltAddress address = gatoea (getHudAddress address) HudHaltName static let getHudSaveGameAddress address = gatoea (getHudAddress address) HudSaveGameName @@ -49,7 +50,8 @@ module GameplayDispatcherModule = static let getHudDetailDownAddress address = gatoea (getHudAddress address) HudDetailDownName static let getHudDetailLeftAddress address = gatoea (getHudAddress address) HudDetailLeftName - // scene addresses + (* Scene Addresses *) + static let getSceneAddress address = satoga address SceneName @@ -81,6 +83,8 @@ module GameplayDispatcherModule = let entityAddresses = World.getEntityAddressesInGroup (getSceneAddress address) world World.filterEntityAddresses (Entity.dispatchesAs typeof) entityAddresses world + (* End of Addresses *) + static let makeField rand world = let pathEdgesM = [(Vector2i (1, 10), Vector2i (20, 10))] let (fieldMap, rand) = FieldMap.make FieldTileSheetImage (Vector2i 22) pathEdgesM rand diff --git a/Nu/Nu/Nu/Entity.fs b/Nu/Nu/Nu/Entity.fs index 4f5c8f7426..1ef04b5ea6 100644 --- a/Nu/Nu/Nu/Entity.fs +++ b/Nu/Nu/Nu/Entity.fs @@ -344,7 +344,7 @@ module WorldEntityModule = // find the entity's dispatcher let dispatcher = Map.find dispatcherName world.Components.EntityDispatchers - // compute the opt overlay name + // compute the default opt overlay name let intrinsicOverlayName = dispatcherName let defaultOptOverlayName = Map.find intrinsicOverlayName world.State.OverlayRouter diff --git a/Nu/Nu/Nu/Program.fs b/Nu/Nu/Nu/Program.fs index 1cc19ad184..431bfab6ac 100644 --- a/Nu/Nu/Nu/Program.fs +++ b/Nu/Nu/Nu/Program.fs @@ -5,7 +5,8 @@ module Program = (* WISDOM - Dealing with different device resolutions - Instead of rendering each component scaled to a back-buffer of a varying size, render each component unscaled to a off-screen - buffer of a static size and then blit that with scaling to the back-buffer. *) + buffer of a static size and then blit that with scaling to the back-buffer. NOTE: this only + applies to 2D ~ will not apply to 3D once implemented in Nu (for obvious reasons). *) (* WISDOM: From benchmarks. it looks like our mobile target will cost us anywhere from a 25% to 50% decrease in speed as compared to the dev machine. However, this can be mitigated in a few @@ -22,8 +23,6 @@ module Program = 1.2x gain - render tiles layers to their own buffer so that each whole layer can be blitted directly with a single draw call (though this might cause overdraw). ? gain - avoid rendering clear tiles! *) - (* WISDOM: Program types and behavior should be closed where possible and open where necessary. *) - (* WISDOM: On avoiding threads where possible... Beyond the cases where persistent threads are absolutely required or where transient threads @@ -45,7 +44,9 @@ module Program = (* WISDOM: On threading physics... A simulation that would put physics on another thread should likely do so in a different app - domain with communication via .NET remoting to make 100% sure that no sharing is happening. *) + domain with communication via .NET remoting to make 100% sure that no sharing is happening. + This should keep debugging easy and even possibly give a boost to GC latency what with + spreading collection pauses across two separate collectors. *) (* IDEA: Simplified networking... diff --git a/Nu/Nu/Nu/Serialization.fs b/Nu/Nu/Nu/Serialization.fs index bc715b61e5..d102c665db 100644 --- a/Nu/Nu/Nu/Serialization.fs +++ b/Nu/Nu/Nu/Serialization.fs @@ -125,7 +125,7 @@ module Serialization = tryReadPropertyToTarget node target /// Write an Xtension to Xml. - // NOTE: XmlWriter can also write to an XmlDocument / XmlNode instance by using + /// NOTE: XmlWriter can also write to an XmlDocument / XmlNode instance by using /// XmlWriter.Create <| (document.CreateNavigator ()).AppendChild () let writeXtension shouldWriteProperty (writer : XmlWriter) xtension = for xFieldKvp in xtension.XFields do diff --git a/Nu/Nu/Nu/Simulation.fs b/Nu/Nu/Nu/Simulation.fs index f0e10e280d..a41f2aa782 100644 --- a/Nu/Nu/Nu/Simulation.fs +++ b/Nu/Nu/Nu/Simulation.fs @@ -253,7 +253,7 @@ module SimulationModule = let xtension = Xtension.(?<-) (this.Xtension, memberName, value) { this with Xtension = xtension } - /// The screen type that allows transitioning to and fro other screens, and also hosts the + /// The screen type that allows transitioning to and from other screens, and also hosts the /// currently interactive groups of entities. and [] Screen = { Id : Guid diff --git a/Nu/Nu/Nu/WorldPrimitives.fs b/Nu/Nu/Nu/WorldPrimitives.fs index 49bba60f85..bf5c29e0eb 100644 --- a/Nu/Nu/Nu/WorldPrimitives.fs +++ b/Nu/Nu/Nu/WorldPrimitives.fs @@ -16,7 +16,8 @@ module World = let transformSimulants transform patoca simulants parentAddress world = Map.fold (fun (simulants, world) simulantName simulant -> - let (simulant, world) = transform simulant (patoca parentAddress simulantName) world + let childAddress = patoca parentAddress simulantName + let (simulant, world) = transform simulant childAddress world (Map.add simulantName simulant simulants, world)) (Map.empty, world) simulants diff --git a/Nu/Nu/Nu/Xtension.fs b/Nu/Nu/Nu/Xtension.fs index d345cf1709..61f4a3ae8c 100644 --- a/Nu/Nu/Nu/Xtension.fs +++ b/Nu/Nu/Nu/Xtension.fs @@ -24,6 +24,7 @@ module XtensionModule = { FieldName : string FieldType : Type } + /// An Xtension field. type [] XField = { FieldValue : obj FieldType : Type } @@ -84,7 +85,7 @@ module XtensionModule = /// let entity = entity.Position <- Vector2 (4.0, 5.0). static member (?<-) (xtension, fieldName, value : 'a) = #if DEBUG - // nop'ed outside of debug mode for efficiency + // NOTE: nop'ed outside of debug mode for efficiency // TODO: consider writing a 'Map.addDidContainKey' function to efficently add and return a // result that the key was already contained. if xtension.Sealed && not <| Map.containsKey fieldName xtension.XFields diff --git a/Prime/Prime/Prime/Interactive.fsx b/Prime/Prime/Prime/Interactive.fsx index 75e233c26f..93c02d2e81 100644 --- a/Prime/Prime/Prime/Interactive.fsx +++ b/Prime/Prime/Prime/Interactive.fsx @@ -35,4 +35,5 @@ open System open Prime +open Prime.Desync