Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Will this work?

Author
Message
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 22nd Aug 2007 02:40
i can't use the comp at home so i can't test this... does this code work?



thanx in advance... this code is to make text fade in and out like on the main screen of Zelda: Ocarina of Time... i waz just wandering if that is wat it does... thanx again

Why do they turn against me? Especially when i need them the most?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 22nd Aug 2007 02:52
sync and cls used like that kills your framerate.

making a 3d panel and fading the panel with fade object etc would be a lot more proficient in 3d or 2d.

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 22nd Aug 2007 03:28


should be



with



right before



Indi was not right actually about the sync and cls(sorry mate but its true)

A^2+b^2=c^2, but D^2-A^2/g^2*t-r-o-u-b-l-e = w+i+t+h / a*(c*a/p^i+t+o+l)/T+rhyming+with/P+f/o*r^(p-o-o/l)

That equation has a quote from a movie in it. Find it for a cookie
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Aug 2007 04:00
Quote: "Indi was not right actually about the sync and cls(sorry mate but its true)"

Yep, has no effect on FPS.

Here's my version. The RGB command slows the program down if you use it loads like that, so I substituted it for the multiplication factor of red.


Your signature has been erased by a mod because it was rubbish.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 22nd Aug 2007 05:49
a cls is a sync - a sync is a sync
when your program grows it will give you grief.
good luck to you if you think it doesnt, been down that road many times.

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 22nd Aug 2007 17:52
Quote: "a cls is a sync"

no its not, cls clears the screen. What he is doing if anything will increase the fps because the computer doesn't draw anything to the screen untill the end of the loop so it is just figuring out what the screen should look like and not having to draw it constantly.

- - - - -

A^2+b^2=c^2, but D^2-A^2/g^2*t-r-o-u-b-l-e = w+i+t+h / a*(c*a/p^i+t+o+l)/T+rhyming+with/P+f/o*r^(p-o-o/l)

That equation has a quote from a movie in it. Find it for a cookie
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Aug 2007 20:43 Edited at: 22nd Aug 2007 20:45
@indi
Quote: "a cls is a sync"

Sorry indi didn't think that's what you meant.
I thought you were commenting on the way he had SYNC and then CLS afterwards.

Tested it out and you're right! CLS does do a sync??? that's stupid
They don't say that in the tutorials, unless I missed it.

Your signature has been erased by a mod because it was rubbish.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 23rd Aug 2007 00:31
Quote: "CLS does do a sync"


nnaaawwwwwwwwwwwwww!
really?
what does that mean?
how would you do it better???
CLS DOES A SYNC????????????????????????


A^2+b^2=c^2, but D^2-A^2/g^2*t-r-o-u-b-l-e = w+i+t+h / a*(c*a/p^i+t+o+l)/T+rhyming+with/P+f/o*r^(p-o-o/l)

That equation has a quote from a movie in it. Find it for a cookie
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 23rd Aug 2007 01:13
I guess you would get rid of the SYNC
so why do tutorials always have CLS at the top?

Your signature has been erased by a mod because it was rubbish.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 23rd Aug 2007 03:18
dumb dumb dumb - roll credits
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Aug 2007 04:10
Quote: "a cls is a sync - a sync is a sync"


Under what circumstances? If one uses SYNC ON at the beginning of the program, the CLS doesn't behave the same as a sync.

Here's a couple examples. The last one is so slow, that the mouse pointer doesn't even move. The refresh takes several seconds.









Enjoy your day.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 23rd Aug 2007 04:12 Edited at: 23rd Aug 2007 04:19
i am still getting over it

how do i put an image here?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Aug 2007 04:19
SYNC and CLS are not interchangeable

Enjoy your day.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 23rd Aug 2007 04:45
I KNEW IT!!!!!!I KNEW IT, I KNEW IT, I KNEW IT!!!!! YAY!!!!!![/u]

how do i put an image here?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 23rd Aug 2007 05:40 Edited at: 23rd Aug 2007 05:40
using a backdrop on without cls i get 457 fps.




using a cls i lose about 30 fps.



naturally for the classic users change fastsync to sync.
As you clearly see it draws fps.
A sync is really a clear screen then repaint screen.


If you wanted to know as well for yourself instead of stabbing in the proverbial dark you would have found out in minutes writing your own examples.

If you want less fps in your programs be my guest pfft lmao.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Aug 2007 06:02
It's just the statement:

Quote: "a cls is a sync - a sync is a sync"


Is not entirely accurate and may lead some astray to thinking that one command can be used for the other. A CLS will not adjust the screen refresh timing according to a set SYNC RATE. A SYNC wil not clear the screen in all cases. It may in a 3d situation, but it will not clear a 2d screen.









A CLS without a SYNC when SYNC ON has been set will slow to a crawl as the system waits for the refresh from SYNC.

You are correct in saying that using both at the same time will slow fps, but so will using any drawing commands. I just want to avoid confusion that CLS cannot be used in place of SYNC and SYNC cannot be used in place of CLS.

But thank you for the tip in speeding up code execution.

Enjoy your day.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 23rd Aug 2007 06:24
I can see how that got misconstrued, but yeah its a bad thing to use both.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 23rd Aug 2007 17:23
Quote: "but yeah its a bad thing to use both"

obviously there are times when you would have to.
Thanks for clearing that up Latch.

Your signature has been erased by a mod because it was rubbish.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 23rd Aug 2007 17:27
Quote: "CLS cannot be used in place of SYNC and SYNC cannot be used in place of CLS."


Thats what i thought...

how do i put an image here?
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Aug 2007 19:57
Quote: "naturally for the classic users change fastsync to sync."


As Indi's example is a DBPro example, I guess there's also the possibility that DBPro behaves differently to DBC in this respect. It does for many others.

TDK_Man

hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 30th Aug 2007 19:05
srry if this sounds like i'm being a jack@$$... but i just wanted to know if it worked... i appreciate all the help you guys have given me tho ... so... yea... just... yes/no does it work?

i waz in my room, and i wrote this code in a notebook... so i have no way of checking it

Why do they turn against me? Especially when i need them the most?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Aug 2007 03:06
Sorry hpfan, the answer is NO it didn't work
You can't assign a variable in the middle of a function call like that
Quote: "rgb(color=color+15,0,0),1"

Although it did actually compile????
Didn't work though

Apart from that it works, but here is an edited version


there was no need for the "if up=whatever then blah-de-blah" verses, they both did exactly the same thing accept for the change to the color variable. So what do we need to do? Change what is added to the variable! And since we already have the whole "UP" thing I just substituted its value for +15 or -15 and used it to alter the color variable. Easy peasy
Sorry if I was at all annoying in this post, it is late here
If you have any questions then post them and some other person will reply because I'm going to bed

Your signature has been erased by a mod because it was rubbish.

Login to post a reply

Server time is: 2025-06-02 06:52:45
Your offset time is: 2025-06-02 06:52:45