Import Cardgame 0.1.15 upstream source snapshot
Original author: Pierre Sarrazin. Public-domain library and demo. Source: http://sarrazip.com/dev/cardgame-0.1.15.tar.gz Archive SHA-256: ca706dddd96fec63b829f8958c2e47485b0e1166129d45fda0b6369404c1bb54
This commit is contained in:
commit
d3a54e24ee
39 files changed
+2603
No files matched your search
@@ -0,0 +1,48 @@
|
||||
#include "cardgame.h"
|
||||
|
||||
#include "pmode4game_private.h"
|
||||
|
||||
|
||||
void
|
||||
drawCharAtAddressWithoutMovingCursor(unsigned char c, byte *dest, BOOL drawBottomRow)
|
||||
{
|
||||
if (c == ' ' && transparentSpaceChar)
|
||||
return; // nothing to do
|
||||
if (c < ' ' || c > '`') // mask undefined glyphs
|
||||
c = '?';
|
||||
|
||||
BOOL drawRight = (colorInversionMask == 0xFF
|
||||
&& drawColumnAtRightOfGlyphWhenColorsInverted
|
||||
&& ((byte) (word) dest & 0x1F) < 0x1F);
|
||||
|
||||
if (colorInversionMask == 0xFF
|
||||
&& drawRowOverGlyphWhenColorsInverted
|
||||
&& dest >= scrnBuffer + BYTES_PER_SCREEN_ROW)
|
||||
{
|
||||
dest[-BYTES_PER_SCREEN_ROW] = colorInversionMask;
|
||||
if (drawRight)
|
||||
dest[1 - BYTES_PER_SCREEN_ROW] |= 0xC0;
|
||||
}
|
||||
|
||||
const byte *src = eightBitWideFont[c - ' '];
|
||||
for (byte i = 0; i < PIXEL_ROWS_PER_GLYPH; ++i)
|
||||
{
|
||||
*dest = *src++ ^ colorInversionMask;
|
||||
if (drawRight)
|
||||
dest[1] |= 0xC0;
|
||||
dest += BYTES_PER_SCREEN_ROW;
|
||||
}
|
||||
if (drawBottomRow)
|
||||
{
|
||||
*dest = colorInversionMask; // additional row below glyph -- total of 8 rows
|
||||
if (drawRight)
|
||||
dest[1] |= 0xC0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
drawCharWithoutMovingCursor(unsigned char c)
|
||||
{
|
||||
drawCharAtAddressWithoutMovingCursor(c, getCurrentCharPos(), TRUE);
|
||||
}
|
||||
Reference in new issue
Block a user