#153525 - TheMagnitude - Tue Apr 01, 2008 11:33 am
Ok. These two lines of code that simply set the x and y value of an instance, work on no$gba but don't work on the hardware and instead seem to (delete/hide) all sprites.
*bulletIns and *instances[i] are members of class:
and *bullet and *ship are members of class:
I think its something to do with data types because this works:
Is there something with the ARM processor that cant handle certain data type conversions or something?
Code: |
bulletIns->x = instances[i]->x + ship->spriteSize / 2 + 14 * cos(instances[i]->spriteAngle) - bullet->spriteSize / 2;
bulletIns->y = instances[i]->y + ship->spriteSize / 2 + 14 * sin(instances[i]->spriteAngle) - bullet->spriteSize / 2; |
*bulletIns and *instances[i] are members of class:
Code: |
class instance
{ public: instance(float, float, object*); instance(object*); ~instance(); object* parent; float x, y, hspeed, vspeed, spriteAngle; SpriteEntry* sprite; bool wrap; void updateSprite(); void step(); void setMotion(float, float); void addForce(float, float); } * instances[SPRITE_COUNT]; |
and *bullet and *ship are members of class:
Code: |
class object
{ public: object() {}; object(SpriteEntry* s); char spriteSize; SpriteEntry* sprite; }; |
I think its something to do with data types because this works:
Code: |
bulletIns->x = 200;
bulletIns->y = 200; |
Is there something with the ARM processor that cant handle certain data type conversions or something?