Mirage Engine
GetTickCount - 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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: GetTickCount (/showthread.php?tid=1081)

Pages: 1 2


GetTickCount - DarkX - 03-07-2007

I was wondering if there was a tut with a good explanation of using GetTickCount. If so could someone point me in the direction,

Thanks.


Re: GetTickCount - Robin - 03-07-2007

Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed

'CODE GOES HERE ROFL

nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code



Re: GetTickCount - DarkX - 03-07-2007

so that would work for replacing timers?


Re: GetTickCount - Robin - 03-07-2007

Oh yeah! Completely!

I mean, it doesn't matter what the timers are doing!

This one piece of code will manage to replace all the timers in the game!

Wooooooooh!


Re: GetTickCount - DarkX - 03-07-2007

so key this
Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed
before anything that you want to use GetTickCount and
Code:
nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code
at the end of the code?


Re: GetTickCount - Robin - 03-07-2007

I gave you just a small example of how to use gettickcount.

My example showed a quick calculation to see how long it takes for a piece of code to finish.


Re: GetTickCount - Robin - 03-07-2007

What?


Re: GetTickCount - Matt - 03-07-2007

Verrigan Wrote:What part didn't you understand? Tongue

The fact that nobody said anything about that in this post? xD


Re: GetTickCount - Matt - 04-07-2007

Verrigan Wrote:I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. Sad

Don't cry now. Lol.

It's okay. Everything will be fine.


Re: GetTickCount - Robin - 04-07-2007

I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.


Re: GetTickCount - Matt - 04-07-2007

Robin Wrote:I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.


Haha, you're an ass dude.


Re: GetTickCount - Coke - 04-07-2007

Verrigan Wrote:I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. Sad

actually i drew assumptions and understood it... i just didnt want to post incase i looked like an idiot ;D


Re: GetTickCount - funkynut - 04-07-2007

rofl, I didnt get it at all :lol:

I searched high and low, but couldnt find it. I even used the search Tongue


Re: GetTickCount - DarkX - 05-07-2007

Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?


Re: GetTickCount - Coke - 05-07-2007

DarkX Wrote:Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?

scream and roll on the floor? ^_^

honestly.. what do you mean cant get them to blt? blt where? maybe your blt'd them into the recycle bin?

I dont understand.. i thought this was about gettickcount o.0


Re: GetTickCount - Robin - 05-07-2007

Except.
Blt.

Check your spelling next time.

As to what you're on about, maybe you should read the topic title before posting ^_^


Re: GetTickCount - Matt - 06-07-2007

Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^


Re: GetTickCount - Robin - 06-07-2007

We only assume it's pronounced blit.


Re: GetTickCount - Matt - 06-07-2007

Same difference. I feel like an idiot when I say blt though. Makes me want a sammich. O_o


Re: GetTickCount - DarkX - 06-07-2007

Perfekt Wrote:Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^

Yes I did start the topic, and it is about TickCount which I thank Robin for the code. By the way the Blit thing, I was rewriting GSD's Visual Inventory code to use GetTickCount, and I think somewhere along the lines I messed up the blit code for the equipped. But thanks for the assistance from all ya.


Re: GetTickCount - Robin - 06-07-2007

It already uses gettickcount...


Re: GetTickCount - DarkX - 08-07-2007

Code:
double click the timer in frmMirage (the one u made) add the following:

Dim Q As Integer

On Error Resume Next
For Q = 0 To MAX_INV - 1
If PicInv(Q).Picture  LoadPicture() Then
PicInv(Q).Picture = LoadPicture()
Else
Call BitBlt(PicInv(Q).hdc, 0, 0, PIC_X, PIC_Y, PicItems.hdc, 0,
Item(GetPlayerInvItemNum(MyIndex, lstInv.SelCount + Q)).Pic * PIC_Y,
SRCCOPY)
End If
Next Q
that's a line from the code, does that not mean that it uses a timer?


Re: GetTickCount - Robin - 08-07-2007

Hmph. I guess I converted it to GetTickCount myself...


Re: GetTickCount - Matt - 08-07-2007

Robin Wrote:Hmph. I guess I converted it to GetTickCount myself...

xD

Don't you feel like a heel now? Haha.


Re: GetTickCount - Robin - 08-07-2007

Not really.

I guessed the tutorial used gettickcount.

Anyway, I've given him the basic knowledge of gettickcount, he can now go use it on that code himself ^_^