Skip to content

Instantly share code, notes, and snippets.

View Bailey3D's full-sized avatar

Bailey Martin Bailey3D

View GitHub Profile
@Bailey3D
Bailey3D / !README.md
Created August 3, 2023 17:33 — forked from mmozeiko/!README.md
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

import win32ui, win32api, win32gui, win32con
import os, sys, glob
path = "C:/Windows/explorer.exe"
def ExtractICO(exe_str, exe_name):
exe_str = exe_str.strip()
if(os.path.isfile(exe_str)):
try:
@Bailey3D
Bailey3D / Python >> File Step
Last active December 28, 2019 15:00
Step through all files on a drive
import os, win32api
drives = win32api.GetLogicalDriveStrings()
drives = drives.split("\000")[:-1]
path = "D:\\"
files = []
for r, d, f in os.walk(path):
inline float SimpleLightBloom(float3 CamPos, float3 WorldPos, float FadeDist, float FadeExp)
{
float d = distance(CamPos, WorldPos);
float m = pow( (d / FadeDist), FadeExp);
return clamp( m, 0.0, 5.0 ); //max depends on your use case
}
float LightWrapMask = dot(SunVec , (CamVec - VertexNormals));
float4 vec = float4(0,0,0,0);
float pW = 2 / waveLength;
float wSpd = (time * phase * pW);
float wDot = (dot(wPos.xy, normalize(windVec).xy) * pW) + wSpd;
float calcSteepness = amplitude * (steepness / (amplitude * pW * 36));
vec.x = cos(wDot) * windVec.x * calcSteepness;
vec.y = cos(wDot) * windVec.y * calcSteepness;
vec.z = sin(wDot) * amplitude;
//Angle to Direction
float2 AngleToDirection(float Direction)
{
float2 Angle = {sin(Direction), cos(Direction)};
return Angle;
}
@Bailey3D
Bailey3D / C++ >> Ustruct With Methods
Last active March 18, 2022 23:27
Example of a USTRUCT with BlueprintCallable UFUNCTIONS using a BlueprintFunctionLibrary & Struct reference
/*CPP File*/
#include "MyStruct.h"
/*Header File*/
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"