Merge branch 'master' into issue270
This commit is contained in:
@@ -194,8 +194,6 @@ typedef std::wstring WString;
|
||||
WString IntToWide(int value);
|
||||
WString ColorToWide(int value);
|
||||
|
||||
void SetIcon( const char *path );
|
||||
|
||||
int GetDeviceOrientation();
|
||||
int GetNormalOrientation();
|
||||
double CapabilitiesGetPixelAspectRatio ();
|
||||
@@ -255,6 +253,8 @@ extern int gFixedOrientation;
|
||||
#endif
|
||||
|
||||
|
||||
void SetIcon( const OSChar *path );
|
||||
|
||||
std::string GetExeName();
|
||||
|
||||
|
||||
|
||||
@@ -928,7 +928,7 @@ DEFINE_PRIM(nme_get_unique_device_identifier,0);
|
||||
value nme_set_icon( value path ) {
|
||||
//printf( "setting icon\n" );
|
||||
#if defined( HX_WINDOWS ) || defined( HX_MACOS )
|
||||
SetIcon( val_string( path ) );
|
||||
SetIcon( val_os_string( path ) );
|
||||
#endif
|
||||
return alloc_null();
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ void CreateMainFrame(FrameCreationCallback inOnFrame, int inWidth, int inHeight,
|
||||
}
|
||||
|
||||
|
||||
void SetIcon(const char *path)
|
||||
void SetIcon(const OSChar *path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ void CreateMainFrame(nme::FrameCreationCallback inOnFrame,int inWidth,int inHeig
|
||||
|
||||
bool sgDead = false;
|
||||
|
||||
void SetIcon( const char *path ) { }
|
||||
void SetIcon( const OSChar *path ) { }
|
||||
|
||||
QuickVec<int> *CapabilitiesGetScreenResolutions()
|
||||
{
|
||||
|
||||
@@ -3052,7 +3052,29 @@ public:
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
if (gFixedOrientation >= 0)
|
||||
return interfaceOrientation == gFixedOrientation;
|
||||
{
|
||||
enum {
|
||||
OrientationPortrait = 1,
|
||||
OrientationPortraitUpsideDown = 2,
|
||||
OrientationLandscapeRight = 3,
|
||||
OrientationLandscapeLeft = 4,
|
||||
OrientationFaceUp = 5,
|
||||
OrientationFaceDown = 6,
|
||||
OrientationPortraitAny = 7,
|
||||
OrientationLandscapeAny = 8,
|
||||
OrientationAny = 9,
|
||||
};
|
||||
|
||||
if (interfaceOrientation == gFixedOrientation)
|
||||
return true;
|
||||
if (gFixedOrientation==OrientationAny)
|
||||
return true;
|
||||
if (gFixedOrientation==OrientationPortraitAny)
|
||||
return interfaceOrientation==OrientationPortrait || interfaceOrientation==OrientationPortraitUpsideDown;
|
||||
if (gFixedOrientation==OrientationLandscapeAny)
|
||||
return interfaceOrientation==OrientationLandscapeLeft || interfaceOrientation==OrientationLandscapeRight;
|
||||
return false;
|
||||
}
|
||||
Event evt(etShouldRotate);
|
||||
evt.value = interfaceOrientation;
|
||||
sgMainView->mStage->OnEvent(evt);
|
||||
|
||||
@@ -1343,7 +1343,7 @@ void CreateMainFrame(FrameCreationCallback inOnFrame,int inWidth,int inHeight,
|
||||
|
||||
bool sgDead = false;
|
||||
|
||||
void SetIcon( const char *path ) {
|
||||
void SetIcon( const OSChar *path ) {
|
||||
#ifndef EMSCRIPTEN
|
||||
initSDL();
|
||||
|
||||
|
||||
@@ -1591,9 +1591,19 @@ void CreateMainFrame(FrameCreationCallback inOnFrame, int inWidth, int inHeight,
|
||||
bool sgDead = false;
|
||||
|
||||
|
||||
void SetIcon(const char *path)
|
||||
void SetIcon(const OSChar *path)
|
||||
{
|
||||
Surface *surface = Surface::Load(path);
|
||||
|
||||
if (surface)
|
||||
{
|
||||
SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom ((void *)surface->GetBase(), surface->Width(), surface->Height(), 32, surface->GetStride(), 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
|
||||
|
||||
SDL_SetWindowIcon(sgSDLFrame->mStage->mSDLWindow, sdlSurface);
|
||||
|
||||
surface->DecRef();
|
||||
SDL_FreeSurface (sdlSurface);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace nme {
|
||||
}
|
||||
|
||||
|
||||
void SetIcon (const char *path) {}
|
||||
void SetIcon (const OSChar *path) {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ void CreateMainFrame(nme::FrameCreationCallback inOnFrame,int inWidth,int inHeig
|
||||
|
||||
bool sgDead = false;
|
||||
|
||||
void SetIcon( const char *path ) { }
|
||||
void SetIcon( const OSChar *path ) { }
|
||||
|
||||
QuickVec<int> *CapabilitiesGetScreenResolutions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user