Gakuen KING: Draw key wait icon from GAKUEN.COM

This commit is contained in:
kichikuou
2026-08-29 08:29:46 +09:00
parent 882b380525
commit a9d9c32405
3 changed files with 26 additions and 5 deletions
+2
View File
@@ -144,6 +144,7 @@ public:
void clear_text_window(int index, bool erase);
bool return_text_line(int index);
void draw_push(int index);
void set_push_bitmap(const uint8_t* bitmap) { push_bitmap = bitmap; }
void open_text_window(int index, bool erase);
void close_text_window(int index, bool update);
void set_text_window(int index, int sx, int sy, int ex, int ey, bool save) {
@@ -262,6 +263,7 @@ private:
Dri acg;
const char* bmp_prefix = NULL;
const uint8_t* push_bitmap = nullptr;
};
extern "C" void ags_setAntialiasedStringMode(int on);
+2 -2
View File
@@ -145,7 +145,7 @@ bool AGS::return_text_line(int index)
void AGS::draw_push(int index)
{
const uint8_t push_bitmap[32] = {
static const uint8_t builtin_bitmap[32] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x90, 0x00, 0x99, 0x74, 0xe9, 0x44, 0x89, 0x77,
@@ -155,7 +155,7 @@ void AGS::draw_push(int index)
Window& w = text_w[index - 1];
int x = w.ex - 16;
int y = w.ey - 16;
draw_gaiji(0, x, y, push_bitmap, 16, text.font_color);
draw_gaiji(0, x, y, push_bitmap ? push_bitmap : builtin_bitmap, 16, text.font_color);
draw_screen(x, y, 16, 16);
}
+22 -3
View File
@@ -55,6 +55,7 @@ public:
private:
void cmd_a() override {
set_push_bitmap();
NACT::cmd_a();
map_overview_rebuild_pending = true;
}
@@ -93,7 +94,7 @@ private:
exec_y(14, param);
break;
case 25:
fixed_cursor_shape = (param == 1);
fixed_shapes = (param == 1);
if (0 <= param && param <= 4) {
ags->menu.back_color = ags->text.back_color =
(param == 1 || param == 2) ? 0 : 1;
@@ -214,6 +215,7 @@ private:
}
load_digit_font(exe);
load_mouse_cursors(exe);
load_push_bitmaps(exe);
load_credit_text(exe);
}
@@ -1327,7 +1329,7 @@ private:
};
MouseCursor mouse_cursor[NR_MOUSE_CURSORS] = {};
bool fixed_cursor_shape = false; // set by Y 25,1
bool fixed_shapes = false; // set by Y 25,1
void load_mouse_cursors(const std::vector<uint8_t>& exe) {
const uint8_t* p = &exe[MOUSE_CURSOR_OFFSET];
@@ -1340,7 +1342,7 @@ private:
}
int pick_cursor_shape() {
if (fixed_cursor_shape)
if (fixed_shapes)
return 5;
int r = random(100);
return r < 5 ? r : 1;
@@ -1359,6 +1361,23 @@ private:
ags->draw_screen(x, y, MOUSE_CURSOR_SIZE, MOUSE_CURSOR_SIZE);
}
// --- A key wait icon --------------------------------------------------
static constexpr int PUSH_BITMAP_OFFSET = 0x08aa;
static constexpr int NR_PUSH_BITMAPS = 4;
uint8_t push_bitmap[NR_PUSH_BITMAPS][32] = {};
void load_push_bitmaps(const std::vector<uint8_t>& exe) {
memcpy(push_bitmap, &exe[PUSH_BITMAP_OFFSET], sizeof(push_bitmap));
}
void set_push_bitmap() {
int r = random(100);
r = r < NR_PUSH_BITMAPS ? r : 0;
ags->set_push_bitmap(fixed_shapes ? nullptr : push_bitmap[r]);
}
// --- I grid selection -------------------------------------------------
// I 2 composes its overlays over the background CG on the work screen and