Author: johnmci Date: 2010-09-13 18:09:53 -0700 (Mon, 13 Sep 2010) New Revision: 2307 Modified: trunk/platforms/iOS/vm/OSX/sqSqueakOSXNSView.m trunk/platforms/iOS/vm/Settings.bundle/Root.plist trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.h trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.m trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIController.m trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIViewOpenGL.m trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneApplication.m trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneInfoPlistInterface.m Log: iOS iPhone scroll window rotation cleanup Settings pick min as 20MB pick max as 132MB sqSqueakOSXNSView.m remove stray thoughts SqueakUIController.m comment out eToys magic rotate me a keyboard SqueakUIViewOpenGL.m Handle layoutSubviews and my texture when we rotate sqSqueakIPhoneApplication Bug? in 4.1 if you alter the settings it zaps the memory value. No idea... SqueakNoOGLIPhoneAppDelegate.m/h comment out eToys magic zoom code Set window size back to 2x for scroll fix and confirm scroll window rotation is sane.. Modified: trunk/platforms/iOS/vm/OSX/sqSqueakOSXNSView.m =================================================================== --- trunk/platforms/iOS/vm/OSX/sqSqueakOSXNSView.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/OSX/sqSqueakOSXNSView.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -737,72 +737,4 @@ } } -@end - - -/*GL_TEXTURE_RECTANGLE_ARB - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, (int)r.size.width,(int)r.size.height, - 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (void*)lastBitsIndex); - */ - -/* glPixelStorei( GL_UNPACK_ROW_LENGTH, r.size.width ); - glPixelStorei( GL_UNPACK_SKIP_PIXELS, subRect.origin.x ); - glPixelStorei( GL_UNPACK_SKIP_ROWS, subRect.origin.y ); - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, (int)subRect.size.width,(int)subRect.size.height,0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (void*)lastBitsIndex ); - - NSLog(@" draw %f %f %f %f",subRect.origin.x,subRect.origin.y,subRect.size.width,subRect.size.height); - - glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); - glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 ); - glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 ); - */ -/* void glTexImage2D( GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - const GLvoid *pixels ); - - void glTexSubImage2D( GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const GLvoid *pixels ) - - - glPixelStorei(GL_UNPACK_ROW_LENGTH, r.size.width); - glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, - 0, - (int) subRect.origin.x, - (int) subRect.origin.y, - (int) subRect.size.width, - (int) subRect.size.height, - GL_BGRA, - GL_UNSIGNED_INT_8_8_8_8_REV, - (void*)lastBitsIndex); - - glPixelStorei( GL_UNPACK_ROW_LENGTH, img_width ); - char *subimg = (char*)m_data + (sub_x + sub_y*img_width)*4; - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, sub_width, sub_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, subimg ); - glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); - - GLES for iphone - no GL_UNPACK_ROW_LENGTH. In which case, you could either (a) extract the subimage into a new buffer yourself, or (b)... - - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, sub_width, sub_height, 0, GL_RGBA, GL_UNSIGNED_BYTES, NULL ); - - for( int y = 0; y < sub_height; y++ ) - { - char *row = m_data + ((y + sub_y)*img_width + sub_x) * 4; - glTexSubImage2D( GL_TEXTURE_2D, 0, 0, y, sub_width, 1, GL_RGBA, GL_UNSIGNED_BYTE, row ); - } - - */ +@end \ No newline at end of file Modified: trunk/platforms/iOS/vm/Settings.bundle/Root.plist =================================================================== --- trunk/platforms/iOS/vm/Settings.bundle/Root.plist 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/Settings.bundle/Root.plist 2010-09-14 01:09:53 UTC (rev 2307) @@ -46,7 +46,7 @@ <key>Type</key> <string>PSGroupSpecifier</string> <key>Title</key> - <string>Memory 10 MB to 54 MB</string> + <string>Memory 20 MB to 132 MB (limited)</string> </dict> <dict> <key>Type</key> @@ -58,9 +58,9 @@ <key>DefaultValue</key> <integer>33554432</integer> <key>MinimumValue</key> - <integer>10485760</integer> + <integer>20971520</integer> <key>MaximumValue</key> - <integer>56623104</integer> + <integer>138412032</integer> </dict> </array> </dict> Modified: trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.h =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.h 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.h 2010-09-14 01:09:53 UTC (rev 2307) @@ -55,6 +55,7 @@ - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation; - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application; // try to clean up as much memory as possible. next step is to terminate app +- (void) zoomToOrientation:(UIInterfaceOrientation)o animated:(BOOL)animated; @property (nonatomic,retain) UIWindow *window; @property (nonatomic,retain) SqueakUIView *mainView; Modified: trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.m =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -93,16 +93,20 @@ } - (void) zoomToOrientation:(UIInterfaceOrientation)o animated:(BOOL)animated { - CGRect zoomRect; - zoomRect.origin.x = 0; - zoomRect.origin.y = 0; - if (UIInterfaceOrientationIsPortrait(o)) { - zoomRect.size.width = 1200 * 4 / 3; - } else { - zoomRect.size.width = 1200 * 3 / 4; - } - zoomRect.size.height = zoomRect.size.width * 3 / 4; - [self.scrollView zoomToRect: zoomRect animated: animated]; + /* + Magic eToys code, leave this here to be nice.. Don't use unless you know what you are doing? + + CGRect zoomRect; + zoomRect.origin.x = 0; + zoomRect.origin.y = 0; + if (UIInterfaceOrientationIsPortrait(o)) { + zoomRect.size.width = 1200 * 4 / 3; + } else { + zoomRect.size.width = 1200 * 3 / 4; + } + zoomRect.size.height = zoomRect.size.width * 3 / 4; + [self.scrollView zoomToRect: zoomRect animated: animated]; + */ } - (Class) whatRenderCanWeUse { @@ -135,12 +139,15 @@ scrollView = [[UIScrollView alloc ] initWithFrame: mainScreenSize]; //Now setup the true view size as the width/height * 2.0 so we can have a larger squeak window and zoom in/out. - CGRect fakeScreenSize ; + CGRect fakeScreenSize = mainScreenSize; fakeScreenSize.origin.x = 0; fakeScreenSize.origin.y = 0; - fakeScreenSize.size.width = 1200; - fakeScreenSize.size.height = 900; -//#error use SqueakUIViewCALayer SqueakUIViewOpenGL + fakeScreenSize.size.width *= 2.0; + fakeScreenSize.size.height *= 2.0; + /* eToys setup + fakeScreenSize.size.width = 1200; + fakeScreenSize.size.height = 900; + */ mainView = [[[self whatRenderCanWeUse] alloc] initWithFrame: fakeScreenSize]; mainView.backgroundColor = [UIColor blackColor]; mainView.multipleTouchEnabled = YES; @@ -151,16 +158,16 @@ self.scrollView.scrollEnabled = useScrollingView; self.scrollView.clearsContextBeforeDrawing = NO; self.scrollView.canCancelContentTouches = NO; - self.scrollView.minimumZoomScale = 0.35555; + self.scrollView.minimumZoomScale = 0.5; self.scrollView.maximumZoomScale = 4.0; self.scrollView.delegate = self; self.scrollView.backgroundColor = [UIColor blackColor]; + self.scrollView.autoresizesSubviews=YES; + self.scrollView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth); + self.viewController = [SqueakUIController new]; self.viewController.view = self.scrollView; - // no idea if needed - // self.scrollView.autoresizesSubviews=YES; - // self.scrollView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth); [self zoomToOrientation: UIInterfaceOrientationPortrait animated: NO]; [self.scrollView addSubview: self.mainView]; @@ -168,7 +175,6 @@ } else { CGRect fakeScreenSize = mainScreenSize; -//#error use SqueakUIViewCALayer SqueakUIViewOpenGL mainView = [[[self whatRenderCanWeUse] alloc] initWithFrame: fakeScreenSize]; self.mainView.clearsContextBeforeDrawing = NO; [self.mainView setMultipleTouchEnabled: YES]; Modified: trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIController.m =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIController.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIController.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -68,10 +68,13 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { UIInterfaceOrientation o = [[UIApplication sharedApplication] statusBarOrientation]; + +/* etoys rotate for keyboard! if (UIInterfaceOrientationIsPortrait(o)) [gDelegateApp.mainView becomeFirstResponder]; else [gDelegateApp.mainView resignFirstResponder]; +*/ CGRect mainScreenSize = [[UIScreen mainScreen] applicationFrame]; CGRect f; Modified: trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIViewOpenGL.m =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIViewOpenGL.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/SqueakUIViewOpenGL.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -131,6 +131,10 @@ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);glCheckError(); glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);glCheckError(); rt_assert(GL_FRAMEBUFFER_COMPLETE_OES == glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); + if (textureId) { + glDeleteTextures(1,&textureId); + textureId = 0; + } } - (void) drawImageUsingClip: (CGRect) clip { Modified: trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneApplication.m =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneApplication.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneApplication.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -54,6 +54,9 @@ - (void) doMemorySetup { gMaxHeapSize = [(sqSqueakIPhoneInfoPlistInterface*) self.infoPlistInterfaceLogic memorySize]; + if (gMaxHeapSize == 0) // NO IDEA is this a 4.1 bug? + gMaxHeapSize = 32*1024*1024; + } - (void) fetchPreferences { Modified: trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneInfoPlistInterface.m =================================================================== --- trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneInfoPlistInterface.m 2010-09-13 21:27:57 UTC (rev 2306) +++ trunk/platforms/iOS/vm/iPhone/Classes/sqSqueakIPhoneInfoPlistInterface.m 2010-09-14 01:09:53 UTC (rev 2307) @@ -70,7 +70,7 @@ NSDictionary *prefItem; NSString *writeable_preferenceDefault = @"NO"; NSString *scrollableView_preferenceDefault= @"NO"; - NSString *memorySize_preferenceDefault=@"56623104"; + NSString *memorySize_preferenceDefault=@"33554432"; for (prefItem in prefSpecifierArray) { NSString *keyValueStr = [prefItem objectForKey:@"Key"]; id defaultValue = [prefItem objectForKey:@"DefaultValue"]; |
Free forum by Nabble | Edit this page |