Skip to content

Instantly share code, notes, and snippets.

View AMZN-alexpete's full-sized avatar

Alex Peterson AMZN-alexpete

View GitHub Profile
@AMZN-alexpete
AMZN-alexpete / o3de_android_howto.md
Last active October 10, 2023 01:22
O3DE Android HowTo
@AMZN-alexpete
AMZN-alexpete / o3de_ios_howto.md
Last active October 9, 2023 23:14
O3DE iOS builds
  1. clone and setup o3de repo
git clone https://github.com/o3de/o3de
./o3de/python/get_python.sh
./o3de/scripts/o3de register --this-engine
  1. clone the project you want to build if needed
git clone http://github.com/o3de/o3de-atom-sampleviewer
cd o3de-atom-sampleviewer
@AMZN-alexpete
AMZN-alexpete / DeviceAttributeInstalledRAM.cpp
Created September 1, 2023 21:02
Retrieve physically installed system memory (Windows)
m_value = 0;
HMODULE kernel32Handle = ::GetModuleHandleW(L"Kernel32.dll");
if (kernel32Handle)
{
using Func = BOOL(WINAPI*)(_Out_ PULONGLONG TotalMemoryInKilobytes);
auto getPhysicallyInstalledSystemMemoryFunc =
reinterpret_cast<Func>(::GetProcAddress(kernel32Handle, "GetPhysicallyInstalledSystemMemory"));
if (getPhysicallyInstalledSystemMemoryFunc)
{
@AMZN-alexpete
AMZN-alexpete / SpacesscapeO3DE.md
Last active August 6, 2023 13:42
SpaceScape Skyboxes in O3DE

Using Spacescape skyboxes in O3DE

  1. Open Spacescape, load your skybox file and turn on HDR using the Settings>Enable HDR menu option. image

  2. (Optional) disable all the star layers in your skybox if you intend to use the Stars Gem and component in spacescape.

  3. Select File>Export and select the Single DDS Cube Map type and Export For OGRE 3D SpacescapeExportSettings Choose a path inside your project.

choco install neovim

To make nvim-qt appear in Windows searches, add a shortcut to it named nvim-qt in C:\Users\%USER%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs e.g. to the path C:\tools\neovim\nvim-win64\bin\nvim-qt.exe working directory: C:\tools\neovim\nvim-win64\bin

.registry file contents to add shortcuts:

@AMZN-alexpete
AMZN-alexpete / binary_size_tools.md
Created April 10, 2023 17:46
Tools for Diagnosing LIB/DLL/EXE sizes
@AMZN-alexpete
AMZN-alexpete / ebus.cpp
Created March 21, 2023 23:18
EBus Event Lambda Syntax Example
// Example of using a Lambda to perform multiple actions on an event bus (ebus)
SystemCursorState state;
AzFramework::InputSystemCursorRequestBus::Event( AzFramework::InputDeviceMouse::Id,
[&](auto requests)
{
systemCursorState = requests->GetSystemCursorState();
requests->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible);
}
);
@AMZN-alexpete
AMZN-alexpete / b.sh
Last active November 8, 2022 19:32
b.sh
#! /bin/bash
if [ -f "engine.json" ]; then
echo cmake --build build/linux --target Editor AutomatedTesting.GameLauncher --config profile -j 8
time cmake --build build/linux --target Editor AutomatedTesting.GameLauncher --config profile -j 8
elif [ -f "project.json" ]; then
project=$(grep -oP '(?<="project_name": ")[^"]*' project.json)
echo "cmake --build build/linux --target Editor ${project}.GameLauncher --config profile -j 8"
time cmake --build build/linux --target Editor ${project}.GameLauncher --config profile -j 8
else
@AMZN-alexpete
AMZN-alexpete / c.sh
Last active November 8, 2022 19:15
c.sh
#! /bin/bash
if [ -f "engine.json" ]; then
echo cmake -B build/linux -S. -G "Ninja Multi-Config" -DLY_PROJECTS=AutomatedTesting -DLY_3RDPARTY_PATH=$HOME/o3de-packages
time cmake -B build/linux -S. -G "Ninja Multi-Config" -DLY_PROJECTS=AutomatedTesting -DLY_3RDPARTY_PATH=$HOME/o3de-packages
else
echo cmake -B build/linux -S. -G "Ninja Multi-Config" -DLY_3RDPARTY_PATH=$HOME/o3de-packages
time cmake -B build/linux -S. -G "Ninja Multi-Config" -DLY_3RDPARTY_PATH=$HOME/o3de-packages
fi
@AMZN-alexpete
AMZN-alexpete / v.bat
Last active November 21, 2023 17:29
Open O3DE visual studio solution from command line
@echo off
setlocal enabledelayedexpansion
REM open first .sln file in build/windows_vs2022 with VS 2022
for %%A in (build/windows_vs2022/*.sln) do (
powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe' -ArgumentList '%CD%\build\windows_vs2022\%%A'"
GOTO finished
)
REM fall back to first .sln file in build/windows_vs2019 with VS 2019