- Forked from Godot Engine 4.7-dev (MIT License) - Rebranded to AeThex Engine with cyan/purple theme - Added AI-powered development assistant module - Integrated Claude API for code completion & error fixing - Custom hexagon logo and branding - Multi-platform CI/CD (Windows, Linux, macOS) - Built Linux editor binary (151MB) - Complete source code with all customizations Tech Stack: - C++ game engine core - AI Module: Claude 3.5 Sonnet integration - Build: SCons, 14K+ source files - License: MIT (Godot) + Custom (AeThex features) Ready for Windows build via GitHub Actions!
27 lines
772 B
C++
27 lines
772 B
C++
|
|
#pragma once
|
|
|
|
#include "arithmetics.hpp"
|
|
#include "Vector2.hpp"
|
|
#include "BitmapRef.hpp"
|
|
|
|
namespace msdfgen {
|
|
|
|
template <typename T, int N>
|
|
inline void interpolate(T *output, const BitmapConstSection<T, N> &bitmap, Point2 pos) {
|
|
pos.x = clamp(pos.x, double(bitmap.width));
|
|
pos.y = clamp(pos.y, double(bitmap.height));
|
|
pos -= .5;
|
|
int l = (int) floor(pos.x);
|
|
int b = (int) floor(pos.y);
|
|
int r = l+1;
|
|
int t = b+1;
|
|
double lr = pos.x-l;
|
|
double bt = pos.y-b;
|
|
l = clamp(l, bitmap.width-1), r = clamp(r, bitmap.width-1);
|
|
b = clamp(b, bitmap.height-1), t = clamp(t, bitmap.height-1);
|
|
for (int i = 0; i < N; ++i)
|
|
output[i] = mix(mix(bitmap(l, b)[i], bitmap(r, b)[i], lr), mix(bitmap(l, t)[i], bitmap(r, t)[i], lr), bt);
|
|
}
|
|
|
|
}
|