![]() |
[Misc] Some useful functions... - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [Misc] Some useful functions... (/showthread.php?tid=2175) |
[Misc] Some useful functions... - JokeofWeek - 23-09-2008 Hey guys ![]() ![]() ![]() [code]Public Function IsInRange(ByVal TestX As Integer, ByVal TestY As Integer, ByVal X As Byte, ByVal Y As Byte, ByVal Range As Byte) As Boolean IsInRange = False TestX = Sqr(((TestX - X) * (TestX - X)) + ((TestY - Y) * (TestY - Y))) If TestX Re: [Misc] Some useful functions... - Jacob - 10-10-2008 Quick question Shouldn't the AddInt and AddLong be like this: Code: Public Sub AddIntegerToSetBuffer(ByRef Buffer() As Byte, vData As Integer, ByRef WriteHead As Integer) Code: Public Sub AddLongToSetBuffer(ByRef Buffer() As Byte, vData As Long, ByRef WriteHead As Integer) Otherwise: Code: Public Sub AddIntegerToSetBuffer(ByRef Buffer() As Byte, vData As Integer, ByRef WriteHead As Integer) You'd be overwriting anything you've written to the Buffer() before that call because it's setting Buffer = tBytes. tBytes is never given the data from Buffer. Re: [Misc] Some useful functions... - JokeofWeek - 10-10-2008 Dugor Wrote:Quick question Ah true, fixed ![]() ![]() |