Jump to content

Halloween Horrors with Objective-C

JMK

3,233 views

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.



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.

Share this comment


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?

Share this comment


Link to comment

The hard parts of the sample game are done. It's more Chris' job, so ask him about it.

Share this comment


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.

Share this comment


Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...