@@ -34,6 +34,11 @@ class IHTML;
34
34
class IHTMLEvents ;
35
35
class VGuiVertex ;
36
36
37
+ }
38
+
39
+ namespace vgui2
40
+ {
41
+
37
42
class ISurface : public IBaseInterface
38
43
{
39
44
public:
@@ -246,14 +251,19 @@ class ILocalize : public IBaseInterface
246
251
247
252
#define VGUI_LOCALIZE_INTERFACE_VERSION " VGUI_Localize003"
248
253
254
+ }
255
+
256
+ namespace
257
+ {
258
+
249
259
bool g_bSurfaceLoaded = false ;
250
260
251
261
// hw.dll or sw.dll on Windows, hw.so on Linux, hw.dylib on macOS.
252
262
CSysModule *g_hEngineModule = nullptr ;
253
263
CSysModule *g_hVGuiModule = nullptr ;
254
264
255
- ISurface *g_pVGuiSurface = nullptr ;
256
- ILocalize *g_pVGuiLocalize = nullptr ;
265
+ vgui2:: ISurface *g_pVGuiSurface = nullptr ;
266
+ vgui2:: ILocalize *g_pVGuiLocalize = nullptr ;
257
267
258
268
}
259
269
@@ -328,7 +338,7 @@ void UnicodeTextImage::initInterfaces()
328
338
}
329
339
330
340
pIface = static_cast <IfaceType>(fnFactory (ifaceName, nullptr ));
331
- if (!g_pVGuiSurface )
341
+ if (!pIface )
332
342
{
333
343
gEngfuncs .Con_Printf (" UnicodeTextImage: Error: %s doesn't export %s.\n " , moduleName, ifaceName);
334
344
return false ;
@@ -360,7 +370,7 @@ UnicodeTextImage::HFont UnicodeTextImage::createFont(const char *fontName, int t
360
370
361
371
int flags = 0 ;
362
372
if (tall >= MIN_AA_FONT_SIZE)
363
- flags |= ISurface::FONTFLAG_ANTIALIAS;
373
+ flags |= vgui2:: ISurface::FONTFLAG_ANTIALIAS;
364
374
365
375
HFont font = g_pVGuiSurface->CreateFont ();
366
376
g_pVGuiSurface->AddGlyphSetToFont (font, fontName, tall, weight, 0 , 0 , flags, 0 , 0 );
0 commit comments