Skip to content

Commit

Permalink
TODOs, NOTEs, and bits of clean-up.
Browse files Browse the repository at this point in the history
Former-commit-id: 35b5889
  • Loading branch information
bryanedds committed Jan 1, 2015
1 parent 4278676 commit 1ac89a6
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
8 changes: 6 additions & 2 deletions InfinityRpg/InfinityRpg/InfinityRpg/GameplayDispatcher.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -81,6 +83,8 @@ module GameplayDispatcherModule =
let entityAddresses = World.getEntityAddressesInGroup (getSceneAddress address) world
World.filterEntityAddresses (Entity.dispatchesAs typeof<EnemyDispatcher>) 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
Expand Down
2 changes: 1 addition & 1 deletion Nu/Nu/Nu/Entity.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions Nu/Nu/Nu/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion Nu/Nu/Nu/Serialization.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Nu/Nu/Nu/Simulation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [<CLIMutable; StructuralEquality; NoComparison>] Screen =
{ Id : Guid
Expand Down
3 changes: 2 additions & 1 deletion Nu/Nu/Nu/WorldPrimitives.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Nu/Nu/Nu/Xtension.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module XtensionModule =
{ FieldName : string
FieldType : Type }

/// An Xtension field.
type [<StructuralEquality; NoComparison>] XField =
{ FieldValue : obj
FieldType : Type }
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Prime/Prime/Prime/Interactive.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

open System
open Prime
open Prime.Desync

0 comments on commit 1ac89a6

Please sign in to comment.