Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

GetTickCount() may return negative value

GetTickCount

  • Please log in to reply
6 replies to this topic

#1
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

idk how this api implement, but seems it return negative value after 2X days.
 
so i guess it's based on TickCount ?
 
but it'll "broken" after 24.9 days....
https://msdn.microso...(v=vs.110).aspx
 

i think GetTickCount() is better

https://msdn.microso...p/ms724408.aspx

 

or even GetTickCount64(), according the comment in the doc, it support ~585 million years Kreygasm 
https://msdn.microso...p/ms724411.aspx
 
 
 
 
anyways, temporally way is to avoid compare tick with 0, use smth like this
 
 

tick = - math.huge
if tick < GetTickcount() then

  • 0

#2
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

 

idk how this api implement, but seems it return negative value after 2X days.
 
so i guess it's based on TickCount ?
 
but it'll "broken" after 24.9 days....
https://msdn.microso...(v=vs.110).aspx
 

i think GetTickCount() is better

https://msdn.microso...p/ms724408.aspx

 

or even GetTickCount64(), according the comment in the doc, it support ~585 million years Kreygasm 
https://msdn.microso...p/ms724411.aspx
 
 
 
 
anyways, temporally way is to avoid compare tick with 0, use smth like this
 
 

tick = - math.huge
if tick < GetTickcount() then

Minimum supported phone

Windows Phone 8

nope


  • 0

#3
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

 

Minimum supported phone

Windows Phone 8

nope

 

you want run gos on your phone? :fappa:


  • 0

#4
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

you want run gos on your phone? :fappa:

soz :fappa:


  • 0

#5
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland

idk how this api implement, but seems it return negative value after 2X days.
 
so i guess it's based on TickCount ?
 
but it'll "broken" after 24.9 days....
https://msdn.microso...(v=vs.110).aspx
 
i think GetTickCount() is better
https://msdn.microso...p/ms724408.aspx
 
or even GetTickCount64(), according the comment in the doc, it support ~585 million years Kreygasm 
https://msdn.microso...p/ms724411.aspx
 
 
 
 
anyways, temporally way is to avoid compare tick with 0, use smth like this
 
 

tick = - math.huge
if tick < GetTickcount() then


GetTickCount = function()
return GetGameTimer() * 1000
end
  • 0

#6
Feretorix

Feretorix

    Administrator

  • Administrators
  • 3,024 posts
Yeah, i indeed return an integer value from GetTickCount which the max positive is 7FFFFFF, sadly lua doesn't support dword, else it would last a few months (FFFFFFFF)

And as suggested, you could use just the function from inspired instead.
  • 0

#7
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

Yeah, i indeed return an integer value from GetTickCount which the max positive is 7FFFFFF, sadly lua doesn't support dword, else it would last a few months (FFFFFFFF)

And as suggested, you could use just the function from inspired instead.

lua not support?

 

but it work in my test....what win api did you test?


  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users