Browse Source

Merge pull request #59 from blitz-research/develop

Develop up with merge probs sdks copied manualy
abakobo 8 years ago
parent
commit
cfa2f55f68

+ 4 - 3
VERSIONS.TXT

@@ -1,9 +1,10 @@
 
 
 ***** Monkey2 v1.1.05 *****
 ***** Monkey2 v1.1.05 *****
 
 
-* Added WIP MSVC support - see: #MX2_USE_MSVC in bin/windows_env.txt
+* Added std.requesters.OpenUrl support for android and ios.
 
 
-* Added assimp model for loading 3d models.
+* Added WIP assimp and bullet modules mainly for future use by mojo3d but its nice to have standalone versions of these.
 
 
-* Added std.requesters.OpenUrl support for android and ios.
+* Added tinyfiledialog library for linux requesters, except for Proceed which uses kdialog as there's no equivalent in tfd.
 
 
+* Added WIP MSVC support for faster compile times on windows. To enable, use 'MX2_USE_MSVC=1' in bin/env_windows.txt and rebuild all modules.

+ 6 - 6
modules/mojo/app/app.monkey2

@@ -926,7 +926,7 @@ Class AppInstance
 				
 				
 			Case SDL_WINDOWEVENT_FOCUS_GAINED
 			Case SDL_WINDOWEVENT_FOCUS_GAINED
 			
 			
-				Print "SDL_WINDOWEVENT_FOCUS_GAINED"
+				'Print "SDL_WINDOWEVENT_FOCUS_GAINED"
 			
 			
 				Local active:=_active
 				Local active:=_active
 				_activeWindow=_window
 				_activeWindow=_window
@@ -938,7 +938,7 @@ Class AppInstance
 				
 				
 			Case SDL_WINDOWEVENT_FOCUS_LOST
 			Case SDL_WINDOWEVENT_FOCUS_LOST
 			
 			
-				Print "SDL_WINDOWEVENT_FOCUS_LOST"
+				'Print "SDL_WINDOWEVENT_FOCUS_LOST"
 			
 			
 				Local active:=_active
 				Local active:=_active
 				_active=False
 				_active=False
@@ -991,13 +991,13 @@ Class AppInstance
 
 
 		Case SDL_RENDER_TARGETS_RESET
 		Case SDL_RENDER_TARGETS_RESET
 		
 		
-			Print "SDL_RENDER_TARGETS_RESET"
+			'Print "SDL_RENDER_TARGETS_RESET"
 		
 		
 			RequestRender()
 			RequestRender()
 			
 			
 		Case SDL_RENDER_DEVICE_RESET
 		Case SDL_RENDER_DEVICE_RESET
 		
 		
-			Print "SDL_RENDER_DEVICE_RESET"
+			'Print "SDL_RENDER_DEVICE_RESET"
 		
 		
 			mojo.graphics.glutil.glGraphicsSeq+=1
 			mojo.graphics.glutil.glGraphicsSeq+=1
 
 
@@ -1014,7 +1014,7 @@ Class AppInstance
 		Case SDL_APP_WILLENTERBACKGROUND
 		Case SDL_APP_WILLENTERBACKGROUND
 			'Prepare your app to go into the background. Stop loops, etc.
 			'Prepare your app to go into the background. Stop loops, etc.
 			'This gets called when the user hits the home button, or gets a call.
 			'This gets called when the user hits the home button, or gets a call.
-			Print "SDL_APP_WILLENTERBACKGROUND"
+			'Print "SDL_APP_WILLENTERBACKGROUND"
 			_frozen=True
 			_frozen=True
 
 
 		Case SDL_APP_DIDENTERBACKGROUND
 		Case SDL_APP_DIDENTERBACKGROUND
@@ -1030,7 +1030,7 @@ Class AppInstance
 		Case SDL_APP_DIDENTERFOREGROUND
 		Case SDL_APP_DIDENTERFOREGROUND
 			'Restart your loops here.
 			'Restart your loops here.
 			'Your app is interactive and getting CPU again.
 			'Your app is interactive and getting CPU again.
-			Print "SDL_APP_DIDENTERFOREGROUND"
+			'Print "SDL_APP_DIDENTERFOREGROUND"
 			RequestRender()
 			RequestRender()
 			_frozen=False
 			_frozen=False
 #Endif
 #Endif

+ 4 - 4
modules/mojo/graphics/glexts/glexts.cpp

@@ -60,10 +60,10 @@ namespace bbGLexts{
 			SDL_GL_ExtensionSupported( "GL_WEBGL_depth_texture" ) ||
 			SDL_GL_ExtensionSupported( "GL_WEBGL_depth_texture" ) ||
 			SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
 			SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
 		
 		
-		bb_printf( "GL_draw_buffers=%i\n",int( GL_draw_buffers ) );
-		bb_printf( "GL_texture_float=%i\n",int( GL_texture_float ) );
-		bb_printf( "GL_texture_half_float=%i\n",int( GL_texture_half_float ) );
-		bb_printf( "GL_depth_texture=%i\n",int( GL_depth_texture ) );
+//		bb_printf( "GL_draw_buffers=%i\n",int( GL_draw_buffers ) );
+//		bb_printf( "GL_texture_float=%i\n",int( GL_texture_float ) );
+//		bb_printf( "GL_texture_half_float=%i\n",int( GL_texture_half_float ) );
+//		bb_printf( "GL_depth_texture=%i\n",int( GL_depth_texture ) );
 		
 		
 		fflush( stdout );
 		fflush( stdout );
 	}
 	}

+ 9 - 0
modules/mojo/graphics/glutil.monkey2

@@ -7,6 +7,10 @@ Global bindings:=New IntStack
 
 
 Public
 Public
 
 
+#rem monkeydoc @hidden
+#end
+Global glDebug:Bool=False
+
 #rem monkeydoc @hidden
 #rem monkeydoc @hidden
 #end
 #end
 Global glGraphicsSeq:Int=1
 Global glGraphicsSeq:Int=1
@@ -28,8 +32,12 @@ End
 #rem monkeydoc @hidden
 #rem monkeydoc @hidden
 #end
 #end
 Function glCheck()
 Function glCheck()
+	
+	If Not glDebug Return
+	
 	Local err:=glGetError()
 	Local err:=glGetError()
 	If err=GL_NO_ERROR Return
 	If err=GL_NO_ERROR Return
+	
 	Local msg:=""
 	Local msg:=""
 	Select err
 	Select err
 	Case GL_INVALID_ENUM
 	Case GL_INVALID_ENUM
@@ -45,6 +53,7 @@ Function glCheck()
 	Default
 	Default
 		msg="?????"
 		msg="?????"
 	End
 	End
+	
 	RuntimeError( "GL ERROR: "+msg+" "+err )
 	RuntimeError( "GL ERROR: "+msg+" "+err )
 End
 End
 
 

+ 5 - 5
modules/mojo/graphics/graphicsdevice.monkey2

@@ -430,11 +430,11 @@ Class GraphicsDevice
 
 
 		glCheck()
 		glCheck()
 		
 		
-		#If __CONFIG__="debug"
-		Print "GL_VERSION="+glGetString( GL_VERSION )
-		Print "GL_VENDOR="+glGetString( GL_VENDOR )
-		Print "GL_RENDERER="+glGetString( GL_VENDOR )
-		#Endif
+		'#If __CONFIG__="debug"
+		'Print "GL_VERSION="+glGetString( GL_VERSION )
+		'Print "GL_VENDOR="+glGetString( GL_VENDOR )
+		'Print "GL_RENDERER="+glGetString( GL_VENDOR )
+		'#Endif
 			
 			
 		InitGLexts()
 		InitGLexts()
 		
 		

+ 1 - 1
modules/mojo/graphics/rendertarget.monkey2

@@ -76,7 +76,7 @@ Class RenderTarget Extends Resource
 		Endif
 		Endif
 
 
 		If glexts.GL_read_buffer
 		If glexts.GL_read_buffer
-			glReadBuffer( GL_NONE )
+			glReadBuffer( _drawBufs ? _drawBufs[0] Else GL_NONE )
 		Endif
 		Endif
 
 
 		CheckStatus()
 		CheckStatus()

+ 5 - 2
modules/mojox/textview.monkey2

@@ -937,11 +937,14 @@ Class TextView Extends ScrollableView
 	End
 	End
 	
 	
 	Method OnRenderContent( canvas:Canvas ) Override
 	Method OnRenderContent( canvas:Canvas ) Override
+		
+		OnRenderContent( canvas,VisibleRect )
+	End
+	
+	Method OnRenderContent( canvas:Canvas,clip:Recti ) Virtual
 
 
 		If App.KeyView=Self And Not _blinkTimer RestartBlinkTimer()
 		If App.KeyView=Self And Not _blinkTimer RestartBlinkTimer()
 		
 		
-		Local clip:=VisibleRect
-		
 		Local firstLine:=LineAtPoint( New Vec2i( 0,clip.Top ) ) 
 		Local firstLine:=LineAtPoint( New Vec2i( 0,clip.Top ) ) 
 		Local lastLine:=LineAtPoint( New Vec2i( 0,clip.Bottom-1 ) )+1
 		Local lastLine:=LineAtPoint( New Vec2i( 0,clip.Bottom-1 ) )+1
 		
 		

+ 1 - 1
modules/monkey/native/bbobject.h

@@ -67,7 +67,7 @@ template<class T,class C> T bb_object_cast( C *p ){
 }
 }
 
 
 inline void bbDBAssertSelf( void *p ){
 inline void bbDBAssertSelf( void *p ){
-	bbDebugAssert( p,"'Self' is null" );
+	bbDebugAssert( p,"Attempt to invoke method on null instance" );
 }
 }
 
 
 inline bbString bbDBObjectValue( bbObject *p ){
 inline bbString bbDBObjectValue( bbObject *p ){

+ 3 - 3
src/createrelease/createrelease.monkey2

@@ -13,7 +13,6 @@ Const IGNORE:="
 .gitignore
 .gitignore
 src/c2mx2
 src/c2mx2
 src/createrelease
 src/createrelease
-src/launcher
 modules/admob
 modules/admob
 modules/linq
 modules/linq
 modules/gles30
 modules/gles30
@@ -22,7 +21,7 @@ modules/mojo3d-loaders
 modules/mojo3d-physics
 modules/mojo3d-physics
 bin/ted2.state.json
 bin/ted2.state.json
 bin/ted2_windows/state.json
 bin/ted2_windows/state.json
-bin/ted2_macos/state.json
+bin/ted2_macos.app/Contents/MacOS/state.json
 bin/ted2_linux/state.json
 bin/ted2_linux/state.json
 "
 "
 
 
@@ -101,11 +100,12 @@ Function CopyRelease()
 	CreateDir( output+"/devtools" )
 	CreateDir( output+"/devtools" )
 	CreateDir( output+"/tmp" )
 	CreateDir( output+"/tmp" )
 	
 	
+	CopyFiles( "bananas" )
 	CopyFiles( "bin" )
 	CopyFiles( "bin" )
 	CopyFiles( "docs" )
 	CopyFiles( "docs" )
 	CopyFiles( "modules" )
 	CopyFiles( "modules" )
-	CopyFiles( "bananas" )
 	CopyFiles( "products" )
 	CopyFiles( "products" )
+	CopyFiles( "scripts" )
 	CopyFiles( "src" )
 	CopyFiles( "src" )
 	
 	
 	Copy( "ABOUT.HTML" )
 	Copy( "ABOUT.HTML" )

+ 1 - 1
src/mx2cc/buildproduct.monkey2

@@ -407,7 +407,7 @@ Class GccBuildProduct Extends BuildProduct
 			
 			
 		cmd+=(toolchain="msvc" ? " -Fo~q" Else " -o ~q") +obj+"~q ~q"+src+"~q"
 		cmd+=(toolchain="msvc" ? " -Fo~q" Else " -o ~q") +obj+"~q ~q"+src+"~q"
 		
 		
-		If toolchain<>"msvc" Print StripDir( src )
+		'If toolchain<>"msvc" Print StripDir( src )
 		
 		
 		Exec( cmd )
 		Exec( cmd )
 		
 		

+ 3 - 10
src/mx2cc/translator_cpp.monkey2

@@ -1069,16 +1069,9 @@ Class Translator_CPP Extends Translator
 			EmitMain()
 			EmitMain()
 		Endif
 		Endif
 		
 		
-		If _debug And func.IsMethod
-		
-			If Not func.IsVirtual And Not func.IsExtension
-				'			
-				'Can't do this yet as it breaks mx2cc!
-				'
-				'Emit( "bbDBAssertSelf(this);" )
-				'
-			Endif
-			
+		If _debug And func.IsMethod And func.cscope.ctype.IsClass And Not func.IsVirtual And Not func.IsExtension
+
+			Emit( "bbDBAssertSelf(this);" )
 		Endif
 		Endif
 		
 		
 		EmitBlock( func )
 		EmitBlock( func )