2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-28 15:45:46 +03:00

HLTV-Core: Fixed wrong size of lightstyles

HLTV-Console: Added macros LAUNCHER_FIXES
This commit is contained in:
s1lent 2017-12-09 23:24:18 +07:00
parent aac529d2e4
commit e5d26bc4d2
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
4 changed files with 40 additions and 47 deletions

View File

@ -24,7 +24,7 @@ void setupToolchain(NativeBinarySpec b) {
boolean useGcc = project.hasProperty("useGcc")
def cfg = rootProject.createToolchainConfig(b);
cfg.projectInclude(project, '/..', '/../..', '/src', '/../../common', '/../../engine', '/../../public', '/../../public/rehlds');
cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'HLTV', '_CONSOLE'
cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'HLTV', 'LAUNCHER_FIXES', '_CONSOLE'
if (cfg instanceof MsvcToolchainConfig) {
cfg.compilerOptions.pchConfig = new MsvcToolchainConfig.PrecompiledHeadersConfig(

View File

@ -353,13 +353,6 @@ void World::AddLightStyle(int index, char *style)
m_System->Printf("WARNING! World::SetLightStyle: style too long (%i).\n", length);
}
// FIXME: code mismatch
// Original code:
// Q_strncopy(..., 64);
// ...[63] = '\0';
// Current code:
// Q_strncopy(..., 64);
// ...[64] = '\0';
Q_strlcpy(m_Lightstyles[index], style);
}

View File

@ -251,8 +251,12 @@ protected:
entity_state_t m_Instanced_BaseLines[MAX_INSTANCED_BASELINES];
int m_MaxInstanced_BaseLine;
// TODO: wtf, why 65? here should be 64
#ifdef HOOK_HLTV
char m_Lightstyles[MAX_LIGHTSTYLES][65];
#else
char m_Lightstyles[MAX_LIGHTSTYLES][64];
#endif // HOOK_HLTV
movevars_t m_MoveVars;
BSPModel m_WorldModel;

View File

@ -27,6 +27,7 @@ struct delta_test_struct_t {
uint8 b_61; // 20
};
#pragma pack(pop)
typedef delta_test_struct_t dts_t;
struct delta_res_t
@ -65,7 +66,6 @@ NOINLINE qboolean _DoMarkFields(void* src, void* dst, delta_t* delta, bool useJi
qboolean sendfields;
#ifdef REHLDS_JIT
if (useJit) {
DELTA_ClearFlags(delta);
return DELTAJit_Fields_Clear_Mark_Check((unsigned char*)src, (unsigned char*)dst, delta, NULL);
} else
#endif
@ -163,7 +163,6 @@ NOINLINE void _MarkAndEnsureCorrectResults(const char* action, delta_t* delta, v
}
}
NOINLINE void _GetBitmaskAndBytecount(delta_t* delta, int* bits, int* bytecount, int usejit) {
#ifdef REHLDS_JIT
if (usejit) {
@ -248,7 +247,6 @@ void _DeltaSimpleTests(delta_t* delta, delta_simpletest_data_t* tests, int tests
}
}
TEST(MarkFieldsTest_Simple_Primitives, Delta, 1000) {
EngineInitializer engInitGuard;
@ -368,8 +366,6 @@ TEST(TestDelta_Test, Delta, 1000) {
for (size_t i = 0; i < 4; i++)
{
int tested = DELTA_TestDelta((uint8 *)&from, (uint8 *)&testdata[i], delta);
if (tested != result[i])
rehlds_syserror("TestDelta_Test: returned bitcount %i is not equal to true value %i", tested, result[i]);
CHECK(va("TestDelta_Test: returned bitcount %i is not equal to true value %i on iter %i", tested, result[i], i), tested == result[i]);
}
}