Mouse Destruction and Building fixes. #25

Open
WildEgo wants to merge 2 commits from WildEgo/client:nightly into master
5 changed files with 52 additions and 35 deletions

2
.gitignore vendored
View File

@ -378,3 +378,5 @@ FodyWeavers.xsd
# Build directories
build/
dist/
src/vcpkg_installed

12
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
"configurations": [
{
"type": "cmake",
"request": "launch",
"name": "Debug portfile(s)",
"cmakeDebugType": "external",
"pipeName": "/tmp/vcpkg_ext_portfile_dbg",
"preLaunchTask": "Debug vcpkg commands"
}
]
}

View File

@ -16,7 +16,7 @@ import systemSetting
import localeInfo
## Mouse Controler
## <EFBFBD><EFBFBD><EFBFBD>콺 Ŀ<><C4BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD>콺 Ŀ<><C4BF><EFBFBD><EFBFBD> Attach<63>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD> Object<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD>.
## When the cursor is over the object, the Attach menu appears and allows attaching or editing the object.
class CursorImage(object):
def __init__(self):
@ -57,9 +57,7 @@ class CursorImage(object):
grpImage.Render(self.handle)
class CMouseController(object):
def __init__(self):
self.x = 0
self.y = 0
@ -84,9 +82,12 @@ class CMouseController(object):
self.DeattachObject()
self.callbackDict = {}
self.cursorDict = {}
def __del__(self):
self.callbackDict = {}
for k, v in self.cursorDict.items():
v.DeleteImage()
def Create(self):
self.IsSoftwareCursor = systemSetting.IsSoftwareCursor()
@ -157,7 +158,7 @@ class CMouseController(object):
self.curCursorImage = self.cursorDict[app.NORMAL]
except KeyError:
dbg.TraceError("mouseModule.MouseController.SetCursor - <20>߸<EFBFBD><DFB8><EFBFBD> Ŀ<><C4BF> <20><>ȣ [%d]" % cursorNum)
dbg.TraceError("mouseModule.MouseController.SetCursor - <20>߸<EFBFBD><DFB8><EFBFBD> Ŀ<><C4BF> <20><>ȣ [%d]" % cursorNum)
self.curCursorName = app.NORMAL
self.curCursorImage = self.cursorDict[app.NORMAL]

View File

@ -57,6 +57,7 @@ def RunApp():
app.Loop()
mainStream.Destroy()
del mouseModule.mouseController
RunApp()

View File

@ -5,13 +5,13 @@
#include "PropertyManager.h"
#include "Property.h"
/*
* CProperty 파일 포맷
*
* 0 ~ 4 bytes: fourcc
* 5 ~ 6 bytes: \r\n
*
* 그 이후의 바이트들은 텍스트 파일 로더와 같은 구조
*/
* CProperty file format
*
* 0 ~ 4 bytes: fourcc
* 5 ~ 6 bytes: \r\n
*
* The bytes after that are structured like a text file loader
*/
CProperty::CProperty(const char * c_pszFileName) : mc_pFileName(NULL), m_dwCRC(0)
{
m_stFileName = c_pszFileName;
@ -68,25 +68,25 @@ bool CProperty::GetVector(const char * c_pszKey, CTokenVector & rTokenVector)
if (m_stTokenMap.end() == it)
return false;
// NOTE : 튕김 현상 발견
// std::copy(rTokenVector.begin(), it->second.begin(), it->second.end());
// NOTE : 레퍼런스에는 이런 식으로 하게끔 되어 있음
///////////////////////////////////////////////////////////////////////////////
// template <class InputIterator, class OutputIterator>
// OutputIterator copy(InputIterator first, InputIterator last,
// OutputIterator result);
//
// vector<int> V(5);
// iota(V.begin(), V.end(), 1);
// list<int> L(V.size());
// copy(V.begin(), V.end(), L.begin());
// assert(equal(V.begin(), V.end(), L.begin()));
///////////////////////////////////////////////////////////////////////////////
// 헌데 그래도 튕김. - [levites]
// std::copy(it->second.begin(), it->second.end(), rTokenVector.begin());
// NOTE: Crash issue discovered
// std::copy(rTokenVector.begin(), it->second.begin(), it->second.end());
// NOTE: According to the reference, it's supposed to be done like this
///////////////////////////////////////////////////////////////////////////////
// template <class InputIterator, class OutputIterator>
// OutputIterator copy(InputIterator first, InputIterator last,
// OutputIterator result);
//
// vector<int> V(5);
// iota(V.begin(), V.end(), 1);
// list<int> L(V.size());
// copy(V.begin(), V.end(), L.begin());
// assert(equal(V.begin(), V.end(), L.begin()));
///////////////////////////////////////////////////////////////////////////////
// But it still crashes. - [levites]
// std::copy(it->second.begin(), it->second.end(), rTokenVector.begin());
// 결국 이렇게.. - [levites]
// 현재 사용하는 곳 : WorldEditor/Dialog/MapObjectPropertyPageBuilding.cpp
// Ended up doing it this way.. - [levites]
// Current usage location: WorldEditor/Dialog/MapObjectPropertyPageBuilding.cpp
CTokenVector & rSourceTokenVector = it->second;
CTokenVector::iterator itor = rSourceTokenVector.begin();
for (; itor != rSourceTokenVector.end(); ++itor)
@ -102,7 +102,7 @@ void CProperty::PutString(const char * c_pszKey, const char * c_pszString)
std::string stTempKey = c_pszKey;
stl_lowers(stTempKey);
// 이미 있는걸 지움
// Deleting/removing what already exists
CTokenVectorMap::iterator itor = m_stTokenMap.find(stTempKey);
if (itor != m_stTokenMap.end())
@ -145,16 +145,17 @@ bool CProperty::ReadFromMemory(const void * c_pvData, int iLen, const char * c_p
pcData += sizeof(DWORD);
if (*pcData != '\r' || *(pcData + 1) != '\n')
{
if ((*pcData == '\r' && *(pcData + 1) == '\n'))
pcData += 2;
else if (*pcData == '\n')
pcData += 1;
else {
TraceError("CProperty::ReadFromMemory: File format error after FourCC: %s\n", c_pszFileName);
return false;
}
pcData += 2;
CTokenVector stTokenVector;
/*
/*
char szTimeStamp[64];
memcpy(szTimeStamp, pcData, 14);
szTimeStamp[14] = '\0';