mirror of
https://github.com/halpz/re3.git
synced 2025-07-07 00:58:55 +00:00
Fix use of strncmp
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Camera.h"
|
||||
#include "ModelInfo.h"
|
||||
#include "General.h"
|
||||
|
||||
CTimeModelInfo*
|
||||
CTimeModelInfo::FindOtherTimeModel(void)
|
||||
@ -23,7 +24,7 @@ CTimeModelInfo::FindOtherTimeModel(void)
|
||||
for(i = 0; i < MODELINFOSIZE; i++){
|
||||
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
|
||||
if (mi && mi->GetModelType() == MITYPE_TIME &&
|
||||
strncmp(name, mi->GetName(), 24) == 0){
|
||||
!CGeneral::faststrncmp(name, mi->GetName(), MAX_MODEL_NAME)){
|
||||
m_otherTimeModelID = i;
|
||||
return (CTimeModelInfo*)mi;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ CVehicleModelInfo::SetAtomicRendererCB(RpAtomic *atomic, void *data)
|
||||
name = GetFrameNodeName(RpAtomicGetFrame(atomic));
|
||||
alpha = false;
|
||||
RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), HasAlphaMaterialCB, &alpha);
|
||||
if(strstr(name, "_hi") || strncmp(name, "extra", 5) == 0){
|
||||
if(strstr(name, "_hi") || !CGeneral::faststrncmp(name, "extra", 5)) {
|
||||
if(alpha || strncmp(name, "windscreen", 10) == 0)
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleHiDetailAlphaCB);
|
||||
else
|
||||
@ -359,7 +359,7 @@ CVehicleModelInfo::SetAtomicRendererCB_BigVehicle(RpAtomic *atomic, void *data)
|
||||
name = GetFrameNodeName(RpAtomicGetFrame(atomic));
|
||||
alpha = false;
|
||||
RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), HasAlphaMaterialCB, &alpha);
|
||||
if(strstr(name, "_hi") || strncmp(name, "extra", 5) == 0){
|
||||
if(strstr(name, "_hi") || !CGeneral::faststrncmp(name, "extra", 5)) {
|
||||
if(alpha)
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_BigVehicle);
|
||||
else
|
||||
@ -407,7 +407,7 @@ CVehicleModelInfo::SetAtomicRendererCB_Boat(RpAtomic *atomic, void *data)
|
||||
|
||||
clump = (RpClump*)data;
|
||||
name = GetFrameNodeName(RpAtomicGetFrame(atomic));
|
||||
if(strcmp(name, "boat_hi") == 0 || strncmp(name, "extra", 5) == 0)
|
||||
if(strcmp(name, "boat_hi") == 0 || !CGeneral::faststrncmp(name, "extra", 5))
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleHiDetailCB_Boat);
|
||||
else if(strstr(name, "_hi"))
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleHiDetailCB);
|
||||
@ -453,7 +453,7 @@ CVehicleModelInfo::SetAtomicRendererCB_RealHeli(RpAtomic *atomic, void *data)
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleRotorAlphaCB);
|
||||
else if(strncmp(name, "rearrotor", 9) == 0)
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleTailRotorAlphaCB);
|
||||
else if(strstr(name, "_hi") || strncmp(name, "extra", 5) == 0){
|
||||
else if(strstr(name, "_hi") || !CGeneral::faststrncmp(name, "extra", 5)) {
|
||||
if(alpha || strncmp(name, "windscreen", 10) == 0)
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderVehicleHiDetailAlphaCB);
|
||||
else
|
||||
@ -1011,11 +1011,11 @@ CVehicleModelInfo::LoadVehicleColours(void)
|
||||
continue;
|
||||
|
||||
if(section == NONE){
|
||||
if(strncmp(&line[start], "col", 3) == 0)
|
||||
if(line[start] == 'c' && line[start + 1] == 'o' && line[start + 2] == 'l')
|
||||
section = COLOURS;
|
||||
else if(strncmp(&line[start], "car", 3) == 0)
|
||||
if(line[start] == 'c' && line[start + 1] == 'a' && line[start + 2] == 'r')
|
||||
section = CARS;
|
||||
}else if(strncmp(&line[start], "end", 3) == 0){
|
||||
}else if(line[start] == 'e' && line[start + 1] == 'n' && line[start + 2] == 'd'){
|
||||
section = NONE;
|
||||
}else if(section == COLOURS){
|
||||
sscanf(&line[start], // BUG: games doesn't add start
|
||||
|
Reference in New Issue
Block a user