From 04841a996b16182032f7f822e7cb7831701be889 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sun, 24 Sep 2017 18:55:15 +0100 Subject: [PATCH] add pressure control flag on size and flow, change data directory in OSX to Documents --- PanoPainter-OSX/main.cpp | 24 ++++++------------------ PanoPainter/GameViewController.m | 1 + PanoPainter/Info.plist | 4 ++-- data/Icons/Edge.png | Bin 0 -> 413 bytes data/layout.xml | 25 ++++++++++++++++++++++--- engine.xcodeproj/project.pbxproj | 18 +++++++++--------- engine/app.cpp | 12 ++++++------ engine/app_layout.cpp | 14 +++++++++++--- engine/brush.cpp | 14 ++++++++++++-- engine/brush.h | 3 +++ engine/log.cpp | 5 +++-- engine/node_canvas.cpp | 2 +- engine/node_panel_stroke.cpp | 2 ++ engine/node_panel_stroke.h | 2 ++ 14 files changed, 80 insertions(+), 46 deletions(-) create mode 100644 data/Icons/Edge.png diff --git a/PanoPainter-OSX/main.cpp b/PanoPainter-OSX/main.cpp index 40daf05..ba21059 100644 --- a/PanoPainter-OSX/main.cpp +++ b/PanoPainter-OSX/main.cpp @@ -288,25 +288,13 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime @interface Window : NSWindow @end @implementation Window -- (void)keyDown:(NSEvent *)theEvent -{ - [[self windowController] keyDown:theEvent]; -} @end @interface Controller : NSWindowController @end @implementation Controller -- (void)keyDown:(NSEvent *)theEvent +- (void)windowWillClose:(NSNotification *)notification { - unichar c = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; - if (c == 27) - { - [[NSApplication sharedApplication] terminate:nil]; - } -} -- (void)windowDidResize:(NSNotification *)notification -{ - + [[NSApplication sharedApplication] terminate:nil]; } @end @@ -336,9 +324,11 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime NSRect r = NSMakeRect(0, 0, App::I.width, App::I.height); view = [[View alloc] initWithFrame:r]; - - auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask; + controller = [[Controller alloc] initWithWindow:window]; + + auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask|NSClosableWindowMask; window = [[Window alloc] initWithContentRect:r styleMask:style backing:NSBackingStoreBuffered defer:NO]; + [window setDelegate:controller]; [window setTitle:@"PanoPainter 0.1.2 alpha"]; [window center]; [window makeKeyAndOrderFront:controller]; @@ -346,8 +336,6 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime [window setAcceptsMouseMovedEvents:true]; [window makeFirstResponder:view]; - controller = [[Controller alloc] initWithWindow:window]; - auto menubar = [NSMenu new]; auto appMenuItem = [NSMenuItem new]; [menubar addItem:appMenuItem]; diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 42fe1cf..52731d4 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -204,6 +204,7 @@ glm::vec2 t_pos; App::I.initLog(); App::I.ios_view = self; + self.preferredFramesPerSecond = 60; self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]; if (!self.context) { diff --git a/PanoPainter/Info.plist b/PanoPainter/Info.plist index 90b2ea6..fd0f446 100644 --- a/PanoPainter/Info.plist +++ b/PanoPainter/Info.plist @@ -2,8 +2,6 @@ - NSPhotoLibraryAddUsageDescription - Save the pano image in the user gallery CFBundleDevelopmentRegion en CFBundleExecutable @@ -24,6 +22,8 @@ 1 LSRequiresIPhoneOS + NSPhotoLibraryAddUsageDescription + Save the pano image in the user gallery UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/data/Icons/Edge.png b/data/Icons/Edge.png new file mode 100644 index 0000000000000000000000000000000000000000..cbdc41ecba586129a42d4a3ed3312bd033a1ba8c GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ea{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG?d}4kf#9d}?s_1_ zS>O>_%)p?h48n{ROYO@T7#JBnT^vIyZoR$b$=9kNz!3PO>F`|J^~{DBkMvsqGt3IS ztG;4Sf{VfW*S98DoHF1kVdf6VUMkJRz$$TkVqOB{vdl%&5e=2|Ub0C!>}L|&)yOu% zp6RrZc0(RV1A_wN7iq=6VHON;7=E397{qn=0Mm{BBSr6HYc+l?W`4oRVAUXJ>+o}5 zKhU6i- - - + + + + + + + + + + + + @@ -394,6 +404,10 @@ + + + + @@ -450,12 +464,17 @@ + + + +