cocos2d-x/cocos2dx-win8 — pull request #12 by mingulov (2012-09-04 11:33:28+00:00)
Title: Support for devices with ResolutionScale + some minor fixes

Hi,

Win8 supports ResolutionScale property to improve UX for high-density displays:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.resolutionscale

It means that for 10.6" 2560x1440 display it will report the full window size as 1422x1066 (180% less, can be checked with simulator - start simulator, change resolution and start your app). The similar - for 10.6" 1920x1080 it will be 140% less, for example. Some other cases are possible with other resolutions.

So the current cocos2d version does not handle it properly, and uses just a part of available screen space to show the data. This pull request is intended to fix the issue and improve the situation.

As a part of the fix - pointer press events are fixed (it was possible before that the coord is calculated incorrectly in some cases).

Also, text drawing does not work properly on ResolutionScaled devices in case if alignment is used, looks like a bug at DirectDraw (?) or something like this (the printed text is moved to bottom / right, so the bitmap contains just a clipped image of the text). As a workaround - on ResolutionScaled devices alignment usage is disabled, I think as an initial version it should be ok, perhaps later it will be fixed.

Also here is some other fixes:
- HelloWorld compilation is fixed (FontLoader.cpp and FontFileStream.cpp added to the project file)
- Pontential memory fix in case of DirectX call fail in 1 place
- Latest release SDK does not compile DXTextPainter.h due to:
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 - do not lose the edge line on bottom/right - as floating point is widely used, it was possible that last visible line was lost with bitmap data.