找回密码
 点一下
查看: 3081|回复: 10

请问有没有什么办法能知道游戏中"点"的数量.

[复制链接]
发表于 2008-9-12 19:42:09 | 显示全部楼层 |阅读模式
泄露问题吧. 一些T指令都会创建点,  如果没有把他们处理干净就会越来越多.  

那么有没有什么方法能够检测游戏中一共有多少个点了?


如果无法知道处理的结果,  又如何清楚自己是否排泄干净,处理正确了?
发表于 2008-9-12 20:12:46 | 显示全部楼层
handle的总数可以测出来,不过代价很大
回复

使用道具 举报

 楼主| 发表于 2008-9-12 22:24:26 | 显示全部楼层
想在游戏中途检测一下点的数量, 看来是不实用了.
回复

使用道具 举报

发表于 2008-9-13 01:09:05 | 显示全部楼层
有个检查 一段代码是否点泄露的..代码
回复

使用道具 举报

发表于 2008-9-13 08:13:43 | 显示全部楼层
[codes=jass]
function TEST takes nothing returns nothing
local integer start = H2I(Location(0,0))
local integer end = 0
//some codes here
set end = H2I(Rect(0,0,0,0))
call BJDebugMsg(I2S(end-(start+1)))
endfunction
[/codes]
回复

使用道具 举报

发表于 2008-9-13 09:49:51 | 显示全部楼层
你如果愿意的话,可以这样:
[codes=jass]globals
integer PointNumber = 0
endglobals

function LocationXL takes real x, real y returns location
set PointNumber = PointNumber + 1
return Location(x,y)
endfunction

function OffsetLocationXL takes location loc, real dx, real dy returns location
set PointNumber = PointNumber + 1
return OffsetLocation(loc,x,y)
endfunction

function RemoveLocationXL takes location loc returns nothing
set PointNumber = PointNumber - 1
call RemoveLocation(loc)
endfunction

function GetUnitLocXL takes unit u returns location
set PointNumber = PointNumber + 1
return GetUnitLoc(u)
endfunction

function GetRandomLocInRectXL takes rect r returns location
set PointNumber = PointNumber + 1
return GetRandomLocInRect(r)
endfunction

function GetSpellTargetLocXL takes nothing returns location
set PointNumber = PointNumber + 1
return GetSpellTargetLoc()
endfunction
…………………………[/codes]
回复

使用道具 举报

 楼主| 发表于 2008-9-13 14:52:25 | 显示全部楼层
我不会JASS.  大大们有没有什么拿来就可以用的一段代码. 那样就太帅了.
回复

使用道具 举报

发表于 2008-9-13 14:54:29 | 显示全部楼层
T做不到handle返回值……
回复

使用道具 举报

 楼主| 发表于 2008-9-14 00:09:16 | 显示全部楼层
那给个J吧. 好在WE里有T也可以有J.
回复

使用道具 举报

发表于 2008-9-14 13:48:23 | 显示全部楼层
游戏开始到结束 内存占用变化不很夸张就可以接受的..
回复

使用道具 举报

发表于 2008-9-15 01:36:50 | 显示全部楼层
事后补偿远没有当时解决来得好~~

你一开始就不要用创建临时点的函数或者用完立即销毁不就结了么~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 20:36 , Processed in 0.037145 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表