1 (edited by WhiteSlash 2011-02-19 08:33:01)

Topic: Edit & recompil

Hi huys,

First of all, I'm not english, so I apologize for the mistake I'll do.
If I'm here today that's 'cause I wanna learn how to create some gametypes for example, or how to modify game physic. I read the code, & I found it quite understandable.

But here are my questions :
If I wanna create a gametype, should I add a mygametype.cpp in the gametypes folder & that's it ? 'Cause I think that I should "recompil" everything... But I don't find any Makefile.
Then if I wanna modify the game physics, should I recompil everything & then create a new teeworlds_srv ?

I'm a bit lost here. But I really wanna practice my c++/c, & I'd like to train using teeworlds' code.

Thanks for reading me,
WhiteSlash.

PS: I'm on linux. & for the instagib mod, I just had to "patch" the game.

EDIT : I've find this : http://www.teeworlds.com/?wiki=CompilingEverything , I think that it will help me a lot big_smile

2

Re: Edit & recompil

Could you precisly describe the problems you're encountering? Is it about understanding the code (in that case we can't do anything for you), getting some C++ knowledge (same there) or compiling (you're at the right place for that, huh!)?

Not Luck, Just Magic.

3

Re: Edit & recompil

"I read the code, & I found it quite understandable." I said.

But I'm here 'cause I wanna recompilate it.

I recompilated the server for the moment. But I have some errors for the "all" recompilating. I think that I need to install
alsa (asound), gl, glu & x11, but I don't find the name of them... (alsa is ok right now, but for the others : "impossible to find the "paquets" gl" for example.

My errors when I do :
../bam-0.2.0/src/bam debug

=>
src/engine/client/ec_gfx.c: In function ‘gfx_clip_disable’:
src/engine/client/ec_gfx.c:989: error: ‘GL_SCISSOR_TEST’ undeclared (first use in this function)
src/engine/client/ec_gfx.c: In function ‘gfx_minimize’:
src/engine/client/ec_gfx.c:994: warning: implicit declaration of function ‘SDL_WM_IconifyWindow’

(there're hundred of errors like those).

Thank for your replies.

4

Re: Edit & recompil

Opengl and stuf should be available in most cases already. What kind of OS do you use?
The error you are encountering is because you are missing the sdl library. For example on a debian or ubuntu based system just do

sudo apt-get install libsdl1.2-dev

This should solve your problem.

5 (edited by WhiteSlash 2011-02-19 23:52:51)

Re: Edit & recompil

I did it. I installed the SDL package.

But I still have the same prob. The SDL is still missing, or at least, the compiler doesn't know where to search the SDL.h file.

Should I add something in the command :
../bam-0.2.0/src/bam release    ?

(I know that on my PC I had to select the path where was the sdl lib)

And I'm on the latest Ubuntu.

EDIT : I've found the SDL.h in /usr/include/SDL/SDL.h.
I changed the files which used to have some compilation probs, I modified the #include "SDL.h" into #include <SDL/SDL.h>.
So now The first setp is ok.
But it is still not working ... Files .o cannot be liked to the functions "undefinied reference to ..." at the [2/2] #1 link teeworlds

6 (edited by ghost 2011-02-19 23:58:30)

Re: Edit & recompil

Don't modify! It's all correct!
Your problem is that sdl is still marked as missing in you bam configuration in the teeworlds folder. Do a

bam -c all

in the teeworlds dircetory and you should be fine wink

7 (edited by WhiteSlash 2011-02-20 00:39:36)

Re: Edit & recompil

I put #include "SDL.h" back.
I got the "bam" command.
I "bam -c all".
I retried to compile again.
And I got the same errors
[96/138] #1 c src/engine/client/ec_gfx.c
src/engine/client/ec_gfx.c:5:17: error: SDL.h: Aucun fichier ou dossier de ce type

(which means : no file or directory which is this)

And then there are all the "SDL_*** undeclared" errors.

=/ Sorry to bother you, but thanks a lot for your help

8

Re: Edit & recompil

Try "sudo apt-get build-dep teeworlds", that'll install all packages you need (and some more).

9 (edited by WhiteSlash 2011-02-20 16:22:42)

Re: Edit & recompil

Thanks guys.

I fixed it,  thanks to this clue "sdl is still marked as missing in you bam configuration in the teeworlds folder", I deleted the config.bam, installed the build-dev teeworlds package, & then it worked !

Thanks!