Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Decompilation] [th01] REIIDEN.EXE: Move already referenced literals …
…to C land Part of P0214, funded by Ember2528.
- Loading branch information
Showing
7 changed files
with
41 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
// Fills the text layer with spaces. | ||
// PORTERS: Implement better, and more consistently. | ||
#define text_fill_space(esc_move_topleft, space, tmp_x, tmp_y) { \ | ||
// ZUN bloat: The slowest imaginable version of this operation. | ||
#define text_fill_space(esc_move_topleft, tmp_x, tmp_y) { \ | ||
printf(esc_move_topleft); \ | ||
for(tmp_y = 0; tmp_y < (RES_Y / GLYPH_H); tmp_y++) { \ | ||
for(tmp_x = 0; tmp_x < (RES_X / GLYPH_HALF_W); tmp_x++) { \ | ||
printf(space); \ | ||
printf(" "); \ | ||
} \ | ||
} \ | ||
} | ||
|
||
// Fills the text layer with opaque black. | ||
// MODDERS: This should maybe reset the current text mode color. | ||
#define text_fill_black( \ | ||
esc_color_bg_black_fg_black, esc_move_topleft, space, tmp_x, tmp_y \ | ||
) { \ | ||
printf(esc_color_bg_black_fg_black); \ | ||
text_fill_space(esc_move_topleft, space, tmp_x, tmp_y); \ | ||
#define text_fill_black(tmp_x, tmp_y) { \ | ||
printf("\x1B[16;40m"); \ | ||
text_fill_space("\x1B[0;0H", tmp_x, tmp_y); \ | ||
} | ||
|
||
inline void text_color_reset(void) { | ||
printf("\x1B[0m"); | ||
} | ||
|
||
// Fills the text layer with transparent spaces. Yes, this overwrites the | ||
// perfectly suitable master.lib function with the same name. | ||
#define text_clear_sloppy(tmp_x, tmp_y) { \ | ||
printf("\x1B[0m"); /* Reset text mode color */ \ | ||
text_color_reset(); \ | ||
/* (yes, this escape sequence is actually 1-based) */ \ | ||
text_fill_space("\x1B[1;1H", " ", tmp_x, tmp_y); \ | ||
text_fill_space("\x1B[1;1H", tmp_x, tmp_y); \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters