summaryrefslogtreecommitdiffstats
path: root/Tools/BiomeVisualiser/BiomeViewWnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/BiomeVisualiser/BiomeViewWnd.cpp')
-rw-r--r--Tools/BiomeVisualiser/BiomeViewWnd.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/Tools/BiomeVisualiser/BiomeViewWnd.cpp b/Tools/BiomeVisualiser/BiomeViewWnd.cpp
index 3dd1bb4e0..5c1240bc7 100644
--- a/Tools/BiomeVisualiser/BiomeViewWnd.cpp
+++ b/Tools/BiomeVisualiser/BiomeViewWnd.cpp
@@ -7,7 +7,7 @@
#include "BiomeViewWnd.h"
#include "BiomeCache.h"
#include "GeneratorBiomeSource.h"
-#include "../iniFile/iniFile.h"
+#include "iniFile/iniFile.h"
@@ -34,6 +34,8 @@ bool cBiomeViewWnd::Create(HWND a_ParentWnd, LPCTSTR a_Title)
{
ASSERT(m_Wnd == NULL);
+ InitBiomeView();
+
// Create a regular STATIC window, then override its window procedure with our own. No need for obnoxious RegisterWindowClass() stuff.
m_Wnd = CreateWindow("STATIC", a_Title, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 400, 300, a_ParentWnd, NULL, GetModuleHandle(NULL), NULL);
if (m_Wnd == NULL)
@@ -43,11 +45,6 @@ bool cBiomeViewWnd::Create(HWND a_ParentWnd, LPCTSTR a_Title)
}
SetWindowLongPtr(m_Wnd, GWLP_WNDPROC, m_Thunk);
- cIniFile IniFile;
- cBiomeGen * BioGen = new cBioGenMultiStepMap(2);
- BioGen->Initialize(IniFile);
- m_Renderer.SetSource(new cGeneratorBiomeSource(BioGen));
-
return true;
}
@@ -55,6 +52,20 @@ bool cBiomeViewWnd::Create(HWND a_ParentWnd, LPCTSTR a_Title)
+void cBiomeViewWnd::InitBiomeView(void)
+{
+ cIniFile IniFile;
+ IniFile.ReadFile("world.ini");
+ int Seed = IniFile.GetValueSetI("Generator", "Seed", 0);
+ bool CacheOffByDefault = false;
+ m_BiomeGen = cBiomeGen::CreateBiomeGen(IniFile, Seed, CacheOffByDefault);
+ m_Renderer.SetSource(new cGeneratorBiomeSource(m_BiomeGen));
+ IniFile.WriteFile("world.ini");
+}
+
+
+
+
LRESULT cBiomeViewWnd::WndProc(HWND a_Wnd, UINT a_Msg, WPARAM wParam, LPARAM lParam)
{