MCPcopy Create free account
hub / github.com/MyGUI/mygui / deserialization

Method deserialization

Common/Input/SDL/ResourceSDLPointer.cpp:13–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13 void ResourceSDLPointer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
14 {
15 Base::deserialization(_node, _version);
16
17 MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
18 while (info.next())
19 {
20 if (info->getName() == "Property")
21 {
22 std::string_view key = info->findAttribute("key");
23
24 if (key == "SourceFile")
25 {
26 //std::string path = MyGUI::DataManager::getInstance().getDataPath(info->getContent());
27 //mCursorType = (size_t)LoadCursorFromFileA(path.c_str());
28 }
29 else if (key == "SourceSystem")
30 {
31 const std::string& value = info->getContent();
32 if (value == "SDL_SYSTEM_CURSOR_ARROW")
33 mCursorType = SDL_SYSTEM_CURSOR_ARROW;
34 else if (value == "SDL_SYSTEM_CURSOR_IBEAM")
35 mCursorType = SDL_SYSTEM_CURSOR_IBEAM;
36 else if (value == "SDL_SYSTEM_CURSOR_WAIT")
37 mCursorType = SDL_SYSTEM_CURSOR_WAIT;
38 else if (value == "SDL_SYSTEM_CURSOR_CROSSHAIR")
39 mCursorType = SDL_SYSTEM_CURSOR_CROSSHAIR;
40 else if (value == "SDL_SYSTEM_CURSOR_SIZENWSE")
41 mCursorType = SDL_SYSTEM_CURSOR_SIZENWSE;
42 else if (value == "SDL_SYSTEM_CURSOR_SIZENESW")
43 mCursorType = SDL_SYSTEM_CURSOR_SIZENESW;
44 else if (value == "SDL_SYSTEM_CURSOR_SIZEWE")
45 mCursorType = SDL_SYSTEM_CURSOR_SIZEWE;
46 else if (value == "SDL_SYSTEM_CURSOR_SIZENS")
47 mCursorType = SDL_SYSTEM_CURSOR_SIZENS;
48 else if (value == "SDL_SYSTEM_CURSOR_SIZEALL")
49 mCursorType = SDL_SYSTEM_CURSOR_SIZEALL;
50 else if (value == "SDL_SYSTEM_CURSOR_NO")
51 mCursorType = SDL_SYSTEM_CURSOR_NO;
52 else if (value == "SDL_SYSTEM_CURSOR_HAND")
53 mCursorType = SDL_SYSTEM_CURSOR_HAND;
54 }
55 }
56 }
57 }
58
59}

Callers

nothing calls this directly

Calls 4

getElementEnumeratorMethod · 0.80
findAttributeMethod · 0.80
deserializationFunction · 0.50
nextMethod · 0.45

Tested by

no test coverage detected