]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor into native-image-loader
authorJoe Groff <arcata@gmail.com>
Sun, 18 Jul 2010 20:26:52 +0000 (13:26 -0700)
committerJoe Groff <arcata@gmail.com>
Sun, 18 Jul 2010 20:26:52 +0000 (13:26 -0700)
1  2 
basis/cocoa/messages/messages.factor
basis/opengl/textures/textures.factor

index 4b2c2f2a33cecbc8a5441c8f4cecf567356017f0,4d786aaf720f68b395b510e2a516b9513443db46..b607682e761f4756b10bb8d1762c68d58f9915e4
@@@ -109,7 -109,7 +109,7 @@@ H
      { "d" c:double }
      { "B" c:bool }
      { "v" c:void }
 -    { "*" c:c-string }
 +    { "*" c:void* }
      { "?" unknown_type }
      { "@" id }
      { "#" Class }
@@@ -216,7 -216,7 +216,7 @@@ ERROR: no-objc-type name 
      objc-methods get set-at ;
  
  : each-method-in-class ( class quot -- )
-     [ { uint } [ class_copyMethodList ] [ ] with-out-parameters ] dip
+     [ { uint } [ class_copyMethodList ] with-out-parameters ] dip
      over 0 = [ 3drop ] [
          [ <direct-void*-array> ] dip
          [ each ] [ drop (free) ] 2bi
index bba41653042da751686322c7d15dc00fcac20c14,f33ea9e47db26812d600a72b753d4d92cead9af4..0aaa9dcf9bc786f3b0fb0c0f63325142ffa68faf
@@@ -312,21 -312,12 +312,21 @@@ TUPLE: single-texture < disposable imag
      [ init-texture texture-coords>> gl-texture-coord-pointer ] tri
      swap gl-fill-rect ;
  
 +: set-blend-mode ( texture -- )
 +    image>> dup has-alpha?
 +    [ premultiplied-alpha?>> [ GL_ONE GL_ONE_MINUS_SRC_ALPHA glBlendFunc ] when ]
 +    [ drop GL_BLEND glDisable ] if ;
 +
 +: reset-blend-mode ( texture -- )
 +    image>> dup has-alpha?
 +    [ premultiplied-alpha?>> [ GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc ] when ]
 +    [ drop GL_BLEND glEnable ] if ;
 +
  : draw-textured-rect ( dim texture -- )
      [
 -        [ image>> has-alpha? [ GL_BLEND glDisable ] unless ]
 +        [ set-blend-mode ]
          [ (draw-textured-rect) GL_TEXTURE_2D 0 glBindTexture ]
 -        [ image>> has-alpha? [ GL_BLEND glEnable ] unless ]
 -        tri
 +        [ reset-blend-mode ] tri
      ] with-texturing ;
  
  : texture-coords ( texture -- coords )
@@@ -415,7 -406,7 +415,7 @@@ PRIVATE
      [ [ max-texture-size tesselate ] dip <multi-texture> ] if ;
  
  : get-texture-float ( target level enum -- value )
-     { float } [ glGetTexLevelParameterfv ] [ ] with-out-parameters ; inline
+     { float } [ glGetTexLevelParameterfv ] with-out-parameters ; inline
  
  : get-texture-int ( target level enum -- value )
-     { int } [ glGetTexLevelParameteriv ] [ ] with-out-parameters ; inline
+     { int } [ glGetTexLevelParameteriv ] with-out-parameters ; inline