MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSTPreLoadScene

Function xSTPreLoadScene

src/SB/Core/x/xstransvc.cpp:56–133  ·  view source on GitHub ↗

This doesn't seem exactly how HI would have written this, but it OKs TODO: Try to clean this up?

Source from the content-addressed store, hash-verified

54// This doesn't seem exactly how HI would have written this, but it OKs
55// TODO: Try to clean this up?
56S32 xSTPreLoadScene(U32 sid, void* userdata, S32 flg_hiphop)
57{
58 S32 result;
59 S32 i = 0;
60 st_STRAN_SCENE* sdata;
61 char* path;
62 if ((flg_hiphop & 3) == 2)
63 {
64 sdata = XST_lock_next();
65 sdata->scnid = sid;
66 sdata->userdata = userdata;
67 sdata->isHOP = 1;
68
69 path = XST_translate_sid_path(sid, ".HOP");
70 if (path != NULL)
71 {
72 strcpy(sdata->fnam, path);
73 i = XST_PreLoadScene(sdata, path);
74 }
75 if (i == 0)
76 {
77 path = XST_translate_sid(sid, ".HOP");
78 if (path != NULL)
79 {
80 strcpy(sdata->fnam, path);
81 i = XST_PreLoadScene(sdata, path);
82 }
83 }
84 if (i == 0)
85 {
86 XST_unlock(sdata);
87 result = 0;
88 }
89 else
90 {
91 result = i;
92 }
93 }
94 else
95 {
96 do
97 {
98 sdata = XST_lock_next();
99 sdata->scnid = sid;
100 sdata->userdata = userdata;
101 sdata->isHOP = 0;
102
103 if (sid != 0x424f4f54 && sid != 0x464f4e54)
104 {
105 path = XST_translate_sid_path(sid, ".HIP");
106 if (path != NULL)
107 {
108 strcpy(sdata->fnam, path);
109 i = XST_PreLoadScene(sdata, path);
110 }
111 }
112 if (i == 0)
113 {

Callers 4

player_sound_hop_loadFunction · 0.50
zMainLoopFunction · 0.50
zMainLoadFontHIPFunction · 0.50
zSceneInitFunction · 0.50

Calls 5

XST_translate_sid_pathFunction · 0.85
XST_PreLoadSceneFunction · 0.85
XST_translate_sidFunction · 0.85
XST_unlockFunction · 0.85
XST_lock_nextFunction · 0.70

Tested by

no test coverage detected