bot: benefit from sse4.x intrinsics if cpu capable

bot: speed some string functions if sse 4.x available
build: allow to build with native optimizations by settings -Dnative=true
This commit is contained in:
jeefo 2023-06-09 06:27:04 +03:00
commit 0b8cd9a01c
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
18 changed files with 133 additions and 89 deletions

View file

@ -154,7 +154,7 @@ CR_EXPORT int GetEntityAPI (gamefuncs_t *table, int) {
// the server for incoming clients.
// check if this client is the listen server client
if (strcmp (addr, "loopback") == 0) {
if (cr::strcmp (addr, "loopback") == 0) {
game.setLocalEntity (ent); // save the edict of the listen server client...
// if not dedicated set the default editor for graph
@ -472,7 +472,7 @@ CR_LINKAGE_C int GetEngineFunctions (enginefuncs_t *table, int *) {
if (game.is (GameFlags::Legacy)) {
table->pfnFindEntityByString = [] (edict_t *edictStartSearchAfter, const char *field, const char *value) {
// round starts in counter-strike 1.5
if (strcmp (value, "info_map_parameters") == 0) {
if (cr::strcmp (value, "info_map_parameters") == 0) {
bots.initRound ();
}
@ -891,6 +891,9 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *table, globalvars_t *glob) {
// such if necessary. Nothing really bot-related is done in this function. The actual bot
// initialization stuff will be done later, when we'll be certain to have a multilayer game.
// initialize simd-string functions
simdstring.init ();
// get the engine functions from the game...
memcpy (&engfuncs, table, sizeof (enginefuncs_t));
globals = glob;
@ -968,7 +971,7 @@ SharedLibrary::Func EntityLinkage::lookup (SharedLibrary::Handle module, const c
return m_dlsym (handle, function);
};
if (ents.needsBypass () && !strcmp (function, "CreateInterface")) {
if (ents.needsBypass () && !cr::strcmp (function, "CreateInterface")) {
ents.setPaused (true);
auto ret = resolve (module);