Skip to content

Instantly share code, notes, and snippets.

[ModMeta]
schema=1
name=test pois
author=Weird and Wry
desc=test desc
version=1.0.0
[DemandCurve]
id = waw_demand_id_1
name = test demand 1
lon lat color text font_size max_lod transparent demand population
-2.2004 53.4831 ff4411 Sportsball One 1 3 0 waw_demand_id_1 10000000
2.1229 41.3809 1144ff Sportsball Two 1 3 0 waw_demand_id_1 5000000
-43.2303 -22.9122 44ff11 Sportsball Three 1 3 0 waw_demand_id_1 8000000
-83.7487 42.2659 ffff44 Sportsball Four 1 3 0 waw_demand_id_1 7000000
@carloscm
carloscm / gist:0d3488dd88bc759f442cdfa698b0c764
Created October 15, 2023 16:04
1.10 OSM key= whitelist
"type",
"aerialway",
"aeroway",
"amenity",
"barrier",
"boundary",
"admin_level",
"craft",
"emergency",
"lifeguard",
@carloscm
carloscm / gist:2a7f9d1b0135125358d18e450df0b54f
Last active October 2, 2023 20:40
fix texture array in bgfx dx12
diff --git a/thirdparty/bgfx/src/renderer_d3d12.cpp b/thirdparty/bgfx/src/renderer_d3d12.cpp
index 3a4194271..2a66d4c80 100644
--- a/thirdparty/bgfx/src/renderer_d3d12.cpp
+++ b/thirdparty/bgfx/src/renderer_d3d12.cpp
@@ -5387,7 +5387,7 @@ namespace bgfx { namespace d3d12
if (0 != kk)
{
kk = 0;
- for (uint8_t side = 0; side < numSides; ++side)
+ for (uint16_t side = 0; side < numSides; ++side)

image link

#include <stb_image_resize.h>
static void build_mips(uint8_t* data, size_t base, uint32_t w, uint32_t h)
{
uint32_t mw = w;
uint32_t mh = h;
uint32_t pw = w;
uint32_t ph = h;
size_t prev_start = base;
size_t last_size = size_t(w) * size_t(h) * 4;
// https://github.com/memononen/nanosvg
#include <nanosvg.h>
struct CLSVG {
vg::CommandListHandle handle = { VG_INVALID_HANDLE };
float width = 0.0f;
float height = 0.0f;
};
static uint32_t modulate_color_alpha(uint32_t color, float alpha) {
struct UIDeclare {
virtual bool button(const char* txt, int flags = 0) = 0;
virtual void label(const char* txt, int flags = 0) = 0;
virtual void space() = 0;
};
struct UILayoutEmit : public UIDeclare {
lay_context ctx;
lay_id root = 0;
eastl::vector<lay_id> ids;
@carloscm
carloscm / bgfx-nuklear.cpp
Last active June 13, 2024 11:35
bgfx renderer for nuklear. Bring your own event handling and your own common sense for integration into your project.
#include "../platform/platform.h"
#include <cstdlib>
#include <cstring>
#include <bgfx/bgfx.h>
#include <bgfx/embedded_shader.h>
#include <bx/allocator.h>
#include <bx/math.h>
#define NK_IMPLEMENTATION
(define-mod-export job-logistic-sm (state-machine
(start pre-check)
(args job-giver state-component phase)
(vars
work-ticks 0)
(state basic-info
(vars
state-component-c (ecs-get-component job-giver state-component)