Interesting, have you tried publishing your game to Steam with it?
Those problem behaviours from above occured when after approval of Steam.
If you had, I'll tell to my friend about tried another thing after of it.
Image operations may not fit for RGD because RGD has different internal bitmap structures.
I'm not sure about the detailed effects of parameters in text drawing function. I even find something like bugs in GetGlyphOutline.
Some old APIs draw text directly on screen. But they are not for d3d and I am not going to add them in RGD. If you need better performance, "text sprites" may be a good solution, caching each character in one bitmap and use a sprite to display it. RGD is ready for many sprites on the screen. This is especially useful if you are working on phonogram languages. Some other languages including Chinese and Japanese take more time to generate characters but it still works good enough on enhancing performance.
Please try download the newest version. I have just updated to 1.5.4.
A simple rule is that, if you use external DLLs to handle bitmap, then the script is likely not to work with RGD. RGD stores the bitmap data in a DirectX texture instead of an RGBA color array in RGSS. If the script is not relying on other DLLs or not calling any API to modify the bitmap, it would be OK to use it with RGD.
#----------------------------------------------------------------------------
class Bitmap
#--------------------------------------------------------------------------
def ptr
@ptr ||= DL::CPtr.new((
addr = DL.dlwrap(self) + 16
cptr = DL::CPtr.new(addr)
addr = (cptr[0,4].unpack("i"))[0] + 8
cptr.free
cptr = DL::CPtr.new(addr)
addr = (cptr[0,4].unpack("i"))[0] + 16
cptr.free
cptr = DL::CPtr.new(addr)
addr = (cptr[0,4].unpack("i"))[0]
cptr.free
addr), width * height * 4)
end
#--------------------------------------------------------------------------
def data_to_hash(id = 0)
data = Zlib::Deflate.deflate(ptr[0, ptr.size])
{:id => id, :width => width, :height => height, :data => data}
end
#--------------------------------------------------------------------------
def string_to_data(s)
ptr[0, ptr.size] = s
end
#--------------------------------------------------------------------------
def self.by_hash(data)
ret = Bitmap.new(data[:width], data[:height])
ret.string_to_data(Zlib::Inflate.inflate(data[:data]))
ret
end
end
#--------------------------------------------------------------------------
#使用例
#--------------------------------------------------------------------------
def snap_for_thunbnail(w, h)
src = Graphics.snap_to_bitmap
dest = Bitmap.new(w, h)
dest.stretch_blt(dest.rect, src, src.rect)
src.dispose
ret = dest.data_to_hash
dest.dispose
ret
end
def snap_test
data = snap_for_thunbnail(198, 140)
$s = Sprite.new
$s.bitmap = Bitmap.by_hash(data)
Graphics.update
sleep 2
$s.bitmap.dispose
$s.dispose
end
Original thread: https://forums.rpgmakerweb.com/threads/rgd-directx-implementation-of-rgss3.95228/