Skip to content

Commit

Permalink
Migrated to work with 4.17 (and probably 4.16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gundlack Florian committed Aug 10, 2017
1 parent 5a3fe79 commit c8270d2
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 62 deletions.
9 changes: 0 additions & 9 deletions .gitignore

This file was deleted.

74 changes: 74 additions & 0 deletions Tutorials/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/Packaged/*
/Content/StarterContent
.DS_Store

# Visual Studio 2015 user specific files
.vs/

# Visual Studio 2015 database file
*.VC.db

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.ipa

# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb

# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga

# Binary Files
Binaries/*

# Builds
Build/*

# Don't ignore icon files in Build
!Build/**/*.ico

# Built data for maps
*_BuiltData.uasset

# Configuration files generated by the Editor
Saved/*

# Compiled source files for the engine to use
Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*
Binary file removed Tutorials/Binaries/Win64/UE4Editor-Tutorials.dll
Binary file not shown.
Binary file removed Tutorials/Binaries/Win64/UE4Editor-Tutorials.pdb
Binary file not shown.
Binary file modified Tutorials/Content/Maps/OutlinePostEffect_Map.umap
Binary file not shown.
15 changes: 2 additions & 13 deletions Tutorials/Source/Tutorials.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,10 @@

public class TutorialsTarget : TargetRules
{
public TutorialsTarget(TargetInfo Target)
public TutorialsTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
}

//
// TargetRules interface.
//

public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("Tutorials");
ExtraModuleNames.Add("Tutorials");
}
}
8 changes: 5 additions & 3 deletions Tutorials/Source/Tutorials/Private/TutorialsCharacter.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Tutorials.h"
#include "TutorialsCharacter.h"
#include "Tutorials.h"
#include "TutorialsProjectile.h"

//////////////////////////////////////////////////////////////////////////
Expand All @@ -19,7 +19,9 @@ ATutorialsCharacter::ATutorialsCharacter(const class FObjectInitializer& PCIP)

// Create a CameraComponent
FirstPersonCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));
FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();
GetCapsuleComponent()->AttachToComponent(FirstPersonCameraComponent, FAttachmentTransformRules::KeepRelativeTransform);
//FirstPersonCameraComponent->AttachToComponent(this, GetCapsuleComponent());

FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera

// Default offset from the character location for projectiles to spawn
Expand All @@ -28,7 +30,7 @@ ATutorialsCharacter::ATutorialsCharacter(const class FObjectInitializer& PCIP)
// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)
Mesh1P = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("CharacterMesh1P"));
Mesh1P->SetOnlyOwnerSee(true); // only the owning player will see this mesh
Mesh1P->AttachParent = FirstPersonCameraComponent;
Mesh1P->AttachToComponent(FirstPersonCameraComponent, FAttachmentTransformRules::KeepRelativeTransform);
Mesh1P->RelativeLocation = FVector(0.f, 0.f, -150.f);
Mesh1P->bCastDynamicShadow = false;
Mesh1P->CastShadow = false;
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/Source/Tutorials/Private/TutorialsGameMode.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Tutorials.h"
#include "TutorialsGameMode.h"
#include "Tutorials.h"
#include "TutorialsHUD.h"

ATutorialsGameMode::ATutorialsGameMode(const class FObjectInitializer& PCIP)
Expand Down
6 changes: 4 additions & 2 deletions Tutorials/Source/Tutorials/Private/TutorialsHUD.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Tutorials.h"
#include "TutorialsHUD.h"
#include "Tutorials.h"


ATutorialsHUD::ATutorialsHUD(const class FObjectInitializer& PCIP) : Super(PCIP)
ATutorialsHUD::ATutorialsHUD(const class FObjectInitializer& PCIP):
Super(PCIP)
{
// Set the crosshair texture
static ConstructorHelpers::FObjectFinder<UTexture2D> CrosshiarTexObj(TEXT("/Game/Textures/T_Crosshair_D"));
Expand Down
6 changes: 3 additions & 3 deletions Tutorials/Source/Tutorials/Private/TutorialsProjectile.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Tutorials.h"
#include "TutorialsProjectile.h"

#include "Tutorials.h"

ATutorialsProjectile::ATutorialsProjectile(const class FObjectInitializer& PCIP)
: Super(PCIP)
Expand All @@ -26,7 +25,8 @@ ATutorialsProjectile::ATutorialsProjectile(const class FObjectInitializer& PCIP)
InitialLifeSpan = 3.0f;
}

void ATutorialsProjectile::OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
//(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
void ATutorialsProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
// Only add impulse and destroy projectile if we hit a physics
if ((OtherActor != NULL) && (OtherActor != this) && (OtherComp != NULL) && OtherComp->IsSimulatingPhysics())
Expand Down
10 changes: 8 additions & 2 deletions Tutorials/Source/Tutorials/Public/TutorialsCharacter.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/Character.h"

#include "TutorialsCharacter.generated.h"

UCLASS(config=Game)
class ATutorialsCharacter : public ACharacter
class TUTORIALS_API ATutorialsCharacter : public ACharacter
{
GENERATED_UCLASS_BODY()
GENERATED_BODY()

public:

ATutorialsCharacter(const class FObjectInitializer& PCIP);

/** Pawn mesh: 1st person view (arms; seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
Expand Down
9 changes: 6 additions & 3 deletions Tutorials/Source/Tutorials/Public/TutorialsGameMode.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/GameModeBase.h"
#include "TutorialsGameMode.generated.h"

UCLASS(minimalapi)
class ATutorialsGameMode : public AGameMode
UCLASS()
class TUTORIALS_API ATutorialsGameMode : public AGameModeBase
{
GENERATED_UCLASS_BODY()
GENERATED_BODY()

public:
ATutorialsGameMode(const class FObjectInitializer& PCIP);
};


Expand Down
7 changes: 5 additions & 2 deletions Tutorials/Source/Tutorials/Public/TutorialsHUD.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/HUD.h"
#include "TutorialsHUD.generated.h"

UCLASS()
class ATutorialsHUD : public AHUD
class TUTORIALS_API ATutorialsHUD : public AHUD
{
GENERATED_UCLASS_BODY()
GENERATED_BODY()

public:

ATutorialsHUD(const class FObjectInitializer& PCIP);

/** Primary draw call for the HUD */
virtual void DrawHUD() override;

Expand Down
13 changes: 10 additions & 3 deletions Tutorials/Source/Tutorials/Public/TutorialsProjectile.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/Actor.h"
#include "Components/SphereComponent.h"

#include "TutorialsProjectile.generated.h"

UCLASS(config=Game)
class ATutorialsProjectile : public AActor
class TUTORIALS_API ATutorialsProjectile : public AActor
{
GENERATED_UCLASS_BODY()
GENERATED_BODY()

public:

ATutorialsProjectile(const class FObjectInitializer& PCIP);

/** Sphere collision component */
UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
Expand All @@ -18,6 +25,6 @@ class ATutorialsProjectile : public AActor

/** called when projectile hits something */
UFUNCTION()
void OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
};

4 changes: 3 additions & 1 deletion Tutorials/Source/Tutorials/Tutorials.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

public class Tutorials : ModuleRules
{
public Tutorials(TargetInfo Target)
public Tutorials(ReadOnlyTargetRules Target): base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

#include "Tutorials.h"
#include "UsableActor.h"
#include "Tutorials.h"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@


#include "Tutorials.h"
#include "UsableCppCharacter.h"
#include "Tutorials.h"
#include "UsableActor.h"
#include "TutorialsProjectile.h"

#include "Engine/World.h"

AUsableCppCharacter::AUsableCppCharacter()
: Super()
Expand All @@ -18,13 +18,13 @@ AUsableCppCharacter::AUsableCppCharacter()

// Create a CameraComponent
FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));
FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();
FirstPersonCameraComponent->AttachToComponent(GetCapsuleComponent(), FAttachmentTransformRules::KeepRelativeTransform);
FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera

// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)
Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));
Mesh1P->SetOnlyOwnerSee(true); // only the owning player will see this mesh
Mesh1P->AttachParent = FirstPersonCameraComponent;
Mesh1P->AttachToComponent(FirstPersonCameraComponent, FAttachmentTransformRules::KeepRelativeTransform);
Mesh1P->RelativeLocation = FVector(0.f, 0.f, -150.f);
Mesh1P->bCastDynamicShadow = false;
Mesh1P->CastShadow = false;
Expand Down Expand Up @@ -58,7 +58,7 @@ AUsableActor* AUsableCppCharacter::GetUsableInView()
TraceParams.bTraceComplex = true;

FHitResult Hit(ForceInit);
GetWorld()->LineTraceSingle(Hit, start_trace, end_trace, COLLISION_PROJECTILE, TraceParams);
ActorLineTraceSingle(Hit, start_trace, end_trace, COLLISION_PROJECTILE, TraceParams);

//DrawDebugLine(GetWorld(), start_trace, end_trace, FColor(255, 255, 255), false, 1);

Expand Down
15 changes: 2 additions & 13 deletions Tutorials/Source/TutorialsEditor.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,10 @@

public class TutorialsEditorTarget : TargetRules
{
public TutorialsEditorTarget(TargetInfo Target)
public TutorialsEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
}

//
// TargetRules interface.
//

public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("Tutorials");
ExtraModuleNames.Add("Tutorials");
}
}
2 changes: 1 addition & 1 deletion Tutorials/Tutorials.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "4.10",
"EngineAssociation": "{57375377-44E8-71FB-8A37-70803ED6365A}",
"Category": "",
"Description": "",
"Modules": [
Expand Down

0 comments on commit c8270d2

Please sign in to comment.