mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Reduced the work done when updating the sprites of events without a graphic
This commit is contained in:
@@ -105,33 +105,37 @@ class Sprite_Character < RPG::Sprite
|
|||||||
@character_hue = @character.character_hue
|
@character_hue = @character.character_hue
|
||||||
@oldbushdepth = @character.bush_depth
|
@oldbushdepth = @character.bush_depth
|
||||||
@charbitmap&.dispose
|
@charbitmap&.dispose
|
||||||
|
@charbitmap = nil
|
||||||
|
@bushbitmap&.dispose
|
||||||
|
@bushbitmap = nil
|
||||||
if @tile_id >= 384
|
if @tile_id >= 384
|
||||||
@charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id,
|
@charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id,
|
||||||
@character_hue, @character.width, @character.height)
|
@character_hue, @character.width, @character.height)
|
||||||
@charbitmapAnimated = false
|
@charbitmapAnimated = false
|
||||||
@bushbitmap&.dispose
|
|
||||||
@bushbitmap = nil
|
|
||||||
@spriteoffset = false
|
@spriteoffset = false
|
||||||
@cw = Game_Map::TILE_WIDTH * @character.width
|
@cw = Game_Map::TILE_WIDTH * @character.width
|
||||||
@ch = Game_Map::TILE_HEIGHT * @character.height
|
@ch = Game_Map::TILE_HEIGHT * @character.height
|
||||||
self.src_rect.set(0, 0, @cw, @ch)
|
self.src_rect.set(0, 0, @cw, @ch)
|
||||||
self.ox = @cw / 2
|
self.ox = @cw / 2
|
||||||
self.oy = @ch
|
self.oy = @ch
|
||||||
else
|
elsif @character_name != ""
|
||||||
@charbitmap = AnimatedBitmap.new(
|
@charbitmap = AnimatedBitmap.new(
|
||||||
"Graphics/Characters/" + @character_name, @character_hue
|
"Graphics/Characters/" + @character_name, @character_hue
|
||||||
)
|
)
|
||||||
RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player
|
RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player
|
||||||
@charbitmapAnimated = true
|
@charbitmapAnimated = true
|
||||||
@bushbitmap&.dispose
|
|
||||||
@bushbitmap = nil
|
|
||||||
@spriteoffset = @character_name[/offset/i]
|
@spriteoffset = @character_name[/offset/i]
|
||||||
@cw = @charbitmap.width / 4
|
@cw = @charbitmap.width / 4
|
||||||
@ch = @charbitmap.height / 4
|
@ch = @charbitmap.height / 4
|
||||||
self.ox = @cw / 2
|
self.ox = @cw / 2
|
||||||
|
else
|
||||||
|
self.bitmap = nil
|
||||||
|
@cw = 0
|
||||||
|
@ch = 0
|
||||||
end
|
end
|
||||||
@character.sprite_size = [@cw, @ch]
|
@character.sprite_size = [@cw, @ch]
|
||||||
end
|
end
|
||||||
|
return if !@charbitmap
|
||||||
@charbitmap.update if @charbitmapAnimated
|
@charbitmap.update if @charbitmapAnimated
|
||||||
bushdepth = @character.bush_depth
|
bushdepth = @character.bush_depth
|
||||||
if bushdepth == 0
|
if bushdepth == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user