diff options
author | Paul Gilbert | 2018-12-09 11:36:20 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-09 11:36:20 -0800 |
commit | 7637edb5a2e84c0abbf1c1aa156772ce1f7906c3 (patch) | |
tree | 4c35ef8cf96ffd4148a19dafaf082a0209d0416a | |
parent | 9809e19f48f750c79068baf3a0681c6a0233a083 (diff) | |
download | scummvm-rg350-7637edb5a2e84c0abbf1c1aa156772ce1f7906c3.tar.gz scummvm-rg350-7637edb5a2e84c0abbf1c1aa156772ce1f7906c3.tar.bz2 scummvm-rg350-7637edb5a2e84c0abbf1c1aa156772ce1f7906c3.zip |
GLK: Change all references to glui32 and glsi32 to uint and int
This should finally fix compilation for the Amiga, which had
difference sized types. And the renamed types are clearer for
ScummVM anyway
34 files changed, 634 insertions, 636 deletions
diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp index 0d2c33fc04..dffb79eabd 100644 --- a/engines/glk/conf.cpp +++ b/engines/glk/conf.cpp @@ -161,7 +161,7 @@ Conf::Conf(InterpreterType interpType) { Common::copy(T_STYLES, T_STYLES + style_NUMSTYLES, _tStyles); Common::copy(G_STYLES, G_STYLES + style_NUMSTYLES, _gStyles); - char buffer[255]; + char buffer[256]; const char *const TG_COLOR[2] = { "tcolor_%d", "gcolor_%d" }; for (int tg = 0; tg < 2; ++tg) { for (int style = 0; style <= 10; ++style) { diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index 7c8f490fce..c6e0ca4d1a 100644 --- a/engines/glk/frotz/glk_interface.cpp +++ b/engines/glk/frotz/glk_interface.cpp @@ -49,7 +49,7 @@ GlkInterface::~GlkInterface() { } void GlkInterface::initialize() { - glui32 width, height; + uint width, height; /* * Init glk stuff @@ -280,7 +280,7 @@ void GlkInterface::os_stop_sample(int a) { void GlkInterface::os_beep(int volume) { } -bool GlkInterface::os_picture_data(int picture, glui32 *height, glui32 *width) { +bool GlkInterface::os_picture_data(int picture, uint *height, uint *width) { if (_pics && picture == 0) { *width = _pics->version(); *height = _pics->size(); @@ -315,7 +315,7 @@ void GlkInterface::start_next_sample() { } void GlkInterface::gos_update_width() { - glui32 width; + uint width; if (gos_upper) { glk_window_get_size(gos_upper, &width, nullptr); h_screen_cols = width; @@ -328,8 +328,8 @@ void GlkInterface::gos_update_width() { } void GlkInterface::gos_update_height() { - glui32 height_upper; - glui32 height_lower; + uint height_upper; + uint height_lower; if (gos_curwin) { glk_window_get_size(gos_upper, nullptr, &height_upper); glk_window_get_size(gos_lower, nullptr, &height_lower); @@ -339,7 +339,7 @@ void GlkInterface::gos_update_height() { } void GlkInterface::reset_status_ht() { - glui32 height; + uint height; if (gos_upper) { glk_window_get_size(gos_upper, nullptr, &height); if ((uint)mach_status_ht != height) { @@ -377,7 +377,7 @@ void GlkInterface::split_window(zword lines) { lines++; if (!lines || lines > curr_status_ht) { - glui32 height; + uint height; glk_window_get_size(gos_upper, nullptr, &height); if (lines != height) @@ -425,7 +425,7 @@ void GlkInterface::packspaces(zchar *src, zchar *dst) { void GlkInterface::smartstatusline() { zchar packed[256]; - glui32 buf[256]; + uint buf[256]; zchar *a, *b, *c, *d; int roomlen, scorelen, scoreofs; int len, tmp; @@ -478,7 +478,7 @@ void GlkInterface::gos_cancel_pending_line() { } void GlkInterface::showBeyondZorkTitle() { - glui32 winW, winH, imgW, imgH; + uint winW, winH, imgW, imgH; winid_t win = glk_window_open(0, 0, 0, wintype_Graphics, 0); glk_window_get_size(win, &winW, &winH); diff --git a/engines/glk/frotz/glk_interface.h b/engines/glk/frotz/glk_interface.h index ce5da8a2fb..4d69151560 100644 --- a/engines/glk/frotz/glk_interface.h +++ b/engines/glk/frotz/glk_interface.h @@ -166,7 +166,7 @@ protected: * Only when picture 0 is asked for, write the number of available * pictures and the release number instead. */ - bool os_picture_data(int picture, glui32 *height, glui32 *width); + bool os_picture_data(int picture, uint *height, uint *width); /** * Display a picture at the given coordinates. Top left is (1,1). diff --git a/engines/glk/frotz/processor_windows.cpp b/engines/glk/frotz/processor_windows.cpp index 5e24ac818a..4bd332472f 100644 --- a/engines/glk/frotz/processor_windows.cpp +++ b/engines/glk/frotz/processor_windows.cpp @@ -71,8 +71,8 @@ void Processor::z_draw_picture() { */ for (i = 0; mapper[i].story_id != UNKNOWN; i++) { if (_storyId == mapper[i].story_id && pic == mapper[i].pic) { - glui32 height1, width1; - glui32 height2, width2; + uint height1, width1; + uint height2, width2; int delta = 0; @@ -90,7 +90,7 @@ void Processor::z_draw_picture() { os_draw_picture(pic, gos_lower, Point(x, y)); if (_storyId == SHOGUN && pic == 3) { - glui32 height, width; + uint height, width; os_picture_data(59, &height, &width); os_draw_picture(59, gos_lower, Point(h_screen_width - width + 1, y)); @@ -100,7 +100,7 @@ void Processor::z_draw_picture() { void Processor::z_picture_data() { zword pic = zargs[0]; zword table = zargs[1]; - glui32 height, width; + uint height, width; int i; bool avail = os_picture_data(pic, &height, &width); @@ -108,7 +108,7 @@ void Processor::z_picture_data() { for (i = 0; mapper[i].story_id != UNKNOWN; i++) { if (_storyId == mapper[i].story_id) { if (pic == mapper[i].pic) { - glui32 height2, width2; + uint height2, width2; avail &= os_picture_data(mapper[i].pic1, &height2, &width2); avail &= os_picture_data(mapper[i].pic2, &height2, &width2); diff --git a/engines/glk/glk.h b/engines/glk/glk.h index 91702c56be..ccf58c07a7 100644 --- a/engines/glk/glk.h +++ b/engines/glk/glk.h @@ -112,9 +112,9 @@ public: Windows *_windows; bool _copySelect; bool _terminated; - void (*gli_unregister_obj)(void *obj, glui32 objclass, gidispatch_rock_t objrock); - gidispatch_rock_t (*gli_register_arr)(void *array, glui32 len, const char *typecode); - void (*gli_unregister_arr)(void *array, glui32 len, const char *typecode, gidispatch_rock_t objrock); + void (*gli_unregister_obj)(void *obj, uint objclass, gidispatch_rock_t objrock); + gidispatch_rock_t (*gli_register_arr)(void *array, uint len, const char *typecode); + void (*gli_unregister_arr)(void *array, uint len, const char *typecode, gidispatch_rock_t objrock); public: GlkEngine(OSystem *syst, const GlkGameDescription &gameDesc); diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp index f638ea3a0d..2e476e62da 100644 --- a/engines/glk/glk_api.cpp +++ b/engines/glk/glk_api.cpp @@ -77,11 +77,11 @@ void GlkAPI::glk_tick(void) { // Nothing needed } -glui32 GlkAPI::glk_gestalt(glui32 id, glui32 val) { +uint GlkAPI::glk_gestalt(uint id, uint val) { return glk_gestalt_ext(id, val, nullptr, 0); } -glui32 GlkAPI::glk_gestalt_ext(glui32 id, glui32 val, glui32 *arr, glui32 arrlen) { +uint GlkAPI::glk_gestalt_ext(uint id, uint val, uint *arr, uint arrlen) { switch (id) { case gestalt_Version: return 0x00000703; @@ -169,7 +169,7 @@ winid_t GlkAPI::glk_window_get_root(void) const { return _windows->getRoot(); } -winid_t GlkAPI::glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, glui32 rock) const { +winid_t GlkAPI::glk_window_open(winid_t split, uint method, uint size, uint wintype, uint rock) const { return _windows->windowOpen(split, method, size, wintype, rock); } @@ -181,7 +181,7 @@ void GlkAPI::glk_window_close(winid_t win, stream_result_t *result) { } } -void GlkAPI::glk_window_get_size(winid_t win, glui32 *width, glui32 *height) { +void GlkAPI::glk_window_get_size(winid_t win, uint *width, uint *height) { if (win) { win->getSize(width, height); } else { @@ -189,7 +189,7 @@ void GlkAPI::glk_window_get_size(winid_t win, glui32 *width, glui32 *height) { } } -void GlkAPI::glk_window_set_arrangement(winid_t win, glui32 method, glui32 size, winid_t keywin) { +void GlkAPI::glk_window_set_arrangement(winid_t win, uint method, uint size, winid_t keywin) { if (win) { win->setArrangement(method, size, keywin); } else { @@ -197,8 +197,8 @@ void GlkAPI::glk_window_set_arrangement(winid_t win, glui32 method, glui32 size, } } -void GlkAPI::glk_window_get_arrangement(winid_t win, glui32 *method, - glui32 *size, winid_t *keyWin) { +void GlkAPI::glk_window_get_arrangement(winid_t win, uint *method, + uint *size, winid_t *keyWin) { if (win) { win->getArrangement(method, size, keyWin); } else { @@ -206,7 +206,7 @@ void GlkAPI::glk_window_get_arrangement(winid_t win, glui32 *method, } } -winid_t GlkAPI::glk_window_iterate(winid_t win, glui32 *rock) { +winid_t GlkAPI::glk_window_iterate(winid_t win, uint *rock) { win = win ? win->_next : _windows->getRoot(); if (win) { @@ -221,7 +221,7 @@ winid_t GlkAPI::glk_window_iterate(winid_t win, glui32 *rock) { return nullptr; } -glui32 GlkAPI::glk_window_get_rock(winid_t win) { +uint GlkAPI::glk_window_get_rock(winid_t win) { if (win) { return win->_rock; } else { @@ -230,7 +230,7 @@ glui32 GlkAPI::glk_window_get_rock(winid_t win) { } } -glui32 GlkAPI::glk_window_get_type(winid_t win) { +uint GlkAPI::glk_window_get_type(winid_t win) { if (win) { return win->_type; } else { @@ -287,7 +287,7 @@ void GlkAPI::glk_window_clear(winid_t win) { } } -void GlkAPI::glk_window_move_cursor(winid_t win, glui32 xpos, glui32 ypos) { +void GlkAPI::glk_window_move_cursor(winid_t win, uint xpos, uint ypos) { if (win) { win->moveCursor(Point(xpos, ypos)); } else { @@ -325,11 +325,11 @@ void GlkAPI::glk_set_window(winid_t win) { _streams->setCurrent(win ? win->_stream : nullptr); } -strid_t GlkAPI::glk_stream_open_file(frefid_t fileref, FileMode fmode, glui32 rock) { +strid_t GlkAPI::glk_stream_open_file(frefid_t fileref, FileMode fmode, uint rock) { return _streams->openFileStream(fileref, fmode, rock, false); } -strid_t GlkAPI::glk_stream_open_memory(char *buf, glui32 buflen, FileMode fmode, glui32 rock) { +strid_t GlkAPI::glk_stream_open_memory(char *buf, uint buflen, FileMode fmode, uint rock) { return _streams->openMemoryStream(buf, buflen, fmode, rock, false); } @@ -337,11 +337,11 @@ void GlkAPI::glk_stream_close(strid_t str, stream_result_t *result) { str->close(result); } -strid_t GlkAPI::glk_stream_iterate(strid_t str, glui32 *rockptr) const { +strid_t GlkAPI::glk_stream_iterate(strid_t str, uint *rockptr) const { return str ? str->getNext(rockptr) : _streams->getFirst(rockptr); } -glui32 GlkAPI::glk_stream_get_rock(strid_t str) const { +uint GlkAPI::glk_stream_get_rock(strid_t str) const { if (!str) { warning("stream_get_rock: invalid ref"); return 0; @@ -350,7 +350,7 @@ glui32 GlkAPI::glk_stream_get_rock(strid_t str) const { return str->getRock(); } -void GlkAPI::glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekMode) { +void GlkAPI::glk_stream_set_position(strid_t str, int pos, uint seekMode) { if (str) { str->setPosition(pos, seekMode); } else { @@ -358,7 +358,7 @@ void GlkAPI::glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekMode) { } } -glui32 GlkAPI::glk_stream_get_position(strid_t str) const { +uint GlkAPI::glk_stream_get_position(strid_t str) const { if (str) { return str->getPosition(); } else { @@ -395,19 +395,19 @@ void GlkAPI::glk_put_string_stream(strid_t str, const char *s) { str->putBuffer(s, strlen(s)); } -void GlkAPI::glk_put_buffer(const char *buf, glui32 len) { +void GlkAPI::glk_put_buffer(const char *buf, uint len) { _streams->getCurrent()->putBuffer(buf, len); } -void GlkAPI::glk_put_buffer_stream(strid_t str, const char *buf, glui32 len) { +void GlkAPI::glk_put_buffer_stream(strid_t str, const char *buf, uint len) { str->putBuffer(buf, len); } -void GlkAPI::glk_set_style(glui32 styl) { +void GlkAPI::glk_set_style(uint styl) { _streams->getCurrent()->setStyle(styl); } -void GlkAPI::glk_set_style_stream(strid_t str, glui32 styl) { +void GlkAPI::glk_set_style_stream(strid_t str, uint styl) { if (str) { str->setStyle(styl); } else { @@ -415,7 +415,7 @@ void GlkAPI::glk_set_style_stream(strid_t str, glui32 styl) { } } -glsi32 GlkAPI::glk_get_char_stream(strid_t str) { +int GlkAPI::glk_get_char_stream(strid_t str) { if (str) { return str->getChar(); } else { @@ -424,7 +424,7 @@ glsi32 GlkAPI::glk_get_char_stream(strid_t str) { } } -glui32 GlkAPI::glk_get_line_stream(strid_t str, char *buf, glui32 len) { +uint GlkAPI::glk_get_line_stream(strid_t str, char *buf, uint len) { if (str) { return str->getLine(buf, len); } else { @@ -433,7 +433,7 @@ glui32 GlkAPI::glk_get_line_stream(strid_t str, char *buf, glui32 len) { } } -glui32 GlkAPI::glk_get_buffer_stream(strid_t str, char *buf, glui32 len) { +uint GlkAPI::glk_get_buffer_stream(strid_t str, char *buf, uint len) { if (str) { return str->getBuffer(buf, len); } else { @@ -442,7 +442,7 @@ glui32 GlkAPI::glk_get_buffer_stream(strid_t str, char *buf, glui32 len) { } } -void GlkAPI::glk_stylehint_set(glui32 wintype, glui32 style, glui32 hint, glsi32 val) { +void GlkAPI::glk_stylehint_set(uint wintype, uint style, uint hint, int val) { WindowStyle *styles; bool p, b, i; @@ -513,7 +513,7 @@ void GlkAPI::glk_stylehint_set(glui32 wintype, glui32 style, glui32 hint, glsi32 } } -void GlkAPI::glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint) { +void GlkAPI::glk_stylehint_clear(uint wintype, uint style, uint hint) { WindowStyle *styles; const WindowStyle *defaults; @@ -561,7 +561,7 @@ void GlkAPI::glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint) { } } -glui32 GlkAPI::glk_style_distinguish(winid_t win, glui32 style1, glui32 style2) { +uint GlkAPI::glk_style_distinguish(winid_t win, uint style1, uint style2) { const WindowStyle *styles = win->getStyles(); if (!styles) return false; @@ -569,7 +569,7 @@ glui32 GlkAPI::glk_style_distinguish(winid_t win, glui32 style1, glui32 style2) return styles[style1] == styles[style2] ? 0 : 1; } -bool GlkAPI::glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *result) { +bool GlkAPI::glk_style_measure(winid_t win, uint style, uint hint, uint *result) { const WindowStyle *styles = win->getStyles(); if (!styles) return false; @@ -627,11 +627,11 @@ bool GlkAPI::glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *r return true; } -frefid_t GlkAPI::glk_fileref_create_temp(glui32 usage, glui32 rock) { +frefid_t GlkAPI::glk_fileref_create_temp(uint usage, uint rock) { return _streams->createTemp(usage, rock); } -frefid_t GlkAPI::glk_fileref_create_by_name(glui32 usage, const char *name, glui32 rock) { +frefid_t GlkAPI::glk_fileref_create_by_name(uint usage, const char *name, uint rock) { // Take out all dangerous characters Common::String tempName(name); for (uint idx = 0; idx < tempName.size(); ++idx) { @@ -642,11 +642,11 @@ frefid_t GlkAPI::glk_fileref_create_by_name(glui32 usage, const char *name, glui return _streams->createRef(tempName, usage, rock); } -frefid_t GlkAPI::glk_fileref_create_by_prompt(glui32 usage, FileMode fmode, glui32 rock) { +frefid_t GlkAPI::glk_fileref_create_by_prompt(uint usage, FileMode fmode, uint rock) { return _streams->createByPrompt(usage, fmode, rock); } -frefid_t GlkAPI::glk_fileref_create_from_fileref(glui32 usage, frefid_t fref, glui32 rock) { +frefid_t GlkAPI::glk_fileref_create_from_fileref(uint usage, frefid_t fref, uint rock) { if (!fref) { warning("fileref_create_from_fileref: invalid ref"); return nullptr; @@ -659,11 +659,11 @@ void GlkAPI::glk_fileref_destroy(frefid_t fref) { _streams->deleteRef(fref); } -frefid_t GlkAPI::glk_fileref_iterate(frefid_t fref, glui32 *rockptr) { +frefid_t GlkAPI::glk_fileref_iterate(frefid_t fref, uint *rockptr) { return _streams->iterate(fref, rockptr); } -glui32 GlkAPI::glk_fileref_get_rock(frefid_t fref) { +uint GlkAPI::glk_fileref_get_rock(frefid_t fref) { if (!fref) { warning("fileref_get_rock: invalid ref."); return 0; @@ -676,7 +676,7 @@ void GlkAPI::glk_fileref_delete_file(frefid_t fref) { fref->deleteFile(); } -glui32 GlkAPI::glk_fileref_does_file_exist(frefid_t fref) { +uint GlkAPI::glk_fileref_does_file_exist(frefid_t fref) { return fref->exists(); } @@ -698,11 +698,11 @@ void GlkAPI::glk_select_poll(event_t *event) { _events->getEvent(event, true); } -void GlkAPI::glk_request_timer_events(glui32 millisecs) { +void GlkAPI::glk_request_timer_events(uint millisecs) { _events->setTimerInterval(millisecs); } -void GlkAPI::glk_request_line_event(winid_t win, char *buf, glui32 maxlen, glui32 initlen) { +void GlkAPI::glk_request_line_event(winid_t win, char *buf, uint maxlen, uint initlen) { if (!win) { warning("request_line_event: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni @@ -756,7 +756,7 @@ void GlkAPI::glk_cancel_mouse_event(winid_t win) { } } -void GlkAPI::glk_set_echo_line_event(winid_t win, glui32 val) { +void GlkAPI::glk_set_echo_line_event(winid_t win, uint val) { if (!win) { warning("set_echo_line_event: invalid ref"); } else { @@ -764,7 +764,7 @@ void GlkAPI::glk_set_echo_line_event(winid_t win, glui32 val) { } } -void GlkAPI::glk_set_terminators_line_event(winid_t win, glui32 *keycodes, glui32 count) { +void GlkAPI::glk_set_terminators_line_event(winid_t win, uint *keycodes, uint count) { if (!win) { warning("set_terminators_line_event: invalid ref"); } else { @@ -772,32 +772,32 @@ void GlkAPI::glk_set_terminators_line_event(winid_t win, glui32 *keycodes, glui3 } } -glui32 GlkAPI::glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len, glui32 numchars) { +uint GlkAPI::glk_buffer_to_lower_case_uni(uint *buf, uint len, uint numchars) { return bufferChangeCase(buf, len, numchars, CASE_LOWER, COND_ALL, true); } -glui32 GlkAPI::glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, glui32 numchars) { +uint GlkAPI::glk_buffer_to_upper_case_uni(uint *buf, uint len, uint numchars) { return bufferChangeCase(buf, len, numchars, CASE_UPPER, COND_ALL, true); } -glui32 GlkAPI::glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, - glui32 numchars, glui32 lowerrest) { +uint GlkAPI::glk_buffer_to_title_case_uni(uint *buf, uint len, + uint numchars, uint lowerrest) { return bufferChangeCase(buf, len, numchars, CASE_TITLE, COND_LINESTART, lowerrest); } -void GlkAPI::glk_put_char_uni(glui32 ch) { +void GlkAPI::glk_put_char_uni(uint ch) { _streams->getCurrent()->putCharUni(ch); } -void GlkAPI::glk_put_string_uni(glui32 *s) { +void GlkAPI::glk_put_string_uni(uint *s) { _streams->getCurrent()->putBufferUni(s, strlen_uni(s)); } -void GlkAPI::glk_put_buffer_uni(glui32 *buf, glui32 len) { +void GlkAPI::glk_put_buffer_uni(uint *buf, uint len) { _streams->getCurrent()->putBufferUni(buf, len); } -void GlkAPI::glk_put_char_stream_uni(strid_t str, glui32 ch) { +void GlkAPI::glk_put_char_stream_uni(strid_t str, uint ch) { if (str) { str->putCharUni(ch); } else { @@ -805,7 +805,7 @@ void GlkAPI::glk_put_char_stream_uni(strid_t str, glui32 ch) { } } -void GlkAPI::glk_put_string_stream_uni(strid_t str, const glui32 *s) { +void GlkAPI::glk_put_string_stream_uni(strid_t str, const uint *s) { if (str) { str->putBufferUni(s, strlen_uni(s)); } else { @@ -813,7 +813,7 @@ void GlkAPI::glk_put_string_stream_uni(strid_t str, const glui32 *s) { } } -void GlkAPI::glk_put_buffer_stream_uni(strid_t str, const glui32 *buf, glui32 len) { +void GlkAPI::glk_put_buffer_stream_uni(strid_t str, const uint *buf, uint len) { if (str) { str->putBufferUni(buf, len); } else { @@ -821,7 +821,7 @@ void GlkAPI::glk_put_buffer_stream_uni(strid_t str, const glui32 *buf, glui32 le } } -glsi32 GlkAPI::glk_get_char_stream_uni(strid_t str) { +int GlkAPI::glk_get_char_stream_uni(strid_t str) { if (str) { return str->getCharUni(); } else { @@ -830,7 +830,7 @@ glsi32 GlkAPI::glk_get_char_stream_uni(strid_t str) { } } -glui32 GlkAPI::glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len) { +uint GlkAPI::glk_get_buffer_stream_uni(strid_t str, uint *buf, uint len) { if (str) { return str->getBufferUni(buf, len); } else { @@ -839,20 +839,20 @@ glui32 GlkAPI::glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len) { } } -glui32 GlkAPI::glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len) { +uint GlkAPI::glk_get_line_stream_uni(strid_t str, uint *buf, uint len) { if (str) { return str->getLineUni(buf, len); } else { warning("get_line_stream_uni: invalid ref"); - return (glui32) - 1; + return (uint) - 1; } } -strid_t GlkAPI::glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, glui32 rock) { +strid_t GlkAPI::glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, uint rock) { return _streams->openFileStream(fileref, fmode, rock, true); } -strid_t GlkAPI::glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, FileMode fmode, glui32 rock) { +strid_t GlkAPI::glk_stream_open_memory_uni(uint *buf, uint buflen, FileMode fmode, uint rock) { return _streams->openMemoryStream(buf, buflen, fmode, rock, true); } @@ -867,7 +867,7 @@ void GlkAPI::glk_request_char_event_uni(winid_t win) { } } -void GlkAPI::glk_request_line_event_uni(winid_t win, glui32 *buf, glui32 maxlen, glui32 initlen) { +void GlkAPI::glk_request_line_event_uni(winid_t win, uint *buf, uint maxlen, uint initlen) { if (!win) { warning("request_line_event_uni: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni @@ -878,17 +878,17 @@ void GlkAPI::glk_request_line_event_uni(winid_t win, glui32 *buf, glui32 maxlen, } } -glui32 GlkAPI::glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len, - glui32 numchars) { +uint GlkAPI::glk_buffer_canon_decompose_uni(uint *buf, uint len, + uint numchars) { // TODO return 0; } -glui32 GlkAPI::glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len, glui32 numchars) { +uint GlkAPI::glk_buffer_canon_normalize_uni(uint *buf, uint len, uint numchars) { return 0; } -bool GlkAPI::glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2) { +bool GlkAPI::glk_image_draw(winid_t win, uint image, int val1, int val2) { if (!win) { warning("image_draw: invalid ref"); } else if (g_conf->_graphics) { @@ -904,8 +904,8 @@ bool GlkAPI::glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2) return false; } -bool GlkAPI::glk_image_draw_scaled(winid_t win, glui32 image, glsi32 val1, glsi32 val2, - glui32 width, glui32 height) { +bool GlkAPI::glk_image_draw_scaled(winid_t win, uint image, int val1, int val2, + uint width, uint height) { if (!win) { warning("image_draw_scaled: invalid ref"); } else if (g_conf->_graphics) { @@ -921,7 +921,7 @@ bool GlkAPI::glk_image_draw_scaled(winid_t win, glui32 image, glsi32 val1, glsi3 return false; } -bool GlkAPI::glk_image_get_info(glui32 image, glui32 *width, glui32 *height) { +bool GlkAPI::glk_image_get_info(uint image, uint *width, uint *height) { if (!g_conf->_graphics) return false; @@ -945,7 +945,7 @@ void GlkAPI::glk_window_flow_break(winid_t win) { } } -void GlkAPI::glk_window_erase_rect(winid_t win, glsi32 left, glsi32 top, glui32 width, glui32 height) { +void GlkAPI::glk_window_erase_rect(winid_t win, int left, int top, uint width, uint height) { if (!win) { warning("window_erase_rect: invalid ref"); } else { @@ -953,8 +953,8 @@ void GlkAPI::glk_window_erase_rect(winid_t win, glsi32 left, glsi32 top, glui32 } } -void GlkAPI::glk_window_fill_rect(winid_t win, glui32 color, glsi32 left, glsi32 top, - glui32 width, glui32 height) { +void GlkAPI::glk_window_fill_rect(winid_t win, uint color, int left, int top, + uint width, uint height) { if (!win) { warning("window_fill_rect: invalid ref"); } else { @@ -962,7 +962,7 @@ void GlkAPI::glk_window_fill_rect(winid_t win, glui32 color, glsi32 left, glsi32 } } -void GlkAPI::glk_window_set_background_color(winid_t win, glui32 color) { +void GlkAPI::glk_window_set_background_color(winid_t win, uint color) { if (!win) { warning("window_set_background_color: invalid ref"); } else { @@ -970,7 +970,7 @@ void GlkAPI::glk_window_set_background_color(winid_t win, glui32 color) { } } -schanid_t GlkAPI::glk_schannel_create(glui32 rock) { +schanid_t GlkAPI::glk_schannel_create(uint rock) { return _sounds->create(rock); } @@ -982,11 +982,11 @@ void GlkAPI::glk_schannel_destroy(schanid_t chan) { } } -schanid_t GlkAPI::glk_schannel_iterate(schanid_t chan, glui32 *rockptr) { +schanid_t GlkAPI::glk_schannel_iterate(schanid_t chan, uint *rockptr) { return _sounds->iterate(chan, rockptr); } -glui32 GlkAPI::glk_schannel_get_rock(schanid_t chan) { +uint GlkAPI::glk_schannel_get_rock(schanid_t chan) { if (chan) { return chan->_rock; } else { @@ -995,7 +995,7 @@ glui32 GlkAPI::glk_schannel_get_rock(schanid_t chan) { } } -glui32 GlkAPI::glk_schannel_play(schanid_t chan, glui32 snd) { +uint GlkAPI::glk_schannel_play(schanid_t chan, uint snd) { if (chan) { return chan->play(snd); } else { @@ -1004,7 +1004,7 @@ glui32 GlkAPI::glk_schannel_play(schanid_t chan, glui32 snd) { } } -glui32 GlkAPI::glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats, glui32 notify) { +uint GlkAPI::glk_schannel_play_ext(schanid_t chan, uint snd, uint repeats, uint notify) { if (chan) { return chan->play(snd, repeats, notify); } else { @@ -1021,7 +1021,7 @@ void GlkAPI::glk_schannel_stop(schanid_t chan) { } } -void GlkAPI::glk_schannel_set_volume(schanid_t chan, glui32 vol) { +void GlkAPI::glk_schannel_set_volume(schanid_t chan, uint vol) { if (chan) { chan->setVolume(vol); } else { @@ -1029,17 +1029,17 @@ void GlkAPI::glk_schannel_set_volume(schanid_t chan, glui32 vol) { } } -void GlkAPI::glk_sound_load_hint(glui32 snd, glui32 flag) { +void GlkAPI::glk_sound_load_hint(uint snd, uint flag) { // No implementation } -schanid_t GlkAPI::glk_schannel_create_ext(glui32 rock, glui32 volume) { +schanid_t GlkAPI::glk_schannel_create_ext(uint rock, uint volume) { // No implementation return nullptr; } -glui32 GlkAPI::glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount, - glui32 *sndarray, glui32 soundcount, glui32 notify) { +uint GlkAPI::glk_schannel_play_multi(schanid_t *chanarray, uint chancount, + uint *sndarray, uint soundcount, uint notify) { // No implementation return 0; } @@ -1060,8 +1060,8 @@ void GlkAPI::glk_schannel_unpause(schanid_t chan) { } } -void GlkAPI::glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, - glui32 duration, glui32 notify) { +void GlkAPI::glk_schannel_set_volume_ext(schanid_t chan, uint vol, + uint duration, uint notify) { if (chan) { chan->setVolume(vol, duration, notify); } else { @@ -1069,11 +1069,11 @@ void GlkAPI::glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, } } -void GlkAPI::glk_set_hyperlink(glui32 linkval) { +void GlkAPI::glk_set_hyperlink(uint linkval) { _streams->getCurrent()->setHyperlink(linkval); } -void GlkAPI::glk_set_hyperlink_stream(strid_t str, glui32 linkval) { +void GlkAPI::glk_set_hyperlink_stream(strid_t str, uint linkval) { if (str) str->setHyperlink(linkval); } @@ -1101,7 +1101,7 @@ void GlkAPI::glk_current_time(glktimeval_t *time) { *time = td; } -glsi32 GlkAPI::glk_current_simple_time(glui32 factor) { +int GlkAPI::glk_current_simple_time(uint factor) { assert(factor); TimeAndDate td; @@ -1117,12 +1117,12 @@ void GlkAPI::glk_time_to_date_local(const glktimeval_t *time, glkdate_t *date) { *date = TimeAndDate(*time); } -void GlkAPI::glk_simple_time_to_date_utc(glsi32 time, glui32 factor, glkdate_t *date) { +void GlkAPI::glk_simple_time_to_date_utc(int time, uint factor, glkdate_t *date) { TimeSeconds secs = (int64)time * factor; *date = TimeAndDate(secs); } -void GlkAPI::glk_simple_time_to_date_local(glsi32 time, glui32 factor, glkdate_t *date) { +void GlkAPI::glk_simple_time_to_date_local(int time, uint factor, glkdate_t *date) { TimeSeconds secs = (int64)time * factor; *date = TimeAndDate(secs); } @@ -1136,14 +1136,14 @@ void GlkAPI::glk_date_to_time_local(const glkdate_t *date, glktimeval_t *time) { *time = TimeAndDate(*date); } -glsi32 GlkAPI::glk_date_to_simple_time_utc(const glkdate_t *date, glui32 factor) { +int GlkAPI::glk_date_to_simple_time_utc(const glkdate_t *date, uint factor) { // WORKAROUND: timezones aren't currently supported assert(factor); TimeSeconds ts = TimeAndDate(*date); return ts / factor; } -glsi32 GlkAPI::glk_date_to_simple_time_local(const glkdate_t *date, glui32 factor) { +int GlkAPI::glk_date_to_simple_time_local(const glkdate_t *date, uint factor) { assert(factor); TimeSeconds ts = TimeAndDate(*date); return ts / factor; @@ -1181,15 +1181,15 @@ void GlkAPI::garglk_unput_string(const char *str) { _streams->getCurrent()->unputBuffer(str, strlen(str)); } -void GlkAPI::garglk_unput_string_uni(const glui32 *str) { +void GlkAPI::garglk_unput_string_uni(const uint *str) { _streams->getCurrent()->unputBufferUni(str, strlen_uni(str)); } -void GlkAPI::garglk_set_zcolors(glui32 fg, glui32 bg) { +void GlkAPI::garglk_set_zcolors(uint fg, uint bg) { _streams->getCurrent()->setZColors(fg, bg); } -void GlkAPI::garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg) { +void GlkAPI::garglk_set_zcolors_stream(strid_t str, uint fg, uint bg) { if (str) { str->setZColors(fg, bg); } else { @@ -1197,11 +1197,11 @@ void GlkAPI::garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg) { } } -void GlkAPI::garglk_set_reversevideo(glui32 reverse) { +void GlkAPI::garglk_set_reversevideo(uint reverse) { _streams->getCurrent()->setReverseVideo(reverse != 0); } -void GlkAPI::garglk_set_reversevideo_stream(strid_t str, glui32 reverse) { +void GlkAPI::garglk_set_reversevideo_stream(strid_t str, uint reverse) { if (str) { str->setReverseVideo(reverse != 0); } else { diff --git a/engines/glk/glk_api.h b/engines/glk/glk_api.h index 2dd2501f72..030b50e751 100644 --- a/engines/glk/glk_api.h +++ b/engines/glk/glk_api.h @@ -51,8 +51,8 @@ public: void glk_set_interrupt_handler(void(*func)(void)); void glk_tick(void); - glui32 glk_gestalt(glui32 id, glui32 val); - glui32 glk_gestalt_ext(glui32 id, glui32 val, glui32 *arr, glui32 arrlen); + uint glk_gestalt(uint id, uint val); + uint glk_gestalt_ext(uint id, uint val, uint *arr, uint arrlen); unsigned char glk_char_to_lower(unsigned char ch); unsigned char glk_char_to_upper(unsigned char ch); @@ -65,35 +65,35 @@ public: /** * Open a new window */ - winid_t glk_window_open(winid_t split, glui32 method, glui32 size, - glui32 wintype, glui32 rock = 0) const; + winid_t glk_window_open(winid_t split, uint method, uint size, + uint wintype, uint rock = 0) const; void glk_window_close(winid_t win, stream_result_t *result = nullptr); - void glk_window_get_size(winid_t win, glui32 *width, glui32 *height); - void glk_window_set_arrangement(winid_t win, glui32 method, - glui32 size, winid_t keyWin); - void glk_window_get_arrangement(winid_t win, glui32 *method, - glui32 *size, winid_t *keyWin); - winid_t glk_window_iterate(winid_t win, glui32 *rock = 0); - glui32 glk_window_get_rock(winid_t win); - glui32 glk_window_get_type(winid_t win); + void glk_window_get_size(winid_t win, uint *width, uint *height); + void glk_window_set_arrangement(winid_t win, uint method, + uint size, winid_t keyWin); + void glk_window_get_arrangement(winid_t win, uint *method, + uint *size, winid_t *keyWin); + winid_t glk_window_iterate(winid_t win, uint *rock = 0); + uint glk_window_get_rock(winid_t win); + uint glk_window_get_type(winid_t win); winid_t glk_window_get_parent(winid_t win); winid_t glk_window_get_sibling(winid_t win); void glk_window_clear(winid_t win); - void glk_window_move_cursor(winid_t win, glui32 xpos, glui32 ypos); + void glk_window_move_cursor(winid_t win, uint xpos, uint ypos); strid_t glk_window_get_stream(winid_t win); void glk_window_set_echo_stream(winid_t win, strid_t str); strid_t glk_window_get_echo_stream(winid_t win); void glk_set_window(winid_t win); - strid_t glk_stream_open_file(frefid_t fileref, FileMode fmode, glui32 rock = 0); - strid_t glk_stream_open_memory(char *buf, glui32 buflen, FileMode fmode, glui32 rock = 0); + strid_t glk_stream_open_file(frefid_t fileref, FileMode fmode, uint rock = 0); + strid_t glk_stream_open_memory(char *buf, uint buflen, FileMode fmode, uint rock = 0); void glk_stream_close(strid_t str, stream_result_t *result = nullptr); - strid_t glk_stream_iterate(strid_t str, glui32 *rockptr) const; - glui32 glk_stream_get_rock(strid_t str) const; - void glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekMode); - glui32 glk_stream_get_position(strid_t str) const; + strid_t glk_stream_iterate(strid_t str, uint *rockptr) const; + uint glk_stream_get_rock(strid_t str) const; + void glk_stream_set_position(strid_t str, int pos, uint seekMode); + uint glk_stream_get_position(strid_t str) const; void glk_stream_set_current(strid_t str); strid_t glk_stream_get_current(void); @@ -101,38 +101,38 @@ public: void glk_put_char_stream(strid_t str, unsigned char ch); void glk_put_string(const char *s); void glk_put_string_stream(strid_t str, const char *s); - void glk_put_buffer(const char *buf, glui32 len); - void glk_put_buffer_stream(strid_t str, const char *buf, glui32 len); - void glk_set_style(glui32 styl); - void glk_set_style_stream(strid_t str, glui32 styl); - - glsi32 glk_get_char_stream(strid_t str); - glui32 glk_get_line_stream(strid_t str, char *buf, glui32 len); - glui32 glk_get_buffer_stream(strid_t str, char *buf, glui32 len); - - void glk_stylehint_set(glui32 wintype, glui32 styl, glui32 hint, - glsi32 val); - void glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint); - glui32 glk_style_distinguish(winid_t win, glui32 style1, glui32 style2); - bool glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *result); - - frefid_t glk_fileref_create_temp(glui32 usage, glui32 rock = 0); - frefid_t glk_fileref_create_by_name(glui32 usage, const char *name, glui32 rock = 0); - frefid_t glk_fileref_create_by_prompt(glui32 usage, FileMode fmode, glui32 rock = 0); - frefid_t glk_fileref_create_from_fileref(glui32 usage, frefid_t fref, glui32 rock = 0); + void glk_put_buffer(const char *buf, uint len); + void glk_put_buffer_stream(strid_t str, const char *buf, uint len); + void glk_set_style(uint styl); + void glk_set_style_stream(strid_t str, uint styl); + + int glk_get_char_stream(strid_t str); + uint glk_get_line_stream(strid_t str, char *buf, uint len); + uint glk_get_buffer_stream(strid_t str, char *buf, uint len); + + void glk_stylehint_set(uint wintype, uint styl, uint hint, + int val); + void glk_stylehint_clear(uint wintype, uint style, uint hint); + uint glk_style_distinguish(winid_t win, uint style1, uint style2); + bool glk_style_measure(winid_t win, uint style, uint hint, uint *result); + + frefid_t glk_fileref_create_temp(uint usage, uint rock = 0); + frefid_t glk_fileref_create_by_name(uint usage, const char *name, uint rock = 0); + frefid_t glk_fileref_create_by_prompt(uint usage, FileMode fmode, uint rock = 0); + frefid_t glk_fileref_create_from_fileref(uint usage, frefid_t fref, uint rock = 0); void glk_fileref_destroy(frefid_t fref); - frefid_t glk_fileref_iterate(frefid_t fref, glui32 *rockptr); - glui32 glk_fileref_get_rock(frefid_t fref); + frefid_t glk_fileref_iterate(frefid_t fref, uint *rockptr); + uint glk_fileref_get_rock(frefid_t fref); void glk_fileref_delete_file(frefid_t fref); - glui32 glk_fileref_does_file_exist(frefid_t fref); + uint glk_fileref_does_file_exist(frefid_t fref); void glk_select(event_t *event); void glk_select_poll(event_t *event); - void glk_request_timer_events(glui32 millisecs); + void glk_request_timer_events(uint millisecs); - void glk_request_line_event(winid_t win, char *buf, glui32 maxlen, - glui32 initlen); + void glk_request_line_event(winid_t win, char *buf, uint maxlen, + uint initlen); void glk_request_char_event(winid_t win); void glk_request_mouse_event(winid_t win); @@ -141,105 +141,105 @@ public: void glk_cancel_mouse_event(winid_t win); #ifdef GLK_MODULE_LINE_ECHO - void glk_set_echo_line_event(winid_t win, glui32 val); + void glk_set_echo_line_event(winid_t win, uint val); #endif /* GLK_MODULE_LINE_ECHO */ #ifdef GLK_MODULE_LINE_TERMINATORS - void glk_set_terminators_line_event(winid_t win, glui32 *keycodes, - glui32 count); + void glk_set_terminators_line_event(winid_t win, uint *keycodes, + uint count); #endif /* GLK_MODULE_LINE_TERMINATORS */ /** \addtogroup Unicode * @{ */ - glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len, - glui32 numchars); - glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, - glui32 numchars); - glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, - glui32 numchars, glui32 lowerrest); + uint glk_buffer_to_lower_case_uni(uint *buf, uint len, + uint numchars); + uint glk_buffer_to_upper_case_uni(uint *buf, uint len, + uint numchars); + uint glk_buffer_to_title_case_uni(uint *buf, uint len, + uint numchars, uint lowerrest); - void glk_put_char_uni(glui32 ch); - void glk_put_string_uni(glui32 *s); - void glk_put_buffer_uni(glui32 *buf, glui32 len); - void glk_put_char_stream_uni(strid_t str, glui32 ch); - void glk_put_string_stream_uni(strid_t str, const glui32 *s); - void glk_put_buffer_stream_uni(strid_t str, const glui32 *buf, glui32 len); + void glk_put_char_uni(uint ch); + void glk_put_string_uni(uint *s); + void glk_put_buffer_uni(uint *buf, uint len); + void glk_put_char_stream_uni(strid_t str, uint ch); + void glk_put_string_stream_uni(strid_t str, const uint *s); + void glk_put_buffer_stream_uni(strid_t str, const uint *buf, uint len); - glsi32 glk_get_char_stream_uni(strid_t str); - glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len); - glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len); + int glk_get_char_stream_uni(strid_t str); + uint glk_get_buffer_stream_uni(strid_t str, uint *buf, uint len); + uint glk_get_line_stream_uni(strid_t str, uint *buf, uint len); - strid_t glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, glui32 rock = 0); - strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, FileMode fmode, glui32 rock = 0); + strid_t glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, uint rock = 0); + strid_t glk_stream_open_memory_uni(uint *buf, uint buflen, FileMode fmode, uint rock = 0); void glk_request_char_event_uni(winid_t win); - void glk_request_line_event_uni(winid_t win, glui32 *buf, - glui32 maxlen, glui32 initlen); + void glk_request_line_event_uni(winid_t win, uint *buf, + uint maxlen, uint initlen); /** @}*/ #ifdef GLK_MODULE_UNICODE_NORM - glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len, - glui32 numchars); - glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len, - glui32 numchars); + uint glk_buffer_canon_decompose_uni(uint *buf, uint len, + uint numchars); + uint glk_buffer_canon_normalize_uni(uint *buf, uint len, + uint numchars); #endif /* GLK_MODULE_UNICODE_NORM */ #ifdef GLK_MODULE_IMAGE - bool glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2); - bool glk_image_draw_scaled(winid_t win, glui32 image, - glsi32 val1, glsi32 val2, glui32 width, glui32 height); - bool glk_image_get_info(glui32 image, glui32 *width, glui32 *height); + bool glk_image_draw(winid_t win, uint image, int val1, int val2); + bool glk_image_draw_scaled(winid_t win, uint image, + int val1, int val2, uint width, uint height); + bool glk_image_get_info(uint image, uint *width, uint *height); void glk_window_flow_break(winid_t win); void glk_window_erase_rect(winid_t win, - glsi32 left, glsi32 top, glui32 width, glui32 height); - void glk_window_fill_rect(winid_t win, glui32 color, - glsi32 left, glsi32 top, glui32 width, glui32 height); - void glk_window_set_background_color(winid_t win, glui32 color); + int left, int top, uint width, uint height); + void glk_window_fill_rect(winid_t win, uint color, + int left, int top, uint width, uint height); + void glk_window_set_background_color(winid_t win, uint color); #endif /* GLK_MODULE_IMAGE */ #ifdef GLK_MODULE_SOUND - schanid_t glk_schannel_create(glui32 rock = 0); + schanid_t glk_schannel_create(uint rock = 0); void glk_schannel_destroy(schanid_t chan); - schanid_t glk_schannel_iterate(schanid_t chan, glui32 *rockptr); - glui32 glk_schannel_get_rock(schanid_t chan); + schanid_t glk_schannel_iterate(schanid_t chan, uint *rockptr); + uint glk_schannel_get_rock(schanid_t chan); - glui32 glk_schannel_play(schanid_t chan, glui32 snd); - glui32 glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats, - glui32 notify); + uint glk_schannel_play(schanid_t chan, uint snd); + uint glk_schannel_play_ext(schanid_t chan, uint snd, uint repeats, + uint notify); void glk_schannel_stop(schanid_t chan); - void glk_schannel_set_volume(schanid_t chan, glui32 vol); + void glk_schannel_set_volume(schanid_t chan, uint vol); - void glk_sound_load_hint(glui32 snd, glui32 flag); + void glk_sound_load_hint(uint snd, uint flag); #ifdef GLK_MODULE_SOUND2 /* Note that this section is nested inside the #ifdef GLK_MODULE_SOUND. GLK_MODULE_SOUND must be defined if GLK_MODULE_SOUND2 is. */ - schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume); - glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount, - glui32 *sndarray, glui32 soundcount, glui32 notify); + schanid_t glk_schannel_create_ext(uint rock, uint volume); + uint glk_schannel_play_multi(schanid_t *chanarray, uint chancount, + uint *sndarray, uint soundcount, uint notify); void glk_schannel_pause(schanid_t chan); void glk_schannel_unpause(schanid_t chan); - void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, - glui32 duration, glui32 notify); + void glk_schannel_set_volume_ext(schanid_t chan, uint vol, + uint duration, uint notify); #endif /* GLK_MODULE_SOUND2 */ #endif /* GLK_MODULE_SOUND */ #ifdef GLK_MODULE_HYPERLINKS - void glk_set_hyperlink(glui32 linkval); - void glk_set_hyperlink_stream(strid_t str, glui32 linkval); + void glk_set_hyperlink(uint linkval); + void glk_set_hyperlink_stream(strid_t str, uint linkval); void glk_request_hyperlink_event(winid_t win); void glk_cancel_hyperlink_event(winid_t win); @@ -248,15 +248,15 @@ public: #ifdef GLK_MODULE_DATETIME void glk_current_time(glktimeval_t *time); - glsi32 glk_current_simple_time(glui32 factor); + int glk_current_simple_time(uint factor); void glk_time_to_date_utc(const glktimeval_t *time, glkdate_t *date); void glk_time_to_date_local(const glktimeval_t *time, glkdate_t *date); - void glk_simple_time_to_date_utc(glsi32 time, glui32 factor, glkdate_t *date); - void glk_simple_time_to_date_local(glsi32 time, glui32 factor, glkdate_t *date); + void glk_simple_time_to_date_utc(int time, uint factor, glkdate_t *date); + void glk_simple_time_to_date_local(int time, uint factor, glkdate_t *date); void glk_date_to_time_utc(const glkdate_t *date, glktimeval_t *time); void glk_date_to_time_local(const glkdate_t *date, glktimeval_t *time); - glsi32 glk_date_to_simple_time_utc(const glkdate_t *date, glui32 factor); - glsi32 glk_date_to_simple_time_local(const glkdate_t *date, glui32 factor); + int glk_date_to_simple_time_utc(const glkdate_t *date, uint factor); + int glk_date_to_simple_time_local(const glkdate_t *date, uint factor); #endif /* GLK_MODULE_DATETIME */ @@ -281,12 +281,12 @@ public: * Removes the specified string from the end of the output buffer, if * indeed it is there. */ - void garglk_unput_string_uni(const glui32 *str); + void garglk_unput_string_uni(const uint *str); - void garglk_set_zcolors(glui32 fg, glui32 bg); - void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg); - void garglk_set_reversevideo(glui32 reverse); - void garglk_set_reversevideo_stream(strid_t str, glui32 reverse); + void garglk_set_zcolors(uint fg, uint bg); + void garglk_set_zcolors_stream(strid_t str, uint fg, uint bg); + void garglk_set_reversevideo(uint reverse); + void garglk_set_reversevideo_stream(strid_t str, uint reverse); }; } // End of namespace Glk diff --git a/engines/glk/glk_types.h b/engines/glk/glk_types.h index 3a51b96887..61add0afeb 100644 --- a/engines/glk/glk_types.h +++ b/engines/glk/glk_types.h @@ -28,8 +28,6 @@ namespace Glk { -typedef uint glui32; -typedef int glsi32; class Window; /** @@ -220,7 +218,7 @@ enum ImageAlign { #endif /* GLK_MODULE_IMAGE */ union gidispatch_rock_t { - glui32 num; + uint num; void *ptr; }; diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp index 1efc683ab0..3d16fed3db 100644 --- a/engines/glk/scott/scott.cpp +++ b/engines/glk/scott/scott.cpp @@ -516,7 +516,7 @@ Common::Error Scott::saveGameData(strid_t file, const Common::String &desc) { glk_put_string_stream(file, msg.c_str()); } - msg = Common::String::format("%u %d %hd %d %d %hd\n", + msg = Common::String::format("%u %d %d %d %d %d\n", _bitFlags, (_bitFlags & (1 << DARKBIT)) ? 1 : 0, MY_LOC, _currentCounter, _savedRoom, _gameHeader._lightTime); glk_put_string_stream(file, msg.c_str()); diff --git a/engines/glk/selection.cpp b/engines/glk/selection.cpp index 91097768ba..e5e853e50c 100644 --- a/engines/glk/selection.cpp +++ b/engines/glk/selection.cpp @@ -85,7 +85,7 @@ void WindowMask::resize(size_t x, size_t y) { _ver = y + 1; // allocate new storage - _links = new glui32 *[_hor]; + _links = new uint *[_hor]; if (!_links) { warning("resize_mask: out of memory"); _hor = _ver = 0; @@ -93,7 +93,7 @@ void WindowMask::resize(size_t x, size_t y) { } for (size_t i = 0; i < _hor; i++) { - _links[i] = new glui32[_ver]; + _links[i] = new uint[_ver]; if (!_links[i]) { warning("resize_mask: could not allocate new memory"); return; @@ -106,7 +106,7 @@ void WindowMask::resize(size_t x, size_t y) { _select.bottom = 0; } -void WindowMask::putHyperlink(glui32 linkval, uint x0, uint y0, uint x1, uint y1) { +void WindowMask::putHyperlink(uint linkval, uint x0, uint y0, uint x1, uint y1) { uint i, k; size_t tx0 = x0 < x1 ? x0 : x1; size_t tx1 = x0 < x1 ? x1 : x0; @@ -132,7 +132,7 @@ void WindowMask::putHyperlink(glui32 linkval, uint x0, uint y0, uint x1, uint y1 } } -glui32 WindowMask::getHyperlink(const Point &pos) const { +uint WindowMask::getHyperlink(const Point &pos) const { if (!_hor || !_ver) { warning("getHyperlink: struct not initialized"); return 0; diff --git a/engines/glk/selection.h b/engines/glk/selection.h index 10d6d5cdec..be124c5ab7 100644 --- a/engines/glk/selection.h +++ b/engines/glk/selection.h @@ -70,7 +70,7 @@ private: void clear(); public: size_t _hor, _ver; - glui32 **_links; + uint **_links; Rect _select; Point _last; public: @@ -89,9 +89,9 @@ public: */ void resize(size_t x, size_t y); - void putHyperlink(glui32 linkval, uint x0, uint y0, uint x1, uint y1); + void putHyperlink(uint linkval, uint x0, uint y0, uint x1, uint y1); - glui32 getHyperlink(const Point &pos) const; + uint getHyperlink(const Point &pos) const; }; /** diff --git a/engines/glk/sound.cpp b/engines/glk/sound.cpp index b2b07782db..1012c2040f 100644 --- a/engines/glk/sound.cpp +++ b/engines/glk/sound.cpp @@ -46,13 +46,13 @@ void Sounds::removeSound(schanid_t snd) { } } -schanid_t Sounds::create(glui32 rock) { +schanid_t Sounds::create(uint rock) { schanid_t snd = new SoundChannel(this); _sounds.push_back(snd); return snd; } -schanid_t Sounds::iterate(schanid_t chan, glui32 *rockptr) { +schanid_t Sounds::iterate(schanid_t chan, uint *rockptr) { for (int idx = 0; idx < (int)_sounds.size() - 1; ++idx) { if (_sounds[idx] == chan) { schanid_t next = _sounds[idx + 1]; @@ -82,7 +82,7 @@ SoundChannel::~SoundChannel() { _owner->removeSound(this); } -glui32 SoundChannel::play(glui32 soundNum, glui32 repeats, glui32 notify) { +uint SoundChannel::play(uint soundNum, uint repeats, uint notify) { stop(); if (repeats == 0) return 1; @@ -148,7 +148,7 @@ void SoundChannel::stop() { void SoundChannel::poll() { if (!g_vm->_mixer->isSoundHandleActive(_handle) && _notify != 0) { - glui32 notify = _notify; + uint notify = _notify; _notify = 0; g_vm->_events->store(evtype_SoundNotify, nullptr, _soundNum, notify); } diff --git a/engines/glk/sound.h b/engines/glk/sound.h index 9635302b8d..337239b761 100644 --- a/engines/glk/sound.h +++ b/engines/glk/sound.h @@ -38,11 +38,11 @@ class Sounds; class SoundChannel { private: Sounds *_owner; - glui32 _soundNum; - glui32 _notify; + uint _soundNum; + uint _notify; Audio::SoundHandle _handle; public: - glui32 _rock; + uint _rock; public: /** * Constructor @@ -57,7 +57,7 @@ public: /** * Play a sound */ - glui32 play(glui32 soundNum, glui32 repeats = 1, glui32 notify = 0); + uint play(uint soundNum, uint repeats = 1, uint notify = 0); /** * Stop playing sound @@ -108,12 +108,12 @@ public: /** * Create a new channel */ - schanid_t create(glui32 rock = 0); + schanid_t create(uint rock = 0); /** * Used to iterate over the current list of sound channels */ - schanid_t iterate(schanid_t chan, glui32 *rockptr = nullptr); + schanid_t iterate(schanid_t chan, uint *rockptr = nullptr); /** * Poll for whether any playing sounds are finished diff --git a/engines/glk/speech.h b/engines/glk/speech.h index df4a89edc5..43f929cc1d 100644 --- a/engines/glk/speech.h +++ b/engines/glk/speech.h @@ -39,7 +39,7 @@ protected: void gli_tts_purge(void) {} - void gli_tts_speak(const glui32 *buf, size_t len) {} + void gli_tts_speak(const uint *buf, size_t len) {} void gli_free_tts(void) {} }; diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp index 42aa79060e..e52006069c 100644 --- a/engines/glk/streams.cpp +++ b/engines/glk/streams.cpp @@ -64,7 +64,7 @@ void Stream::close(StreamResult *result) { delete this; } -void Stream::setZColors(glui32 fg, glui32 bg) { +void Stream::setZColors(uint fg, uint bg) { if (_writable && g_conf->_styleHint) Windows::_forceRedraw = true; } @@ -163,7 +163,7 @@ void WindowStream::putBufferUni(const uint32 *buf, size_t len) { } void WindowStream::unputBuffer(const char *buf, size_t len) { - glui32 lx; + uint lx; const char *cx; if (!_writable) @@ -188,9 +188,9 @@ void WindowStream::unputBuffer(const char *buf, size_t len) { _window->_echoStream->unputBuffer(buf, len); } -void WindowStream::unputBufferUni(const glui32 *buf, size_t len) { - glui32 lx; - const glui32 *cx; +void WindowStream::unputBufferUni(const uint *buf, size_t len) { + uint lx; + const uint *cx; if (!_writable) return; @@ -215,7 +215,7 @@ void WindowStream::unputBufferUni(const glui32 *buf, size_t len) { _window->_echoStream->unputBufferUni(buf, len); } -void WindowStream::setStyle(glui32 val) { +void WindowStream::setStyle(uint val) { if (!_writable) return; @@ -227,12 +227,12 @@ void WindowStream::setStyle(glui32 val) { _window->_echoStream->setStyle(val); } -void WindowStream::setHyperlink(glui32 linkVal) { +void WindowStream::setHyperlink(uint linkVal) { if (_writable) _window->_attr.hyper = linkVal; } -void WindowStream::setZColors(glui32 fg, glui32 bg) { +void WindowStream::setZColors(uint fg, uint bg) { if (!_writable || !g_conf->_styleHint) return; @@ -326,8 +326,8 @@ void MemoryStream::putChar(unsigned char ch) { if (_bufPtr < _bufEnd) { if (_unicode) { - *((glui32 *)_bufPtr) = ch; - _bufPtr = ((glui32 *)_bufPtr) + 1; + *((uint *)_bufPtr) = ch; + _bufPtr = ((uint *)_bufPtr) + 1; } else { *((unsigned char *)_bufPtr) = ch; _bufPtr = ((unsigned char *)_bufPtr) + 1; @@ -345,8 +345,8 @@ void MemoryStream::putCharUni(uint32 ch) { if (_bufPtr < _bufEnd) { if (_unicode) { - *((glui32 *)_bufPtr) = ch; - _bufPtr = ((glui32 *)_bufPtr) + 1; + *((uint *)_bufPtr) = ch; + _bufPtr = ((uint *)_bufPtr) + 1; } else { *((unsigned char *)_bufPtr) = (unsigned char)ch; _bufPtr = ((unsigned char *)_bufPtr) + 1; @@ -383,20 +383,20 @@ void MemoryStream::putBuffer(const char *buf, size_t len) { } _bufPtr = bp; } else { - glui32 *bp = (glui32 *)_bufPtr; - if (bp + len > (glui32 *)_bufEnd) { - lx = (bp + len) - (glui32 *)_bufEnd; + uint *bp = (uint *)_bufPtr; + if (bp + len > (uint *)_bufEnd) { + lx = (bp + len) - (uint *)_bufEnd; if (lx < len) len -= lx; else len = 0; } if (len) { - glui32 i; + uint i; for (i = 0; i < len; i++) bp[i] = buf[i]; bp += len; - if (bp > (glui32 *)_bufEof) + if (bp > (uint *)_bufEof) _bufEof = bp; } _bufPtr = bp; @@ -424,9 +424,9 @@ void MemoryStream::putBufferUni(const uint32 *buf, size_t len) { len = 0; } if (len) { - glui32 i; + uint i; for (i = 0; i < len; i++) { - glui32 ch = buf[i]; + uint ch = buf[i]; if (ch > 0xff) ch = '?'; bp[i] = (unsigned char)ch; @@ -437,9 +437,9 @@ void MemoryStream::putBufferUni(const uint32 *buf, size_t len) { } _bufPtr = bp; } else { - glui32 *bp = (glui32 *)_bufPtr; - if (bp + len > (glui32 *)_bufEnd) { - lx = (bp + len) - (glui32 *)_bufEnd; + uint *bp = (uint *)_bufPtr; + if (bp + len > (uint *)_bufEnd) { + lx = (bp + len) - (uint *)_bufEnd; if (lx < len) len -= lx; else @@ -448,7 +448,7 @@ void MemoryStream::putBufferUni(const uint32 *buf, size_t len) { if (len) { memmove(bp, buf, len * 4); bp += len; - if (bp > (glui32 *)_bufEof) + if (bp > (uint *)_bufEof) _bufEof = bp; } _bufPtr = bp; @@ -456,14 +456,14 @@ void MemoryStream::putBufferUni(const uint32 *buf, size_t len) { } } -glui32 MemoryStream::getPosition() const { +uint MemoryStream::getPosition() const { if (_unicode) - return ((glui32 *)_bufPtr - (glui32 *)_buf); + return ((uint *)_bufPtr - (uint *)_buf); else return ((unsigned char *)_bufPtr - (unsigned char *)_buf); } -void MemoryStream::setPosition(glsi32 pos, glui32 seekMode) { +void MemoryStream::setPosition(int pos, uint seekMode) { if (!_unicode) { if (seekMode == seekmode_Current) pos = ((unsigned char *)_bufPtr - (unsigned char *)_buf) + pos; @@ -480,19 +480,19 @@ void MemoryStream::setPosition(glsi32 pos, glui32 seekMode) { _bufPtr = (unsigned char *)_buf + pos; } else { if (seekMode == seekmode_Current) - pos = ((glui32 *)_bufPtr - (glui32 *)_buf) + pos; + pos = ((uint *)_bufPtr - (uint *)_buf) + pos; else if (seekMode == seekmode_End) - pos = ((glui32 *)_bufEof - (glui32 *)_buf) + pos; + pos = ((uint *)_bufEof - (uint *)_buf) + pos; if (pos < 0) pos = 0; - if (pos > ((glui32 *)_bufEof - (glui32 *)_buf)) - pos = ((glui32 *)_bufEof - (glui32 *)_buf); - _bufPtr = (glui32 *)_buf + pos; + if (pos > ((uint *)_bufEof - (uint *)_buf)) + pos = ((uint *)_bufEof - (uint *)_buf); + _bufPtr = (uint *)_buf + pos; } } -glsi32 MemoryStream::getChar() { +int MemoryStream::getChar() { if (!_readable) return -1; @@ -504,9 +504,9 @@ glsi32 MemoryStream::getChar() { _readCount++; return ch; } else { - glui32 ch; - ch = *((glui32 *)_bufPtr); - _bufPtr = ((glui32 *)_bufPtr) + 1; + uint ch; + ch = *((uint *)_bufPtr); + _bufPtr = ((uint *)_bufPtr) + 1; _readCount++; if (ch > 0xff) ch = '?'; @@ -517,7 +517,7 @@ glsi32 MemoryStream::getChar() { } } -glsi32 MemoryStream::getCharUni() { +int MemoryStream::getCharUni() { if (!_readable) return -1; @@ -529,9 +529,9 @@ glsi32 MemoryStream::getCharUni() { _readCount++; return ch; } else { - glui32 ch; - ch = *((glui32 *)_bufPtr); - _bufPtr = ((glui32 *)_bufPtr) + 1; + uint ch; + ch = *((uint *)_bufPtr); + _bufPtr = ((uint *)_bufPtr) + 1; _readCount++; return ch; } @@ -540,7 +540,7 @@ glsi32 MemoryStream::getCharUni() { } } -glui32 MemoryStream::getBuffer(char *buf, glui32 len) { +uint MemoryStream::getBuffer(char *buf, uint len) { if (!_readable) return 0; @@ -550,7 +550,7 @@ glui32 MemoryStream::getBuffer(char *buf, glui32 len) { if (!_unicode) { unsigned char *bp = (unsigned char *)_bufPtr; if (bp + len > (unsigned char *)_bufEnd) { - glui32 lx; + uint lx; lx = (bp + len) - (unsigned char *)_bufEnd; if (lx < len) len -= lx; @@ -568,24 +568,24 @@ glui32 MemoryStream::getBuffer(char *buf, glui32 len) { _readCount += len; _bufPtr = bp; } else { - glui32 *bp = (glui32 *)_bufPtr; - if (bp + len > (glui32 *)_bufEnd) { - glui32 lx; - lx = (bp + len) - (glui32 *)_bufEnd; + uint *bp = (uint *)_bufPtr; + if (bp + len > (uint *)_bufEnd) { + uint lx; + lx = (bp + len) - (uint *)_bufEnd; if (lx < len) len -= lx; else len = 0; } if (len) { - glui32 i; + uint i; for (i = 0; i < len; i++) { - glui32 ch = *bp++; + uint ch = *bp++; if (ch > 0xff) ch = '?'; *buf++ = (char)ch; } - if (bp > (glui32 *)_bufEof) + if (bp > (uint *)_bufEof) _bufEof = bp; } @@ -597,7 +597,7 @@ glui32 MemoryStream::getBuffer(char *buf, glui32 len) { return len; } -glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { +uint MemoryStream::getBufferUni(uint *buf, uint len) { if (!_readable) return 0; @@ -607,7 +607,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { if (!_unicode) { unsigned char *bp = (unsigned char *)_bufPtr; if (bp + len > (unsigned char *)_bufEnd) { - glui32 lx; + uint lx; lx = (bp + len) - (unsigned char *)_bufEnd; if (lx < len) len -= lx; @@ -615,7 +615,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { len = 0; } if (len) { - glui32 i; + uint i; for (i = 0; i < len; i++) buf[i] = bp[i]; bp += len; @@ -625,10 +625,10 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { _readCount += len; _bufPtr = bp; } else { - glui32 *bp = (glui32 *)_bufPtr; - if (bp + len > (glui32 *)_bufEnd) { - glui32 lx; - lx = (bp + len) - (glui32 *)_bufEnd; + uint *bp = (uint *)_bufPtr; + if (bp + len > (uint *)_bufEnd) { + uint lx; + lx = (bp + len) - (uint *)_bufEnd; if (lx < len) len -= lx; else @@ -637,7 +637,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { if (len) { memcpy(buf, bp, len * 4); bp += len; - if (bp > (glui32 *)_bufEof) + if (bp > (uint *)_bufEof) _bufEof = bp; } _readCount += len; @@ -648,8 +648,8 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { return len; } -glui32 MemoryStream::getLine(char *buf, glui32 len) { - glui32 lx; +uint MemoryStream::getLine(char *buf, uint len) { + uint lx; bool gotNewline; if (len == 0) @@ -692,8 +692,8 @@ glui32 MemoryStream::getLine(char *buf, glui32 len) { gotNewline = false; for (lx = 0; lx < len && !gotNewline; lx++) { - glui32 ch; - ch = ((glui32 *)_bufPtr)[lx]; + uint ch; + ch = ((uint *)_bufPtr)[lx]; if (ch >= 0x100) ch = '?'; buf[lx] = (char)ch; @@ -701,14 +701,14 @@ glui32 MemoryStream::getLine(char *buf, glui32 len) { } buf[lx] = '\0'; - _bufPtr = ((glui32 *)_bufPtr) + lx; + _bufPtr = ((uint *)_bufPtr) + lx; } _readCount += lx; return lx; } -glui32 MemoryStream::getLineUni(glui32 *ubuf, glui32 len) { +uint MemoryStream::getLineUni(uint *ubuf, uint len) { bool gotNewline; int lx; @@ -739,8 +739,8 @@ glui32 MemoryStream::getLineUni(glui32 *ubuf, glui32 len) { if (_bufPtr >= _bufEnd) { len = 0; } else { - if ((glui32 *)_bufPtr + len > (glui32 *)_bufEnd) { - lx = ((glui32 *)_bufPtr + len) - (glui32 *)_bufEnd; + if ((uint *)_bufPtr + len > (uint *)_bufEnd) { + lx = ((uint *)_bufPtr + len) - (uint *)_bufEnd; if (lx < (int)len) len -= lx; else @@ -749,13 +749,13 @@ glui32 MemoryStream::getLineUni(glui32 *ubuf, glui32 len) { } gotNewline = false; for (lx = 0; lx < (int)len && !gotNewline; lx++) { - glui32 ch; - ch = ((glui32 *)_bufPtr)[lx]; + uint ch; + ch = ((uint *)_bufPtr)[lx]; ubuf[lx] = ch; gotNewline = (ch == '\n'); } ubuf[lx] = '\0'; - _bufPtr = ((glui32 *)_bufPtr) + lx; + _bufPtr = ((uint *)_bufPtr) + lx; } _readCount += lx; @@ -764,7 +764,7 @@ glui32 MemoryStream::getLineUni(glui32 *ubuf, glui32 len) { /*--------------------------------------------------------------------------*/ -FileStream::FileStream(Streams *streams, frefid_t fref, glui32 fmode, glui32 rock, bool unicode) : +FileStream::FileStream(Streams *streams, frefid_t fref, uint fmode, uint rock, bool unicode) : Stream(streams, fmode == filemode_Read, fmode != filemode_Read, rock, unicode), _lastOp(0), _textFile(fref->_textMode), _inFile(nullptr), _outFile(nullptr), _inStream(nullptr) { Common::String fname = fref->_slotNumber == -1 ? fref->_filename : fref->getSaveName(); @@ -830,7 +830,7 @@ void FileStream::putChar(unsigned char ch) { if (!_unicode) { _outFile->writeByte(ch); } else if (_textFile) { - putCharUtf8((glui32)ch); + putCharUtf8((uint)ch); } else { _outFile->writeUint32BE(ch); } @@ -868,7 +868,7 @@ void FileStream::putBuffer(const char *buf, size_t len) { if (!_unicode) { _outFile->writeByte(ch); } else if (_textFile) { - putCharUtf8((glui32)ch); + putCharUtf8((uint)ch); } else { _outFile->writeUint32BE(ch); } @@ -885,7 +885,7 @@ void FileStream::putBufferUni(const uint32 *buf, size_t len) { ensureOp(filemode_Write); for (size_t lx = 0; lx < len; lx++) { - glui32 ch = buf[lx]; + uint ch = buf[lx]; if (!_unicode) { if (ch >= 0x100) ch = '?'; @@ -900,7 +900,7 @@ void FileStream::putBufferUni(const uint32 *buf, size_t len) { _outFile->flush(); } -void FileStream::putCharUtf8(glui32 val) { +void FileStream::putCharUtf8(uint val) { if (val < 0x80) { _outFile->writeByte(val); } else if (val < 0x800) { @@ -920,9 +920,9 @@ void FileStream::putCharUtf8(glui32 val) { } } -glsi32 FileStream::getCharUtf8() { - glui32 res; - glui32 val0, val1, val2, val3; +int FileStream::getCharUtf8() { + uint res; + uint val0, val1, val2, val3; if (_inStream->eos()) return -1; @@ -1008,11 +1008,11 @@ glsi32 FileStream::getCharUtf8() { return '?'; } -glui32 FileStream::getPosition() const { +uint FileStream::getPosition() const { return _outFile ? _outFile->pos() : _inStream->pos(); } -void FileStream::setPosition(glsi32 pos, glui32 seekMode) { +void FileStream::setPosition(int pos, uint seekMode) { _lastOp = 0; if (_unicode) pos *= 4; @@ -1024,7 +1024,7 @@ void FileStream::setPosition(glsi32 pos, glui32 seekMode) { } } -glsi32 FileStream::getChar() { +int FileStream::getChar() { if (!_readable) return -1; @@ -1035,7 +1035,7 @@ glsi32 FileStream::getChar() { } else if (_textFile) { res = getCharUtf8(); } else { - glui32 ch; + uint ch; res = _inStream->readByte(); if (_inStream->eos()) return -1; @@ -1058,13 +1058,13 @@ glsi32 FileStream::getChar() { _readCount++; if (res >= 0x100) return '?'; - return (glsi32)res; + return (int)res; } else { return -1; } } -glsi32 FileStream::getCharUni() { +int FileStream::getCharUni() { if (!_readable) return -1; @@ -1075,7 +1075,7 @@ glsi32 FileStream::getCharUni() { } else if (_textFile) { res = getCharUtf8(); } else { - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) return -1; @@ -1096,25 +1096,25 @@ glsi32 FileStream::getCharUni() { } if (res != -1) { _readCount++; - return (glsi32)res; + return (int)res; } else { return -1; } } -glui32 FileStream::getBuffer(char *buf, glui32 len) { +uint FileStream::getBuffer(char *buf, uint len) { ensureOp(filemode_Read); if (!_unicode) { - glui32 res; + uint res; res = _inStream->read(buf, len); _readCount += res; return res; } else if (_textFile) { - glui32 lx; + uint lx; for (lx = 0; lx < len; lx++) { - glui32 ch; + uint ch; ch = getCharUtf8(); - if (ch == (glui32)-1) + if (ch == (uint)-1) break; _readCount++; if (ch >= 0x100) @@ -1123,10 +1123,10 @@ glui32 FileStream::getBuffer(char *buf, glui32 len) { } return lx; } else { - glui32 lx; + uint lx; for (lx = 0; lx < len; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1152,16 +1152,16 @@ glui32 FileStream::getBuffer(char *buf, glui32 len) { } } -glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { +uint FileStream::getBufferUni(uint *buf, uint len) { if (!_readable) return 0; ensureOp(filemode_Read); if (!_unicode) { - glui32 lx; + uint lx; for (lx = 0; lx < len; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1171,21 +1171,21 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { } return lx; } else if (_textFile) { - glui32 lx; + uint lx; for (lx = 0; lx < len; lx++) { - glui32 ch; + uint ch; ch = getCharUtf8(); - if (ch == (glui32)-1) + if (ch == (uint)-1) break; _readCount++; buf[lx] = ch; } return lx; } else { - glui32 lx; + uint lx; for (lx = 0; lx < len; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1209,8 +1209,8 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { } } -glui32 FileStream::getLine(char *buf, glui32 len) { - glui32 lx; +uint FileStream::getLine(char *buf, uint len) { + uint lx; bool gotNewline; if (len == 0) @@ -1233,9 +1233,9 @@ glui32 FileStream::getLine(char *buf, glui32 len) { len -= 1; // for the terminal null gotNewline = false; for (lx = 0; lx < len && !gotNewline; lx++) { - glui32 ch; + uint ch; ch = getCharUtf8(); - if (ch == (glui32)-1) + if (ch == (uint)-1) break; _readCount++; if (ch >= 0x100) @@ -1250,7 +1250,7 @@ glui32 FileStream::getLine(char *buf, glui32 len) { gotNewline = false; for (lx = 0; lx < len && !gotNewline; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1279,7 +1279,7 @@ glui32 FileStream::getLine(char *buf, glui32 len) { } } -glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) { +uint FileStream::getLineUni(uint *ubuf, uint len) { bool gotNewline; int lx; @@ -1292,7 +1292,7 @@ glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) { gotNewline = false; for (lx = 0; lx < (int)len && !gotNewline; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1307,9 +1307,9 @@ glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) { len -= 1; // for the terminal null gotNewline = false; for (lx = 0; lx < (int)len && !gotNewline; lx++) { - glui32 ch; + uint ch; ch = getCharUtf8(); - if (ch == (glui32)-1) + if (ch == (uint)-1) break; _readCount++; ubuf[lx] = ch; @@ -1322,7 +1322,7 @@ glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) { gotNewline = false; for (lx = 0; lx < (int)len && !gotNewline; lx++) { int res; - glui32 ch; + uint ch; res = _inStream->readByte(); if (res == -1) break; @@ -1427,7 +1427,7 @@ Streams::~Streams() { } } -FileStream *Streams::openFileStream(frefid_t fref, glui32 fmode, glui32 rock, bool unicode) { +FileStream *Streams::openFileStream(frefid_t fref, uint fmode, uint rock, bool unicode) { FileStream *stream = new FileStream(this, fref, fmode, rock, unicode); addStream(stream); return stream; @@ -1477,7 +1477,7 @@ Stream *Streams::getFirst(uint32 *rock) { } -frefid_t Streams::createByPrompt(glui32 usage, FileMode fmode, glui32 rock) { +frefid_t Streams::createByPrompt(uint usage, FileMode fmode, uint rock) { switch (usage & fileusage_TypeMask) { case fileusage_SavedGame: { if (fmode == filemode_Write) { @@ -1514,7 +1514,7 @@ frefid_t Streams::createByPrompt(glui32 usage, FileMode fmode, glui32 rock) { return nullptr; } -frefid_t Streams::createRef(int slot, const Common::String &desc, glui32 usage, glui32 rock) { +frefid_t Streams::createRef(int slot, const Common::String &desc, uint usage, uint rock) { frefid_t fref = new FileReference(); fref->_slotNumber = slot; fref->_description = desc; @@ -1525,7 +1525,7 @@ frefid_t Streams::createRef(int slot, const Common::String &desc, glui32 usage, return fref; } -frefid_t Streams::createRef(const Common::String &filename, glui32 usage, glui32 rock) { +frefid_t Streams::createRef(const Common::String &filename, uint usage, uint rock) { frefid_t fref = new FileReference(); fref->_filename = filename; fref->_textMode = ((usage & fileusage_TextMode) != 0); @@ -1535,12 +1535,12 @@ frefid_t Streams::createRef(const Common::String &filename, glui32 usage, glui32 return fref; } -frefid_t Streams::createTemp(glui32 usage, glui32 rock) { +frefid_t Streams::createTemp(uint usage, uint rock) { return createRef(Common::String::format("%s.tmp", g_vm->getTargetName().c_str()), usage, rock); } -frefid_t Streams::createFromRef(frefid_t fref, glui32 usage, glui32 rock) { +frefid_t Streams::createFromRef(frefid_t fref, uint usage, uint rock) { return createRef(fref->_filename, usage, rock); } @@ -1553,7 +1553,7 @@ void Streams::deleteRef(frefid_t fref) { } } -frefid_t Streams::iterate(frefid_t fref, glui32 *rock) { +frefid_t Streams::iterate(frefid_t fref, uint *rock) { // Find reference following the specified one int index = -1; for (uint idx = 0; idx < _fileReferences.size(); ++idx) { diff --git a/engines/glk/streams.h b/engines/glk/streams.h index 8d72c57ff3..4f518ff52c 100644 --- a/engines/glk/streams.h +++ b/engines/glk/streams.h @@ -87,7 +87,7 @@ struct SavegameHeader { * File details */ struct FileReference { - glui32 _rock; + uint _rock; int _slotNumber; Common::String _description; Common::String _filename; @@ -103,7 +103,7 @@ struct FileReference { /** * Constructor */ - FileReference(int slot, const Common::String &desc, glui32 usage, glui32 rock = 0) : + FileReference(int slot, const Common::String &desc, uint usage, uint rock = 0) : _rock(rock), _slotNumber(slot), _description(desc), _fileType((FileUsage)(usage & fileusage_TypeMask)), _textMode(usage & fileusage_TextMode) {} @@ -181,7 +181,7 @@ public: /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) = 0; + virtual void putCharUni(uint ch) = 0; /** * Write a buffer @@ -191,7 +191,7 @@ public: /** * Write a unicode character */ - virtual void putBufferUni(const glui32 *buf, size_t len) = 0; + virtual void putBufferUni(const uint *buf, size_t len) = 0; /** * Remove a string from the end of the stream, if indeed it is at the end @@ -201,12 +201,12 @@ public: /** * Remove a string from the end of the stream, if indeed it is at the end */ - virtual void unputBufferUni(const glui32 *buf, size_t len) {} + virtual void unputBufferUni(const uint *buf, size_t len) {} /** * Send a line to the stream with a trailing newline */ - void echoLine(const char *buf, glui32 len) { + void echoLine(const char *buf, uint len) { putBuffer(buf, len); putChar('\n'); }; @@ -214,70 +214,70 @@ public: /** * Send a line to the stream with a trailing newline */ - void echoLineUni(const glui32 *buf, glui32 len) { + void echoLineUni(const uint *buf, uint len) { putBufferUni(buf, len); putCharUni('\n'); } - virtual glui32 getPosition() const { + virtual uint getPosition() const { return 0; } - virtual void setPosition(glsi32 pos, glui32 seekMode) {} + virtual void setPosition(int pos, uint seekMode) {} - virtual void setStyle(glui32 val) {} + virtual void setStyle(uint val) {} /** * Get a character from the stream */ - virtual glsi32 getChar() { + virtual int getChar() { return -1; } /** * Get a unicode character from the stream */ - virtual glsi32 getCharUni() { + virtual int getCharUni() { return -1; } /** * Get a buffer */ - virtual glui32 getBuffer(char *buf, glui32 len) { + virtual uint getBuffer(char *buf, uint len) { return 0; } /** * Get a unicode buffer */ - virtual glui32 getBufferUni(glui32 *buf, glui32 len) { + virtual uint getBufferUni(uint *buf, uint len) { return 0; } /** * Get a line */ - virtual glui32 getLine(char *buf, glui32 len) { + virtual uint getLine(char *buf, uint len) { return 0; } /** * Get a unicode line */ - virtual glui32 getLineUni(glui32 *ubuf, glui32 len) { + virtual uint getLineUni(uint *ubuf, uint len) { return 0; } /** * Set a hyperlink */ - virtual void setHyperlink(glui32 linkVal) {} + virtual void setHyperlink(uint linkVal) {} /** * Set the style colors */ - virtual void setZColors(glui32 fg, glui32 bg); + virtual void setZColors(uint fg, uint bg); /** * Set the reverse video style @@ -327,7 +327,7 @@ public: /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) override; + virtual void putCharUni(uint ch) override; /** * Write a buffer @@ -337,7 +337,7 @@ public: /** * Write a unicode character */ - virtual void putBufferUni(const glui32 *buf, size_t len) override; + virtual void putBufferUni(const uint *buf, size_t len) override; /** * Remove a string from the end of the stream, if indeed it is at the end @@ -347,19 +347,19 @@ public: /** * Remove a string from the end of the stream, if indeed it is at the end */ - virtual void unputBufferUni(const glui32 *buf, size_t len) override; + virtual void unputBufferUni(const uint *buf, size_t len) override; - virtual void setStyle(glui32 val) override; + virtual void setStyle(uint val) override; /** * Set a hyperlink */ - virtual void setHyperlink(glui32 linkVal) override; + virtual void setHyperlink(uint linkVal) override; /** * Set the style colors */ - virtual void setZColors(glui32 fg, glui32 bg) override; + virtual void setZColors(uint fg, uint bg) override; /** * Set the reverse video style @@ -372,7 +372,7 @@ public: */ class MemoryStream : public Stream { private: - void *_buf; ///< unsigned char* for latin1, glui32* for unicode + void *_buf; ///< unsigned char* for latin1, uint* for unicode void *_bufPtr; void *_bufEnd; void *_bufEof; @@ -391,7 +391,7 @@ public: /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) override; + virtual void putCharUni(uint ch) override; /** * Write a buffer @@ -401,41 +401,41 @@ public: /** * Write a unicode character */ - virtual void putBufferUni(const glui32 *buf, size_t len) override; + virtual void putBufferUni(const uint *buf, size_t len) override; - virtual glui32 getPosition() const override; + virtual uint getPosition() const override; - virtual void setPosition(glsi32 pos, glui32 seekMode) override; + virtual void setPosition(int pos, uint seekMode) override; /** * Get a character from the stream */ - virtual glsi32 getChar() override; + virtual int getChar() override; /** * Get a unicode character from the stream */ - virtual glsi32 getCharUni() override; + virtual int getCharUni() override; /** * Get a buffer */ - virtual glui32 getBuffer(char *buf, glui32 len) override; + virtual uint getBuffer(char *buf, uint len) override; /** * Get a unicode buffer */ - virtual glui32 getBufferUni(glui32 *buf, glui32 len) override; + virtual uint getBufferUni(uint *buf, uint len) override; /** * Get a line */ - virtual glui32 getLine(char *buf, glui32 len) override; + virtual uint getLine(char *buf, uint len) override; /** * Get a unicode line */ - virtual glui32 getLineUni(glui32 *ubuf, glui32 len) override; + virtual uint getLineUni(uint *ubuf, uint len) override; }; /** @@ -458,12 +458,12 @@ private: /** * Put a UTF8 character */ - void putCharUtf8(glui32 val); + void putCharUtf8(uint val); /** * Get a UTF8 character */ - glsi32 getCharUtf8(); + int getCharUtf8(); public: /** * Read a savegame header from a stream @@ -478,7 +478,7 @@ public: /** * Constructor */ - FileStream(Streams *streams, frefid_t fref, glui32 fmode, glui32 rock, bool unicode); + FileStream(Streams *streams, frefid_t fref, uint fmode, uint rock, bool unicode); /** * Destructor @@ -493,7 +493,7 @@ public: /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) override; + virtual void putCharUni(uint ch) override; /** * Write a buffer @@ -503,41 +503,41 @@ public: /** * Write a unicode character */ - virtual void putBufferUni(const glui32 *buf, size_t len) override; + virtual void putBufferUni(const uint *buf, size_t len) override; - virtual glui32 getPosition() const override; + virtual uint getPosition() const override; - virtual void setPosition(glsi32 pos, glui32 seekMode) override; + virtual void setPosition(int pos, uint seekMode) override; /** * Get a character from the stream */ - virtual glsi32 getChar() override; + virtual int getChar() override; /** * Get a unicode character from the stream */ - virtual glsi32 getCharUni() override; + virtual int getCharUni() override; /** * Get a buffer */ - virtual glui32 getBuffer(char *buf, glui32 len) override; + virtual uint getBuffer(char *buf, uint len) override; /** * Get a unicode buffer */ - virtual glui32 getBufferUni(glui32 *buf, glui32 len) override; + virtual uint getBufferUni(uint *buf, uint len) override; /** * Get a line */ - virtual glui32 getLine(char *buf, glui32 len) override; + virtual uint getLine(char *buf, uint len) override; /** * Get a unicode line */ - virtual glui32 getLineUni(glui32 *ubuf, glui32 len) override; + virtual uint getLineUni(uint *ubuf, uint len) override; /** * Cast a stream to a ScummVM write stream @@ -583,7 +583,7 @@ public: /** * Open a file stream */ - FileStream *openFileStream(frefid_t fref, glui32 fmode, glui32 rock = 0, bool unicode = false); + FileStream *openFileStream(frefid_t fref, uint fmode, uint rock = 0, bool unicode = false); /** * Open a window stream @@ -625,27 +625,27 @@ public: /** * Prompt for a savegame to load or save, and populate a file reference from the result */ - frefid_t createByPrompt(glui32 usage, FileMode fmode, glui32 rock); + frefid_t createByPrompt(uint usage, FileMode fmode, uint rock); /** * Create a new file reference */ - frefid_t createRef(int slot, const Common::String &desc, glui32 usage, glui32 rock); + frefid_t createRef(int slot, const Common::String &desc, uint usage, uint rock); /** * Create a new file reference */ - frefid_t createRef(const Common::String &filename, glui32 usage, glui32 rock); + frefid_t createRef(const Common::String &filename, uint usage, uint rock); /** * Create a new temporary file reference */ - frefid_t createTemp(glui32 usage, glui32 rock); + frefid_t createTemp(uint usage, uint rock); /** * Create a new file reference from an old one */ - frefid_t createFromRef(frefid_t fref, glui32 usage, glui32 rock); + frefid_t createFromRef(frefid_t fref, uint usage, uint rock); /** * Delete a file reference @@ -656,7 +656,7 @@ public: * Iterates to the next file reference following the specified one, * or the first if null is passed */ - frefid_t iterate(frefid_t fref, glui32 *rock); + frefid_t iterate(frefid_t fref, uint *rock); }; } // End of namespace Glk diff --git a/engines/glk/tads/tads.h b/engines/glk/tads/tads.h index ec9ea93f7d..49f59f5bf5 100644 --- a/engines/glk/tads/tads.h +++ b/engines/glk/tads/tads.h @@ -35,8 +35,8 @@ namespace TADS { class TADS : public GlkAPI { protected: winid_t story_win, status_win; - glui32 mainfg, mainbg; - glui32 statusfg, statusbg; + uint mainfg, mainbg; + uint statusfg, statusbg; public: /** * Constructor diff --git a/engines/glk/tads/tads2/os.cpp b/engines/glk/tads/tads2/os.cpp index 17bdc346e5..15a291a87b 100644 --- a/engines/glk/tads/tads2/os.cpp +++ b/engines/glk/tads/tads2/os.cpp @@ -36,13 +36,13 @@ void OS::os_terminate(int rc) { glk_exit(); } -glui32 OS::oss_convert_prompt_type(int type) { +uint OS::oss_convert_prompt_type(int type) { if (type == OS_AFP_OPEN) return filemode_Read; return filemode_ReadWrite; } -glui32 OS::oss_convert_file_type(int type) { +uint OS::oss_convert_file_type(int type) { if (type == OSFTSAVE) return fileusage_SavedGame; if (type == OSFTLOG || type == OSFTTEXT) @@ -50,15 +50,15 @@ glui32 OS::oss_convert_file_type(int type) { return fileusage_Data; } -glui32 OS::oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, int buf_len) { +uint OS::oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, int buf_len) { #ifdef TODO char temp_string[32]; - glui32 value, i = 0, digit, + uint value, i = 0, digit, digit_flag = false, // Have we put a digit in the string yet? divisor = 1e9; // The max 32-bit integer is 4294967295 // This could probably be done by using sprintf("%s%ld%s") but I don't want to risk it - value = (glui32)file_to_convert; + value = (uint)file_to_convert; while (divisor != 1) { digit = (char)(value / divisor); if (digit != 0 || digit_flag) { // This lets us handle, eg, 102 @@ -79,10 +79,10 @@ glui32 OS::oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, return true; } -frefid_t OS::oss_convert_string_to_fileref(char *buffer, glui32 usage) { +frefid_t OS::oss_convert_string_to_fileref(char *buffer, uint usage) { #ifdef TODO char temp_string[32]; - glui32 value = 0, i, multiplier = 1; + uint value = 0, i, multiplier = 1; // Does the buffer contain a hashed fileref? if (oss_is_string_a_fileref(buffer)) { @@ -92,7 +92,7 @@ frefid_t OS::oss_convert_string_to_fileref(char *buffer, glui32 usage) { temp_string[i] = 0; while (i != 0) { i--; - value += ((glui32)(temp_string[i] - '0') * multiplier); + value += ((uint)(temp_string[i] - '0') * multiplier); multiplier *= 10; } return ((frefid_t)value); @@ -115,7 +115,7 @@ bool OS::oss_is_string_a_fileref(char *buffer) { return false; } -unsigned char OS::oss_convert_keystroke_to_tads(glui32 key) { +unsigned char OS::oss_convert_keystroke_to_tads(uint key) { // Characters 0 - 255 we return per normal */ if (key <= 255) return ((unsigned char)key); @@ -169,8 +169,8 @@ void OS::oss_revert_path() { // No implementation } -osfildef *OS::oss_open_stream(char *buffer, glui32 tadsusage, glui32 tbusage, - glui32 fmode, glui32 rock) { +osfildef *OS::oss_open_stream(char *buffer, uint tadsusage, uint tbusage, + uint fmode, uint rock) { frefid_t fileref; strid_t osf; int changed_dirs; @@ -226,7 +226,7 @@ void OS::oss_put_string_with_hilite(winid_t win, const char *str, size_t len) { } void OS::oss_draw_status_line(void) { - glui32 width, height, division; + uint width, height, division; if (status_win == nullptr) return; // In case this is a CheapGlk port diff --git a/engines/glk/tads/tads2/os.h b/engines/glk/tads/tads2/os.h index ecd046858e..45ab804f95 100644 --- a/engines/glk/tads/tads2/os.h +++ b/engines/glk/tads/tads2/os.h @@ -57,12 +57,12 @@ protected: /** * Change a TADS prompt type (OS_AFP_*) into a Glk prompt type. */ - glui32 oss_convert_prompt_type(int type); + uint oss_convert_prompt_type(int type); /** * Change a TADS file type (OSFT*) into a Glk file type. */ - glui32 oss_convert_file_type(int type); + uint oss_convert_file_type(int type); /** * Change a fileref ID (frefid_t) to a special string and put it in the @@ -73,7 +73,7 @@ protected: * 64-bit pointers I'll have to start using a hash table or use hex * numbers. */ - glui32 oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, int buf_len); + uint oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, int buf_len); /** * Turn a filename or a special fileref string into an actual fileref. @@ -81,7 +81,7 @@ protected: * call oss_check_path, which should do the OS-dependent path changing * in the event that the filename contains path information */ - frefid_t oss_convert_string_to_fileref(char *buffer, glui32 usage); + frefid_t oss_convert_string_to_fileref(char *buffer, uint usage); /** * Tell us if the passed string is a hashed fileref or not @@ -91,7 +91,7 @@ protected: /** * Change a Glk key into a TADS one, using the CMD_xxx codes */ - unsigned char oss_convert_keystroke_to_tads(glui32 key); + unsigned char oss_convert_keystroke_to_tads(uint key); /**@}*/ @@ -117,8 +117,8 @@ protected: * TADS filemode (OSFT*); tbusage is either fileusage_TextMode or * fileusage_BinaryMode (from Glk). */ - osfildef *oss_open_stream(char *buffer, glui32 tadsusage, glui32 tbusage, - glui32 fmode, glui32 rock); + osfildef *oss_open_stream(char *buffer, uint tadsusage, uint tbusage, + uint fmode, uint rock); /** * Get a pointer to the root name portion of a filename. This is the part diff --git a/engines/glk/time.h b/engines/glk/time.h index 8e68328dcf..6bf3f37b16 100644 --- a/engines/glk/time.h +++ b/engines/glk/time.h @@ -30,21 +30,21 @@ namespace Glk { typedef int64 TimeSeconds; struct Timestamp { - glsi32 high_sec; - glui32 low_sec; - glsi32 microsec; + int high_sec; + uint low_sec; + int microsec; }; typedef Timestamp glktimeval_t; struct TimeAndDate { - glsi32 year; ///< full (four-digit) year - glsi32 month; ///< 1-12, 1 is January - glsi32 day; ///< 1-31 - glsi32 weekday; ///< 0-6, 0 is Sunday - glsi32 hour; ///< 0-23 - glsi32 minute; ///< 0-59 - glsi32 second; ///< 0-59, maybe 60 during a leap second - glsi32 microsec; ///< 0-999999 + int year; ///< full (four-digit) year + int month; ///< 1-12, 1 is January + int day; ///< 1-31 + int weekday; ///< 0-6, 0 is Sunday + int hour; ///< 0-23 + int minute; ///< 0-59 + int second; ///< 0-59, maybe 60 during a leap second + int microsec; ///< 0-999999 private: /** * Get the number of seconds since the start of 1970 diff --git a/engines/glk/unicode.cpp b/engines/glk/unicode.cpp index 909f4ee284..e87892f74f 100644 --- a/engines/glk/unicode.cpp +++ b/engines/glk/unicode.cpp @@ -33,12 +33,12 @@ size_t strlen_uni(const uint32 *s) { return len; } -glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCase destcase, +uint bufferChangeCase(uint *buf, uint len, uint numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest) { - glui32 ix, jx; - glui32 *outbuf; - glui32 *newoutbuf; - glui32 outcount; + uint ix, jx; + uint *outbuf; + uint *newoutbuf; + uint outcount; int dest_block_rest = 0, dest_block_first = 0; int dest_spec_rest = 0, dest_spec_first = 0; @@ -70,11 +70,11 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa for (ix = 0; ix < numchars; ix++) { int target; int isfirst; - glui32 res; - glui32 *special; - glui32 *ptr; - glui32 speccount; - glui32 ch = buf[ix]; + uint res; + uint *special; + uint *ptr; + uint speccount; + uint ch = buf[ix]; isfirst = (ix == 0); @@ -121,11 +121,11 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa // Now we have to allocate a new buffer, if we haven't already. if (!newoutbuf) { - newoutbuf = new glui32[len + 1]; + newoutbuf = new uint[len + 1]; if (!newoutbuf) return 0; if (outcount) - memcpy(newoutbuf, buf, outcount * sizeof(glui32)); + memcpy(newoutbuf, buf, outcount * sizeof(uint)); outbuf = newoutbuf; } @@ -137,11 +137,11 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa } if (newoutbuf) { - glui32 finallen = outcount; + uint finallen = outcount; if (finallen > len) finallen = len; if (finallen) - memcpy(buf, newoutbuf, finallen * sizeof(glui32)); + memcpy(buf, newoutbuf, finallen * sizeof(uint)); free(newoutbuf); } diff --git a/engines/glk/unicode.h b/engines/glk/unicode.h index f49a841616..07a3e0ac7e 100644 --- a/engines/glk/unicode.h +++ b/engines/glk/unicode.h @@ -27,7 +27,7 @@ namespace Glk { -typedef glui32 gli_case_block_t[2]; // upper, lower +typedef uint gli_case_block_t[2]; // upper, lower enum BufferChangeCase { CASE_UPPER = 0, CASE_LOWER = 1, CASE_TITLE = 2, CASE_IDENT = 3 }; enum BufferChangeCond { COND_ALL = 0, COND_LINESTART = 1 }; @@ -43,8 +43,8 @@ size_t strlen_uni(const uint32 *s); * the return value will be the full number of characters that the *converted string should have contained. */ -extern glui32 bufferChangeCase(glui32 *buf, glui32 len, - glui32 numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest); +extern uint bufferChangeCase(uint *buf, uint len, + uint numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest); } // End of namespace Glk diff --git a/engines/glk/unicode_gen.cpp b/engines/glk/unicode_gen.cpp index 9c6785959a..9607dc25a5 100644 --- a/engines/glk/unicode_gen.cpp +++ b/engines/glk/unicode_gen.cpp @@ -3396,7 +3396,7 @@ gli_case_block_t unigen_case_block_0x104[256] = { { 0x104ff, 0x104ff }, }; -glui32 unigen_special_array[] = { +uint unigen_special_array[] = { 2, 0x53, 0x53, /* 0xdf upcase */ 1, 0xdf, /* 0xdf downcase */ 2, 0x53, 0x73, /* 0xdf titlecase */ @@ -3861,7 +3861,7 @@ gli_case_special_t unigen_special_0xfb16 = { 857, 860, 862 }; gli_case_special_t unigen_special_0xfb17 = { 865, 868, 870 }; #define RETURN_COMBINING_CLASS(ch) \ - switch ((glui32)(ch) >> 8) { \ + switch ((uint)(ch) >> 8) { \ case 3: \ switch (ch) { \ case 820: \ @@ -4395,7 +4395,7 @@ gli_case_special_t unigen_special_0xfb17 = { 865, 868, 870 }; return 0; #define RETURN_COMPOSITION(ch1, ch2) \ - switch ((glui32)(ch1) >> 8) { \ + switch ((uint)(ch1) >> 8) { \ case 0: \ switch (ch1) { \ case 60: \ @@ -7181,7 +7181,7 @@ gli_case_special_t unigen_special_0xfb17 = { 865, 868, 870 }; } \ return 0; -glui32 unigen_decomp_data[3247] = { +uint unigen_decomp_data[3247] = { 0x41, 0x300, 0x41, 0x301, 0x41, 0x302, 0x41, 0x303, 0x41, 0x308, 0x41, 0x30a, 0x43, 0x327, 0x45, 0x300, 0x45, 0x301, 0x45, 0x302, 0x45, 0x308, 0x49, 0x300, @@ -11476,7 +11476,7 @@ gli_decomp_block_t unigen_decomp_block_0x2fa[256] = { }; #define GET_DECOMP_BLOCK(ch, blockptr) \ - switch ((glui32)(ch) >> 8) { \ + switch ((uint)(ch) >> 8) { \ case 0x0: \ *blockptr = unigen_decomp_block_0x0; \ break; \ diff --git a/engines/glk/unicode_gen.h b/engines/glk/unicode_gen.h index 6822d699f4..69e6aa000d 100644 --- a/engines/glk/unicode_gen.h +++ b/engines/glk/unicode_gen.h @@ -28,7 +28,7 @@ namespace Glk { #define GET_CASE_BLOCK(ch, blockptr) \ - switch ((glui32)(ch) >> 8) { \ + switch ((uint)(ch) >> 8) { \ case 0x0: \ *blockptr = unigen_case_block_0x0; \ break; \ @@ -423,9 +423,9 @@ namespace Glk { *specptr = nullptr; \ } -typedef glui32 gli_case_block_t[2]; ///< upper, lower -typedef glui32 gli_case_special_t[3]; ///< upper, lower, title -typedef glui32 gli_decomp_block_t[2]; ///< count, position +typedef uint gli_case_block_t[2]; ///< upper, lower +typedef uint gli_case_special_t[3]; ///< upper, lower, title +typedef uint gli_decomp_block_t[2]; ///< count, position extern gli_case_block_t unigen_case_block_0x0[256]; extern gli_case_block_t unigen_case_block_0x1[256]; @@ -556,7 +556,7 @@ extern gli_case_special_t unigen_special_0xfb14; extern gli_case_special_t unigen_special_0xfb15; extern gli_case_special_t unigen_special_0xfb16; extern gli_case_special_t unigen_special_0xfb17; -extern glui32 unigen_special_array[]; +extern uint unigen_special_array[]; } // End of namespace Glk diff --git a/engines/glk/window_graphics.cpp b/engines/glk/window_graphics.cpp index 7343d51607..919dff878e 100644 --- a/engines/glk/window_graphics.cpp +++ b/engines/glk/window_graphics.cpp @@ -93,10 +93,10 @@ void GraphicsWindow::redraw() { } } -glui32 GraphicsWindow::drawPicture(glui32 image, glsi32 xpos, glsi32 ypos, int scale, - glui32 imagewidth, glui32 imageheight) { +uint GraphicsWindow::drawPicture(uint image, int xpos, int ypos, int scale, + uint imagewidth, uint imageheight) { Picture *pic = g_vm->_pictures->load(image); - glui32 hyperlink = _attr.hyper; + uint hyperlink = _attr.hyper; if (!pic) return false; @@ -132,10 +132,10 @@ void GraphicsWindow::eraseRect(bool whole, const Rect &box) { if (y0 < 0) y0 = 0; if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; - if ((glui32)x0 >= _w) x0 = _w; - if ((glui32)y0 >= _h) y0 = _h; - if ((glui32)x1 >= _w) x1 = _w; - if ((glui32)y1 >= _h) y1 = _h; + if ((uint)x0 >= _w) x0 = _w; + if ((uint)y0 >= _h) y0 = _h; + if ((uint)x1 >= _w) x1 = _w; + if ((uint)y1 >= _h) y1 = _h; hx0 = _bbox.left + x0; hx1 = _bbox.left + x1; @@ -149,7 +149,7 @@ void GraphicsWindow::eraseRect(bool whole, const Rect &box) { touch(); } -void GraphicsWindow::fillRect(glui32 color, const Rect &box) { +void GraphicsWindow::fillRect(uint color, const Rect &box) { unsigned char col[3]; int x0 = box.left, y0 = box.top, x1 = box.right, y1 = box.bottom; int hx0, hx1, hy0, hy1; @@ -162,10 +162,10 @@ void GraphicsWindow::fillRect(glui32 color, const Rect &box) { if (y0 < 0) y0 = 0; if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; - if ((glui32)x0 > _w) x0 = _w; - if ((glui32)y0 > _h) y0 = _h; - if ((glui32)x1 > _w) x1 = _w; - if ((glui32)y1 > _h) y1 = _h; + if ((uint)x0 > _w) x0 = _w; + if ((uint)y0 > _h) y0 = _h; + if ((uint)x1 > _w) x1 = _w; + if ((uint)y1 > _h) y1 = _h; hx0 = _bbox.left + x0; hx1 = _bbox.left + x1; @@ -179,7 +179,7 @@ void GraphicsWindow::fillRect(glui32 color, const Rect &box) { touch(); } -void GraphicsWindow::drawPicture(Picture *src, int x0, int y0, int width, int height, glui32 linkval) { +void GraphicsWindow::drawPicture(Picture *src, int x0, int y0, int width, int height, uint linkval) { int dx1, dy1, x1, y1, sx0, sy0, sx1, sy1; int hx0, hx1, hy0, hy1; int w, h; @@ -233,12 +233,12 @@ void GraphicsWindow::drawPicture(Picture *src, int x0, int y0, int width, int h _surface->blitFrom(*src, Rect(sx0, sy0, sx0 + w, sy0 + h), Point(0, 0)); } -void GraphicsWindow::getSize(glui32 *width, glui32 *height) const { +void GraphicsWindow::getSize(uint *width, uint *height) const { *width = _bbox.width(); *height = _bbox.height(); } -void GraphicsWindow::setBackgroundColor(glui32 color) { +void GraphicsWindow::setBackgroundColor(uint color) { _bgnd[0] = (color >> 16) & 0xff; _bgnd[1] = (color >> 8) & 0xff; _bgnd[2] = (color >> 0) & 0xff; @@ -255,7 +255,7 @@ void GraphicsWindow::click(const Point &newPos) { } if (_hyperRequest) { - glui32 linkval = g_vm->_selection->getHyperlink(newPos); + uint linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; diff --git a/engines/glk/window_graphics.h b/engines/glk/window_graphics.h index c2f4a556a3..e57012d2ab 100644 --- a/engines/glk/window_graphics.h +++ b/engines/glk/window_graphics.h @@ -35,11 +35,11 @@ class GraphicsWindow : public Window { private: void touch(); - void drawPicture(Picture *src, int x0, int y0, int width, int height, glui32 linkval); + void drawPicture(Picture *src, int x0, int y0, int width, int height, uint linkval); public: unsigned char _bgnd[3]; bool _dirty; - glui32 _w, _h; + uint _w, _h; Graphics::ManagedSurface *_surface; public: /** @@ -52,8 +52,8 @@ public: */ virtual ~GraphicsWindow(); - glui32 drawPicture(glui32 image, glsi32 xpos, glsi32 ypos, int scale, - glui32 imagewidth, glui32 imageheight); + uint drawPicture(uint image, int xpos, int ypos, int scale, + uint imagewidth, uint imageheight); /** * Rearranges the window @@ -63,7 +63,7 @@ public: /** * Get window split size within parent pair window */ - virtual glui32 getSplit(glui32 size, bool vertical) const override { + virtual uint getSplit(uint size, bool vertical) const override { return size; } @@ -101,11 +101,11 @@ public: virtual void eraseRect(bool whole, const Rect &box) override; - virtual void fillRect(glui32 color, const Rect &box) override; + virtual void fillRect(uint color, const Rect &box) override; - virtual void getSize(glui32 *width, glui32 *height) const override; + virtual void getSize(uint *width, uint *height) const override; - virtual void setBackgroundColor(glui32 color) override; + virtual void setBackgroundColor(uint color) override; }; } // End of namespace Glk diff --git a/engines/glk/window_pair.cpp b/engines/glk/window_pair.cpp index 41b4e20a10..dfec02bc43 100644 --- a/engines/glk/window_pair.cpp +++ b/engines/glk/window_pair.cpp @@ -27,7 +27,7 @@ namespace Glk { -PairWindow::PairWindow(Windows *windows, glui32 method, Window *key, glui32 size) : +PairWindow::PairWindow(Windows *windows, uint method, Window *key, uint size) : Window(windows, 0), _dir(method & winmethod_DirMask), _division(method & winmethod_DivisionMask), @@ -149,8 +149,8 @@ void PairWindow::redraw() { } } -void PairWindow::getArrangement(glui32 *method, glui32 *size, Window **keyWin) { - glui32 val = _dir | _division; +void PairWindow::getArrangement(uint *method, uint *size, Window **keyWin) { + uint val = _dir | _division; if (!_wBorder) val |= winmethod_NoBorder; @@ -167,8 +167,8 @@ void PairWindow::getArrangement(glui32 *method, glui32 *size, Window **keyWin) { *method = val; } -void PairWindow::setArrangement(glui32 method, glui32 size, Window *keyWin) { - glui32 newDir; +void PairWindow::setArrangement(uint method, uint size, Window *keyWin) { + uint newDir; bool newVertical, newBackward; if (_key) { diff --git a/engines/glk/window_pair.h b/engines/glk/window_pair.h index b58819261c..ebd2d01ac0 100644 --- a/engines/glk/window_pair.h +++ b/engines/glk/window_pair.h @@ -35,18 +35,18 @@ public: Window *_child1, *_child2; // split info... - glui32 _dir; ///< winmethod_Left, Right, Above, or Below + uint _dir; ///< winmethod_Left, Right, Above, or Below bool _vertical, _backward; ///< flags - glui32 _division; ///< winmethod_Fixed or winmethod_Proportional + uint _division; ///< winmethod_Fixed or winmethod_Proportional Window *_key; ///< nullptr or a leaf-descendant (not a Pair) int _keyDamage; ///< used as scratch space in window closing - glui32 _size; ///< size value + uint _size; ///< size value bool _wBorder; ///< If windows are separated by border public: /** * Constructor */ - PairWindow(Windows *windows, glui32 method, Window *key, glui32 size); + PairWindow(Windows *windows, uint method, Window *key, uint size); /** * Destructor @@ -63,9 +63,9 @@ public: */ virtual void redraw() override; - virtual void getArrangement(glui32 *method, glui32 *size, Window **keyWin) override; + virtual void getArrangement(uint *method, uint *size, Window **keyWin) override; - virtual void setArrangement(glui32 method, glui32 size, Window *keyWin) override; + virtual void setArrangement(uint method, uint size, Window *keyWin) override; /** * Click the window diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp index 35f5af9c6f..30b98146a3 100644 --- a/engines/glk/window_text_buffer.cpp +++ b/engines/glk/window_text_buffer.cpp @@ -105,7 +105,7 @@ void TextBufferWindow::rearrange(const Rect &box) { // allocate copy buffer if (_copyBuf) delete[] _copyBuf; - _copyBuf = new glui32[_height * TBLINELEN]; + _copyBuf = new uint[_height * TBLINELEN]; for (int i = 0; i < (_height * TBLINELEN); i++) _copyBuf[i] = 0; @@ -127,10 +127,10 @@ void TextBufferWindow::reflow() { // allocate temp buffers Attributes *attrbuf = new Attributes[SCROLLBACK * TBLINELEN]; - glui32 *charbuf = new glui32[SCROLLBACK * TBLINELEN]; + uint *charbuf = new uint[SCROLLBACK * TBLINELEN]; int *alignbuf = new int[SCROLLBACK]; Picture **pictbuf = new Picture *[SCROLLBACK]; - glui32 *hyperbuf = new glui32[SCROLLBACK]; + uint *hyperbuf = new uint[SCROLLBACK]; int *offsetbuf = new int[SCROLLBACK]; if (!attrbuf || !charbuf || !alignbuf || !pictbuf || !hyperbuf || !offsetbuf) { @@ -239,7 +239,7 @@ void TextBufferWindow::touchScroll() { _lines[i]._dirty = true; } -bool TextBufferWindow::putPicture(Picture *pic, glui32 align, glui32 linkval) { +bool TextBufferWindow::putPicture(Picture *pic, uint align, uint linkval) { if (align == imagealign_MarginRight) { if (_lines[0]._rPic || _numChars) return false; @@ -269,9 +269,9 @@ bool TextBufferWindow::putPicture(Picture *pic, glui32 align, glui32 linkval) { return true; } -glui32 TextBufferWindow::drawPicture(glui32 image, glui32 align, glui32 scaled, glui32 width, glui32 height) { +uint TextBufferWindow::drawPicture(uint image, uint align, uint scaled, uint width, uint height) { Picture *pic; - glui32 hyperlink; + uint hyperlink; int error; pic = g_vm->_pictures->load(image); @@ -330,7 +330,7 @@ void TextBufferWindow::putText(const char *buf, int len, int pos, int oldlen) { touch(0); } -void TextBufferWindow::putTextUni(const glui32 *buf, int len, int pos, int oldlen) { +void TextBufferWindow::putTextUni(const uint *buf, int len, int pos, int oldlen) { int diff = len - oldlen; if (_numChars + diff >= TBLINELEN) @@ -370,12 +370,12 @@ void TextBufferWindow::touch(int line) { _windows->repaint(Rect(_bbox.left, y - 2, _bbox.right, y + g_conf->_leading + 2)); } -glui32 TextBufferWindow::getSplit(glui32 size, bool vertical) const { +uint TextBufferWindow::getSplit(uint size, bool vertical) const { return (vertical) ? size * g_conf->_cellW : size * g_conf->_cellH; } -void TextBufferWindow::putCharUni(glui32 ch) { - glui32 bchars[TBLINELEN]; +void TextBufferWindow::putCharUni(uint ch) { + uint bchars[TBLINELEN]; Attributes battrs[TBLINELEN]; int pw; int bpoint; @@ -572,7 +572,7 @@ void TextBufferWindow::click(const Point &newPos) { _windows->setFocus(this); if (_hyperRequest) { - glui32 linkval = g_vm->_selection->getHyperlink(newPos); + uint linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; @@ -600,7 +600,7 @@ void TextBufferWindow::click(const Point &newPos) { } } -void TextBufferWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) { +void TextBufferWindow::requestLineEvent(char *buf, uint maxlen, uint initlen) { if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) { warning("request_line_event: window already has keyboard request"); return; @@ -643,10 +643,10 @@ void TextBufferWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen _echoLineInput = _echoLineInputBase; if (_lineTerminatorsBase && _termCt) { - _lineTerminators = new glui32[_termCt + 1]; + _lineTerminators = new uint[_termCt + 1]; if (_lineTerminators) { - memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(glui32)); + memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(uint)); _lineTerminators[_termCt] = 0; } } @@ -655,7 +655,7 @@ void TextBufferWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen _inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Cn"); } -void TextBufferWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen) { +void TextBufferWindow::requestLineEventUni(uint *buf, uint maxlen, uint initlen) { if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) { warning("request_line_event_uni: window already has keyboard request"); return; @@ -697,10 +697,10 @@ void TextBufferWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 in _echoLineInput = _echoLineInputBase; if (_lineTerminatorsBase && _termCt) { - _lineTerminators = new glui32[_termCt + 1]; + _lineTerminators = new uint[_termCt + 1]; if (_lineTerminators) { - memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(glui32)); + memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(uint)); _lineTerminators[_termCt] = 0; } } @@ -742,14 +742,14 @@ void TextBufferWindow::cancelLineEvent(Event *ev) { if (!unicode) { for (ix = 0; ix < len; ix++) { - glui32 ch = _chars[_inFence + ix]; + uint ch = _chars[_inFence + ix]; if (ch > 0xff) ch = '?'; ((char *)inbuf)[ix] = (char)ch; } } else { for (ix = 0; ix < len; ix++) - ((glui32 *)inbuf)[ix] = _chars[_inFence + ix]; + ((uint *)inbuf)[ix] = _chars[_inFence + ix]; } _attr = _origAttr; @@ -786,7 +786,7 @@ void TextBufferWindow::redraw() { int x0, y0, x1, y1; int x, y, w; int a, b; - glui32 link; + uint link; int font; unsigned char *color; int i; @@ -1156,7 +1156,7 @@ void TextBufferWindow::redraw() { delete ln; } -int TextBufferWindow::acceptScroll(glui32 arg) { +int TextBufferWindow::acceptScroll(uint arg) { int pageht = _height - 2; // 1 for prompt, 1 for overlap int startpos = _scrollPos; @@ -1201,8 +1201,8 @@ int TextBufferWindow::acceptScroll(glui32 arg) { return (startpos || _scrollPos); } -void TextBufferWindow::acceptReadChar(glui32 arg) { - glui32 key; +void TextBufferWindow::acceptReadChar(uint arg) { + uint key; if (_height < 2) _scrollPos = 0; @@ -1238,8 +1238,8 @@ void TextBufferWindow::acceptReadChar(glui32 arg) { g_vm->_events->store(evtype_CharInput, this, key, 0); } -void TextBufferWindow::acceptReadLine(glui32 arg) { - glui32 *cx; +void TextBufferWindow::acceptReadLine(uint arg) { + uint *cx; Common::U32String s; int len; @@ -1368,7 +1368,7 @@ void TextBufferWindow::acceptReadLine(glui32 arg) { touch(0); } -void TextBufferWindow::acceptLine(glui32 keycode) { +void TextBufferWindow::acceptLine(uint keycode) { int ix; int len, olen; void *inbuf; @@ -1392,7 +1392,7 @@ void TextBufferWindow::acceptLine(glui32 keycode) { if (g_conf->_speakInput) { const uint32 NEWLINE = '\n'; gli_tts_speak(_chars + _inFence, len); - gli_tts_speak((const glui32 *)&NEWLINE, 1); + gli_tts_speak((const uint *)&NEWLINE, 1); } /* @@ -1429,20 +1429,20 @@ void TextBufferWindow::acceptLine(glui32 keycode) { if (!unicode) { for (ix = 0; ix < len; ix++) { - glui32 ch = _chars[_inFence + ix]; + uint ch = _chars[_inFence + ix]; if (ch > 0xff) ch = '?'; ((char *)inbuf)[ix] = (char)ch; } } else { for (ix = 0; ix < len; ix++) - ((glui32 *)inbuf)[ix] = _chars[_inFence + ix]; + ((uint *)inbuf)[ix] = _chars[_inFence + ix]; } _attr = _origAttr; if (_lineTerminators) { - glui32 val2 = keycode; + uint val2 = keycode; if (val2 == keycode_Return) val2 = 0; g_vm->_events->store(evtype_LineInput, this, len, val2); @@ -1468,7 +1468,7 @@ void TextBufferWindow::acceptLine(glui32 keycode) { (*g_vm->gli_unregister_arr)(inbuf, inmax, unicode ? "&+#!Iu" : "&+#!Cn", inarrayrock); } -bool TextBufferWindow::leftquote(glui32 c) { +bool TextBufferWindow::leftquote(uint c) { switch (c) { case '(': case '[': @@ -1580,7 +1580,7 @@ void TextBufferWindow::scrollResize() { _scrollBack += SCROLLBACK; } -int TextBufferWindow::calcWidth(glui32 *chars, Attributes *attrs, int startchar, +int TextBufferWindow::calcWidth(uint *chars, Attributes *attrs, int startchar, int numChars, int spw) { Screen &screen = *g_vm->_screen; int w = 0; @@ -1600,7 +1600,7 @@ int TextBufferWindow::calcWidth(glui32 *chars, Attributes *attrs, int startchar, return w; } -void TextBufferWindow::getSize(glui32 *width, glui32 *height) const { +void TextBufferWindow::getSize(uint *width, uint *height) const { if (width) *width = (_bbox.width() - g_conf->_tMarginX * 2) / g_conf->_cellW; if (height) diff --git a/engines/glk/window_text_buffer.h b/engines/glk/window_text_buffer.h index b20d921548..2493248558 100644 --- a/engines/glk/window_text_buffer.h +++ b/engines/glk/window_text_buffer.h @@ -39,12 +39,12 @@ class TextBufferWindow : public Window, Speech { * Structure for a row within the window */ struct TextBufferRow { - glui32 _chars[TBLINELEN]; + uint _chars[TBLINELEN]; Attributes _attrs[TBLINELEN]; int _len, _newLine; bool _dirty, _repaint; Picture *_lPic, *_rPic; - glui32 _lHyper, _rHyper; + uint _lHyper, _rHyper; int _lm, _rm; /** @@ -56,7 +56,7 @@ class TextBufferWindow : public Window, Speech { private: void reflow(); void touchScroll(); - bool putPicture(Picture *pic, glui32 align, glui32 linkval); + bool putPicture(Picture *pic, uint align, uint linkval); /** * @remarks Only for input text @@ -66,12 +66,12 @@ private: /** * @remarks Only for input text */ - void putTextUni(const glui32 *buf, int len, int pos, int oldlen); + void putTextUni(const uint *buf, int len, int pos, int oldlen); /** * Return or enter, during line input. Ends line input. */ - void acceptLine(glui32 keycode); + void acceptLine(uint keycode); /** * Return true if a following quotation mark should be an opening mark, @@ -79,7 +79,7 @@ private: * appear following an open parenthesis, open square bracket, or * whitespace. */ - bool leftquote(glui32 c); + bool leftquote(uint c); /** * Mark a given text row as modified @@ -88,7 +88,7 @@ private: void scrollOneLine(bool forced); void scrollResize(); - int calcWidth(glui32 *chars, Attributes *attrs, int startchar, int numchars, int spw); + int calcWidth(uint *chars, Attributes *attrs, int startchar, int numchars, int spw); public: int _width, _height; int _spaced; @@ -98,7 +98,7 @@ public: int _scrollBack; int _numChars; ///< number of chars in last line: lines[0] - glui32 *_chars; ///< alias to lines[0].chars + uint *_chars; ///< alias to lines[0].chars Attributes *_attrs; ///< alias to lines[0].attrs ///< adjust margins temporarily for images @@ -118,21 +118,21 @@ public: int _scrollMax; // for line input - void *_inBuf; ///< unsigned char* for latin1, glui32* for unicode + void *_inBuf; ///< unsigned char* for latin1, uint* for unicode int _inMax; long _inFence; long _inCurs; Attributes _origAttr; gidispatch_rock_t _inArrayRock; - glui32 _echoLineInput; - glui32 *_lineTerminators; + uint _echoLineInput; + uint *_lineTerminators; // style hints and settings WindowStyle _styles[style_NUMSTYLES]; // for copy selection - glui32 *_copyBuf; + uint *_copyBuf; int _copyPos; public: /** @@ -145,9 +145,9 @@ public: */ virtual ~TextBufferWindow(); - int acceptScroll(glui32 arg); + int acceptScroll(uint arg); - glui32 drawPicture(glui32 image, glui32 align, glui32 scaled, glui32 width, glui32 height); + uint drawPicture(uint image, uint align, uint scaled, uint width, uint height); /** * Rearranges the window @@ -157,12 +157,12 @@ public: /** * Get window split size within parent pair window */ - virtual glui32 getSplit(glui32 size, bool vertical) const override; + virtual uint getSplit(uint size, bool vertical) const override; /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) override; + virtual void putCharUni(uint ch) override; /** * Unput a unicode character @@ -182,12 +182,12 @@ public: /** * Prepare for inputing a line */ - virtual void requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) override; + virtual void requestLineEvent(char *buf, uint maxlen, uint initlen) override; /** * Prepare for inputing a line */ - virtual void requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen) override; + virtual void requestLineEventUni(uint *buf, uint maxlen, uint initlen) override; /** * Cancel an input line event @@ -206,11 +206,11 @@ public: */ virtual void redraw() override; - virtual void acceptReadLine(glui32 arg) override; + virtual void acceptReadLine(uint arg) override; - virtual void acceptReadChar(glui32 arg) override; + virtual void acceptReadChar(uint arg) override; - virtual void getSize(glui32 *width, glui32 *height) const override; + virtual void getSize(uint *width, uint *height) const override; virtual void requestCharEvent() override { _charRequest = true; @@ -220,7 +220,7 @@ public: _charRequestUni = true; } - virtual void setEchoLineEvent(glui32 val) override { + virtual void setEchoLineEvent(uint val) override { _echoLineInput = val != 0; } diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp index 3ee8198703..703527d6fd 100644 --- a/engines/glk/window_text_grid.cpp +++ b/engines/glk/window_text_grid.cpp @@ -79,7 +79,7 @@ void TextGridWindow::touch(int line) { _windows->repaint(Rect(_bbox.left, y, _bbox.right, y + g_conf->_leading)); } -glui32 TextGridWindow::getSplit(glui32 size, bool vertical) const { +uint TextGridWindow::getSplit(uint size, bool vertical) const { return vertical ? size * g_conf->_cellW : size * g_conf->_cellH; } @@ -162,7 +162,7 @@ bool TextGridWindow::unputCharUni(uint32 ch) { void TextGridWindow::moveCursor(const Point &pos) { // If the values are negative, they're really huge positive numbers -- - // remember that they were cast from glui32. So set them huge and + // remember that they were cast from uint. So set them huge and // let canonicalization take its course. _curX = (pos.x < 0) ? 32767 : pos.x; _curY = (pos.y < 0) ? 32767 : pos.y; @@ -204,7 +204,7 @@ void TextGridWindow::click(const Point &newPos) { } if (_hyperRequest) { - glui32 linkval = g_vm->_selection->getHyperlink(newPos); + uint linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; @@ -214,7 +214,7 @@ void TextGridWindow::click(const Point &newPos) { } } -void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) { +void TextGridWindow::requestLineEvent(char *buf, uint maxlen, uint initlen) { if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) { warning("request_line_event: window already has keyboard request"); return; @@ -240,7 +240,7 @@ void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) if (initlen) { TextGridRow *ln = &_lines[_inOrgY]; - for (glui32 ix = 0; ix < initlen; ix++) { + for (uint ix = 0; ix < initlen; ix++) { ln->_attrs[_inOrgX + ix].set(style_Input); ln->_chars[_inOrgX + ix] = buf[ix]; } @@ -254,10 +254,10 @@ void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) } if (_lineTerminatorsBase && _termCt) { - _lineTerminators = new glui32[_termCt + 1]; + _lineTerminators = new uint[_termCt + 1]; if (_lineTerminators) { - memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(glui32)); + memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(uint)); _lineTerminators[_termCt] = 0; } } @@ -266,7 +266,7 @@ void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) _inArrayRock = (*g_vm->gli_register_arr)(buf, maxlen, "&+#!Cn"); } -void TextGridWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen) { +void TextGridWindow::requestLineEventUni(uint *buf, uint maxlen, uint initlen) { if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) { warning("requestLineEventUni: window already has keyboard request"); return; @@ -292,7 +292,7 @@ void TextGridWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 init if (initlen) { TextGridRow *ln = &(_lines[_inOrgY]); - for (glui32 ix = 0; ix < initlen; ix++) { + for (uint ix = 0; ix < initlen; ix++) { ln->_attrs[_inOrgX + ix].set(style_Input); ln->_chars[_inOrgX + ix] = buf[ix]; } @@ -306,10 +306,10 @@ void TextGridWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 init } if (_lineTerminatorsBase && _termCt) { - _lineTerminators = new glui32[_termCt + 1]; + _lineTerminators = new uint[_termCt + 1]; if (_lineTerminators) { - memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(glui32)); + memcpy(_lineTerminators, _lineTerminatorsBase, _termCt * sizeof(uint)); _lineTerminators[_termCt] = 0; } } @@ -342,7 +342,7 @@ void TextGridWindow::cancelLineEvent(Event *ev) { if (!unicode) { for (ix = 0; ix < _inLen; ix++) { - glui32 ch = ln->_chars[_inOrgX + ix]; + uint ch = ln->_chars[_inOrgX + ix]; if (ch > 0xff) ch = '?'; ((char *)inbuf)[ix] = (char)ch; @@ -351,9 +351,9 @@ void TextGridWindow::cancelLineEvent(Event *ev) { _echoStream->echoLine((char *)_inBuf, _inLen); } else { for (ix = 0; ix < _inLen; ix++) - ((glui32 *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; + ((uint *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; if (_echoStream) - _echoStream->echoLineUni((glui32 *)inbuf, _inLen); + _echoStream->echoLineUni((uint *)inbuf, _inLen); } _curY = _inOrgY + 1; @@ -382,8 +382,8 @@ void TextGridWindow::cancelLineEvent(Event *ev) { (*g_vm->gli_unregister_arr)(inbuf, inmax, unicode ? "&+#!Iu" : "&+#!Cn", inarrayrock); } -void TextGridWindow::acceptReadChar(glui32 arg) { - glui32 key; +void TextGridWindow::acceptReadChar(uint arg) { + uint key; switch (arg) { case keycode_Erase: @@ -406,7 +406,7 @@ void TextGridWindow::acceptReadChar(glui32 arg) { g_vm->_events->store(evtype_CharInput, this, key, 0); } -void TextGridWindow::acceptLine(glui32 keycode) { +void TextGridWindow::acceptLine(uint keycode) { int ix; void *inbuf; int inmax; @@ -428,9 +428,9 @@ void TextGridWindow::acceptLine(glui32 keycode) { _echoStream->echoLine((char *)inbuf, _inLen); } else { for (ix = 0; ix < _inLen; ix++) - ((glui32 *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; + ((uint *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; if (_echoStream) - _echoStream->echoLineUni((glui32 *)inbuf, _inLen); + _echoStream->echoLineUni((uint *)inbuf, _inLen); } _curY = _inOrgY + 1; @@ -438,7 +438,7 @@ void TextGridWindow::acceptLine(glui32 keycode) { _attr = _origAttr; if (_lineTerminators) { - glui32 val2 = keycode; + uint val2 = keycode; if (val2 == keycode_Return) val2 = 0; g_vm->_events->store(evtype_LineInput, this, _inLen, val2); @@ -458,7 +458,7 @@ void TextGridWindow::acceptLine(glui32 keycode) { (*g_vm->gli_unregister_arr)(inbuf, inmax, unicode ? "&+#!Iu" : "&+#!Cn", inarrayrock); } -void TextGridWindow::acceptReadLine(glui32 arg) { +void TextGridWindow::acceptReadLine(uint arg) { int ix; TextGridRow *ln = &(_lines[_inOrgY]); @@ -466,7 +466,7 @@ void TextGridWindow::acceptReadLine(glui32 arg) { return; if (_lineTerminators && checkTerminator(arg)) { - glui32 *cx; + uint *cx; for (cx = _lineTerminators; *cx; cx++) { if (*cx == arg) { acceptLine(arg); @@ -569,7 +569,7 @@ void TextGridWindow::redraw() { int x0, y0; int x, y, w; int i, a, b, k, o; - glui32 link; + uint link; int font; byte *fgcolor, *bgcolor; Screen &screen = *g_vm->_screen; @@ -636,7 +636,7 @@ void TextGridWindow::redraw() { } } -void TextGridWindow::getSize(glui32 *width, glui32 *height) const { +void TextGridWindow::getSize(uint *width, uint *height) const { if (width) *width = _bbox.width() / g_conf->_cellW; if (height) diff --git a/engines/glk/window_text_grid.h b/engines/glk/window_text_grid.h index ae8f2c9cbe..2a4d284d40 100644 --- a/engines/glk/window_text_grid.h +++ b/engines/glk/window_text_grid.h @@ -59,7 +59,7 @@ private: /** * Return or enter, during line input. Ends line input. */ - void acceptLine(glui32 keycode); + void acceptLine(uint keycode); public: int _width, _height; TextGridRows _lines; @@ -67,13 +67,13 @@ public: int _curX, _curY; ///< the window cursor position ///< for line input - void *_inBuf; ///< unsigned char* for latin1, glui32* for unicode + void *_inBuf; ///< unsigned char* for latin1, uint* for unicode int _inOrgX, _inOrgY; int _inMax; int _inCurs, _inLen; Attributes _origAttr; gidispatch_rock_t _inArrayRock; - glui32 *_lineTerminators; + uint *_lineTerminators; WindowStyle _styles[style_NUMSTYLES]; ///< style hints and settings public: @@ -95,12 +95,12 @@ public: /** * Get window split size within parent pair window */ - virtual glui32 getSplit(glui32 size, bool vertical) const override; + virtual uint getSplit(uint size, bool vertical) const override; /** * Write a unicode character */ - virtual void putCharUni(glui32 ch) override; + virtual void putCharUni(uint ch) override; /** * Unput a unicode character @@ -139,11 +139,11 @@ public: */ virtual void redraw() override; - virtual void acceptReadLine(glui32 arg) override; + virtual void acceptReadLine(uint arg) override; - virtual void acceptReadChar(glui32 arg) override; + virtual void acceptReadChar(uint arg) override; - virtual void getSize(glui32 *width, glui32 *height) const override; + virtual void getSize(uint *width, uint *height) const override; virtual void requestCharEvent() override { _charRequest = true; @@ -152,12 +152,12 @@ public: /** * Prepare for inputing a line */ - virtual void requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) override; + virtual void requestLineEvent(char *buf, uint maxlen, uint initlen) override; /** * Prepare for inputing a line */ - virtual void requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen) override; + virtual void requestLineEventUni(uint *buf, uint maxlen, uint initlen) override; /** * Cancel an input line event diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp index 58a1648b5c..5e35d9f64f 100644 --- a/engines/glk/windows.cpp +++ b/engines/glk/windows.cpp @@ -74,11 +74,11 @@ Windows::~Windows() { delete _rootWin; } -Window *Windows::windowOpen(Window *splitwin, glui32 method, glui32 size, - glui32 wintype, glui32 rock) { +Window *Windows::windowOpen(Window *splitwin, uint method, uint size, + uint wintype, uint rock) { Window *newwin, *oldparent; PairWindow *pairWin; - glui32 val; + uint val; _forceRedraw = true; @@ -210,7 +210,7 @@ void Windows::windowClose(Window *win, StreamResult *result) { } } -Window *Windows::newWindow(glui32 type, glui32 rock) { +Window *Windows::newWindow(uint type, uint rock) { Window *win; switch (type) { @@ -240,7 +240,7 @@ Window *Windows::newWindow(glui32 type, glui32 rock) { return win; } -PairWindow *Windows::newPairWindow(glui32 method, Window *key, glui32 size) { +PairWindow *Windows::newPairWindow(uint method, Window *key, uint size) { PairWindow *pwin = new PairWindow(this, method, key, size); pwin->_next = _windowList; _windowList = pwin; @@ -339,7 +339,7 @@ void Windows::inputScrollFocus() { _focusWin = altWin; } -void Windows::inputHandleKey(glui32 key) { +void Windows::inputHandleKey(uint key) { if (_moreFocus) { inputMoreFocus(); } else { @@ -484,7 +484,7 @@ Window *Windows::iterateTreeOrder(Window *win) { /*--------------------------------------------------------------------------*/ -Window::Window(Windows *windows, glui32 rock) : _windows(windows), _rock(rock), +Window::Window(Windows *windows, uint rock) : _windows(windows), _rock(rock), _type(0), _parent(nullptr), _next(nullptr), _prev(nullptr), _yAdj(0), _lineRequest(0), _lineRequestUni(0), _charRequest(0), _charRequestUni(0), _mouseRequest(0), _hyperRequest(0), _moreRequest(0), _scrollRequest(0), _imageLoaded(0), @@ -570,11 +570,11 @@ void Window::moveCursor(const Point &newPos) { warning("moveCursor: not a TextGrid window"); } -void Window::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) { +void Window::requestLineEvent(char *buf, uint maxlen, uint initlen) { warning("requestLineEvent: window does not support keyboard input"); } -void Window::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen) { +void Window::requestLineEventUni(uint *buf, uint maxlen, uint initlen) { warning("requestLineEventUni: window does not support keyboard input"); } @@ -586,19 +586,19 @@ void Window::redraw() { } } -void Window::acceptReadLine(glui32 arg) { +void Window::acceptReadLine(uint arg) { warning("acceptReadLine:: window does not support keyboard input"); } -void Window::acceptReadChar(glui32 arg) { +void Window::acceptReadChar(uint arg) { warning("acceptReadChar:: window does not support keyboard input"); } -void Window::getArrangement(glui32 *method, glui32 *size, Window **keyWin) { +void Window::getArrangement(uint *method, uint *size, Window **keyWin) { warning("getArrangement: not a Pair window"); } -void Window::setArrangement(glui32 method, glui32 size, Window *keyWin) { +void Window::setArrangement(uint method, uint size, Window *keyWin) { warning("setArrangement: not a Pair window"); } @@ -618,11 +618,11 @@ void Window::eraseRect(bool whole, const Rect &box) { warning("eraseRect: not a graphics window"); } -void Window::fillRect(glui32 color, const Rect &box) { +void Window::fillRect(uint color, const Rect &box) { warning("fillRect: not a graphics window"); } -void Window::setBackgroundColor(glui32 color) { +void Window::setBackgroundColor(uint color) { warning("setBackgroundColor: not a graphics window"); } @@ -631,7 +631,7 @@ const WindowStyle *Window::getStyles() const { return nullptr; } -void Window::setTerminatorsLineEvent(glui32 *keycodes, glui32 count) { +void Window::setTerminatorsLineEvent(uint *keycodes, uint count) { if (dynamic_cast<TextBufferWindow *>(this) || dynamic_cast<TextGridWindow *>(this)) { delete _lineTerminatorsBase; _lineTerminatorsBase = nullptr; @@ -639,9 +639,9 @@ void Window::setTerminatorsLineEvent(glui32 *keycodes, glui32 count) { if (!keycodes || count == 0) { _termCt = 0; } else { - _lineTerminatorsBase = new glui32[count + 1]; + _lineTerminatorsBase = new uint[count + 1]; if (_lineTerminatorsBase) { - memcpy(_lineTerminatorsBase, keycodes, count * sizeof(glui32)); + memcpy(_lineTerminatorsBase, keycodes, count * sizeof(uint)); _lineTerminatorsBase[count] = 0; _termCt = count; } @@ -651,7 +651,7 @@ void Window::setTerminatorsLineEvent(glui32 *keycodes, glui32 count) { } } -bool Window::checkTerminator(glui32 ch) { +bool Window::checkTerminator(uint ch) { if (ch == keycode_Escape) return true; else if (ch >= keycode_Func12 && ch <= keycode_Func1) @@ -660,7 +660,7 @@ bool Window::checkTerminator(glui32 ch) { return false; } -bool Window::imageDraw(glui32 image, glui32 align, glsi32 val1, glsi32 val2) { +bool Window::imageDraw(uint image, uint align, int val1, int val2) { if (!g_conf->_graphics) return false; @@ -675,7 +675,7 @@ bool Window::imageDraw(glui32 image, glui32 align, glsi32 val1, glsi32 val2) { return false; } -void Window::getSize(glui32 *width, glui32 *height) const { +void Window::getSize(uint *width, uint *height) const { if (width) *width = 0; if (height) diff --git a/engines/glk/windows.h b/engines/glk/windows.h index cb13095c55..8ba2f2ac0c 100644 --- a/engines/glk/windows.h +++ b/engines/glk/windows.h @@ -97,12 +97,12 @@ private: /** * Create a new window */ - Window *newWindow(glui32 type, glui32 rock); + Window *newWindow(uint type, uint rock); /** * Create a new pair window */ - PairWindow *newPairWindow(glui32 method, Window *key, glui32 size); + PairWindow *newPairWindow(uint method, Window *key, uint size); /** * Set the window focus @@ -159,8 +159,8 @@ public: /** * Open a new window */ - Window *windowOpen(Window *splitwin, glui32 method, glui32 size, - glui32 wintype, glui32 rock); + Window *windowOpen(Window *splitwin, uint method, uint size, + uint wintype, uint rock); /** * Close an existing window @@ -196,7 +196,7 @@ public: /** * Handle input keypress */ - void inputHandleKey(glui32 key); + void inputHandleKey(uint key); /** * Handle mouse clicks @@ -319,7 +319,7 @@ struct Attributes { /** * Set the style */ - void set(glui32 s) { + void set(uint s) { clear(); style = s; } @@ -365,8 +365,8 @@ struct Attributes { class Window { public: Windows *_windows; - glui32 _rock; - glui32 _type; + uint _rock; + uint _type; Window *_parent; ///< pair window which contains this one Window *_next, *_prev; ///< in the big linked list of windows @@ -386,9 +386,9 @@ public: bool _scrollRequest; bool _imageLoaded; - glui32 _echoLineInputBase; - glui32 *_lineTerminatorsBase; - glui32 _termCt; + uint _echoLineInputBase; + uint *_lineTerminatorsBase; + uint _termCt; Attributes _attr; byte _bgColor[3]; @@ -396,7 +396,7 @@ public: gidispatch_rock_t _dispRock; public: - static bool checkTerminator(glui32 ch); + static bool checkTerminator(uint ch); public: /** * Constructor @@ -423,14 +423,14 @@ public: /** * Get window split size within parent pair window */ - virtual glui32 getSplit(glui32 size, bool vertical) const { + virtual uint getSplit(uint size, bool vertical) const { return 0; } /** * Write a character */ - virtual void putCharUni(glui32 ch) {} + virtual void putCharUni(uint ch) {} /** * Unput a unicode character @@ -462,12 +462,12 @@ public: /** * Prepare for inputing a line */ - virtual void requestLineEvent(char *buf, glui32 maxlen, glui32 initlen); + virtual void requestLineEvent(char *buf, uint maxlen, uint initlen); /** * Prepare for inputing a line */ - virtual void requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 initlen); + virtual void requestLineEventUni(uint *buf, uint maxlen, uint initlen); /** * Cancel an input line event @@ -494,27 +494,27 @@ public: */ virtual void redraw(); - bool imageDraw(glui32 image, glui32 align, glsi32 val1, glsi32 val2); + bool imageDraw(uint image, uint align, int val1, int val2); - int acceptScroll(glui32 arg); + int acceptScroll(uint arg); - void setTerminatorsLineEvent(glui32 *keycodes, glui32 count); + void setTerminatorsLineEvent(uint *keycodes, uint count); - virtual void acceptReadLine(glui32 arg); + virtual void acceptReadLine(uint arg); - virtual void acceptReadChar(glui32 arg); + virtual void acceptReadChar(uint arg); - virtual void getArrangement(glui32 *method, glui32 *size, Window **keyWin); + virtual void getArrangement(uint *method, uint *size, Window **keyWin); - virtual void setArrangement(glui32 method, glui32 size, Window *keyWin); + virtual void setArrangement(uint method, uint size, Window *keyWin); - virtual void getSize(glui32 *width, glui32 *height) const; + virtual void getSize(uint *width, uint *height) const; virtual void requestCharEvent(); virtual void requestCharEventUni(); - virtual void setEchoLineEvent(glui32 val) {} + virtual void setEchoLineEvent(uint val) {} virtual void requestMouseEvent() {} @@ -524,9 +524,9 @@ public: virtual void eraseRect(bool whole, const Rect &box); - virtual void fillRect(glui32 color, const Rect &box); + virtual void fillRect(uint color, const Rect &box); - virtual void setBackgroundColor(glui32 color); + virtual void setBackgroundColor(uint color); /** * Returns a pointer to the styles for the window |