Browse Source

improved atlas tool
added pause events
added new example

Denis Muratshin 12 years ago
parent
commit
77c47e6df0

BIN
doc.zip


+ 2 - 2
examples/Demo/src/TestMask.h

@@ -7,7 +7,7 @@ class TestMask: public Test
 public:
 	timeMS _lastSnow;
 
-	spMaskedActor _masked;
+	spMaskedSprite _masked;
 	spSprite _mask;
 
 	TestMask():_lastSnow(0)
@@ -25,7 +25,7 @@ public:
 		_mask->addTween(Actor::TweenX(content->getWidth() - 100), 10000, -1, true);
 		_mask->addTween(Actor::TweenY(content->getHeight() - 50), 12000, -1, true);
 
-		_masked = initActor(new MaskedActor,
+		_masked = initActor(new MaskedSprite,
 			arg_attachTo = content);
 
 		_masked->setMask(_mask);

+ 28 - 0
examples/TutorialResources/TutorialResources.mkb

@@ -0,0 +1,28 @@
+#!/usr/bin/env mkb
+
+options
+{
+	module_path="../../oxygine/marmalade/"
+	enable-exceptions=1
+}
+
+includepath src
+
+files
+{
+	[src]
+	(src)
+	"*.h"
+	"*.cpp"
+}
+
+subprojects
+{
+	oxygine-framework
+	iwgl 
+}
+
+assets
+{
+	(data)
+}

+ 8 - 0
examples/TutorialResources/data/animals.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<resources>
+	<set path = "images/animals" />
+	<atlas>
+		<image file="cat.png" />
+		<image file="dog.png"/>		
+	</atlas>
+</resources>

+ 19 - 0
examples/TutorialResources/data/app.icf

@@ -0,0 +1,19 @@
+[S3E]
+MemSize = 64777216
+DispFixRot=2
+SysGlesVersion=2
+SysStackSize=131072
+
+[Trace]
+ALL=0
+EXT=0
+NONE=0
+DEVICE=0
+FIBRE=0
+THREAD=0
+LOADER=0
+SOUND=0
+FILE=0
+SURFACE=0
+MEMORY=0
+ERROR=0

+ 105 - 0
examples/TutorialResources/data/fonts/main.fnt

@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<font>
+  <info face="Century Gothic" size="-24" bold="1" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="1,1" outline="0"/>
+  <common lineHeight="28" base="23" scaleW="256" scaleH="128" pages="1" packed="0" alphaChnl="1" redChnl="0" greenChnl="0" blueChnl="0"/>
+  <pages>
+    <page id="0" file="main_0.png" />
+  </pages>
+  <chars count="95">
+    <char id="32" x="91" y="19" width="1" height="1" xoffset="0" yoffset="23" xadvance="7" page="0" chnl="15" />
+    <char id="33" x="43" y="59" width="4" height="17" xoffset="1" yoffset="6" xadvance="7" page="0" chnl="15" />
+    <char id="34" x="47" y="77" width="8" height="6" xoffset="0" yoffset="6" xadvance="9" page="0" chnl="15" />
+    <char id="35" x="186" y="19" width="13" height="17" xoffset="0" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="36" x="56" y="0" width="11" height="21" xoffset="0" yoffset="5" xadvance="13" page="0" chnl="15" />
+    <char id="37" x="91" y="0" width="20" height="18" xoffset="1" yoffset="6" xadvance="21" page="0" chnl="15" />
+    <char id="38" x="127" y="19" width="14" height="17" xoffset="1" yoffset="6" xadvance="16" page="0" chnl="15" />
+    <char id="39" x="56" y="76" width="3" height="6" xoffset="1" yoffset="6" xadvance="5" page="0" chnl="15" />
+    <char id="40" x="0" y="0" width="7" height="23" xoffset="1" yoffset="5" xadvance="9" page="0" chnl="15" />
+    <char id="41" x="8" y="0" width="7" height="23" xoffset="1" yoffset="5" xadvance="9" page="0" chnl="15" />
+    <char id="42" x="17" y="78" width="10" height="9" xoffset="0" yoffset="6" xadvance="11" page="0" chnl="15" />
+    <char id="43" x="5" y="78" width="11" height="11" xoffset="1" yoffset="9" xadvance="14" page="0" chnl="15" />
+    <char id="44" x="40" y="78" width="6" height="7" xoffset="0" yoffset="19" xadvance="7" page="0" chnl="15" />
+    <char id="45" x="86" y="72" width="6" height="3" xoffset="2" yoffset="15" xadvance="10" page="0" chnl="15" />
+    <char id="46" x="81" y="73" width="4" height="4" xoffset="1" yoffset="19" xadvance="7" page="0" chnl="15" />
+    <char id="47" x="80" y="0" width="10" height="21" xoffset="0" yoffset="6" xadvance="11" page="0" chnl="15" />
+    <char id="48" x="242" y="18" width="12" height="17" xoffset="0" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="49" x="29" y="60" width="6" height="17" xoffset="2" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="50" x="77" y="40" width="11" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="51" x="0" y="42" width="12" height="17" xoffset="0" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="52" x="39" y="41" width="12" height="17" xoffset="0" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="53" x="65" y="40" width="11" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="54" x="184" y="37" width="10" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="55" x="137" y="37" width="11" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="56" x="26" y="42" width="12" height="17" xoffset="0" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="57" x="173" y="37" width="10" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="58" x="0" y="78" width="4" height="13" xoffset="1" yoffset="10" xadvance="7" page="0" chnl="15" />
+    <char id="59" x="56" y="59" width="6" height="16" xoffset="0" yoffset="10" xadvance="7" page="0" chnl="15" />
+    <char id="60" x="125" y="37" width="11" height="17" xoffset="1" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="61" x="28" y="78" width="11" height="8" xoffset="1" yoffset="10" xadvance="14" page="0" chnl="15" />
+    <char id="62" x="113" y="37" width="11" height="17" xoffset="1" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="63" x="101" y="37" width="11" height="17" xoffset="1" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="64" x="38" y="23" width="18" height="17" xoffset="0" yoffset="6" xadvance="18" page="0" chnl="15" />
+    <char id="65" x="93" y="19" width="17" height="17" xoffset="0" yoffset="6" xadvance="18" page="0" chnl="15" />
+    <char id="66" x="89" y="40" width="11" height="17" xoffset="2" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="67" x="75" y="22" width="17" height="17" xoffset="1" yoffset="6" xadvance="19" page="0" chnl="15" />
+    <char id="68" x="142" y="19" width="14" height="17" xoffset="2" yoffset="6" xadvance="17" page="0" chnl="15" />
+    <char id="69" x="0" y="60" width="9" height="17" xoffset="2" yoffset="6" xadvance="12" page="0" chnl="15" />
+    <char id="70" x="228" y="36" width="9" height="17" xoffset="2" yoffset="6" xadvance="12" page="0" chnl="15" />
+    <char id="71" x="19" y="24" width="18" height="17" xoffset="1" yoffset="6" xadvance="20" page="0" chnl="15" />
+    <char id="72" x="52" y="41" width="12" height="17" xoffset="2" yoffset="6" xadvance="16" page="0" chnl="15" />
+    <char id="73" x="52" y="59" width="3" height="17" xoffset="2" yoffset="6" xadvance="7" page="0" chnl="15" />
+    <char id="74" x="10" y="60" width="9" height="17" xoffset="1" yoffset="6" xadvance="12" page="0" chnl="15" />
+    <char id="75" x="200" y="18" width="13" height="17" xoffset="2" yoffset="6" xadvance="15" page="0" chnl="15" />
+    <char id="76" x="20" y="60" width="8" height="17" xoffset="2" yoffset="6" xadvance="11" page="0" chnl="15" />
+    <char id="77" x="217" y="0" width="21" height="17" xoffset="0" yoffset="6" xadvance="22" page="0" chnl="15" />
+    <char id="78" x="157" y="19" width="14" height="17" xoffset="2" yoffset="6" xadvance="18" page="0" chnl="15" />
+    <char id="79" x="0" y="24" width="18" height="17" xoffset="1" yoffset="6" xadvance="20" page="0" chnl="15" />
+    <char id="80" x="206" y="36" width="10" height="17" xoffset="2" yoffset="6" xadvance="13" page="0" chnl="15" />
+    <char id="81" x="112" y="0" width="19" height="18" xoffset="1" yoffset="6" xadvance="20" page="0" chnl="15" />
+    <char id="82" x="13" y="42" width="12" height="17" xoffset="2" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="83" x="217" y="36" width="10" height="17" xoffset="1" yoffset="6" xadvance="12" page="0" chnl="15" />
+    <char id="84" x="238" y="36" width="9" height="17" xoffset="0" yoffset="6" xadvance="10" page="0" chnl="15" />
+    <char id="85" x="161" y="37" width="11" height="17" xoffset="2" yoffset="6" xadvance="15" page="0" chnl="15" />
+    <char id="86" x="57" y="22" width="17" height="17" xoffset="0" yoffset="6" xadvance="17" page="0" chnl="15" />
+    <char id="87" x="193" y="0" width="23" height="17" xoffset="-1" yoffset="6" xadvance="22" page="0" chnl="15" />
+    <char id="88" x="239" y="0" width="16" height="17" xoffset="0" yoffset="6" xadvance="16" page="0" chnl="15" />
+    <char id="89" x="111" y="19" width="15" height="17" xoffset="0" yoffset="6" xadvance="15" page="0" chnl="15" />
+    <char id="90" x="195" y="37" width="10" height="17" xoffset="1" yoffset="6" xadvance="12" page="0" chnl="15" />
+    <char id="91" x="29" y="0" width="5" height="23" xoffset="2" yoffset="5" xadvance="8" page="0" chnl="15" />
+    <char id="92" x="68" y="0" width="11" height="21" xoffset="2" yoffset="6" xadvance="15" page="0" chnl="15" />
+    <char id="93" x="23" y="0" width="5" height="23" xoffset="0" yoffset="5" xadvance="8" page="0" chnl="15" />
+    <char id="94" x="105" y="55" width="13" height="13" xoffset="1" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="95" x="93" y="72" width="12" height="1" xoffset="0" yoffset="25" xadvance="12" page="0" chnl="15" />
+    <char id="96" x="73" y="73" width="7" height="5" xoffset="1" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="97" x="119" y="55" width="13" height="13" xoffset="1" yoffset="10" xadvance="16" page="0" chnl="15" />
+    <char id="98" x="172" y="19" width="13" height="17" xoffset="2" yoffset="6" xadvance="16" page="0" chnl="15" />
+    <char id="99" x="189" y="55" width="12" height="13" xoffset="2" yoffset="10" xadvance="15" page="0" chnl="15" />
+    <char id="100" x="214" y="18" width="13" height="17" xoffset="1" yoffset="6" xadvance="16" page="0" chnl="15" />
+    <char id="101" x="133" y="55" width="13" height="13" xoffset="1" yoffset="10" xadvance="15" page="0" chnl="15" />
+    <char id="102" x="36" y="60" width="6" height="17" xoffset="1" yoffset="6" xadvance="7" page="0" chnl="15" />
+    <char id="103" x="175" y="0" width="13" height="18" xoffset="1" yoffset="10" xadvance="16" page="0" chnl="15" />
+    <char id="104" x="149" y="37" width="11" height="17" xoffset="2" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="105" x="189" y="0" width="3" height="18" xoffset="1" yoffset="5" xadvance="6" page="0" chnl="15" />
+    <char id="106" x="16" y="0" width="6" height="23" xoffset="-1" yoffset="5" xadvance="6" page="0" chnl="15" />
+    <char id="107" x="228" y="18" width="13" height="17" xoffset="2" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="108" x="48" y="59" width="3" height="17" xoffset="1" yoffset="6" xadvance="6" page="0" chnl="15" />
+    <char id="109" x="85" y="58" width="19" height="13" xoffset="2" yoffset="10" xadvance="23" page="0" chnl="15" />
+    <char id="110" x="202" y="55" width="11" height="13" xoffset="2" yoffset="10" xadvance="14" page="0" chnl="15" />
+    <char id="111" x="147" y="55" width="13" height="13" xoffset="1" yoffset="10" xadvance="15" page="0" chnl="15" />
+    <char id="112" x="147" y="0" width="13" height="18" xoffset="2" yoffset="10" xadvance="16" page="0" chnl="15" />
+    <char id="113" x="161" y="0" width="13" height="18" xoffset="1" yoffset="10" xadvance="16" page="0" chnl="15" />
+    <char id="114" x="247" y="54" width="7" height="13" xoffset="1" yoffset="10" xadvance="8" page="0" chnl="15" />
+    <char id="115" x="237" y="54" width="9" height="13" xoffset="1" yoffset="10" xadvance="11" page="0" chnl="15" />
+    <char id="116" x="248" y="36" width="7" height="17" xoffset="0" yoffset="6" xadvance="7" page="0" chnl="15" />
+    <char id="117" x="226" y="54" width="10" height="13" xoffset="2" yoffset="10" xadvance="14" page="0" chnl="15" />
+    <char id="118" x="161" y="55" width="13" height="13" xoffset="0" yoffset="10" xadvance="13" page="0" chnl="15" />
+    <char id="119" x="63" y="59" width="21" height="13" xoffset="-1" yoffset="10" xadvance="19" page="0" chnl="15" />
+    <char id="120" x="175" y="55" width="13" height="13" xoffset="0" yoffset="10" xadvance="13" page="0" chnl="15" />
+    <char id="121" x="132" y="0" width="14" height="18" xoffset="0" yoffset="10" xadvance="14" page="0" chnl="15" />
+    <char id="122" x="214" y="54" width="11" height="13" xoffset="0" yoffset="10" xadvance="11" page="0" chnl="15" />
+    <char id="123" x="44" y="0" width="8" height="22" xoffset="0" yoffset="6" xadvance="8" page="0" chnl="15" />
+    <char id="124" x="53" y="0" width="2" height="22" xoffset="6" yoffset="6" xadvance="14" page="0" chnl="15" />
+    <char id="125" x="35" y="0" width="8" height="22" xoffset="0" yoffset="6" xadvance="8" page="0" chnl="15" />
+    <char id="126" x="60" y="76" width="12" height="5" xoffset="1" yoffset="12" xadvance="14" page="0" chnl="15" />
+  </chars>
+</font>

BIN
examples/TutorialResources/data/fonts/main_0.png


+ 164 - 0
examples/TutorialResources/data/fonts/system.fnt

@@ -0,0 +1,164 @@
+<?xml version="1.0"?>
+<font>
+  <info face="Arial" size="-12" bold="0" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="1,1" outline="0"/>
+  <common lineHeight="15" base="12" scaleW="128" scaleH="64" pages="1" packed="0" alphaChnl="1" redChnl="0" greenChnl="0" blueChnl="0"/>
+  <pages>
+    <page id="0" file="system_0.png" />
+  </pages>
+  <chars count="95">
+    <char id="32" x="53" y="39" width="1" height="1" xoffset="0" yoffset="12" xadvance="3" page="0" chnl="15" />
+    <char id="33" x="23" y="32" width="1" height="9" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="34" x="32" y="40" width="3" height="3" xoffset="0" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="35" x="0" y="13" width="7" height="9" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="36" x="48" y="0" width="5" height="10" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="37" x="70" y="0" width="9" height="9" xoffset="1" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="38" x="8" y="13" width="7" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="39" x="36" y="40" width="1" height="3" xoffset="1" yoffset="3" xadvance="2" page="0" chnl="15" />
+    <char id="40" x="12" y="0" width="3" height="11" xoffset="1" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="41" x="16" y="0" width="3" height="11" xoffset="0" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="42" x="26" y="42" width="5" height="4" xoffset="0" yoffset="3" xadvance="5" page="0" chnl="15" />
+    <char id="43" x="120" y="30" width="5" height="5" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="44" x="126" y="30" width="1" height="3" xoffset="1" yoffset="11" xadvance="3" page="0" chnl="15" />
+    <char id="45" x="49" y="39" width="3" height="1" xoffset="0" yoffset="8" xadvance="4" page="0" chnl="15" />
+    <char id="46" x="55" y="39" width="1" height="1" xoffset="1" yoffset="11" xadvance="3" page="0" chnl="15" />
+    <char id="47" x="15" y="33" width="3" height="9" xoffset="0" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="48" x="0" y="33" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="49" x="11" y="33" width="3" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="50" x="20" y="22" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="51" x="26" y="22" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="52" x="32" y="22" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="53" x="38" y="22" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="54" x="110" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="55" x="44" y="21" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="56" x="50" y="21" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="57" x="62" y="21" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="58" x="112" y="30" width="1" height="7" xoffset="1" yoffset="5" xadvance="3" page="0" chnl="15" />
+    <char id="59" x="125" y="0" width="1" height="9" xoffset="1" yoffset="5" xadvance="3" page="0" chnl="15" />
+    <char id="60" x="6" y="43" width="5" height="5" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="61" x="12" y="43" width="6" height="4" xoffset="0" yoffset="6" xadvance="7" page="0" chnl="15" />
+    <char id="62" x="0" y="43" width="5" height="5" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="63" x="80" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="64" x="0" y="0" width="11" height="12" xoffset="1" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="65" x="80" y="0" width="9" height="9" xoffset="-1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="66" x="104" y="10" width="6" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="67" x="40" y="11" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="68" x="88" y="10" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="69" x="0" y="23" width="6" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="70" x="122" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="71" x="109" y="0" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="72" x="56" y="11" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="73" x="25" y="32" width="1" height="9" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="74" x="14" y="23" width="5" height="9" xoffset="0" yoffset="3" xadvance="6" page="0" chnl="15" />
+    <char id="75" x="64" y="10" width="7" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="76" x="118" y="10" width="6" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="77" x="72" y="10" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="78" x="80" y="10" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="79" x="32" y="12" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="80" x="111" y="10" width="6" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="81" x="40" y="0" width="7" height="10" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="82" x="100" y="0" width="8" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="83" x="7" y="23" width="6" height="9" xoffset="1" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="84" x="48" y="11" width="7" height="9" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="85" x="96" y="10" width="7" height="9" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="86" x="90" y="0" width="9" height="9" xoffset="-1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="87" x="58" y="0" width="11" height="9" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="88" x="24" y="12" width="7" height="9" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="89" x="16" y="12" width="7" height="9" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="90" x="117" y="0" width="7" height="9" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="91" x="35" y="0" width="2" height="11" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="92" x="19" y="33" width="3" height="9" xoffset="0" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="93" x="32" y="0" width="2" height="11" xoffset="0" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="94" x="114" y="30" width="5" height="5" xoffset="0" yoffset="3" xadvance="5" page="0" chnl="15" />
+    <char id="95" x="41" y="40" width="7" height="1" xoffset="0" yoffset="13" xadvance="7" page="0" chnl="15" />
+    <char id="96" x="38" y="40" width="2" height="2" xoffset="1" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="97" x="97" y="30" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="98" x="56" y="21" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="99" x="103" y="30" width="4" height="7" xoffset="1" yoffset="5" xadvance="6" page="0" chnl="15" />
+    <char id="100" x="92" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="101" x="85" y="30" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="102" x="6" y="33" width="4" height="9" xoffset="0" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="103" x="68" y="20" width="5" height="9" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="104" x="74" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="105" x="27" y="32" width="1" height="9" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="106" x="24" y="0" width="3" height="11" xoffset="-1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="107" x="86" y="20" width="5" height="9" xoffset="1" yoffset="3" xadvance="6" page="0" chnl="15" />
+    <char id="108" x="125" y="10" width="1" height="9" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="109" x="39" y="32" width="9" height="7" xoffset="1" yoffset="5" xadvance="11" page="0" chnl="15" />
+    <char id="110" x="61" y="31" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="111" x="73" y="30" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="112" x="98" y="20" width="5" height="9" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="113" x="104" y="20" width="5" height="9" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="114" x="108" y="30" width="3" height="7" xoffset="1" yoffset="5" xadvance="4" page="0" chnl="15" />
+    <char id="115" x="91" y="30" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="116" x="54" y="0" width="3" height="10" xoffset="0" yoffset="2" xadvance="3" page="0" chnl="15" />
+    <char id="117" x="49" y="31" width="5" height="7" xoffset="1" yoffset="5" xadvance="7" page="0" chnl="15" />
+    <char id="118" x="55" y="31" width="5" height="7" xoffset="0" yoffset="5" xadvance="5" page="0" chnl="15" />
+    <char id="119" x="29" y="32" width="9" height="7" xoffset="0" yoffset="5" xadvance="9" page="0" chnl="15" />
+    <char id="120" x="67" y="31" width="5" height="7" xoffset="0" yoffset="5" xadvance="5" page="0" chnl="15" />
+    <char id="121" x="116" y="20" width="5" height="9" xoffset="0" yoffset="5" xadvance="5" page="0" chnl="15" />
+    <char id="122" x="79" y="30" width="5" height="7" xoffset="0" yoffset="5" xadvance="5" page="0" chnl="15" />
+    <char id="123" x="20" y="0" width="3" height="11" xoffset="0" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="124" x="38" y="0" width="1" height="11" xoffset="1" yoffset="3" xadvance="3" page="0" chnl="15" />
+    <char id="125" x="28" y="0" width="3" height="11" xoffset="1" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="126" x="19" y="43" width="6" height="4" xoffset="1" yoffset="6" xadvance="7" page="0" chnl="15" />
+  </chars>
+  <kernings count="57">
+    <kerning first="32" second="65" amount="-1" />
+    <kerning first="121" second="46" amount="-1" />
+    <kerning first="121" second="44" amount="-1" />
+    <kerning first="119" second="46" amount="-1" />
+    <kerning first="119" second="44" amount="-1" />
+    <kerning first="118" second="46" amount="-1" />
+    <kerning first="118" second="44" amount="-1" />
+    <kerning first="114" second="46" amount="-1" />
+    <kerning first="114" second="44" amount="-1" />
+    <kerning first="89" second="118" amount="-1" />
+    <kerning first="49" second="49" amount="-1" />
+    <kerning first="65" second="32" amount="-1" />
+    <kerning first="65" second="84" amount="-1" />
+    <kerning first="65" second="86" amount="-1" />
+    <kerning first="89" second="117" amount="-1" />
+    <kerning first="65" second="89" amount="-1" />
+    <kerning first="89" second="113" amount="-1" />
+    <kerning first="89" second="112" amount="-1" />
+    <kerning first="89" second="111" amount="-1" />
+    <kerning first="89" second="101" amount="-1" />
+    <kerning first="70" second="44" amount="-1" />
+    <kerning first="70" second="46" amount="-1" />
+    <kerning first="70" second="65" amount="-1" />
+    <kerning first="89" second="97" amount="-1" />
+    <kerning first="76" second="84" amount="-1" />
+    <kerning first="76" second="86" amount="-1" />
+    <kerning first="76" second="87" amount="-1" />
+    <kerning first="76" second="89" amount="-1" />
+    <kerning first="89" second="65" amount="-1" />
+    <kerning first="89" second="58" amount="-1" />
+    <kerning first="89" second="46" amount="-2" />
+    <kerning first="80" second="44" amount="-2" />
+    <kerning first="80" second="46" amount="-2" />
+    <kerning first="80" second="65" amount="-1" />
+    <kerning first="89" second="45" amount="-1" />
+    <kerning first="89" second="44" amount="-2" />
+    <kerning first="87" second="46" amount="-1" />
+    <kerning first="87" second="44" amount="-1" />
+    <kerning first="86" second="111" amount="-1" />
+    <kerning first="84" second="44" amount="-1" />
+    <kerning first="84" second="45" amount="-1" />
+    <kerning first="84" second="46" amount="-1" />
+    <kerning first="84" second="58" amount="-1" />
+    <kerning first="86" second="101" amount="-1" />
+    <kerning first="84" second="65" amount="-1" />
+    <kerning first="86" second="97" amount="-1" />
+    <kerning first="84" second="97" amount="-1" />
+    <kerning first="84" second="99" amount="-1" />
+    <kerning first="84" second="101" amount="-1" />
+    <kerning first="86" second="65" amount="-1" />
+    <kerning first="84" second="111" amount="-1" />
+    <kerning first="86" second="46" amount="-1" />
+    <kerning first="84" second="115" amount="-1" />
+    <kerning first="86" second="45" amount="-1" />
+    <kerning first="84" second="119" amount="-1" />
+    <kerning first="84" second="121" amount="-1" />
+    <kerning first="86" second="44" amount="-1" />
+  </kernings>
+</font>

BIN
examples/TutorialResources/data/fonts/system_0.png


BIN
examples/TutorialResources/data/images/animals/cat.png


BIN
examples/TutorialResources/data/images/animals/dog.png


+ 11 - 0
examples/TutorialResources/data/res.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<resources>
+	<set path = "images" />
+	<atlas>
+		<image id="anim" file="anim1.png" cols = "7" /> <!-- 'id' is optional -->
+		<image file="button.png" cols = "3" />		
+	</atlas>
+	
+	<set path = "fonts" />
+	<font file="main.fnt" />	
+</resources>

+ 153 - 0
examples/TutorialResources/src/entry_point.cpp

@@ -0,0 +1,153 @@
+#include <stdio.h>
+
+#include "core/Renderer.h"
+#include "RootActor.h"
+#include "DebugActor.h"
+
+#include "example.h"
+
+
+using namespace oxygine;
+
+Renderer renderer;
+Rect viewport;
+
+int mainloop()
+{
+	//update our rootActor
+	//Actor::update would be called also for children
+	RootActor::instance->update();
+
+	Color clear(33, 33, 33, 255);
+	//start rendering and clear viewport
+	renderer.begin(0, viewport, &clear);
+	//begin rendering from RootActor. 
+	RootActor::instance->render(renderer);
+	//rendering done
+	renderer.end();
+
+	//update internal components
+	//all input events would be passed to RootActor::instance.handleEvent
+	//if done is true then User requests quit from app.
+	bool done = core::update();
+
+	return done ? 1 : 0;
+}
+
+//it is application entry point
+void run()
+{	
+	//initialize oxygine's internal stuff
+	core::init();
+	
+	
+	//create RootActor. RootActor is a root node
+	RootActor::instance = new RootActor();
+
+	
+	Point size = core::getDisplaySize();
+
+	//initialize it
+	//first argument is real display size of device.
+	//second is your "virtual" preferred size. You could change it to any size you need
+	//VirtualWidth and VirtualHeight are defined in example.h	
+	RootActor::instance->init(size, 
+		Point(VirtualWidth, VirtualHeight));
+	
+
+	//DebugActor is a helper node it shows FPS and memory usage
+	DebugActor::initialize();
+
+
+	//create and add new DebugActor to root actor as child
+	RootActor::instance->addChild(new DebugActor());
+
+
+	//it is view and projection matrix  initialization stuff
+	
+	Matrix view = makeViewMatrix(size.x, size.y); //Returns View matrix where Left Top corner is (0,0), and right bottom is (w,h)
+
+	viewport = Rect(0, 0, size.x, size.y);
+
+	Matrix proj;
+	//initialize projection matrix
+	Matrix::orthoLH(proj, (float)size.x, (float)size.y, 0, 1);
+	
+	//initialize Renderer
+	//Renderer is class helper for rendering primitives and batching them
+	//Renderer is lightweight class you could create it many of times
+	//for example if you need to render something into RenderTarget (FBO)
+	renderer.setDriver(IVideoDriver::instance);
+	renderer.setViewTransform(view);
+	renderer.setProjTransform(proj);
+
+
+	//initialize this example stuff. check example.cpp
+	example_init();
+
+
+	bool done = false;	
+
+	//here is main game loop
+    while (1)
+    {
+		int done = mainloop();
+		if (done)
+			break;
+    }
+	//so user closed application
+	
+	//lets dump all created objects into Output
+	//all created and not freed resources would be displayed
+	ObjectBase::dumpCreatedObjects();
+
+
+	//lets cleanup everything right now and call ObjectBase::dumpObjects() again
+	//we need to free all allocated resources and delete all created actors
+	//yes, actor is smart pointer and actually you don't need it remove by hands
+	//but now we want delete it forcedly
+
+	//check example.cpp
+	example_destroy();	
+	
+
+	renderer.cleanup();
+
+	/**releases all internal components and RootActor*/
+	core::release();
+
+	//dump list should be empty now
+	//we deleted everything and could be sure that there aren't any memory leaks
+	ObjectBase::dumpCreatedObjects();
+
+	//end
+}
+
+#ifdef __S3E__
+int main(int argc, char* argv[])
+{
+    run();
+    return 0;
+}
+#endif
+
+
+#ifdef OXYGINE_SDL
+extern "C"
+{
+	int SDL_main(int argc, char* argv[])
+	{
+		run();
+		return 0;
+	}
+};
+#endif
+
+#ifdef __FLASHPLAYER__
+int main(int argc, char* argv[])
+{
+	printf("test\n");
+	run();
+	return 0;
+}
+#endif

+ 24 - 0
examples/TutorialResources/src/example.cpp

@@ -0,0 +1,24 @@
+#include "oxygine-framework.h"
+using namespace oxygine;
+
+Resources animals;
+
+void example_init()
+{
+	animals.loadXML("animals.xml");
+
+	spSprite dog = new Sprite;
+	dog->setResAnim(animals.getResAnim("dog"));	
+	dog->setPosition(200, 300);
+	dog->attachTo(getRoot());
+
+	spSprite cat = new Sprite;
+	cat->setResAnim(animals.getResAnim("cat"));
+	cat->setPosition(600, 300);
+	cat->attachTo(getRoot());
+}
+
+void example_destroy()
+{
+	animals.free();
+}

+ 5 - 0
examples/TutorialResources/src/example.h

@@ -0,0 +1,5 @@
+void example_init();
+void example_destroy();
+
+const int VirtualWidth = 960;
+const int VirtualHeight = 640;

+ 2 - 2
oxygine/src/Actor.h

@@ -229,8 +229,8 @@ namespace oxygine
 
 				
 		typedef GetSet2Args<float, Vector2, const Vector2 &, Actor, &Actor::getPosition, &Actor::setPosition>	TweenPosition;
-		typedef GetSet<float, float, Actor, &Actor::getX, &Actor::setX>	TweenX;
-		typedef GetSet<float, float, Actor, &Actor::getY, &Actor::setY>	TweenY;
+		typedef GetSet<float, float, Actor, &Actor::getX, &Actor::setX>											TweenX;
+		typedef GetSet<float, float, Actor, &Actor::getY, &Actor::setY>											TweenY;
 		typedef GetSet<float, float, Actor, &Actor::getWidth, &Actor::setWidth>									TweenWidth;
 		typedef GetSet<float, float, Actor, &Actor::getHeight, &Actor::setHeight>								TweenHeight;
 		typedef GetSet<float, float, Actor, &Actor::getRotation, &Actor::setRotation>							TweenRotation;

+ 32 - 0
oxygine/src/MaskedSprite.cpp

@@ -0,0 +1,32 @@
+#include "MaskedSprite.h"
+#include "RenderState.h"
+namespace oxygine
+{
+	spSprite MaskedSprite::getMask() const
+	{
+		return _mask;
+	}
+
+	void MaskedSprite::setMask(spSprite mask)
+	{
+		_mask = mask;
+	}
+
+	void MaskedSprite::render(const RenderState &parentRS)
+	{
+		if(_mask)
+		{
+			Renderer::transform t = getGlobalTransform(_mask);
+			RectF maskDest = _mask->getDestRect();
+			RectF maskSrc = _mask->getSrcRect();
+			//maskDest
+
+			const Diffuse &df = _mask->getAnimFrame().getDiffuse();
+			parentRS.renderer->setMask(df.alpha ? df.alpha : df.base, maskSrc, maskDest, t);
+		}
+
+		Sprite::render(parentRS);
+
+		parentRS.renderer->removeMask();
+	}
+}

+ 19 - 0
oxygine/src/MaskedSprite.h

@@ -0,0 +1,19 @@
+#pragma once
+#include "Sprite.h"
+namespace oxygine
+{
+	DECLARE_SMART(MaskedSprite, spMaskedSprite);
+	class MaskedSprite: public Sprite
+	{
+	public:
+		spSprite getMask() const;
+		void setMask(spSprite);	
+
+
+	protected:
+		void render(const RenderState &parentRS);
+
+	private:
+		spSprite _mask;
+	};
+}

+ 4 - 3
oxygine/src/RootActor.cpp

@@ -8,10 +8,11 @@ namespace oxygine
 {
 	spRootActor RootActor::instance;
 
-	RootActor::RootActor():_realDisplaySize(0,0), _statUpdate(0), _statRender(0), _clipOuter(false), _viewport(0,0,0,0)
+	RootActor::RootActor():_statUpdate(0), _statRender(0), _clipOuter(false), _viewport(0,0,0,0)
 	{
 		spClock clock = new Clock();
 		setClock(clock);
+		setName("RootActor");
 
 		//addEventHandler(new EventHandler());
 	}
@@ -26,7 +27,7 @@ namespace oxygine
 		stringstream st;
 
 		st << "{RootActor}\n";
-		st << " displaySize=(" << _realDisplaySize.x << "," << _realDisplaySize.y << ")";
+		//st << " displaySize=(" << _realDisplaySize.x << "," << _realDisplaySize.y << ")";
 		st << Actor::dump(opt);
 
 		return st.str();
@@ -50,7 +51,7 @@ namespace oxygine
 
 	void RootActor::init(const Point &displaySize, const Point &gameSize)
 	{
-		_realDisplaySize = displaySize;
+		//_realDisplaySize = displaySize;
 		setSize(gameSize);
 
 		_viewport = calcCenteredViewport(displaySize, gameSize);

+ 6 - 3
oxygine/src/RootActor.h

@@ -10,6 +10,12 @@ namespace oxygine
 	class RootActor : public Actor
 	{
 	public:
+		enum
+		{
+			ACTIVATE = makefourcc('_', 'R', 'A', 'c'),
+			DEACTIVATE = makefourcc('_', 'R', 'D', 'c'),
+		};
+
 		static spRootActor instance;
 		static Rect	calcCenteredViewport(const Point &displaySize, const Point &gameSize);
 
@@ -26,8 +32,6 @@ namespace oxygine
 		/**Renders each children*/
 		void render(Renderer &r);
 
-		/**Returns original display size*/
-		const Point &getDisplaySize() const {return _realDisplaySize;}
 		//const Rect	&getArea();
 
 		/**Updates each children*/
@@ -50,7 +54,6 @@ namespace oxygine
 
 		void safeRemove(spActor actor);
 
-		Point _realDisplaySize;
 		actors _removedActors;
 
 		timeMS _statUpdate;

+ 0 - 29
oxygine/src/Sprite.cpp

@@ -181,33 +181,4 @@ namespace oxygine
 
 		actor.setAnimFrame(_resAnim->getFrame(col, _row));
 	}
-
-
-	spSprite MaskedActor::getMask() const
-	{
-		return _mask;
-	}
-	
-	void MaskedActor::setMask(spSprite mask)
-	{
-		_mask = mask;
-	}
-
-	void MaskedActor::render(const RenderState &parentRS)
-	{
-		if(_mask)
-		{
-			Renderer::transform t = getGlobalTransform(_mask);
-			RectF maskDest = _mask->getDestRect();
-			RectF maskSrc = _mask->getSrcRect();
-			//maskDest
-
-			const Diffuse &df = _mask->getAnimFrame().getDiffuse();
-			parentRS.renderer->setMask(df.alpha ? df.alpha : df.base, maskSrc, maskDest, t);
-		}
-		
-		Actor::render(parentRS);
-
-		parentRS.renderer->removeMask();
-	}
 }

+ 0 - 13
oxygine/src/Sprite.h

@@ -55,21 +55,8 @@ namespace oxygine
 		bool _manageResAnim;
 	};
 
-	DECLARE_SMART(MaskedActor, spMaskedActor);
-	class MaskedActor: public Actor
-	{
-	public:
-		spSprite getMask() const;
-		void setMask(spSprite);	
 
 
-	protected:
-		void render(const RenderState &parentRS);
-
-	private:
-		spSprite _mask;
-	};
-
 	/** A TweenAnim class
 	*   use for playing per frame animation
 	\code

+ 47 - 11
oxygine/src/core/oxygine.cpp

@@ -25,6 +25,7 @@
 
 #include "gl/oxgl.h"
 #include "winnie_alloc/winnie_alloc.h"
+
 #ifdef __S3E__
 #include "s3e.h"
 #include "IwGL.h"
@@ -181,6 +182,20 @@ namespace oxygine
 
 		return 0;
 	}
+
+	int32 applicationPause(void* systemData, void* userData)
+	{
+		Event ev(RootActor::DEACTIVATE);
+		getRoot()->handleEvent(&ev);
+		return 0;
+	}
+
+	int32 applicationUnPause(void* systemData, void* userData)
+	{
+		Event ev(RootActor::ACTIVATE);
+		getRoot()->handleEvent(&ev);
+		return 0;
+	}
 #endif
 
 #ifdef OXYGINE_SDL
@@ -225,6 +240,9 @@ namespace oxygine
 				s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, &pointerEvent, 0);
 				s3ePointerRegister(S3E_POINTER_MOTION_EVENT, &pointerMotionEvent, 0);
 			}	
+
+			s3eDeviceRegister(S3E_DEVICE_UNPAUSE, applicationUnPause, 0);
+			s3eDeviceRegister(S3E_DEVICE_PAUSE, applicationPause, 0);
 	#endif
 	
 	#if __FLASHPLAYER__
@@ -450,16 +468,34 @@ namespace oxygine
 					done = true;
 					break;
 				case SDL_WINDOWEVENT:
-					if (event.window.event == SDL_WINDOWEVENT_MINIMIZED)
-						active = false;
-					if (event.window.event == SDL_WINDOWEVENT_RESTORED)
-						active = true;
-					if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST)
-						focus = false;
-					if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
-						focus = true;
-					log::messageln("SDL_SYSWMEVENT %d", (int)event.window.event);
-					break;
+					{					
+						/*
+						if (event.window.event == SDL_WINDOWEVENT_ENTER)
+							active = false;
+						if (event.window.event == SDL_WINDOWEVENT_LEAVE)
+							active = true;
+							*/
+
+						if (event.window.event == SDL_WINDOWEVENT_MINIMIZED)
+							active = false;
+						if (event.window.event == SDL_WINDOWEVENT_RESTORED)
+							active = true;
+
+						bool newFocus = focus;
+						if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST)
+							newFocus = false;
+						if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
+							newFocus = true;
+						if (focus != newFocus)
+						{
+							focus = newFocus;
+							Event ev(focus ? RootActor::ACTIVATE : RootActor::DEACTIVATE);
+							getRoot()->dispatchEvent(&ev);
+							log::messageln("focus: %d", (int)focus);
+						}
+						//log::messageln("SDL_SYSWMEVENT %d", (int)event.window.event);
+						break;
+					}
 				case SDL_MOUSEWHEEL:
 					input->sendPointerWheelEvent(event.wheel.y, &input->_pointerMouse);
 					break;
@@ -609,7 +645,7 @@ namespace oxygine
 		{
 		case ep_show_error:
 			log::error_va(format, args);
-			OX_ASSERT(!"Some object is missing. Check log for more details.");
+			OX_ASSERT(!"handleErrorPolicy error.");
 			break;
 		case ep_show_warning:
 			log::warning_va(format, args);

+ 1 - 0
oxygine/src/oxygine-framework.h

@@ -27,6 +27,7 @@
 #include "RootActor.h"
 #include "SlidingActor.h"
 #include "Sprite.h"
+#include "MaskedSprite.h"
 #include "TextActor.h"
 #include "TextStyle.h"
 #include "Tweener.h"

+ 6 - 0
oxygine/src/res/ResAtlas.cpp

@@ -47,6 +47,12 @@ namespace oxygine
 		ad.mt.unlock();
 
 		ad.texture->apply();
+
+		/*
+		char str[255];
+		sprintf(str, "%d.png", ad.texture.get());
+		saveImage(image_data, str, "png");
+		*/
 	}
 
 	void next_atlas(int w, int h, TextureFormat tf, atlas_data &ad, const char *name = 0)

+ 1 - 1
oxygine/src/utils/AtlasTool.cpp

@@ -97,7 +97,7 @@ namespace oxygine
 	bool Atlas::add(Texture *dest, const ImageData &src, Rect &srcRect)
 	{
 		AnimationFrame af;
-		Point offset(1, 1);
+		Point offset(2, 2);
 		if (src.w == dest->getWidth())
 			offset.x = 0;
 		if (src.h == dest->getHeight())

+ 280 - 251
tools/main.wpu

@@ -8,6 +8,14 @@ debug.breakpoints = {loc('../../elements_battle_2/assets/build.py'): {8: (0,
         None,
         1,
         0)},
+                     loc('src2/process_atlas.py'): {290: (0,
+        None,
+        1,
+        0),
+        356: (0,
+              None,
+              1,
+              0)},
                      loc('test.py'): {4: (0,
         None,
         1,
@@ -18,6 +26,7 @@ debug.breakpoints = {loc('../../elements_battle_2/assets/build.py'): {8: (0,
         0)}}
 debug.err-values = {loc('../../elements_battle/assets/build_res.py'): {},
                     loc('../../funmath/assets/build_res.py'): {},
+                    loc('../../m3q/build/build_app.py'): {},
                     loc('convert_font2sd.py'): {},
                     loc('process_xml.py'): {},
                     loc('process_xml2.py'): {}}
@@ -60,7 +69,8 @@ debug.recent-run-args = {loc('convert_font2sd.py'): ['font.xml'],
         ' -x xmls/mm.xml -d data -ds 1 -e hd',
         ' -x xmls/game.xml -d data'],
                          loc('process_xml2.py'): [' -x xmls/res.xml --src_da'\
-        'ta data --dest_data data -s 0.5',
+        'ta data --dest_data data -s 0.5 -m 512\n',
+        ' -x xmls/res.xml --src_data data --dest_data data -s 0.5',
         ' -x xmls/res.xml --src_data data --dest_data data -s 1',
         ' -x xmls/res.xml --src_data data --dest_data data',
         '-x xmls/res.xml --src_data data --dest_data data/ext  --compress pv'\
@@ -91,15 +101,15 @@ debug.run-args = {loc('convert_font2sd.py'): 'sd.fnt',
                   loc('process_xml.py'): '-x fonts.xml -d d:\\temp\\bmf -des'\
         't 480  --downscale 1 -s 1.500000',
                   loc('process_xml2.py'): ' -x xmls/res.xml --src_data data '\
-        '--dest_data data -s 0.5',
+        '--dest_data data -s 0.5 -m 512\n',
                   loc('src/xml_processor.py'): '-x system/res.xml -d data'}
 debug.show-args-dialog = {loc('convert_font2sd.py'): False,
                           loc('generate_xml_lines.py'): False,
                           loc('process_xml.py'): False,
                           loc('process_xml2.py'): False,
                           loc('test.py'): False}
-debug.var-col-widths = [0.41156840934371525,
-                        0.58843159065628481]
+debug.var-col-widths = [0.41067961165048544,
+                        0.58932038834951461]
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                             'windows': [{'name': 'VN4o3PI005PYDd98zUe8WcDMwg'\
         'dNI5cr',
@@ -127,8 +137,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                                {'tree-state': {'file-sort-method': 'by name',
         'list-files-first': False,
         'tree-states': {'deep': {'column-widths': [1.0],
-                                 'expanded-nodes': [(0,)],
-                                 'selected-nodes': [(9,)],
+                                 'expanded-nodes': [(0,),
+        (1,)],
+                                 'selected-nodes': [(5,)],
                                  'top-node': (0,)}},
         'tree-style': 'deep'}}),
                               ('snippets',
@@ -159,7 +170,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         'current_pages': [2,
                           1],
         'notebook_display': 'normal',
-        'notebook_percent': 0.29487179487179482,
+        'notebook_percent': 0.23996913580246915,
         'override_title': None,
         'pagelist': [('bookmarks',
                       'wide',
@@ -175,23 +186,25 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                       {'attrib-starts': [],
                        'first-line': 0,
                        'folded-linenos': [],
-                       'sel-line': 2,
-                       'sel-line-start': 42,
-                       'selection_end': 42,
-                       'selection_start': 42}),
+                       'sel-line': 0,
+                       'sel-line-start': 0,
+                       'selection_end': 0,
+                       'selection_start': 0}),
                      ('debug-probe',
                       'wide',
                       2,
                       {'attrib-starts': [],
                        'first-line': 0,
                        'folded-linenos': [],
-                       'history': {u'file:d:/oxygine/tools/test.py': ['im.ti'\
+                       'history': {u'file:D:/oxygine-framework/tools/process_xml2.py': [''\
+        'frames\n'],
+                                   u'file:d:/oxygine/tools/test.py': ['im.ti'\
         'le\n',
         'im.seek(1)\n']},
-                       'sel-line': 0,
-                       'sel-line-start': 0,
-                       'selection_end': 5,
-                       'selection_start': 5}),
+                       'sel-line': 2,
+                       'sel-line-start': 55,
+                       'selection_end': 55,
+                       'selection_start': 55}),
                      ('debug-exceptions',
                       'wide',
                       0,
@@ -236,7 +249,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                                        'fRegexFlags': 46,
                                        'fReplaceText': '',
                                        'fReverse': False,
-                                       'fSearchText': u'frame_size',
+                                       'fSearchText': u'sizes',
                                        'fStartPos': 0,
                                        'fStyle': 'text',
                                        'fWholeWords': False,
@@ -267,7 +280,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                                        'fRegexFlags': 46,
                                        'fReplaceText': '',
                                        'fReverse': False,
-                                       'fSearchText': u'"pvrt',
+                                       'fSearchText': u'.sizes',
                                        'fStartPos': 0,
                                        'fStyle': 'text',
                                        'fWholeWords': False,
@@ -295,252 +308,256 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                       'wide',
                       1,
                       {'node-states': [('eval',
-        'self'),
+        'atl'),
                                        ('eval',
-        'frame_width'),
+        'frames'),
                                        ('eval',
-        'scaled_font_file'),
-                                       ('eval',
-        'bm_config_temp')],
-                       'tree-state': {'column-widths': [0.399702823179792,
-        0.600297176820208],
-                                      'expanded-nodes': [],
+        'fr')],
+                       'tree-state': {'column-widths': [0.41757156959526159,
+        0.58242843040473835],
+                                      'expanded-nodes': [(2,)],
                                       'selected-nodes': [(0,)],
                                       'top-node': (0,)}})],
-        'primary_view_state': {'editor_states': {'bookmarks': ([(loc('src2/xml_processor.py'),
-        {'attrib-starts': [('XmlProcessor',
-                            7),
-                           ('XmlProcessor.get_apply_scale',
-                            49)],
-         'first-line': 34,
+        'primary_view_state': {'editor_states': {'bookmarks': ([(loc('src2/process_atlas.py'),
+        {'attrib-starts': [('atlas_Processor',
+                            102),
+                           ('atlas_Processor.process',
+                            108)],
+         'first-line': 237,
          'folded-linenos': [],
-         'sel-line': 53,
-         'sel-line-start': 1871,
-         'selection_end': 1871,
-         'selection_start': 1871},
-        1371461790.256),
-        (loc('src2/xml_processor.py'),
-         {'attrib-starts': [('XmlProcessor',
-                             7),
-                            ('XmlProcessor.get_apply_scale',
-                             49)],
-          'first-line': 34,
+         'sel-line': 276,
+         'sel-line-start': 9088,
+         'selection_end': 9088,
+         'selection_start': 9088},
+        1378387662.6240001),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 54,
-          'sel-line-start': 1932,
-          'selection_end': 1932,
-          'selection_start': 1932},
-         1371461794.7460001),
+          'sel-line': 277,
+          'sel-line-start': 9144,
+          'selection_end': 9144,
+          'selection_start': 9144},
+         1378387663.247),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 192,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 210,
-          'sel-line-start': 5651,
-          'selection_end': 5689,
-          'selection_start': 5689},
-         1371461803.5940001),
-        (loc('src2/xml_processor.py'),
-         {'attrib-starts': [('XmlProcessor',
-                             7),
-                            ('XmlProcessor.get_apply_scale',
-                             49)],
-          'first-line': 34,
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9184,
+          'selection_start': 9184},
+         1378387663.872),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 53,
-          'sel-line-start': 1871,
-          'selection_end': 1930,
-          'selection_start': 1896},
-         1371461831.527),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9184,
+          'selection_start': 9184},
+         1378387664.473),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 192,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 210,
-          'sel-line-start': 5651,
-          'selection_end': 5722,
-          'selection_start': 5722},
-         1371461835.1259999),
+          'sel-line': 274,
+          'sel-line-start': 8902,
+          'selection_end': 8926,
+          'selection_start': 8926},
+         1378387665.4719999),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 192,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 212,
-          'sel-line-start': 5742,
-          'selection_end': 5772,
-          'selection_start': 5762},
-         1371461847.408),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9216,
+          'selection_start': 9216},
+         1378387667.47),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 201,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 229,
-          'sel-line-start': 6451,
-          'selection_end': 6531,
-          'selection_start': 6521},
-         1371461911.737),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9253,
+          'selection_start': 9253},
+         1378387677.484),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 201,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 229,
-          'sel-line-start': 6451,
-          'selection_end': 6554,
-          'selection_start': 6544},
-         1371461913.9189999),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9184,
+          'selection_start': 9184},
+         1378387685.4820001),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 210,
+                             108)],
+          'first-line': 237,
           'folded-linenos': [],
-          'sel-line': 238,
-          'sel-line-start': 7107,
-          'selection_end': 7189,
-          'selection_start': 7179},
-         1371461914.2880001),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9184,
+          'selection_start': 9184},
+         1378387686.506),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 210,
+                             108)],
+          'first-line': 311,
           'folded-linenos': [],
-          'sel-line': 238,
-          'sel-line-start': 7107,
-          'selection_end': 7212,
-          'selection_start': 7202},
-         1371461915.247),
+          'sel-line': 335,
+          'sel-line-start': 11746,
+          'selection_end': 11778,
+          'selection_start': 11778},
+         1378387688.507),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 395,
+                             108)],
+          'first-line': 311,
           'folded-linenos': [],
-          'sel-line': 423,
-          'sel-line-start': 14861,
-          'selection_end': 14943,
-          'selection_start': 14933},
-         1371461916.3110001),
+          'sel-line': 334,
+          'sel-line-start': 11695,
+          'selection_end': 11744,
+          'selection_start': 11744},
+         1378387739.707),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 395,
+                             108)],
+          'first-line': 312,
           'folded-linenos': [],
-          'sel-line': 423,
-          'sel-line-start': 14861,
-          'selection_end': 14963,
-          'selection_start': 14953},
-         1371461921.3269999),
+          'sel-line': 343,
+          'sel-line-start': 12124,
+          'selection_end': 12163,
+          'selection_start': 12163},
+         1378387750.22),
         (loc('src2/process_atlas.py'),
-         {'attrib-starts': [('ResAnim',
-                             61),
-                            ('ResAnim.__init__',
-                             62)],
-          'first-line': 60,
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 264,
           'folded-linenos': [],
-          'sel-line': 65,
-          'sel-line-start': 1422,
-          'selection_end': 1445,
-          'selection_start': 1435},
-         1371461921.776),
+          'sel-line': 278,
+          'sel-line-start': 9184,
+          'selection_end': 9257,
+          'selection_start': 9257},
+         1378387761.21),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 184,
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 210,
-          'sel-line-start': 5651,
-          'selection_end': 5722,
-          'selection_start': 5722},
-         1371461922.4070001),
-        (loc('process_xml2.py'),
-         {'attrib-starts': [('get_parser',
-                             0)],
-          'first-line': 0,
+          'sel-line': 288,
+          'sel-line-start': 9339,
+          'selection_end': 9420,
+          'selection_start': 9420},
+         1378387789.2130001),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 8,
-          'sel-line-start': 604,
-          'selection_end': 642,
-          'selection_start': 642},
-         1371462213.283),
+          'sel-line': 288,
+          'sel-line-start': 9339,
+          'selection_end': 9339,
+          'selection_start': 9339},
+         1378387914.7179999),
         (loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 184,
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 210,
-          'sel-line-start': 5651,
-          'selection_end': 5722,
-          'selection_start': 5722},
-         1371462227.2739999),
-        (loc('process_xml2.py'),
-         {'attrib-starts': [('get_parser',
-                             0)],
-          'first-line': 0,
+          'sel-line': 288,
+          'sel-line-start': 9339,
+          'selection_end': 9367,
+          'selection_start': 9367},
+         1378387917.7130001),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 8,
-          'sel-line-start': 604,
-          'selection_end': 642,
-          'selection_start': 642},
-         1371462228.4530001),
-        (loc('src2/xml_processor.py'),
-         {'attrib-starts': [('XmlProcessor',
-                             7),
-                            ('XmlProcessor.get_apply_scale',
-                             49)],
-          'first-line': 34,
+          'sel-line': 289,
+          'sel-line-start': 9365,
+          'selection_end': 9394,
+          'selection_start': 9394},
+         1378387920.2119999),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 53,
-          'sel-line-start': 1871,
-          'selection_end': 1930,
-          'selection_start': 1896},
-         1371462287.684),
-        (loc('process_xml2.py'),
-         {'attrib-starts': [('get_parser',
-                             0)],
-          'first-line': 0,
+          'sel-line': 289,
+          'sel-line-start': 9353,
+          'selection_end': 9365,
+          'selection_start': 9365},
+         1378387934.22),
+        (loc('src2/process_atlas.py'),
+         {'attrib-starts': [('atlas_Processor',
+                             102),
+                            ('atlas_Processor.process',
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 8,
-          'sel-line-start': 604,
-          'selection_end': 642,
-          'selection_start': 642},
-         1371462289.0009999),
+          'sel-line': 289,
+          'sel-line-start': 9353,
+          'selection_end': 9353,
+          'selection_start': 9353},
+         1378387950.369),
         [loc('src2/process_atlas.py'),
          {'attrib-starts': [('atlas_Processor',
-                             101),
+                             102),
                             ('atlas_Processor.process',
-                             107)],
-          'first-line': 184,
+                             108)],
+          'first-line': 254,
           'folded-linenos': [],
-          'sel-line': 210,
-          'sel-line-start': 5651,
-          'selection_end': 5722,
-          'selection_start': 5722},
-         1371462289.461]],
+          'sel-line': 290,
+          'sel-line-start': 9378,
+          'selection_end': 9378,
+          'selection_start': 9378},
+         1378387951.9549999]],
         19),
         'current-loc': loc('src2/process_atlas.py'),
         'editor-states': {loc('process_xml2.py'): {'attrib-starts': [('get_p'\
@@ -552,31 +569,40 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
         'sel-line-start': 604,
         'selection_end': 642,
         'selection_start': 642},
+                          loc('src2/atlas.py'): {'attrib-starts': [('Atlas',
+        69)],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 69,
+        'sel-line-start': 1801,
+        'selection_end': 1812,
+        'selection_start': 1807},
                           loc('src2/process_atlas.py'): {'attrib-starts': [(''\
         'atlas_Processor',
-        101),
+        102),
         ('atlas_Processor.process',
-         107)],
-        'first-line': 184,
+         108)],
+        'first-line': 254,
         'folded-linenos': [],
-        'sel-line': 210,
-        'sel-line-start': 5651,
-        'selection_end': 5722,
-        'selection_start': 5722},
+        'sel-line': 290,
+        'sel-line-start': 9374,
+        'selection_end': 9413,
+        'selection_start': 9413},
                           loc('src2/xml_processor.py'): {'attrib-starts': [(''\
         'XmlProcessor',
         7),
-        ('XmlProcessor.get_apply_scale',
-         49)],
-        'first-line': 34,
-        'folded-linenos': [],
-        'sel-line': 53,
-        'sel-line-start': 1871,
-        'selection_end': 1930,
-        'selection_start': 1896}},
+        ('XmlProcessor.__init__',
+         8)],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 36,
+        'sel-line-start': 1128,
+        'selection_end': 1128,
+        'selection_start': 1128}},
         'has-focus': True,
         'locked': False},
-                               'open_files': [u'src2/xml_processor.py',
+                               'open_files': [u'src2/atlas.py',
+        u'src2/xml_processor.py',
         u'process_xml2.py',
         u'src2/process_atlas.py']},
         'saved_notebook_display': None,
@@ -589,13 +615,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                  'splits': 2,
                  'tab_location': 'left',
                  'user_data': {}},
-        'window-alloc': (56,
-                         604,
-                         1816,
-                         476)}]}
+        'window-alloc': (182,
+                         58,
+                         2147,
+                         1146)}]}
 guimgr.recent-documents = [loc('src2/process_atlas.py'),
+                           loc('src2/xml_processor.py'),
                            loc('process_xml2.py'),
-                           loc('src2/xml_processor.py')]
+                           loc('src2/atlas.py')]
 guimgr.visual-state = {loc('file:C:/Program Files (x86)/Wing IDE 4.1/resources/builtin-pi-files/2.7/__builtin__.pi'): {''\
         'attrib-starts': [('xrange',
                            2588)],
@@ -787,6 +814,17 @@ guimgr.visual-state = {loc('file:C:/Program Files (x86)/Wing IDE 4.1/resources/b
         'sel-line-start': 123,
         'selection_end': 123,
         'selection_start': 123},
+                       loc('file:c:/Python27/Lib/argparse.py'): {'attrib-sta'\
+        'rts': [('_ActionsContainer',
+                 1166),
+                ('_ActionsContainer.add_argument',
+                 1249)],
+        'first-line': 1289,
+        'folded-linenos': [],
+        'sel-line': 1294,
+        'sel-line-start': 46432,
+        'selection_end': 46432,
+        'selection_start': 46432},
                        loc('file:c:/Python27/Lib/os.py'): {'attrib-starts': [(''\
         'removedirs',
         158)],
@@ -806,14 +844,16 @@ guimgr.visual-state = {loc('file:C:/Program Files (x86)/Wing IDE 4.1/resources/b
         'selection_end': 7662,
         'selection_start': 7662},
                        loc('file:c:/Python27/Lib/site-packages/PIL/Image.py'): {''\
-        'attrib-starts': [('open',
-                           1942)],
-        'first-line': 1922,
-        'folded-linenos': [],
-        'sel-line': 1948,
-        'sel-line-start': 62028,
-        'selection_end': 62052,
-        'selection_start': 62052},
+        'attrib-starts': [('Image',
+                           443),
+                          ('Image.getbbox',
+                           838)],
+        'first-line': 810,
+        'folded-linenos': [],
+        'sel-line': 838,
+        'sel-line-start': 24018,
+        'selection_end': 24033,
+        'selection_start': 24026},
                        loc('file:c:/Python27/Lib/site-packages/PythonMagick/__init__.py'): {''\
         'attrib-starts': [('Image',
                            2)],
@@ -833,18 +873,7 @@ guimgr.visual-state = {loc('file:C:/Program Files (x86)/Wing IDE 4.1/resources/b
         'sel-line': 1737,
         'sel-line-start': 59543,
         'selection_end': 59559,
-        'selection_start': 59551},
-                       loc('file:c:/Python27/lib/argparse.py'): {'attrib-sta'\
-        'rts': [('_ActionsContainer',
-                 1166),
-                ('_ActionsContainer.add_argument',
-                 1249)],
-        'first-line': 1289,
-        'folded-linenos': [],
-        'sel-line': 1294,
-        'sel-line-start': 46432,
-        'selection_end': 46432,
-        'selection_start': 46432}}
+        'selection_start': 59551}}
 proj.build-cmd = {loc('process_xml.py'): ('project',
         None),
                   loc('process_xml2.py'): ('project',
@@ -873,7 +902,12 @@ proj.initial-dir = {loc('convert_font2sd.py'): ('custom',
         'd:\\oxygine-framework\\examples\\GameTemplate\\'),
                     loc('src/xml_processor.py'): ('custom',
         'd:\\oxygine-framework\\oxygine\\system_data')}
-search.search-history = [u'frame_size',
+search.search-history = [u'sizes',
+                         u'args',
+                         u'.sizes',
+                         u'frame(',
+                         u'max_size',
+                         u'frame_size',
                          u'frame_scale',
                          u'scale',
                          u'-l',
@@ -887,9 +921,4 @@ search.search-history = [u'frame_size',
                          u'path_xml',
                          u'_process_set',
                          u'context._process_set',
-                         u'get_inner_dest',
-                         u'get_dest_path',
-                         u'get_meta_xml_path',
-                         u'get_src_path',
-                         u'context.path_current',
-                         u'res_type_name']
+                         u'get_inner_dest']

+ 6 - 0
tools/src2/atlas.py

@@ -15,6 +15,9 @@ class Node:
         self._child1 = None
         self._free = True
         
+    def is_free(self):
+        return self._free
+        
     def insert(self, w, h):
         new_node = None
         if self._child0 or self._child1:
@@ -70,6 +73,9 @@ class Atlas:
         self.h = h
         self._tree = Node(rect(0, 0, w, h))
         
+    def get_root(self):
+        return self._tree        
+        
     def add(self, w, h):
         r = self._tree.insert(w, h)
         if r:

+ 51 - 10
tools/src2/process_atlas.py

@@ -47,12 +47,13 @@ def premultipliedAlpha(image):
     return image    
 
 class frame:
-    def __init__(self, image, bbox, image_element):
+    def __init__(self, image, bbox, image_element, rs):
         self.image = image
         self.image_element = image_element
 
         self.node = None
         self.atlas = None
+        self.resanim = rs
 
         if not bbox:
             bbox = (0,0,1,1)
@@ -117,6 +118,10 @@ class atlas_Processor(process.Process):
         anims = []
     
         frames = []
+        
+        all_sizes = [64, 128, 256, 512, 1024, 2048, 4096]
+        sizes = [s for s in all_sizes if s <= context.args.max_size]        
+                
         for image_el in el.childNodes:
             if image_el.nodeName == "set":
                 context._process_set(image_el)
@@ -223,8 +228,19 @@ class atlas_Processor(process.Process):
                 for col in xrange(columns):
                     rect = (col * frame_width, row * frame_height, (col + 1) * frame_width, (row + 1)* frame_height, )
                     
-                    frame_image = image.crop(rect)                    
-                     
+                    frame_image = image.crop(rect)      
+                    
+                    
+                    def resize():
+                        ax = applyScale2(frame_width, finalScale);
+                        ay = applyScale2(frame_height, finalScale);
+                        bx = int(ax / finalScale)
+                        by = int(ay / finalScale)
+                        im = Image.new("RGBA", (bx, by))
+                        im.paste(frame_image, (0, 0, frame_image.size[0], frame_image.size[1]))
+                        frame_image = im.resize((ax, ay), Image.ANTIALIAS)
+                        frame_image = frame_image.crop((0, 0, resAnim.frame_size[0], resAnim.frame_size[1]))                        
+                    
                     if context.args.resize:
                         if as_bool(image_el.getAttribute("trueds")):
                             frame_image = frame_image.resize((resAnim.frame_size[0], resAnim.frame_size[1]), Image.ANTIALIAS)
@@ -237,7 +253,7 @@ class atlas_Processor(process.Process):
                             im.paste(frame_image, (0, 0, frame_image.size[0], frame_image.size[1]))
                             frame_image = im.resize((ax, ay), Image.ANTIALIAS)
                             frame_image = frame_image.crop((0,0,resAnim.frame_size[0], resAnim.frame_size[1]))
-            
+                                       
                     trim = True
                     if image_el.getAttribute("trim") == "0":
                         trim = False
@@ -246,11 +262,32 @@ class atlas_Processor(process.Process):
                         frame_bbox = a.getbbox()
                     else:
                         frame_bbox = frame_image.getbbox()
+                        
+                    w = frame_bbox[2] - frame_bbox[0]
+                    h = frame_bbox[3] - frame_bbox[1]                    
+                    
     
                     frame_image = frame_image.crop(frame_bbox)
     
-                    fr = frame(frame_image, frame_bbox, image_el)
-    
+                    fr = frame(frame_image, frame_bbox, image_el, resAnim)
+                    fr.sizes = sizes
+
+		    def nextPOT(v):
+			v = v - 1;
+			v = v | (v >> 1);
+			v = v | (v >> 2);
+			v = v | (v >> 4);
+			v = v | (v >> 8);
+			v = v | (v >>16);
+			return v + 1
+		    
+                    if w > sizes[-1] or h > sizes[-1]:
+                        context.warning("image '%s' is too big. Can't fit it into atlas. Atlas size increased" % (image_name, ))
+                        fr.sizes = sizes[0:len(sizes)]
+                        mx = max(w, h)
+			mx = nextPOT(mx + 5)
+                        fr.sizes = [s for s in all_sizes if s <= mx]                        
+                                            
                     frames.append(fr)
                     resAnim.frames.append(fr)
     
@@ -264,8 +301,8 @@ class atlas_Processor(process.Process):
     
         while frames:
             try:
-                for sh in context.sizes:
-                    for sw in context.sizes:
+                for sh in fr.sizes:
+                    for sw in fr.sizes:
                         
                         if compression.startswith("pvrtc"):
                             if sh != sw:
@@ -300,15 +337,19 @@ class atlas_Processor(process.Process):
                                     ns = (align_pixel(ns[0]), align_pixel(ns[1]))
                                 
                                 fr.node = atl.add(ns[0], ns[1])
+                                
                                 if not fr.node:
+                                    #if atl.get_root().is_free():
+                                        #image is too big
                                     raise MyExc()
-                                fr.atlas = atl                                
+                                                                                                
+                                fr.atlas = atl
                                 frames_copy.remove(fr)
     
                             frames = frames_copy
     
                         except MyExc:
-                            if sw == context.sizes[-1] and sh == context.sizes[-1]:
+                            if sw == fr.sizes[-1] and sh == fr.sizes[-1]:
                                 frames = frames_copy
                                 raise MyExc()
     

+ 2 - 3
tools/src2/xml_processor.py

@@ -34,9 +34,7 @@ class XmlProcessor:
         self._meta_doc = None
         self._meta_element = None
 
-        all_sizes = [64, 128, 256, 512, 1024, 2048, 4096]
-        self.sizes = [s for s in all_sizes if s <= self.args.max_size]
-        
+       
         self.register_processor(process_font.bmfc_font_Processor())
         self.register_processor(process_font.font_Processor())
         self.register_processor(process_atlas.atlas_Processor())
@@ -44,6 +42,7 @@ class XmlProcessor:
         
         self._current_processor = None
         
+
     def register_processor(self, processor):
         self.processors[processor.node_id] = processor