Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Generate doc.js, regenerate RME.rb, fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gr-im committed Mar 18, 2018
1 parent 193abb4 commit 2839741
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Join us on Discord !](https://discord.gg/yRUZcdQ)

# [![RMEx](http://rmex.github.io/images/rmex-shortcut.png)](http://rmex.github.io) [RME : RPG Maker Extender](https://github.com/RMEx/RME/wiki)
# [![RMEx](http://rmex.github.io/images/rmex-shortcut.png)](http://rmex.github.io) [RME : RPG Maker Extender](https://github.com/RMEx/RME/wiki) (`v1.3.0`)

**RME** is the successor of **[Event Extender](http://funkywork.github.io/EE)**.
It offers a collection of tools to promote the personalization of an RPG Maker VX Ace project.
Expand Down
283 changes: 281 additions & 2 deletions RME.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12414,6 +12414,13 @@ def map_name
# * Get Event Id form coords
#--------------------------------------------------------------------------
def id_at(x, y)
RME::deprecated_command("id_at", "use 'event_at'")
event_at(x, y)
end
#--------------------------------------------------------------------------
# * Get Event Id form coords
#--------------------------------------------------------------------------
def event_at(x, y)
result = $game_map.event_id_xy(x, y)
return result if result > 0
return 0 if $game_player.x == x && $game_player.y == y
Expand Down Expand Up @@ -12656,8 +12663,6 @@ def unflash_rect(x, y, width, height)
flash_rect(x, y, width, height, Color.new(0, 0, 0))
end

alias_method :event_at, :id_at

append_commands
end

Expand Down Expand Up @@ -16084,4 +16089,278 @@ def terminate
super
dispose_main_viewport
end
end
# By Raho
if RME.unsafe?

#==============================================================================
# ** Resolution
#------------------------------------------------------------------------------
# Hack in the matrice :'( :'(
#==============================================================================
module Resolution
extend self
#------------------------------------------------------------------------
# * ... no idea
#------------------------------------------------------------------------
def fresh_pointer(reg, v)
addr = Externlib::LoadLibraryA.call(Externlib::RGSSDLL)
ptr = DL::CPtr.new(addr + reg)
ptr[0, v.size] = v
end
#------------------------------------------------------------------------
# * ... pack dimension
#------------------------------------------------------------------------
def pack_dimension(width, height)
[
[width, height],[width+32, height+32],
[-(~(width/32)), -(~(height/32))]
].collect{|elt| elt.pack('ll').scan(/..../)}
end
#------------------------------------------------------------------------
# * ... Oh yeah, i'm currently listening a nice song !
#------------------------------------------------------------------------
def map_reg(width, height)
empty_buff = [].pack('x4')
(buff_aa, buff_ab), (buff_ba, buff_bb),
(buff_ca, buff_cb) = *pack_dimension(width, height)
{
6495 => "\x90"*5, 6564 => buff_ab, 6569 => buff_aa,
6742 => buff_ab, 6747 => buff_aa, 8438 => buff_aa,
8447 => buff_aa, 8454 => buff_ab, 8463 => buff_ab,
116195 => empty_buff, 116200 => empty_buff,
128119 => buff_ab, 128124 => buff_aa, 135679 => buff_bb,
135684 => buff_ba, 138621 => buff_cb[0], 138753 => buff_ca[0],
1105576=> buff_ab, 1105581=> buff_aa, 1105631=> buff_ab,
1105648=> buff_aa, 1105684=> buff_ab, 1105688=> buff_aa,
1105736=> buff_ab, 1105740=> buff_aa, 1107623=> buff_aa,
1107651=> buff_ab, 1109673=> buff_aa, 1109689=> buff_ab
}.each{|k, v| fresh_pointer(k, v)}
end
#------------------------------------------------------------------------
# * ... Change resolution
#------------------------------------------------------------------------
def change(w, h)
map_reg(w, h)
Graphics.resize_screen(w, h)
end
end

end
if RME.unsafe?

#==============================================================================
# ** SceneManager
#------------------------------------------------------------------------------
# This module manages scene transitions. For example, it can handle
# hierarchical structures such as calling the item screen from the main menu
# or returning from the item screen to the main menu.
#==============================================================================

module SceneManager
class << self
alias_method :incubator_run, :run
#--------------------------------------------------------------------------
# * Execute
#--------------------------------------------------------------------------
def run
Graphics.overlayer = Sprite.new
Graphics.overlayer.viewport = Viewport.new
Graphics.overlayer.viewport.z = 1000
Graphics.retreive_bitmap
incubator_run
end
end
end

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
# Ugly Graphics Monkeypatch
#==============================================================================
module Graphics

#------------------------------------------------------------------------
# * Singleton
#------------------------------------------------------------------------
class << self

#------------------------------------------------------------------------
# * Public instance variables
#------------------------------------------------------------------------
attr_accessor :overlayer

#------------------------------------------------------------------------
# * Retreive bitmap
#------------------------------------------------------------------------
def retreive_bitmap
black = Color.new(0,0,0,255)
Graphics.overlayer.bitmap = Bitmap.new(Graphics.width, Graphics.height)
r = Rect.new(0,0,Graphics.width, Graphics.height)
Graphics.overlayer.bitmap.fill_rect(r, black)
end

#------------------------------------------------------------------------
# * Freezes the current screen in preparation for transitions.
#------------------------------------------------------------------------
def freeze
Graphics.overlayer.bitmap = snap_to_bitmap
end

#------------------------------------------------------------------------
# * Performs a fade-out of the screen.
#------------------------------------------------------------------------
def fadeout(frames)
steps = 255.0/frames.to_f
1.upto(frames) do |k|
Graphics.brightness = 255.0 - (steps * k)
Graphics.wait(1)
end
end

#------------------------------------------------------------------------
# * Performs a fade-in of the screen.
#------------------------------------------------------------------------
def fadein(frames)
steps = 255.0/frames.to_f
frames.times do |k|
Graphics.brightness = steps * k.to_f
Graphics.wait(1)
end
end

#------------------------------------------------------------------------
# * The brightness of the screen
#------------------------------------------------------------------------
def brightness
255 - Graphics.overlayer.opacity
end
#------------------------------------------------------------------------
# * change The brightness of the screen
#------------------------------------------------------------------------
def brightness=(val)
Graphics.overlayer.opacity = 255.0 - val.to_f
end

#------------------------------------------------------------------------
# * Carries out a transition from the screen frozen by Graphics.freeze
# to the current screen.
#------------------------------------------------------------------------
def transition(duration = 10, filename=nil, wave=nil)
Graphics.overlayer.bitmap = Bitmap.new(filename) if filename
Graphics.overlayer.opacity = 255
steps = 255.0 / duration.to_f
duration.times do |k|
Graphics.overlayer.opacity = 255.0 - (steps * k.to_f)
Graphics.wait(1)
end
Graphics.overlayer.bitmap.dispose if Graphics.overlayer.bitmap
retreive_bitmap
end

end

end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================

class Scene_Map
#--------------------------------------------------------------------------
# * Post Processing for Transferring Player
#--------------------------------------------------------------------------
alias_method :incubator_post_t, :post_transfer
def post_transfer
@spriteset.incubator_refresh_viewports
incubator_post_t
end
end

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
# * Retreive a correct rect
#--------------------------------------------------------------------------
def correct_rect
real_w = $game_map.width * 32
real_h = $game_map.height * 32
loop_h = $game_map.loop_vertical?
loop_w = $game_map.loop_horizontal?
coeffx = coeffy = 0
coeffx = (Graphics.width - real_w)/2 if Graphics.width > real_w && !loop_w
coeffy = (Graphics.height - real_h)/2 if Graphics.height > real_h && !loop_h
coeffw = (loop_w) ? Graphics.width : [Graphics.width, real_w].min
coeffh = (loop_h) ? Graphics.height : [Graphics.height, real_h].min
Rect.new(coeffx, coeffy, coeffw, coeffh)
end
#--------------------------------------------------------------------------
# * Create Viewport
#--------------------------------------------------------------------------
def create_viewports
r = correct_rect
@viewport1 = Viewport.new(r)
@viewport2 = Viewport.new(r)
@viewport3 = Viewport.new(r)
@viewport2.z = 50
@viewport3.z = 100
end
#--------------------------------------------------------------------------
# * Refresh viewports
#--------------------------------------------------------------------------
def incubator_refresh_viewports
r = correct_rect
[@viewport1, @viewport2, @viewport3].each do |vp|
vp.rect.set(r)
end
end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Scroll Down
#--------------------------------------------------------------------------
def scroll_down(distance)
if loop_vertical?
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance if @parallax_loop_y
else
last_y = @display_y
tile_y = (Graphics.height > (height * 32)) ? height : screen_tile_y
@display_y = [@display_y + distance, (height - tile_y)].min
@parallax_y += @display_y - last_y
end
end
#--------------------------------------------------------------------------
# * Scroll Right
#--------------------------------------------------------------------------
def scroll_right(distance)
if loop_horizontal?
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance if @parallax_loop_x
else
last_x = @display_x
tile_x = (Graphics.width > (width * 32)) ? width : screen_tile_x
@display_x = [@display_x + distance, (width - tile_x)].min
@parallax_x += @display_x - last_x
end
end
end

end
2 changes: 1 addition & 1 deletion doc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/package.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Package description
Package.new(
name: 'RME',
version: vsn(1, 2, 0),
version: vsn(1, 3, 0),
authors: {
'xvw' => '[email protected]',
'Grim' => '[email protected]',
Expand All @@ -23,7 +23,9 @@
'SDK.Gui.rb',
'EvEx.rb',
'Commands.rb',
'Tools.rb'
'Tools.rb',
'Incubator/add_kill_resolution.rb',
'Incubator/fix_kill_resolution.rb'
],
description: 'RME is a powerful tool to improve your RPGMaker VXAce experience!'
)

0 comments on commit 2839741

Please sign in to comment.