Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Quick and Simple Graphics Support  (Read 694 times)

Blackcat

  • Bay Watcher
    • View Profile
Quick and Simple Graphics Support
« on: August 31, 2006, 08:26:00 am »

I don't know how flexible your curses engine is, and the rendering part, but does it support multiple fonts in/on the same window/surface?

Obviously, all the fonts would have to be the same size, but with two fonts defined, one could be defined as the normal text font, and the second defined as a symbol font.

Normal text is rendered with the normal text font (how surprising), and all the things in the actual game world are drawn with the second font.

Start with both fonts being identical. Spread out the symbol allocations, so that you can get close to "one symbol = one thing".

Result? Editing the symbol font (which you can leave to others) will result in normal text being unaffected, but allowing graphical tiles.

Logged

gimli

  • Bay Watcher
    • View Profile
Re: Quick and Simple Graphics Support
« Reply #1 on: August 31, 2006, 09:45:00 am »

quote:
Originally posted by Blackcat:
<STRONG>I don't know how flexible your curses engine is, and the rendering part, but does it support multiple fonts in/on the same window/surface?

Obviously, all the fonts would have to be the same size, but with two fonts defined, one could be defined as the normal text font, and the second defined as a symbol font.

Normal text is rendered with the normal text font (how surprising), and all the things in the actual game world are drawn with the second font.

Start with both fonts being identical. Spread out the symbol allocations, so that you can get close to "one symbol = one thing".

Result? Editing the symbol font (which you can leave to others) will result in normal text being unaffected, but allowing graphical tiles.</STRONG>


I don't think that any serious tile system can be added without a 'support' gfx engine.

Logged

Blackcat

  • Bay Watcher
    • View Profile
Re: Quick and Simple Graphics Support
« Reply #2 on: August 31, 2006, 09:49:00 am »

quote:
Originally posted by gimli:

I don't think that any serious tile system can be added without a 'support' gfx engine.


That'll be why I used the words "Quick" and "Simple" in the title.

Logged

imsabbel

  • Bay Watcher
    • View Profile
Re: Quick and Simple Graphics Support
« Reply #3 on: August 31, 2006, 10:50:00 am »

The program doesnt use curses.
It uses opengl, and the letters are alpha-mapped textures.

It IS a perfectly fine graphics engine.
The only limiting factor is that the backend is written in a way that assumes only 255 different tiles.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Quick and Simple Graphics Support
« Reply #4 on: August 31, 2006, 01:14:00 pm »

Yeah, DF used PDCurses for most of its development, which just prints characters to the screen (so far as I know).  The parts of the program still assuming that leave some tedious pains associated to increasing the numbers.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Blackcat

  • Bay Watcher
    • View Profile
Re: Quick and Simple Graphics Support
« Reply #5 on: August 31, 2006, 01:21:00 pm »

Ah, that's a shame. I was hoping you'd be able to swap the current font on-the-fly, so to speak. By default, you'd display using the symbol font, then to display text you'd swap in the textual font, render it, then swap back to the symbol font. (This assumes that PDCurses allows it, and that you've got text string output going through a separate codepath to single character rendering for the map).
Logged

JT

  • Bay Watcher
  • Explosively Canadian
    • View Profile
    • http://www.jtgibson.ca/df/
Re: Quick and Simple Graphics Support
« Reply #6 on: August 31, 2006, 04:48:00 pm »

Well, at present, it no longer uses PDCurses, but rather OpenGL.  But there's still the nightmare of replacing the old routines with ones that could support proportional text on the screen.
Logged
"The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, 'You know, I want to set those people over there on fire, but I'm just not close enough to get the job done.'" --George Carlin