Change up strcasecmp/strncasecmp to be more C++y

This commit is contained in:
iikorni
2026-08-30 16:40:12 -05:00
parent 7a697986c6
commit da2a9a8fbc
32 changed files with 351 additions and 790 deletions
+11 -11
View File
@@ -40,8 +40,10 @@ read from the demo file.
*/
// from ProQuake: space to fill out the demo header for record at any time
static byte *demo_head;
static int *demo_head_sizes;
// static byte *demo_head;
// static int *demo_head_sizes;
std::vector<std::vector<byte>> demo_head{};
/*
==============
@@ -49,8 +51,7 @@ CL_ClearSignons
==============
*/
void CL_ClearSignons(void) {
VEC_CLEAR(demo_head);
VEC_CLEAR(demo_head_sizes);
demo_head.clear();
cls.signon = 0;
}
@@ -178,8 +179,10 @@ int CL_GetMessage(void) {
if (cls.signon < 2) {
// record messages before full connection, so that a
// demo record can happen after connection is done
Vec_Append((void **) &demo_head, 1, net_message.data(), net_message.size());
VEC_PUSH(demo_head_sizes, net_message.size());
std::vector<byte> new_msg{};
new_msg.resize(net_message.size());
std::memcpy(new_msg.data(), net_message.data(), net_message.size());
demo_head.push_back(new_msg);
}
return r;
@@ -300,12 +303,9 @@ void CL_Record_f(void) {
static byte tmpbuf[NET_MAXMESSAGE];
net::msg old = net_message;
const auto count = VEC_SIZE(demo_head_sizes);
auto offset = 0;
for (auto i = 0; i < count; i++) {
for (auto msg : demo_head) {
net_message = net::msg{};
net_message.write(&demo_head[offset], demo_head_sizes[i]);
offset += demo_head_sizes[i];
net_message.write(msg.data(), msg.size());
CL_WriteDemoMessage();
}