Author Topic: TinyCurses 0.9f released!  (Read 7733 times)

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
TinyCurses 0.9f released!
« on: June 03, 2009, 07:29:06 AM »
New version. This one FINALLY adds full alpha blending for every character on every layer on screen. It also fixes a lot of bugs, and removes the need to initialize and close the library.

Get it here: http://code.google.com/p/tinycurses/
A small list of changes is here: http://nosoftware.blogspot.com/

Anvilfolk

  • Rogueliker
  • ***
  • Posts: 374
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #1 on: June 03, 2009, 11:06:08 AM »
If I remember correctly, this is based on SDL, which requires manual initialization of the various components. How did you manage that? I don't mind opening and closing libraries when it's something related to graphics, it kind of makes sense, especially if you want to send parameters over to the video initialization thing.
"Get it hot! Hit it harder!!!"
 - The tutor warcry

One of They Who Are Too Busy

PaulBlay

  • Rogueliker
  • ***
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #2 on: June 03, 2009, 12:53:09 PM »
Looking at the code it seems that the practical maximum height / width is around 127.  Isn't that a little low given games like Pyromancer ?

PaulBlay

  • Rogueliker
  • ***
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #3 on: June 03, 2009, 02:02:37 PM »
Out of curiosity I created a patch that removes 94 of the 96 compiler warnings that VC++ finds.  If you're interested I can email it (no guarantees that I haven't broken it ;-)

I gave it a trial run and wrote a review.  Unfortunately I didn't get very far.
« Last Edit: June 03, 2009, 02:30:06 PM by PaulBlay »

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #4 on: June 03, 2009, 05:24:26 PM »
If I remember correctly, this is based on SDL, which requires manual initialization of the various components. How did you manage that? I don't mind opening and closing libraries when it's something related to graphics, it kind of makes sense, especially if you want to send parameters over to the video initialization thing.

TinyCurses depends on SDL and SDL_ttf, but you never have you know/use them if you use TinyCurses. TinyCurses handles all of the initialization stuff for you.

Looking at the code it seems that the practical maximum height / width is around 127.  Isn't that a little low given games like Pyromancer ?

Maybe. I might change the maximum width/height eventually.

Out of curiosity I created a patch that removes 94 of the 96 compiler warnings that VC++ finds.  If you're interested I can email it (no guarantees that I haven't broken it ;-)

I gave it a trial run and wrote a review.  Unfortunately I didn't get very far.

Awesome! I'd love to get a copy of that patch. Sorry you didn't get very far in compiling. It is as if TinyCurses.c was not explicitly compiled. TinyCurses.h has all the functions as externs, so if it's included without TinyCurses.c being compiled, you'll get an error about missing function definitions. Make sure TinyCurses.c is getting compiled. Of course, it could be something else. But I did get TinyCurses to work on MSVC in the beginning. I'll have to take a look at it again. Thanks for taking the time to use and review TinyCurses, AND to patch it! :D I'd love to get a copy of that patch.

Anvilfolk

  • Rogueliker
  • ***
  • Posts: 374
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #5 on: June 04, 2009, 12:59:54 PM »
Ah, I had misunderstood. I thought TinyCurses didn't need to be explicitly initialized, which would have been weird. It makes all kinds of sense for TC to initialize all the libraries that it depends upon :)
"Get it hot! Hit it harder!!!"
 - The tutor warcry

One of They Who Are Too Busy

Anvilfolk

  • Rogueliker
  • ***
  • Posts: 374
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #6 on: June 04, 2009, 01:32:57 PM »
Oh, also, one of the warnings is simple to remove. Just make function endwin not return anything. Atexit is complaining.

Also, I did a Makefile but I have absolutely no idea if the shared library produced can then be used to compile ;)

Anyone care to try?

Code: [Select]
CC=gcc
CFLAGS=-Wall -O3 `sdl-config --cflags`
LIBS=`sdl-config --libs`

all: TinyCurses
 
 
TinyCurses: TinyCurses.o
$(CC) -shared $(CFLAGS) $(LIBS) -o TinyCurses.so
"Get it hot! Hit it harder!!!"
 - The tutor warcry

One of They Who Are Too Busy

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #7 on: June 04, 2009, 10:45:13 PM »
Oh, also, one of the warnings is simple to remove. Just make function endwin not return anything. Atexit is complaining.

Also, I did a Makefile but I have absolutely no idea if the shared library produced can then be used to compile ;)

Anyone care to try?

Code: [Select]
CC=gcc
CFLAGS=-Wall -O3 `sdl-config --cflags`
LIBS=`sdl-config --libs`

all: TinyCurses
 
 
TinyCurses: TinyCurses.o
$(CC) -shared $(CFLAGS) $(LIBS) -o TinyCurses.so

That should work, just add SDL_ttf onto libs, too. And TinyCurses doesn't need to be explicitly initialized. You just use it's functions, and they automatically detect if the library needs initialization. So, unlike curses, there's no initscr or endwin that the user needs to call. Also, yes, endwin needs to be void instead of int. Sorry about that.

Anvilfolk

  • Rogueliker
  • ***
  • Posts: 374
  • Karma: +0/-0
    • View Profile
Re: TinyCurses 0.9f released!
« Reply #8 on: June 04, 2009, 10:58:35 PM »
Understood how you did it. I still don't mind having to initialize stuff if it's just one or two calls which you parametrize according to your needs, but I guess it's a matter of choice :)

I didn't have to add libsdl_TTF for some reason. It compiled just fine, but I did have to install the correct package. I'm guessing it automatically linked it? Not much of a guru in these things :)
"Get it hot! Hit it harder!!!"
 - The tutor warcry

One of They Who Are Too Busy