sprite2mem issue

Previous topic - Next topic

Scott_AW

I started to use sprite2mem in my image to voxel program, to replace the inaccurate and slow process of using get pixel.

I managed to somewhat correct the colors since its ABGR instead of simple RGB, but seem to get neon colors.

The main problem is everything was fine when working on one computer, however when I tried things on two different systems the sprite2mem was no longer storing the data.  I found this out by trying to convert it back to a sprite and ended up with an empty image.

The first system had a decent graphics card, I think ATI.

The second system had on board video, probably nothing that powerful.

The third system was my netbook which normally runs everything fine with it's intel 3150 graphics chip.

All systems are running XP.

Any ideas on what might be wrong?
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

MrTAToad

How are you calling SPRITE2MEM and MEM2SPRITE ?

I've included my compressed graphic display routine which uses MEM2SPRITE - give that a go on all machines and see what happens

[attachment deleted by admin]

Scott_AW

I'll give that a try on a few systems to see what happens.

Here's the jist of what I have...

Code (glbasic) Select

GLOBAL sprdrop%[]
DIM sprdrop%[500000]

GLOBAL file$ = "test.png"

LOADSPRITE file$, 1
SPRITE2MEM(sprdrop%[], 1)



Here's how I was extractng the colors, but they were coming out neon.  I reversed the order of the break down to compensate for ABGR instead of RGB, but I might be missing something.
Code (glbasic) Select

FUNCTION makecolor: value, color
  SELECT color
    CASE 0; //RED
      RETURN bAND(value/(256*256), 255)
    CASE 1; //GREEN
      RETURN bAND(value/256, 255)
    CASE 2; //BLUE
      RETURN bAND(value, 255)
  ENDSELECT
ENDFUNCTION

Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

MrTAToad

Are you using this with SETCOLOR ?

Scott_AW

Nope, just storing that data else where for later.

I may just try again from scratch, I could have messed something up along the way.

Your example seemed to work fine.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/