Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,767

Halloween Horrors with Objective-C


Josh

5,102 views

 Share

It's November 1, and this is the longest summer I can remember in a while. Jokes about the seasons aside, last week I had trouble deciding what to do first, so I decided to attack the remaining tasks I was most scared of. This has been my strategy throughout the entire process, and it results in my work becoming progressively easier as we near the finish line.

 

I finished one big task today that was holding us back. We need a file system watcher for Mac computers to detect changes to the file system. That way when files are created, deleted, modified, or renamed, the editor can detect the change and automatically reconvert and reload assets. This feature allows you to keep Photoshop open and work on a texture, while Leadwerks will display your changes instantly every time you save the file.

 

I started by asking a few questions on the Mac developer forum on Apple's website. I found one method of doing this with an event stream, but that wasn't recursive. Finally I built some code off the Objective-C example here:

https://developer.ap...nts/_index.html

 

Objective-C is frightening (perfect for Halloween!), but after this experience I feel slightly less afraid of it. Once I got the code working, I found that Mac FSEventStreams only give you a folder path; they don't tell you which exact file changed, or whether it was created, deleted, renamed, or modified. Going back to the editor side of things, I added some code that reads the directory structure at startup and stores the file time for each file. Some clever code analyzes a folder when an even occurs, and then is able to emit events based on whether a file was changed, created, deleted, etc.

 

So what's left to do? Well, here's my exact list:

  • Lua Interpreter project for iOS and Android
  • Improve flowgraph visual style
  • Documentation
  • Recursive rendering (like LE2 uses)
  • Restructure asset class (I did something stupid here that can be improved)
  • Brush rendering batches (to make editor rendering faster)
  • Finish skinning in OpenGL ES renderer (copy and paste, mostly)
  • Undo system

And what we finished recently:

  • Move project over to VS 2010 (Chris)
  • FileSystemWatcher for Mac (today)

I'm heading down to the hacker lab tonight to talk to the co-founders there. Catch me in Left 4 Dead 2 past about 9 P.M. PST if you want to kill zombies for a round.

  • Upvote 2
 Share

7 Comments


Recommended Comments

I think you may underestimate the amount of work in an undo system for an editor as complex as Leadwerks 3's.

 

But hey, it's almost over, so cheers.

Link to comment

Not sure if you mentioned this elsewhere but does that mean that the sample game is finished or is that to be released in a post-beta version?

Link to comment

You write it in a general way so it doesn't matter what the actual undo operations are. Figure out which objects are affected each step, save only those objects to a temp file in memory, and that is an undo step. It doesn't matter what the operations they undergo are, because you just restore the last state they were in.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...