News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
slicing images
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: slicing images

Quote:
I guess the Fl_Shared_Image.get method returns (obviously) an RGBA image (when the loaded image contains an alpha channel). It might work better when you use Fl_PNG_Image() instead. It is supposed to "handle color- and alpha-based transparency". (Whatever that means)

That makes sense. It's something that crossed my mind but I haven't done any tests yet. Still, I don't see that explaining why an RGBA file loaded with Fl_Shared_Image.get() would tile properly if it's not resized.

Quote:
When gettiles scans the RGBA values you can see that alternating one of the RGB values is blanked out, because in memory it looks like RGB0RGB0RGB0RGB0.... which is then scanned as RGB,0RG,B0R,GB0,RGB,...
...
If the C/C++ code makes wrong assumptions about the pixel size, most likely it tries to access a memory location which is not backed by physical memory, which will result in a segmentation fault.

You see, this is exactly the sort of thing that amazes me. I wouldn't have a clue to even begin speculating what the prblems are, but your explanations makes complete sense =o)

Quote:
If you want, I can elaborate it a little more.

I wouldn't mind at all, if you don't mind. I might not be able to follow it, but at the least I might have a little better understanding of how images are handled and about why I have to tweak things so often to prevent crashes.

I noticed two more things that "puzzle" me, one about getTile() and one about my script. The first is that getTile() seems to vertically compress the tiles slightly (maybe by a pixel?). This creates a shift in the tiled image and a small line along the bottom of the image:


.gif File  puzzle.gif (Size: 28.92 KB / Downloads: 30)

The other is the fact that the scrambling occasionally results in teh unsolvable puzzle that I had consciously tried to avoid by not simply choosing random locations for the tiles:


.jpg File  puzzle.jpg (Size: 25.15 KB / Downloads: 31)
The two tiles in the bottom right are apparently impossible to swap. Maybe I haven't thought it through completely yet, but it seems like this should never happen if the scramble is done in a loop that checks to make sure a tile is adjacent only to the "hidden" tile before doing a swap.
Then again, it could be an issue of changing images before the puzzle is solved. If that's the case then maybe the hidden tile is in an inappropriate place to start with. If so I think I'll need to force the tile postitions to reset with every image change.

02-27-2008 07:08 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
slicing images - mikshaw - 01-26-2008, 06:28 AM
RE: slicing images - JohnMurga - 01-26-2008, 08:48 AM
RE: slicing images - mikshaw - 01-26-2008, 08:51 AM
RE: slicing images - JohnMurga - 01-27-2008, 06:38 AM
RE: slicing images - mikshaw - 01-27-2008, 07:26 AM
RE: slicing images - mikshaw - 02-25-2008, 05:49 AM
RE: slicing images - iGame3D - 02-25-2008, 08:08 AM
RE: slicing images - mikshaw - 02-25-2008, 12:22 PM
RE: slicing images - iGame3D - 02-25-2008, 07:15 PM
RE: slicing images - iGame3D - 02-25-2008, 07:31 PM
RE: slicing images - iGame3D - 02-25-2008, 08:15 PM
RE: slicing images - mikshaw - 02-25-2008, 10:26 PM
RE: slicing images - mikshaw - 02-26-2008, 04:47 AM
RE: slicing images - iGame3D - 02-26-2008, 06:22 AM
RE: slicing images - mikshaw - 02-26-2008, 10:41 PM
RE: slicing images - Juergen - 02-27-2008, 04:42 AM
RE: slicing images - iGame3D - 02-27-2008, 05:53 AM
RE: slicing images - iGame3D - 02-27-2008, 06:30 AM
RE: slicing images - mikshaw - 02-27-2008 07:08 AM
RE: slicing images - mikshaw - 02-27-2008, 07:18 AM
RE: slicing images - iGame3D - 02-27-2008, 07:52 AM
RE: slicing images - JohnMurga - 02-27-2008, 08:04 AM
RE: slicing images - JohnMurga - 02-27-2008, 08:28 AM
RE: slicing images - mikshaw - 02-27-2008, 08:31 AM
RE: slicing images - Juergen - 02-27-2008, 09:41 AM
RE: slicing images - mikshaw - 02-27-2008, 12:40 PM
RE: slicing images - iGame3D - 02-27-2008, 03:04 PM
RE: slicing images - mikshaw - 02-27-2008, 11:51 PM
RE: slicing images - Juergen - 02-28-2008, 03:50 AM
RE: slicing images - iGame3D - 02-28-2008, 04:22 AM
RE: slicing images - Juergen - 02-28-2008, 04:30 AM
RE: slicing images - mikshaw - 02-28-2008, 04:55 AM
RE: slicing images - iGame3D - 02-28-2008, 07:23 AM
RE: slicing images - mikshaw - 02-28-2008, 08:04 AM
RE: slicing images - JohnMurga - 02-28-2008, 08:43 AM
RE: slicing images - iGame3D - 02-28-2008, 03:41 PM
RE: slicing images - mikshaw - 02-28-2008, 07:29 PM
RE: slicing images - iGame3D - 02-29-2008, 05:29 AM
RE: slicing images - mikshaw - 02-29-2008, 05:42 AM
RE: slicing images - iGame3D - 02-29-2008, 04:16 PM
RE: slicing images - mikshaw - 02-29-2008, 11:36 PM
RE: slicing images - Juergen - 03-01-2008, 04:27 AM
RE: slicing images - mikshaw - 03-01-2008, 06:57 AM
RE: slicing images - mikshaw - 03-01-2008, 09:20 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: