Unable to convert from Int Ptr to Int

BlitzMax Forums/BlitzMax Programming/Unable to convert from Int Ptr to Int

RustyKristi(Posted 2016) [#1]
I would like to know can this be fixed with NG, this works perfectly with Vanilla BMX btw.

		For Local Sprite:LTSprite = EachIn SpriteMap.Lists[ Int( Floor( X / SpriteMap.CellWidth ) ) & SpriteMap.XMask, ..
				Int( Floor( Y / SpriteMap.CellHeight ) ) & SpriteMap.YMask ]
			Sprite.Draw()
		Next


I'm kind of confused on what has changed, thanks.


col(Posted 2016) [#2]
Hiya,

Also, posting any bugs on the github repo would likely get more attention and faster.

https://github.com/bmx-ng/bcc
https://github.com/bmx-ng/bmx-ng

Although NG has moved away from 100% compatibility with the legacy Blitzmax ( it has way more features ), I'm sure Brucey wants it to be 100% backwards compatible.

In the meantime, making the assumption that SpriteMap.Lists is a 2 dimension array of integers, have you tried moving the mask expression inside the integer cast expression as opposed to be a part of it...

Int(( Floor( X / SpriteMap.CellWidth ) ) & SpriteMap.XMask) , Int(( Floor( Y / SpriteMap.CellHeight ) ) & SpriteMap.YMask)


RustyKristi(Posted 2016) [#3]
Thanks Dave, but I'm still getting the same error


col(Posted 2016) [#4]
No probs, I thought it was a bit of a long shot anyway :D

I'd raise an issue on the repo.


Henri(Posted 2016) [#5]
Hi,

one possible scenario is that either CellWidth or Mask fields are defined as Int Ptr's, which legacy Blitzmax converts to Int's but NG does not due to 64-bit awareness.

-Henri

Ps. Of course I can be completely off :-)


RustyKristi(Posted 2016) [#6]
Thanks Henri, Ok now I understand it's related to 64bit awareness and I'm curious on any possible workaround.

CellWidth and CellHeight are double and SpriteMap.XMask is integer.


col(Posted 2016) [#7]
Is there any chance that you post a complete example that reproduces that same bug?


RustyKristi(Posted 2016) [#8]
@col Yes, that's the DWLab library that munch posted on an earlier thread, which works on vanilla but not with NG.

https://code.google.com/archive/p/dwlab/

Check out 1.4 as I think that's the last version


col(Posted 2016) [#9]
Using NG v0.78
I just tried real quick and I can't get dwlab.mod to compile either ( obviously ). I get an expression error in a different place to you that I can work around but then I get an EAV during compilation which is rather unhelpful :P

It looks like dwlab.mod would be a great candidate for squeezing out some compatibility bugs.


RustyKristi(Posted 2016) [#10]
Ah I see. still got 0.70 as I'm failing to build all brl.blitz module with 0.78 (see related post)


It looks like dwlab.mod would be a great candidate for squeezing out some compatibility bugs.


Agree, it would be a waste to be not able to port and use these existing libraries from Vanilla to NG.


Derron(Posted 2016) [#11]
@ col
use "bmk makemods -v modulenamepart" to compile the module.
Then you get in the command prompt the commands used to compile the various file - and so also the line leading to the EAV.

Next:
- create another BCC-directory, copy the sources in it, copy (if needed) bcc.conf (and adjust to your needs)
Open up "bcc.bmx" in MaxIDE, select "debug build" and in "program - command line" you enter the portion after the "bcc[.exe]"-portion of that EAVing command line.

Now compile your bcc and upon execution, it should try to compile the module - and when segfaulting, you might have a chance to see what fails.


bye
Ron