Merge branch 'master' into global_optimization
commit
2322f30df2
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2006, 2008 Doug Coleman.
|
! Copyright (C) 2006, 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel io io.binary io.files io.streams.byte-array math
|
USING: alien.c-types kernel io io.binary io.files io.streams.byte-array math
|
||||||
math.functions math.parser namespaces splitting grouping strings
|
math.functions math.parser namespaces splitting grouping strings
|
||||||
sequences byte-arrays locals sequences.private macros fry
|
sequences byte-arrays locals sequences.private macros fry
|
||||||
io.encodings.binary math.bitwise checksums accessors
|
io.encodings.binary math.bitwise checksums accessors
|
||||||
|
@ -173,9 +173,27 @@ HINTS: (process-md5-block-G) { uint-array md5-state } ;
|
||||||
HINTS: (process-md5-block-H) { uint-array md5-state } ;
|
HINTS: (process-md5-block-H) { uint-array md5-state } ;
|
||||||
HINTS: (process-md5-block-I) { uint-array md5-state } ;
|
HINTS: (process-md5-block-I) { uint-array md5-state } ;
|
||||||
|
|
||||||
|
: byte-array>le ( byte-array -- byte-array )
|
||||||
|
little-endian? [
|
||||||
|
dup 4 <sliced-groups> [
|
||||||
|
[ [ 1 2 ] dip exchange-unsafe ]
|
||||||
|
[ [ 0 3 ] dip exchange-unsafe ] bi
|
||||||
|
] each
|
||||||
|
] unless ;
|
||||||
|
|
||||||
|
: byte-array>uint-array-le ( byte-array -- uint-array )
|
||||||
|
byte-array>le byte-array>uint-array ;
|
||||||
|
|
||||||
|
HINTS: byte-array>uint-array-le byte-array ;
|
||||||
|
|
||||||
|
: uint-array>byte-array-le ( uint-array -- byte-array )
|
||||||
|
underlying>> byte-array>le ;
|
||||||
|
|
||||||
|
HINTS: uint-array>byte-array-le uint-array ;
|
||||||
|
|
||||||
M: md5-state checksum-block ( block state -- )
|
M: md5-state checksum-block ( block state -- )
|
||||||
[
|
[
|
||||||
[ byte-array>uint-array ] [ state>> ] bi* {
|
[ byte-array>uint-array-le ] [ state>> ] bi* {
|
||||||
[ (process-md5-block-F) ]
|
[ (process-md5-block-F) ]
|
||||||
[ (process-md5-block-G) ]
|
[ (process-md5-block-G) ]
|
||||||
[ (process-md5-block-H) ]
|
[ (process-md5-block-H) ]
|
||||||
|
@ -185,7 +203,7 @@ M: md5-state checksum-block ( block state -- )
|
||||||
nip update-md5
|
nip update-md5
|
||||||
] 2bi ;
|
] 2bi ;
|
||||||
|
|
||||||
: md5>checksum ( md5 -- bytes ) state>> underlying>> ;
|
: md5>checksum ( md5 -- bytes ) state>> uint-array>byte-array-le ;
|
||||||
|
|
||||||
M: md5-state clone ( md5 -- new-md5 )
|
M: md5-state clone ( md5 -- new-md5 )
|
||||||
call-next-method
|
call-next-method
|
||||||
|
|
|
@ -51,10 +51,8 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: WGL_ARB { $ WGL_SUPPORT_OPENGL_ARB 1 } H{
|
||||||
{ samples { $ WGL_SAMPLES_ARB } }
|
{ samples { $ WGL_SAMPLES_ARB } }
|
||||||
}
|
}
|
||||||
|
|
||||||
MEMO: (has-wglChoosePixelFormatARB?) ( dc -- ? )
|
|
||||||
{ "WGL_ARB_pixel_format" } has-wgl-extensions? ;
|
|
||||||
: has-wglChoosePixelFormatARB? ( world -- ? )
|
: has-wglChoosePixelFormatARB? ( world -- ? )
|
||||||
handle>> hDC>> (has-wglChoosePixelFormatARB?) ;
|
drop f ;
|
||||||
|
|
||||||
: arb-make-pixel-format ( world attributes -- pf )
|
: arb-make-pixel-format ( world attributes -- pf )
|
||||||
[ handle>> hDC>> ] dip >WGL_ARB-int-array f 1 0 <int> 0 <int>
|
[ handle>> hDC>> ] dip >WGL_ARB-int-array f 1 0 <int> 0 <int>
|
||||||
|
|
Loading…
Reference in New Issue