Skip to content

Instantly share code, notes, and snippets.

@geordiemhall
geordiemhall / MyCheatManager.cpp
Last active March 15, 2024 10:27
UE4 Cheat manager with meta-based cheat names
#include "MyCheatManager.h"
#include "Engine/Console.h"
#include "AssetRegistryModule.h"
DEFINE_LOG_CATEGORY(LogCheatManager);
void UMyCheatManager::AddWorkers(int32 NumWorkers)
{
UE_LOG(LogCheatManager, Log, TEXT("%s: AddWorkers: %i"), *GetName(), NumWorkers);
}
@statico
statico / gpu.cpp
Last active January 25, 2024 01:06
Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU
#ifdef _WIN32
// Use discrete GPU by default.
extern "C" {
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
@valryon
valryon / CheatCode.cs
Created April 1, 2014 09:06
Unity cheat code handler
// Copyright © 2014 Pixelnest Studio
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
using UnityEngine;
namespace Pixelnest
{
/// <summary>
/// Trigger an event is a cheat code is recognized
/// </summary>
using System.Threading;
Console.Beep(658, 125);
Console.Beep(1320, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 250);
Console.Beep(1320, 125);
Console.Beep(1188, 125);
Console.Beep(1056, 250);