Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 WhatDotColour/Draw.Dot Trouble
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Atma Weapon




PostPosted: Mon Sep 20, 2004 1:39 am   Post subject: WhatDotColour/Draw.Dot Trouble

For a game that is currently under development, I have written code that will allow me to effectively double the screen size (by user command), by reading each pixel, storing it, then creating a new window twice the size, and spitting them back out. The problem is, there must be an issue with the maximum amount of colours that Turing will recognize, for the second window displays an extremely low colour count. My question then is, why is the 256 colour cap for Turing coming up with WhatDotColour, and what can I do to get around it?

Posted Image, might have been reduced in size. Click Image to view fullscreen.
This is what I'm talking about.

Any help would be greatly appreciated.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Sep 20, 2004 7:25 am   Post subject: (No subject)

Because turing can recognize just 256 colors. For more, you have to use RGB. module
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Delos




PostPosted: Mon Sep 20, 2004 10:46 am   Post subject: (No subject)

Hehehe, nice try Tony.

Now you see, using the RGB. module is fine and good, but the problem arises in the WhatDotColour part of his question. WhatDotColour returns a value closeset to the base 256 colours Turing incorporates, so in effect even using RGB. will not work all that well.

The alternative is to store a list of all the RGB. values you need and dynamically create a new colour scale each time you load the game/screen/etc...don't forget the 1024 colour limit Turing imposes! Yes! That's right! You can only have up to 1024 colours (created using RGB.) at any given time...so you'd obviously have to overwrite these time and again to achieve any sort of high quality screens...[sigh]
Mazer




PostPosted: Mon Sep 20, 2004 10:54 am   Post subject: (No subject)

Atma: It's nice knowing how to do these things, but in this case (especially with turing's limited colours) I think it would be better just to use Pic to do it. I can't remember the exact commands, but it's something like Pic.Take to make a picture from a rectangular area of the screen specified in the parameters. Then you can use Pic.Scale to double the size.
Delos




PostPosted: Mon Sep 20, 2004 2:25 pm   Post subject: (No subject)

Here's your function:

Pic.New (x1, y1, x2, y2) : int

And Mazer is right, Pic.Scale would be a lot faster than a pixel by pixel redrawing...
Paul




PostPosted: Mon Sep 20, 2004 4:06 pm   Post subject: (No subject)

or if ur not a perfectionist... keep it the way it is (because that pic looks good to me Razz)
Dan




PostPosted: Mon Sep 20, 2004 5:14 pm   Post subject: (No subject)

Ya i was going to say this was a realy cool idea. I never thougth about reszing things in turing quite like that. Some of the problmy could be in the way u are reszing things rather then the color as well. When u make things big they lose deatal. There are many difrent methods of rezing things witch try to aviode this as much as posable tho and could help a bit.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
rizzix




PostPosted: Mon Sep 20, 2004 5:32 pm   Post subject: (No subject)

about the colour problem.. i know a way to get around it.. sigh but i need to look into my "newer" imglib.. and thats a heck of a problem at the moment.. cuz i'm not even close to my pc (yea right like ur gonna belive that. well just in case, try this excuse: i'm lazy).. so you'll have to wait a while, i'll show it to u.
Sponsor
Sponsor
Sponsor
sponsor
Atma Weapon




PostPosted: Tue Sep 21, 2004 2:50 pm   Post subject: (No subject)

Mazer wrote:
Atma: It's nice knowing how to do these things, but in this case (especially with turing's limited colours) I think it would be better just to use Pic to do it. I can't remember the exact commands, but it's something like Pic.Take to make a picture from a rectangular area of the screen specified in the parameters. Then you can use Pic.Scale to double the size.


Delos wrote:
Here's your function:

Pic.New (x1, y1, x2, y2) : int

And Mazer is right, Pic.Scale would be a lot faster than a pixel by pixel redrawing...


*laughs* If I had known it was that easy, I would have implemented that particular command in the first place. Thanks, the both of you.

Here is what it looks like now:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Thank you to everyone for their prompt attention.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: