MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / InitTexture

Method InitTexture

ogsr_engine/xrGame/UIFrameRect.cpp:25–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void CUIFrameRect::InitTexture(const char* texture)
26{
27 string_path fn, buf;
28 strcpy_s(buf, texture);
29 if (strext(buf))
30 *strext(buf) = 0;
31
32 if (FS.exist(fn, "$game_textures$", buf, ".ini"))
33 {
34 Fvector4 v;
35 // uFlags.set (flSingleTex,TRUE);
36 CInifile _ini{fn, TRUE};
37 CInifile* ini = &_ini;
38
39 LPCSTR sh = ini->r_string("frame", "shader");
40 frame[fmBK].CreateShader(texture, sh);
41 frame[fmL].CreateShader(texture, sh);
42 frame[fmR].CreateShader(texture, sh);
43 frame[fmT].CreateShader(texture, sh);
44 frame[fmB].CreateShader(texture, sh);
45 frame[fmLT].CreateShader(texture, sh);
46 frame[fmRT].CreateShader(texture, sh);
47 frame[fmRB].CreateShader(texture, sh);
48 frame[fmLB].CreateShader(texture, sh);
49 v = ini->r_fvector4("frame", "back");
50 frame[fmBK].SetOriginalRect(v.x, v.y, v.z, v.w);
51 frame[fmBK].SetRect(0, 0, v.z, v.w);
52 v = ini->r_fvector4("frame", "l");
53 frame[fmL].SetOriginalRect(v.x, v.y, v.z, v.w);
54 frame[fmL].SetRect(0, 0, v.z, v.w);
55 v = ini->r_fvector4("frame", "r");
56 frame[fmR].SetOriginalRect(v.x, v.y, v.z, v.w);
57 frame[fmR].SetRect(0, 0, v.z, v.w);
58 v = ini->r_fvector4("frame", "t");
59 frame[fmT].SetOriginalRect(v.x, v.y, v.z, v.w);
60 frame[fmT].SetRect(0, 0, v.z, v.w);
61 v = ini->r_fvector4("frame", "b");
62 frame[fmB].SetOriginalRect(v.x, v.y, v.z, v.w);
63 frame[fmB].SetRect(0, 0, v.z, v.w);
64 v = ini->r_fvector4("frame", "lt");
65 frame[fmLT].SetOriginalRect(v.x, v.y, v.z, v.w);
66 frame[fmLT].SetRect(0, 0, v.z, v.w);
67 v = ini->r_fvector4("frame", "rt");
68 frame[fmRT].SetOriginalRect(v.x, v.y, v.z, v.w);
69 frame[fmRT].SetRect(0, 0, v.z, v.w);
70 v = ini->r_fvector4("frame", "rb");
71 frame[fmRB].SetOriginalRect(v.x, v.y, v.z, v.w);
72 frame[fmRB].SetRect(0, 0, v.z, v.w);
73 v = ini->r_fvector4("frame", "lb");
74 frame[fmLB].SetOriginalRect(v.x, v.y, v.z, v.w);
75 frame[fmLB].SetRect(0, 0, v.z, v.w);
76 }
77 else
78 {
79 CUITextureMaster::InitTexture(strconcat(sizeof(buf), buf, texture, "_back"), &frame[CUIFrameRect::fmBK]);
80 CUITextureMaster::InitTexture(strconcat(sizeof(buf), buf, texture, "_l"), &frame[CUIFrameRect::fmL]);
81 CUITextureMaster::InitTexture(strconcat(sizeof(buf), buf, texture, "_r"), &frame[CUIFrameRect::fmR]);
82 CUITextureMaster::InitTexture(strconcat(sizeof(buf), buf, texture, "_t"), &frame[CUIFrameRect::fmT]);

Callers 1

InitZoomParamsMethod · 0.45

Calls 7

strextFunction · 0.85
existMethod · 0.80
SetRectMethod · 0.80
r_stringMethod · 0.45
CreateShaderMethod · 0.45
r_fvector4Method · 0.45
SetOriginalRectMethod · 0.45

Tested by

no test coverage detected