diff --git a/scripts/Game_Map.rb b/scripts/Game_Map.rb index d699a8d..7f141fb 100644 --- a/scripts/Game_Map.rb +++ b/scripts/Game_Map.rb @@ -282,7 +282,7 @@ class Game_Map def scroll_down(distance) return if @display_y_fix - @display_y = [@display_y + distance, (self.height - Graphics.height / 32 - 1) * 128].min + @display_y = [@display_y + distance, (self.height - Graphics.height / 32.0).round * 128].min @display_y = @display_y.clamp((@display_clip_top * 128.0).to_i, (@display_clip_bottom * 128.0).to_i - Graphics.height * 4) end #-------------------------------------------------------------------------- @@ -302,7 +302,7 @@ class Game_Map def scroll_right(distance) return if @display_x_fix - @display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min + @display_x = [@display_x + distance, (self.width - (Graphics.width / 32.0).round) * 128].min @display_x = @display_x.clamp((@display_clip_left * 128.0).to_i, (@display_clip_right * 128.0).to_i - Graphics.width * 4) end #-------------------------------------------------------------------------- diff --git a/scripts/Game_Player.rb b/scripts/Game_Player.rb index 83bee85..0a8a74a 100644 --- a/scripts/Game_Player.rb +++ b/scripts/Game_Player.rb @@ -39,8 +39,8 @@ class Game_Player < Game_Character # * Set Map Display Position to Center of Screen #-------------------------------------------------------------------------- def center(x, y) - max_x = ($game_map.width - (Graphics.width / 32)) * 128 - max_y = ($game_map.height - (Graphics.height / 32)) * 128 + max_x = ($game_map.width - (Graphics.width / 32.0).round) * 128 + max_y = ($game_map.height - (Graphics.height / 32.0).round) * 128 $game_map.display_x = [0, [x * 128 - @center_x, max_x].min].max $game_map.display_y = [0, [y * 128 - @center_y, max_y].min].max end diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index 41a0edb..17c746d 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -340,9 +340,9 @@ class Spriteset_Map # no point in updating the sprite if offscreen # this greatly increases performance on larger maps elsif ((sprite.character.real_x + (sprite.ox*4) > $game_map.display_x - 128) && - (sprite.character.real_x - (sprite.ox*4) < $game_map.display_x + ((Graphics.width / 32 + 1) * 128)) && + (sprite.character.real_x - (sprite.ox*4) < $game_map.display_x + ((Graphics.width / 32.0).ceil * 128)) && (sprite.character.real_y + (sprite.oy*4) > ($game_map.display_y) - 128) && - (sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (Graphics.height / 32 * 128))) + (sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (Graphics.height / 32.0).ceil * 128)) sprite.update else sprite.update_fast diff --git a/src/tilemap.cpp b/src/tilemap.cpp index 8341239..9b3f1eb 100644 --- a/src/tilemap.cpp +++ b/src/tilemap.cpp @@ -331,8 +331,8 @@ struct TilemapPrivate { mapViewportDirty(false), zOrderDirty(false), tilemapReady(false), - viewpW(shState->graphics().width() / 31 + 2), - viewpH(shState->graphics().height() / 31 + 2), + viewpW(shState->graphics().width() / 32 + 2), + viewpH(shState->graphics().height() / 32 + 2), zlayersMax(viewpH + 5) { zlayerVert.resize(zlayersMax); @@ -372,8 +372,8 @@ struct TilemapPrivate { } int oldZLayersCount = zlayersMax; - viewpW = w / 31 + 2; - viewpH = h / 31 + 2; + viewpW = w / 32 + 2; + viewpH = h / 32 + 2; zlayersMax = viewpH + 5; zlayerVert.resize(zlayersMax); zlayerBases.resize(zlayersMax + 1);