diff options
author | Paul Gilbert | 2019-07-03 18:57:06 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:09 -0700 |
commit | 0f0c2c97e13d01cd77ba9fb489aec77398ce6945 (patch) | |
tree | 3992b4db0f385c0116a3562d1b86f902a23c45d6 /engines/glk/alan3/glkio.cpp | |
parent | d185cc58946922939e41aca7c6440804c83b2fae (diff) | |
download | scummvm-rg350-0f0c2c97e13d01cd77ba9fb489aec77398ce6945.tar.gz scummvm-rg350-0f0c2c97e13d01cd77ba9fb489aec77398ce6945.tar.bz2 scummvm-rg350-0f0c2c97e13d01cd77ba9fb489aec77398ce6945.zip |
GLK: ALAN3: Move some Glk interface methods to glkio.cpp
Diffstat (limited to 'engines/glk/alan3/glkio.cpp')
-rw-r--r-- | engines/glk/alan3/glkio.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/engines/glk/alan3/glkio.cpp b/engines/glk/alan3/glkio.cpp index 4d0963b65d..6cc264f30a 100644 --- a/engines/glk/alan3/glkio.cpp +++ b/engines/glk/alan3/glkio.cpp @@ -22,6 +22,7 @@ #include "glk/alan3/alan3.h" #include "glk/alan3/glkio.h" +#include "glk/alan3/acode.h" namespace Glk { namespace Alan3 { @@ -49,5 +50,52 @@ void glkio_printf(const char *fmt, ...) { va_end(argp); } +void showImage(int image, int align) { + uint ecode; + + if ((g_vm->glk_gestalt(gestalt_Graphics, 0) == 1) && + (g_vm->glk_gestalt(gestalt_DrawImage, wintype_TextBuffer) == 1)) { + g_vm->glk_window_flow_break(glkMainWin); + printf("\n"); + ecode = g_vm->glk_image_draw(glkMainWin, image, imagealign_MarginLeft, 0); + (void)ecode; + } +} + +void playSound(int sound) { +#ifdef GLK_MODULE_SOUND + static schanid_t soundChannel = NULL; + + if (g_vm->glk_gestalt(gestalt_Sound, 0) == 1) { + if (soundChannel == NULL) + soundChannel = g_vm->glk_schannel_create(0); + if (soundChannel != NULL) { + g_vm->glk_schannel_stop(soundChannel); + (void)g_vm->glk_schannel_play(soundChannel, sound); + } + } +#endif +} + +void setStyle(int style) { + switch (style) { + case NORMAL_STYLE: + g_vm->glk_set_style(style_Normal); + break; + case EMPHASIZED_STYLE: + g_vm->glk_set_style(style_Emphasized); + break; + case PREFORMATTED_STYLE: + g_vm->glk_set_style(style_Preformatted); + break; + case ALERT_STYLE: + g_vm->glk_set_style(style_Alert); + break; + case QUOTE_STYLE: + g_vm->glk_set_style(style_BlockQuote); + break; + } +} + } // End of namespace Alan3 } // End of namespace Glk |