MestreLion / roguepc

Port of original PC-DOS Epyx Rogue to modern platforms
27 stars 6 forks source link

No intro graphics (ROGUE.PIC splash image) #2

Closed MestreLion closed 4 years ago

MestreLion commented 9 years ago

This will be tricky, as original switched to CGA 320x200 graphics mode to display image, and there is no universal way of doing so in POSIX. SDL would be an option, as it chooses the display backend based on platform, environment and user permissions, so it could open a new window on X, use the framebuffer on console, or fallback to aalib/libcaca for ASCII art.

But adding SDL, even as an optional dependency, would kind of defeat the project's spirit: to be a text-only game, requiring nothing but libc and curses, just like traditional UNIX versions and clones, including the one shipped in bsdgames package.

There's an alternative approach which I'm quite fond of, suggested by a fellow contributor: to manually decode and "render" the image as colored, half-block text characters. In an 80x25 terminal this means a 1:4 scale, which depending on the downsample method can have a quite satisfactory result with 256 colors.

It could be a standalone executable (a bash script), or, preferably, C code integrated in the project. The latter is not trivial, as the render code would share the same curses initialization of the game (initscr() can only be called once, and so does winit()), but it may require very different settings, as the color palette for example.