From 7bc07b613f9fed3dcef26f63332ea68db1e1f381 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 9 Jul 2011 01:09:06 +0200 Subject: added auto mapping feature by LordSkelethom --- src/game/editor/editor.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/game/editor/editor.cpp') diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index bc00c4a2..907552dc 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -8,20 +8,20 @@ #include #include #include -#include #include #include #include +#include -#include #include +#include +#include #include +#include #include +#include "auto_map.h" #include "editor.h" -#include - -#include int CEditor::ms_CheckerTexture; int CEditor::ms_BackgroundTexture; @@ -1899,6 +1899,7 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser) *pImg = ImgInfo; pImg->m_External = External; pEditor->ExtractName(pFileName, pImg->m_aName, sizeof(pImg->m_aName)); + pImg->m_AutoMapper.Load(pImg->m_aName); pImg->m_TexID = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0); pEditor->SortImages(); for(int i = 0; i < pEditor->m_Map.m_lImages.size(); ++i) @@ -1930,6 +1931,7 @@ void CEditor::AddImage(const char *pFileName, int StorageType, void *pUser) pImg->m_TexID = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0); pImg->m_External = 1; // external by default str_copy(pImg->m_aName, aBuf, sizeof(pImg->m_aName)); + pImg->m_AutoMapper.Load(pImg->m_aName); pEditor->m_Map.m_lImages.add(pImg); pEditor->SortImages(); if(pEditor->m_SelectedImage > -1 && pEditor->m_SelectedImage < pEditor->m_Map.m_lImages.size()) -- cgit 1.4.1