Removed redundant "\r" from various messages, removed usages of BitmapWrapper, fixed Lure Ball error in battles started in the Debug menu, improved Terrain Tag editor, fixed some Compiler errors, enabled vsync, fixed event graphics frozen to the screen when using $game_player.moveto directly.

This commit is contained in:
Maruno17
2023-05-04 21:28:00 +01:00
parent 5f20121e59
commit 48fb8dae73
44 changed files with 362 additions and 398 deletions

View File

@@ -1074,7 +1074,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
windowheight += self.borderY
if !width || width < 0
width = 0
tmpbitmap = BitmapWrapper.new(1, 1)
tmpbitmap = Bitmap.new(1, 1)
pbSetSystemFont(tmpbitmap)
commands.each do |i|
width = [width, tmpbitmap.text_size(i).width].max

View File

@@ -1,93 +1,3 @@
#===============================================================================
# SpriteWrapper is a class which wraps (most of) Sprite's properties.
# (unused) Use class Sprite instead
#===============================================================================
class SpriteWrapper
def initialize(viewport = nil)
@sprite = Sprite.new(viewport)
end
def dispose; @sprite.dispose; end
def disposed?; return @sprite.disposed?; end
def viewport; return @sprite.viewport; end
def flash(color, duration); return @sprite.flash(color, duration); end
def update; return @sprite.update; end
def x; @sprite.x; end
def x=(value); @sprite.x = value; end
def y; @sprite.y; end
def y=(value); @sprite.y = value; end
def bitmap; @sprite.bitmap; end
def bitmap=(value); @sprite.bitmap = value; end
def src_rect; @sprite.src_rect; end
def src_rect=(value); @sprite.src_rect = value; end
def visible; @sprite.visible; end
def visible=(value); @sprite.visible = value; end
def z; @sprite.z; end
def z=(value); @sprite.z = value; end
def ox; @sprite.ox; end
def ox=(value); @sprite.ox = value; end
def oy; @sprite.oy; end
def oy=(value); @sprite.oy = value; end
def zoom_x; @sprite.zoom_x; end
def zoom_x=(value); @sprite.zoom_x = value; end
def zoom_y; @sprite.zoom_y; end
def zoom_y=(value); @sprite.zoom_y = value; end
def angle; @sprite.angle; end
def angle=(value); @sprite.angle = value; end
def mirror; @sprite.mirror; end
def mirror=(value); @sprite.mirror = value; end
def bush_depth; @sprite.bush_depth; end
def bush_depth=(value); @sprite.bush_depth = value; end
def opacity; @sprite.opacity; end
def opacity=(value); @sprite.opacity = value; end
def blend_type; @sprite.blend_type; end
def blend_type=(value); @sprite.blend_type = value; end
def color; @sprite.color; end
def color=(value); @sprite.color = value; end
def tone; @sprite.tone; end
def tone=(value); @sprite.tone = value; end
def viewport=(value)
return if self.viewport == value
bitmap = @sprite.bitmap
src_rect = @sprite.src_rect
visible = @sprite.visible
x = @sprite.x
y = @sprite.y
z = @sprite.z
ox = @sprite.ox
oy = @sprite.oy
zoom_x = @sprite.zoom_x
zoom_y = @sprite.zoom_y
angle = @sprite.angle
mirror = @sprite.mirror
bush_depth = @sprite.bush_depth
opacity = @sprite.opacity
blend_type = @sprite.blend_type
color = @sprite.color
tone = @sprite.tone
@sprite.dispose
@sprite = Sprite.new(value)
@sprite.bitmap = bitmap
@sprite.src_rect = src_rect
@sprite.visible = visible
@sprite.x = x
@sprite.y = y
@sprite.z = z
@sprite.ox = ox
@sprite.oy = oy
@sprite.zoom_x = zoom_x
@sprite.zoom_y = zoom_y
@sprite.angle = angle
@sprite.mirror = mirror
@sprite.bush_depth = bush_depth
@sprite.opacity = opacity
@sprite.blend_type = blend_type
@sprite.color = color
@sprite.tone = tone
end
end
#===============================================================================
# Sprite class that maintains a bitmap of its own.
# This bitmap can't be changed to a different one.

View File

@@ -58,7 +58,7 @@ class PngAnimatedBitmap
@frameDelay = delay
subWidth = panorama.width / numFrames
numFrames.times do |i|
subBitmap = BitmapWrapper.new(subWidth, panorama.height)
subBitmap = Bitmap.new(subWidth, panorama.height)
subBitmap.blt(0, 0, panorama, Rect.new(subWidth * i, 0, subWidth, panorama.height))
@frames.push(subBitmap)
end
@@ -155,7 +155,7 @@ class GifBitmap
rescue
@bitmap = nil
end
@bitmap = BitmapWrapper.new(32, 32) if @bitmap.nil?
@bitmap = Bitmap.new(32, 32) if @bitmap.nil?
@bitmap.play if @bitmap&.animated?
end

View File

@@ -221,7 +221,7 @@ class FaceWindowVX < SpriteWindow_Base
self.contents&.dispose
@faceIndex = faceinfo[1].to_i
@facebitmaptmp = AnimatedBitmap.new(facefile)
@facebitmap = BitmapWrapper.new(96, 96)
@facebitmap = Bitmap.new(96, 96)
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap,
Rect.new((@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96))
self.contents = @facebitmap