Skip to content

Commit

Permalink
сохранение платформ
Browse files Browse the repository at this point in the history
  • Loading branch information
spidamoo committed Sep 23, 2013
1 parent 3c36301 commit 5276bff
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 83 deletions.
134 changes: 67 additions & 67 deletions SoDlib/SoDlib.layout
Original file line number Diff line number Diff line change
@@ -1,206 +1,206 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="src\CharacterAction.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Game.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="2183" topLine="55" />
</Cursor>
</File>
<File name="hgecolor.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\GroundLine.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="456" topLine="0" />
</Cursor>
</File>
<File name="src\CharacterActionCause.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\NonPlayerCharacter.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="hgefont.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\PlayerCharacter.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\CharacterActionEffect.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\SoDlib.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="907" topLine="0" />
</Cursor>
</File>
<File name="hgegui.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\hgeGUIMenuItem.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\CharacterHotSpot.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\tinystr.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="3495" topLine="99" />
</Cursor>
</File>
<File name="hgeguictrls.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgeanim.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\Construction.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\tinyxml.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="15429" topLine="455" />
</Cursor>
</File>
<File name="src\DebugDraw.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgecolor.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\Exception.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Animation.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Character.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="13109" topLine="143" />
</Cursor>
<Folding>
<Collapse line="31" />
</Folding>
</File>
<File name="src\GUIWindow.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterAction.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Character.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="365" topLine="0" />
</Cursor>
</File>
<File name="src\Game.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgefont.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3644" topLine="138" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterAction.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterActionCause.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\GroundLine.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgegui.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2708" topLine="87" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterActionCause.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterActionEffect.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterActionEffect.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgeguictrls.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterHotSpot.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterHotSpot.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\NonPlayerCharacter.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Construction.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Construction.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\DebugDraw.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\PlayerCharacter.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="325" topLine="0" />
<Cursor1 position="0" topLine="0" />
</Cursor>
<Folding>
<Collapse line="18" />
<Collapse line="41" />
</Folding>
</File>
<File name="include\DebugDraw.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Exception.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\hgeGUIMenuItem.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Character.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="365" topLine="0" />
</Cursor>
</File>
<File name="include\Exception.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\GUIWindow.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\GUIWindow.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterAction.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="tinyxml.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Game.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1368" topLine="32" />
<Cursor1 position="3644" topLine="138" />
</Cursor>
</File>
<File name="include\Game.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterActionCause.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2183" topLine="55" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\GroundLine.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\GroundLine.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="456" topLine="0" />
<Cursor1 position="2708" topLine="87" />
</Cursor>
</File>
<File name="include\NonPlayerCharacter.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterActionEffect.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\PlayerCharacter.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterHotSpot.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\SoDlib.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\NonPlayerCharacter.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="907" topLine="0" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\hgeGUIMenuItem.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Construction.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\tinystr.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\PlayerCharacter.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3495" topLine="99" />
<Cursor1 position="325" topLine="0" />
</Cursor>
<Folding>
<Collapse line="18" />
<Collapse line="41" />
</Folding>
</File>
<File name="include\tinyxml.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\DebugDraw.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="15429" topLine="455" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\Animation.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\hgeGUIMenuItem.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\Character.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Exception.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="13109" topLine="143" />
<Cursor1 position="0" topLine="0" />
</Cursor>
<Folding>
<Collapse line="31" />
</Folding>
</File>
<File name="hgeanim.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\GUIWindow.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="tinyxml.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1368" topLine="32" />
</Cursor>
</File>
</CodeBlocks_layout_file>
6 changes: 6 additions & 0 deletions mapEditor/bin/Debug/map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@
<ground_line x1="1.84998" y1="6.31751" x2="4.33749" y2="6.31751" />
<ground_line x1="-0.1" y1="9.53002" x2="10.1" y2="9.51752" />
<ground_line x1="0.00250208" y1="7.875" x2="1.22125" y2="7.87875" />
<platform ground_lines="1" animations="1" spots="2">
<ground_line index="4" />
<animation index="6" />
<spot time="2" x="0.15" y="4.06" angle="0" />
<spot time="2" x="0" y="0" angle="0" />
</platform>
</map>
Binary file modified mapEditor/bin/Debug/mapEditor.exe
Binary file not shown.
12 changes: 6 additions & 6 deletions mapEditor/bin/Debug/map_editor.log
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
HGE Started..

HGE version: 1.80
Date: 23.09.2013, 01:34:10
Date: 23.09.2013, 19:24:07

Application: SoD map editor
OS: Windows 5.1.2600
Memory: 2097151K total, 2037280K free
OS: Windows 6.1.7600
Memory: 4158584K total, 1395844K free

D3D Driver: nv4_disp.dll
Description: NVIDIA GeForce 9600M GS
Version: 6.14.12.6658
D3D Driver: igdumd32.dll
Description: ����� ��������� Intel(R) G41 Express (���������� ���������� - WDDM 1.1)
Version: 8.15.10.1749
Mode: 1600 x 900 x X8R8G8B8

Init done.
Expand Down
65 changes: 65 additions & 0 deletions mapEditor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,31 @@ bool saveMap(char* fn)
element->SetDoubleAttribute("x2", groundLines[i]->getEndPoint().x);
element->SetDoubleAttribute("y2", groundLines[i]->getEndPoint().y);
}
for (int i = 0; i < platformsCount; i++) {
TiXmlElement* element = new TiXmlElement( "platform" );
root->LinkEndChild( element );
element->SetAttribute("ground_lines", platformGroundLinesCounts[i]);
element->SetAttribute("animations", platformAnimsCounts[i]);
element->SetAttribute("spots", platformSpotsCounts[i]);
for (int j = 0; j < platformGroundLinesCounts[i]; j++) {
TiXmlElement* child = new TiXmlElement( "ground_line" );
element->LinkEndChild( child );
child->SetAttribute("index", platformGroundLines[i][j]);
}
for (int j = 0; j < platformAnimsCounts[i]; j++) {
TiXmlElement* child = new TiXmlElement( "animation" );
element->LinkEndChild( child );
child->SetAttribute("index", platformAnims[i][j]);
}
for (int j = 0; j < platformSpotsCounts[i]; j++) {
TiXmlElement* child = new TiXmlElement( "spot" );
element->LinkEndChild( child );
child->SetDoubleAttribute("time", platformSpotsTimes[i][j]);
child->SetDoubleAttribute("x", platformSpotX[i][j]);
child->SetDoubleAttribute("y", platformSpotY[i][j]);
child->SetDoubleAttribute("angle", platformSpotAngle[i][j]);
}
}

doc.LinkEndChild( root );
doc.SaveFile(fn);
Expand Down Expand Up @@ -268,6 +293,46 @@ bool loadMap(char* fn)
element = element->NextSiblingElement("ground_line");
}
groundLinesCount = i;

i = 0;
element = root->FirstChildElement("platform");
while (element) {
int j =0;
TiXmlElement* child = element->FirstChildElement("ground_line");
while (child) {
platformGroundLines[i][j] = atoi(child->Attribute("index"));
j++;
child = child->NextSiblingElement("ground_line");
}
platformGroundLinesCounts[i] = j;

j = 0;
child = element->FirstChildElement("animation");
while (child) {
platformAnims[i][j] = atoi(child->Attribute("index"));
j++;
child = child->NextSiblingElement("animation");
}
platformAnimsCounts[i] = j;

j = 0;
child = element->FirstChildElement("spot");
while (child) {
platformSpotsTimes[i][j] = atof(child->Attribute("time"));
platformSpotX[i][j] = atof(child->Attribute("x"));
platformSpotY[i][j] = atof(child->Attribute("y"));
platformSpotAngle[i][j] = atof(child->Attribute("angle"));
j++;
child = child->NextSiblingElement("spot");
}
platformSpotsCounts[i] = j;

i++;
element = element->NextSiblingElement("platform");
}
platformsCount = i;

//delete root;
} else {
printf("failed\n");
}
Expand Down
2 changes: 1 addition & 1 deletion mapEditor/mapEditor.depend
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
1378306187 d:\www\git\sod\sodlib\include\mapanimation.h
<SoDlib.h>

1379685303 source:d:\git\sod\mapeditor\main.cpp
1379949683 source:d:\git\sod\mapeditor\main.cpp
<stdio.h>
<hge.h>
<hgefont.h>
Expand Down
Loading

0 comments on commit 5276bff

Please sign in to comment.