Skip to content

Commit

Permalink
Add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
ldpl committed Feb 21, 2024
1 parent f70c17b commit d06acbf
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/citymania/cm_colour.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "../stdafx.h"

#include "cm_colour.hpp"

#include "../safeguards.h"
#include <cstdint>

namespace citymania {

const uint8_t RGB_TO_M[16 * 16 * 16] = {70, 70, 70, 178, 40, 41, 179, 42, 180, 181, 181, 181, 182, 182, 183, 184, 1, 1, 104, 178, 71, 122, 179, 42, 180, 181, 181, 181, 182, 182, 183, 184, 104, 104, 104, 105, 60, 122, 123, 73, 180, 181, 181, 162, 182, 183, 183, 184, 80, 80, 88, 24, 32, 32, 61, 73, 74, 74, 162, 162, 182, 163, 183, 184, 81, 81, 81, 89, 25, 33, 54, 108, 62, 62, 75, 162, 163, 163, 163, 185, 82, 82, 82, 82, 26, 26, 26, 55, 55, 115, 63, 63, 116, 163, 185, 185, 83, 83, 83, 83, 83, 27, 27, 55, 55, 63, 63, 63, 64, 117, 185, 185, 84, 84, 84, 84, 84, 84, 84, 28, 56, 56, 63, 64, 64, 64, 186, 186, 84, 84, 85, 85, 85, 85, 85, 85, 28, 56, 64, 64, 64, 192, 192, 187, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 57, 192, 192, 192, 193, 193, 206, 206, 206, 206, 206, 206, 206, 206, 87, 87, 87, 65, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 87, 87, 87, 87, 65, 66, 66, 66, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 66, 66, 66, 189, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 50, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 191, 51, 51, 1, 70, 70, 178, 40, 41, 41, 42, 180, 181, 181, 181, 182, 182, 183, 184, 1, 1, 1, 178, 71, 41, 179, 42, 180, 181, 181, 181, 182, 182, 183, 184, 104, 104, 2, 105, 60, 72, 123, 73, 180, 181, 181, 162, 182, 183, 183, 184, 96, 96, 88, 24, 32, 107, 113, 73, 74, 74, 162, 162, 182, 163, 183, 184, 81, 81, 81, 89, 25, 33, 54, 108, 62, 62, 75, 162, 163, 163, 163, 164, 82, 82, 82, 82, 26, 26, 26, 55, 109, 115, 63, 116, 116, 163, 185, 185, 83, 83, 83, 83, 83, 27, 27, 55, 55, 63, 63, 63, 117, 117, 185, 185, 84, 84, 84, 84, 84, 84, 84, 28, 56, 56, 63, 64, 64, 64, 186, 186, 84, 84, 85, 85, 85, 85, 85, 85, 28, 56, 64, 64, 64, 192, 192, 187, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 57, 192, 192, 192, 193, 193, 206, 206, 206, 206, 206, 206, 206, 206, 87, 87, 87, 65, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 87, 87, 87, 94, 65, 66, 66, 66, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 66, 66, 66, 189, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 50, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 1, 1, 70, 40, 40, 41, 41, 42, 180, 43, 181, 181, 182, 182, 183, 184, 1, 1, 1, 40, 71, 41, 41, 42, 180, 43, 181, 162, 182, 182, 183, 184, 2, 2, 2, 2, 71, 72, 123, 42, 43, 43, 181, 162, 182, 163, 183, 184, 96, 96, 88, 3, 32, 112, 113, 73, 74, 74, 162, 162, 182, 163, 163, 184, 81, 81, 89, 89, 25, 33, 108, 114, 62, 75, 75, 162, 163, 163, 163, 164, 82, 82, 82, 82, 26, 26, 34, 34, 109, 115, 75, 116, 76, 163, 185, 185, 83, 83, 83, 83, 83, 27, 27, 55, 55, 63, 63, 116, 117, 117, 185, 185, 84, 84, 84, 84, 84, 84, 84, 28, 56, 56, 56, 64, 64, 64, 186, 186, 84, 84, 85, 85, 85, 85, 85, 85, 28, 56, 57, 64, 64, 192, 192, 187, 85, 85, 85, 85, 85, 86, 86, 86, 86, 93, 57, 192, 192, 192, 193, 193, 206, 206, 206, 206, 206, 206, 206, 206, 87, 87, 87, 65, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 87, 87, 87, 94, 65, 66, 66, 195, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 66, 66, 66, 189, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 50, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 1, 1, 1, 40, 40, 41, 41, 42, 43, 43, 181, 162, 182, 182, 183, 184, 1, 1, 2, 2, 71, 41, 42, 42, 43, 43, 181, 162, 182, 163, 183, 184, 2, 2, 2, 128, 3, 72, 42, 42, 43, 43, 181, 162, 182, 163, 163, 184, 96, 3, 3, 3, 3, 112, 73, 73, 74, 74, 162, 162, 182, 163, 163, 164, 97, 97, 97, 89, 4, 33, 108, 114, 74, 75, 75, 162, 163, 163, 163, 164, 97, 97, 97, 90, 90, 26, 34, 34, 109, 115, 75, 76, 76, 163, 185, 185, 83, 83, 90, 90, 90, 91, 27, 55, 35, 63, 116, 116, 117, 117, 185, 185, 84, 84, 84, 84, 84, 91, 91, 28, 56, 56, 56, 64, 64, 118, 186, 186, 84, 84, 85, 85, 85, 85, 85, 28, 28, 56, 57, 64, 64, 192, 192, 187, 85, 85, 85, 85, 85, 86, 86, 86, 86, 93, 57, 192, 192, 192, 193, 187, 206, 206, 206, 206, 206, 206, 206, 206, 87, 87, 87, 65, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 87, 87, 87, 94, 65, 66, 66, 195, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 66, 66, 66, 189, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 50, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 198, 198, 198, 198, 170, 41, 42, 42, 43, 43, 43, 44, 182, 163, 163, 184, 198, 198, 198, 128, 128, 41, 42, 42, 43, 43, 44, 162, 182, 163, 163, 184, 198, 128, 128, 128, 128, 72, 42, 42, 43, 43, 44, 162, 162, 163, 163, 164, 128, 128, 128, 3, 16, 4, 73, 124, 43, 43, 44, 162, 162, 163, 163, 164, 97, 16, 16, 16, 4, 4, 5, 124, 74, 75, 44, 162, 163, 163, 163, 164, 97, 97, 97, 97, 5, 5, 34, 34, 115, 125, 75, 76, 76, 163, 163, 164, 98, 98, 98, 98, 98, 91, 91, 35, 35, 110, 116, 116, 77, 77, 185, 165, 84, 84, 91, 91, 91, 91, 91, 28, 56, 110, 110, 117, 117, 118, 118, 186, 84, 84, 84, 85, 85, 92, 92, 92, 28, 57, 57, 64, 64, 118, 118, 186, 85, 85, 85, 85, 85, 86, 86, 86, 93, 93, 57, 57, 192, 192, 193, 187, 206, 206, 206, 206, 206, 206, 206, 206, 87, 87, 94, 58, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 207, 87, 94, 94, 65, 65, 66, 195, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 95, 95, 66, 66, 189, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 95, 50, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 198, 198, 198, 136, 170, 170, 170, 42, 43, 43, 44, 44, 162, 163, 163, 164, 198, 198, 198, 136, 170, 170, 170, 42, 43, 43, 44, 44, 162, 163, 163, 164, 198, 198, 128, 128, 129, 170, 42, 43, 43, 43, 44, 44, 162, 163, 163, 164, 128, 128, 129, 129, 129, 130, 130, 43, 43, 44, 44, 44, 162, 163, 163, 164, 154, 154, 16, 16, 16, 17, 5, 124, 125, 44, 44, 162, 45, 163, 163, 164, 155, 155, 155, 17, 5, 5, 5, 125, 125, 125, 76, 76, 45, 163, 163, 164, 98, 98, 98, 98, 98, 98, 6, 6, 35, 126, 76, 76, 77, 77, 165, 165, 98, 98, 99, 99, 99, 99, 99, 35, 35, 110, 116, 117, 117, 118, 118, 165, 99, 99, 99, 99, 99, 92, 92, 92, 28, 36, 111, 111, 118, 118, 118, 186, 85, 85, 85, 85, 85, 86, 93, 93, 93, 93, 57, 58, 58, 119, 119, 187, 206, 206, 206, 206, 206, 206, 206, 206, 93, 93, 94, 58, 65, 65, 65, 194, 207, 207, 207, 207, 207, 207, 207, 207, 207, 94, 94, 94, 65, 65, 66, 195, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 95, 95, 66, 66, 196, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 95, 95, 95, 50, 50, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 190, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 198, 198, 136, 136, 170, 170, 170, 170, 43, 43, 44, 44, 44, 163, 163, 164, 198, 198, 136, 136, 170, 170, 170, 171, 43, 43, 44, 44, 44, 163, 163, 164, 199, 199, 199, 136, 170, 170, 170, 171, 43, 43, 44, 44, 44, 163, 163, 164, 199, 199, 129, 129, 129, 130, 130, 43, 43, 44, 44, 44, 45, 163, 163, 164, 154, 154, 154, 130, 130, 130, 131, 131, 44, 44, 44, 44, 45, 45, 163, 164, 155, 155, 155, 17, 17, 17, 5, 18, 125, 125, 126, 45, 45, 45, 46, 164, 98, 98, 98, 98, 98, 18, 6, 6, 6, 126, 126, 126, 77, 46, 46, 165, 99, 99, 99, 99, 99, 99, 99, 7, 7, 126, 126, 77, 77, 118, 118, 165, 99, 99, 99, 99, 99, 92, 100, 100, 36, 36, 111, 111, 78, 118, 118, 166, 100, 100, 100, 100, 100, 100, 100, 93, 93, 29, 29, 58, 58, 119, 119, 166, 206, 206, 206, 206, 206, 206, 206, 93, 93, 29, 58, 58, 37, 119, 120, 120, 207, 207, 207, 207, 207, 207, 207, 207, 94, 94, 94, 94, 30, 59, 120, 195, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 95, 95, 95, 95, 66, 196, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 95, 95, 95, 95, 196, 196, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 190, 190, 51, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 51, 144, 144, 136, 136, 170, 170, 170, 171, 171, 43, 44, 44, 44, 45, 163, 164, 144, 144, 136, 136, 170, 170, 170, 171, 171, 43, 44, 44, 44, 45, 163, 164, 144, 199, 136, 136, 170, 170, 171, 171, 171, 44, 44, 44, 45, 45, 163, 164, 200, 200, 200, 200, 130, 171, 171, 171, 171, 44, 44, 44, 45, 45, 45, 164, 154, 154, 154, 130, 130, 130, 131, 131, 44, 44, 44, 45, 45, 45, 45, 164, 155, 155, 155, 155, 131, 131, 131, 131, 132, 44, 45, 45, 45, 45, 46, 165, 156, 156, 156, 156, 156, 18, 18, 6, 6, 126, 126, 45, 45, 46, 46, 165, 157, 157, 157, 157, 157, 157, 7, 7, 7, 126, 126, 77, 77, 46, 46, 165, 99, 99, 99, 99, 99, 100, 100, 100, 8, 8, 111, 78, 78, 78, 47, 166, 100, 100, 100, 100, 100, 100, 100, 100, 93, 29, 29, 58, 119, 119, 119, 166, 206, 206, 206, 206, 206, 93, 93, 101, 101, 29, 58, 58, 37, 119, 120, 120, 207, 207, 207, 207, 207, 207, 207, 94, 94, 94, 94, 30, 59, 59, 120, 120, 207, 207, 207, 207, 207, 207, 208, 208, 94, 94, 95, 95, 95, 95, 196, 196, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 95, 95, 95, 95, 196, 196, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 95, 51, 51, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 51, 51, 68, 144, 144, 136, 136, 170, 170, 170, 171, 171, 171, 44, 44, 45, 45, 45, 164, 144, 145, 136, 136, 170, 170, 171, 171, 171, 171, 44, 44, 45, 45, 45, 164, 145, 145, 145, 136, 137, 170, 171, 171, 171, 172, 44, 44, 45, 45, 45, 164, 200, 200, 200, 200, 137, 171, 171, 171, 172, 172, 44, 44, 45, 45, 45, 164, 201, 201, 201, 201, 201, 131, 171, 172, 172, 44, 44, 45, 45, 45, 45, 46, 155, 155, 155, 155, 131, 131, 131, 132, 132, 44, 45, 45, 45, 45, 46, 46, 156, 156, 156, 156, 156, 18, 132, 132, 132, 126, 126, 45, 46, 46, 46, 165, 157, 157, 157, 157, 157, 157, 19, 19, 19, 7, 126, 46, 46, 46, 46, 165, 157, 157, 157, 157, 157, 100, 7, 8, 8, 8, 8, 127, 127, 47, 47, 47, 100, 100, 100, 100, 100, 100, 100, 100, 8, 9, 9, 127, 127, 79, 79, 166, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 58, 37, 37, 119, 120, 120, 101, 101, 101, 101, 101, 101, 101, 101, 94, 94, 30, 30, 59, 59, 120, 121, 207, 207, 207, 207, 207, 207, 94, 94, 94, 94, 95, 95, 95, 38, 38, 121, 208, 208, 208, 208, 208, 208, 208, 208, 208, 95, 95, 95, 95, 95, 196, 196, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 95, 95, 95, 197, 197, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 68, 68, 68, 145, 145, 145, 136, 137, 170, 171, 171, 171, 172, 172, 44, 45, 45, 45, 45, 145, 145, 145, 136, 137, 137, 171, 171, 171, 172, 172, 44, 45, 45, 45, 45, 145, 145, 145, 137, 137, 137, 171, 171, 171, 172, 172, 44, 45, 45, 45, 46, 146, 146, 146, 137, 137, 171, 171, 171, 172, 172, 172, 45, 45, 45, 45, 46, 201, 201, 201, 201, 201, 138, 171, 172, 172, 172, 172, 45, 45, 45, 46, 46, 201, 201, 201, 201, 202, 131, 131, 172, 172, 172, 45, 45, 45, 46, 46, 46, 202, 202, 202, 202, 202, 132, 132, 132, 132, 132, 45, 45, 46, 46, 46, 46, 157, 157, 157, 157, 157, 157, 19, 19, 19, 133, 133, 46, 46, 46, 47, 47, 157, 157, 157, 157, 158, 158, 19, 19, 8, 8, 20, 127, 127, 47, 47, 47, 158, 158, 158, 158, 158, 158, 158, 20, 20, 9, 9, 127, 127, 79, 47, 48, 214, 214, 214, 214, 101, 101, 101, 101, 101, 101, 10, 37, 37, 79, 120, 48, 101, 101, 101, 101, 101, 101, 101, 101, 101, 30, 30, 30, 59, 59, 120, 121, 207, 207, 207, 207, 101, 94, 94, 102, 102, 102, 102, 59, 59, 38, 121, 121, 208, 208, 208, 208, 208, 208, 208, 208, 95, 95, 95, 95, 95, 31, 31, 197, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 95, 95, 95, 197, 197, 197, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 68, 68, 68, 68, 145, 145, 145, 137, 137, 137, 171, 171, 171, 172, 172, 172, 45, 45, 45, 45, 145, 145, 145, 137, 137, 137, 171, 171, 171, 172, 172, 172, 45, 45, 45, 46, 146, 146, 146, 137, 137, 137, 171, 171, 172, 172, 172, 172, 45, 45, 45, 46, 146, 146, 146, 137, 137, 137, 171, 172, 172, 172, 172, 173, 45, 45, 45, 46, 146, 146, 201, 201, 138, 138, 138, 172, 172, 172, 173, 173, 45, 45, 46, 46, 202, 202, 202, 202, 202, 138, 172, 172, 172, 173, 173, 173, 45, 46, 46, 46, 202, 202, 202, 202, 202, 202, 132, 132, 173, 173, 173, 45, 46, 46, 46, 46, 157, 157, 157, 157, 203, 203, 132, 19, 133, 133, 133, 46, 46, 46, 47, 47, 157, 157, 158, 158, 158, 158, 158, 133, 133, 133, 133, 127, 127, 47, 47, 47, 158, 158, 158, 158, 158, 158, 158, 20, 20, 20, 9, 127, 127, 47, 47, 48, 214, 214, 214, 214, 214, 214, 214, 101, 9, 21, 21, 10, 10, 79, 48, 48, 101, 101, 101, 101, 101, 101, 101, 101, 101, 10, 10, 10, 11, 38, 120, 167, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 102, 38, 38, 121, 121, 208, 208, 208, 102, 102, 102, 102, 102, 102, 102, 95, 31, 31, 31, 31, 197, 209, 209, 209, 209, 209, 209, 209, 209, 95, 95, 95, 95, 103, 39, 39, 197, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 103, 68, 68, 68, 69, 146, 146, 146, 146, 137, 137, 171, 171, 172, 172, 172, 172, 173, 45, 45, 46, 146, 146, 146, 146, 137, 137, 171, 171, 172, 172, 172, 172, 173, 45, 45, 46, 146, 146, 146, 146, 137, 137, 138, 172, 172, 172, 172, 173, 173, 45, 45, 46, 146, 146, 146, 146, 137, 138, 138, 172, 172, 172, 172, 173, 173, 45, 46, 46, 147, 147, 147, 147, 138, 138, 138, 172, 172, 172, 173, 173, 173, 45, 46, 46, 147, 147, 147, 202, 202, 138, 139, 172, 172, 173, 173, 173, 173, 46, 46, 46, 202, 202, 202, 202, 202, 202, 139, 173, 173, 173, 173, 173, 46, 46, 46, 46, 203, 203, 203, 203, 203, 203, 203, 173, 173, 173, 173, 173, 46, 46, 47, 47, 203, 203, 203, 203, 203, 203, 158, 133, 133, 133, 133, 174, 47, 47, 47, 47, 158, 158, 158, 158, 158, 158, 214, 214, 133, 133, 21, 21, 127, 47, 48, 48, 214, 214, 214, 214, 214, 214, 214, 214, 159, 21, 21, 21, 134, 48, 48, 48, 159, 159, 159, 159, 159, 159, 159, 159, 159, 10, 10, 11, 11, 11, 48, 49, 159, 159, 159, 159, 102, 102, 102, 102, 102, 102, 102, 11, 11, 12, 121, 167, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 31, 31, 31, 31, 39, 209, 209, 209, 209, 209, 102, 95, 95, 103, 103, 103, 103, 103, 103, 39, 39, 209, 209, 209, 209, 209, 209, 209, 209, 209, 103, 103, 103, 103, 39, 69, 69, 146, 146, 146, 146, 137, 138, 138, 138, 172, 172, 172, 172, 173, 173, 45, 46, 146, 146, 146, 146, 137, 138, 138, 138, 172, 172, 172, 173, 173, 173, 45, 46, 146, 146, 146, 146, 137, 138, 138, 138, 172, 172, 172, 173, 173, 173, 45, 46, 147, 147, 147, 147, 138, 138, 138, 139, 172, 172, 172, 173, 173, 173, 46, 46, 147, 147, 147, 147, 138, 138, 139, 139, 139, 172, 173, 173, 173, 173, 46, 46, 147, 147, 147, 147, 138, 139, 139, 139, 139, 173, 173, 173, 173, 173, 46, 46, 148, 148, 148, 148, 148, 139, 139, 173, 173, 173, 173, 173, 173, 174, 46, 47, 203, 203, 203, 203, 203, 203, 203, 173, 173, 173, 173, 174, 174, 174, 47, 47, 203, 203, 203, 203, 203, 203, 203, 133, 133, 133, 174, 174, 174, 47, 47, 47, 204, 204, 204, 204, 204, 204, 204, 204, 133, 133, 174, 174, 174, 47, 48, 48, 214, 214, 214, 214, 214, 214, 214, 159, 159, 21, 21, 134, 134, 48, 48, 48, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 134, 134, 22, 11, 48, 49, 159, 159, 159, 159, 159, 159, 213, 213, 102, 102, 22, 11, 12, 12, 12, 49, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 160, 103, 12, 12, 13, 168, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 39, 39, 209, 209, 209, 209, 103, 103, 103, 103, 103, 103, 103, 103, 103, 39, 69, 69, 146, 146, 146, 146, 147, 138, 138, 139, 139, 172, 140, 140, 173, 173, 173, 46, 146, 146, 146, 147, 147, 138, 138, 139, 139, 139, 140, 173, 173, 173, 173, 46, 147, 147, 147, 147, 147, 138, 138, 139, 139, 139, 140, 173, 173, 173, 173, 46, 147, 147, 147, 147, 147, 138, 139, 139, 139, 140, 140, 173, 173, 173, 173, 46, 147, 147, 147, 147, 147, 139, 139, 139, 139, 140, 173, 173, 173, 173, 174, 46, 148, 148, 148, 148, 148, 139, 139, 139, 140, 140, 173, 173, 173, 173, 174, 46, 148, 148, 148, 148, 148, 139, 140, 140, 173, 173, 173, 173, 173, 174, 174, 174, 149, 149, 149, 149, 149, 149, 203, 173, 173, 173, 173, 174, 174, 174, 174, 47, 149, 149, 149, 149, 203, 203, 150, 150, 174, 174, 174, 174, 174, 174, 174, 47, 204, 204, 204, 204, 204, 204, 204, 204, 204, 174, 174, 174, 174, 174, 48, 48, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 134, 134, 134, 175, 48, 48, 205, 205, 205, 205, 205, 205, 159, 159, 159, 213, 134, 134, 22, 22, 49, 49, 159, 159, 159, 159, 213, 213, 213, 213, 213, 213, 22, 22, 12, 12, 12, 49, 213, 213, 213, 213, 213, 213, 160, 160, 160, 160, 160, 160, 12, 23, 13, 168, 160, 160, 160, 160, 160, 160, 160, 103, 103, 103, 103, 103, 103, 13, 13, 168, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 14, 14, 169, 147, 147, 147, 147, 147, 138, 139, 139, 139, 140, 140, 140, 141, 141, 141, 141, 147, 147, 147, 147, 147, 138, 139, 139, 139, 140, 140, 140, 141, 141, 141, 174, 147, 147, 147, 147, 147, 138, 139, 139, 139, 140, 140, 140, 141, 141, 141, 174, 147, 147, 147, 147, 147, 139, 139, 139, 140, 140, 140, 140, 141, 141, 141, 174, 147, 147, 147, 148, 148, 139, 139, 139, 140, 140, 140, 141, 141, 141, 174, 174, 148, 148, 148, 148, 148, 139, 140, 140, 140, 140, 141, 141, 141, 174, 174, 174, 148, 148, 148, 148, 148, 140, 140, 140, 140, 141, 141, 141, 174, 174, 174, 174, 149, 149, 149, 149, 149, 149, 149, 140, 173, 173, 141, 174, 174, 174, 174, 174, 149, 149, 149, 149, 149, 150, 150, 150, 174, 174, 174, 174, 174, 174, 174, 143, 150, 150, 150, 150, 150, 150, 204, 204, 174, 174, 174, 174, 174, 143, 143, 175, 204, 204, 204, 204, 204, 204, 151, 151, 205, 205, 143, 143, 143, 175, 175, 175, 205, 205, 205, 205, 205, 205, 205, 205, 205, 213, 134, 134, 175, 175, 176, 176, 205, 205, 205, 213, 213, 213, 213, 213, 213, 213, 160, 22, 12, 23, 23, 49, 213, 213, 213, 213, 213, 213, 160, 160, 160, 160, 160, 160, 23, 23, 135, 135, 160, 160, 160, 160, 160, 160, 160, 160, 160, 212, 212, 212, 212, 13, 14, 14, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 211, 211, 161, 14, 169, 147, 147, 147, 147, 147, 139, 139, 139, 140, 140, 140, 140, 141, 141, 141, 141, 147, 147, 147, 147, 147, 139, 139, 139, 140, 140, 140, 141, 141, 141, 141, 141, 147, 147, 147, 147, 147, 139, 139, 139, 140, 140, 140, 141, 141, 141, 141, 141, 147, 147, 147, 147, 148, 139, 139, 140, 140, 140, 140, 141, 141, 141, 141, 174, 148, 148, 148, 148, 148, 139, 140, 140, 140, 140, 141, 141, 141, 141, 141, 174, 148, 148, 148, 148, 148, 140, 140, 140, 140, 140, 141, 141, 141, 141, 174, 174, 148, 148, 148, 148, 148, 140, 140, 140, 141, 141, 141, 141, 141, 142, 174, 174, 149, 149, 149, 149, 149, 149, 140, 141, 141, 141, 141, 142, 142, 174, 174, 174, 149, 149, 149, 149, 150, 150, 150, 150, 142, 142, 142, 142, 174, 174, 174, 143, 150, 150, 150, 150, 150, 150, 150, 150, 142, 142, 174, 174, 174, 143, 143, 175, 204, 204, 204, 151, 151, 151, 151, 151, 151, 151, 143, 143, 143, 143, 175, 175, 151, 151, 151, 151, 151, 151, 205, 205, 205, 152, 143, 143, 175, 175, 176, 176, 205, 205, 205, 205, 205, 152, 152, 152, 152, 152, 152, 175, 176, 176, 176, 177, 152, 152, 152, 152, 152, 152, 152, 152, 160, 160, 160, 212, 23, 135, 177, 177, 160, 160, 160, 160, 160, 160, 160, 160, 212, 212, 212, 212, 153, 153, 14, 14, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 211, 211, 211, 161, 210, 169};

// uint8_t GetMForRGB(uint8_t r, uint8_t g, uint8_t b) {
// uint k = ((uint)(r & 0xf0) >> 4) | ((uint)g & 0xf0) | ((uint)(b & 0xf0) << 4);
// return RGB_TO_M[k];
// }


// uint8 cm_mdict[64 * 64 * 64] = {0};
// uint8 GetMForRGB(uint8 r, uint8 g, uint8 b) {
// if (r==0 && g==0 && b==0) return 0;
// r &= 252; g &= 252; b &= 252;
// auto key = (r << 10) | (g << 4) | (b >> 2);
// auto m = cm_mdict[key];
// if (m != 0) return m;
// uint md = UINT_MAX;
// for (uint8 i = 1; i < 0xc0; i++) {
// auto c = this->LookupColourInPalette(i);
// auto rmean = (int)c.r + (int)r;
// auto dr = (int)c.r - (int)r;
// auto dg = (int)c.g - (int)g;
// auto db = (int)c.b - (int)b;
// auto dist = (1020 + rmean) * dr * dr + 2040 * dg * dg + (1530 - rmean) * db * db;
// // auto dist = r * r + g * g + b * b;
// if (dist < md) {
// md = dist;
// m = i;
// }
// }
// cm_mdict[key] = m;
// return m;
// }

} // namespace citymania
Loading

0 comments on commit d06acbf

Please sign in to comment.