Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

Commit

Permalink
stickerknight: support scaling flipping rotation (somewhaT)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerLevy committed Sep 15, 2018
1 parent 9fa5012 commit a194c99
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion afkit
Submodule afkit updated from d664e6 to 37355c
4 changes: 2 additions & 2 deletions island.f
Expand Up @@ -5,7 +5,7 @@

s" island/data/islandz.tmx" open-map

map 0 load-tmxtileset
0 load-tmxtileset
s" Ground" find-tmxlayer tilebuf 0 0 load-tmxlayer

: -act act> noop ;
Expand All @@ -21,7 +21,7 @@
vy @ 0> if y @ 450 >= if vy @ negate vy ! then then
vx 2@ tm 's scrollx 2+! ;

stage object: dummy 10 15 x 2! bounce
stage object: scroller 10 15 x 2! bounce

: (show) show> black backdrop tm >{ draw } subject track camtrans stage drawzsorted ;
:is warm (show) ;
Expand Down
9 changes: 0 additions & 9 deletions maze/data/maze.tmx

This file was deleted.

Binary file removed maze/data/tiles.aseprite
Binary file not shown.
Binary file removed maze/data/tiles.png
Binary file not shown.
4 changes: 0 additions & 4 deletions maze/data/tiles.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion ramen
Submodule ramen updated from d397fa to a5a1fb
1 change: 1 addition & 0 deletions session.f
Expand Up @@ -4,5 +4,6 @@
[in-platform] sf [if]
include ramen/ide/ide.f
'source-id @ close-file drop
s" test.f" file-exists [if] ld test [then]
ide
[then]
19 changes: 16 additions & 3 deletions stickerknight.f
Expand Up @@ -7,11 +7,24 @@
1024 768 resolution
stage 1000 pool: layer0

:is tmxobj ( object-nnn XT -- ) over ?type if cr type then execute ;
var flip

also tmxing also xmling
: !wh
dup gid@ tilebmp 0= if drop exit then
dup wh@ rot gid@ tilebmp bmpwh 2/ sx 2! ;
: !flip flip@ flip ! ;
: !ang dup s" rotation" attr? if rotation@ ang ! else drop then ;

:is tmxobj ( object-nnn XT -- ) over obj?type if cr type then execute ;
:is tmxrect ( object-nnn w h -- ) .s 3drop ;
:is tmximage ( object-nnn gid -- )
0 -200 +at layer0 one gid ! drop
draw> @gidbmp blit ;
\ dup tilebmp bmpwh -0.5 -0.5 2* +at
layer0 one
gid ! ( nnn )
dup !wh dup !ang !flip
draw> untinted @gidbmp sx 2@ ang @ >rad flip @ srblitf ;
previous previous

: load
s" stickerknight/data/sandbox.tmx" open-map
Expand Down
10 changes: 10 additions & 0 deletions test.f
@@ -0,0 +1,10 @@
s" data/test.png" image: test.png

require ramen/lib/draw
: test show> black backdrop
test.png >bmp
1 1 1 1 4af
0 0 0 0 4af
0.25 0.25 0 3af
0 al_draw_tinted_scaled_rotated_bitmap ;

0 comments on commit a194c99

Please sign in to comment.