Skip to content

Instantly share code, notes, and snippets.

View minexew's full-sized avatar
🥒
pray4eggplant

Minexew minexew

🥒
pray4eggplant
View GitHub Profile
View extract-texture-names.py
import os
for f in sorted(os.listdir("AllModel")):
if f.endswith(".mtl"):
with open(f"AllModel/{f}", "rt") as file:
for line in file:
if line.startswith("\tmap_Kd "):
texture = line.rstrip()[-6:]
print(f"INSERT INTO \"model_texture\" VALUES('Stalker','{f.replace('mtl', 'mbac')}','{texture}');")
break
View build-packages-list.py
#!/usr/bin/env python
#usage: build-package-list.py <directory>
from __future__ import print_function
import os
import sys
DIR = sys.argv[1]
View ShaderGlobal.cpp
// Renderer.hpp
class ShaderGlobal {
public:
ShaderGlobal(const char* name) {
this->handle = Rend::CreateShaderGlobal(name);
}
template <typename T>
void operator = (const T& value) {
@minexew
minexew / fixheader.py
Created July 29, 2014 20:45
/gd/ is pretty cool
View fixheader.py
# usage: fixheader.py <valid_bmp> <file_to_fix>
HEADER_SIZE = 54
import sys
header = sys.argv[1]
fileName = sys.argv[2]
with open(header, 'rb') as input, open(fileName, 'rb+') as output: