瀏覽代碼

Changed a bunch of #If __TARGET__ checks for new system.

Mark Sibly 9 年之前
父節點
當前提交
fc83b0fbe6

+ 5 - 3
modules/emscripten/emscripten.monkey2

@@ -1,9 +1,9 @@
 
-Namespace emscripten
-
 #If __TARGET__="emscripten"
+
 #Import "<emscripten.h>"
-#Endif
+
+Namespace emscripten
 
 Extern
 
@@ -30,3 +30,5 @@ Function emscripten_get_device_pixel_ratio:Double()
 Function emscripten_set_canvas_size:Void( width:Int,height:Int )
 Function emscripten_get_canvas_size:Void( width:Int Ptr,height:Int Ptr,fullScreen:Int Ptr )
 Function emscripten_get_now:Double()
+
+#Endif

+ 32 - 23
modules/gles20/gles20.monkey2

@@ -5,40 +5,49 @@ Namespace gles20
 
 Using monkey
 
-#If __TARGET__="desktop"
-
-	#If __HOSTOS__="windows"
+#If __TARGET__="windows"
 	
-		'USE ANGLE!
-		#Import "angle/include/*.h"
-		#Import "<GLES2/gl2.h>"
-
-		#Import "angle/lib/libEGL.lib"
-		#Import "angle/lib/libGLESv2.lib"
+	'USE ANGLE!
+	#Import "angle/lib/libEGL.lib"
+	#Import "angle/lib/libGLESv2.lib"
 		
-		#Import "angle/bin/libEGL.dll"
-		#Import "angle/bin/libGLESv2.dll"
-		#Import "angle/bin/d3dcompiler_47.dll"
+	#Import "angle/bin/libEGL.dll"
+	#Import "angle/bin/libGLESv2.dll"
+	#Import "angle/bin/d3dcompiler_47.dll"
 		
-	#Else If __HOSTOS__="macos"
+	#Import "angle/include/*.h"
+
+	#Import "<GLES2/gl2.h>"
+
+#Else If __TARGET__="macos"
 	
-		#Import "native/gles20_macos.h"
-		#Import "<OpenGL.framework>"
+	#Import "<OpenGL.framework>"
+
+	#Import "native/gles20_macos.h"
 		
-	#Else If __HOSTOS__="linux"
+#Else If __TARGET__="linux"
 	
-		#Import "native/gles20_linux.h"
-		#Import "<libGL.a>"
+	#Import "<libGL.a>"
+
+	#Import "native/gles20_linux.h"
 		
-	#Endif
+#Else If __TARGET__="emscripten"
 	
-#Else
-
 	#Import "<GLES2/gl2.h>"
 	
+#Else If __TARGET__="android"
+
 	#import "<libGLESv1_CM.a>"
 	#import "<libGLESv2.a>"
 	
+	#Import "<GLES2/gl2.h>"
+	
+#Else If __TARGET__="ios"
+
+	#Import "<OpenGLES.framework>"
+
+	#import "<OpenGLES/ES2/gl.h>"
+	
 #Endif
 
 #rem
@@ -540,7 +549,7 @@ Function glVertexAttribPointer:Void(indx_:GLuint,size_:GLint,type_:GLenum,normal
 Function glViewport:Void(x_:GLint,y_:GLint,width_:GLsizei,height_:GLsizei)
 '${END}
 
-#If __TARGET__="desktop" And __HOSTOS__="windows"
+#If __TARGET__="windows"
 Function bb_gles20_windows_init()
 #Endif
 
@@ -549,7 +558,7 @@ Public
 'Must call this after creating context...
 '
 Function glInitEx()
-	#If __TARGET__="desktop" And __HOSTOS__="windows"
+	#If __TARGET__="windows"
 '		bb_gles20_windows_init()
 	#Endif
 End

+ 2 - 1
modules/mojo/app/window.monkey2

@@ -306,7 +306,8 @@ Class Window Extends View
 
 		SDL_GL_SetSwapInterval( _swapInterval )
 	
-#If __TARGET__="desktop" And __HOSTOS__="windows"
+#If __TARGET__="windows"
+
 		If _weirdHack
 			_weirdHack=False
 			SDL_GL_SwapWindow( _sdlWindow )

+ 3 - 3
modules/mojo/graphics/glutil.monkey2

@@ -63,9 +63,9 @@ End
 #end
 Function glCompile:Int( type:Int,source:String )
 
-	#if __TARGET__<>"desktop" Or __HOSTOS__="windows"
-		source="precision mediump float;~n"+source
-	#Endif
+#If __TARGET__="windows" Or Not __DESKTOP_TARGET__
+	source="precision mediump float;~n"+source
+#Endif
 	
 	Local shader:=glCreateShader( type )
 	glShaderSourceEx( shader,source )

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

@@ -30,7 +30,7 @@ Class Texture
 
 	Method New( pixmap:Pixmap,flags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap )
 		
-#If __TARGET__<>"desktop"
+#If Not __DESKTOP_TARGET__
 		If flags & TextureFlags.Mipmap
 			Local tw:=Log2( pixmap.Width ),th:=Log2( pixmap.Height )
 			If tw<>Round( tw ) Or th<>Round( th ) flags&=~TextureFlags.Mipmap

+ 4 - 4
modules/mojo/requesters/requesters.monkey2

@@ -1,19 +1,19 @@
 
 Namespace mojo.requesters
 
-#If __TARGET__="desktop"
+#If __DESKTOP_TARGET__
 
 #Import "native/requesters.h"
 
-#If __HOSTOS__="macos"
+#If __TARGET__="macos"
 
 	#Import "native/requesters.mm"
 	
-#else
+#Else
 
 	#Import "native/requesters.cpp"
 	
-	#if __HOSTOS__="windows"
+	#if __TARGET__="windows"
 
 		#Import "<libcomdlg32.a>"
 

+ 4 - 2
modules/mojox/htmlview.monkey2

@@ -61,9 +61,11 @@ Class HtmlView Extends ScrollableView
 		Local root:=ExtractRootDir( url )
 		
 		If root="http://" Or root="https://"
-#if __TARGET__="desktop"		
+		
+#If __DESKTOP_TARGET__			
 			requesters.OpenUrl( url )
-#endif
+#Endif
+
 			Return
 		Endif
 		

+ 22 - 8
modules/std/fiber/fcontext.monkey2

@@ -8,23 +8,37 @@ Namespace std.fiber
 #import "native/fcontext.cpp"
 #import "native/fcontext.h"
 
-#if __TARGET__="android"
-	#import "native/asm/make_arm_aapcs_elf_gas.S"
-	#import "native/asm/jump_arm_aapcs_elf_gas.S"
-	#import "native/asm/ontop_arm_aapcs_elf_gas.S"
-#else if __HOSTOS__="windows"
+#If __TARGET__="windows"
+
 	#import "native/asm/make_i386_ms_pe_gas.asm"
 	#import "native/asm/jump_i386_ms_pe_gas.asm"
 	#import "native/asm/ontop_i386_ms_pe_gas.asm"
-#else if __HOSTOS__="macos"
+
+#Else If __TARGET__="macos"
+
 	#import "native/asm/make_x86_64_sysv_macho_gas.S"
 	#import "native/asm/jump_x86_64_sysv_macho_gas.S"
 	#import "native/asm/ontop_x86_64_sysv_macho_gas.S"
-#else if __HOSTOS__="linux"
+
+#Else If __TARGET__="linux"
+
 	#import "native/asm/make_x86_64_sysv_elf_gas.S"
 	#import "native/asm/jump_x86_64_sysv_elf_gas.S"
 	#import "native/asm/ontop_x86_64_sysv_elf_gas.S"
-#end
+
+#Else If __TARGET__="android"
+
+	#import "native/asm/make_arm_aapcs_elf_gas.S"
+	#import "native/asm/jump_arm_aapcs_elf_gas.S"
+	#import "native/asm/ontop_arm_aapcs_elf_gas.S"
+
+#Else If __TARGET__="ios"
+
+	#import "native/asm/make_arm_aapcs_macho_gas.S"
+	#import "native/asm/jump_arm_aapcs_macho_gas.S"
+	#import "native/asm/ontop_arm_aapcs_macho_gas.S"
+
+#Endif
 
 Extern