; hgimg3 hgrotate bug fix ; 奇数サイズを指定しても偶数サイズにされてしまうバグについて、 ; 公式掲示板で紹介されていた追加ライブラリ dx8_grot.as で解決するか実験 ; ; たしかに奇数サイズでも描画できるようになったが、描画内容が微妙に怪しい。 ; 例えば横方向のみ拡大すると、値によっては縦方向の描画内容がずれたりする。 ; また、d3dx9_39.dll を要求されてしまうのも少し厳しいかもしれない。 ; DirectXランタイムの追加インストールが必要になる。 #include "hgimg3.as" #include "dx8_grot.as" ; * add #packopt name "11_hgrotate_bugfix2" ; file name #packopt type 0 ; generate ".exe" #define TEXFILE "tex.png" #pack TEXFILE #define KB_ESC $00080 screen 0, 512, 288, 0 ; initialize screen wdw_w = ginfo_winx ; get window size wdw_h = ginfo_winy hgini ; initialize hgimg3 ; load texture ; * texload : alpha channel not support ; * texload2 : alpha channel support texload2 TEXFILE texid = stat ; get texture ID RegDxTexid texid ; set ID clscolor $4080c0 ; set clear color *mainloop stick k, 0 ; check keyboard if k & KB_ESC : goto *job_end ; ESC key to exit hgdraw ; draw start repeat 14 ; set image source size gmode gmode_rgb0, 16, 16 ; set position x = wdw_w / 2 y = 20 + (16 + 2) * cnt pos x, y ; draw texture src_x = 0 src_y = 0 scale = 1.0 rot = 0.0 dst_w = 14 + cnt dst_h = 16 dxgrotate texid, src_x, src_y, rot, dst_w, dst_h loop hgsync 15 ; draw end and wait goto *mainloop *job_end hgbye ; release HGIMG3 plugin end