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
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: slicing images

I noticed that green line of pixels at the bottom as well.

I'm having great luck with this function now:
It will resize large images and prevent most of the problems so far.

Code:
function load_callback(object)
-- mod of a function (and a piece) written by John Murga
fileName = fltk.fl_file_chooser("Choose an RGB image", "Image Files (*.{jpg,png})", nil, nil)
if fileName then
  if image1 then image1:uncache() end -- don't know if this is needed
  image1 = Fl_Shared_Image.get(fileName)
-- set a window (or an object) image property to the image data
  w:image(image1,ts*tc,ts*tc)
-- set the image data to the a resized copy of the image data  
  image1 = w:image():copy(ts*tc,ts*tc)  
-- get table of tiles getTiles  
  myImages = image1:getTiles(ts,ts)
-- parse tile table into image data of objects
  for key,value in ipairs(myImages) do
  if  key < 16 then
    tile[key-1]:image(value)
tile[key-1]:redraw()
end
end
scramble()
  scrambutt:label("load an image")
end
end


However I broke the game play functionality so I have to go back a few steps somewhere.

I  think I've still segfaulted, and I've got some weird crash logs.

Code:
Thread 0 Crashed:
0   <<00000000>>     0xffff08a0 __memcpy + 256 (cpu_capabilities.h:228)
1   murgaLua                0x000595a6 0x1000 + 361894
..etc..etc
7   murgaLua                0x0015cd53 Fl_Widget::do_callback() + 29
8   murgaLua                0x0009d252 0x1000 + 639570
..etc..etc
12  com.apple.HIToolbox     0x92def4d7 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1093
13  com.apple.HIToolbox     0x92deeb7c SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 304
14  com.apple.HIToolbox     0x92df5f7c SendEventToEventTarget + 56

etc...etc..

Once I've got the game play back I'll see if those crashes persist.

02-27-2008 07:52 AM
Visit this user's website 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: