[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Troll] Troll 0.5.1



Yeah, I've replied to this one already....

At 11:11 PM 9/12/2002 -0400, you wrote:
> > I'm going to be trapped in Lakehurst, NJ for three weeks, with nothing
> > better to do, so I might work on porting this to Windows.

It now works.  :)

>With SDL support it should be easy.

Mostly.

>   Probably should use the SDL
>functions for loading dynamic library.  If you didn't feel like fixing
>that you could just build one executable like Dos.

I think they are for loading OpenGL libraries.  I'm not sure if they do any 
custom initialization.  Instead, I've written a load library abstraction 
around both Windows and Linux.  You simply compile in the right file and 
everything links into place.

>   Only other change
>that would probably be needed would be listing the files in a
>directory.

Yep, another abstraction.

>   (Actually it might be more involved if SDL requires
>locking the video surface under windows.  I noticed it doesn't do the
>right thing but it works so I didn't change it.  However you could
>just use the screen size multipliers since locking is done correctly
>when the physical screen is larger than 320x200.)

Nothing needed.  Works fine with no changes.

>Oh.  But I can't forget the most important things the logo.  The troll
>standing in front of a broken window?  :)

Defenestration anyone?


I'm going to clean up the code, make sure it still compiles under Linux, 
and then send it back to you.  Note that I had to make some pretty drastic 
changes to make dlls work under Windows.

* IScreenCreate and IPaletteCreate *have* to be functions in order to 
allocate the memory in the identical dll heap and then delete it there 
(since IPaletteCopy calls IPaletteCreate internally).  They probably should 
be functions on all platforms (possibly inline), and not macros, BTW.

* Lots of ugly Window's style macro magic (TROLL_API and 
IDENTICAL_GRAPHICS_API constants decorating function defs) that goes away 
on other platforms.

* You cannot have templates in dlls on Windows.  Therefore there are 
proxies for the thing and map iterators and the STL containers are hidden 
behind a pointer inside these.  This change is made for all platforms, 
since some form of it is a good idea (no need to expose the details of the 
list implementation to the clients), and because maintaining it on one 
platform only is going to be killer.  With judicious inlining you could 
probably eliminate the overhead as well.

* A few bug fixes.  Probably have to diff for them (I think there are two, 
most have to do with error handling).

I've tried to be as non-intrusive to the code as I could, but I couldn't do 
this gently.  I'm not sure you're going to be 100% happy with some of the 
changes, but I made few to no style changes, concentrating on only what I 
had to do to make it work.  I'm probably going to go back over the code 
with a copy of Effective C++ and "bring it into compliance" but that should 
probably be a separate change.

I'm on Windows for this, so it's probably easiest for me to send you all 
the code.  Is there a possibility of creating a CVS (over SSH) tree 
somewhere I could work on?  That would be much better (that's what I use at 
work all the time...)  It works well on Windows (w/ Putty, a Windows ssh 
client).

Kenn