memory access violation error on LoadAnimTexture

Blitz3D Forums/Blitz3D Beginners Area/memory access violation error on LoadAnimTexture

ryan scott(Posted 2006) [#1]
I am getting really annoyed with this command

w=512/7
cauteryanim=LoadAnimTexture( "gfx\models\cautery\lightning\lightning_anim_texture.bmp",1+2,w,512,0,7 )

what could possibly be so wrong as to give me the cryptic "memory access violation" ?

the texture is 512x512 (i tried everything else too)

it's got 7 frames on it, but i've tried telling it there are just 4,5,6 in case it was going off the edge. i tried using constants everywhere. i tried everything.

what the heck is memory access violation supposed to mean, for crying out loud??

the texture is being loaded because when i change the filename i get a different error (I get it on the command that's next where i try to apply that texture, 'no texture')

it looks like a bug in blitz to me - should it not give a more reasonable error otherwise?


Shambler(Posted 2006) [#2]
Run it with debug on, you might get a more meaningful error.

[Edit] Then again I get a MAV with debug on if I try to access frame 8 of a 7 frame animtexture. ^^

The MAV is not occuring at the loadanimtexture command, it is another line in your code so can you post the full code?

A MAV is caused when you try to access something that isn't there ( for example a missing texture but the MAV only occurs when you try to use the texture, not when you load it ) but without the full code we can't really say where this is occuring.

Also, 512/7 is a weird texture size, are your frames really 73 pixels wide?...that would mean you have an unused 1 pixel wide strip at the end since 7*73=511 not 512.

Try to always use 'power of two' texture sizes e.g. 8,16,32,64,128,256,512 etc. since these are what some graphics cards can only handle.

One thing that might be causing the MAV is if you have a line like
EntityTexture cube,cauteryanim,0,index
where index has gone above 7.


ryan scott(Posted 2006) [#3]
well, i'm running it with debug on, and that's the error i get.

I solved it: apparently the system does not like if you make the frames anything except on a ^2 boundary.

the docs don't say that, of course.

yeah the artist gave me frames in separate files, and i had to stick it all onto one - i'll just have him make it the 'right' way.

thanks


tonyg(Posted 2006) [#4]
I think that's a graphics card restriction rather than B3D. Some cards insist on ^2 but I thought B3D catered for that by creating a ^2 internal texture.
73.n*512 would be 128*512 so you'd be loosing a lot of space.