查看: 2435|回复: 2

[已经过期] 不需要了

[复制链接]
梦石
0
星屑
575
在线时间
1752 小时
注册时间
2008-11-7
回帖
1111
发表于 2012-12-25 13:49:59 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 z2z4 于 2012-12-25 14:42 编辑

111111111111
RPG魔塔:http://rpg.blue/thread-254429-1-1.html
魔塔2:http://rpg.blue/thread-303601-1-1.html
魔塔3: 制作中...MV
梦石
0
星屑
575
在线时间
1752 小时
注册时间
2008-11-7
回帖
1111
 楼主| 发表于 2012-12-25 14:28:52 | 显示全部楼层
这 脚本的 窗口 如何改宽  太小了

评分

参与人数 1星屑 -50 收起 理由
Mic_洛洛 -50 这是帖子标题和内容……扣分!.

查看全部评分

RPG魔塔:http://rpg.blue/thread-254429-1-1.html
魔塔2:http://rpg.blue/thread-303601-1-1.html
魔塔3: 制作中...MV
回复

使用道具 举报

梦石
0
星屑
166
在线时间
630 小时
注册时间
2012-6-9
回帖
1233
发表于 2012-12-26 18:00:19 | 显示全部楼层
不知怎么的,我想叫斑竹帮你收尸@迷糊的安安 @Mic_洛洛

这 脚本的 窗口 如何改宽  太小了

另外加上 (屏幕分辨率) :
lz任意选择1个吧。

  1. #==============================================================================
  2. # ■ 屏幕分辨率
  3. #------------------------------------------------------------------------------
  4. #    适用于:RPG Maker VX Ace
  5. #    说明:把脚本放在Main的前面。扩展到640*480。
  6. #==============================================================================

  7. Graphics.resize_screen(640,480)
复制代码

  1. #==============================================================================
  2. # ■ 屏幕分辨率
  3. #------------------------------------------------------------------------------
  4. #    适用于:RPG Maker VX Ace
  5. #    说明:把脚本放在Main的前面。直接扩大屏幕,但还是544*416。
  6. #==============================================================================

  7. 宽度=800
  8. 高度=600
  9. 游戏ini名=".\\Game.ini"
  10. #============================================================================
  11. val = "\0"*256
  12. gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
  13. gps.call("Game", "Title", "", val, 256, 游戏ini名)
  14. val.delete!("\0")
  15. title = val
  16. fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
  17. hWnd = fw.call("RGSS Player", title)
  18. swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
  19. ok = swp.call(hWnd, 0, 0, 0, 宽度, 高度, 2)
复制代码

  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 屏幕分辨率
  4. #------------------------------------------------------------------------------
  5. #    适用于:RPG Maker VX Ace
  6. #    说明:把脚本放在Main的前面。扩大到800*600。原脚本:ACE分辨率内存补丁
  7. #==============================================================================

  8. #==============================================================================
  9. # ■ String
  10. #------------------------------------------------------------------------------
  11. #  String 类追加定义。
  12. #==============================================================================

  13. class String
  14.   #----------------------------------------------------------------------------
  15.   # ● API
  16.   #----------------------------------------------------------------------------
  17.   @@MultiByteToWideChar  = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i')
  18.   @@WideCharToMultiByte  = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i')
  19.   #----------------------------------------------------------------------------
  20.   # ● UTF-8 转 Unicode
  21.   #----------------------------------------------------------------------------
  22.   def u2w
  23.     i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
  24.     buffer = "\0" * (i*2)
  25.     @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
  26.     buffer.chop!
  27.     return buffer
  28.   end  
  29.   #----------------------------------------------------------------------------
  30.   # ● UTF-8 转系统编码
  31.   #----------------------------------------------------------------------------
  32.   def u2s
  33.     i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
  34.     buffer = "\0" * (i*2)
  35.     @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
  36.     i = @@WideCharToMultiByte.call(0, 0, buffer, -1, nil, 0, nil, nil)
  37.     result = "\0" * i
  38.     @@WideCharToMultiByte.call(0, 0, buffer, -1, result, i, nil, nil)
  39.     result.chop!
  40.     return result
  41.   end
  42.   #----------------------------------------------------------------------------
  43.   # ● 系统编码转 UTF-8
  44.   #----------------------------------------------------------------------------
  45.   def s2u
  46.     i = @@MultiByteToWideChar.call(0, 0, self, -1, nil, 0)
  47.     buffer = "\0" * (i*2)
  48.     @@MultiByteToWideChar.call(0, 0, self, -1, buffer, buffer.size / 2)
  49.     i = @@WideCharToMultiByte.call(65001, 0, buffer, -1, nil, 0, nil, nil)
  50.     result = "\0" * i
  51.     @@WideCharToMultiByte.call(65001, 0, buffer, -1, result, result.size, nil, nil)
  52.     result.chop!
  53.     return result
  54.   end
  55. end

  56. #==============================================================================
  57. # ■ AceResolutionMemoryPatch
  58. #------------------------------------------------------------------------------
  59. #  用于调整RMACE分辨率的内存补丁脚本,免修改DLL。
  60. #==============================================================================
  61. module AceResolutionMemoryPatch

  62.   GetModuleFileName       = Win32API.new("kernel32", "GetModuleFileName", "lpl", "l")
  63.   GetPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", "pppplp", "l")
  64.   GetModuleHandle         = Win32API.new("kernel32", "GetModuleHandle", "p", "l")
  65.   RtlMoveMemory           = Win32API.new("kernel32", "RtlMoveMemory", "pli", "v")
  66.   RtlMoveMemoryLP         = Win32API.new("kernel32", "RtlMoveMemory", "lpi", "v")
  67.   VirtualProtect          = Win32API.new("kernel32", "VirtualProtect", "lllp", "i")
  68.   FindWindow              = Win32API.new("user32", "FindWindow", "pp", "l")

  69.   module_function

  70.   def patch(width = 800, height = 600)
  71.     # 获取句柄
  72.     path = 0.chr * 256
  73.     return false if 0 == GetModuleFileName.call(0, path, path.size)
  74.     path = path.s2u.gsub!(/.exe/ ,".ini").u2s
  75.     buff = 0.chr * 256
  76.     return false if 0 == GetPrivateProfileString.call("Game", "Library", nil, buff, buff.size, path)
  77.     buff.delete!("\0")
  78.     rgsshandle = GetModuleHandle.call(buff)
  79.     # 获取标题名和脚本名字
  80.     title = 0.chr * 256
  81.     return false if 0 == GetPrivateProfileString.call("Game", "Title", nil, title, title.size, path)
  82.     title = title.s2u.delete("\0").u2s
  83.     scripts = 0.chr * 256
  84.     return false if 0 == GetPrivateProfileString.call("Game", "Scripts", nil, scripts, scripts.size, path)
  85.     scripts = scripts.s2u.delete("\0").u2w
  86.     # 地址表
  87.     addr =
  88.     {
  89.       # 直接宽度替换
  90.       :w0 => [0x000016EE, 0x000020F6, 0x000020FF, 0x0010DFED, 0x0010E025, 0x0010E059, 0x0010E08D, 0x000019AA, 0x00001A5B, 0x0001C528, 0x0001F49C, 0x0010E7E7, 0x0010EFE9],
  91.       # 直接高度替换
  92.       :h0 => [0x000016E9, 0x00002106, 0x0000210F, 0x0010DFE8, 0x0010E020, 0x0010E054, 0x0010E088, 0x000019A5, 0x00001A56, 0x0001C523, 0x0001F497, 0x0010E803, 0x0010EFF9],

  93.       # 宽度+32
  94.       :w1 => [0x000213E4],
  95.       # 高度+32
  96.       :h1 => [0x000213DF],

  97.       # 最大宽度/32+1
  98.       :w2 => [0x00021FE1],
  99.       # 最大高度/32+1
  100.       :h2 => [0x00021F5D]
  101.     }
  102.     # 更新
  103.     w0 = [width].pack("L")
  104.     addr[:w0].each{|ofs| return false if !write_memory(rgsshandle + ofs, w0)}
  105.     h0 = [height].pack("L")
  106.     addr[:h0].each{|ofs| return false if !write_memory(rgsshandle + ofs, h0)}
  107.     w1 = [width + 32].pack("L")
  108.     addr[:w1].each{|ofs| return false if !write_memory(rgsshandle + ofs, w1)}
  109.     h1 = [height + 32].pack("L")
  110.     addr[:h1].each{|ofs| return false if !write_memory(rgsshandle + ofs, h1)}
  111.     w2 = [width / 32 + 1].pack("C")
  112.     addr[:w2].each{|ofs| return false if !write_memory(rgsshandle + ofs, w2)}
  113.     h2 = [height / 32 + 1].pack("C")
  114.     addr[:h2].each{|ofs| return false if !write_memory(rgsshandle + ofs, h2)}
  115.     # 重启
  116.     rgssgamemain = Win32API.new(buff, "RGSSGameMain", "ipp", "v")
  117.     rgssgamemain.call(FindWindow.call("RGSS Player", title), scripts, "")
  118.     # 补丁成功
  119.     return true
  120.   end

  121.   def write_memory(addr, str)
  122.     old = 0.chr * 4
  123.     return false if 0 == VirtualProtect.call(addr, str.size, 0x40, old)
  124.     RtlMoveMemoryLP.call(addr, str, str.size)
  125.     return false if 0 == VirtualProtect.call(addr, str.size, old.unpack("L").first, old)
  126.     return true
  127.   end
  128.   private_class_method :write_memory

  129.   def read_byte(addr)
  130.     dst = 0.chr * 1
  131.     RtlMoveMemory.call(dst, addr, dst.size)
  132.     return dst.unpack("C").first
  133.   end
  134.   private_class_method :read_byte

  135.   def read_dword(addr)
  136.     dst = 0.chr * 4
  137.     RtlMoveMemory.call(dst, addr, dst.size)
  138.     return dst.unpack("L").first
  139.   end
  140.   private_class_method :read_dword

  141. end

  142. unless $ace_patched
  143.   $ace_patched = true
  144.   raise "应用分辨率补丁失败!" unless AceResolutionMemoryPatch.patch
  145.   #raise RGSSReset.new
  146. end

  147. Graphics.resize_screen(800, 600)
复制代码

点评

是你电脑配置低的问题  发表于 2012-12-27 12:16
我才发现 这个脚本 太卡帧了 我就加了 4个变量  发表于 2012-12-26 18:30
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部