windows.directx.dinput: factor out a code snippet into a word instead of repeating it many times in macro expansion, reducing compiled code size
parent
43f7c4f2da
commit
aaa4c70b01
|
@ -56,14 +56,17 @@ M: array array-base-type first ;
|
|||
[ first dup word? [ '[ _ get ] ] [ drop [ f ] ] if ]
|
||||
} cleave
|
||||
[ DIOBJECTDATAFORMAT <struct-boa> ] dip
|
||||
'[ _ clone @ >>pguid ] ;
|
||||
curry ;
|
||||
|
||||
: set-DIOBJECTDATAFORMAT ( array struct pguid n -- array )
|
||||
[ [ clone ] dip >>pguid ] dip pick set-nth ;
|
||||
|
||||
:: make-DIOBJECTDATAFORMAT-array-quot ( struct array -- quot )
|
||||
array length '[ _ malloc-DIOBJECTDATAFORMAT-array ]
|
||||
array [| args i |
|
||||
struct args <DIOBJECTDATAFORMAT>-quot
|
||||
i '[ _ pick set-nth ] compose compose
|
||||
] each-index ;
|
||||
i '[ @ _ set-DIOBJECTDATAFORMAT ]
|
||||
] map-index [ ] join compose ;
|
||||
|
||||
>>
|
||||
|
||||
|
|
Loading…
Reference in New Issue