Skip to content
Snippets Groups Projects
Commit ae9f9911 authored by deuce's avatar deuce
Browse files

Add getcodepage() which returns the codepage associated with font zero.

parent ebe3bda4
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,7 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem(struct vmem_cell *cell, uint8_t ch,
CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem_attr(struct vmem_cell *cell, uint8_t attr);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinsize(int width, int height);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinposition(int x, int y);
CIOLIBEXPORT enum ciolib_codepage CIOLIBCALL ciolib_getcodepage(void);
#if defined(WITH_SDL) || defined(WITH_SDL_AUDIO)
int sdl_video_initialized = 0;
......@@ -1868,3 +1869,14 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_setwinposition(int x, int y)
if(cio_api.setwinposition)
cio_api.setwinposition(x, y);
}
CIOLIBEXPORT enum ciolib_codepage CIOLIBCALL ciolib_getcodepage(void)
{
int font = ciolib_getfont(0);
if (font < 0)
return CIOLIB_CP437;
if (font >= sizeof(conio_fontdata) / sizeof(conio_fontdata[0]))
return CIOLIB_CP437;
return conio_fontdata[font].cp;
}
......
......@@ -457,6 +457,7 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem(struct vmem_cell *cell, uint8_t ch,
CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem_attr(struct vmem_cell *cell, uint8_t attr);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinsize(int width, int height);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinposition(int x, int y);
CIOLIBEXPORT enum ciolib_codepage CIOLIBCALL ciolib_getcodepage(void);
/* DoorWay specific stuff that's only applicable to ANSI mode. */
CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable);
......@@ -540,6 +541,7 @@ CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable);
#define set_vmem_attr(a, b) ciolib_set_vmem_attr(a, b)
#define setwinsize(a,b) ciolib_setwinsize(a,b)
#define setwinposition(a,b) ciolib_setwinposition(a,b)
#define getcodepage() ciolib_getcodepage()
#endif
#ifdef WITH_SDL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment