Compilation fix

There was a different declaration and definition for
CCScheduler::scheduleSelector - ccTime was not fully used.
Merge pull request #8 from mingulov/cctime

Compilation fix for CCScheduler::scheduleSelector
fixed issue#4 CCEGLView::clearRender() in CCEGLView_win8_metro.cpp, did not initialize the local variable color with its current m_color.
issue#9 m_dwriteFactory of DirectXRender should be initialized as IDWriteFactory1
Test is added for the CCDXParticleSystemQuad buffer overflow
CCDXParticleSystemQuad - buffer overflow and potential leak fixes

CCDXParticleSystemQuad is used as a static, so it is initialized just
once for multiple CCParticleSystemQuads. As m_uMaxTotalParticles was
almost useless - some internal buffers have been initialized just
once (by CCDXParticleSystemQuad::initVertexAndIndexBuffer), so there
was a buffer overflow in case if a small buffer (e.g. for 20 particles)
has been initialized originally, and later another CCParticleQuad with
more particles (but less than 100, for example 50) tried to be handled -
CCDXParticleSystemQuad::RenderVertexBuffer overflow buffer by rewriting
the originally allocated memory with more data.
Consequences - random crashes, display flickering and so on. E.g. it was
possible that some CCParticleSystemQuads were not shown at all, some
are shown particularly (as less indices were provided than needed).

Such behaviour is fixed by this commit. m_uMaxTotalParticles is used now
as the currently allocated buffer size, and buffers are dynamically
reallocated when it is needed. No indexes are lost, no memory corruption.

Also a potential memory leak is fixed - if there is some problem
with mapping the buffer at CCDXParticleSystemQuad::RenderVertexBuffer
Potential memory leak fixes

Fixes some potential memory leaks (possible if some DirectX call
fails) for CCDrawingPrimitives, CCGrid and CCRibbon.

Also remove potential 'access denied' exception at
CCDrawingPrimitive and CCDXProgressTimer initVertexBuffer
methods (if memory is not enough for the temporary buffer).
Merge pull request #10 from mingulov/memcorrupt2

CCDXParticleSystemQuad - buffer overflow and potential leak fixes
Text drawing - do not lose the edge line on bottom/right

Due to the float point rounding - it was possible that the last line
on the bottom or on the right was not used. For example, a height of
a bitmap with text had 30 pixels, but just 29 was used for the sprite
creation.
Touch events: fix for the pointer coords
Initial support for scaling displays (ResolutionScale)

WinRT uses Windows.Graphics.Display.ResolutionScale to allow
scaling to pixel density. In case if high-density displays are
used - some data is provided "incorrectly", for example the
current window size for 10.6" 1920x1080 display is shown as
1371x771 with ResolutionScale = 140% (at least on the emulator).
Potential memory leak in case of failed execution
Compilation fix for HelloWorld application

FontLoader.cpp and FontFileStream.cpp were missing at the project.
DXTextPainter.h - compilation fix for the latest official SDK

dxtextpainter.h(48): error C2035: a non-virtual destructor
with 'internal' accessibility is not allowed for this type...
a non-virtual destructor must have 'protected private'
or 'private' accessibility
Text drawing - a fix with active ResolutionScale

In case if ResolutionScale is not equal 100 - the text metrics
are calculated incorrectly, also too big font is tried to be used.
Fix supports both text size and alignments.
Merge pull request #12 from mingulov/resolution_scale

Support for devices with ResolutionScale + some minor fixes
Bug fix for text drawing on displays with ResolutionScale

Sometime due to floating point accuracy problem - it was possible
that the finally calculated metric for the text layout will be
less than originally retrieved one.

For example:
1) text width (T) = 157.122391, ResolutionScale = 180
2) A = T * (180 / 100) (calculating size in pixels for the bitmap)
3) B = A / (180 / 100) (calculating size for the layout from bitmap size)
B = 157.122335. Very small difference, but metrics provides the minimal
size, so text will be incorrectly divided in 2 lines.

Fixed by using the originally received metrics, and re-calculating
it when needed only.
Merge pull request #13 from mingulov/resolution_scale2

Bug fix for text drawing on displays with ResolutionScale
add tinyxml license
update vs2012 project template