This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Bitmasking? xor or somthing?


Bitmasking? xor or somthing?

Postby brendan » Oct 10, 2002 @ 5:28am

User avatar
brendan
pm Insider
 
Posts: 451
Joined: Oct 23, 2001 @ 2:51am
Location: Hobart, Australia


Postby Digby » Oct 10, 2002 @ 5:59am

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby brendan » Oct 10, 2002 @ 8:59am

User avatar
brendan
pm Insider
 
Posts: 451
Joined: Oct 23, 2001 @ 2:51am
Location: Hobart, Australia


Postby refractor » Oct 10, 2002 @ 10:12am

I concur with Digby - for this kind of thing I'd use an RLE method (especially for "sparse" tiles).

However, historically (when I wrote tile-routines for games using 8-bit graphics many, many years ago), I used to do it something like this (I think this is the EOR method you mention):

make a mask the same size as your bitmap - make set pixels 0s and transparent pixels 1s.

load the destination
load the mask
AND the destination with the mask
load the tile
ORR the destination with the tile

then plot.

When it was all 8-bit pixels (and masks) it wasn't a terrible way of doing things on the ARM because you could load a chunk into registers, munge them, and slam them straight out with an STMIA (doing it pixel by pixel would be ghastly).

However, with 16-bit pixels that's just too much data being thrown around for my liking (though you could use a 32-bit bit-mask per 32-pixel tile row and expand it into the mask on the fly). I'd investigate that approach if you have the time.

I'd still go for RLE unless most of the things you're plotting only have a few "holes" (I would think that a bitmask set would be faster to load and process than a heavily "fragmented" RLE set, IYSWIM).

Cheers,

Ref.
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby MirekCz » Oct 10, 2002 @ 1:43pm

if you know exact dimensions of object (like tile which is repeated dozens of time) you will be served best with special function to draw it that knows how many pixels and where it has to "overjump" (and you store in your bitmap only visible pixels)

For everything else... digby showed you the way:)
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Postby Quirk » Oct 10, 2002 @ 11:41pm

Quirk
 


thansk

Postby brendan » Oct 14, 2002 @ 6:53am

User avatar
brendan
pm Insider
 
Posts: 451
Joined: Oct 23, 2001 @ 2:51am
Location: Hobart, Australia


Postby refractor » Oct 15, 2002 @ 10:15am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Digby » Oct 15, 2002 @ 6:57pm

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby brendan » Oct 16, 2002 @ 12:14am

No refrector, i'm not, I was going to "implement" the trans feature (pic) later... but code wise it would be no diff (either a trans color, or nothing)... but it "seems" to be slower anyhows...

-Brendan
User avatar
brendan
pm Insider
 
Posts: 451
Joined: Oct 23, 2001 @ 2:51am
Location: Hobart, Australia


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum