Mirage Source
I'm no good with optimizations.. - Printable Version

+- Mirage Source (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)
+----- Thread: I'm no good with optimizations.. (/showthread.php?tid=3207)



I'm no good with optimizations.. - Matt - 14-10-2009

http://web.miragesource.com/old-tutoria ... 20Tut.html

What would it take to properly optimize this system?


Re: I'm no good with optimizations.. - Matt - 14-10-2009

[code]Sub BltWeather()
Dim i As Long

If WeatherTick = 0 Then
WeatherTick = GetTickCount
End If

Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255))

If GameWeather = WEATHER_RAINING Then
For i = 1 To MAX_RAINDROPS
If DropRain(i).Randomized = False Then
If frmMirage.tmrRainDrop.Enabled = False Then
BLT_RAIN_DROPS = 1
frmMirage.tmrRainDrop.Enabled = True
If frmMirage.tmrRainDrop.Tag = "" Then
frmMirage.tmrRainDrop.Interval = 200
frmMirage.tmrRainDrop.Tag = "123"
End If
End If
End If
Next i
Else
If BLT_RAIN_DROPS > 0 And BLT_RAIN_DROPS


Re: I'm no good with optimizations.. - genusis - 14-10-2009

hmm 0.0

Id say What you got there is close just get rid of the timer and make it Get tick.

also

Type DropRainRec
x as long
y as long
speed as byte
Randomized as byte
End Type

use byte instead of Boolean ^^. 1 or 0 Would work =].

and in the MapRec

add Weather() As byte
1 rain 2 thundering rain 3 snow ^^

you can Make them public Consent ^^ as well for the max amount of drops

Public Const MAX_BLTDROPS As Byte = 100

Reason for Adding to map is to allow Each map to be able to have a different Weather. like Mountains with snow then walk off rain forest woot.

You could also add a Gettickcount to Count down, to turn the Drops on and off for each map and Have a set variable In the map editor for it =].

If you ask why i use byte instead of Boolean because i think its faster ^^.


Re: I'm no good with optimizations.. - Matt - 14-10-2009

Most of that is already done with this system..


Re: I'm no good with optimizations.. - genusis - 14-10-2009

from what i see you still got frmMirage.tmrRainDrop.Enabled = True
get rid of all timers =[ they are bad.


Re: I'm no good with optimizations.. - Matt - 14-10-2009

I said most. And I know timers are bad. I just wanted to get the other part fixed BEFORE I did that.

Anyways, thanks to Jacob, this is fixed.


Re: I'm no good with optimizations.. - Jacob - 14-10-2009

Posting in a locked topic!