Minor tidying

This commit is contained in:
Maruno17
2021-03-09 21:31:17 +00:00
parent 4c35a7ecfe
commit 117396f8e2
11 changed files with 38 additions and 34 deletions

View File

@@ -106,7 +106,7 @@ class Sprite_Character < RPG::Sprite
@oldbushdepth = @character.bush_depth
if @tile_id>=384
@charbitmap.dispose if @charbitmap
@charbitmap = pbGetTileBitmap(@character.map.tileset_name,@tile_id,@character.character_hue)
@charbitmap = pbGetTileBitmap(@character.map.tileset_name,@tile_id,@character_hue)
@charbitmapAnimated = false
@bushbitmap.dispose if @bushbitmap
@bushbitmap = nil
@@ -120,7 +120,7 @@ class Sprite_Character < RPG::Sprite
else
@charbitmap.dispose if @charbitmap
@charbitmap = AnimatedBitmap.new(
"Graphics/Characters/"+@character.character_name,@character.character_hue)
"Graphics/Characters/"+@character_name,@character_hue)
@charbitmapAnimated = true
@bushbitmap.dispose if @bushbitmap
@bushbitmap = nil

View File

@@ -1,5 +1,5 @@
class Sprite_SurfBase
attr_reader :visible
attr_reader :visible
attr_accessor :event
def initialize(sprite,event,viewport=nil)
@@ -18,12 +18,12 @@ class Sprite_SurfBase
end
def dispose
if !@disposed
@sprite.dispose if @sprite
@sprite = nil
@surfbitmap.dispose
@disposed = true
end
return if @disposed
@sprite.dispose if @sprite
@sprite = nil
@surfbitmap.dispose
@divebitmap.dispose
@disposed = true
end
def disposed?
@@ -49,9 +49,13 @@ class Sprite_SurfBase
@sprite = Sprite.new(@viewport) if !@sprite
if @sprite
if $PokemonGlobal.surfing
@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
@sprite.bitmap = @surfbitmap.bitmap
cw = @cws
ch = @chs
elsif $PokemonGlobal.diving
@sprite.bitmap = @divebitmap.bitmap; cw = @cwd; ch = @chd
@sprite.bitmap = @divebitmap.bitmap
cw = @cwd
ch = @chd
end
sx = @event.pattern_surf*cw
sy = ((@event.direction-2)/2)*ch