Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Isegrim on Thu 06/11/2003 12:34:40

Title: 2 Suggestions
Post by: Isegrim on Thu 06/11/2003 12:34:40
Hi!

I have two suggestions for further AGS versions:
1) A function like RawSetColor, but with RGB values instead of the palette number.
2) "While"-loops always seem to be aborted after 50000 iterations. It would be great, if one could manually change compiler obtions such as that, because having one loop into another quickly rockets you beyond 50000 iterations.

Would be cool...

P.S. I have made definitely sure that every loop something happens (in my case, each loop properly updates its counter and draws a circle to specific coordinates)
Title: Re:2 Suggestions
Post by: Scorpiorus on Thu 06/11/2003 19:27:53
Quote1) A function like RawSetColor, but with RGB values instead of the palette number.
Do you mean the hi-color mode? Because for the 256 colored one you have to change the palette itself. In any case you can have a custom function to return a raw color, like:

function GetRawColor(int R, int G, int B) {

return 2048*R + 64*G + B;

}

then a custom function for 16bit mode:

function RawSetColorRGB(int R, int G, int B) {

RawSetColor (GetRawColor(R, G, B));

}

as for 256 color mode you need to change the palette with the SetPalRGB (int slot, int red, int green, int blue)

Quote2) "While"-loops always seem to be aborted after 50000 iterations. It would be great, if one could manually change compiler obtions such as that, because having one loop into another quickly rockets you beyond 50000 iterations.
I have the same problem when was making a fade-in/fade-out to color transitions, so I had to put a Wait(1). Also, recently testing a sqrt() function a set a really long loop to check a large range of values and of course encountered that problem as well. I workarounded with a Wait again but it slowed things a bit. So, I would like it to be optional. :P



~Cheers
Title: Re:2 Suggestions
Post by: Pumaman on Fri 07/11/2003 16:29:18
1. Scorpiorus has suggested an easy workaround. For 256-colours it would have to scan the palette and find the closest match - I don't know how useful this would really be.

2. Ah, I hadn't forseen there would be problems with that. I'll make the limit customizable.