diff --git a/hyper.h b/hyper.h index d7010825..fa4fb141 100644 --- a/hyper.h +++ b/hyper.h @@ -3268,6 +3268,7 @@ namespace texture { extern bool texture_aura; bool using_aura(); + void start_editor(); } #endif diff --git a/menus.cpp b/menus.cpp index a966b0bb..9d1384e3 100644 --- a/menus.cpp +++ b/menus.cpp @@ -755,18 +755,19 @@ void showStartMenu() { #if CAP_TEXTURE && CAP_EDIT else if(uni == 'T') { popScreenAll(); + pushScreen(texture::showMenu); resetModes('c'); + stop_game(); + firstland = specialland = laCanvas; + cheater = true; + patterns::canvasback = 0xFFFFFF; + mapeditor::drawplayer = false; + start_game(); clearMessages(); welcomeMessage(); - using namespace texture; - if(config.data.whitetexture() && config.data.loadTextureGL()) { - config.tstate = config.tstate_max = tsActive; - config.perform_mapping(); - config.finish_mapping(); - mapeditor::initdraw(cwt.at); - pushScreen(showMenu); - pushScreen(mapeditor::showDrawEditor); - } + calcparam(); + drawthemap(); + texture::start_editor(); } #endif else if(uni == 'g') { diff --git a/textures.cpp b/textures.cpp index 2ab8d0f5..f62b3ef4 100644 --- a/textures.cpp +++ b/textures.cpp @@ -1056,6 +1056,17 @@ string texturehelp = "(these probably work best with the 'large picture' setting in geometry selection). " "Again, tesselations can have their geometry changed.\n\n"; +void start_editor() { + addMessage("white"); + if(config.data.whitetexture() && config.data.loadTextureGL()) { + config.tstate = config.tstate_max = tsActive; + config.perform_mapping(); + config.finish_mapping(); + mapeditor::initdraw(cwt.at); + pushScreen(mapeditor::showDrawEditor); + } + } + void showMenu() { cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; gamescreen(0); @@ -1215,16 +1226,7 @@ void showMenu() { pushScreen(mapeditor::showDrawEditor); } - else if(uni == 'n' && config.tstate == tsOff) { - addMessage("white"); - if(config.data.whitetexture() && config.data.loadTextureGL()) { - config.tstate = config.tstate_max = tsActive; - config.perform_mapping(); - config.finish_mapping(); - mapeditor::initdraw(cwt.at); - pushScreen(mapeditor::showDrawEditor); - } - } + else if(uni == 'n' && config.tstate == tsOff) start_editor(); #endif else if(uni == 't' && config.tstate == tsOff)