[Scummvm-git-logs] scummvm master -> 0faee72fa2b077c4cad1804836de7df21ba84578
aquadran
aquadran at gmail.com
Sun Mar 14 12:29:30 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0faee72fa2 ICB: Remove global constructor case
Commit: 0faee72fa2b077c4cad1804836de7df21ba84578
https://github.com/scummvm/scummvm/commit/0faee72fa2b077c4cad1804836de7df21ba84578
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2021-03-14T13:29:25+01:00
Commit Message:
ICB: Remove global constructor case
Changed paths:
engines/icb/options_manager_pc.cpp
engines/icb/p4.h
engines/icb/p4_pc.cpp
engines/icb/text_pc.cpp
engines/icb/text_sprites.cpp
engines/icb/text_sprites_pc.cpp
diff --git a/engines/icb/options_manager_pc.cpp b/engines/icb/options_manager_pc.cpp
index 9ac849643a..938d744601 100644
--- a/engines/icb/options_manager_pc.cpp
+++ b/engines/icb/options_manager_pc.cpp
@@ -5565,6 +5565,7 @@ void OptionsManager::LoadBitmapFont() {
sprintf(m_fontName, FONT_PATH, OPTIONS_FONT_NAME);
uint32 hashedname = NULL_HASH;
+ pxString font_cluster = FONT_CLUSTER_PATH;
m_font_file = (_pxBitmap *)rs_font->Res_open(m_fontName, hashedname, font_cluster, font_cluster_hash);
if (m_font_file->schema != PC_BITMAP_SCHEMA)
diff --git a/engines/icb/p4.h b/engines/icb/p4.h
index cfa3e14256..d470305f8b 100644
--- a/engines/icb/p4.h
+++ b/engines/icb/p4.h
@@ -91,9 +91,6 @@ extern uint32 ANIMATION_BUFFER_SIZE;
extern uint32 BITMAP_BUFFER_SIZE;
extern uint32 SONICS_BUFFER_SIZE;
-// globals for the font cluster name and hash value
-extern pxString font_cluster;
-
#define ANIM_CHECK(a) \
if (!I->IsAnimTable(a)) \
Fatal_error("engine finds anim [%s] '%s' %X missing for object [%s]", (const char *)master_anim_name_table[a].name, I->get_info_name(a), I->info_name_hash[a], \
diff --git a/engines/icb/p4_pc.cpp b/engines/icb/p4_pc.cpp
index e1eadd9ea7..006f1b0ffe 100644
--- a/engines/icb/p4_pc.cpp
+++ b/engines/icb/p4_pc.cpp
@@ -49,8 +49,6 @@ namespace ICB {
bool gRegainedFocus = false;
bool gotTheFocus = false;
-pxString font_cluster = FONT_CLUSTER_PATH;
-
char g_characters[] = "characters\\";
char gamelanguage[ENGINE_STRING_LEN] = "english";
bool8 camera_hack;
@@ -227,7 +225,7 @@ void InitEngine(const char *lpCmdLine) {
// we run a special check for a font file - otherwise, res-open will fail triggering a con-fatal-error - not good
sys_font_hash = HashString(SYS_FONT);
- font_cluster_hash = HashString(font_cluster);
+ font_cluster_hash = HashString(FONT_CLUSTER_PATH);
// inti direct input
Init_direct_input();
diff --git a/engines/icb/text_pc.cpp b/engines/icb/text_pc.cpp
index 31f761b244..ef88aa07b3 100644
--- a/engines/icb/text_pc.cpp
+++ b/engines/icb/text_pc.cpp
@@ -52,6 +52,7 @@ void Clip_text_print(_rgb *pen, uint32 x, uint32 y, uint8 *base, uint32 pitch, c
va_start(arg_ptr, format);
vsnprintf(ascii, 150, format, arg_ptr);
+ pxString font_cluster = FONT_CLUSTER_PATH;
charSet = rs_font->Res_open(SYS_FONT, sys_font_hash, font_cluster, font_cluster_hash);
do {
diff --git a/engines/icb/text_sprites.cpp b/engines/icb/text_sprites.cpp
index f99b4328fd..e5ab279e00 100644
--- a/engines/icb/text_sprites.cpp
+++ b/engines/icb/text_sprites.cpp
@@ -338,6 +338,7 @@ void text_sprite::CopyChar(_pxSprite *charPtr, uint8 *spritePtr, uint8 *pal) { /
}
_pxBitmap *text_sprite::LoadFont(const char *fontRes, uint32 fontRes_hash) {
+ pxString font_cluster = FONT_CLUSTER_PATH;
_pxBitmap *font = (_pxBitmap *)rs_font->Res_open(const_cast<char *>(fontRes), fontRes_hash, font_cluster, font_cluster_hash); // open font file
return (font);
diff --git a/engines/icb/text_sprites_pc.cpp b/engines/icb/text_sprites_pc.cpp
index 839d5c4fcf..b83d061f68 100644
--- a/engines/icb/text_sprites_pc.cpp
+++ b/engines/icb/text_sprites_pc.cpp
@@ -81,6 +81,7 @@ _TSrtn text_sprite::BuildTextSprite(int32 stopAtLine, bool8 bRemoraLeftFormattin
_pxBitmap *charSet;
+ pxString font_cluster = FONT_CLUSTER_PATH;
charSet = (_pxBitmap *)rs_font->Res_open(const_cast<char *>(params.fontResource), params.fontResource_hash, font_cluster, font_cluster_hash); // open font file
if (charSet->schema != PC_BITMAP_SCHEMA)
More information about the Scummvm-git-logs
mailing list