summaryrefslogtreecommitdiffstats
path: root/Tools/BiomeVisualiser/BiomeViewWnd.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2013-12-09 18:51:12 +0100
committerworktycho <work.tycho@gmail.com>2013-12-09 18:51:12 +0100
commit843605d59ebc128be0a578dc6f45ef8c05da6e79 (patch)
tree3ffebc6ba27baf7a9e1d4bc51501ffeea9b14226 /Tools/BiomeVisualiser/BiomeViewWnd.cpp
parentmerged makefile changes (diff)
parentFix Undefined behavior at Bindings/LuaWindow line 32 (diff)
downloadcuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.gz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.bz2
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.lz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.xz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.zst
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.zip
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)
{