Compare commits
No commits in common. "08e3dfd9d3b5356e29809c1b925ea712d452db03" and "a872bede2cdbe64d60fca4dbeecee8a33e1a9b80" have entirely different histories.
08e3dfd9d3
...
a872bede2c
@ -61,7 +61,6 @@ add_shader(basic_pixel_shader)
|
|||||||
add_executable(mikemon
|
add_executable(mikemon
|
||||||
src/log.cpp
|
src/log.cpp
|
||||||
src/load_entire_file.cpp
|
src/load_entire_file.cpp
|
||||||
src/smol-atlas.cpp
|
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(mikemon
|
target_link_libraries(mikemon
|
||||||
|
|||||||
Binary file not shown.
@ -1,229 +1,253 @@
|
|||||||
const unsigned char SPIRV_basic_pixel_shader[] =
|
const unsigned char SPIRV_basic_pixel_shader[] =
|
||||||
{
|
{
|
||||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x53, 0x50, 0x56, 0x5f, 0x4b, 0x48,
|
0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x53, 0x50, 0x56, 0x5f, 0x4b, 0x48,
|
||||||
0x52, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f,
|
0x52, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f,
|
||||||
0x00, 0x00, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x6e, 0x53, 0x65, 0x6d, 0x61, 0x6e,
|
0x00, 0x00, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x6e, 0x53, 0x65, 0x6d, 0x61, 0x6e,
|
||||||
0x74, 0x69, 0x63, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x66,
|
0x74, 0x69, 0x63, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x66,
|
||||||
0x6f, 0x2e, 0x31, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x4c,
|
0x6f, 0x2e, 0x31, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x4c,
|
||||||
0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00,
|
0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||||
0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03,
|
0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00,
|
||||||
0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x10, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x02, 0x00,
|
||||||
0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x75, 0x69, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x07,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x75, 0x69, 0x6e, 0x74, 0x00,
|
||||||
0x00, 0x13, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76, 0x65, 0x6e, 0x2f, 0x70,
|
0x00, 0x00, 0x00, 0x07, 0x00, 0x13, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76,
|
||||||
0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x6d, 0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x73,
|
0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x6d, 0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e,
|
||||||
0x65, 0x74, 0x73, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x70, 0x69,
|
0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x73, 0x69,
|
||||||
0x78, 0x65, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x00, 0x00, 0x07,
|
0x63, 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e,
|
||||||
0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xed, 0x00,
|
0x67, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x19, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63,
|
0x07, 0x00, 0x08, 0x01, 0x19, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x75, 0x6c, 0x6b, 0x61, 0x6e,
|
0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x75,
|
||||||
0x31, 0x30, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63,
|
0x6c, 0x6b, 0x61, 0x6e, 0x31, 0x30, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2d, 0x65, 0x6e, 0x76, 0x20, 0x76, 0x75,
|
0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2d, 0x65, 0x6e,
|
||||||
0x6c, 0x6b, 0x61, 0x6e, 0x31, 0x2e, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
0x76, 0x20, 0x76, 0x75, 0x6c, 0x6b, 0x61, 0x6e, 0x31, 0x2e, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x4d, 0x6f,
|
||||||
0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2d, 0x70, 0x6f, 0x69,
|
0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79,
|
||||||
0x6e, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x0a, 0x23, 0x76, 0x65,
|
0x2d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31,
|
||||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x34, 0x35, 0x30, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x72, 0x6f,
|
0x0a, 0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x34, 0x35, 0x30, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75,
|
||||||
0x77, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x3b, 0x0a, 0x6c,
|
0x74, 0x28, 0x72, 0x6f, 0x77, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72,
|
||||||
0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x72, 0x6f, 0x77, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x29, 0x20, 0x62, 0x75,
|
0x6d, 0x3b, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x72, 0x6f, 0x77, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72,
|
||||||
0x66, 0x66, 0x65, 0x72, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x32, 0x20, 0x22, 0x2f, 0x68,
|
0x29, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x32,
|
||||||
0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x6d,
|
|
||||||
0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x65,
|
|
||||||
0x72, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65,
|
|
||||||
0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, 0x6e,
|
|
||||||
0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x29, 0x0a,
|
|
||||||
0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x74,
|
|
||||||
0x65, 0x78, 0x31, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, 0x6e, 0x64,
|
|
||||||
0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x29, 0x0a, 0x75,
|
|
||||||
0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x74, 0x65, 0x78, 0x74,
|
|
||||||
0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c,
|
|
||||||
0x69, 0x6e, 0x65, 0x20, 0x31, 0x37, 0x38, 0x30, 0x20, 0x22, 0x68, 0x6c, 0x73, 0x6c, 0x2e, 0x6d, 0x65, 0x74, 0x61,
|
|
||||||
0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x29, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20,
|
|
||||||
0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69,
|
|
||||||
0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20,
|
|
||||||
0x31, 0x37, 0x38, 0x30, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x20, 0x3d, 0x20, 0x30, 0x29, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6e, 0x70, 0x75,
|
|
||||||
0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x37,
|
|
||||||
0x20, 0x22, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
|
0x20, 0x22, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
|
||||||
0x74, 0x73, 0x2f, 0x6d, 0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x73,
|
0x74, 0x73, 0x2f, 0x6d, 0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x73,
|
||||||
0x68, 0x61, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73,
|
0x68, 0x61, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73,
|
||||||
0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
|
0x68, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74,
|
||||||
0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f,
|
0x28, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x65, 0x74, 0x20, 0x3d,
|
||||||
0x30, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f,
|
0x20, 0x32, 0x29, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
|
||||||
0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x38, 0x0a, 0x76, 0x6f,
|
0x32, 0x44, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x74, 0x65, 0x78, 0x31, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x6c, 0x61,
|
||||||
0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20,
|
0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73,
|
||||||
0x31, 0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f,
|
0x65, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x29, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d,
|
||||||
0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x3b, 0x0a, 0x0a,
|
0x70, 0x6c, 0x65, 0x72, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x5f, 0x53, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65,
|
0x72, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x37, 0x38, 0x30, 0x20, 0x22,
|
||||||
0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x28, 0x74, 0x65, 0x78,
|
0x68, 0x6c, 0x73, 0x6c, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x6c, 0x61,
|
||||||
0x31, 0x5f, 0x30, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x29, 0x0a,
|
||||||
0x5f, 0x30, 0x29, 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x2e,
|
0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74,
|
||||||
0x78, 0x79, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x32, 0x32, 0x0a, 0x20, 0x20,
|
0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x3b,
|
||||||
0x20, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x20,
|
0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x37, 0x38, 0x30, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75,
|
||||||
0x3d, 0x20, 0x5f, 0x53, 0x31, 0x3b, 0x0a, 0x0a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79,
|
0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x29, 0x0a, 0x69, 0x6e, 0x20,
|
||||||
0x50, 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c,
|
0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x3b, 0x0a,
|
||||||
0x6f, 0x72, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x2e, 0x63, 0x6f, 0x6c,
|
0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x37, 0x38, 0x30, 0x0a, 0x66, 0x6c, 0x61, 0x74, 0x20, 0x6c,
|
||||||
0x6f, 0x72, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x32, 0x36, 0x0a, 0x20, 0x20, 0x20,
|
0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x31, 0x29,
|
||||||
0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x07, 0x00, 0x04, 0x00, 0x1f, 0x00,
|
0x0a, 0x69, 0x6e, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6c, 0x65,
|
||||||
0x00, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x00, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00, 0x5f,
|
0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x37, 0x20,
|
||||||
0x53, 0x31, 0x00, 0x07, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x32, 0x64, 0x2e,
|
0x22, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x73, 0x76, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
|
||||||
0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00, 0x40, 0x74, 0x79,
|
0x73, 0x2f, 0x6d, 0x69, 0x6b, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x73, 0x68,
|
||||||
0x70, 0x65, 0x2e, 0x32, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x36, 0x00,
|
0x61, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73, 0x68,
|
||||||
0x00, 0x00, 0x74, 0x65, 0x78, 0x31, 0x5f, 0x30, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x74,
|
0x61, 0x64, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20,
|
||||||
0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00,
|
|
||||||
0x3c, 0x00, 0x00, 0x00, 0x40, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x07, 0x00, 0x41, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61,
|
|
||||||
0x6d, 0x70, 0x6c, 0x65, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x45, 0x00, 0x00, 0x00, 0x74,
|
|
||||||
0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00,
|
|
||||||
0x07, 0x00, 0x07, 0x00, 0x46, 0x00, 0x00, 0x00, 0x40, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c,
|
|
||||||
0x65, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x07, 0x00, 0x06, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x69, 0x6e,
|
|
||||||
0x70, 0x75, 0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x54,
|
|
||||||
0x00, 0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x07, 0x00, 0x07, 0x00, 0x58, 0x00, 0x00, 0x00,
|
|
||||||
0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30,
|
0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30,
|
||||||
0x00, 0x07, 0x00, 0x05, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x00,
|
0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30,
|
||||||
0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x74, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x69,
|
0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x38, 0x0a, 0x76, 0x6f, 0x69,
|
||||||
0x00, 0x00, 0x00, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f,
|
0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x31,
|
||||||
0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a,
|
0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75,
|
||||||
0x00, 0x47, 0x4c, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x63, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c,
|
0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x0a,
|
||||||
0x65, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x00, 0x00, 0x05,
|
0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x5f, 0x53, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65, 0x78,
|
||||||
0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00,
|
0x74, 0x75, 0x72, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x41, 0x72, 0x72, 0x61, 0x79,
|
||||||
0x26, 0x00, 0x00, 0x00, 0x5f, 0x53, 0x31, 0x00, 0x05, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78,
|
0x28, 0x74, 0x65, 0x78, 0x31, 0x5f, 0x30, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d,
|
||||||
0x31, 0x5f, 0x30, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72,
|
0x70, 0x6c, 0x65, 0x72, 0x5f, 0x30, 0x29, 0x2c, 0x20, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, 0x69, 0x6e, 0x70, 0x75,
|
||||||
0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4a,
|
0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28,
|
||||||
0x00, 0x00, 0x00, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00,
|
0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x30, 0x29, 0x29,
|
||||||
0x05, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72,
|
0x29, 0x29, 0x29, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x32, 0x32, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||||
0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x06, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x20, 0x3d, 0x20,
|
||||||
0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x6f,
|
0x5f, 0x53, 0x31, 0x3b, 0x0a, 0x0a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f,
|
||||||
0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x00, 0x00,
|
0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
||||||
0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69,
|
0x5f, 0x30, 0x20, 0x3d, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
||||||
0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00,
|
0x5f, 0x30, 0x3b, 0x0a, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x32, 0x36, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72,
|
||||||
0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x22,
|
0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x07, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
0x66, 0x6c, 0x6f, 0x61, 0x74, 0x00, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00, 0x5f, 0x53, 0x31,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
|
0x00, 0x07, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x32, 0x64, 0x2e, 0x69, 0x6d,
|
||||||
0x00, 0x47, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00,
|
0x61, 0x67, 0x65, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00, 0x40, 0x74, 0x79, 0x70, 0x65,
|
||||||
0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x04,
|
0x2e, 0x32, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00,
|
0x74, 0x65, 0x78, 0x31, 0x5f, 0x30, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70,
|
||||||
0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
|
0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x3c, 0x00,
|
||||||
0x00, 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0b, 0x00,
|
0x00, 0x00, 0x40, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x07,
|
||||||
0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x07, 0x00, 0x41, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x6c, 0x65, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x45, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70,
|
||||||
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
|
0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x07, 0x00,
|
||||||
0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
0x07, 0x00, 0x46, 0x00, 0x00, 0x00, 0x40, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64,
|
||||||
0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0d,
|
0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x07, 0x00, 0x06, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x70, 0x75,
|
||||||
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
0x74, 0x5f, 0x75, 0x76, 0x73, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x55, 0x00, 0x00,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
|
0x00, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x30, 0x00,
|
||||||
0x00, 0x14, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00,
|
0x00, 0x00, 0x07, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x07,
|
||||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x04,
|
0x00, 0x07, 0x00, 0x64, 0x00, 0x00, 0x00, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x07, 0x00, 0x05, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74,
|
||||||
0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
|
0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x69, 0x6e,
|
||||||
0x00, 0x1a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00,
|
0x74, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x00, 0x00, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e,
|
||||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18,
|
0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30,
|
||||||
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x47, 0x4c, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x63,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
|
0x70, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63,
|
||||||
0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0d, 0x00,
|
0x74, 0x69, 0x76, 0x65, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00,
|
||||||
0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x5f, 0x53, 0x31, 0x00, 0x05, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
0x34, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x31, 0x5f, 0x30, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x3f, 0x00, 0x00,
|
||||||
0x1f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04,
|
0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x5f, 0x30, 0x00,
|
||||||
0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00,
|
0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x75, 0x76, 0x73,
|
||||||
0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17,
|
0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x53, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x70, 0x75,
|
||||||
0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
0x74, 0x5f, 0x74, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07,
|
||||||
0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08,
|
0x00, 0x5e, 0x00, 0x00, 0x00, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74,
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x22, 0x00,
|
0x70, 0x75, 0x74, 0x5f, 0x30, 0x00, 0x06, 0x00, 0x05, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63,
|
||||||
0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x29,
|
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0x67, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x70,
|
||||||
0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
0x75, 0x74, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x00, 0x00, 0x65, 0x6e, 0x74,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
|
0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63,
|
||||||
0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x21,
|
||||||
0x05, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x19,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x09, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x05,
|
0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00,
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x53,
|
||||||
0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x2f,
|
0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x15, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04,
|
0x00, 0x13, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00,
|
0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b,
|
||||||
0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
0x07, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
|
0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00,
|
||||||
0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00,
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b,
|
||||||
0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
|
0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
||||||
0x1a, 0x00, 0x02, 0x00, 0x39, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
|
0x00, 0x08, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x13, 0x00,
|
0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2b,
|
||||||
0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x31,
|
0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
|
||||||
0x39, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
0x00, 0x17, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00,
|
||||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00,
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2b,
|
||||||
0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04,
|
0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x09, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
|
0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
|
||||||
0x3a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
|
0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x43, 0x00,
|
0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x06,
|
||||||
0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x01,
|
0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
0x11, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00,
|
||||||
0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00,
|
0x00, 0x20, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||||
0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00,
|
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c,
|
||||||
0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
|
0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
|
||||||
0x48, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00,
|
0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x07, 0x00,
|
||||||
0x00, 0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x22, 0x00,
|
0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x07,
|
||||||
0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x4c,
|
0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00,
|
0x03, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04,
|
||||||
0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00,
|
0x00, 0x07, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00,
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1e, 0x00,
|
0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x22,
|
||||||
0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x55,
|
0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00,
|
0x17, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
||||||
0x0a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
0x00, 0x1f, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||||
0x00, 0x0b, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x55, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x00, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
||||||
0x58, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
|
0x00, 0x0a, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00,
|
||||||
0x00, 0x15, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x53, 0x00,
|
0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0d,
|
||||||
0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
|
||||||
0x57, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x00,
|
0x00, 0x2e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x32, 0x00,
|
||||||
0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x57, 0x00,
|
0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x37,
|
||||||
0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x17,
|
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
|
||||||
0x0c, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
|
0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x34, 0x00,
|
||||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2b, 0x00,
|
0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x39, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04,
|
||||||
0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x65,
|
0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
|
0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
|
||||||
0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00,
|
0x00, 0x3c, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3d, 0x00,
|
||||||
0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x03, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e,
|
||||||
0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c,
|
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x69, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
|
0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00,
|
||||||
0x00, 0x15, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x2b, 0x00,
|
0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c,
|
||||||
0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x04,
|
0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
|
0x1b, 0x00, 0x03, 0x00, 0x43, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00,
|
||||||
0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
|
0x00, 0x44, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
||||||
0x00, 0x3b, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x46,
|
||||||
0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x12,
|
0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
|
||||||
0x67, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
|
0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
||||||
0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00,
|
0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c,
|
||||||
0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04,
|
0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
0x4c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
|
||||||
0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08,
|
0x00, 0x15, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x17, 0x00,
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x27, 0x00,
|
0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x38,
|
0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
|
0x1a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
|
||||||
0x3f, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x43, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
|
0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00,
|
||||||
0x00, 0x42, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4a, 0x00,
|
0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x51,
|
||||||
0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f,
|
0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00,
|
0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
|
||||||
0x51, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00,
|
0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x55, 0x00,
|
||||||
0x00, 0x51, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x01, 0x00,
|
0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x1e,
|
||||||
0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d,
|
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03,
|
||||||
0x23, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03,
|
0x00, 0x5e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, 0x00,
|
||||||
0x00, 0x64, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6c, 0x00,
|
0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x0a,
|
||||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x6a,
|
0x00, 0x00, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x0b, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00,
|
||||||
|
0x00, 0x62, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
||||||
|
0x0f, 0x00, 0x04, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x64,
|
||||||
|
0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||||
|
0x15, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00,
|
||||||
|
0x00, 0x20, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
||||||
|
0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x63,
|
||||||
|
0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||||
|
0x68, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
|
||||||
|
0x00, 0x13, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x17, 0x00,
|
||||||
|
0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c,
|
||||||
|
0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x6c, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04,
|
||||||
|
0x00, 0x6b, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x71, 0x00,
|
||||||
|
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x72,
|
||||||
|
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||||
|
0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
|
||||||
|
0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c, 0x00,
|
||||||
|
0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x75,
|
||||||
|
0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||||
|
0x15, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04,
|
||||||
|
0x00, 0x07, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x04, 0x00,
|
||||||
|
0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0f,
|
||||||
|
0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||||
|
0x3b, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06,
|
||||||
|
0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x12, 0x00,
|
||||||
|
0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67,
|
||||||
|
0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||||
|
0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x65, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00,
|
||||||
|
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x29,
|
||||||
|
0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00,
|
||||||
|
0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00,
|
||||||
|
0x00, 0x26, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x38, 0x00,
|
||||||
|
0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x3f,
|
||||||
|
0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x43, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
|
||||||
|
0x42, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
|
||||||
|
0x00, 0x4f, 0x00, 0x07, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56,
|
||||||
|
0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x70, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00,
|
||||||
|
0x56, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x50, 0x00,
|
||||||
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x58, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5a,
|
||||||
|
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x5d, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00,
|
||||||
|
0x00, 0x5d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d,
|
||||||
|
0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
||||||
|
0x23, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03,
|
||||||
|
0x00, 0x70, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x78, 0x00,
|
||||||
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x23, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||||
0x6b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00,
|
0x77, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00,
|
||||||
0x00, 0x6d, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x67, 0x00, 0x00, 0x00, 0x6d, 0x00,
|
0x00, 0x79, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x79, 0x00,
|
||||||
0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00,
|
0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t SPIRV_basic_pixel_shader_sizeInBytes = 4228;
|
const size_t SPIRV_basic_pixel_shader_sizeInBytes = 4684;
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ struct PixelShaderOutput {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[[vk::binding(0, 2)]]
|
[[vk::binding(0, 2)]]
|
||||||
Texture2D<float4> tex1 : register(t0, space2);
|
Texture2DArray<float4> tex1 : register(t0, space2);
|
||||||
|
|
||||||
[[vk::binding(0, 2)]]
|
[[vk::binding(0, 2)]]
|
||||||
SamplerState texture_sampler : register(s0, space2);
|
SamplerState texture_sampler : register(s0, space2);
|
||||||
@ -19,7 +19,7 @@ PixelShaderOutput main(PixelShaderInput input) {
|
|||||||
PixelShaderOutput output;
|
PixelShaderOutput output;
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
output.color = tex1.Sample(texture_sampler, float2(input.uvst.xy));
|
output.color = tex1.Sample(texture_sampler, float3(input.uvst.xy, input.tile_type));
|
||||||
#else
|
#else
|
||||||
output.color = float4(1, 0, 1, 1);
|
output.color = float4(1, 0, 1, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
|
//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
|
||||||
|
|
||||||
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
|
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
|
||||||
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
|
||||||
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
|
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
|
||||||
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
|
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
|
||||||
@ -111,7 +111,7 @@
|
|||||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||||
*/
|
*/
|
||||||
//---- ...Or use Dear ImGui's own very basic math operators.
|
//---- ...Or use Dear ImGui's own very basic math operators.
|
||||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
//#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
|
|
||||||
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||||
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||||
|
|||||||
241
src/main.cpp
241
src/main.cpp
@ -2,11 +2,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <imgui_internal.h>
|
|
||||||
#include <imgui_impl_sdl3.h>
|
#include <imgui_impl_sdl3.h>
|
||||||
#include <imgui_impl_sdlgpu3.h>
|
#include <imgui_impl_sdlgpu3.h>
|
||||||
|
|
||||||
#include "smol-atlas.h"
|
|
||||||
#include "defer.h"
|
#include "defer.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "m_string.h"
|
#include "m_string.h"
|
||||||
@ -16,8 +14,6 @@
|
|||||||
#include "../assets/shader/basic_vertex_shader.h"
|
#include "../assets/shader/basic_vertex_shader.h"
|
||||||
#include "../assets/shader/basic_pixel_shader.h"
|
#include "../assets/shader/basic_pixel_shader.h"
|
||||||
|
|
||||||
using namespace M;
|
|
||||||
|
|
||||||
SDL_GPUDevice *device;
|
SDL_GPUDevice *device;
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
|
||||||
@ -32,8 +28,8 @@ SDL_GPUBuffer *index_buffer;
|
|||||||
SDL_GPUBuffer *tiles_instance_buffer;
|
SDL_GPUBuffer *tiles_instance_buffer;
|
||||||
SDL_GPUBuffer *player_instance_buffer;
|
SDL_GPUBuffer *player_instance_buffer;
|
||||||
|
|
||||||
Sint32 window_width;
|
Sint16 window_width;
|
||||||
Sint32 window_height;
|
Sint16 window_height;
|
||||||
|
|
||||||
bool Running = true;
|
bool Running = true;
|
||||||
|
|
||||||
@ -67,12 +63,16 @@ Instance tiles_instances[view_width * view_height] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Instance player_instance = { { 0.5f + 0.5f / view_width, 0.5f, 1.0f / view_width, 1.0f / view_height}, 0, {0, 0, 1, 1}};
|
Instance player_instance = { { 0.5f - 0.5f / view_width, 0.5f, 1.0f / view_width, 1.0f / view_height}, 0, {0, 0, 1, 1}};
|
||||||
|
|
||||||
|
struct Tile {
|
||||||
|
Uint32 type;
|
||||||
|
};
|
||||||
|
|
||||||
Uint32 map_width = view_width;
|
Uint32 map_width = view_width;
|
||||||
Uint32 map_height = view_height;
|
Uint32 map_height = view_height;
|
||||||
|
|
||||||
Uint32* map_tiles;
|
Tile* map_tiles;
|
||||||
|
|
||||||
struct Player {
|
struct Player {
|
||||||
Sint64 pos_x;
|
Sint64 pos_x;
|
||||||
@ -91,29 +91,6 @@ struct PerFrame {
|
|||||||
|
|
||||||
PerFrame per_frame = {1};
|
PerFrame per_frame = {1};
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Uint32 type;
|
|
||||||
const char *asset_path;
|
|
||||||
|
|
||||||
smol_atlas_item_t *atlas_item;
|
|
||||||
} TileInfo;
|
|
||||||
|
|
||||||
TileInfo tile_infos[] = {
|
|
||||||
{ 0x0001, "../assets/tiles/error.png" },
|
|
||||||
{ 0x0000, "../assets/tiles/empty.png" },
|
|
||||||
{ 0x0100, "../assets/tiles/grass_1.png" },
|
|
||||||
{ 0x0101, "../assets/tiles/grass_2.png" },
|
|
||||||
{ 0x0102, "../assets/tiles/grass_3.png" },
|
|
||||||
{ 0x0200, "../assets/tiles/ground_1.png" },
|
|
||||||
{ 0x0300, "../assets/tiles/water_1.png" },
|
|
||||||
{ 0x0301, "../assets/tiles/water_2.png" },
|
|
||||||
};
|
|
||||||
|
|
||||||
int tile_atlas_size = 256;
|
|
||||||
smol_atlas_t *tile_atlas;
|
|
||||||
|
|
||||||
Sint32 selected_tile = -1;
|
|
||||||
|
|
||||||
void save_map() {
|
void save_map() {
|
||||||
log("Save file is under construction.");
|
log("Save file is under construction.");
|
||||||
FILE* file = fopen("../assets/map/map.sv", "wb");
|
FILE* file = fopen("../assets/map/map.sv", "wb");
|
||||||
@ -135,8 +112,7 @@ void save_map() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < map_width * map_height; i++) {
|
for (int i = 0; i < map_width * map_height; i++) {
|
||||||
Uint32 type = tile_infos[map_tiles[i]].type;
|
if (fwrite(&map_tiles[i], sizeof(Tile), 1, file) != 1) {
|
||||||
if (fwrite(&type, sizeof(Uint32), 1, file) != 1) {
|
|
||||||
log_error("fwrite for tile_type at tile number %d has failed.", i);
|
log_error("fwrite for tile_type at tile number %d has failed.", i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -163,26 +139,17 @@ void load_map() {
|
|||||||
if (map_tiles)
|
if (map_tiles)
|
||||||
free(map_tiles);
|
free(map_tiles);
|
||||||
|
|
||||||
map_tiles = (Uint32*)malloc(map_width * map_height * sizeof(Uint32));
|
map_tiles = (Tile*)malloc(map_width * map_height * sizeof(Tile));
|
||||||
|
|
||||||
for (int i = 0; i < map_width * map_height; i++) {
|
for (int i = 0; i < map_width * map_height; i++) {
|
||||||
Uint32 type = read<Uint32>(file);
|
map_tiles[i] = read<Tile>(file);
|
||||||
Uint32 kind = 0;
|
|
||||||
for (int i = 0; i < SDL_arraysize(tile_infos); i++) {
|
|
||||||
if (tile_infos[i].type == type) {
|
|
||||||
kind = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
map_tiles[i] = kind;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log("Loading map was successful.");
|
log("Loading map was successful.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void change_map_size(char direction, int amount) {
|
void change_map_size(char direction, int amount) {
|
||||||
Uint32* old_map = map_tiles;
|
Tile* old_map = map_tiles;
|
||||||
auto old_map_width = map_width;
|
auto old_map_width = map_width;
|
||||||
auto old_map_height = map_height;
|
auto old_map_height = map_height;
|
||||||
|
|
||||||
@ -230,7 +197,7 @@ void change_map_size(char direction, int amount) {
|
|||||||
to_fill_y_offset = old_map_height;
|
to_fill_y_offset = old_map_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
map_tiles = (Uint32*)malloc(map_width * map_height * sizeof(Uint32));
|
map_tiles = (Tile*)malloc(map_width * map_height * sizeof(Tile));
|
||||||
|
|
||||||
for (int y = 0; y < min(old_map_height, map_height); y++) {
|
for (int y = 0; y < min(old_map_height, map_height); y++) {
|
||||||
for (int x = 0; x < min(old_map_width, map_width); x++) {
|
for (int x = 0; x < min(old_map_width, map_width); x++) {
|
||||||
@ -240,7 +207,7 @@ void change_map_size(char direction, int amount) {
|
|||||||
|
|
||||||
for (int y = 0; y < to_fill_height; y++) {
|
for (int y = 0; y < to_fill_height; y++) {
|
||||||
for (int x = 0; x < to_fill_width; x++) {
|
for (int x = 0; x < to_fill_width; x++) {
|
||||||
map_tiles[(y + to_fill_y_offset) * map_width + (x + to_fill_x_offset)] = 0;
|
map_tiles[(y + to_fill_y_offset) * map_width + (x + to_fill_x_offset)].type = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,27 +403,27 @@ SDL_GPUTexture *create_shader_texture(const char *path) {
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GPUTexture *create_shader_texture(const char *name, const char *data, int width, int height, int channels) {
|
SDL_GPUTexture* create_shader_texture_array(Uint32 num_textures, const char **texture_paths, const char *debug_name) {
|
||||||
SDL_GPUTextureFormat format = SDL_GPU_TEXTUREFORMAT_INVALID;
|
if (!num_textures) return NULL;
|
||||||
if (channels == 1) format = SDL_GPU_TEXTUREFORMAT_A8_UNORM;
|
|
||||||
if (channels == 4) format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM;
|
|
||||||
|
|
||||||
if (format == SDL_GPU_TEXTUREFORMAT_INVALID) {
|
int width = 0, height = 0, channels = 0;
|
||||||
log_error("Failed to find texture format for texture.");
|
stbi_uc *data = stbi_load(texture_paths[0], &width, &height, &channels, 4);
|
||||||
|
if (!data) {
|
||||||
|
log_error("Failed to load texture (\"%s\").", texture_paths[0]);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_PropertiesID properties = SDL_CreateProperties();
|
SDL_PropertiesID properties = SDL_CreateProperties();
|
||||||
if (properties) SDL_SetStringProperty(properties, SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING, name);
|
if (properties) SDL_SetStringProperty(properties, SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING, debug_name);
|
||||||
|
|
||||||
SDL_GPUTextureCreateInfo texture_info = {
|
SDL_GPUTextureCreateInfo texture_info = {
|
||||||
.type = SDL_GPU_TEXTURETYPE_2D,
|
.type = SDL_GPU_TEXTURETYPE_2D_ARRAY,
|
||||||
.format = format,
|
.format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM,
|
||||||
.usage = SDL_GPU_TEXTUREUSAGE_SAMPLER,
|
.usage = SDL_GPU_TEXTUREUSAGE_SAMPLER,
|
||||||
.width = (Uint32)width,
|
.width = (Uint32)width,
|
||||||
.height = (Uint32)height,
|
.height = (Uint32)height,
|
||||||
|
|
||||||
.layer_count_or_depth = 1,
|
.layer_count_or_depth = (Uint32)num_textures,
|
||||||
.num_levels = 1,
|
.num_levels = 1,
|
||||||
|
|
||||||
.props = properties,
|
.props = properties,
|
||||||
@ -465,20 +432,23 @@ SDL_GPUTexture *create_shader_texture(const char *name, const char *data, int wi
|
|||||||
SDL_GPUTexture *texture = SDL_CreateGPUTexture(device, &texture_info);
|
SDL_GPUTexture *texture = SDL_CreateGPUTexture(device, &texture_info);
|
||||||
if (!texture) {
|
if (!texture) {
|
||||||
log_error("Failed to create gpu texture (%s).", SDL_GetError());
|
log_error("Failed to create gpu texture (%s).", SDL_GetError());
|
||||||
|
stbi_image_free(data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (properties) SDL_DestroyProperties(properties);
|
if (properties) SDL_DestroyProperties(properties);
|
||||||
|
|
||||||
Uint32 upload_size = width * height * channels;
|
Uint32 upload_size = width * height * 4;
|
||||||
|
Uint32 total_upload_size = upload_size * num_textures;
|
||||||
SDL_GPUTransferBufferCreateInfo transfer_buffer_info = {
|
SDL_GPUTransferBufferCreateInfo transfer_buffer_info = {
|
||||||
.usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD,
|
.usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD,
|
||||||
.size = upload_size,
|
.size = total_upload_size,
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_GPUTransferBuffer *transfer_buffer = SDL_CreateGPUTransferBuffer(device, &transfer_buffer_info);
|
SDL_GPUTransferBuffer *transfer_buffer = SDL_CreateGPUTransferBuffer(device, &transfer_buffer_info);
|
||||||
if (!transfer_buffer) {
|
if (!transfer_buffer) {
|
||||||
log_error("Failed to create gpu transfer buffer (%s).", SDL_GetError());
|
log_error("Failed to create gpu transfer buffer (%s).", SDL_GetError());
|
||||||
SDL_ReleaseGPUTexture(device, texture);
|
SDL_ReleaseGPUTexture(device, texture);
|
||||||
|
stbi_image_free(data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,22 +457,29 @@ SDL_GPUTexture *create_shader_texture(const char *name, const char *data, int wi
|
|||||||
log_error("Failed to map gpu transfer buffer (%s).", SDL_GetError());
|
log_error("Failed to map gpu transfer buffer (%s).", SDL_GetError());
|
||||||
SDL_ReleaseGPUTransferBuffer(device, transfer_buffer);
|
SDL_ReleaseGPUTransferBuffer(device, transfer_buffer);
|
||||||
SDL_ReleaseGPUTexture(device, texture);
|
SDL_ReleaseGPUTexture(device, texture);
|
||||||
|
stbi_image_free(data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(transfer_data, data, upload_size);
|
memcpy(transfer_data, data, upload_size);
|
||||||
|
stbi_image_free(data);
|
||||||
|
|
||||||
|
for (int i = 1; i < num_textures; i++) {
|
||||||
|
int width2 = 0, height2 = 0;
|
||||||
|
stbi_uc *data = stbi_load(texture_paths[i], &width2, &height2, &channels, 4);
|
||||||
|
if (!data || width != width2 || height != height2) {
|
||||||
|
log_error("Failed to load texture (\"%s\").", texture_paths[i]);
|
||||||
SDL_UnmapGPUTransferBuffer(device, transfer_buffer);
|
SDL_UnmapGPUTransferBuffer(device, transfer_buffer);
|
||||||
|
SDL_ReleaseGPUTransferBuffer(device, transfer_buffer);
|
||||||
|
SDL_ReleaseGPUTexture(device, texture);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_GPUTextureTransferInfo transfer_info = {
|
memcpy((void *)((char *)transfer_data + i * upload_size), data, upload_size);
|
||||||
.transfer_buffer = transfer_buffer,
|
stbi_image_free(data);
|
||||||
.pixels_per_row = (Uint32)width,
|
}
|
||||||
};
|
|
||||||
|
|
||||||
SDL_GPUTextureRegion tetxure_region = {
|
SDL_UnmapGPUTransferBuffer(device, transfer_buffer);
|
||||||
.texture = texture,
|
|
||||||
.w = (Uint32)width,
|
|
||||||
.h = (Uint32)height,
|
|
||||||
.d = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
SDL_GPUCommandBuffer *command_buffer = SDL_AcquireGPUCommandBuffer(device);
|
SDL_GPUCommandBuffer *command_buffer = SDL_AcquireGPUCommandBuffer(device);
|
||||||
if (!command_buffer) {
|
if (!command_buffer) {
|
||||||
@ -513,7 +490,26 @@ SDL_GPUTexture *create_shader_texture(const char *name, const char *data, int wi
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDL_GPUCopyPass *copy_pass = SDL_BeginGPUCopyPass(command_buffer);
|
SDL_GPUCopyPass *copy_pass = SDL_BeginGPUCopyPass(command_buffer);
|
||||||
|
|
||||||
|
for (int i = 0; i < num_textures; i++) {
|
||||||
|
SDL_GPUTextureTransferInfo transfer_info = {
|
||||||
|
.transfer_buffer = transfer_buffer,
|
||||||
|
.offset = i * upload_size,
|
||||||
|
.pixels_per_row = (Uint32)width,
|
||||||
|
.rows_per_layer = (Uint32)height,
|
||||||
|
};
|
||||||
|
|
||||||
|
SDL_GPUTextureRegion tetxure_region = {
|
||||||
|
.texture = texture,
|
||||||
|
.layer = (Uint32)i,
|
||||||
|
.w = (Uint32)width,
|
||||||
|
.h = (Uint32)height,
|
||||||
|
.d = 1,
|
||||||
|
};
|
||||||
|
|
||||||
SDL_UploadToGPUTexture(copy_pass, &transfer_info, &tetxure_region, false);
|
SDL_UploadToGPUTexture(copy_pass, &transfer_info, &tetxure_region, false);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_EndGPUCopyPass(copy_pass);
|
SDL_EndGPUCopyPass(copy_pass);
|
||||||
|
|
||||||
if (!SDL_SubmitGPUCommandBuffer(command_buffer)) {
|
if (!SDL_SubmitGPUCommandBuffer(command_buffer)) {
|
||||||
@ -528,26 +524,6 @@ SDL_GPUTexture *create_shader_texture(const char *name, const char *data, int wi
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
void blit(char *dst, Sint32 dst_width, Sint32 dst_x, Sint32 dst_y, char *src, Sint32 width, Sint32 height, int components = 4) {
|
|
||||||
for (Sint32 y = 0; y < height; y++)
|
|
||||||
memmove(&dst[((dst_y + y) * dst_width + dst_x) * components], &src[y * width * components], width * components);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SelectableImage(const char *label, bool selected, SDL_GPUTextureSamplerBinding *image, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1)) {
|
|
||||||
const ImGuiContext *context = ImGui::GetCurrentContext();
|
|
||||||
const ImVec2 padding = context->Style.FramePadding;
|
|
||||||
|
|
||||||
bool pressed = ImGui::Selectable(label, selected, 0, image_size + padding * 2.0f);
|
|
||||||
|
|
||||||
ImVec2 min = ImGui::GetItemRectMin();
|
|
||||||
ImVec2 max = ImGui::GetItemRectMax();
|
|
||||||
|
|
||||||
if (image)
|
|
||||||
context->CurrentWindow->DrawList->AddImage((ImTextureID)image, min + padding, max - padding, uv0, uv1);
|
|
||||||
|
|
||||||
return pressed;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) {
|
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) {
|
||||||
log_error("Failed to initialize SDL (%s). Exiting.", SDL_GetError());
|
log_error("Failed to initialize SDL (%s). Exiting.", SDL_GetError());
|
||||||
@ -705,35 +681,17 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GPUTexture *player_texture = create_shader_texture("../assets/decorations/strawberry.png");
|
const char *player_texture_array[] = { "../assets/decorations/strawberry.png" };
|
||||||
|
SDL_GPUTexture *player_texture = create_shader_texture_array(SDL_arraysize(player_texture_array), player_texture_array, "player_textures");
|
||||||
if (!player_texture) {
|
if (!player_texture) {
|
||||||
log_error("Failed to create shader texture. Exiting.");
|
log_error("Failed to create shader texture. Exiting.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tile_atlas = sma_atlas_create(tile_atlas_size, tile_atlas_size);
|
const char *tile_texture_array[] = { "../assets/tiles/empty.png", "../assets/tiles/grass_1.png" , "../assets/tiles/ground_1.png" , "../assets/tiles/water_1.png", "../assets/tiles/error.png" };
|
||||||
char *tile_atlas_texture_cpu = (char *)calloc(1, tile_atlas_size * tile_atlas_size * 4);
|
SDL_GPUTexture *tile_texture = create_shader_texture_array(SDL_arraysize(tile_texture_array), tile_texture_array, "tile_textures");
|
||||||
for (int i = 0; i < SDL_arraysize(tile_infos); i++) {
|
if (!player_texture) {
|
||||||
int width = 0, height = 0;
|
log_error("Failed to create shader texture array. Exiting.");
|
||||||
stbi_uc *data = stbi_load(tile_infos[i].asset_path, &width, &height, NULL, 4);
|
|
||||||
if (!data) {
|
|
||||||
log_error("Failed to load texture (\"%s\"). Exiting.", tile_infos[i].asset_path);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
tile_infos[i].atlas_item = sma_item_add(tile_atlas, width, height);
|
|
||||||
if (!tile_infos[i].atlas_item) {
|
|
||||||
log_error("Failed to add tile texture to atlas. Exiting.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
blit(tile_atlas_texture_cpu, tile_atlas_size, sma_item_x(tile_infos[i].atlas_item), sma_item_y(tile_infos[i].atlas_item), (char *)data, width, height);
|
|
||||||
stbi_image_free(data);
|
|
||||||
}
|
|
||||||
SDL_GPUTexture *tile_atlas_texture = create_shader_texture("tile_atlas", tile_atlas_texture_cpu, tile_atlas_size, tile_atlas_size, 4);
|
|
||||||
free(tile_atlas_texture_cpu);
|
|
||||||
if (!tile_atlas_texture) {
|
|
||||||
log_error("Failed to create tile atlas texture. Exiting.");
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,10 +750,6 @@ int main(int argc, char **argv) {
|
|||||||
ImGui_ImplSDLGPU3_Init(&imgui_init_info);
|
ImGui_ImplSDLGPU3_Init(&imgui_init_info);
|
||||||
|
|
||||||
bool show_demo_window = true;
|
bool show_demo_window = true;
|
||||||
bool first_frame = true;
|
|
||||||
|
|
||||||
|
|
||||||
SDL_GetWindowSizeInPixels(window, &window_width, &window_height);
|
|
||||||
|
|
||||||
// MSG Message;
|
// MSG Message;
|
||||||
while (Running) {
|
while (Running) {
|
||||||
@ -803,42 +757,9 @@ int main(int argc, char **argv) {
|
|||||||
ImGui_ImplSDL3_NewFrame();
|
ImGui_ImplSDL3_NewFrame();
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
ImGui::SetNextWindowPos(ImVec2(0, 0));
|
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(0, window_height), ImVec2(window_width, window_height));
|
|
||||||
ImGui::SetNextWindowSize(ImVec2(0.2 * window_width, window_height), ImGuiCond_FirstUseEver);
|
|
||||||
if (ImGui::Begin("Tile Picker", NULL, ImGuiWindowFlags_NoFocusOnAppearing)) {
|
|
||||||
if (SelectableImage("##tile", selected_tile == -1, NULL, ImVec2(32, 32))) {
|
|
||||||
selected_tile = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < SDL_arraysize(tile_infos); i++) {
|
|
||||||
ImGui::PushID(i);
|
|
||||||
SDL_GPUTextureSamplerBinding texture_binding = { .texture = tile_atlas_texture, .sampler = point_sampler };
|
|
||||||
|
|
||||||
ImVec2 uv0 = ImVec2(sma_item_x(tile_infos[i].atlas_item) / (float)tile_atlas_size, sma_item_y(tile_infos[i].atlas_item) / (float)tile_atlas_size);
|
|
||||||
ImVec2 uv1 = ImVec2(uv0.x + sma_item_width(tile_infos[i].atlas_item) / (float)tile_atlas_size, uv0.y + sma_item_height(tile_infos[i].atlas_item) / (float)tile_atlas_size);
|
|
||||||
|
|
||||||
float available = ImGui::GetContentRegionAvail().x - ImGui::GetItemRectMax().x;
|
|
||||||
if (available >= 32)
|
|
||||||
ImGui::SameLine();
|
|
||||||
|
|
||||||
if (SelectableImage("##tile", selected_tile == i, &texture_binding, ImVec2(32, 32), uv0, uv1)) {
|
|
||||||
selected_tile = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::PopID();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImGui::End();
|
|
||||||
|
|
||||||
if (show_demo_window)
|
if (show_demo_window)
|
||||||
ImGui::ShowDemoWindow(&show_demo_window);
|
ImGui::ShowDemoWindow(&show_demo_window);
|
||||||
|
|
||||||
if (first_frame) {
|
|
||||||
ImGui::SetWindowFocus(NULL);
|
|
||||||
first_frame = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_GPUCommandBuffer *command_buffer = SDL_AcquireGPUCommandBuffer(device);
|
SDL_GPUCommandBuffer *command_buffer = SDL_AcquireGPUCommandBuffer(device);
|
||||||
if (!command_buffer) {
|
if (!command_buffer) {
|
||||||
log_error("Failed to acquire gpu command buffer (%s). Exiting.", SDL_GetError());
|
log_error("Failed to acquire gpu command buffer (%s). Exiting.", SDL_GetError());
|
||||||
@ -900,9 +821,6 @@ int main(int argc, char **argv) {
|
|||||||
if (io.WantCaptureMouse)
|
if (io.WantCaptureMouse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (selected_tile == -1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
float mouse_x = event.button.x;
|
float mouse_x = event.button.x;
|
||||||
float mouse_y = event.button.y;
|
float mouse_y = event.button.y;
|
||||||
|
|
||||||
@ -934,7 +852,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
if(0 <= tile_x && tile_x < map_width &&
|
if(0 <= tile_x && tile_x < map_width &&
|
||||||
0 <= tile_y && tile_y < map_height)
|
0 <= tile_y && tile_y < map_height)
|
||||||
map_tiles[tile_x + map_width * tile_y] = selected_tile;
|
map_tiles[tile_x + map_width * tile_y].type = (map_tiles[tile_x + map_width * tile_y].type + 1) % 4;
|
||||||
|
|
||||||
SDL_Keymod modifiers = SDL_GetModState();
|
SDL_Keymod modifiers = SDL_GetModState();
|
||||||
if (modifiers & SDL_KMOD_SHIFT && tile_x == -1) {
|
if (modifiers & SDL_KMOD_SHIFT && tile_x == -1) {
|
||||||
@ -973,19 +891,10 @@ int main(int argc, char **argv) {
|
|||||||
for (int x = 0; x < view_width; x++) {
|
for (int x = 0; x < view_width; x++) {
|
||||||
if (x + player.pos_x - view_width / 2 >= 0 && x + player.pos_x - view_width / 2 < map_width &&
|
if (x + player.pos_x - view_width / 2 >= 0 && x + player.pos_x - view_width / 2 < map_width &&
|
||||||
y + player.pos_y - view_height / 2 >= 0 && y + player.pos_y - view_height / 2 < map_height) {
|
y + player.pos_y - view_height / 2 >= 0 && y + player.pos_y - view_height / 2 < map_height) {
|
||||||
tiles_instances[x + y * view_width].tile_type = map_tiles[(x + player.pos_x - view_width / 2) + (y + player.pos_y - view_height / 2) * map_width];
|
tiles_instances[x + y * view_width].tile_type = map_tiles[(x + player.pos_x - view_width / 2) + (y + player.pos_y - view_height / 2) * map_width].type;
|
||||||
} else {
|
} else {
|
||||||
tiles_instances[x + y * view_width].tile_type = 0;
|
tiles_instances[x + y * view_width].tile_type = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 type = tiles_instances[x + y * view_width].tile_type;
|
|
||||||
|
|
||||||
float x0 = sma_item_x(tile_infos[type].atlas_item);
|
|
||||||
float y0 = sma_item_y(tile_infos[type].atlas_item);
|
|
||||||
float x1 = x0 + sma_item_width(tile_infos[type].atlas_item);
|
|
||||||
float y1 = y0 + sma_item_height(tile_infos[type].atlas_item);
|
|
||||||
|
|
||||||
tiles_instances[x + y * view_width].uv0uv1 = { x0 / tile_atlas_size, y0 / tile_atlas_size, x1 / tile_atlas_size, y1 / tile_atlas_size };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1024,7 +933,7 @@ int main(int argc, char **argv) {
|
|||||||
{ .buffer = tiles_instance_buffer, .offset = 0 },
|
{ .buffer = tiles_instance_buffer, .offset = 0 },
|
||||||
};
|
};
|
||||||
SDL_GPUTextureSamplerBinding texture_bindings[] = {
|
SDL_GPUTextureSamplerBinding texture_bindings[] = {
|
||||||
{ .texture = tile_atlas_texture, .sampler = point_sampler },
|
{ .texture = tile_texture, .sampler = point_sampler },
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_BindGPUGraphicsPipeline(render_pass, basic_graphics_pipeline);
|
SDL_BindGPUGraphicsPipeline(render_pass, basic_graphics_pipeline);
|
||||||
|
|||||||
@ -11,83 +11,82 @@
|
|||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
|
|
||||||
namespace M {
|
//clamp
|
||||||
//clamp
|
constexpr inline float clamp(float min, float a, float max) {
|
||||||
constexpr inline float clamp(float min, float a, float max) {
|
|
||||||
float result = a;
|
float result = a;
|
||||||
if (a < min)
|
if (a < min)
|
||||||
result = min;
|
result = min;
|
||||||
if (a > max)
|
if (a > max)
|
||||||
result = max;
|
result = max;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//clamp für 0-1 Bereich (Grafik)
|
//clamp für 0-1 Bereich (Grafik)
|
||||||
constexpr inline float clamp01(float a) {
|
constexpr inline float clamp01(float a) {
|
||||||
return clamp(0, a, 1);
|
return clamp(0, a, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//clamp für Integer
|
//clamp für Integer
|
||||||
constexpr inline int64_t clamp(int64_t min, int64_t a, int64_t max) {
|
constexpr inline int64_t clamp(int64_t min, int64_t a, int64_t max) {
|
||||||
int64_t result = a;
|
int64_t result = a;
|
||||||
if (a < min)
|
if (a < min)
|
||||||
result = min;
|
result = min;
|
||||||
if (a > max)
|
if (a > max)
|
||||||
result = max;
|
result = max;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//wurzelberechnung
|
//wurzelberechnung
|
||||||
inline float square_root(float a) {
|
inline float square_root(float a) {
|
||||||
return _mm_cvtss_f32(_mm_sqrt_ss(_mm_set_ss(a)));
|
return _mm_cvtss_f32(_mm_sqrt_ss(_mm_set_ss(a)));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float reciprocal_square_root(float a) {
|
inline float reciprocal_square_root(float a) {
|
||||||
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(a)));
|
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(a)));
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline float min(float a, float b) {
|
constexpr inline float min(float a, float b) {
|
||||||
return a < b ? a : b;
|
return a < b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline float max(float a, float b) {
|
constexpr inline float max(float a, float b) {
|
||||||
return a > b ? a : b;
|
return a > b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline double min(double a, double b) {
|
constexpr inline double min(double a, double b) {
|
||||||
return a < b ? a : b;
|
return a < b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline double max(double a, double b) {
|
constexpr inline double max(double a, double b) {
|
||||||
return a > b ? a : b;
|
return a > b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline int64_t min(int64_t a, int64_t b) {
|
constexpr inline int64_t min(int64_t a, int64_t b) {
|
||||||
return a < b ? a : b;
|
return a < b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr inline T min(T a, T b) {
|
constexpr inline T min(T a, T b) {
|
||||||
return a < b ? a : b;
|
return a < b ? a : b;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr float lerp(float a, float b, float t) {
|
constexpr float lerp(float a, float b, float t) {
|
||||||
return (1.0f - t) * a + t * b;
|
return (1.0f - t) * a + t * b;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float ilerp(float a, float b, float v) {
|
inline float ilerp(float a, float b, float v) {
|
||||||
return (v - a) / (b - a);
|
return (v - a) / (b - a);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float remap(float in_a, float in_b, float out_a, float out_b, float v) {
|
inline float remap(float in_a, float in_b, float out_a, float out_b, float v) {
|
||||||
float t = ilerp(in_a, in_b, v);
|
float t = ilerp(in_a, in_b, v);
|
||||||
return lerp(out_a, out_b, t);
|
return lerp(out_a, out_b, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//Vektorberechnung 2-dim
|
//Vektorberechnung 2-dim
|
||||||
union V2 {
|
union V2 {
|
||||||
struct {
|
struct {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
@ -111,191 +110,191 @@ namespace M {
|
|||||||
assert(index < 2);
|
assert(index < 2);
|
||||||
return E[index];
|
return E[index];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Negation von 2-dim Vektor
|
//Negation von 2-dim Vektor
|
||||||
inline V2 operator -(V2 a) {
|
inline V2 operator -(V2 a) {
|
||||||
return {
|
return {
|
||||||
-a.x,
|
-a.x,
|
||||||
-a.y
|
-a.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Addition 2er 2-dim Vektoren
|
//Addition 2er 2-dim Vektoren
|
||||||
inline V2 operator +(V2 a, V2 b) {
|
inline V2 operator +(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a.x + b.x,
|
a.x + b.x,
|
||||||
a.y + b.y
|
a.y + b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Vektor Addition
|
//Vektor Addition
|
||||||
inline V2 operator +=(V2& a, V2 b) {
|
inline V2 operator +=(V2& a, V2 b) {
|
||||||
return a = a + b;
|
return a = a + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Subtraktion 2er 2-dim Vektoren
|
//Subtraktion 2er 2-dim Vektoren
|
||||||
inline V2 operator -(V2 a, V2 b) {
|
inline V2 operator -(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a.x - b.x,
|
a.x - b.x,
|
||||||
a.y - b.y
|
a.y - b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Vektor Subtraktion
|
//Vektor Subtraktion
|
||||||
inline V2 operator -=(V2& a, V2 b) {
|
inline V2 operator -=(V2& a, V2 b) {
|
||||||
return a = a - b;
|
return a = a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarmultiplikation -> erst Skalar, dann Vektor
|
//Skalarmultiplikation -> erst Skalar, dann Vektor
|
||||||
inline V2 operator *(float a, V2 b) {
|
inline V2 operator *(float a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a * b.x,
|
a * b.x,
|
||||||
a * b.y
|
a * b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarmultiplikation -> erst Vektor, dann Skalar
|
//Skalarmultiplikation -> erst Vektor, dann Skalar
|
||||||
inline V2 operator *(V2 a, float b) {
|
inline V2 operator *(V2 a, float b) {
|
||||||
return {
|
return {
|
||||||
a.x * b,
|
a.x * b,
|
||||||
a.y * b
|
a.y * b
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarmultiplikation -> mit V2 Pointer
|
//Skalarmultiplikation -> mit V2 Pointer
|
||||||
inline V2 &operator *= (V2 &a, float b) {
|
inline V2 &operator *= (V2 &a, float b) {
|
||||||
a = a * b;
|
a = a * b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit einem Skalar Oo -> Skalar geteilt durch Vektor
|
//Division mit einem Skalar Oo -> Skalar geteilt durch Vektor
|
||||||
inline V2 operator /(float a, V2 b) {
|
inline V2 operator /(float a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a / b.x,
|
a / b.x,
|
||||||
a / b.y
|
a / b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit einem Skalar Oo -> Vektor geteilt durch Skalar
|
//Division mit einem Skalar Oo -> Vektor geteilt durch Skalar
|
||||||
inline V2 operator /(V2 a, float b) {
|
inline V2 operator /(V2 a, float b) {
|
||||||
return {
|
return {
|
||||||
a.x / b,
|
a.x / b,
|
||||||
a.y / b
|
a.y / b
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit einem Skalar -> 2 Vektoren
|
//Division mit einem Skalar -> 2 Vektoren
|
||||||
inline V2 operator /(V2 a, V2 b) {
|
inline V2 operator /(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a.x / b.x,
|
a.x / b.x,
|
||||||
a.y / b.y
|
a.y / b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit einem Skalar -> mit V2 Pointer
|
//Division mit einem Skalar -> mit V2 Pointer
|
||||||
inline V2 &operator /= (V2 &a, float b) {
|
inline V2 &operator /= (V2 &a, float b) {
|
||||||
a = a / b;
|
a = a / b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarprodukt
|
//Skalarprodukt
|
||||||
inline float dot(V2 a, V2 b) {
|
inline float dot(V2 a, V2 b) {
|
||||||
return a.x * b.x + a.y * b.y;
|
return a.x * b.x + a.y * b.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Hadamard-Produkt
|
//Hadamard-Produkt
|
||||||
inline V2 hadamard(V2 a, V2 b) {
|
inline V2 hadamard(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a.x * b.x,
|
a.x * b.x,
|
||||||
a.y * b.y
|
a.y * b.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Betrag des Vektors quadrieren
|
//Betrag des Vektors quadrieren
|
||||||
inline float length_squared(V2 a) {
|
inline float length_squared(V2 a) {
|
||||||
return dot(a, a);
|
return dot(a, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Betrag eines Vektors
|
//Betrag eines Vektors
|
||||||
inline float length(V2 a) {
|
inline float length(V2 a) {
|
||||||
return square_root(length_squared(a));
|
return square_root(length_squared(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Reziproke der Länge
|
//Reziproke der Länge
|
||||||
inline float reciprocal_length(V2 a) {
|
inline float reciprocal_length(V2 a) {
|
||||||
return reciprocal_square_root(length_squared(a));
|
return reciprocal_square_root(length_squared(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Einheitsvektor
|
//Einheitsvektor
|
||||||
inline V2 normalize(V2 a) {
|
inline V2 normalize(V2 a) {
|
||||||
return a * reciprocal_length(a);
|
return a * reciprocal_length(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Vektor der 90
|
//Vektor der 90
|
||||||
inline V2 perp(V2 a) {
|
inline V2 perp(V2 a) {
|
||||||
return {
|
return {
|
||||||
-a.y,
|
-a.y,
|
||||||
a.x
|
a.x
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//clamp für 2-dim Vektor
|
//clamp für 2-dim Vektor
|
||||||
inline V2 clamp01(V2 a) {
|
inline V2 clamp01(V2 a) {
|
||||||
return {
|
return {
|
||||||
clamp01(a.x),
|
clamp01(a.x),
|
||||||
clamp01(a.y)
|
clamp01(a.y)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Vektor mit den kleinsten Werten 2er Vektoren
|
//Vektor mit den kleinsten Werten 2er Vektoren
|
||||||
inline V2 min(V2 a, V2 b) {
|
inline V2 min(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
min(a.x, b.x),
|
min(a.x, b.x),
|
||||||
min(a.y, b.y),
|
min(a.y, b.y),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Vektor mit den groessten Werten 2er Vektoren
|
//Vektor mit den groessten Werten 2er Vektoren
|
||||||
inline V2 max(V2 a, V2 b) {
|
inline V2 max(V2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
max(a.x, b.x),
|
max(a.x, b.x),
|
||||||
max(a.y, b.y),
|
max(a.y, b.y),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//kleinster Vektor Wert
|
//kleinster Vektor Wert
|
||||||
inline float min(V2 a) {
|
inline float min(V2 a) {
|
||||||
return min(a.x, a.y);
|
return min(a.x, a.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//groesster Vektor Wert
|
//groesster Vektor Wert
|
||||||
inline float max(V2 a) {
|
inline float max(V2 a) {
|
||||||
return max(a.x, a.y);
|
return max(a.x, a.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Lerp mit 2 Vektoren
|
//Lerp mit 2 Vektoren
|
||||||
inline V2 lerp(V2 a, V2 b, V2 t) {
|
inline V2 lerp(V2 a, V2 b, V2 t) {
|
||||||
return V2{
|
return V2{
|
||||||
lerp(a.x, b.x, t.x),
|
lerp(a.x, b.x, t.x),
|
||||||
lerp(a.y, b.y, t.y),
|
lerp(a.y, b.y, t.y),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
inline V2 ilerp(V2 a, V2 b, V2 v) {
|
inline V2 ilerp(V2 a, V2 b, V2 v) {
|
||||||
return (v - a) / (b - a);
|
return (v - a) / (b - a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
inline V2 remap(V2 in_a, V2 in_b, V2 out_a, V2 out_b, V2 v) {
|
inline V2 remap(V2 in_a, V2 in_b, V2 out_a, V2 out_b, V2 v) {
|
||||||
V2 t = ilerp(in_a, in_b, v);
|
V2 t = ilerp(in_a, in_b, v);
|
||||||
return lerp(out_a, out_b, t);
|
return lerp(out_a, out_b, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//Vektorberechnung 3-dim
|
//Vektorberechnung 3-dim
|
||||||
union V3 {
|
union V3 {
|
||||||
struct {
|
struct {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
@ -336,117 +335,117 @@ namespace M {
|
|||||||
assert(index < 3);
|
assert(index < 3);
|
||||||
return E[index];
|
return E[index];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Negation von 2-dim Vektor
|
//Negation von 2-dim Vektor
|
||||||
inline V3 operator -(V3 a) {
|
inline V3 operator -(V3 a) {
|
||||||
return {
|
return {
|
||||||
-a.x,
|
-a.x,
|
||||||
-a.y,
|
-a.y,
|
||||||
-a.z
|
-a.z
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Addition 2er 2-dim Vektoren
|
//Addition 2er 2-dim Vektoren
|
||||||
inline V3 operator +(V3 a, V3 b) {
|
inline V3 operator +(V3 a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a.x + b.x,
|
a.x + b.x,
|
||||||
a.y + b.y,
|
a.y + b.y,
|
||||||
a.z + b.z
|
a.z + b.z
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Subtraktion 2er 2-dim Vektoren
|
//Subtraktion 2er 2-dim Vektoren
|
||||||
inline V3 operator -(V3 a, V3 b) {
|
inline V3 operator -(V3 a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a.x - b.x,
|
a.x - b.x,
|
||||||
a.y - b.y,
|
a.y - b.y,
|
||||||
a.z - b.z
|
a.z - b.z
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarmultiplikation -> erst Skalar, dann Vektor
|
//Skalarmultiplikation -> erst Skalar, dann Vektor
|
||||||
inline V3 operator *(float a, V3 b) {
|
inline V3 operator *(float a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a * b.x,
|
a * b.x,
|
||||||
a * b.y,
|
a * b.y,
|
||||||
a * b.z
|
a * b.z
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarmultiplikation -> erst Vektor, dann Skalar
|
//Skalarmultiplikation -> erst Vektor, dann Skalar
|
||||||
inline V3 operator *(V3 a, float b) {
|
inline V3 operator *(V3 a, float b) {
|
||||||
return {
|
return {
|
||||||
a.x * b,
|
a.x * b,
|
||||||
a.y * b,
|
a.y * b,
|
||||||
a.z * b
|
a.z * b
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit nem Skalar Oo -> Skalar geteilt durch Vektor
|
//Division mit nem Skalar Oo -> Skalar geteilt durch Vektor
|
||||||
inline V3 operator /(float a, V3 b) {
|
inline V3 operator /(float a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a / b.x,
|
a / b.x,
|
||||||
a / b.y,
|
a / b.y,
|
||||||
a / b.z
|
a / b.z
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Division mit nem Skalar Oo -> Vektor geteilt durch Skalar
|
//Division mit nem Skalar Oo -> Vektor geteilt durch Skalar
|
||||||
inline V3 operator /(V3 a, float b) {
|
inline V3 operator /(V3 a, float b) {
|
||||||
return {
|
return {
|
||||||
a.x / b,
|
a.x / b,
|
||||||
a.y / b,
|
a.y / b,
|
||||||
a.z / b
|
a.z / b
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skalarprodukt
|
//Skalarprodukt
|
||||||
inline float dot(V3 a, V3 b) {
|
inline float dot(V3 a, V3 b) {
|
||||||
return a.x * b.x + a.y * b.y + a.z * b.z;
|
return a.x * b.x + a.y * b.y + a.z * b.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Hadamard-Produkt
|
//Hadamard-Produkt
|
||||||
inline V3 hadamard(V3 a, V3 b) {
|
inline V3 hadamard(V3 a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a.x * b.x,
|
a.x * b.x,
|
||||||
a.y * b.y,
|
a.y * b.y,
|
||||||
a.z * b.z
|
a.z * b.z
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Kreuzprodukt
|
//Kreuzprodukt
|
||||||
inline V3 cross(V3 a, V3 b) {
|
inline V3 cross(V3 a, V3 b) {
|
||||||
return {
|
return {
|
||||||
a.y * b.z - a.z * b.y,
|
a.y * b.z - a.z * b.y,
|
||||||
a.z * b.x - a.x * b.z,
|
a.z * b.x - a.x * b.z,
|
||||||
a.x * b.y - a.y * b.x
|
a.x * b.y - a.y * b.x
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Betrag des Vektors quadrieren
|
//Betrag des Vektors quadrieren
|
||||||
inline float length_squared(V3 a) {
|
inline float length_squared(V3 a) {
|
||||||
return dot(a, a);
|
return dot(a, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Betrag eines Vektors
|
//Betrag eines Vektors
|
||||||
inline float length(V3 a) {
|
inline float length(V3 a) {
|
||||||
return square_root(length_squared(a));
|
return square_root(length_squared(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Reziproke der Länge
|
//Reziproke der Länge
|
||||||
inline float reciprocal_length(V3 a) {
|
inline float reciprocal_length(V3 a) {
|
||||||
return reciprocal_square_root(length_squared(a));
|
return reciprocal_square_root(length_squared(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Einheitsvektor
|
//Einheitsvektor
|
||||||
inline V3 normalize(V3 a) {
|
inline V3 normalize(V3 a) {
|
||||||
return a * reciprocal_length(a);
|
return a * reciprocal_length(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
union V4 {
|
union V4 {
|
||||||
struct {
|
struct {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
@ -502,18 +501,18 @@ namespace M {
|
|||||||
assert(index < 4);
|
assert(index < 4);
|
||||||
return E[index];
|
return E[index];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//2x2 Matrix
|
//2x2 Matrix
|
||||||
|
|
||||||
//M2x2 m;
|
//M2x2 m;
|
||||||
//m.E[0][1]
|
//m.E[0][1]
|
||||||
//m.V[1]
|
//m.V[1]
|
||||||
|
|
||||||
//m[1][0]
|
//m[1][0]
|
||||||
union M2x2 {
|
union M2x2 {
|
||||||
struct {
|
struct {
|
||||||
float x1; float x2;
|
float x1; float x2;
|
||||||
float y1; float y2;
|
float y1; float y2;
|
||||||
@ -531,84 +530,84 @@ namespace M {
|
|||||||
assert(index < 2);
|
assert(index < 2);
|
||||||
return V[index];
|
return V[index];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Matrix negieren
|
//Matrix negieren
|
||||||
inline M2x2 operator -(M2x2 a){
|
inline M2x2 operator -(M2x2 a){
|
||||||
return {
|
return {
|
||||||
-a[0][0], -a[0][1],
|
-a[0][0], -a[0][1],
|
||||||
-a[1][0], -a[1][1]
|
-a[1][0], -a[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Addition
|
//Matrix Addition
|
||||||
inline M2x2 operator +(M2x2 a, M2x2 b) {
|
inline M2x2 operator +(M2x2 a, M2x2 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] + b[0][0], a[0][1] + b[0][1],
|
a[0][0] + b[0][0], a[0][1] + b[0][1],
|
||||||
a[1][0] + b[1][0], a[1][1] + b[1][1]
|
a[1][0] + b[1][0], a[1][1] + b[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Subtraktion
|
//Matrix Subtraktion
|
||||||
inline M2x2 operator -(M2x2 a, M2x2 b) {
|
inline M2x2 operator -(M2x2 a, M2x2 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] - b[0][0], a[0][1] - b[0][1],
|
a[0][0] - b[0][0], a[0][1] - b[0][1],
|
||||||
a[1][0] - b[1][0], a[1][1] - b[1][1]
|
a[1][0] - b[1][0], a[1][1] - b[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Skalarmultiplikation
|
//Matrix Skalarmultiplikation
|
||||||
inline M2x2 operator *(M2x2 a, float b) {
|
inline M2x2 operator *(M2x2 a, float b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] * b, a[0][1] * b,
|
a[0][0] * b, a[0][1] * b,
|
||||||
a[1][0] * b, a[1][1] * b
|
a[1][0] * b, a[1][1] * b
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Skalarmultiplikation
|
//Matrix Skalarmultiplikation
|
||||||
inline M2x2 operator *(float a, M2x2 b) {
|
inline M2x2 operator *(float a, M2x2 b) {
|
||||||
return {
|
return {
|
||||||
a * b[0][0], a * b[0][1],
|
a * b[0][0], a * b[0][1],
|
||||||
a * b[1][0], a * b[1][1]
|
a * b[1][0], a * b[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Multiplikation
|
//Matrix Multiplikation
|
||||||
inline M2x2 operator *(M2x2 a, M2x2 b) {
|
inline M2x2 operator *(M2x2 a, M2x2 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1],
|
a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1],
|
||||||
a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]
|
a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix * Vektor
|
//Matrix * Vektor
|
||||||
inline V2 operator *(M2x2 a, V2 b) {
|
inline V2 operator *(M2x2 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] * b[0] + a[0][1] * b[1],
|
a[0][0] * b[0] + a[0][1] * b[1],
|
||||||
a[1][0] * b[0] + a[1][1] * b[1],
|
a[1][0] * b[0] + a[1][1] * b[1],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Transponieren
|
//Matrix Transponieren
|
||||||
inline M2x2 transpose(M2x2 a) {
|
inline M2x2 transpose(M2x2 a) {
|
||||||
return {
|
return {
|
||||||
a[0][0], a[1][0],
|
a[0][0], a[1][0],
|
||||||
a[0][1], a[1][1]
|
a[0][1], a[1][1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Einheitsmatrix (oder Identitätsmatrix)
|
//Einheitsmatrix (oder Identitätsmatrix)
|
||||||
constexpr inline M2x2 identityM2x2() {
|
constexpr inline M2x2 identityM2x2() {
|
||||||
return {
|
return {
|
||||||
1.0f, 0.0f,
|
1.0f, 0.0f,
|
||||||
0.0f, 1.0f
|
0.0f, 1.0f
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//3x3 Matrix
|
//3x3 Matrix
|
||||||
union M3x3 {
|
union M3x3 {
|
||||||
struct {
|
struct {
|
||||||
float x1; float x2; float x3;
|
float x1; float x2; float x3;
|
||||||
float y1; float y2; float y3;
|
float y1; float y2; float y3;
|
||||||
@ -629,146 +628,145 @@ namespace M {
|
|||||||
return V[index];
|
return V[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//Matrix negieren
|
//Matrix negieren
|
||||||
inline M3x3 operator -(M3x3 a) {
|
inline M3x3 operator -(M3x3 a) {
|
||||||
return {
|
return {
|
||||||
-a[0][0], -a[0][1], -a[0][1],
|
-a[0][0], -a[0][1], -a[0][1],
|
||||||
-a[1][0], -a[1][1], -a[1][2],
|
-a[1][0], -a[1][1], -a[1][2],
|
||||||
-a[2][0], -a[2][1], -a[2][2]
|
-a[2][0], -a[2][1], -a[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Addition
|
//Matrix Addition
|
||||||
inline M3x3 operator +(M3x3 a, M3x3 b) {
|
inline M3x3 operator +(M3x3 a, M3x3 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] + b[0][0], a[0][1] + b[0][1], a[0][2] + b[0][2],
|
a[0][0] + b[0][0], a[0][1] + b[0][1], a[0][2] + b[0][2],
|
||||||
a[1][0] + b[1][0], a[1][1] + b[1][1], a[1][2] + b[1][2],
|
a[1][0] + b[1][0], a[1][1] + b[1][1], a[1][2] + b[1][2],
|
||||||
a[2][0] + b[2][0], a[2][1] + b[2][1], a[2][2] + b[2][2]
|
a[2][0] + b[2][0], a[2][1] + b[2][1], a[2][2] + b[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Subtraktion
|
//Matrix Subtraktion
|
||||||
inline M3x3 operator -(M3x3 a, M3x3 b) {
|
inline M3x3 operator -(M3x3 a, M3x3 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] - b[0][0], a[0][1] - b[0][1], a[0][2] - b[0][2],
|
a[0][0] - b[0][0], a[0][1] - b[0][1], a[0][2] - b[0][2],
|
||||||
a[1][0] - b[1][0], a[1][1] - b[1][1], a[1][2] - b[1][2],
|
a[1][0] - b[1][0], a[1][1] - b[1][1], a[1][2] - b[1][2],
|
||||||
a[2][0] - b[2][0], a[2][1] - b[2][1], a[2][2] - b[2][2]
|
a[2][0] - b[2][0], a[2][1] - b[2][1], a[2][2] - b[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Skalarmultiplikation
|
//Matrix Skalarmultiplikation
|
||||||
inline M3x3 operator *(M3x3 a, float b) {
|
inline M3x3 operator *(M3x3 a, float b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] * b, a[0][1] * b, a[0][2] * b,
|
a[0][0] * b, a[0][1] * b, a[0][2] * b,
|
||||||
a[1][0] * b, a[1][1] * b, a[1][2] * b,
|
a[1][0] * b, a[1][1] * b, a[1][2] * b,
|
||||||
a[2][0] * b, a[2][1] * b, a[2][2] * b
|
a[2][0] * b, a[2][1] * b, a[2][2] * b
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Skalarmultiplikation
|
//Matrix Skalarmultiplikation
|
||||||
inline M3x3 operator *(float a, M3x3 b) {
|
inline M3x3 operator *(float a, M3x3 b) {
|
||||||
return {
|
return {
|
||||||
a * b[0][0], a * b[0][1], a * b[0][2],
|
a * b[0][0], a * b[0][1], a * b[0][2],
|
||||||
a * b[1][0], a * b[1][1], a * b[1][2],
|
a * b[1][0], a * b[1][1], a * b[1][2],
|
||||||
a * b[2][0], a * b[2][1], a * b[2][2]
|
a * b[2][0], a * b[2][1], a * b[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix Multiplikation
|
//Matrix Multiplikation
|
||||||
inline M3x3 operator *(M3x3 a, M3x3 b) {
|
inline M3x3 operator *(M3x3 a, M3x3 b) {
|
||||||
return {
|
return {
|
||||||
a[0][0] * b[0][0] + a[0][1] * b[1][0] + a[0][2] * b[2][0], a[0][0] * b[0][1] + a[0][1] * b[1][1] + a[0][2] * b[2][1], a[0][0] * b[0][2] + a[0][1] * b[1][2] + a[0][2] * b[2][2],
|
a[0][0] * b[0][0] + a[0][1] * b[1][0] + a[0][2] * b[2][0], a[0][0] * b[0][1] + a[0][1] * b[1][1] + a[0][2] * b[2][1], a[0][0] * b[0][2] + a[0][1] * b[1][2] + a[0][2] * b[2][2],
|
||||||
a[1][0] * b[0][0] + a[1][1] * b[1][0] + a[1][2] * b[2][0], a[1][0] * b[0][1] + a[1][1] * b[1][1] + a[1][2] * b[2][1], a[1][0] * b[0][2] + a[1][1] * b[1][2] + a[0][2] * b[2][2],
|
a[1][0] * b[0][0] + a[1][1] * b[1][0] + a[1][2] * b[2][0], a[1][0] * b[0][1] + a[1][1] * b[1][1] + a[1][2] * b[2][1], a[1][0] * b[0][2] + a[1][1] * b[1][2] + a[0][2] * b[2][2],
|
||||||
a[2][0] * b[0][0] + a[2][1] * b[1][0] + a[2][2] * b[2][0], a[2][0] * b[0][1] + a[2][1] * b[1][1] + a[2][2] * b[2][1], a[2][0] * b[0][2] + a[2][1] * b[1][2] + a[0][2] * b[2][2]
|
a[2][0] * b[0][0] + a[2][1] * b[1][0] + a[2][2] * b[2][0], a[2][0] * b[0][1] + a[2][1] * b[1][1] + a[2][2] * b[2][1], a[2][0] * b[0][2] + a[2][1] * b[1][2] + a[0][2] * b[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix * V2
|
//Matrix * V2
|
||||||
inline V2 operator *(M3x3 a, V2 b) {
|
inline V2 operator *(M3x3 a, V2 b) {
|
||||||
return {
|
return {
|
||||||
b.x * a[0][0] + b.y * a[0][1] + 1.0f * a[0][2],
|
b.x * a[0][0] + b.y * a[0][1] + 1.0f * a[0][2],
|
||||||
b.x * a[1][0] + b.y * a[1][1] + 1.0f * a[1][2],
|
b.x * a[1][0] + b.y * a[1][1] + 1.0f * a[1][2],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Matrix * V3
|
//Matrix * V3
|
||||||
inline V3 operator *(M3x3 a, V3 b) {
|
inline V3 operator *(M3x3 a, V3 b) {
|
||||||
return {
|
return {
|
||||||
b.x * a[0][0] + b.y * a[0][1] + b.z * a[0][2],
|
b.x * a[0][0] + b.y * a[0][1] + b.z * a[0][2],
|
||||||
b.x * a[1][0] + b.y * a[1][1] + b.z * a[1][2],
|
b.x * a[1][0] + b.y * a[1][1] + b.z * a[1][2],
|
||||||
b.x * a[2][0] + b.y * a[2][1] + b.z * a[2][2]
|
b.x * a[2][0] + b.y * a[2][1] + b.z * a[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Matrix transponieren
|
//Matrix transponieren
|
||||||
inline M3x3 transpose(M3x3 a) {
|
inline M3x3 transpose(M3x3 a) {
|
||||||
return {
|
return {
|
||||||
a[0][0], a[1][0], a[2][0],
|
a[0][0], a[1][0], a[2][0],
|
||||||
a[0][1], a[1][1], a[2][1],
|
a[0][1], a[1][1], a[2][1],
|
||||||
a[0][2], a[1][2], a[2][2]
|
a[0][2], a[1][2], a[2][2]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Einheitsmatrix (oder Identitätsmatrix)
|
//Einheitsmatrix (oder Identitätsmatrix)
|
||||||
inline M3x3 identityM3x3() {
|
inline M3x3 identityM3x3() {
|
||||||
return {
|
return {
|
||||||
1.0f, 0.0f, 0.0f,
|
1.0f, 0.0f, 0.0f,
|
||||||
0.0f, 1.0f, 0.0f,
|
0.0f, 1.0f, 0.0f,
|
||||||
0.0f, 0.0f, 1.0f
|
0.0f, 0.0f, 1.0f
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//m128i
|
//m128i
|
||||||
struct m128i {
|
struct m128i {
|
||||||
__m128i val;
|
__m128i val;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline __m128i operator &(m128i a, m128i b) {
|
inline __m128i operator &(m128i a, m128i b) {
|
||||||
return _mm_and_si128(a.val, b.val);
|
return _mm_and_si128(a.val, b.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128i operator |(m128i a, m128i b) {
|
inline __m128i operator |(m128i a, m128i b) {
|
||||||
return _mm_or_si128(a.val, b.val);
|
return _mm_or_si128(a.val, b.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128i operator >>(m128i a, int b) {
|
inline __m128i operator >>(m128i a, int b) {
|
||||||
return _mm_srli_epi32(a.val, b);
|
return _mm_srli_epi32(a.val, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128i operator <<(m128i a, int b) {
|
inline __m128i operator <<(m128i a, int b) {
|
||||||
return _mm_slli_epi32(a.val, b);
|
return _mm_slli_epi32(a.val, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//m128
|
//m128
|
||||||
struct m128 {
|
struct m128 {
|
||||||
__m128 val;
|
__m128 val;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline __m128 operator +(m128 a, m128 b) {
|
inline __m128 operator +(m128 a, m128 b) {
|
||||||
return _mm_mul_ps(a.val, b.val);
|
return _mm_mul_ps(a.val, b.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128 operator *(m128 a, m128 b) {
|
inline __m128 operator *(m128 a, m128 b) {
|
||||||
return _mm_mul_ps(a.val, b.val);
|
return _mm_mul_ps(a.val, b.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128 operator *(float a, m128 b) {
|
inline __m128 operator *(float a, m128 b) {
|
||||||
return _mm_mul_ps(_mm_set1_ps(a), b.val);
|
return _mm_mul_ps(_mm_set1_ps(a), b.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128 square_root(__m128 a) {
|
inline __m128 square_root(__m128 a) {
|
||||||
return _mm_sqrt_ps(a);
|
return _mm_sqrt_ps(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline __m128 operator /(m128 a, m128 b) {
|
inline __m128 operator /(m128 a, m128 b) {
|
||||||
return _mm_div_ps(a.val, b.val);
|
return _mm_div_ps(a.val, b.val);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,403 +0,0 @@
|
|||||||
// SPDX-License-Identifier: MIT OR Unlicense
|
|
||||||
// smol-atlas: https://github.com/aras-p/smol-atlas
|
|
||||||
|
|
||||||
#include "smol-atlas.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <vector>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
// "memory pool" that allocates chunks of same size items,
|
|
||||||
// and maintains a freelist of items for O(1) alloc and free.
|
|
||||||
template <typename T>
|
|
||||||
struct smol_pool_t
|
|
||||||
{
|
|
||||||
static_assert(std::is_trivially_destructible_v<T>, "smol_pool_t type must be trivially destructible");
|
|
||||||
|
|
||||||
union item_t
|
|
||||||
{
|
|
||||||
item_t* next;
|
|
||||||
alignas(alignof(T)) char data[sizeof(T)];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct chunk_t
|
|
||||||
{
|
|
||||||
item_t* storage = nullptr;
|
|
||||||
chunk_t* next = nullptr;
|
|
||||||
size_t m_size_in_items;
|
|
||||||
chunk_t(size_t size_in_items) : storage(new item_t[size_in_items]), m_size_in_items(size_in_items)
|
|
||||||
{
|
|
||||||
link_all_items(nullptr);
|
|
||||||
}
|
|
||||||
~chunk_t() { delete[] storage; }
|
|
||||||
|
|
||||||
void link_all_items(item_t* last_item_next_ptr)
|
|
||||||
{
|
|
||||||
for (size_t i = 1; i < m_size_in_items; ++i)
|
|
||||||
storage[i - 1].next = &storage[i];
|
|
||||||
storage[m_size_in_items - 1].next = last_item_next_ptr;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
size_t m_chunk_size_in_items;
|
|
||||||
chunk_t* m_cur_chunk = nullptr;
|
|
||||||
item_t* m_free_list = nullptr;
|
|
||||||
|
|
||||||
smol_pool_t(size_t size_in_items)
|
|
||||||
: m_chunk_size_in_items(size_in_items)
|
|
||||||
, m_cur_chunk(new chunk_t(size_in_items))
|
|
||||||
, m_free_list(m_cur_chunk->storage)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~smol_pool_t()
|
|
||||||
{
|
|
||||||
chunk_t* chunk = m_cur_chunk;
|
|
||||||
while (chunk) {
|
|
||||||
chunk_t* next = chunk->next;
|
|
||||||
delete chunk;
|
|
||||||
chunk = next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// makes all items "unused", but keeps the allocated space
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
chunk_t* chunk = m_cur_chunk;
|
|
||||||
while (chunk) {
|
|
||||||
chunk_t* next = chunk->next;
|
|
||||||
chunk->link_all_items(next ? next->storage : nullptr);
|
|
||||||
chunk = next;
|
|
||||||
}
|
|
||||||
m_free_list = m_cur_chunk ? m_cur_chunk->storage : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename... Args> T* alloc(Args &&... args)
|
|
||||||
{
|
|
||||||
// create a new chunk if current one is full
|
|
||||||
if (m_free_list == nullptr) {
|
|
||||||
chunk_t* new_chunk = new chunk_t(m_chunk_size_in_items);
|
|
||||||
new_chunk->next = m_cur_chunk;
|
|
||||||
m_cur_chunk = new_chunk;
|
|
||||||
m_free_list = m_cur_chunk->storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
// grab item from free list
|
|
||||||
item_t* item = m_free_list;
|
|
||||||
m_free_list = item->next;
|
|
||||||
|
|
||||||
// construct the object
|
|
||||||
T* res = reinterpret_cast<T*>(item->data);
|
|
||||||
new (res) T(std::forward<Args>(args)...);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void free(T* ptr)
|
|
||||||
{
|
|
||||||
// add item to the free list
|
|
||||||
item_t* item = reinterpret_cast<item_t*>(ptr);
|
|
||||||
item->next = m_free_list;
|
|
||||||
m_free_list = item;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline int max_i(int a, int b)
|
|
||||||
{
|
|
||||||
return a > b ? a : b;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct smol_atlas_item_t
|
|
||||||
{
|
|
||||||
explicit smol_atlas_item_t(int x_, int y_, int w_, int h_, int shelf_)
|
|
||||||
: x(x_), y(y_), width(w_), height(h_), shelf_index(shelf_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int shelf_index;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct smol_free_span_t
|
|
||||||
{
|
|
||||||
explicit smol_free_span_t(int x_, int w_) : x(x_), width(w_), next(nullptr) {}
|
|
||||||
|
|
||||||
int x;
|
|
||||||
int width;
|
|
||||||
smol_free_span_t* next;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
struct smol_single_list_t
|
|
||||||
{
|
|
||||||
smol_single_list_t(T* h) : m_head(h) { }
|
|
||||||
|
|
||||||
void insert(T* prev, T* node)
|
|
||||||
{
|
|
||||||
if (prev == nullptr) { // this is first node
|
|
||||||
node->next = m_head;
|
|
||||||
m_head = node;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
node->next = prev->next;
|
|
||||||
prev->next = node;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void remove(T* prev, T* node)
|
|
||||||
{
|
|
||||||
if (prev)
|
|
||||||
prev->next = node->next;
|
|
||||||
else
|
|
||||||
m_head = node->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
T* m_head = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct smol_shelf_t
|
|
||||||
{
|
|
||||||
explicit smol_shelf_t(int y, int width, int height, int index, smol_pool_t<smol_free_span_t>& span_pool)
|
|
||||||
: m_y(y), m_height(height), m_index(index), m_free_spans(span_pool.alloc(0, width))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_space_for(int width) const
|
|
||||||
{
|
|
||||||
smol_free_span_t* it = m_free_spans.m_head;
|
|
||||||
while (it != nullptr) {
|
|
||||||
if (width <= it->width)
|
|
||||||
return true;
|
|
||||||
it = it->next;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
smol_atlas_item_t* alloc_item(int w, int h, smol_pool_t<smol_atlas_item_t>& item_pool, smol_pool_t<smol_free_span_t>& span_pool)
|
|
||||||
{
|
|
||||||
if (h > m_height)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
// find a suitable free span
|
|
||||||
smol_free_span_t* it = m_free_spans.m_head;
|
|
||||||
smol_free_span_t* prev = nullptr;
|
|
||||||
while (it != nullptr) {
|
|
||||||
if (it->width >= w) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
prev = it;
|
|
||||||
it = it->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no space in this shelf
|
|
||||||
if (it == nullptr)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
const int x = it->x;
|
|
||||||
const int rest = it->width - w;
|
|
||||||
if (rest > 0) {
|
|
||||||
// there will be still space left in this span, adjust
|
|
||||||
it->x += w;
|
|
||||||
it->width -= w;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// whole span is taken, remove it
|
|
||||||
m_free_spans.remove(prev, it);
|
|
||||||
span_pool.free(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
return item_pool.alloc(x, m_y, w, h, m_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void add_free_span(int x, int width, smol_pool_t<smol_free_span_t>& span_pool)
|
|
||||||
{
|
|
||||||
// insert into free spans list at the right position
|
|
||||||
smol_free_span_t* free_e = span_pool.alloc(x, width);
|
|
||||||
smol_free_span_t* it = m_free_spans.m_head;
|
|
||||||
smol_free_span_t* prev = nullptr;
|
|
||||||
bool added = false;
|
|
||||||
while (it != nullptr) {
|
|
||||||
if (free_e->x < it->x) {
|
|
||||||
// found right place, insert into the list
|
|
||||||
m_free_spans.insert(prev, free_e);
|
|
||||||
added = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
prev = it;
|
|
||||||
it = it->next;
|
|
||||||
}
|
|
||||||
if (!added)
|
|
||||||
m_free_spans.insert(prev, free_e);
|
|
||||||
|
|
||||||
merge_free_spans(prev, free_e, span_pool);
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_item(smol_atlas_item_t* e, smol_pool_t<smol_atlas_item_t>& item_pool, smol_pool_t<smol_free_span_t>& span_pool)
|
|
||||||
{
|
|
||||||
assert(e);
|
|
||||||
assert(e->shelf_index == m_index);
|
|
||||||
assert(e->y == m_y);
|
|
||||||
add_free_span(e->x, e->width, span_pool);
|
|
||||||
item_pool.free(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void merge_free_spans(smol_free_span_t* prev, smol_free_span_t* span, smol_pool_t<smol_free_span_t>& span_pool)
|
|
||||||
{
|
|
||||||
smol_free_span_t* next = span->next;
|
|
||||||
if (next != nullptr && span->x + span->width == next->x) {
|
|
||||||
// merge with next
|
|
||||||
span->width += next->width;
|
|
||||||
m_free_spans.remove(span, next);
|
|
||||||
span_pool.free(next);
|
|
||||||
}
|
|
||||||
if (prev != nullptr && prev->x + prev->width == span->x) {
|
|
||||||
// merge with prev
|
|
||||||
prev->width += span->width;
|
|
||||||
m_free_spans.remove(prev, span);
|
|
||||||
span_pool.free(span);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
smol_single_list_t<smol_free_span_t> m_free_spans;
|
|
||||||
const int m_y;
|
|
||||||
const int m_height;
|
|
||||||
const int m_index;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct smol_atlas_t
|
|
||||||
{
|
|
||||||
explicit smol_atlas_t(int w, int h)
|
|
||||||
: m_item_pool(1024), m_span_pool(1024)
|
|
||||||
{
|
|
||||||
m_shelves.reserve(8);
|
|
||||||
m_width = w > 0 ? w : 64;
|
|
||||||
m_height = h > 0 ? h : 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
~smol_atlas_t()
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
smol_atlas_item_t* pack(int w, int h)
|
|
||||||
{
|
|
||||||
// find best shelf
|
|
||||||
smol_shelf_t* best_shelf = nullptr;
|
|
||||||
int best_score = 0x7fffffff;
|
|
||||||
|
|
||||||
int top_y = 0;
|
|
||||||
for (auto& shelf : m_shelves) {
|
|
||||||
const int shelf_h = shelf.m_height;
|
|
||||||
top_y = max_i(top_y, shelf.m_y + shelf_h);
|
|
||||||
|
|
||||||
if (shelf_h < h)
|
|
||||||
continue; // too short
|
|
||||||
|
|
||||||
if (shelf_h == h) { // exact height fit, try to use it
|
|
||||||
smol_atlas_item_t* res = shelf.alloc_item(w, h, m_item_pool, m_span_pool);
|
|
||||||
if (res != nullptr)
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// otherwise the shelf is too tall, track best one
|
|
||||||
int score = shelf_h - h;
|
|
||||||
if (score < best_score && shelf.has_space_for(w)) {
|
|
||||||
best_score = score;
|
|
||||||
best_shelf = &shelf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (best_shelf) {
|
|
||||||
smol_atlas_item_t* res = best_shelf->alloc_item(w, h, m_item_pool, m_span_pool);
|
|
||||||
if (res != nullptr)
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no shelf with enough space: add a new shelf
|
|
||||||
if (w <= m_width && h <= m_height - top_y) {
|
|
||||||
int shelf_index = int(m_shelves.size());
|
|
||||||
m_shelves.emplace_back(top_y, m_width, h, shelf_index, m_span_pool);
|
|
||||||
return m_shelves.back().alloc_item(w, h, m_item_pool, m_span_pool);
|
|
||||||
}
|
|
||||||
|
|
||||||
// out of space
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_item(smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
if (item == nullptr)
|
|
||||||
return;
|
|
||||||
assert(item->shelf_index >= 0 && item->shelf_index < m_shelves.size());
|
|
||||||
m_shelves[item->shelf_index].free_item(item, m_item_pool, m_span_pool);
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
m_item_pool.clear();
|
|
||||||
m_span_pool.clear();
|
|
||||||
m_shelves.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
smol_pool_t<smol_atlas_item_t> m_item_pool;
|
|
||||||
smol_pool_t<smol_free_span_t> m_span_pool;
|
|
||||||
std::vector<smol_shelf_t> m_shelves;
|
|
||||||
int m_width;
|
|
||||||
int m_height;
|
|
||||||
};
|
|
||||||
|
|
||||||
smol_atlas_t* sma_atlas_create(int width, int height)
|
|
||||||
{
|
|
||||||
return new smol_atlas_t(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sma_atlas_destroy(smol_atlas_t* atlas)
|
|
||||||
{
|
|
||||||
delete atlas;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sma_atlas_width(const smol_atlas_t* atlas)
|
|
||||||
{
|
|
||||||
return atlas->m_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sma_atlas_height(const smol_atlas_t* atlas)
|
|
||||||
{
|
|
||||||
return atlas->m_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
smol_atlas_item_t* sma_item_add(smol_atlas_t* atlas, int width, int height)
|
|
||||||
{
|
|
||||||
return atlas->pack(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sma_item_remove(smol_atlas_t* atlas, smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
atlas->free_item(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sma_atlas_clear(smol_atlas_t* atlas, int new_width, int new_height)
|
|
||||||
{
|
|
||||||
atlas->clear();
|
|
||||||
if (new_width > 0) atlas->m_width = new_width;
|
|
||||||
if (new_height > 0) atlas->m_height = new_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sma_item_x(const smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
return item->x;
|
|
||||||
}
|
|
||||||
int sma_item_y(const smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
return item->y;
|
|
||||||
}
|
|
||||||
int sma_item_width(const smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
return item->width;
|
|
||||||
}
|
|
||||||
int sma_item_height(const smol_atlas_item_t* item)
|
|
||||||
{
|
|
||||||
return item->height;
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
// SPDX-License-Identifier: MIT OR Unlicense
|
|
||||||
// smol-atlas: https://github.com/aras-p/smol-atlas
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
// 2D rectangular bin packing utility that uses the Shelf Best Height Fit
|
|
||||||
// heuristic, and supports item removal. You could also call it a
|
|
||||||
// dynamic texture atlas allocator.
|
|
||||||
//
|
|
||||||
// The shelf packing algorithm works well when there is a high number of items
|
|
||||||
// with similar sizes, for example dynamic glyph or thumbnail atlases.
|
|
||||||
//
|
|
||||||
// - Incoming items are placed into horizontal "shelves" based on item heights.
|
|
||||||
// - Within each shelf, there is a sorted list of free spans.
|
|
||||||
// - When an item is added, needed portion of the first suitable free span
|
|
||||||
// is used.
|
|
||||||
// - When an item is removed, resulting free span is joined with any
|
|
||||||
// neighboring spans.
|
|
||||||
// - Shelves, once created, stay at their height and location. Even if they
|
|
||||||
// become empty, they are not removed nor joined with nearby shelves.
|
|
||||||
//
|
|
||||||
// Implementation uses STL <vector>, and some manual memory allocation
|
|
||||||
// with just regular `new` and `delete`. Custom allocators might be nice to
|
|
||||||
// do someday.
|
|
||||||
//
|
|
||||||
// At least C++11 is required.
|
|
||||||
|
|
||||||
struct smol_atlas_t;
|
|
||||||
struct smol_atlas_item_t;
|
|
||||||
|
|
||||||
/// Create atlas of given size.
|
|
||||||
smol_atlas_t* sma_atlas_create(int width, int height);
|
|
||||||
|
|
||||||
/// Destroy the atlas.
|
|
||||||
void sma_atlas_destroy(smol_atlas_t* atlas);
|
|
||||||
|
|
||||||
/// Get atlas width.
|
|
||||||
int sma_atlas_width(const smol_atlas_t* atlas);
|
|
||||||
|
|
||||||
/// Get atlas height.
|
|
||||||
int sma_atlas_height(const smol_atlas_t* atlas);
|
|
||||||
|
|
||||||
/// Add an item of (width x height) size into the atlas.
|
|
||||||
/// Use `sma_item_x` and `sma_item_y` to query the resulting item location.
|
|
||||||
/// Item can later be removed with `sma_item_remove`.
|
|
||||||
/// Returned pointer is valid until atlas is cleared or destroyed, or the item is removed.
|
|
||||||
/// Returns NULL if there is no more space left.
|
|
||||||
smol_atlas_item_t* sma_item_add(smol_atlas_t* atlas, int width, int height);
|
|
||||||
|
|
||||||
/// Remove a previously added item from the atlas.
|
|
||||||
/// The item pointer becomes invalid and can no longer be used.
|
|
||||||
void sma_item_remove(smol_atlas_t* atlas, smol_atlas_item_t* item);
|
|
||||||
|
|
||||||
/// Clear the atlas. This invalidates any previously returned item pointers.
|
|
||||||
/// If passed width and height are positive, the atlas size is also set
|
|
||||||
/// to the new values.
|
|
||||||
void sma_atlas_clear(smol_atlas_t* atlas, int new_width = 0, int new_height = 0);
|
|
||||||
|
|
||||||
/// Get item X coordinate.
|
|
||||||
int sma_item_x(const smol_atlas_item_t* item);
|
|
||||||
/// Get item Y coordinate.
|
|
||||||
int sma_item_y(const smol_atlas_item_t* item);
|
|
||||||
/// Get item width.
|
|
||||||
int sma_item_width(const smol_atlas_item_t* item);
|
|
||||||
/// Get item height.
|
|
||||||
int sma_item_height(const smol_atlas_item_t* item);
|
|
||||||
Loading…
x
Reference in New Issue
Block a user