Suppress some compiler warning

C4668 C4191 caused by undefined macros and type cast
Hiden member class variables names
This commit is contained in:
iFuSiiOnzZ 2018-08-21 14:59:35 +02:00
parent 402f3430ed
commit 8afb3cc59a
3 changed files with 27 additions and 15 deletions

View File

@ -86,7 +86,6 @@ public class Carla : ModuleRules
private void AddCarlaServerDependency(ReadOnlyTargetRules Target)
{
string LibCarlaInstallPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../CarlaDependencies"));
bEnableExceptions = true;
ADelegate GetLibName = (string BaseName) => {
if (IsWindows(Target))

View File

@ -11,6 +11,18 @@
#include "GameFramework/SpectatorPawn.h"
// NOTE(Andrei): disable warning generated by undefined macros
// __GNUC__, __GNUC_MINOR__
// MSGPACK_ARCH_AMD64
// DBG, BETA, OFFICIAL_BUILD
// NTDDI_WIN7SP1
// _APISET_RTLSUPPORT_VER
// _APISET_INTERLOCKED_VER
// _APISET_SECURITYBASE_VER
// _WIN32_WINNT_WINTHRESHOLD
#pragma warning(push)
#pragma warning(disable: 4668 4191)
#include <compiler/disable-ue4-macros.h>
#include <carla/Version.h>
#include <carla/rpc/Actor.h>
@ -21,6 +33,7 @@
#include <carla/rpc/VehicleControl.h>
#include <carla/streaming/Server.h>
#include <compiler/enable-ue4-macros.h>
#pragma warning(pop)
#include <vector>

View File

@ -64,19 +64,19 @@ void ACarlaVehicleController::Tick(float DeltaTime)
Super::Tick(DeltaTime);
if (IsPossessingAVehicle()) {
auto Vehicle = GetPossessedVehicle();
auto CurrentVehicle = GetPossessedVehicle();
CarlaPlayerState->UpdateTimeStamp(DeltaTime);
const FVector PreviousSpeed = CarlaPlayerState->ForwardSpeed * CarlaPlayerState->GetOrientation();
CarlaPlayerState->Transform = Vehicle->GetVehicleTransform();
CarlaPlayerState->ForwardSpeed = Vehicle->GetVehicleForwardSpeed();
CarlaPlayerState->Transform = CurrentVehicle->GetVehicleTransform();
CarlaPlayerState->ForwardSpeed = CurrentVehicle->GetVehicleForwardSpeed();
const FVector CurrentSpeed = CarlaPlayerState->ForwardSpeed * CarlaPlayerState->GetOrientation();
CarlaPlayerState->Acceleration = (CurrentSpeed - PreviousSpeed) / DeltaTime;
const auto &AutopilotControl = GetAutopilotControl();
CarlaPlayerState->Steer = AutopilotControl.Steer;
CarlaPlayerState->Throttle = AutopilotControl.Throttle;
CarlaPlayerState->Brake = AutopilotControl.Brake;
CarlaPlayerState->bHandBrake = AutopilotControl.bHandBrake;
CarlaPlayerState->CurrentGear = Vehicle->GetVehicleCurrentGear();
const auto &AutopilotCtrl = GetAutopilotControl();
CarlaPlayerState->Steer = AutopilotCtrl.Steer;
CarlaPlayerState->Throttle = AutopilotCtrl.Throttle;
CarlaPlayerState->Brake = AutopilotCtrl.Brake;
CarlaPlayerState->bHandBrake = AutopilotCtrl.bHandBrake;
CarlaPlayerState->CurrentGear = CurrentVehicle->GetVehicleCurrentGear();
CarlaPlayerState->SpeedLimit = GetSpeedLimit();
CarlaPlayerState->TrafficLightState = GetTrafficLightState();
IntersectPlayerWithRoadMap();
@ -106,18 +106,18 @@ void ACarlaVehicleController::OnCollisionEvent(
void ACarlaVehicleController::IntersectPlayerWithRoadMap()
{
auto RoadMap = GetRoadMap();
if (RoadMap == nullptr) {
auto CurrentRoadMap = GetRoadMap();
if (CurrentRoadMap == nullptr) {
UE_LOG(LogCarla, Error, TEXT("Controller doesn't have a road map!"));
return;
}
check(IsPossessingAVehicle());
auto Vehicle = GetPossessedVehicle();
auto CurrentVehicle = GetPossessedVehicle();
constexpr float ChecksPerCentimeter = 0.1f;
const auto *BoundingBox = Vehicle->GetVehicleBoundingBox();
const auto *BoundingBox = CurrentVehicle->GetVehicleBoundingBox();
check(BoundingBox != nullptr);
auto Result = RoadMap->Intersect(
auto Result = CurrentRoadMap->Intersect(
BoundingBox->GetComponentTransform(),
BoundingBox->GetUnscaledBoxExtent(),
ChecksPerCentimeter);