diff --git a/celldrawer.cpp b/celldrawer.cpp index c66d0328..eda18d26 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -2542,7 +2542,7 @@ void celldrawer::draw() { return; } - if((cmode & sm::DRAW) && texture::config.tstate == texture::tsActive && !mouseout() && c) + if((cmode & sm::DRAW) && mapeditor::intexture && !mouseout() && c) mapeditor::draw_texture_ghosts(c, V); #endif diff --git a/mapeditor.cpp b/mapeditor.cpp index 533d606d..e309e1b3 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -11,6 +11,7 @@ namespace hr { EX namespace mapeditor { EX bool drawing_tool; + EX bool intexture; #if HDR enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor, sgWall }; @@ -1754,19 +1755,21 @@ EX namespace mapeditor { string line1, line2; usershape *us = NULL; + +#if CAP_TEXTURE + if(texture::config.tstate != texture::tsActive && intexture) { + intexture = false; drawing_tool = true; + } +#endif - bool intexture = false; - (void) intexture; - - bool freedraw = drawing_tool; + bool freedraw = drawing_tool || intexture; #if CAP_TEXTURE - if(texture::config.tstate == texture::tsActive) { + if(intexture) { sg = 16; line1 = "texture"; line2 = ""; texture::config.data.update(); - intexture = true; freedraw = true; drawing_tool = false; } @@ -2430,11 +2433,7 @@ EX namespace mapeditor { (void)clickused; - bool freedraw = drawing_tool; - #if CAP_TEXTURE - bool intexture = texture::config.tstate == texture::tsActive; - freedraw |= intexture; - #endif + bool freedraw = drawing_tool || intexture; if(freedraw) { if(lstartcell) lstart = ggmatrix(lstartcell) * lstart_rel; diff --git a/menus.cpp b/menus.cpp index 3c0a4af6..0e0e81f1 100644 --- a/menus.cpp +++ b/menus.cpp @@ -423,6 +423,7 @@ EX void showCreative() { dialog::addItem(XLAT("shape editor"), 'g'); dialog::add_action([] { mapeditor::drawing_tool = false; + mapeditor::intexture = false; pushScreen(mapeditor::showDrawEditor); mapeditor::initdraw(cwt.at); }); @@ -433,6 +434,7 @@ EX void showCreative() { dialog::add_action([] { dialog::cheat_if_confirmed([] { mapeditor::drawing_tool = true; + mapeditor::intexture = false; pushScreen(mapeditor::showDrawEditor); mapeditor::initdraw(cwt.at); }); diff --git a/textures.cpp b/textures.cpp index 23409455..e1be37c6 100644 --- a/textures.cpp +++ b/textures.cpp @@ -1243,12 +1243,13 @@ string texturehelp = #if CAP_EDIT EX 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); + mapeditor::intexture = true; + mapeditor::drawing_tool = false; pushScreen(mapeditor::showDrawEditor); } } @@ -1393,6 +1394,8 @@ EX void showMenu() { if(GDIM == 2) { dialog::addItem(XLAT("edit the texture"), 'e'); dialog::add_action([] { + mapeditor::intexture = true; + mapeditor::drawing_tool = false; mapeditor::initdraw(cwt.at); pushScreen(mapeditor::showDrawEditor); });