Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 13

Author Topic: Kobold Quest port status?  (Read 12197 times)

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Kobold Quest port status?
« on: September 22, 2006, 12:46:00 pm »

I've had some more inquiries, so I was curious if anybody was working on this?  If I remember, some potential porters were starting to feel uneasy about releasing any of their own work under BSD, which is reasonable.  I'll start an SDL port at some point if there's nobody working, but it'll likely be inferior since it would be my first time with the library.

edit: unabbreviated title in topic!

[ September 22, 2006: Message edited by: Toady One ]

Logged
The Toad, a Natural Resource:  Preserve yours today!

dav

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #1 on: September 22, 2006, 03:30:00 pm »

It's a sign of my gaming orientation that my first thought was "ASCII King's Quest?  Cool!"
Logged

odd2k

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #2 on: September 22, 2006, 08:36:00 pm »

Well, I know of one goon who said he would be porting it. I will summon him to this thread.
Logged

Gakidou

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #3 on: October 03, 2006, 06:40:00 pm »

Although I doubt my skills are up to porting it, now that midterms are over I'm going to take a look at it. I'm still interested to hear if anyone has made any progress yet with either porting or getting it to compile in something other than Visual Studios. (I'm going over to check the other thread about that...)
Logged

jerkloaf

  • Escaped Lunatic
    • View Profile
    • http://jerkloaf
Re: Kobold Quest port status?
« Reply #4 on: October 10, 2006, 05:00:00 pm »

I rewrote the windowing system in SDL but I broke rendering in the process. I have no idea how to make SDL mesh with OpenGL properly although I know it's possible. It also doesn't have working input yet because I don't have a way of testing that.

edit:The code compiles and it plays the title song, just doesn't display anything.

[ October 11, 2006: Message edited by: jerkloaf ]

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Kobold Quest port status?
« Reply #5 on: October 10, 2006, 09:59:00 pm »

When I got the SDL Gears sample running with OpenGL, it seemed like the only difference was that you passed an SDL_OPENGL flag in the beginning:

code:

SDL_SetVideoMode(600, 600, 16, SDL_OPENGL|SDL_RESIZABLE);

Then you can just use standard OpenGL functions inside the event handling loop.  I might have missed something.  I didn't look at it very closely.  There are lots of short samples floating around though.

Logged
The Toad, a Natural Resource:  Preserve yours today!

jerkloaf

  • Escaped Lunatic
    • View Profile
    • http://jerkloaf
Re: Kobold Quest port status?
« Reply #6 on: October 11, 2006, 06:40:00 pm »

I did pass SDL_OPENGL to SetVideoMode. I'm not sure what I'm doing wrong, but here's my code in case anyone wants to take a whack at it.
http://jagular.org/d/files/1/updated.zip

Note:These are just the updated source files. You'll need to download SDL and add it to your library/header include directories. enabler.cpp will link sdl.lib and sdlmain.lib assuming you have them.

[ October 11, 2006: Message edited by: jerkloaf ]

[ October 11, 2006: Message edited by: jerkloaf ]

Logged

peterb

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #7 on: October 17, 2006, 09:41:00 pm »

I spent an afternoon on this, and then got too busy to follow up on it.  From what I can see, there are three issues in porting to SDL (and specifically, Mac).

(1) The horrifically huge case-statement with all the windows-specific key-codes.  Changing those to SDL key codes is mostly a mechanical task, although there are a few places where they don't match up perfectly.

(2) the main program loop.

(3) various windows data types are used throughout, and need to be typedef'd (or avoided) on systems that don't have them.

I did most of (1) and some of (3).  I've been too busy to even think about (2).

But I really want to be able to play DF on OS X.  How much do I have to raise in donations  to convince you to just do it?  :-)

Logged

peterb

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #8 on: October 17, 2006, 09:43:00 pm »

oh, and it needs to deal with build systems other than Visual C, of course.  I threw together a cheesy unix-style Makefile.

[ October 17, 2006: Message edited by: peterb ]

Logged

jerkloaf

  • Escaped Lunatic
    • View Profile
    • http://jerkloaf
Re: Kobold Quest port status?
« Reply #9 on: October 18, 2006, 05:22:00 pm »

quote:
Originally posted by peterb:
(3) various windows data types are used throughout, and need to be typedef'd (or avoided) on systems that don't have them.

Which ones, exactly? The only problems I encountered when ripping out windows.h were with files.cpp, game.cpp and enabler.cpp. files needs to be rewritten and so does enabler, but game.cpp just has a MsgBox that needs to be taken out. Of course, I didn't try to compile it on any other systems but I don't recall seeing any windows-specific stuff.

[ October 18, 2006: Message edited by: jerkloaf ]

[ October 18, 2006: Message edited by: jerkloaf ]

Logged

peterb

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #10 on: October 18, 2006, 07:35:00 pm »

A lot of the data types used use the Windows names instead of the ANSI names.  The first thing I did was throw this together (note, this is totally Hacky McHackHack, and I would not seriously say anyone should use it.  I just wanted to get it closer to compiling).

#ifndef MAC
#define MAC 1

#include <SDL_keyboard>

#define TRUE 1
#define FALSE 0

typedef unsigned int DWORD;
typedef int WORD;
typedef int BOOL;
typedef int32_t LONG;
typedef int64_t LONGLONG;
typedef int32_t HINSTANCE;
typedef void* HANDLE;

typedef union {
 struct {
   DWORD LowPart;
   LONG HighPart;
 };
 struct {
   DWORD LowPart;
   LONG HighPart;
 } u;
 LONGLONG QuadPart;
} LARGE_INTEGER;

typedef struct tagBITMAPINFOHEADER{
 DWORD  biSize;
 LONG   biWidth;
 LONG   biHeight;
 WORD   biPlanes;
 WORD   biBitCount;
 DWORD  biCompression;
 DWORD  biSizeImage;
 LONG   biXPelsPerMeter;
 LONG   biYPelsPerMeter;
 DWORD  biClrUsed;
 DWORD  biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;

#define VK_F10 121 // Magic!

#endif /* MAC */

Logged

X

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #11 on: October 18, 2006, 08:13:00 pm »

But those are only for the windows-specific bit that needs to be chopped out anyway, right? Don't need to spec BITMAPINFOHEADER at all if you're using SDL as it has all its own image loading routines, etc.

X

Logged

Gakidou

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #12 on: October 18, 2006, 09:45:00 pm »

quote:
Originally posted by X:
<STRONG>But those are only for the windows-specific bit that needs to be chopped out anyway, right? Don't need to spec BITMAPINFOHEADER at all if you're using SDL as it has all its own image loading routines, etc.

X</STRONG>


Perhaps, although if the goal is to create something Toady could easily integrate into DF proper, it would probably be best to keep these kind of checks, at least at first.

Logged

popecharlotte

  • Escaped Lunatic
    • View Profile
Re: Kobold Quest port status?
« Reply #13 on: October 19, 2006, 09:03:00 am »

I've managed to get the thing working, at least partially - you can get it here.

At the moment you can get to the main game screen, but that's about it as the keyboard input handling still needs doing properly. And texture transparency isn't done yet - everything's very pink.

Logged

Gakidou

  • Bay Watcher
    • View Profile
Re: Kobold Quest port status?
« Reply #14 on: October 19, 2006, 06:49:00 pm »

I just tried to compile it on Ubuntu; unsuccessful:

code:

~/Desktop/kobold$ make
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/adventurer.o mysource/adventurer.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/basics.o mysource/basics.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/cave.o mysource/cave.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/command_line.o mysource/command_line.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/critter.o mysource/critter.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/definition.o mysource/definition.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/graphics.o mysource/graphics.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/kobold.o mysource/kobold.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/music_and_sound.o mysource/music_and_sound.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/random.o mysource/random.cpp
mysource/random.cpp:103: warning: this decimal constant is unsigned only in ISO C90
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/unit.o mysource/unit.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/game.o mysource/game.cpp
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/enabler.o mysource/enabler.cpp
mysource/enabler.cpp: In member function ‘void enablerst::add_gennum_tile(long int, double, double, double, double, char)’:
mysource/enabler.cpp:1525: warning: converting to ‘long int’ from ‘double’
mysource/enabler.cpp:1526: warning: converting to ‘long int’ from ‘double’
mysource/enabler.cpp:1527: warning: converting to ‘long int’ from ‘double’
g++ -I/usr/include/SDL -D_REENTRANT -DNO_FMOD   -c -o mysource/interface.o mysource/interface.cpp
mysource/interface.cpp: In member function ‘bool interfacest::handleEvent(SDL_Event&)’:
mysource/interface.cpp:863: error: jump to case label
mysource/interface.cpp:857: error:   crosses initialization of ‘interfacekeyst* iks’
mysource/interface.cpp:867: error: jump to case label
mysource/interface.cpp:857: error:   crosses initialization of ‘interfacekeyst* iks’
mysource/interface.cpp:871: error: jump to case label
mysource/interface.cpp:857: error:   crosses initialization of ‘interfacekeyst* iks’
mysource/interface.cpp:875: error: jump to case label
mysource/interface.cpp:857: error:   crosses initialization of ‘interfacekeyst* iks’
make: *** [mysource/interface.o] Error 1

Logged
Pages: [1] 2 3 ... 13