Skip to content

Commit

Permalink
1.4.1 Actor rename
Browse files Browse the repository at this point in the history
* Renamed Omega actors to use OA_ prefex, for easier readiblity.
* Added Demo Assets: RetroStyle guns
* Added Import functions for .png & .wav

BUGS
* Fixed Dynamic Camera treating Master Cam as Source Cam
* Fixed Data Widget not refreshing when Source Asset changed
  • Loading branch information
StudioSyndiCatCaius committed Aug 3, 2024
1 parent 64b4297 commit 2670b79
Show file tree
Hide file tree
Showing 220 changed files with 256 additions and 236 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/Blueprints/Components/AOE_Manager.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/Blueprints/PAL_OGF_BP.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/AOE/OmegaAOE_Box.uasset
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/AOE/OmegaAOE_Cone.uasset
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/AOE/OmegaAOE_Self.uasset
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/AOE/OmegaAOE_Single.uasset
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/AOE/OmegaAOE_Sphere.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/DemoSky.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/OmegaDemoCharacter.uasset
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/OmegaGameMode_Gameplay.uasset
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/PAL_OGF_Demo.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/DEMO/Systems/System_Event_Pause.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OmegaGameFramework/Content/Materials/M_Omega_Prop.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
175 changes: 0 additions & 175 deletions OmegaGameFramework/OmegaGameFramework.uplugin

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public OmegaGameFramework(ReadOnlyTargetRules Target) : base(Target)
"ApplicationCore",
"LevelSequence",
"MovieScene",
"ImageWrapper",
"MetasoundEngine",
"UMG",
"InputCore",
Expand All @@ -68,7 +69,8 @@ public OmegaGameFramework(ReadOnlyTargetRules Target) : base(Target)
"AssetRegistry",
"GameplayTags",
"PropertyPath",
"DeveloperSettings"
"DeveloperSettings",
"AudioPlatformConfiguration",
// ... add private dependencies that you statically link with here ...
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Event_Phys_Hit,"Event.Physics.Hit");
UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Event_Phys_Touch,"Event.Physics.Touch");
UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Event_Phys_Break,"Event.Physics.Break");

UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Event_Drag_Grab,"Event.Drag.Grab");
UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Event_Drag_Drop,"Event.Drag.Drop");

UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Pref_Game,"Preferences.Game");
UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Pref_Visual,"Preferences.Visual");
UE_DEFINE_GAMEPLAY_TAG(Tag_Omega_Pref_Audio,"Preferences.Audio");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ AOmegaDynamicCamera* UOmegaDynamicCameraSubsystem::GetSourceCamera()
AOmegaDynamicCamera* out=nullptr;
for(auto* temp_cam : source_cameras)
{
if(temp_cam)
if(temp_cam && temp_cam!=GetDynamicCamera()) //If camera is valid & is NOT the Master Camera.
{
if(out)
{
Expand Down Expand Up @@ -142,6 +142,8 @@ void UOmegaDynamicCameraSubsystem::InterpToTarget(AOmegaDynamicCamera* cam_sourc
cam_master->comp_spring->TargetArmLength=UKismetMathLibrary::FInterpTo(cam_master->comp_spring->TargetArmLength,cam_source->comp_spring->TargetArmLength,last_delta,speed);
cam_master->comp_spring->SetRelativeLocation(UKismetMathLibrary::VInterpTo(cam_master->comp_spring->GetRelativeLocation(),cam_source->comp_spring->GetRelativeLocation(),last_delta,speed));
cam_master->comp_spring->SetRelativeRotation(UKismetMathLibrary::RInterpTo(cam_master->comp_spring->GetRelativeRotation(),cam_source->comp_spring->GetRelativeRotation(),last_delta,speed));
cam_master->comp_spring->SocketOffset==UKismetMathLibrary::VInterpTo(cam_master->comp_spring->SocketOffset,cam_source->comp_spring->SocketOffset,last_delta,speed);
cam_master->comp_spring->TargetOffset==UKismetMathLibrary::VInterpTo(cam_master->comp_spring->TargetOffset,cam_source->comp_spring->TargetOffset,last_delta,speed);
}
}

Expand Down Expand Up @@ -235,7 +237,18 @@ void AOmegaDynamicCamera::Tick(float DeltaSeconds)
{
if(CameraActive)
{
ActiveTick(DeltaSeconds);
if(!REF_SourcePlayer)
{
REF_SourcePlayer=UGameplayStatics::GetPlayerController(this,0);
}
if(!REF_Subsystem && REF_SourcePlayer)
{
REF_Subsystem=REF_SourcePlayer->GetLocalPlayer()->GetSubsystem<UOmegaDynamicCameraSubsystem>();
}
if(REF_Subsystem && REF_SourcePlayer)
{
ActiveTick(DeltaSeconds,REF_Subsystem->GetSourceCamera()!=this,REF_SourcePlayer);
}
}
if(SetRotationToPlayerControl)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "Subsystems/OmegaSubsystem_File.h"
#include "Engine/GameInstance.h"
#include "Engine/World.h"
#include "Engine/Texture2D.h"

#include "HAL/FileManager.h"
#include "Misc/FileHelper.h"
#include "Misc/Paths.h"
#include "FileSDKBPLibrary.h"

#include "Sound/SoundWave.h"
#include "Sound/SoundWaveProcedural.h"
#include "Misc/FileHelper.h"

#include "OmegaSettings.h"
#include "Kismet/BlueprintPathsLibrary.h"
#include "Kismet/KismetRenderingLibrary.h"

#include "Kismet/KismetSystemLibrary.h"

#include "ImageUtils.h"

void UOmegaFileSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
Expand Down Expand Up @@ -98,5 +105,89 @@ UObject* UOmegaFileSubsystem::GetOverrideObject(FString name, UClass* Class) con
return nullptr;
}

UTexture2D* UOmegaFileFunctions::OmegaImport_Texture2D(const FString& FilePath)
{
UTexture2D* Texture = FImageUtils::ImportFileAsTexture2D(FilePath);;
if(Texture)
{

return Texture;
}
return nullptr;
}

struct FWaveHeader
{
// WAV file header structure
uint8 RIFF[4]; // RIFF Header
uint32 ChunkSize; // RIFF Chunk Size
uint8 WAVE[4]; // WAVE Header
uint8 fmt[4]; // FMT header
uint32 Subchunk1Size; // Size of the fmt chunk
uint16 AudioFormat; // Audio format
uint16 NumOfChan; // Number of channels
uint32 SamplesPerSec; // Sampling Frequency in Hz
uint32 bytesPerSec; // bytes per second
uint16 blockAlign; // 2=16-bit mono, 4=16-bit stereo
uint16 bitsPerSample; // Number of bits per sample
uint8 Subchunk2ID[4]; // "data" string
uint32 Subchunk2Size; // Sampled data length
};

USoundWave* UOmegaFileFunctions::OmegaImport_Sound(const FString& FilePath, FString& Error)
{
// Check if the file exists
if (!FPlatformFileManager::Get().GetPlatformFile().FileExists(*FilePath))
{
Error="File does not exist: "+FilePath;
UE_LOG(LogTemp, Error, TEXT("File does not exist: %s"), *FilePath);
return nullptr;
}

// Load the file to a byte array
TArray<uint8> RawFileData;
if (!FFileHelper::LoadFileToArray(RawFileData, *FilePath))
{
Error="Failed to load file: "+FilePath;
UE_LOG(LogTemp, Error, TEXT("Failed to load file: %s"), *FilePath);
return nullptr;
}

// Parse the WAV header
if (RawFileData.Num() < sizeof(FWaveHeader))
{
Error="File is too small to be a valid WAV file: "+FilePath;
UE_LOG(LogTemp, Error, TEXT("File is too small to be a valid WAV file: %s"), *FilePath);
return nullptr;
}

FWaveHeader* WaveHeader = reinterpret_cast<FWaveHeader*>(RawFileData.GetData());
if (FMemory::Memcmp(WaveHeader->RIFF, "RIFF", 4) != 0 || FMemory::Memcmp(WaveHeader->WAVE, "WAVE", 4) != 0)
{
UE_LOG(LogTemp, Error, TEXT("Invalid WAV file: %s"), *FilePath);
return nullptr;
}

// Create a new USoundWaveProcedural object
USoundWaveProcedural* SoundWave = NewObject<USoundWaveProcedural>(USoundWaveProcedural::StaticClass());
if (!SoundWave)
{
UE_LOG(LogTemp, Error, TEXT("Failed to create USoundWaveProcedural object"));
return nullptr;
}

// Set properties from WAV header
SoundWave->SetSampleRate(WaveHeader->SamplesPerSec);
SoundWave->NumChannels = WaveHeader->NumOfChan;
SoundWave->Duration = static_cast<float>(WaveHeader->Subchunk2Size) / (WaveHeader->SamplesPerSec * WaveHeader->NumOfChan * (WaveHeader->bitsPerSample / 8));

// Set the raw PCM data (skip the header)
const uint8* PCMData = RawFileData.GetData() + sizeof(FWaveHeader);
int32 PCMDataSize = RawFileData.Num() - sizeof(FWaveHeader);
SoundWave->QueueAudio(PCMData, PCMDataSize);

return SoundWave;
}



Loading

0 comments on commit 2670b79

Please sign in to comment.