reading off the bitmap
William Labbett

hi,
i've got this here code :-

tile_type2 = _getpixel(map, x, y - 2)

while y < 2, the coordinates are off the bitmap. the docs say _getpixel() returns
-1 in such cases but in my program i get a crash as this line is executed.
I'm a bit puzzled.
tile_type2 is an int. I assume an int can hold a signed value. Is this right.

please help

LennyLen
Quote:

I assume an int can hold a signed value. Is this right.

Yes. Unless you've declared it to be unsigned.

Richard Phipps

I don't think _getpixel does any bounds checking. Try getpixel instead.

Evert
Quote:

the docs say _getpixel() returns -1 in such cases

They most definately do not:

man _getpixel said:

These
won't work in mode-X, and don't do any clipping, so you must make sure
the point lies inside the bitmap.

You're confused with getpixel().

LennyLen

Grrrrrr, at the bug that causes underscores to not show up (is this a forum bug, or browser bug?). I thought he WAS using getpixel():

{"name":"590176","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/b\/1b22c6d1449bdeb7fa4c73e3c5a371cc.jpg","w":353,"h":50,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/b\/1b22c6d1449bdeb7fa4c73e3c5a371cc"}590176

Evert
Quote:

is this a forum bug, or browser bug?

I have no idea what you're talking about. I can see underscores just fine... maybe check your font settings.

Richard Phipps

The underscore shows up fine here too.

William Labbett

Thanks

I supposed because getpixel() checkedl, _getpixel would too.
I'll let you know how I get on (so if someone would kindly bump for me?).

Thanks :)

LennyLen
Quote:

I have no idea what you're talking about. I can see underscores just fine... maybe check your font settings.

I know I'm not the only person affected by this, as I've seen other mention it before. It's not a font problem, as sometimes the underscore is visible, and at other times not. This only occurs on underscores on hyperlinks, and it could be an Opera bug, as it looks fine with FF, but I've only ever seen it occur on this forum.


testing_testing

[edit]I can see the above underscore no problem, but the original is still not visible.

Onewing

Yeah, I couldn't see the underscores either. Using Opera.

William Labbett

thanks for the help, it's working now.

Thread #587566. Printed from Allegro.cc