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

Method Write

src/SB/Core/x/xserializer.cpp:85–128  ·  view source on GitHub ↗

non-matching: scheduling

Source from the content-addressed store, hash-verified

83
84// non-matching: scheduling
85S32 xSerial::Write(char* data, S32 elesize, S32 n)
86{
87 S32 nbit;
88
89 if (n == 0)
90 {
91 nbit = 0;
92 }
93 else
94 {
95 nbit = n > 0 ? n * elesize * 8 : -n;
96
97 if (n < 0)
98 {
99 S32 bidx = 0;
100 for (S32 i = 0; i < nbit; i++)
101 {
102 S32* iptr = (S32*)data;
103 wrbit(*iptr & g_tbl_onbit[bidx]);
104 if (++bidx == 32)
105 {
106 bidx = 0;
107 data = (char*)((U32*)data + 1);
108 }
109 }
110 }
111 else
112 {
113 S32 bidx = 0;
114 for (S32 i = 0; i < nbit; i++)
115 {
116 char* cptr = data;
117 wrbit(*cptr & g_tbl_onbit[bidx]);
118 if (++bidx == 8)
119 {
120 bidx = 0;
121 data++;
122 }
123 }
124 }
125 }
126
127 return nbit;
128}
129
130S32 xSerial::Write_b1(S32 bits)
131{

Callers 8

writeMethod · 0.80
zSceneSaveFunction · 0.80
zGameExtras_SaveFunction · 0.80
zEntDestructObj_SaveFunction · 0.80
zUI_ScenePortalSaveFunction · 0.80
zEntTeleportBox_SaveFunction · 0.80
xTimerSaveFunction · 0.80
xCounterSaveFunction · 0.80

Calls 2

wrbitFunction · 0.85
WriteFunction · 0.85

Tested by

no test coverage detected