123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|628|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz Max -> gui confusion

Page : 1 Prev 2
Next
Fri, 05 Feb 2021, 07:55
Jayenkai
Y=0 to tilesize

0,1,2,3,4,5,6,7,8
That's 9.

Also, shove brackets around the tilesize*y, just in case.

-=-=-
''Load, Next List!''
Fri, 05 Feb 2021, 08:14
spinal
about 5 seconds after I posted I gave that a try, that's the problem with switching languages, you forget things like

is not the same as


I've done that in a couple of other places too

-=-=-
Check out my excellent homepage!
Fri, 05 Feb 2021, 08:45
Jayenkai
Easily done. SmileBASIC mangles itself in a couple of places due to that. It tries to be 0-based, but occasionally isn't!!

-=-=-
''Load, Next List!''
Fri, 05 Feb 2021, 09:39
spinal
hmmm, resizing an array doesn't seem to be a straight forward task..

|edit| hold on, i missed a bit...

-=-=-
Check out my excellent homepage!
Fri, 12 Mar 2021, 08:14
spinal
gah! I can't tell if I'm confusing myself with the code, or the language
But I seem to be getting nowhere which what is essentially a REALLY SIMPLE task.

-=-=-
Check out my excellent homepage!
Thu, 08 Apr 2021, 02:13
spinal
Current conundrum....

Switching from 'add new colours to palette' to 'use a fixed palette'



My brain says that the above code is correct, but the output is completely wrong

-=-=-
Check out my excellent homepage!
Thu, 08 Apr 2021, 03:51
Jayenkai
A couple of things, at a glance.

I tend to and, then shift. I'm not sure how well different chipsets/languages work if you shift, then and, since they might try to round the results.
And
Perhaps multiplying the three abs' might help spread the results a little better..?

Additionally, consider storing the palette as separate r,g and b arrays so you don't have to keep doing that shr/and every loop. Memory vs cpu ticks.. which is more important?

-=-=-
''Load, Next List!''
Thu, 08 Apr 2021, 04:48
spinal
At the moment I don't care how fast/slow it runs, I'd be happy with accurate. :-p

I seem to have managed OK nearly 12 years ago!! - https://socoder.net/?Topic=1636

-=-=-
Check out my excellent homepage!
Thu, 08 Apr 2021, 05:00
Jayenkai
I'm thinking this..

pixel : red=0 green=5 blue=1

palette : red=6 green=0 blue=0

This would count as a match.

I think you're going to need 3 closest values, one r, one g, one b, then compare for all three, instead of combining them like that.

-=-=-
''Load, Next List!''
Thu, 08 Apr 2021, 05:04
spinal
That makes sense.

Quickly looking at that old code, I didn't abs() the values, also I multiplied them...

|edit| nope, squared....

|edit| Bingo! My brain is too tired, but my guess is that squaring the values gives them so much separation that the channels can't get confused as easily.

Thanks Jay!

-=-=-
Check out my excellent homepage!
Page : 1 Prev 2
Next