Mirage Source
http://web.miragesource.net/forums/

GetTickCount
http://web.miragesource.net/forums/viewtopic.php?f=201&t=2206
Page 1 of 3

Author:  DarkX [ Tue Jul 03, 2007 4:39 pm ]
Post subject:  GetTickCount

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.

Author:  Robin [ Tue Jul 03, 2007 4:43 pm ]
Post subject:  Re: GetTickCount

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

Author:  DarkX [ Tue Jul 03, 2007 4:44 pm ]
Post subject:  Re: GetTickCount

so that would work for replacing timers?

Author:  Robin [ Tue Jul 03, 2007 4:46 pm ]
Post subject:  Re: GetTickCount

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!

Author:  DarkX [ Tue Jul 03, 2007 4:48 pm ]
Post subject:  Re: GetTickCount

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?

Author:  Robin [ Tue Jul 03, 2007 5:38 pm ]
Post subject:  Re: GetTickCount

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.

Author:  Verrigan [ Tue Jul 03, 2007 8:07 pm ]
Post subject:  Re: GetTickCount

Contrary to many people's beliefs.. API != Advanced Programming Interface. It stands for Application Programming Interface.

No offense meant to the poster. It's a common mistake.

Topic moved to Beginner Questions.

Author:  Robin [ Tue Jul 03, 2007 10:49 pm ]
Post subject:  Re: GetTickCount

What?

Author:  Verrigan [ Tue Jul 03, 2007 10:55 pm ]
Post subject:  Re: GetTickCount

What part didn't you understand? :P

Author:  Matt [ Tue Jul 03, 2007 11:03 pm ]
Post subject:  Re: GetTickCount

Verrigan wrote:
What part didn't you understand? :P


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

Author:  Verrigan [ Wed Jul 04, 2007 1:42 am ]
Post subject:  Re: GetTickCount

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. :(

Author:  Matt [ Wed Jul 04, 2007 1:44 am ]
Post subject:  Re: GetTickCount

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. :(


Don't cry now. Lol.

It's okay. Everything will be fine.

Author:  Robin [ Wed Jul 04, 2007 2:05 pm ]
Post subject:  Re: GetTickCount

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

Author:  Matt [ Wed Jul 04, 2007 2:14 pm ]
Post subject:  Re: GetTickCount

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.

Author:  Coke [ Wed Jul 04, 2007 2:22 pm ]
Post subject:  Re: GetTickCount

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. :(


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

Author:  funkynut [ Wed Jul 04, 2007 4:21 pm ]
Post subject:  Re: GetTickCount

rofl, I didnt get it at all :lol:

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

Author:  DarkX [ Thu Jul 05, 2007 3:55 pm ]
Post subject:  Re: GetTickCount

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

Author:  Coke [ Thu Jul 05, 2007 7:58 pm ]
Post subject:  Re: GetTickCount

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

Author:  Robin [ Thu Jul 05, 2007 8:00 pm ]
Post subject:  Re: GetTickCount

Except.
Blt.

Check your spelling next time.

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

Author:  Matt [ Fri Jul 06, 2007 12:04 am ]
Post subject:  Re: GetTickCount

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. ^_^

Author:  Robin [ Fri Jul 06, 2007 2:49 am ]
Post subject:  Re: GetTickCount

We only assume it's pronounced blit.

Author:  Matt [ Fri Jul 06, 2007 3:08 am ]
Post subject:  Re: GetTickCount

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

Author:  DarkX [ Fri Jul 06, 2007 7:51 pm ]
Post subject:  Re: GetTickCount

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.

Author:  Robin [ Fri Jul 06, 2007 8:40 pm ]
Post subject:  Re: GetTickCount

It already uses gettickcount...

Author:  DarkX [ Sun Jul 08, 2007 9:02 pm ]
Post subject:  Re: GetTickCount

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?

Page 1 of 3 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/