forked from organicmaps/organicmaps
[iOS] Logging on startup added.
This commit is contained in:
parent
b0cf0bdb3a
commit
8bb6e70721
4 changed files with 41 additions and 24 deletions
|
@ -20,8 +20,8 @@
|
|||
|
||||
+ (NSString *) getDefaultSetName
|
||||
{
|
||||
Framework &f = GetFramework();
|
||||
int categoryPos = f.LastEditedCategory();
|
||||
Framework & f = GetFramework();
|
||||
int const categoryPos = f.LastEditedCategory();
|
||||
return[NSString stringWithUTF8String:f.GetBmCategory(categoryPos)->GetName().c_str()];
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,11 @@
|
|||
{
|
||||
// Default bookmark pin color
|
||||
self.color = @"placemark-red";
|
||||
|
||||
NSLog(@"Framework initialization started");
|
||||
self.setName = [BalloonView getDefaultSetName];
|
||||
NSLog(@"Framework initialization ended");
|
||||
|
||||
// Load bookmarks from kml files
|
||||
GetFramework().LoadBookmarks();
|
||||
self.pinImage = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:self.color]] autorelease];
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
// The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
|
||||
- (id)initWithCoder:(NSCoder*)coder
|
||||
{
|
||||
NSLog(@"EAGLView initWithCoder Started");
|
||||
|
||||
if ((self = [super initWithCoder:coder]))
|
||||
{
|
||||
// Setup Layer Properties
|
||||
|
@ -43,6 +45,7 @@
|
|||
|
||||
if (!renderContext.get())
|
||||
{
|
||||
NSLog(@"EAGLView initWithCoder Error");
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
@ -60,51 +63,54 @@
|
|||
// Correct retina display support in opengl renderbuffer
|
||||
self.contentScaleFactor = [[UIScreen mainScreen] scale];
|
||||
}
|
||||
|
||||
|
||||
NSLog(@"EAGLView initWithCoder Ended");
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)initRenderPolicy
|
||||
{
|
||||
NSLog(@"EAGLView initRenderPolicy Started");
|
||||
|
||||
// to avoid grid bug on 3G device
|
||||
graphics::DataFormat rtFmt = graphics::Data4Bpp;
|
||||
graphics::DataFormat texFmt = graphics::Data4Bpp;
|
||||
if ([[NSString stringWithFormat:@"%s", glGetString(GL_RENDERER)] hasPrefix:@"PowerVR MBX"])
|
||||
rtFmt = graphics::Data8Bpp;
|
||||
|
||||
|
||||
typedef void (*drawFrameFn)(id, SEL);
|
||||
SEL drawFrameSel = @selector(drawFrame);
|
||||
drawFrameFn drawFrameImpl = (drawFrameFn)[self methodForSelector:drawFrameSel];
|
||||
|
||||
videoTimer = CreateIOSVideoTimer(bind(drawFrameImpl, self, drawFrameSel));
|
||||
|
||||
|
||||
graphics::ResourceManager::Params rmParams;
|
||||
rmParams.m_videoMemoryLimit = GetPlatform().VideoMemoryLimit();
|
||||
rmParams.m_rtFormat = rtFmt;
|
||||
rmParams.m_texFormat = texFmt;
|
||||
|
||||
|
||||
RenderPolicy::Params rpParams;
|
||||
|
||||
|
||||
CGRect frameRect = [[UIScreen mainScreen] applicationFrame];
|
||||
CGRect screenRect = [[UIScreen mainScreen] bounds];
|
||||
|
||||
|
||||
double vs = [[UIScreen mainScreen] scale];
|
||||
|
||||
|
||||
rpParams.m_screenWidth = screenRect.size.width * vs;
|
||||
rpParams.m_screenHeight = screenRect.size.height * vs;
|
||||
|
||||
|
||||
rpParams.m_skinName = "basic.skn";
|
||||
|
||||
|
||||
if (vs > 1.0)
|
||||
rpParams.m_density = graphics::EDensityXHDPI;
|
||||
else
|
||||
rpParams.m_density = graphics::EDensityMDPI;
|
||||
|
||||
|
||||
rpParams.m_videoTimer = videoTimer;
|
||||
rpParams.m_useDefaultFB = false;
|
||||
rpParams.m_rmParams = rmParams;
|
||||
rpParams.m_primaryRC = renderContext;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
renderPolicy = CreateRenderPolicy(rpParams);
|
||||
|
@ -113,12 +119,14 @@
|
|||
{
|
||||
/// terminate program (though this situation is unreal :) )
|
||||
}
|
||||
|
||||
|
||||
frameBuffer = renderPolicy->GetDrawer()->screen()->frameBuffer();
|
||||
|
||||
GetFramework().OnSize(frameRect.size.width * vs,
|
||||
frameRect.size.height * vs);
|
||||
GetFramework().SetRenderPolicy(renderPolicy);
|
||||
|
||||
Framework & f = GetFramework();
|
||||
f.OnSize(frameRect.size.width * vs, frameRect.size.height * vs);
|
||||
f.SetRenderPolicy(renderPolicy);
|
||||
|
||||
NSLog(@"EAGLView initRenderPolicy Ended");
|
||||
}
|
||||
|
||||
- (void)onSize:(int)width withHeight:(int)height
|
||||
|
|
|
@ -405,8 +405,10 @@ const long long LITE_IDL = 431183278L;
|
|||
|
||||
- (id) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ((self = [super initWithCoder:coder]))
|
||||
{
|
||||
NSLog(@"MapViewController initWithCoder Started");
|
||||
|
||||
if ((self = [super initWithCoder:coder]))
|
||||
{
|
||||
self.title = NSLocalizedString(@"back", @"Back button in nav bar to show the map");
|
||||
|
||||
// Helper to display/hide pin on screen tap
|
||||
|
@ -432,9 +434,9 @@ const long long LITE_IDL = 431183278L;
|
|||
ls->AddCompassStatusListener(bind(onCompassStatusChangedImpl, self, onCompassStatusChangedSel, _1));
|
||||
ls->AddOnPositionClickListener(bind(onMyPosiionClickedImpl, self, onMyPositionClickedSel,_1));
|
||||
|
||||
m_StickyThreshold = 10;
|
||||
m_StickyThreshold = 10;
|
||||
|
||||
m_CurrentAction = NOTHING;
|
||||
m_CurrentAction = NOTHING;
|
||||
|
||||
[v initRenderPolicy];
|
||||
|
||||
|
@ -443,9 +445,10 @@ const long long LITE_IDL = 431183278L;
|
|||
f.SetMaxWorldRect();
|
||||
|
||||
f.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
NSLog(@"MapViewController initWithCoder Ended");
|
||||
return self;
|
||||
}
|
||||
|
||||
NSInteger compareAddress(id l, id r, void * context)
|
||||
|
|
|
@ -140,6 +140,8 @@ void InitLocalizedStrings()
|
|||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
NSLog(@"application didFinishLaunchingWithOptions");
|
||||
|
||||
InitLocalizedStrings();
|
||||
|
||||
[m_mapViewController OnEnterForeground];
|
||||
|
|
Loading…
Add table
Reference in a new issue