Browse Source

minor improves

Denis Muratshin 12 years ago
parent
commit
a9b10b628c

+ 2 - 2
.hg_archival.txt

@@ -1,5 +1,5 @@
 repo: b6d71054df5712e643a0685bc3ba54b123db5729
-node: 56ca01b3ef126d80e4db098c6a192a1bbb303f39
+node: 7f5aaebb97cd72bedfe0f0a34eb9d8b56538b978
 branch: default
 latesttag: oldrender
-latesttagdistance: 59
+latesttagdistance: 68

+ 1 - 0
.hgignore

@@ -85,5 +85,6 @@ oxygine/system_data/data/
 examples/Demo/win32/My Inspector XE Results *
 examples/DemoBox2D/build_box2d_vc11/
 examples/Demo/build_demo_vc11/
+examples/TutorialResources/build_tutorialresources_vc10
 syntax: regexp
 ^build/

+ 7 - 1
Doxyfile

@@ -719,7 +719,13 @@ RECURSIVE              = YES
 # run.
 
 EXCLUDE                = oxygine/src/text_utils/ \
-                         oxygine/src/test/
+                         oxygine/src/minizip/ \
+                         oxygine/src/winnie_alloc/ \
+                         oxygine/src/closure/ \
+                         oxygine/src/dev_tools/ \
+                         oxygine/src/pugixml/ \
+                         oxygine/src/core/stage3d/ \
+
 
 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or 
 # directories that are symbolic links (a Unix file system feature) are excluded 

BIN
doc.zip


+ 2 - 1
examples/CMakeLists.txt

@@ -12,4 +12,5 @@ add_subdirectory(Demo)
 add_subdirectory(HelloWorld)
 add_subdirectory(Match3)
 add_subdirectory(GameTemplate)
-add_subdirectory(DemoBox2D)
+add_subdirectory(DemoBox2D)
+add_subdirectory(TutorialResources)

BIN
examples/Demo/data/images/bg.jpg


+ 2 - 0
examples/Demo/src/TestSliding.h

@@ -33,6 +33,8 @@ public:
 				arg_y = i * 100.0f,
 				arg_attachTo = content);
 
+			c->setCull(true);//cull invisible parts
+
 			spButton button = initActor(new Button, 
 				arg_resAnim = resourcesUI.getResAnim("button"),
 				arg_attachTo = c);

+ 2 - 2
examples/Demo/win32/HelloWorld_vs2010.vcxproj

@@ -50,7 +50,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;OXYGINE_SDL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>../../../oxygine/src;../../../oxygine/third_party/win32/glew;../../../../SDL/include;../../../oxygine/third_party/win32/pthreads/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
@@ -68,7 +68,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;OXYGINE_SDL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>../../../oxygine/src;../../../oxygine/third_party/win32/glew;../../../../SDL/include;../../../oxygine/third_party/win32/pthreads/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>

+ 16 - 9
examples/DemoBox2D/src/entry_point.cpp

@@ -1,5 +1,10 @@
+/**
+Attention!
+This file has Oxygine initialization stuff.
+If you just started you don't need to understand it exactly you could check it later. 
+You could start from example.cpp and example.h it has main functions being called from there
+*/
 #include <stdio.h>
-
 #include "core/Renderer.h"
 #include "RootActor.h"
 #include "DebugActor.h"
@@ -35,6 +40,7 @@ public:
 	}
 };
 
+//called each frame
 int mainloop()
 {
 	example_update();
@@ -67,16 +73,17 @@ int mainloop()
 void run()
 {	
 	//initialize oxygine's internal stuff
-	core::init_desc desc; 
+	core::init_desc desc;
 
 #if OXYGINE_SDL
 	//we could setup initial window size on SDL builds
-	//desc.w = 640;
-	//desc.h = 480;
+	//desc.w = 960;
+	//desc.h = 660;
 	//marmalade settings could be changed from emulator's menu
 #endif
 
 	core::init(&desc);	
+	example_preinit();
 	
 	//create RootActor. RootActor is a root node
 	RootActor::instance = new ExampleRootActor();	
@@ -90,8 +97,7 @@ void run()
 	getRoot()->addChild(new DebugActor());
 
 
-	//initialization view and projection matrix 	
-	//makeViewMatrix returns View matrix where Left Top corner is (0,0), and right bottom is (w,h)
+	
 	Matrix view = makeViewMatrix(size.x, size.y); 
 
 	viewport = Rect(0, 0, size.x, size.y);
@@ -100,12 +106,13 @@ void run()
 	//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.setViewProjTransform(view, proj);
+
+	//initialization view and projection matrix 	
+	//where Left Top corner is (0, 0), and right bottom is (width, height)
+	renderer.initCoordinateSystem(size.x, size.y);
 
 	//initialize this example stuff. see example.cpp
 	example_init();

+ 4 - 0
examples/DemoBox2D/src/example.cpp

@@ -164,6 +164,10 @@ public:
 
 };
 
+void example_preinit()
+{
+}
+
 void example_init()
 {
 	//load xml file with resources definition

+ 2 - 4
examples/DemoBox2D/src/example.h

@@ -1,6 +1,4 @@
+void example_preinit();
 void example_init();
 void example_destroy();
-void example_update();
-
-const int VirtualWidth = 960;
-const int VirtualHeight = 640;
+void example_update();

+ 14 - 7
examples/GameTemplate/src/entry_point.cpp

@@ -1,5 +1,10 @@
+/**
+Attention!
+This file has Oxygine initialization stuff.
+If you just started you don't need to understand it exactly you could check it later. 
+You could start from example.cpp and example.h it has main functions being called from there
+*/
 #include <stdio.h>
-
 #include "core/Renderer.h"
 #include "RootActor.h"
 #include "DebugActor.h"
@@ -35,7 +40,8 @@ public:
 	}
 };
 
-int mainloop() 
+//called each frame
+int mainloop()
 {
 	example_update();
 	//update our rootActor
@@ -77,6 +83,7 @@ void run()
 #endif
 
 	core::init(&desc);	
+	example_preinit();
 	
 	//create RootActor. RootActor is a root node
 	RootActor::instance = new ExampleRootActor();	
@@ -90,8 +97,7 @@ void run()
 	getRoot()->addChild(new DebugActor());
 
 
-	//initialization view and projection matrix 	
-	//makeViewMatrix returns View matrix where Left Top corner is (0,0), and right bottom is (w,h)
+	
 	Matrix view = makeViewMatrix(size.x, size.y); 
 
 	viewport = Rect(0, 0, size.x, size.y);
@@ -100,12 +106,13 @@ void run()
 	//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.setViewProjTransform(view, proj);
+
+	//initialization view and projection matrix 	
+	//where Left Top corner is (0, 0), and right bottom is (width, height)
+	renderer.initCoordinateSystem(size.x, size.y);
 
 	//initialize this example stuff. see example.cpp
 	example_init();

+ 3 - 0
examples/GameTemplate/src/example.cpp

@@ -15,6 +15,9 @@ public:
 
 };
 
+void example_preinit()
+{
+}
 
 void example_init()
 {

+ 1 - 0
examples/GameTemplate/src/example.h

@@ -1,3 +1,4 @@
+void example_preinit();
 void example_init();
 void example_destroy();
 void example_update();

+ 13 - 6
examples/HelloWorld/src/entry_point.cpp

@@ -1,5 +1,10 @@
+/**
+Attention!
+This file has Oxygine initialization stuff.
+If you just started you don't need to understand it exactly you could check it later. 
+You could start from example.cpp and example.h it has main functions being called from there
+*/
 #include <stdio.h>
-
 #include "core/Renderer.h"
 #include "RootActor.h"
 #include "DebugActor.h"
@@ -35,6 +40,7 @@ public:
 	}
 };
 
+//called each frame
 int mainloop()
 {
 	example_update();
@@ -77,6 +83,7 @@ void run()
 #endif
 
 	core::init(&desc);	
+	example_preinit();
 	
 	//create RootActor. RootActor is a root node
 	RootActor::instance = new ExampleRootActor();	
@@ -90,8 +97,7 @@ void run()
 	getRoot()->addChild(new DebugActor());
 
 
-	//initialization view and projection matrix 	
-	//makeViewMatrix returns View matrix where Left Top corner is (0,0), and right bottom is (w,h)
+	
 	Matrix view = makeViewMatrix(size.x, size.y); 
 
 	viewport = Rect(0, 0, size.x, size.y);
@@ -100,12 +106,13 @@ void run()
 	//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.setViewProjTransform(view, proj);
+
+	//initialization view and projection matrix 	
+	//where Left Top corner is (0, 0), and right bottom is (width, height)
+	renderer.initCoordinateSystem(size.x, size.y);
 
 	//initialize this example stuff. see example.cpp
 	example_init();

+ 4 - 0
examples/HelloWorld/src/example.cpp

@@ -102,6 +102,10 @@ public:
 	}
 };
 
+void example_preinit()
+{
+}
+
 void example_init()
 {
 	//load xml file with resources definition

+ 1 - 0
examples/HelloWorld/src/example.h

@@ -1,3 +1,4 @@
+void example_preinit();
 void example_init();
 void example_destroy();
 void example_update();

+ 13 - 6
examples/Match3/src/entry_point.cpp

@@ -1,5 +1,10 @@
+/**
+Attention!
+This file has Oxygine initialization stuff.
+If you just started you don't need to understand it exactly you could check it later. 
+You could start from example.cpp and example.h it has main functions being called from there
+*/
 #include <stdio.h>
-
 #include "core/Renderer.h"
 #include "RootActor.h"
 #include "DebugActor.h"
@@ -35,6 +40,7 @@ public:
 	}
 };
 
+//called each frame
 int mainloop()
 {
 	example_update();
@@ -77,6 +83,7 @@ void run()
 #endif
 
 	core::init(&desc);	
+	example_preinit();
 	
 	//create RootActor. RootActor is a root node
 	RootActor::instance = new ExampleRootActor();	
@@ -90,8 +97,7 @@ void run()
 	getRoot()->addChild(new DebugActor());
 
 
-	//initialization view and projection matrix 	
-	//makeViewMatrix returns View matrix where Left Top corner is (0,0), and right bottom is (w,h)
+	
 	Matrix view = makeViewMatrix(size.x, size.y); 
 
 	viewport = Rect(0, 0, size.x, size.y);
@@ -100,12 +106,13 @@ void run()
 	//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.setViewProjTransform(view, proj);
+
+	//initialization view and projection matrix 	
+	//where Left Top corner is (0, 0), and right bottom is (width, height)
+	renderer.initCoordinateSystem(size.x, size.y);
 
 	//initialize this example stuff. see example.cpp
 	example_init();

+ 6 - 0
examples/Match3/src/example.cpp

@@ -4,6 +4,12 @@
 #include "shared.h"
 
 using namespace oxygine;
+
+void example_preinit()
+{
+
+}
+
 void example_init()
 {
 	//load xml file with resources definition

+ 1 - 0
examples/Match3/src/example.h

@@ -1,3 +1,4 @@
+void example_preinit();
 void example_init();
 void example_destroy();
 void example_update();

+ 9 - 0
examples/TutorialResources/CMakeLists.txt

@@ -0,0 +1,9 @@
+cmake_minimum_required (VERSION 2.6)
+project (TUTORIALRESOURCES)
+
+add_executable(TutorialResources 
+	src/entry_point.cpp
+	src/example.h 
+	src/example.cpp)
+
+target_link_libraries(TutorialResources ${OXYGINE_CORE_LIBS})

+ 107 - 0
examples/TutorialResources/data/development.icf

@@ -0,0 +1,107 @@
+# Settings ICF file automatically generated by S3E development environment
+
+AccelEnabled                   = Type=bool, Default="true", Value = "true"
+AudioAAC                       = Type=bool, Default="false", Value = "false"
+AudioAACPlus                   = Type=bool, Default="false", Value = "false"
+AudioMIDI                      = Type=bool, Default="true", Value = "true"
+AudioMP3                       = Type=bool, Default="true", Value = "true"
+AudioPCM                       = Type=bool, Default="true", Value = "true"
+AudioQCP                       = Type=bool, Default="false", Value = "false"
+AudioVolumeDefault             = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256"
+BacklightTimeout               = Type=int, Min=0.000000, Max=120000.000000, Default="10000", Value = "10000"
+CompassEnabled                 = Type=bool, Default="true", Value = "true"
+ContactsFromAddrBook           = Type=bool, Default="false", Value = "false"
+DeviceAdvanceSoftkeyPosition   = Type=string, Allowed="Bottom Left" "Bottom Right" "Top Right" "Top Left", Default="Bottom Left", Value = "Bottom Left"
+DeviceArch                     = Type=string, Allowed="<Use Native Architecture>" "ARM4T" "ARM4" "ARM5T" "ARM5TE" "ARM5TEJ" "ARM6" "ARM6K" "ARM6T2" "ARM6Z" "X86" "PPC" "AMD64" "ARM7", Default="<Use Native Architecture>", Value = "<Use Native Architecture>"
+DeviceBackSoftkeyPosition      = Type=string, Allowed="Bottom Left" "Bottom Right" "Top Right" "Top Left", Default="Bottom Right", Value = "Bottom Right"
+DeviceBatteryLevel             = Type=int, Min=0.000000, Max=100.000000, Default="50", Value = "50"
+DeviceClass                    = Type=string, Allowed="UNKNOWN" "SYMBIAN_GENERIC" "SYMBIAN_SERIES60" "SYMBIAN_SERIES60_EMULATOR" "SYMBIAN_UIQ" "SYMBIAN_UIQ_EMULATOR" "BREW_GENERIC" "BREW_QCIF_3D" "BREW_QCIF_25G" "BREW_SQCIF_256" "BREW_QVGA_3G" "WINDOWS_GENERIC" "WINMOBILE_GENERIC" "WINMOBILE_SP" "WINMOBILE_PPC" "LINUX_GENERIC" "LINUX_DESKTOP" "LINUX_EMBED" "WIPI_GENERIC" "NDS_GENERIC" "ARM_SEMIH_GENERIC" "NULCUES_GENERIC" "NGI_GENERIC", Default="WINDOWS_GENERIC", Value = "WINDOWS_GENERIC"
+DeviceFPU                      = Type=string, Allowed="None" "VFP Present", Default="VFP Present", Value = "VFP Present"
+DeviceFreeRAM                  = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576"
+DeviceIDInt                    = Type=int, Default="0", Value = "0"
+DeviceIDString                 = Type=string, Default="", Value = ""
+DeviceIMSI                     = Type=string, Default="SIMULATOR_IMSI", Value = "SIMULATOR_IMSI"
+DeviceLSKIsBack                = Type=bool, Default="false", Value = "false"
+DeviceLanguage                 = Type=string, Allowed="UNKNOWN" "ENGLISH" "FRENCH" "GERMAN" "SPANISH" "ITALIAN" "PORTUGUESE" "DUTCH" "TURKISH" "CROATIAN" "CZECH" "DANISH" "FINNISH" "HUNGARIAN" "NORWEGIAN" "POLISH" "RUSSIAN" "SERBIAN" "SLOVAK" "SLOVENIAN" "SWEDISH" "UKRAINIAN" "GREEK" "JAPANESE" "SIMPL_CHINESE" "TRAD_CHINESE" "KOREAN" "ICELANDIC" "FLEMISH" "THAI" "AFRIKAANS" "ALBANIAN" "AMHARIC" "ARABIC" "ARMENIAN" "AZERBAIJANI" "TAGALOG" "BELARUSSIAN" "BENGALI" "BULGARIAN" "BURMESE" "CATALAN" "ESTONIAN" "FARSI" "GAELIC" "GEORGIAN" "GUJARATI" "HEBREW" "HINDI" "INDONESIAN" "IRISH" "KANNADA" "KAZAKH" "KHMER" "LAO" "LATVIAN" "LITHUANIAN" "MACEDONIAN" "MALAY" "MALAYALAM" "MARATHI" "MOLDOVIAN" "MONGOLIAN" "PUNJABI" "ROMANIAN" "SINHALESE" "SOMALI" "SWAHILI" "TAJIK" "TAMIL" "TELUGU" "TIBETAN" "TIGRINYA" "TURKMEN" "URDU" "UZBEK" "VIETNAMESE" "WELSH" "ZULU" "<Use Native Language>", Default="<Use Native Language>", Value = "<Use Native Language>"
+DeviceMainsPower               = Type=bool, Default="false", Value = "false"
+DeviceName                     = Type=string, Default="My Computer", Value = "My Computer"
+DeviceOS                       = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "NONE"
+DeviceOSVersion                = Type=string, Default="", Value = ""
+DeviceOSVersionNumber          = Type=int, Default="0", Value = "0"
+DevicePhoneNumber              = Type=string, Default="0044123456789", Value = "0044123456789"
+DeviceTimezone                 = Type=string, Default="SYSTEM", Value = "SYSTEM"
+DeviceTotalRAM                 = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576"
+DeviceUniqueID                 = Type=string, Default="SIMULATOR_ID", Value = "SIMULATOR_ID"
+DeviceUniqueIDInt              = Type=int, Default="01234567890", Value = "01234567890"
+FileTotalStorageSize           = Type=int, Min=0.000000, Max=2147483648.000000, Default="67108864", Value = "67108864"
+FileUseSeparateRomRam          = Type=bool, Default="true", Value = "true"
+FileUseTotalStorageSize        = Type=bool, Default="false", Value = "false"
+GLAPI                          = Type=string, Allowed="None" "GLES 1.0 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.1 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.0 Common Profile from Imagination POWERVR(TM)" "GLES 1.1 Common Profile from Imagination POWERVR(TM)" "GLES 2.0 from Imagination POWERVR(TM)" "Obey [S3E] SysGlesVersion .icf setting" "GLES 1.1 Common Profile from Qualcomm Snapdragon(TM)" "GLES 2.0 from Qualcomm Snapdragon(TM)" "GLES 2.0 ANGLE" "GLES 2.0 ANGLE DirectX 11", Default="Obey [S3E] SysGlesVersion .icf setting", Value = "Obey [S3E] SysGlesVersion .icf setting"
+GLDontUseHiddenWindow          = Type=bool, Default="false", Value = "false"
+GLTerminateOnSuspend           = Type=bool, Default="false", Value = "false"
+GLUsePVRVFrame                 = Type=bool, Default="false", Value = "false"
+KeyboardHasAlpha               = Type=bool, Default="true", Value = "true"
+KeyboardHasDirection           = Type=bool, Default="true", Value = "true"
+KeyboardHasKeypad              = Type=bool, Default="true", Value = "true"
+KeyboardNumpadRotation         = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0"
+LicenseExpiryDate              = Type=int, Min=0.000000, Max=999999995904.000000, Default="0", Value = "0"
+LicenseMinutesRemaining        = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0"
+LicenseStatus                  = Type=string, Allowed="EXPIRED" "DEMO" "USECOUNT" "EXPIRYDATE" "EXPIRYMINSUSE" "PURCHASE" "SUBSCRIPTION" "UPGRADE" "NONCOMMERCIAL", Default="NONCOMMERCIAL", Value = "NONCOMMERCIAL"
+LicenseUsesRemaining           = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0"
+LocationAltitude               = Type=float, Min=-2000.000000, Max=100000.000000, Default="60.0", Value = "60.0"
+LocationAvailable              = Type=bool, Default="true", Value = "true"
+LocationHeading                = Type=float, Min=0.000000, Max=359.000000, Default="0.0", Value = "0.0"
+LocationHorizontalAccuracy     = Type=float, Min=0.000000, Max=100000.000000, Default="20.0", Value = "20.0"
+LocationLatitude               = Type=float, Min=-90.000000, Max=90.000000, Default="51.511791", Value = "51.511791"
+LocationLongitude              = Type=float, Min=-180.000000, Max=180.000000, Default="-0.191084", Value = "-0.191084"
+LocationSpeed                  = Type=float, Min=0.000000, Max=10000.000000, Default="0", Value = "0"
+LocationVerticalAccuracy       = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0"
+MacOSSimulatorCustomSettings   = Type=string, Default="", Value = ""
+MacOSSimulatorDevices_ANDROID  = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512"
+MacOSSimulatorDevices_IPHONE   = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPhone 5:640x1136:1024" "iPad:768x1024:256" "iPad 2:768x1024:512" "iPad 3:1536x2048:1024", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256"
+MacOSSimulatorPlatforms        = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE"
+MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true"
+MemoryPoison                   = Type=bool, Default="true", Value = "true"
+MemoryPoisonAlloc              = Type=int, Min=0.000000, Max=255.000000, Default="170", Value = "170"
+MemoryPoisonFree               = Type=int, Min=0.000000, Max=255.000000, Default="221", Value = "221"
+MemoryPoisonInit               = Type=int, Min=0.000000, Max=255.000000, Default="204", Value = "204"
+PointerAvailable               = Type=bool, Default="true", Value = "true"
+PointerMultiSimulationMode     = Type=bool, Default="false", Value = "false"
+PointerMultiTouchAvailable     = Type=bool, Default="false", Value = "false"
+PointerStylusType              = Type=string, Allowed="INVALID" "STYLUS" "FINGER", Default="INVALID", Value = "INVALID"
+PointerType                    = Type=string, Allowed="INVALID" "MOUSE" "STYLUS", Default="MOUSE", Value = "MOUSE"
+SMSEnabled                     = Type=bool, Default="true", Value = "true"
+SMSReceiveEnabled              = Type=bool, Default="true", Value = "true"
+SocketDNSDelay                 = Type=int, Min=0.000000, Max=30000.000000, Default="0", Value = "0"
+SocketHTTPProxy                = Type=string, Default="", Value = ""
+SocketHostName                 = Type=string, Default="", Value = ""
+SocketNetworkAvailable         = Type=bool, Default="true", Value = "true"
+SocketNetworkLoss              = Type=bool, Default="false", Value = "false"
+SocketNetworkType              = Type=string, Allowed="NONE" "UNKNOWN" "LAN" "WLAN" "GPRS" "UMTS" "EVDO" "CDMA2000" "HSDPA" "WIMAX" "BLUETOOTH" "EDGE" "CDMA" "IDEN" "LTE" "EHRPD" "HSPAPLUS", Default="LAN", Value = "LAN"
+SocketRecvLimit                = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0"
+SocketSendLimit                = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0"
+SoundEnabled                   = Type=bool, Default="true", Value = "true"
+SoundRecordEnabled             = Type=bool, Default="true", Value = "true"
+SoundSampleRate                = Type=int, Allowed="8192" "11025" "16000" "22050" "44100", Default="22050", Value = "22050"
+SoundStereo                    = Type=bool, Default="true", Value = "true"
+SoundVolumeDefault             = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256"
+SurfaceDisableWhenGLIsActive   = Type=bool, Default="false", Value = "false"
+SurfaceDoubleBuffer            = Type=bool, Default="false", Value = "false"
+SurfaceHeight                  = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "680"
+SurfacePitch                   = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0"
+SurfacePixelType               = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565"
+SurfacePredefinedResolution    = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "640x1136 (iPhone 5 Portrait)" "1136x640 (iPhone 5 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200"
+SurfaceRotation                = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0"
+SurfaceUnalign                 = Type=bool, Default="true", Value = "true"
+SurfaceUseMultiBuffers         = Type=bool, Default="true", Value = "true"
+SurfaceWidth                   = Type=int, Min=128.000000, Max=4096.000000, Default="320", Value = "960"
+SymbianSoundLatency            = Type=int, Min=20.000000, Max=1400.000000, Default="120", Value = "120"
+ThreadEnabled                  = Type=bool, Default="true", Value = "true"
+TimerAccuracy                  = Type=int, Min=0.000000, Max=1000.000000, Default="0", Value = "0"
+TimerHiRes                     = Type=bool, Default="false", Value = "false"
+TimerLocaltimeOffsetHours      = Type=string, Allowed="-12" "-11" "-10" "-9" "-8" "-7" "-6" "-5" "-4" "-3" "-2" "-1" "0" "+1" "+2" "+3" "+4" "+5" "+6" "+7" "+8" "+9" "+10" "+11" "+12" "+13" "SYSTEM", Default="SYSTEM", Value = "SYSTEM"
+VibraEnabled                   = Type=bool, Default="true", Value = "true"
+Video3GPP                      = Type=bool, Default="false", Value = "false"
+VideoJPEG                      = Type=bool, Default="true", Value = "true"
+VideoMPEG4                     = Type=bool, Default="true", Value = "true"
+VideoVolumeDefault             = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256"

+ 65 - 37
examples/TutorialResources/src/entry_point.cpp

@@ -1,5 +1,10 @@
+/**
+Attention!
+This file has Oxygine initialization stuff.
+If you just started you don't need to understand it exactly you could check it later. 
+You could start from example.cpp and example.h it has main functions being called from there
+*/
 #include <stdio.h>
-
 #include "core/Renderer.h"
 #include "RootActor.h"
 #include "DebugActor.h"
@@ -12,20 +17,49 @@ using namespace oxygine;
 Renderer renderer;
 Rect viewport;
 
+
+class ExampleRootActor: public RootActor
+{
+public:
+	ExampleRootActor()
+	{
+		//each mobile application should handle focus lost
+		//and free/restore GPU resources
+		addEventListener(RootActor::DEACTIVATE, CLOSURE(this, &ExampleRootActor::onDeactivate));
+		addEventListener(RootActor::ACTIVATE, CLOSURE(this, &ExampleRootActor::onActivate));
+	}
+
+	void onDeactivate(Event *)
+	{
+		core::reset();
+	}
+
+	void onActivate(Event *)
+	{
+		core::restore();
+	}
+};
+
+//called each frame
 int mainloop()
 {
 	example_update();
 	//update our rootActor
 	//Actor::update would be called also for children
-	RootActor::instance->update();
+	getRoot()->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();
+	if (renderer.begin(0, viewport, &clear))
+	{
+		//begin rendering from RootActor. 
+		getRoot()->render(renderer);
+		//rendering done
+		renderer.end();
+
+		core::swapDisplayBuffers();
+	}
+	
 
 	//update internal components
 	//all input events would be passed to RootActor::instance.handleEvent
@@ -39,34 +73,32 @@ int mainloop()
 void run()
 {	
 	//initialize oxygine's internal stuff
-	core::init();
-	
-	
-	//create RootActor. RootActor is a root node
-	RootActor::instance = new RootActor();
+	core::init_desc desc;
+
+#if OXYGINE_SDL
+	//we could setup initial window size on SDL builds
+	//desc.w = 960;
+	//desc.h = 660;
+	//marmalade settings could be changed from emulator's menu
+#endif
 
+	core::init(&desc);	
+	example_preinit();
 	
+	//create RootActor. RootActor is a root node
+	RootActor::instance = new ExampleRootActor();	
 	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));
+	getRoot()->init(size, size);
 	
-
-	//DebugActor is a helper node it shows FPS and memory usage
+	//DebugActor is a helper node it shows FPS and memory usage and other useful stuff
 	DebugActor::initialize();
 
-
 	//create and add new DebugActor to root actor as child
-	RootActor::instance->addChild(new DebugActor());
+	getRoot()->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)
+	Matrix view = makeViewMatrix(size.x, size.y); 
 
 	viewport = Rect(0, 0, size.x, size.y);
 
@@ -74,19 +106,17 @@ void run()
 	//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);
 
+	//initialization view and projection matrix 	
+	//where Left Top corner is (0, 0), and right bottom is (width, height)
+	renderer.initCoordinateSystem(size.x, size.y);
 
-	//initialize this example stuff. check example.cpp
+	//initialize this example stuff. see example.cpp
 	example_init();
 
-
 	bool done = false;	
 
 	//here is main game loop
@@ -96,17 +126,16 @@ void run()
 		if (done)
 			break;
     }
-	//so user closed application
+	//so user want to leave application...
 	
-	//lets dump all created objects into Output
+	//lets dump all created objects into log
 	//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
+	//all actors/sprites are smart pointer objects and actually you don't need it remove them by hands
+	//but now we want delete it by hands
 
 	//check example.cpp
 	example_destroy();	
@@ -120,7 +149,6 @@ void run()
 	//dump list should be empty now
 	//we deleted everything and could be sure that there aren't any memory leaks
 	ObjectBase::dumpCreatedObjects();
-
 	//end
 }
 

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

@@ -3,6 +3,10 @@ using namespace oxygine;
 
 Resources animals;
 
+void example_preinit()
+{
+
+}
 void example_init()
 {
 	animals.loadXML("animals.xml");
@@ -18,6 +22,11 @@ void example_init()
 	cat->attachTo(getRoot());
 }
 
+void example_update()
+{
+
+}
+
 void example_destroy()
 {
 	animals.free();

+ 2 - 3
examples/TutorialResources/src/example.h

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

+ 3 - 0
oxygine/src/AnimationFrame.cpp

@@ -1,4 +1,5 @@
 #include "AnimationFrame.h"
+#include "res/ResAnim.h"
 namespace oxygine
 {
 	void AnimationFrame::init(ResAnim *rs, const Diffuse &df, const RectF &srcRect, const RectF &destRect, const Vector2 &frame_size)
@@ -21,6 +22,8 @@ namespace oxygine
 		RectF srcRect = _srcRect * Vector2(w, h);
 
 		float sc = 1.0f;//(float)srcRect.getWidth() / f._destRect.getWidth();
+		if (_resAnim)
+			sc = _resAnim->getScaleFactor();
 
 
 		f._srcRect.pos = srcRect.pos - (_destRect.pos - f._destRect.pos) * sc;

+ 5 - 7
oxygine/src/AnimationFrame.h

@@ -22,10 +22,11 @@ namespace oxygine
 	class AnimationFrame
 	{
 	public:
-		AnimationFrame(): _flags(0), _srcRect(0, 0, 1, 1), _destRect(0, 0, 1, 1), _frameSize(0, 0), _resAnim(0){}
+		AnimationFrame():/* _flags(0), */_srcRect(0, 0, 1, 1), _destRect(0, 0, 1, 1), _frameSize(0, 0), _resAnim(0){}
 
 		void init(ResAnim *rs, const Diffuse &df, 
 			const RectF &srcRect, const RectF &destRect, const Vector2 &frame_size);
+		/**ResAnim should be valid!*/
 		AnimationFrame clip(const RectF &rect) const;
 		AnimationFrame flip(bool vertical, bool horizontal) const;
 
@@ -49,16 +50,13 @@ namespace oxygine
 		{
 			clipped = 0x01,
 		};
-		unsigned short	_flags;
+		
 		Diffuse			_diffuse;
-		/*
-		spTexture		_baseTexture;
-		spTexture		_alphaTexture;
-		bool			_premultiplied;
-		*/
+
 		RectF			_srcRect;
 		RectF			_destRect;
 		Vector2			_frameSize;//real size without clipping
 		ResAnim*		_resAnim;
+		//unsigned short	_flags;
 	};
 }

+ 3 - 3
oxygine/src/core/STDFileSystem.cpp

@@ -145,7 +145,7 @@ namespace oxygine
 			virtual unsigned int getSize() const
 			{
 				oxFileSeek(_handle, 0, ox_FILESEEK_END);
-				unsigned int size  = oxFileTell(_handle);
+				unsigned int size  = (unsigned int)oxFileTell(_handle);
 				oxFileSeek(_handle, 0, ox_FILESEEK_SET);
 
 				return size;
@@ -159,7 +159,7 @@ namespace oxygine
 		{
 #ifdef WIN32
 			if (!_readonly)
-				mkdir(getFullPath("").c_str());
+				_mkdir(getFullPath("").c_str());
 #endif
 		}
 
@@ -244,7 +244,7 @@ namespace oxygine
 #if __S3E__
 			s3eFileMakeDirectory(buff);
 #elif WIN32
-			mkdir(buff);
+			_mkdir(buff);
 #else
 			mkdir(buff, 0777);
 #endif

+ 4 - 0
oxygine/src/core/file.cpp

@@ -168,8 +168,12 @@ namespace oxygine
 		{
 #if __S3E__
 			s3eFileDeleteDirectory(path);
+#else
+#ifdef WIN32
+			_rmdir(path);
 #else
 			rmdir(path);
+#endif
 #endif
 		}
 

+ 5 - 0
oxygine/src/oxygine_include.h

@@ -13,6 +13,11 @@
 	#endif
 #else
 	#define OXYGINE_SDL 1
+	#ifdef WIN32
+		#ifndef _CRT_SECURE_NO_WARNINGS
+			#define _CRT_SECURE_NO_WARNINGS
+		#endif
+	#endif
 #endif