[dasher] Make constants of LP_OX, LP_OY, LP_NORMALIZATION, LP_MAX_Y & m_iScalingFactor



commit 36a4e613188347b7db87eb6b461b085c3f74b598
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Fri Jun 24 15:43:41 2011 +0100

    Make constants of LP_OX, LP_OY, LP_NORMALIZATION, LP_MAX_Y & m_iScalingFactor
    
    LP_* now in CDasherModel: ORIGIN_X, ORIGIN_Y, MAX_Y, NORMALIZATION
    m_iScalingFactor (CDasherViewSquare) now SCALE_FACTOR & changed to 1<<26
    
    Aim to make it easier for compiler to constant-propagate and change
      multiply -> rightshift, divide -> leftshift. A quick check gcc -S
      reveals that (pre- and post- settings rewrite) a division by
      GetLongParameter(LP_NORMALIZATION) resulted in both a call and a full-blown
      division, whereas it is now a <<16. (=> LP_OX, LP_OY, LP_MAX_Y even more so
      as these could previously have been arbitrary values stored in user prefs
      file. Yes, am assuming no user actually wants different values for these 3!)

 Src/DasherCore/AlphabetManager.cpp       |   10 ++--
 Src/DasherCore/AlphabetManager.h         |    2 +-
 Src/DasherCore/AlternatingDirectMode.cpp |    8 +--
 Src/DasherCore/BasicLog.cpp              |    2 +-
 Src/DasherCore/BasicLog.h                |    5 +-
 Src/DasherCore/ButtonMode.cpp            |    2 +-
 Src/DasherCore/CircleStartHandler.cpp    |    6 +-
 Src/DasherCore/ClickFilter.cpp           |    9 +--
 Src/DasherCore/CompassMode.cpp           |   31 ++-------
 Src/DasherCore/ControlManager.cpp        |    3 +-
 Src/DasherCore/ConversionHelper.cpp      |    8 +-
 Src/DasherCore/ConversionHelper.h        |    2 +-
 Src/DasherCore/ConversionManager.cpp     |    7 +--
 Src/DasherCore/ConversionManager.h       |    4 +-
 Src/DasherCore/DasherModel.cpp           |   55 +++++++--------
 Src/DasherCore/DasherModel.h             |    3 +
 Src/DasherCore/DasherNode.h              |    2 +-
 Src/DasherCore/DasherViewSquare.cpp      |  111 +++++++++++++-----------------
 Src/DasherCore/DasherViewSquare.h        |    9 ++-
 Src/DasherCore/DasherViewSquare.inl      |   22 +++---
 Src/DasherCore/DefaultFilter.cpp         |   24 +++---
 Src/DasherCore/DynamicFilter.h           |    1 +
 Src/DasherCore/GameModule.cpp            |    4 +-
 Src/DasherCore/MandarinAlphMgr.cpp       |    4 +-
 Src/DasherCore/MandarinAlphMgr.h         |    2 +-
 Src/DasherCore/NodeCreationManager.cpp   |    7 +-
 Src/DasherCore/OneDimensionalFilter.cpp  |   22 +++---
 Src/DasherCore/Parameters.cpp            |    4 -
 Src/DasherCore/Parameters.h              |    4 +-
 Src/DasherCore/UserLog.cpp               |    4 +-
 Src/DasherCore/UserLog.h                 |    2 +-
 Src/DasherCore/UserLogBase.cpp           |    6 +-
 Src/DasherCore/UserLogBase.h             |    4 +-
 33 files changed, 175 insertions(+), 214 deletions(-)
---
diff --git a/Src/DasherCore/AlphabetManager.cpp b/Src/DasherCore/AlphabetManager.cpp
index 9dc76d6..9f8d5e4 100644
--- a/Src/DasherCore/AlphabetManager.cpp
+++ b/Src/DasherCore/AlphabetManager.cpp
@@ -507,7 +507,7 @@ void CAlphabetManager::IterateChildGroups(CAlphNode *pParent, const SGroupInfo *
   DASHER_ASSERT((*pCProb)[0] == 0);
   const int iMin(pParentGroup ? pParentGroup->iStart : 1);
   const int iMax(pParentGroup ? pParentGroup->iEnd : m_pAlphabet->GetNumberTextSymbols()+1);
-  unsigned int iRange(pParentGroup ? ((*pCProb)[iMax-1] - (*pCProb)[iMin-1]) : GetLongParameter(LP_NORMALIZATION));
+  unsigned int iRange(pParentGroup ? ((*pCProb)[iMax-1] - (*pCProb)[iMin-1]) : CDasherModel::NORMALIZATION);
 
   // TODO: Think through alphabet file formats etc. to make this class easier.
   // TODO: Throw a warning if parent node already has children
@@ -525,10 +525,10 @@ void CAlphabetManager::IterateChildGroups(CAlphNode *pParent, const SGroupInfo *
     const int iStart=i, iEnd = (bSymbol) ? i+1 : pCurrentNode->iEnd;
     //uint64 is platform-dependently #defined in DasherTypes.h as an (unsigned) 64-bit int ("__int64" or "long long int")
     unsigned int iLbnd = (((*pCProb)[iStart-1] - (*pCProb)[iMin-1]) *
-                          (uint64)(GetLongParameter(LP_NORMALIZATION))) /
+                          static_cast<uint64>(CDasherModel::NORMALIZATION)) /
                          iRange;
     unsigned int iHbnd = (((*pCProb)[iEnd-1] - (*pCProb)[iMin-1]) *
-                          (uint64)(GetLongParameter(LP_NORMALIZATION))) /
+                          static_cast<uint64>(CDasherModel::NORMALIZATION)) /
                          iRange;
     if (bSymbol) {
       pNewChild = (buildAround) ? buildAround->RebuildSymbol(pParent, iLbnd, iHbnd, i) : CreateSymbolNode(pParent, iLbnd, iHbnd, i);
@@ -599,9 +599,9 @@ void CAlphabetManager::CSymbolNode::Output() {
   m_pMgr->m_pInterface->editOutput(outputText(), this);
 }
 
-SymbolProb CAlphabetManager::CSymbolNode::GetSymbolProb(int iNormalization) const {
+SymbolProb CAlphabetManager::CSymbolNode::GetSymbolProb() const {
   //TODO probability here not right - Range() is relative to parent, not prev symbol
-  return Dasher::SymbolProb(iSymbol, m_pMgr->m_pAlphabet->GetText(iSymbol), Range() / (double)iNormalization);
+  return Dasher::SymbolProb(iSymbol, m_pMgr->m_pAlphabet->GetText(iSymbol), Range() / (double)CDasherModel::NORMALIZATION);
 }
 
 void CAlphabetManager::CSymbolNode::Undo() {
diff --git a/Src/DasherCore/AlphabetManager.h b/Src/DasherCore/AlphabetManager.h
index 7e9f4af..9b277a8 100644
--- a/Src/DasherCore/AlphabetManager.h
+++ b/Src/DasherCore/AlphabetManager.h
@@ -155,7 +155,7 @@ namespace Dasher {
       virtual void Output();
       virtual void Undo();
       ///Override to provide symbol number, probability, _edit_ text from alphabet
-      virtual SymbolProb GetSymbolProb(int iNormalization) const;
+      virtual SymbolProb GetSymbolProb() const;
 
       virtual void SetFlag(int iFlag, bool bValue);
 
diff --git a/Src/DasherCore/AlternatingDirectMode.cpp b/Src/DasherCore/AlternatingDirectMode.cpp
index f6cf6e0..41e7275 100644
--- a/Src/DasherCore/AlternatingDirectMode.cpp
+++ b/Src/DasherCore/AlternatingDirectMode.cpp
@@ -35,8 +35,6 @@ CAlternatingDirectMode::CAlternatingDirectMode(CSettingsUser *pCreator, CDasherI
 
 void CAlternatingDirectMode::SetupBoxes()
 {
-  int iDasherY(GetLongParameter(LP_MAX_Y));
-
   m_pBoxes = new SBoxInfo[m_iNumBoxes = 5];
 
   // Fast boxes
@@ -63,10 +61,10 @@ void CAlternatingDirectMode::SetupBoxes()
   m_pBoxes[3].iDisplayBottom = m_pBoxes[3].iBottom;
 
   m_pBoxes[m_iNumBoxes-1].iDisplayTop = 0;
-  m_pBoxes[m_iNumBoxes-1].iDisplayBottom = iDasherY;
+  m_pBoxes[m_iNumBoxes-1].iDisplayBottom = CDasherModel::MAX_Y;
 
-  m_pBoxes[m_iNumBoxes-1].iTop = int(- iDasherY / 2);
-  m_pBoxes[m_iNumBoxes-1].iBottom = int(iDasherY * 1.5);
+  m_pBoxes[m_iNumBoxes-1].iTop = int(- CDasherModel::MAX_Y / 2);
+  m_pBoxes[m_iNumBoxes-1].iBottom = int(CDasherModel::MAX_Y * 1.5);
 
   m_iLastBox = -1;
 }
diff --git a/Src/DasherCore/BasicLog.cpp b/Src/DasherCore/BasicLog.cpp
index 6bb4677..4550bb7 100644
--- a/Src/DasherCore/BasicLog.cpp
+++ b/Src/DasherCore/BasicLog.cpp
@@ -14,7 +14,7 @@
 
 using namespace Dasher;
 
-CBasicLog::CBasicLog(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pIntf) : CUserLogBase(pCreateFrom, pIntf) {
+CBasicLog::CBasicLog(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pIntf) : CSettingsUser(pCreateFrom), CUserLogBase(pIntf) {
   m_iSymbolCount = 0;
   m_bStarted = false;
 }
diff --git a/Src/DasherCore/BasicLog.h b/Src/DasherCore/BasicLog.h
index 49e4aec..7c07842 100644
--- a/Src/DasherCore/BasicLog.h
+++ b/Src/DasherCore/BasicLog.h
@@ -2,12 +2,13 @@
 #define __BasicLog_h__
 
 #include "UserLogBase.h"
+#include "SettingsStore.h"
 
 /// \ingroup Logging
 /// @{
-class CBasicLog : public CUserLogBase {
+class CBasicLog : protected Dasher::CSettingsUser, public CUserLogBase {
  public:
-  CBasicLog(Dasher::CSettingsUser *pCreateFrom, Dasher::CDasherInterfaceBase *pIntf);
+  CBasicLog(CSettingsUser *pCreateFrom, Dasher::CDasherInterfaceBase *pIntf);
   ~CBasicLog();
 
   virtual void AddParam(const string& strName, const string& strValue, int iOptionMask = 0) {};
diff --git a/Src/DasherCore/ButtonMode.cpp b/Src/DasherCore/ButtonMode.cpp
index 2ec74c6..4a55f0c 100644
--- a/Src/DasherCore/ButtonMode.cpp
+++ b/Src/DasherCore/ButtonMode.cpp
@@ -46,7 +46,7 @@ CButtonMode::CButtonMode(CSettingsUser *pCreator, CDasherInterfaceBase *pInterfa
 
 void CButtonMode::SetupBoxes()
 {
-  int iDasherY(GetLongParameter(LP_MAX_Y));
+  int iDasherY(CDasherModel::MAX_Y);
 
   int iForwardBoxes(GetLongParameter(LP_B));
   m_pBoxes = new SBoxInfo[m_iNumBoxes = iForwardBoxes+1];
diff --git a/Src/DasherCore/CircleStartHandler.cpp b/Src/DasherCore/CircleStartHandler.cpp
index fc27cf7..13b13c1 100644
--- a/Src/DasherCore/CircleStartHandler.cpp
+++ b/Src/DasherCore/CircleStartHandler.cpp
@@ -39,13 +39,13 @@ void CCircleStartHandler::ComputeScreenLoc(CDasherView *pView) {
     if (m_pView) m_pView->Observable<CDasherView*>::Unregister(this);
     (m_pView=pView)->Observable<CDasherView*>::Register(this);
   } else if (m_iScreenRadius!=-1) return;
-  
-  pView->Dasher2Screen(GetLongParameter(LP_OX),GetLongParameter(LP_OY),m_screenCircleCenter.x,m_screenCircleCenter.y);
+
+  pView->Dasher2Screen(CDasherModel::ORIGIN_X, CDasherModel::ORIGIN_Y, m_screenCircleCenter.x, m_screenCircleCenter.y);
   //compute radius against orientation. It'd be simpler to use
   // Math.min(screen width, screen height) * LP_CIRCLE_PERCENT / 100
   // - should we?
   screenint iEdgeX, iEdgeY;
-  pView->Dasher2Screen(GetLongParameter(LP_OX), GetLongParameter(LP_OY) + (GetLongParameter(LP_MAX_Y)*GetLongParameter(LP_CIRCLE_PERCENT))/100, iEdgeX, iEdgeY);
+  pView->Dasher2Screen(CDasherModel::ORIGIN_X, CDasherModel::ORIGIN_Y + (CDasherModel::MAX_Y*GetLongParameter(LP_CIRCLE_PERCENT))/100, iEdgeX, iEdgeY);
 
   const Opts::ScreenOrientations iDirection(pView->GetOrientation());
 
diff --git a/Src/DasherCore/ClickFilter.cpp b/Src/DasherCore/ClickFilter.cpp
index d7be0f2..bf26554 100644
--- a/Src/DasherCore/ClickFilter.cpp
+++ b/Src/DasherCore/ClickFilter.cpp
@@ -62,19 +62,18 @@ CZoomAdjuster::CZoomAdjuster(CSettingsUser *pCreateFrom) : CSettingsUser(pCreate
 }
 
 void CZoomAdjuster::AdjustZoomCoords(myint &iDasherX, myint &iDasherY, CDasherView *pView) {
-  const myint ox(GetLongParameter(LP_OX)), safety(GetLongParameter(LP_S));
+  const myint safety(GetLongParameter(LP_S));
   //safety param. Used to be just added onto DasherX,
   // but comments suggested should be interpreted as a fraction. Hence...
-  myint iNewDasherX = (iDasherX*1024 + ox*safety) / (1024+safety);
+  myint iNewDasherX = (iDasherX*1024 + CDasherModel::ORIGIN_X*safety) / (1024+safety);
 
   //max zoom parameter...
-  iNewDasherX = std::max(ox/GetLongParameter(LP_MAXZOOM),iNewDasherX);
+  iNewDasherX = std::max(CDasherModel::ORIGIN_X/GetLongParameter(LP_MAXZOOM),iNewDasherX);
   //force x>=2 (what's wrong with x==1?)
   if (iNewDasherX<2) iNewDasherX=2;
   if (iNewDasherX != iDasherX) {
     //compute new dasher y to keep centre of expansion in same place...
-    const myint oy(GetLongParameter(LP_OY));
-    myint iNewDasherY = oy + ((ox-iNewDasherX) * (iDasherY-oy))/(ox-iDasherX);
+    myint iNewDasherY = CDasherModel::ORIGIN_Y + ((CDasherModel::ORIGIN_X-iNewDasherX) * (iDasherY-CDasherModel::ORIGIN_Y))/(CDasherModel::ORIGIN_X-iDasherX);
     iDasherX = iNewDasherX; iDasherY = iNewDasherY;
   }
 }
diff --git a/Src/DasherCore/CompassMode.cpp b/Src/DasherCore/CompassMode.cpp
index 5ac50d3..be2d07c 100644
--- a/Src/DasherCore/CompassMode.cpp
+++ b/Src/DasherCore/CompassMode.cpp
@@ -39,11 +39,9 @@ CCompassMode::CCompassMode(CSettingsUser *pCreator, CDasherInterfaceBase *pInter
 
 void CCompassMode::SetupBoxes()
 {
-  int iDasherY(GetLongParameter(LP_MAX_Y));
-
   m_pBoxes = new SBoxInfo[m_iNumBoxes = 4];
 
-  iTargetWidth = iDasherY * 1024 / GetLongParameter(LP_RIGHTZOOM);
+  iTargetWidth = CDasherModel::MAX_Y * 1024 / GetLongParameter(LP_RIGHTZOOM);
 
   // FIXME - need to relate these to cross-hair position as stored in the parameters
 
@@ -58,9 +56,9 @@ void CCompassMode::SetupBoxes()
   m_pBoxes[3].iBottom = 4096 - m_pBoxes[3].iTop;
 
   m_pBoxes[0].iTop = -iTargetWidth;
-  m_pBoxes[0].iBottom = iDasherY - iTargetWidth;
+  m_pBoxes[0].iBottom = CDasherModel::MAX_Y - iTargetWidth;
   m_pBoxes[2].iTop = iTargetWidth;
-  m_pBoxes[2].iBottom = iDasherY + iTargetWidth;
+  m_pBoxes[2].iBottom = CDasherModel::MAX_Y + iTargetWidth;
 
   m_pBoxes[0].iDisplayTop = m_pBoxes[0].iTop;
   m_pBoxes[0].iDisplayBottom = m_pBoxes[0].iBottom;
@@ -82,33 +80,18 @@ bool CCompassMode::DecorateView(CDasherView *pView, CDasherInput *pInput) {
   while(iPos >= 0) {
     CDasherScreen::point p[2];
 
-    myint iDasherX;
-    myint iDasherY;
-
-    iDasherX = -100;
-    iDasherY = iPos;
-
-    pView->Dasher2Screen(iDasherX, iDasherY, p[0].x, p[0].y);
+    pView->Dasher2Screen(-100, iPos, p[0].x, p[0].y);
 
-    iDasherX = -1000;
-    iDasherY = iPos;
-
-    pView->Dasher2Screen(iDasherX, iDasherY, p[1].x, p[1].y);
+    pView->Dasher2Screen(-1000, iPos, p[1].x, p[1].y);
 
     if(bFirst)
       pScreen->Polyline(p, 2, 1, 1);
     else
       pScreen->Polyline(p, 2, 1, 2);
 
-    iDasherX = -100;
-    iDasherY = 4096 - iPos;
-
-    pView->Dasher2Screen(iDasherX, iDasherY, p[0].x, p[0].y);
-
-    iDasherX = -1000;
-    iDasherY = 4096 - iPos;
+    pView->Dasher2Screen(-100, 4096-iPos, p[0].x, p[0].y);
 
-    pView->Dasher2Screen(iDasherX, iDasherY, p[1].x, p[1].y);
+    pView->Dasher2Screen(-1000, 4096-iPos, p[1].x, p[1].y);
 
     if(bFirst)
       pScreen->Polyline(p, 2, 1, 1);
diff --git a/Src/DasherCore/ControlManager.cpp b/Src/DasherCore/ControlManager.cpp
index c59d9c4..5e8828b 100644
--- a/Src/DasherCore/ControlManager.cpp
+++ b/Src/DasherCore/ControlManager.cpp
@@ -96,12 +96,11 @@ void CControlBase::CContNode::PopulateChildren() {
   CDasherNode *pNewNode;
 
   const unsigned int iNChildren( m_pTemplate->successors.size() );
-  const unsigned int iNorm(m_pMgr->GetLongParameter(LP_NORMALIZATION));
   unsigned int iLbnd(0), iIdx(0);
 
   for (vector<NodeTemplate *>::iterator it = m_pTemplate->successors.begin(); it!=m_pTemplate->successors.end(); it++) {
 
-    const unsigned int iHbnd((++iIdx*iNorm)/iNChildren);
+    const unsigned int iHbnd((++iIdx*CDasherModel::NORMALIZATION)/iNChildren);
 
     if( *it == NULL ) {
       // Escape back to alphabet
diff --git a/Src/DasherCore/ConversionHelper.cpp b/Src/DasherCore/ConversionHelper.cpp
index 7f7d4f5..9e62a0e 100644
--- a/Src/DasherCore/ConversionHelper.cpp
+++ b/Src/DasherCore/ConversionHelper.cpp
@@ -41,8 +41,8 @@
 using namespace Dasher;
 using namespace std;
 
-CConversionHelper::CConversionHelper(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet, CLanguageModel *pLanguageModel) :
-  CConversionManager(pCreateFrom, pInterface, pNCManager, pAlphabet), m_pLanguageModel(pLanguageModel) {
+CConversionHelper::CConversionHelper(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet, CLanguageModel *pLanguageModel)
+: CSettingsUser(pCreateFrom), CConversionManager(pInterface, pNCManager, pAlphabet), m_pLanguageModel(pLanguageModel) {
 	  colourStore[0][0]=66;//light blue
 	  colourStore[0][1]=64;//very light green
 	  colourStore[0][2]=62;//light yellow
@@ -76,7 +76,7 @@ CConversionManager::CConvNode *CConversionHelper::GetRoot(CDasherNode *pParent,
 
 void CConversionHelper::AssignChildSizes(const std::vector<SCENode *> &nodes, CLanguageModel::Context context) {
 
-  AssignSizes(nodes, context, GetLongParameter(LP_NORMALIZATION), GetLongParameter(LP_UNIFORM));
+  AssignSizes(nodes, context, CDasherModel::NORMALIZATION, GetLongParameter(LP_UNIFORM));
 
 }
 
@@ -113,7 +113,7 @@ void CConversionHelper::CConvHNode::PopulateChildren() {
       DASHER_ASSERT(pCurrentSCEChild != NULL);
       unsigned int iLbnd(iCum);
       unsigned int iHbnd(iCum + pCurrentSCEChild->NodeSize);
-		//GetLongParameter(LP_NORMALIZATION));//
+		//CDasherModel::NORMALIZATION);//
 
       iCum = iHbnd;
 
diff --git a/Src/DasherCore/ConversionHelper.h b/Src/DasherCore/ConversionHelper.h
index 8438240..d7a6bf6 100644
--- a/Src/DasherCore/ConversionHelper.h
+++ b/Src/DasherCore/ConversionHelper.h
@@ -40,7 +40,7 @@ namespace Dasher{
 /// well as assigning weights to each of the predictions. See
 /// CConversionManager for further details of the conversion process.
 ///
-  class CConversionHelper : public CConversionManager {
+  class CConversionHelper : protected CSettingsUser, public CConversionManager {
   public:
 	CConversionHelper(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet, CLanguageModel *pLanguageModel);
 
diff --git a/Src/DasherCore/ConversionManager.cpp b/Src/DasherCore/ConversionManager.cpp
index 6a4aca5..01578ed 100644
--- a/Src/DasherCore/ConversionManager.cpp
+++ b/Src/DasherCore/ConversionManager.cpp
@@ -41,7 +41,7 @@
 using namespace Dasher;
 using namespace std;
 
-CConversionManager::CConversionManager(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet) : CSettingsUser(pCreateFrom) {
+CConversionManager::CConversionManager(CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet) {
   m_pInterface = pInterface;
   m_pNCManager = pNCManager;
   m_pAlphabet = pAlphabet;
@@ -110,10 +110,7 @@ void CConversionManager::CConvNode::PopulateChildren() {
   // alphabet root. This should only happen in error cases, and the
   // user should have been warned here.
   //
-  unsigned int iLbnd(0);
-  unsigned int iHbnd(m_pMgr->GetLongParameter(LP_NORMALIZATION));
-
-  CDasherNode *pNewNode = m_pMgr->m_pNCManager->GetAlphabetManager()->GetRoot(this, iLbnd, iHbnd, false, offset() + 1);
+  CDasherNode *pNewNode = m_pMgr->m_pNCManager->GetAlphabetManager()->GetRoot(this, 0, CDasherModel::NORMALIZATION, false, offset() + 1);
 
   DASHER_ASSERT(GetChildren().back()==pNewNode);
 }
diff --git a/Src/DasherCore/ConversionManager.h b/Src/DasherCore/ConversionManager.h
index a32b20d..8758cb6 100644
--- a/Src/DasherCore/ConversionManager.h
+++ b/Src/DasherCore/ConversionManager.h
@@ -60,9 +60,9 @@ namespace Dasher {
   /// aspects of conversion, and CNodeManager for details of the node
   /// management process.
   ///
-  class CConversionManager : public CNodeManager, protected CSettingsUser {
+  class CConversionManager : public CNodeManager {
   public:
-    CConversionManager(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet);
+    CConversionManager(CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, const CAlphInfo *pAlphabet);
 
     ///Tells us to use the specified screen to create node labels.
     /// (note we cache the screen and create labels lazily)
diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp
index 7db4376..73e6bf5 100644
--- a/Src/DasherCore/DasherModel.cpp
+++ b/Src/DasherCore/DasherModel.cpp
@@ -73,9 +73,8 @@ CDasherModel::CDasherModel(CSettingsUser *pCreateFrom,
 
   m_dAddProb = 0.003;
 
-  int iNormalization = GetLongParameter(LP_NORMALIZATION);
-  m_Rootmin_min = int64_min / iNormalization / 2;
-  m_Rootmax_max = int64_max / iNormalization / 2;
+  m_Rootmin_min = int64_min / NORMALIZATION / 2;
+  m_Rootmax_max = int64_max / NORMALIZATION / 2;
 
 }
 
@@ -131,15 +130,15 @@ void CDasherModel::Make_root(CDasherNode *pNewRoot) {
 
   // Update the root coordinates, as well as any currently scheduled locations
   const myint range = m_Rootmax - m_Rootmin;
-  m_Rootmax = m_Rootmin + (range * m_Root->Hbnd()) / GetLongParameter(LP_NORMALIZATION);
-  m_Rootmin = m_Rootmin + (range * m_Root->Lbnd()) / GetLongParameter(LP_NORMALIZATION);
+  m_Rootmax = m_Rootmin + (range * m_Root->Hbnd()) / NORMALIZATION;
+  m_Rootmin = m_Rootmin + (range * m_Root->Lbnd()) / NORMALIZATION;
 
   for(std::deque<SGotoItem>::iterator it(m_deGotoQueue.begin()); it != m_deGotoQueue.end(); ++it) {
     //Some of these co-ordinate pairs can be bigger than m_Rootmin_min - m_Rootmax_max,
     // hence using unsigned type...
     const uint64 r = it->iN2 - it->iN1;
-    it->iN2 = it->iN1 + (r * m_Root->Hbnd()) / GetLongParameter(LP_NORMALIZATION);
-    it->iN1 = it->iN1 + (r * m_Root->Lbnd()) / GetLongParameter(LP_NORMALIZATION);
+    it->iN2 = it->iN1 + (r * m_Root->Hbnd()) / NORMALIZATION;
+    it->iN1 = it->iN1 + (r * m_Root->Lbnd()) / NORMALIZATION;
   }
 }
 
@@ -177,7 +176,7 @@ bool CDasherModel::Reparent_root() {
   myint iRootWidth(m_Rootmax - m_Rootmin);
 
   // Fail if the new root is bigger than allowed by normalisation
-  if(((myint((GetLongParameter(LP_NORMALIZATION) - upper)) / static_cast<double>(iRange)) >
+  if(((myint(NORMALIZATION - upper) / static_cast<double>(iRange)) >
            (m_Rootmax_max - m_Rootmax)/static_cast<double>(iRootWidth)) ||
       ((myint(lower) / static_cast<double>(iRange)) >
            (m_Rootmin - m_Rootmin_min) / static_cast<double>(iRootWidth))) {
@@ -193,12 +192,12 @@ bool CDasherModel::Reparent_root() {
   DASHER_ASSERT(pNewRoot->GetFlag(NF_SEEN));
   m_Root = pNewRoot;
 
-  m_Rootmax = m_Rootmax + ((GetLongParameter(LP_NORMALIZATION) - upper) * iRootWidth) / iRange;
+  m_Rootmax = m_Rootmax + ((NORMALIZATION - upper) * iRootWidth) / iRange;
   m_Rootmin = m_Rootmin - (lower * iRootWidth) / iRange;
 
   for(std::deque<SGotoItem>::iterator it(m_deGotoQueue.begin()); it != m_deGotoQueue.end(); ++it) {
     iRootWidth = it->iN2 - it->iN1;
-    it->iN2 = it->iN2 + (myint((GetLongParameter(LP_NORMALIZATION) - upper)) * iRootWidth / iRange);
+    it->iN2 = it->iN2 + (myint(NORMALIZATION - upper) * iRootWidth / iRange);
     it->iN1 = it->iN1 - (myint(lower) * iRootWidth / iRange);
   }
   return true;
@@ -227,7 +226,7 @@ void CDasherModel::SetOffset(int iOffset, CAlphabetManager *pMgr, CDasherView *p
   ClearRootQueue();
   delete m_Root;
 
-  m_Root = pMgr->GetRoot(NULL, 0,GetLongParameter(LP_NORMALIZATION), iOffset!=0, iOffset);
+  m_Root = pMgr->GetRoot(NULL, 0, NORMALIZATION, iOffset!=0, iOffset);
   if (iOffset) {
     //there were preceding characters. It's nonetheless possible that they weren't
     // part of the current alphabet, and so we may have got a simple group node as root,
@@ -251,16 +250,16 @@ void CDasherModel::SetOffset(int iOffset, CAlphabetManager *pMgr, CDasherView *p
   // Set the root coordinates so that the root node is an appropriate
   // size and we're not in any of the children
 
-  double dFraction( 1 - (1 - m_Root->MostProbableChild() / static_cast<double>(GetLongParameter(LP_NORMALIZATION))) / 2.0 );
+  double dFraction( 1 - (1 - m_Root->MostProbableChild() / static_cast<double>(NORMALIZATION)) / 2.0 );
 
   //TODO somewhere round here, old code checked whether the InputFilter implemented
   // GetMinWidth, if so called LimitRoot w/that width - i.e., make sure iWidth
   // is no more than that minimum. Should we do something similar here???
 
-  int iWidth( static_cast<int>( (GetLongParameter(LP_MAX_Y) / (2.0*dFraction)) ) );
+  int iWidth( static_cast<int>( MAX_Y / (2.0*dFraction) ) );
 
-  m_Rootmin = GetLongParameter(LP_MAX_Y) / 2 - iWidth / 2;
-  m_Rootmax = GetLongParameter(LP_MAX_Y) / 2 + iWidth / 2;
+  m_Rootmin = MAX_Y / 2 - iWidth / 2;
+  m_Rootmax = MAX_Y / 2 + iWidth / 2;
 
   m_iDisplayOffset = 0;
 
@@ -300,17 +299,15 @@ void CDasherModel::Get_new_root_coords(dasherint X, dasherint Y, dasherint &r1,
   const dasherint R1 = m_Rootmin;
   const dasherint R2 = m_Rootmax;
   // const dasherint Y1 = 0;
-  dasherint Y2(GetLongParameter(LP_MAX_Y));
-  dasherint iOX(GetLongParameter(LP_OX));
-  dasherint iOY(GetLongParameter(LP_OY));
+  const dasherint Y2(MAX_Y);
 
 
   // Calculate what the extremes of the viewport will be when the
   // point under the cursor is at the cross-hair. This is where
   // we want to be in iSteps updates
 
-  dasherint y1(Y - (Y2 * X) / (2 * iOX));
-  dasherint y2(Y + (Y2 * X) / (2 * iOY));
+  dasherint y1(Y - (Y2 * X) / (2 * ORIGIN_X));
+  dasherint y2(Y + (Y2 * X) / (2 * ORIGIN_Y));
   dasherint oy1(y1),oy2(y2); //back these up to use later
   // iSteps is the number of update steps we need to get the point
   // under the cursor over to the cross hair. Calculated in order to
@@ -415,8 +412,8 @@ void CDasherModel::UpdateBounds(myint newRootmin, myint newRootmax, unsigned lon
     const myint iWidth(m_Rootmax-m_Rootmin);
     for (CDasherNode::ChildMap::const_iterator it = m_Root->GetChildren().begin(), E = m_Root->GetChildren().end(); ;) {
       CDasherNode *pChild(*it);
-      DASHER_ASSERT(m_Rootmin + ((pChild->Lbnd() * iWidth) / GetLongParameter(LP_NORMALIZATION)) <= GetLongParameter(LP_OY));
-      if (m_Rootmin + ((pChild->Hbnd() * iWidth) / GetLongParameter(LP_NORMALIZATION)) > GetLongParameter(LP_OY)) {
+      DASHER_ASSERT(m_Rootmin + ((pChild->Lbnd() * iWidth) / NORMALIZATION) <= ORIGIN_Y);
+      if (m_Rootmin + ((pChild->Hbnd() * iWidth) / NORMALIZATION) > ORIGIN_Y) {
         //found child to make root. proceed only if new root is on the game path....
         if (GetBoolParameter(BP_GAME_MODE) && !pChild->GetFlag(NF_GAME)) {
           //If the user's strayed that far off the game path,
@@ -440,7 +437,7 @@ void CDasherModel::UpdateBounds(myint newRootmin, myint newRootmax, unsigned lon
         //...we can retrieve new, equivalent, coordinates for it
         newRootmin = m_deGotoQueue.back().iN1; newRootmax = m_deGotoQueue.back().iN2;
         m_deGotoQueue.pop_back();
-        // (note that the next check below will make sure these coords do cover (0, LP_OY))
+        // (note that the next check below will make sure these coords do cover (0, ORIGIN_Y))
         break;
       }
       ++it;
@@ -451,15 +448,15 @@ void CDasherModel::UpdateBounds(myint newRootmin, myint newRootmax, unsigned lon
   // Check that we haven't drifted too far. The rule is that we're not
   // allowed to let the root max and min cross the midpoint of the
   // screen.
-  newRootmin = min(newRootmin, (myint)GetLongParameter(LP_OY) - 1 - m_iDisplayOffset);
-  newRootmax = max(newRootmax, (myint)GetLongParameter(LP_OY) + 1 - m_iDisplayOffset);
+  newRootmin = min(newRootmin, ORIGIN_Y - 1 - m_iDisplayOffset);
+  newRootmax = max(newRootmax, ORIGIN_Y + 1 - m_iDisplayOffset);
 
   // Only allow the update if it won't make the
   // root too small. We should have re-generated a deeper root
   // before now already, but the original root is an exception.
   // (as is trying to go back beyond the earliest char in the current
   // alphabet, if there are preceding characters not in that alphabet)
-  if ((newRootmax - newRootmin) > (myint)GetLongParameter(LP_MAX_Y) / 4) {
+  if ((newRootmax - newRootmin) > MAX_Y / 4) {
     m_Rootmax = newRootmax;
     m_Rootmin = newRootmin;
   } //else, we just stop - this prevents the user from zooming too far back
@@ -566,7 +563,7 @@ void CDasherModel::ScheduleZoom(long time, dasherint y1, dasherint y2) {
 
   // Rename for readability.
   const dasherint Y1 = 0;
-  const dasherint Y2 = GetLongParameter(LP_MAX_Y);
+  const dasherint Y2 = MAX_Y;
   const dasherint R1 = m_Rootmin;
   const dasherint R2 = m_Rootmax;
 
@@ -629,7 +626,7 @@ void CDasherModel::AbortOffset() {
 }
 
 void CDasherModel::LimitRoot(int iMaxWidth) {
-  m_Rootmin = GetLongParameter(LP_MAX_Y) / 2 - iMaxWidth / 2;
-  m_Rootmax = GetLongParameter(LP_MAX_Y) / 2 + iMaxWidth / 2;
+  m_Rootmin = ORIGIN_Y - iMaxWidth / 2;
+  m_Rootmax = ORIGIN_Y + iMaxWidth / 2;
 }
 
diff --git a/Src/DasherCore/DasherModel.h b/Src/DasherCore/DasherModel.h
index e45df0d..01070a4 100644
--- a/Src/DasherCore/DasherModel.h
+++ b/Src/DasherCore/DasherModel.h
@@ -64,6 +64,9 @@ namespace Dasher {
 class Dasher::CDasherModel:public Dasher::CFrameRate, public Observable<CDasherNode*>, private NoClones
 {
  public:
+  static const unsigned int NORMALIZATION = 1<<16;
+  static const myint ORIGIN_X=2048, ORIGIN_Y=2048, MAX_Y=4096;
+
   /// Constructs a new CDasherModel. Note, must be followed by a call to
   /// SetOffset() before the model can be used.
   CDasherModel(CSettingsUser *pCreateFrom, CDasherInterfaceBase *pDashIface);
diff --git a/Src/DasherCore/DasherNode.h b/Src/DasherCore/DasherNode.h
index e069606..b48cfb5 100644
--- a/Src/DasherCore/DasherNode.h
+++ b/Src/DasherCore/DasherNode.h
@@ -245,7 +245,7 @@ class Dasher::CDasherNode:private NoClones {
   /// output. Subclasses performing output, should override to return appropriate
   /// information. (Will only be called if necessary i.e. logging enabled).
   /// The default returns a very uninformative SymbolProb with just display text.
-  virtual SymbolProb GetSymbolProb(int iNormalization) const {
+  virtual SymbolProb GetSymbolProb() const {
     return SymbolProb(0,m_pLabel->m_strText,0.0);
   }
 
diff --git a/Src/DasherCore/DasherViewSquare.cpp b/Src/DasherCore/DasherViewSquare.cpp
index 285575b..89e4092 100644
--- a/Src/DasherCore/DasherViewSquare.cpp
+++ b/Src/DasherCore/DasherViewSquare.cpp
@@ -57,7 +57,7 @@ static char THIS_FILE[] = __FILE__;
 // FIXME - duplicated 'mode' code throught - needs to be fixed (actually, mode related stuff, Input2Dasher etc should probably be at least partially in some other class)
 
 CDasherViewSquare::CDasherViewSquare(CSettingsUser *pCreateFrom, CDasherScreen *DasherScreen, Opts::ScreenOrientations orient)
-: CDasherView(DasherScreen,orient), CSettingsUserObserver(pCreateFrom), m_Y1(4), m_Y2(0.95 * GetLongParameter(LP_MAX_Y)), m_Y3(0.05 * GetLongParameter((LP_MAX_Y))), m_bVisibleRegionValid(false) {
+: CDasherView(DasherScreen,orient), CSettingsUserObserver(pCreateFrom), m_Y1(4), m_Y2(0.95 * CDasherModel::MAX_Y), m_Y3(0.05 * CDasherModel::MAX_Y), m_bVisibleRegionValid(false) {
 
   //Note, nonlinearity parameters set in SetScaleFactor
   ScreenResized(DasherScreen);
@@ -134,7 +134,7 @@ CDasherNode *CDasherViewSquare::Render(CDasherNode *pRoot, myint iRootMin, myint
   m_DelayedTexts.clear();
 
   // Finally decorate the view
-  Crosshair((myint)GetLongParameter(LP_OX));
+  Crosshair();
   return pOutput;
 }
 
@@ -150,7 +150,7 @@ CDasherViewSquare::CTextString *CDasherViewSquare::DasherDrawText(myint iDasherM
   //compute font size...
   int iSize = GetLongParameter(LP_DASHER_FONTSIZE);
   {
-    const myint iMaxY(GetLongParameter(LP_MAX_Y));
+    const myint iMaxY(CDasherModel::MAX_Y);
     if (Screen()->MultiSizeFonts() && iSize>4) {
       //font size maxes out at ((iMaxY*3)/2)+iMaxY)/iMaxY = 3/2*smallest
       // which is reached when iDasherMaxX == iMaxY/2, i.e. the crosshair
@@ -487,7 +487,7 @@ void CDasherViewSquare::DisjointRender(CDasherNode *pRender, myint y1, myint y2,
   const myint Range(y2-y1);
 
   //Does node cover crosshair?
-  if (pOutput == pRender->Parent() && Range > GetLongParameter(LP_OX) && y1 < GetLongParameter(LP_OY) && y2 > GetLongParameter(LP_OY)) {
+  if (pOutput == pRender->Parent() && Range > CDasherModel::ORIGIN_X && y1 < CDasherModel::ORIGIN_Y && y2 > CDasherModel::ORIGIN_Y) {
     pOutput=pRender;
     if (pRender->ChildCount()==0) {
       //covers crosshair! forcibly populate, now!
@@ -513,15 +513,14 @@ void CDasherViewSquare::DisjointRender(CDasherNode *pRender, myint y1, myint y2,
       dMaxCost = policy.pushNode(pRender, y1, y2, false, dMaxCost);
 
     // Render children
-    int norm = (myint)GetLongParameter(LP_NORMALIZATION);
 
     int id=-1;
 
     if (CDasherNode *pChild = pRender->onlyChildRendered)
     {
       //if child still covers screen, render _just_ it and return
-      myint newy1 = y1 + (Range * (myint)pChild->Lbnd()) / (myint)norm;
-      myint newy2 = y1 + (Range * (myint)pChild->Hbnd()) / (myint)norm;
+      myint newy1 = y1 + (Range * pChild->Lbnd()) / CDasherModel::NORMALIZATION;
+      myint newy2 = y1 + (Range * pChild->Hbnd()) / CDasherModel::NORMALIZATION;
       if (newy1 < iDasherMinY && newy2 > iDasherMaxY) {
         //still covers entire screen. Parent should too...
         DASHER_ASSERT(dMaxCost == std::numeric_limits<double>::infinity());
@@ -544,8 +543,8 @@ void CDasherViewSquare::DisjointRender(CDasherNode *pRender, myint y1, myint y2,
         id++;
         CDasherNode *pChild = *i;
 
-        myint newy1 = y1 + (Range * (myint)pChild->Lbnd()) / (myint)norm;/// norm and lbnd are simple ints
-        myint newy2 = y1 + (Range * (myint)pChild->Hbnd()) / (myint)norm;
+        myint newy1 = y1 + (Range * pChild->Lbnd()) / CDasherModel::NORMALIZATION;
+        myint newy2 = y1 + (Range * pChild->Hbnd()) / CDasherModel::NORMALIZATION;
 
         if (pChild->GetFlag(NF_GAME)) {
           CGameNodeDrawEvent evt(pChild, newy1, newy2);
@@ -598,24 +597,24 @@ void CDasherViewSquare::DisjointRender(CDasherNode *pRender, myint y1, myint y2,
 }
 
 bool CDasherViewSquare::CoversCrosshair(myint Range, myint y1, myint y2) {
-  if (Range > GetLongParameter(LP_OX) && y1 < GetLongParameter(LP_OY) && y2 > GetLongParameter(LP_OY)) {
+  if (Range > CDasherModel::ORIGIN_X && y1 < CDasherModel::ORIGIN_Y && y2 > CDasherModel::ORIGIN_Y) {
     switch (GetLongParameter(LP_SHAPE_TYPE)) {
       case 0: //Disjoint rectangles
       case 1: //Rectangles
         return true;
       case 2: {       //Triangles
         myint iMidY((y1+y2)/2);
-        return (iMidY > GetLongParameter(LP_OY))
-        ? ((GetLongParameter(LP_OY)-y1)*Range) > (iMidY - y1) * GetLongParameter(LP_OX)
-        : ((y2-GetLongParameter(LP_OY))*Range) > (y2 - iMidY) * GetLongParameter(LP_OX);
+        return (iMidY > CDasherModel::ORIGIN_Y)
+        ? ((CDasherModel::ORIGIN_Y-y1)*Range) > (iMidY - y1) * CDasherModel::ORIGIN_X
+        : ((y2-CDasherModel::ORIGIN_Y)*Range) > (y2 - iMidY) * CDasherModel::ORIGIN_X;
       }
       case 3: {       //Truncated tris
         myint midy1((y1+y1+y2)/3), midy2((y1+y2+y2)/3);
-        if (midy1 > GetLongParameter(LP_OY)) //(0,y1) - (Range,midy1)
-          return (GetLongParameter(LP_OY)-y1)*Range > (midy1 - y1) * GetLongParameter(LP_OX);
-        if (midy2 > GetLongParameter(LP_OY)) // (Range,midy1) - (Range,midy2)
+        if (midy1 > CDasherModel::ORIGIN_Y) //(0,y1) - (Range,midy1)
+          return (CDasherModel::ORIGIN_Y-y1)*Range > (midy1 - y1) * CDasherModel::ORIGIN_X;
+        if (midy2 > CDasherModel::ORIGIN_Y) // (Range,midy1) - (Range,midy2)
           return true;
-        return (y2 - GetLongParameter(LP_OY))*Range > (y2 - midy2) * GetLongParameter(LP_OX);
+        return (y2 - CDasherModel::ORIGIN_Y)*Range > (y2 - midy2) * CDasherModel::ORIGIN_X;
         break;
       }
       case 4: //quadrics. We'll approximate with circles, as they're easier...
@@ -623,8 +622,8 @@ bool CDasherViewSquare::CoversCrosshair(myint Range, myint y1, myint y2) {
         // too soon/aggressively :-(.
         // (hence, fallthrough to:)
       case 5: { //circles - actually ellipses, as x diameter is twice y diameter, hence the *4
-        const myint y_dist(GetLongParameter(LP_OY) - (y1+y2)/2);
-        return GetLongParameter(LP_OX) * GetLongParameter(LP_OX) + y_dist*y_dist*4 < Range*Range;
+        const myint y_dist(CDasherModel::ORIGIN_Y - (y1+y2)/2);
+        return CDasherModel::ORIGIN_X * CDasherModel::ORIGIN_X + y_dist*y_dist*4 < Range*Range;
       }
     }
   }
@@ -727,12 +726,11 @@ beginning:
   //Node has children - either it already did, or else it covers the crosshair,
   // and we've just made them...so render them.
 
-  const unsigned int norm(GetLongParameter(LP_NORMALIZATION));
   //first check if there's only one child we need to render
   if (CDasherNode *pChild = pRender->onlyChildRendered) {
     //if child still covers screen, render _just_ it and return
-    myint newy1 = y1 + (Range * (myint)pChild->Lbnd()) / (myint)norm;
-    myint newy2 = y1 + (Range * (myint)pChild->Hbnd()) / (myint)norm;
+    myint newy1 = y1 + (Range * pChild->Lbnd()) / CDasherModel::NORMALIZATION;
+    myint newy2 = y1 + (Range * pChild->Hbnd()) / CDasherModel::NORMALIZATION;
     if (
 	    (newy1 < iDasherMinY && newy2 > iDasherMaxY)) { //covers entire y-axis!
          //render just that child; nothing more to do for this node => tail call to beginning
@@ -749,7 +747,7 @@ beginning:
   while (I!=E) {
     CDasherNode *pChild(*I);
 
-    newy2 = y1 + (Range * (myint)pChild->Hbnd()) / (myint)norm;
+    newy2 = y1 + (Range * pChild->Hbnd()) / CDasherModel::NORMALIZATION;
     if (pChild->GetFlag(NF_GAME)) {
       DASHER_ASSERT(bExpectGameNode);
       bExpectGameNode=false;
@@ -786,28 +784,25 @@ void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myin
 
   // Things we're likely to need:
 
-  //myint iDasherWidth = (myint)GetLongParameter(LP_MAX_Y);
-  myint iDasherHeight = (myint)GetLongParameter(LP_MAX_Y);
-
   screenint iScreenWidth = Screen()->GetWidth();
   screenint iScreenHeight = Screen()->GetHeight();
 
   switch(GetOrientation()) {
   case Dasher::Opts::LeftToRight:
-    iDasherX = ( iScreenWidth - iInputX ) * m_iScalingFactor / iScaleFactorX;
-    iDasherY = iDasherHeight / 2 + ( iInputY - iScreenHeight / 2 ) * m_iScalingFactor / iScaleFactorY;
+    iDasherX = ( iScreenWidth - iInputX ) * SCALE_FACTOR / iScaleFactorX;
+    iDasherY = CDasherModel::MAX_Y / 2 + ( iInputY - iScreenHeight / 2 ) * SCALE_FACTOR / iScaleFactorY;
     break;
   case Dasher::Opts::RightToLeft:
-    iDasherX = myint( ( iInputX ) * m_iScalingFactor/ iScaleFactorX);
-    iDasherY = myint(iDasherHeight / 2 + ( iInputY - iScreenHeight / 2 ) * m_iScalingFactor/ iScaleFactorY);
+    iDasherX = myint( ( iInputX ) * SCALE_FACTOR / iScaleFactorX);
+    iDasherY = myint(CDasherModel::MAX_Y / 2 + ( iInputY - iScreenHeight / 2 ) * SCALE_FACTOR / iScaleFactorY);
     break;
   case Dasher::Opts::TopToBottom:
-    iDasherX = myint( ( iScreenHeight - iInputY ) * m_iScalingFactor/ iScaleFactorX);
-    iDasherY = myint(iDasherHeight / 2 + ( iInputX - iScreenWidth / 2 ) * m_iScalingFactor/ iScaleFactorY);
+    iDasherX = myint( ( iScreenHeight - iInputY ) * SCALE_FACTOR / iScaleFactorX);
+    iDasherY = myint(CDasherModel::MAX_Y / 2 + ( iInputX - iScreenWidth / 2 ) * SCALE_FACTOR / iScaleFactorY);
     break;
   case Dasher::Opts::BottomToTop:
-    iDasherX = myint( ( iInputY  ) * m_iScalingFactor/ iScaleFactorX);
-    iDasherY = myint(iDasherHeight / 2 + ( iInputX - iScreenWidth / 2 ) * m_iScalingFactor/ iScaleFactorY);
+    iDasherX = myint( ( iInputY  ) * SCALE_FACTOR / iScaleFactorX);
+    iDasherY = myint(CDasherModel::MAX_Y / 2 + ( iInputX - iScreenWidth / 2 ) * SCALE_FACTOR / iScaleFactorY);
     break;
   }
 
@@ -820,7 +815,7 @@ void CDasherViewSquare::SetScaleFactor( void )
 {
   //Parameters for X non-linearity.
   // Set some defaults here, in case we change(d) them later...
-  m_iXlogThres=GetLongParameter(LP_MAX_Y)/2; //threshold: DasherX's less than this are linear; those greater are logarithmic
+  m_iXlogThres=CDasherModel::MAX_Y/2; //threshold: DasherX's less than this are linear; those greater are logarithmic
 
   //set log scaling coefficient (unused if LP_NONLINEAR_X==0)
   // note previous value = 1/0.2, i.e. a value of LP_NONLINEAR_X =~= 4.8
@@ -830,12 +825,10 @@ void CDasherViewSquare::SetScaleFactor( void )
   const screenint iScreenWidth(Screen()->GetWidth()), iScreenHeight(Screen()->GetHeight());
   const double dPixelsX(bHoriz ? iScreenWidth : iScreenHeight), dPixelsY(bHoriz ? iScreenHeight : iScreenWidth);
 
-  const myint lpMaxY(GetLongParameter(LP_MAX_Y));
-
   //Defaults/starting values, will be modified later according to scheme in use...
   iMarginWidth = GetLongParameter(LP_MARGIN_WIDTH);
-  double dScaleFactorY(dPixelsY / lpMaxY );
-  double dScaleFactorX(dPixelsX / static_cast<double>(lpMaxY + iMarginWidth) );
+  double dScaleFactorY(dPixelsY / CDasherModel::MAX_Y );
+  double dScaleFactorX(dPixelsX / static_cast<double>(CDasherModel::MAX_Y + iMarginWidth) );
 
   switch (GetLongParameter(LP_GEOMETRY)) {
     case 0: {
@@ -847,14 +840,14 @@ void CDasherViewSquare::SetScaleFactor( void )
         double dMul = max(0.8, dScaleFactorX / dScaleFactorY);
         dScaleFactorY = std::max(dScaleFactorX/dMul, dScaleFactorY / 4.0);
         dScaleFactorX *= 0.9;
-        iMarginWidth = (lpMaxY/20.0 + iMarginWidth*0.95)/0.9;
+        iMarginWidth = (CDasherModel::MAX_Y/20.0 + iMarginWidth*0.95)/0.9;
       } else {
         //X has more room; use Y scale for both -> will get lots history
         // however, "compensate" by relaxing the default "relative scaling" of X
         // (normally only 90% of Y) towards 1...
         double dXmpc = std::min(1.0,0.9 * dScaleFactorX / dScaleFactorY);
         dScaleFactorX = max(dScaleFactorY, dScaleFactorX / 4.0)*dXmpc;
-        iMarginWidth = (iMarginWidth + dPixelsX/dScaleFactorX - lpMaxY)/2;
+        iMarginWidth = (iMarginWidth + dPixelsX/dScaleFactorX - CDasherModel::MAX_Y)/2;
       }
       break;
     }
@@ -867,7 +860,7 @@ void CDasherViewSquare::SetScaleFactor( void )
     case 2:
     case 3: {
       //2 or 3 => squish x (so xhair always visible)
-      const double dDesiredXPerPixel( (lpMaxY + iMarginWidth) / dPixelsX), dMinXPerPixel((GetLongParameter(LP_OX)+iMarginWidth)/dPixelsX);
+      const double dDesiredXPerPixel( (CDasherModel::MAX_Y + iMarginWidth) / dPixelsX), dMinXPerPixel((CDasherModel::ORIGIN_X+iMarginWidth)/dPixelsX);
       const double dAspect(1.0/dScaleFactorY/dDesiredXPerPixel);
       double dDasherXPerPixel( (dAspect<1.0)
                               ? (dMinXPerPixel+pow(dAspect,3.0)*(dDesiredXPerPixel-dMinXPerPixel)) //tall+thin
@@ -882,8 +875,8 @@ void CDasherViewSquare::SetScaleFactor( void )
       dScaleFactorX = 0.9 / dDasherXPerPixel;
     }
   }
-  iScaleFactorX = myint(dScaleFactorX * m_iScalingFactor);
-  iScaleFactorY = myint(dScaleFactorY * m_iScalingFactor);
+  iScaleFactorX = myint(dScaleFactorX * SCALE_FACTOR);
+  iScaleFactorY = myint(dScaleFactorY * SCALE_FACTOR);
 
 #ifdef DEBUG
   //test...
@@ -910,14 +903,14 @@ void CDasherViewSquare::SetScaleFactor( void )
 }
 
 
-inline myint CDasherViewSquare::CustomIDiv(myint iNumerator, myint iDenominator) {
+inline myint CDasherViewSquare::CustomIDivScaleFactor(myint iNumerator) {
   // Integer division rounding away from zero
 
   long long int num, denom, quot, rem;
   myint res;
 
   num   = iNumerator;
-  denom = iDenominator;
+  denom = SCALE_FACTOR;
 
   DASHER_ASSERT(denom != 0);
 
@@ -952,9 +945,6 @@ void CDasherViewSquare::Dasher2Screen(myint iDasherX, myint iDasherY, screenint
 
   // Things we're likely to need:
 
-  //myint iDasherWidth = (myint)GetLongParameter(LP_MAX_Y);
-  myint iDasherHeight = (myint)GetLongParameter(LP_MAX_Y);
-
   screenint iScreenWidth = Screen()->GetWidth();
   screenint iScreenHeight = Screen()->GetHeight();
 
@@ -965,27 +955,25 @@ void CDasherViewSquare::Dasher2Screen(myint iDasherX, myint iDasherY, screenint
   switch( GetOrientation() ) {
   case Dasher::Opts::LeftToRight:
     iScreenX = screenint(iScreenWidth -
-			 CustomIDiv((( iDasherX ) * iScaleFactorX), m_iScalingFactor));
+			 CustomIDivScaleFactor(iDasherX  * iScaleFactorX));
     iScreenY = screenint(iScreenHeight / 2 +
-			 CustomIDiv(( iDasherY - iDasherHeight / 2 ) * iScaleFactorY, m_iScalingFactor));
+			 CustomIDivScaleFactor(( iDasherY - CDasherModel::MAX_Y / 2 ) * iScaleFactorY));
     break;
   case Dasher::Opts::RightToLeft:
-    iScreenX = screenint(
-			 CustomIDiv(( iDasherX ) * iScaleFactorX, m_iScalingFactor));
+    iScreenX = screenint(CustomIDivScaleFactor(iDasherX * iScaleFactorX));
     iScreenY = screenint(iScreenHeight / 2 +
-			 CustomIDiv(( iDasherY - iDasherHeight / 2 ) * iScaleFactorY, m_iScalingFactor));
+			 CustomIDivScaleFactor( (iDasherY - CDasherModel::MAX_Y/2) * iScaleFactorY));
     break;
   case Dasher::Opts::TopToBottom:
     iScreenX = screenint(iScreenWidth / 2 +
-			 CustomIDiv(( iDasherY - iDasherHeight / 2 ) * iScaleFactorY, m_iScalingFactor));
+			 CustomIDivScaleFactor( (iDasherY - CDasherModel::MAX_Y/2) * iScaleFactorY));
     iScreenY = screenint(iScreenHeight -
-			 CustomIDiv(( iDasherX ) * iScaleFactorX, m_iScalingFactor));
+			 CustomIDivScaleFactor( iDasherX * iScaleFactorX ));
     break;
   case Dasher::Opts::BottomToTop:
     iScreenX = screenint(iScreenWidth / 2 +
-			 CustomIDiv(( iDasherY - iDasherHeight / 2 ) * iScaleFactorY, m_iScalingFactor));
-    iScreenY = screenint(
-			 CustomIDiv(( iDasherX ) * iScaleFactorX, m_iScalingFactor));
+			 CustomIDivScaleFactor(( iDasherY - CDasherModel::MAX_Y/2 ) * iScaleFactorY));
+    iScreenY = screenint(CustomIDivScaleFactor( iDasherX  * iScaleFactorX ));
     break;
   }
 }
@@ -994,8 +982,8 @@ void CDasherViewSquare::Dasher2Polar(myint iDasherX, myint iDasherY, double &r,
 	iDasherX = xmap(iDasherX);
     iDasherY = ymap(iDasherY);
 
-  myint iDasherOX = xmap(GetLongParameter(LP_OX));
-    myint iDasherOY = ymap(GetLongParameter(LP_OY));
+  myint iDasherOX = xmap(CDasherModel::ORIGIN_X);
+    myint iDasherOY = ymap(CDasherModel::ORIGIN_Y);
 
     double x = -(iDasherX - iDasherOX) / double(iDasherOX); //Use normalised coords so min r works
     double y = -(iDasherY - iDasherOY) / double(iDasherOY);
@@ -1125,6 +1113,5 @@ void CDasherViewSquare::VisibleRegion( myint &iDasherMinX, myint &iDasherMinY, m
 
 void CDasherViewSquare::ScreenResized(CDasherScreen *NewScreen) {
   m_bVisibleRegionValid = false;
-  m_iScalingFactor = 100000000;
   SetScaleFactor();
 }
diff --git a/Src/DasherCore/DasherViewSquare.h b/Src/DasherCore/DasherViewSquare.h
index 5414221..1b1ed39 100644
--- a/Src/DasherCore/DasherViewSquare.h
+++ b/Src/DasherCore/DasherViewSquare.h
@@ -176,10 +176,11 @@ private:
   ///Parameters for y non-linearity. (TODO Make into preprocessor defines?)
   const myint m_Y1, m_Y2, m_Y3;
 
-  inline void Crosshair(myint sx);
+  inline void Crosshair();
   bool CoversCrosshair(myint Range,myint y1,myint y2);
 
-  inline myint CustomIDiv(myint iNumerator, myint iDenominator);
+  //Divides by SCALE_FACTOR, rounding away from 0
+  inline myint CustomIDivScaleFactor(myint iNumerator);
 
   void DasherLine2Screen(myint x1, myint y1, myint x2, myint y2, vector<CDasherScreen::point> &vPoints);
 
@@ -195,11 +196,11 @@ private:
   //width of margin, in abstract screen coords
   myint iMarginWidth;
 
-  /// There is a ratio of iScaleFactor{X,Y} abstract screen coords to m_iScalingFactor real pixels
+  /// There is a ratio of iScaleFactor{X,Y} abstract screen coords to SCALE_FACTOR real pixels
   /// (Note the naming convention: iScaleFactorX/Y refers to X/Y in Dasher-space, which will be
   /// the other way around to real screen coordinates if using a vertical (T-B/B-T) orientation)
   myint iScaleFactorX, iScaleFactorY;
-  myint m_iScalingFactor;
+  static const myint SCALE_FACTOR = 1<<26; //was 100,000,000; change to power of 2 => easier to multiply/divide
 
   /// Cached extents of visible region
   myint m_iDasherMinX;
diff --git a/Src/DasherCore/DasherViewSquare.inl b/Src/DasherCore/DasherViewSquare.inl
index 8754cf6..caa1b19 100644
--- a/Src/DasherCore/DasherViewSquare.inl
+++ b/Src/DasherCore/DasherViewSquare.inl
@@ -12,7 +12,7 @@ namespace Dasher {
 
   /// Draw the crosshair
 
-  inline void CDasherViewSquare::Crosshair(myint sx) {
+  inline void CDasherViewSquare::Crosshair() {
     myint iDasherMinX;
     myint iDasherMinY;
     myint iDasherMaxX;
@@ -24,21 +24,21 @@ namespace Dasher {
 
     // Vertical bar of crosshair
 
-    x[0] = sx;
+    x[0] = CDasherModel::ORIGIN_X;
     y[0] = iDasherMinY;
 
-    x[1] = sx;
+    x[1] = CDasherModel::ORIGIN_X;
     y[1] = iDasherMaxY;
 
     DasherPolyline(x, y, 2, 1, 5);
 
     // Horizontal bar of crosshair
 
-    x[0] = 12 * sx / 14;
-    y[0] = GetLongParameter(LP_MAX_Y) / 2;
+    x[0] = 12 * CDasherModel::ORIGIN_X / 14;
+    y[0] = CDasherModel::ORIGIN_Y;
 
-    x[1] = 17 * sx / 14;
-    y[1] = GetLongParameter(LP_MAX_Y) / 2;
+    x[1] = 17 * CDasherModel::ORIGIN_X / 14;
+    y[1] = CDasherModel::ORIGIN_Y;
 
     DasherPolyline(x, y, 2, 1, 5);
   }
@@ -47,9 +47,9 @@ namespace Dasher {
   {
     x -= iMarginWidth;
     if (GetLongParameter(LP_NONLINEAR_X)>0 && x >= m_iXlogThres) {
-      double dx = (x - m_iXlogThres) / static_cast<double>(GetLongParameter(LP_MAX_Y));
+      double dx = (x - m_iXlogThres) / static_cast<double>(CDasherModel::MAX_Y);
       dx =  (exp(dx * m_dXlogCoeff) - 1) / m_dXlogCoeff;
-      x = myint( dx * GetLongParameter(LP_MAX_Y)) + m_iXlogThres;
+      x = myint( dx * CDasherModel::MAX_Y) + m_iXlogThres;
     }
     return x;
   }
@@ -57,8 +57,8 @@ namespace Dasher {
   inline myint CDasherViewSquare::xmap(myint x) const
   {
     if(GetLongParameter(LP_NONLINEAR_X) && x >= m_iXlogThres) {
-      double dx = log(1+ (x-m_iXlogThres)*m_dXlogCoeff/GetLongParameter(LP_MAX_Y))/m_dXlogCoeff;
-      dx = (dx*GetLongParameter(LP_MAX_Y)) + m_iXlogThres;
+      double dx = log(1+ (x-m_iXlogThres)*m_dXlogCoeff/CDasherModel::MAX_Y)/m_dXlogCoeff;
+      dx = (dx*CDasherModel::MAX_Y) + m_iXlogThres;
       x= myint(dx>0 ? ceil(dx) : floor(dx));
     }
     return x + iMarginWidth;
diff --git a/Src/DasherCore/DefaultFilter.cpp b/Src/DasherCore/DefaultFilter.cpp
index 74c9f6f..0145a70 100644
--- a/Src/DasherCore/DefaultFilter.cpp
+++ b/Src/DasherCore/DefaultFilter.cpp
@@ -52,13 +52,13 @@ bool CDefaultFilter::DecorateView(CDasherView *pView, CDasherInput *pInput) {
   }
 
   if(GetBoolParameter(BP_DRAW_MOUSE_LINE)) {
-    // Draw a line from (LP_OX, LP_OY) to the current mouse position
+    // Draw a line from the origin to the current mouse position
     myint x[2];
     myint y[2];
 
     // Start of line is the crosshair location
-    x[0] = (myint)GetLongParameter(LP_OX);
-    y[0] = (myint)GetLongParameter(LP_OY);
+    x[0] = CDasherModel::ORIGIN_X;
+    y[0] = CDasherModel::ORIGIN_Y;
 
     x[1] = m_iLastX;
     y[1] = m_iLastY;
@@ -217,24 +217,24 @@ void CDefaultFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDasherVie
     // up/down and reverse
     myint iDasherMaxX,temp;
     pView->VisibleRegion(temp, temp, iDasherMaxX, temp);
-    const myint xd(iDasherX - iDasherMaxX),yd(iDasherY-GetLongParameter(LP_OY));
+    const myint xd(iDasherX - iDasherMaxX),yd(iDasherY-CDasherModel::ORIGIN_Y);
     const myint dist(xd*xd + yd*yd); //squared distance from closest point onscreen to crosshair
-    if (iDasherMaxX < GetLongParameter(LP_OX)) {
+    if (iDasherMaxX < CDasherModel::ORIGIN_X) {
       //crosshair actually offscreen; rescale so left edge of screen = translate
-      iDasherX = (iDasherX * GetLongParameter(LP_OX))/iDasherMaxX;
+      iDasherX = (iDasherX * CDasherModel::ORIGIN_X)/iDasherMaxX;
     }
     //boost reversing if near centerpoint of LHS (even if xhair onscreen)
-    iDasherX += (2*GetLongParameter(LP_OY)*GetLongParameter(LP_OY))/(dist+50); //and close to centerpoint = reverse
+    iDasherX += (2*CDasherModel::ORIGIN_Y*CDasherModel::ORIGIN_Y)/(dist+50); //and close to centerpoint = reverse
   }
   if (GetBoolParameter(BP_REMAP_XTREME)) {
     // Y co-ordinate...
-    myint dasherOY=(myint)GetLongParameter(LP_OY);
+    myint dasherOY=CDasherModel::ORIGIN_Y;
     double double_y = ((iDasherY-dasherOY)/(double)(dasherOY) ); // Fraction above the crosshair
     static const double repulsionparameter=0.5;
     iDasherY = myint(dasherOY * (1.0 + double_y + (double_y*double_y*double_y * repulsionparameter )));
 
     // X co-ordinate...
-    iDasherX = max(iDasherX,myint(GetLongParameter(LP_OX) * xmax(double_y)));
+    iDasherX = max(iDasherX,myint(CDasherModel::ORIGIN_X * xmax(double_y)));
   }
 }
 
@@ -250,7 +250,7 @@ void CDefaultFilter::ApplyOffset(myint &iDasherX, myint &iDasherY) {
   if(GetBoolParameter(BP_AUTOCALIBRATE) && !GetBoolParameter(BP_DASHER_PAUSED)) {
     // Auto-update the offset
 
-    m_iSum += (myint)GetLongParameter(LP_OY) - iDasherY; // Distance above crosshair
+    m_iSum += CDasherModel::ORIGIN_Y - iDasherY; // Distance above crosshair
     ++m_iCounter;
 
     //int m_iFilterTimescale=20
@@ -259,9 +259,9 @@ void CDefaultFilter::ApplyOffset(myint &iDasherX, myint &iDasherY) {
 
       // 'Conditions A', as specified by DJCM.  Only make the auto-offset
       // change if we're past the significance boundary.
-      //int m_iSigBiasPixels(GetLongParameter(LP_MAX_Y)/2);
+      //int m_iSigBiasPixels(CDasherModel::MAX_Y/2);
 
-      if (((m_iSum>0)?m_iSum:-m_iSum) > GetLongParameter(LP_MAX_Y)/2)
+      if (((m_iSum>0)?m_iSum:-m_iSum) > CDasherModel::MAX_Y/2)
         SetLongParameter(LP_TARGET_OFFSET, GetLongParameter(LP_TARGET_OFFSET) + ((m_iSum>0) ? -1 : 1));
       //TODO, "else return" - check effectiveness with/without?
       // old code exited now if neither above cases applied,
diff --git a/Src/DasherCore/DynamicFilter.h b/Src/DasherCore/DynamicFilter.h
index c3c0e6c..0e272df 100644
--- a/Src/DasherCore/DynamicFilter.h
+++ b/Src/DasherCore/DynamicFilter.h
@@ -41,6 +41,7 @@ class CDynamicFilter : public CInputFilter, public CSettingsUserObserver {
 
   //respond to changes to BP_DASHER_PAUSED to keep m_iState in sync
   virtual void HandleEvent(int iParameter);
+
  protected:
   virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel) = 0;
   virtual void Event(int iTime, int iButton, int iType, CDasherModel *pModel);
diff --git a/Src/DasherCore/GameModule.cpp b/Src/DasherCore/GameModule.cpp
index a7f9976..053ff12 100644
--- a/Src/DasherCore/GameModule.cpp
+++ b/Src/DasherCore/GameModule.cpp
@@ -106,9 +106,9 @@ void CGameModule::DecorateView(unsigned long lTime, CDasherView *pView, CDasherM
   myint x[2], y[2];
   x[0] = x[1] = -100;
   
-  if (m_y1 > GetLongParameter(LP_MAX_Y)) {
+  if (m_y1 > CDasherModel::MAX_Y) {
     //off the top! draw an arrow pointing up...
-    y[1] = GetLongParameter(LP_MAX_Y);
+    y[1] = CDasherModel::MAX_Y;
     y[0] = y[1] - 400;
     pView->DasherPolyarrow(x, y, 2, 2, m_iCrosshairColor, 0.1);
   } else if (m_y2 < 0) {
diff --git a/Src/DasherCore/MandarinAlphMgr.cpp b/Src/DasherCore/MandarinAlphMgr.cpp
index 7d987c7..82adc6b 100644
--- a/Src/DasherCore/MandarinAlphMgr.cpp
+++ b/Src/DasherCore/MandarinAlphMgr.cpp
@@ -287,7 +287,7 @@ void CMandarinAlphMgr::GetConversions(std::vector<pair<symbol,unsigned int> > &v
   //Two degenerate cases: PROB_SORT_THRES=0 => all (legal) ch symbols predicted uniformly
   // PROB_SORT_THRES=100 => all symbols put into probability order
   set<symbol> haveProbs;
-  uint64 iRemaining(GetLongParameter(LP_NORMALIZATION));
+  uint64 iRemaining(CDasherModel::NORMALIZATION);
   
   if (long percent=GetLongParameter(LP_PY_PROB_SORT_THRES)) {
     const uint64 iNorm(iRemaining);
@@ -404,7 +404,7 @@ void CMandarinAlphMgr::CMandSym::RebuildForwardsFromAncestor(CAlphNode *pNewNode
       //need to compare pinyin symbols; so compute probability of this (chinese) sym, for each:
       // i.e. P(pinyin) * P(this chinese | pinyin)
       const vector<unsigned int> &vPinyinProbs(*(pNewNode->GetProbInfo()));
-      long bestProb=0; //of this chinese, over LP_NORMALIZATION _squared_
+      long bestProb=0; //of this chinese, over NORMALIZATION _squared_
       for (set<symbol>::iterator p_it = possiblePinyin.begin(); p_it!=possiblePinyin.end(); p_it++) {
         //compute probability of each chinese symbol for that pinyin (=by filtering)
         // context is the same as the ancestor = previous chinese, as pinyin not part of context
diff --git a/Src/DasherCore/MandarinAlphMgr.h b/Src/DasherCore/MandarinAlphMgr.h
index a839378..2db08fa 100644
--- a/Src/DasherCore/MandarinAlphMgr.h
+++ b/Src/DasherCore/MandarinAlphMgr.h
@@ -146,7 +146,7 @@ namespace Dasher {
     ///Gets the possible chinese symbols for a pinyin one, along with their probabilities in the specified context.
     ///Probabilities are computed by CPPMPYLanguageModel::GetPartProbs, then renormalized here. (TODO unnecessary?)
     /// \param vChildren initially empty vector which procedure fills with pairs: first element chinese symbol number,
-    /// second element probability (/LP_NORMALIZATION).    
+    /// second element probability (/NORMALIZATION).    
     void GetConversions(std::vector<std::pair<symbol,unsigned int> > &vChildren, symbol pySym, Dasher::CLanguageModel::Context context);
 
     ///Gets colour for a specified chinese symbol and offset.
diff --git a/Src/DasherCore/NodeCreationManager.cpp b/Src/DasherCore/NodeCreationManager.cpp
index 258fd47..ddf72aa 100644
--- a/Src/DasherCore/NodeCreationManager.cpp
+++ b/Src/DasherCore/NodeCreationManager.cpp
@@ -139,18 +139,17 @@ void CNodeCreationManager::HandleEvent(int iParameter) {
     case BP_CONTROL_MODE:
     case BP_GAME_MODE: {
       delete m_pControlManager;
-      const unsigned long iNorm(GetLongParameter(LP_NORMALIZATION));
       unsigned long iControlSpace;
       //don't allow a control manager during Game Mode 
       if (GetBoolParameter(BP_CONTROL_MODE) && !GetBoolParameter(BP_GAME_MODE)) {
         m_pControlManager = new CControlManager(this, this, m_pInterface);
         if (m_pScreen) m_pControlManager->MakeLabels(m_pScreen);
-        iControlSpace = iNorm / 20;
+        iControlSpace = CDasherModel::NORMALIZATION / 20;
       } else {
         m_pControlManager = NULL;
         iControlSpace = 0;
       }
-      m_iAlphNorm = iNorm-iControlSpace;
+      m_iAlphNorm = CDasherModel::NORMALIZATION-iControlSpace;
       break;
     }
   }
@@ -165,7 +164,7 @@ void CNodeCreationManager::AddExtras(CDasherNode *pParent) {
 #endif
     //ACL leave offset as is - like its groupnode parent, but unlike its alphnode siblings,
     //the control node does not enter a symbol....
-    m_pControlManager->GetRoot(pParent, pParent->GetChildren().back()->Hbnd(), GetLongParameter(LP_NORMALIZATION), pParent->offset());
+    m_pControlManager->GetRoot(pParent, pParent->GetChildren().back()->Hbnd(), CDasherModel::NORMALIZATION, pParent->offset());
   }
 }
 
diff --git a/Src/DasherCore/OneDimensionalFilter.cpp b/Src/DasherCore/OneDimensionalFilter.cpp
index 18f3392..b36d6bd 100644
--- a/Src/DasherCore/OneDimensionalFilter.cpp
+++ b/Src/DasherCore/OneDimensionalFilter.cpp
@@ -9,7 +9,7 @@ using namespace Dasher;
 }*/
 
 COneDimensionalFilter::COneDimensionalFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName)
-  : CDefaultFilter(pCreator, pInterface, iID, szName), forwardmax(GetLongParameter(LP_MAX_Y)/2.5) {
+  : CDefaultFilter(pCreator, pInterface, iID, szName), forwardmax(CDasherModel::MAX_Y/2.5) {
 }
 
 void COneDimensionalFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDasherView *pView) {
@@ -20,10 +20,10 @@ void COneDimensionalFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDa
   double disty,circlesize,yfullrange,yforwardrange,angle,ellipse_eccentricity,ybackrange,yb,x;	
   
   // The distance between the Y coordinate and the centreline in pixels
-  disty=(myint)GetLongParameter(LP_OY)-iDasherY;
+  disty=CDasherModel::ORIGIN_Y-iDasherY;
   
   circlesize=    forwardmax*(1.0-max(0.0,min(1.0,(double)iDasherX/iDasherMaxX)));
-  yforwardrange= (myint)GetLongParameter(LP_MAX_Y)/3.2; // Was 1.6
+  yforwardrange= CDasherModel::MAX_Y/3.2; // Was 1.6
   yfullrange=    yforwardrange*1.6;
   ybackrange=    yfullrange-yforwardrange;
   ellipse_eccentricity=6;
@@ -35,13 +35,13 @@ void COneDimensionalFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDa
     
     if (yb>1) {
       x=0;
-      iDasherY=myint(GetLongParameter(LP_OY));
+      iDasherY=CDasherModel::ORIGIN_Y;
     }
     else { 
       angle=(yb*3.14159)*(yb+(1-yb)*(ybackrange/yforwardrange/ellipse_eccentricity));
       
       x=(-sin(angle)*circlesize/2)*ellipse_eccentricity;
-      iDasherY=myint(-(1+cos(angle))*circlesize/2+(myint)GetLongParameter(LP_OY));
+      iDasherY=myint(-(1+cos(angle))*circlesize/2+CDasherModel::ORIGIN_Y);
     }
   }
   else if (disty <-(yforwardrange)) {
@@ -50,22 +50,22 @@ void COneDimensionalFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDa
     
     if (yb>1) {
       x=0;
-      iDasherY=myint((myint)GetLongParameter(LP_OY));
+      iDasherY=CDasherModel::ORIGIN_Y;
     }   
     else {
       angle=(yb*3.14159)*(yb+(1-yb)*(ybackrange/yforwardrange/ellipse_eccentricity));
       
       x=(-sin(angle)*circlesize/2)*ellipse_eccentricity;
-      iDasherY=myint((1+cos(angle))*circlesize/2+(myint)GetLongParameter(LP_OY));
+      iDasherY=myint((1+cos(angle))*circlesize/2+CDasherModel::ORIGIN_Y);
     }   
   }
   
   else {
     angle=((disty*3.14159/2)/yforwardrange);
     x=cos(angle)*circlesize;
-    iDasherY=myint(-sin(angle)*circlesize+(myint)GetLongParameter(LP_OY));
+    iDasherY=myint(-sin(angle)*circlesize+CDasherModel::ORIGIN_Y);
   }
-  x=(myint)GetLongParameter(LP_OX)-x;
+  x=CDasherModel::ORIGIN_X-x;
   
   iDasherX = myint(x);
 }
@@ -86,8 +86,8 @@ CStartHandler *COneDimensionalFilter::MakeStartHandler() {
         if (GetBoolParameter(BP_DASHER_PAUSED)) {
           //put start circle at center of 1D transform, rather than center of screen
           // (leave m_iScreenRadius, in pixels, as computed by above)
-          const myint rad(GetLongParameter(LP_CIRCLE_PERCENT) * GetLongParameter(LP_OY) / 100); //~~rad/2 in dasher-coords
-          pView->Dasher2Screen(GetLongParameter(LP_OX)-filter->forwardmax+rad, GetLongParameter(LP_OY),m_screenCircleCenter.x, m_screenCircleCenter.y);
+          const myint rad(GetLongParameter(LP_CIRCLE_PERCENT) * CDasherModel::ORIGIN_Y / 100); //~~rad/2 in dasher-coords
+          pView->Dasher2Screen(CDasherModel::ORIGIN_X-filter->forwardmax+rad, CDasherModel::ORIGIN_Y,m_screenCircleCenter.x, m_screenCircleCenter.y);
         } 
       }
       void HandleEvent(int iParameter) {
diff --git a/Src/DasherCore/Parameters.cpp b/Src/DasherCore/Parameters.cpp
index 9678b02..263be3a 100644
--- a/Src/DasherCore/Parameters.cpp
+++ b/Src/DasherCore/Parameters.cpp
@@ -85,7 +85,6 @@ const lp_table longparamtable[] = {
   {LP_LM_ALPHA, "LMAlpha", PERS, 49, "LMAlpha"},
   {LP_LM_BETA, "LMBeta", PERS, 77, "LMBeta"},
   {LP_LM_MIXTURE, "LMMixture", PERS, 50, "LMMixture"},
-  {LP_NORMALIZATION, "Normalization", !PERS, 1 << 16, "Interval for child nodes"},
   {LP_LINE_WIDTH, "LineWidth", PERS, 1, "Width to draw crosshair and mouse line"},
   {LP_GEOMETRY, "Geometry", PERS, 0, "Screen geometry (mostly for tall thin screens) - 0=old-style, 1=square no-xhair, 2=squish, 3=squish+log"},
   {LP_LM_WORD_ALPHA, "WordAlpha", PERS, 50, "Alpha value for word-based model"},
@@ -119,9 +118,6 @@ const lp_table longparamtable[] = {
   {LP_SOCKET_INPUT_X_MAX, "SocketInputXMaxTimes1000", PERS, 1000, "Top of range of X values expected from network input"},
   {LP_SOCKET_INPUT_Y_MIN, "SocketInputYMinTimes1000", PERS, 0, "Bottom of range of Y values expected from network input"},
   {LP_SOCKET_INPUT_Y_MAX, "SocketInputYMaxTimes1000", PERS, 1000, "Top of range of Y values expected from network input"},
-  {LP_OX, "OX", PERS, 2048, "X coordinate of crosshair"},
-  {LP_OY, "OY", PERS, 2048, "Y coordinate of crosshair"},
-  {LP_MAX_Y, "MaxY", PERS, 4096, "Maximum Y coordinate"},
   {LP_INPUT_FILTER, "InputFilterID", PERS, 3, "Module ID of input filter"},
   {LP_CIRCLE_PERCENT, "CirclePercent", PERS, 10, "Percentage of nominal vertical range to use for radius of start circle"},
   {LP_TWO_BUTTON_OFFSET, "TwoButtonOffset", PERS, 1638, "Offset for two button dynamic mode"},
diff --git a/Src/DasherCore/Parameters.h b/Src/DasherCore/Parameters.h
index e3d1de1..170016b 100644
--- a/Src/DasherCore/Parameters.h
+++ b/Src/DasherCore/Parameters.h
@@ -54,12 +54,12 @@ enum {
   LP_UNIFORM, LP_YSCALE, LP_MOUSEPOSDIST, LP_STOP_IDLETIME, LP_PY_PROB_SORT_THRES, LP_MESSAGE_TIME,
   LP_LM_MAX_ORDER, LP_LM_EXCLUSION,
   LP_LM_UPDATE_EXCLUSION, LP_LM_ALPHA, LP_LM_BETA,
-  LP_LM_MIXTURE, LP_NORMALIZATION, LP_LINE_WIDTH, LP_GEOMETRY,
+  LP_LM_MIXTURE, LP_LINE_WIDTH, LP_GEOMETRY,
   LP_LM_WORD_ALPHA, LP_USER_LOG_LEVEL_MASK, 
   LP_ZOOMSTEPS, LP_B, LP_S, LP_BUTTON_SCAN_TIME, LP_R, LP_RIGHTZOOM,
   LP_NODE_BUDGET, LP_OUTLINE_WIDTH, LP_MIN_NODE_SIZE, LP_NONLINEAR_X,
   LP_BOOSTFACTOR, LP_AUTOSPEED_SENSITIVITY, LP_SOCKET_PORT, LP_SOCKET_INPUT_X_MIN, LP_SOCKET_INPUT_X_MAX,
-  LP_SOCKET_INPUT_Y_MIN, LP_SOCKET_INPUT_Y_MAX, LP_OX, LP_OY, LP_MAX_Y, LP_INPUT_FILTER, 
+  LP_SOCKET_INPUT_Y_MIN, LP_SOCKET_INPUT_Y_MAX, LP_INPUT_FILTER, 
   LP_CIRCLE_PERCENT, LP_TWO_BUTTON_OFFSET, LP_HOLD_TIME, LP_MULTIPRESS_TIME,
   LP_SLOW_START_TIME, LP_CONVERSION_ORDER, LP_CONVERSION_TYPE,
   LP_TWO_PUSH_OUTER, LP_TWO_PUSH_UP, LP_TWO_PUSH_DOWN, LP_TWO_PUSH_TOLERANCE,
diff --git a/Src/DasherCore/UserLog.cpp b/Src/DasherCore/UserLog.cpp
index fdc5861..fd3149c 100644
--- a/Src/DasherCore/UserLog.cpp
+++ b/Src/DasherCore/UserLog.cpp
@@ -47,7 +47,7 @@ static UserLogParamMask s_UserLogParamMaskTable [] = {
 
 CUserLog::CUserLog(CSettingsUser *pCreateFrom,
                    Observable<const CEditEvent *> *pObsv,
-                   int iLogTypeMask) : CUserLogBase(pCreateFrom, pObsv), CSettingsObserver(pCreateFrom) {
+                   int iLogTypeMask) : CUserLogBase(pObsv), CSettingsUserObserver(pCreateFrom) {
   //CFunctionLogger f1("CUserLog::CUserLog", g_pLogger);
 
   InitMemberVars();
@@ -1134,7 +1134,7 @@ void CUserLog::UpdateParam(int iParameter, int iOptionMask)
 // TODO these are broken by settings rewrite. Fix???
 
 // Load the object from an XML file
-CUserLog::CUserLog(string strXMLFilename) : CUserLogBase(NULL, NULL), CSettingsObserver(NULL)
+CUserLog::CUserLog(string strXMLFilename) : CUserLogBase(NULL), CSettingsUserObserver(NULL)
 {
   //CFunctionLogger f1("CUserLog::CUserLog(XML)", g_pLogger);
 
diff --git a/Src/DasherCore/UserLog.h b/Src/DasherCore/UserLog.h
index a859417..292cbf2 100644
--- a/Src/DasherCore/UserLog.h
+++ b/Src/DasherCore/UserLog.h
@@ -74,7 +74,7 @@ typedef vector<VECTOR_STRING>::iterator     VECTOR_VECTOR_STRING_ITER;
 
 // We need to be notified when parameters we are logging get changed, so we'll
 // watch for <int> events from the SettingsStore too.
-class CUserLog : public CUserLogBase, public Dasher::CSettingsObserver {
+class CUserLog : public CUserLogBase, public Dasher::CSettingsUserObserver {
 public:
   CUserLog(Dasher::CSettingsUser *pCreateFrom, Observable<const Dasher::CEditEvent *> *pHandler, int iLogTypeMask);
 
diff --git a/Src/DasherCore/UserLogBase.cpp b/Src/DasherCore/UserLogBase.cpp
index 5a1c170..0628c7a 100644
--- a/Src/DasherCore/UserLogBase.cpp
+++ b/Src/DasherCore/UserLogBase.cpp
@@ -14,12 +14,12 @@
 
 using namespace Dasher;
 
-CUserLogBase::CUserLogBase(CSettingsUser *pCreateFrom, Observable<const CEditEvent *> *pHandler) : CSettingsUser(pCreateFrom), TransientObserver<const CEditEvent *>(pHandler), m_iNumDeleted(0) {
+CUserLogBase::CUserLogBase(Observable<const CEditEvent *> *pHandler) : TransientObserver<const CEditEvent *>(pHandler), m_iNumDeleted(0) {
 };
 
 void CUserLogBase::HandleEvent(const CEditEvent *evt) {
   if (evt->m_iEditType == 1) {
-    m_vAdded.push_back(evt->m_pNode->GetSymbolProb(GetLongParameter(LP_NORMALIZATION)));
+    m_vAdded.push_back(evt->m_pNode->GetSymbolProb());
     //output
   } else if (evt->m_iEditType == 2) {
     //delete
@@ -37,4 +37,4 @@ void CUserLogBase::FrameEnded() {
    AddSymbols(&m_vAdded);
     m_vAdded.clear();
   }
-}
\ No newline at end of file
+}
diff --git a/Src/DasherCore/UserLogBase.h b/Src/DasherCore/UserLogBase.h
index c63e82c..02503aa 100644
--- a/Src/DasherCore/UserLogBase.h
+++ b/Src/DasherCore/UserLogBase.h
@@ -16,9 +16,9 @@ namespace Dasher {
 
 /// \defgroup Logging Logging routines
 /// @{
-class CUserLogBase : protected Dasher::CSettingsUser, protected TransientObserver<const Dasher::CEditEvent *> {
+class CUserLogBase : protected TransientObserver<const Dasher::CEditEvent *> {
  public:
-  CUserLogBase(Dasher::CSettingsUser *pCreateFrom, Observable<const Dasher::CEditEvent*> *pHandler);
+  CUserLogBase(Observable<const Dasher::CEditEvent*> *pHandler);
 
   virtual void AddParam(const std::string& strName, const std::string& strValue, int iOptionMask = 0) = 0;
   virtual void AddParam(const std::string& strName, double dValue, int iOptionMask = 0) = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]