#ifndef _LCR_ASSETS_H #define _LCR_ASSETS_H /** @file assets.h Licar: assets This file holds assets, resources and other bigger pieces of data that are to be compiled right into the executable. This is so that for a minimal version of the game a filesystem is not required. NOTES: - All images are 64x64, stored in an indexed mode (8bits pery pixel), the image starts with a 256 color palette in RGB565 format (i.e. the palette takes 512 bytes, then 64x64 bytes follow). - Each sky (background) image is composed of 4 regular images so they have higher resolution. The partial images are stored in the above format, one sky part consists of interleaved lines, so it effectively stores a 128x32 strip (instead of 64x64 square) -- this is convenient for drawing the sky. */ #include "general.h" #include "map.h" static const char *LCR_texts[] = { #define LCR_TEXTS_VERSION 0 "0.5d", // version string #define LCR_TEXTS_TABS 1 "main menu", "play map", "view repl", "race repl", #define LCR_TEXTS_MAIN_MENU 5 "camera", "music", "sound", "save repl", "exit", #define LCR_TEXTS_LOADING 10 "loading", #define LCR_TEXTS_SAVED 11 "saved" }; // TODO: define string for CLI arguments for frontends? static const char *LCR_internalDataFile = "Mtestmap;" "52123 1 :*H1k0" ":=s0s0 :fd19" // big concrete ":+w0o" ":+v0n" ":!x0n" ":^s1A0 :fk110" // ramps before wall ":=s0B0 :fd910" // concrete wall ":nu0j1 :uy0j1 :AA0j1 " ":vw0m0" ":vx0m0J" ":vw0l0L" ":vx0l0I" ":-s0q1" ":;p0w0L :f5130" // bugs ":>f0s0 :fd110" // small labyrinth ":oc0p0 :fd110" ":=f0s0 :f11d0" ":=c0p0 :f11d0" ":=C0s1 :fd190" // big dirt ":=M0s2 :fd190" // big grass ":=W0s3 :fd190" // big ice ":(s0r0" // hill ":~t1t2 :~u1t2 :~t1u2" // bumps ":^t0r0 :fq110 " // ramps ":}n0l1J :|n1l1J :|n3l1J- :]n4l1J- :=o0l1 :f151" // loop ":]n0m1J :|n1m1J :|n3m1J- :]n4m1J- :=o0m1 :f151" // loop ":}l0k1L :|l1k1L :|l3k1L- :]l4k1L- :=k0k1 :f151" ":]l0j1L :|l1j1L :|l3j1L- :]l4j1L- :=k0j1 :f151" ":-k5k1 :f5120" " map end " "#Rrep1;testmap;482f70f9 00000188:00c1:0089:0111:00b9:0091:0109:0028:0050:00c1:0093:0030:00d1:0069:0041:0020:0071:0013:0012:0023:0022:0050:0032:0020:0022:0060:0024:00bc:0044" // MAP 1: "#MLC1;4321 0 " ":*B2mL:!x6G:+L2H:+D38" // start, finish, CPs // pillars: ":nw0w2L:f151:m151" ":nz0w2L:f151:m151" ":nw0H2L:f151:m151" ":nz0H2L:f151:m151" // big structure: ":=z09:f83D" ":=H0k:fa1s" ":=H0D:fa29" ":-A29:f61C" ":'A2pI:f611" ":'B2j:f511" ":=C0j:f347" ":=H0q2:f42c" ":xB2k:f625" // start hole ":uB2o:uF2oJ :uB2kL :uF2kI" // curved corners in start ":]G2kL:]G2oL" // decorative ramps near start ":-w29:f41e" ":xH0r:f35b" // hole ":=G0C:f561" // small wall ":^G5CJ:^K5CL" // the wall corners ":=H0o1:f412" // grass near start ":=H1L1:fa11" // grass ":;R0q:f16l" // big wall west ":;E0ML:fc61" // big wall north ":)Q1rJ:f11c" // curved ramps along big wall ":)Q2DJ:f118" // curved ramps along big wall ":uQ2L|:f141:\\R0LI|:f161:\\Q0ML:f161" // corner between big walls ":=v09:fc2g" ":^z3s:^z3tI" // two small ramps near finish ":;R0l:f125" // small wall near start ":;L0jJ:f521" // small wall near start ":uQ1kI:\\R0k:f121:\\Q0jL|:f121" // corner between small walls ":=G0f1:f545:AK0f1:f141" // big grass block near start ":=A2a2:f12f:^A3a2" // wall ":=w0o:f331" ":=v072:f14i" // wall ":=G072:f14d" // wall ":'G1lL:f113:E0k:f513" // slope: ":^p3v:fk11" ":^o4w:fk11:^o3w-I:fk11" ":^n5x:fk11:^n4x-I:fk11" ":^m6y:fk11:^m5y-I:fk11" ":^l7z :fk11 :^l6z-I :fk11" ":^k8A :fk11 :^k7A-I :fk11" ":=k8B:f419:=o8F:f415:^k9K2I:f611:^k8K2I-:f611" // top ":=y0F1:fb15:^y0F1:fb11:^y0J1I:fb11" // end // TINY MAP 2: "#MLCtiny2;4321 2" ":*w1d:!w1d:+w1A" // big bumps: ":vw1hJ:m111" ":vw1qJ:m111" ":vw1yJ:m111" ":vy1r1J:m111" ":vy1u2J:m111" ":vv1t3J:m111" ":vu1k1I:vu1l1|" ":vu1v2I:vu1w2|" ":vy1lL:vy1m" ":vy1v1L:vy1w1" ":vy1yL:vy1z" // diagonal column: ":Aw1mL:m111" // big structure: ":=t0d2:f71p" ":=t1B1:f711" ":^t1d1J:f11p:^z1d1L:f11p" ":'u0n1I:f511:'u0o1:f511" // small bumps: ":~y1i1:~w1j3:~x1l:~x1p3:~u1q2:~w1s2:~x1v:~v1w1:~x1x3" // TINY MAP 3: "#MLCtiny3;4321 2" ":*B2vJ" // box: ":=n0s:fida" ":=n6s2:fi1a" ":xo2t:fgm8" ":^ocs2:fg11:vncs2L" ":^ocB2I:fg11:vEcs2I" ":^nct2J:f118:vncB2" ":^Ect2L:f118:vEcB2J" ":xo1w:fg12" // ramps: ":]o2tI:fg11:|o3tI:fg11" ":'o1uI:fg11" ":> 1) & 0x7bef); } /** Samples currently loaded image at given pixels coordinates (with wrapping). This is slower than reading the image pixel by pixel. */ uint16_t LCR_sampleImage(int x, int y) { // TODO: bottleneck, later on optimize here x = (y % LCR_IMAGE_SIZE) * LCR_IMAGE_SIZE + (x % LCR_IMAGE_SIZE); x += (x < 0) * (LCR_IMAGE_SIZE * LCR_IMAGE_SIZE); return LCR_currentImage.palette[LCR_currentImage.image[x]]; } /** Gets the next pixel of currently loaded image. This is faster than sampling the image by pixel coordinates. */ uint16_t LCR_getNextImagePixel(void) { uint16_t r = LCR_currentImage.palette[*LCR_currentImage.pixel]; LCR_currentImage.pixel++; return r; } #define LCR_CAR_VERTEX_COUNT 124 #define LCR_CAR_TRIANGLE_COUNT 228 static const int32_t LCR_carVertices[] = { 698, 202, 472, 698, -278, 671, 698, 3, 390, 698, 285, 671, 498, -231, 906, 698, 3, 953, 498, 3, 1004, 698, 202, 871, 498, 238, 906, 287, 197, 865, 287, 3, 945, 287, -190, 865, 287, -270, 671, 498, -328, 671, 698, -196, 472, 498, -231, 436, 287, -190, 478, 287, 3, 397, 498, 3, 339, 287, 197, 478, 498, 238, 436, 498, 335, 671, 287, 277, 671, 698, -196, 871, -700, 202, 871, -700, -278, 671, -700, 3, 953, -700, 285, 671, -500, -231, 436, -700, 3, 390, -500, 3, 339, -700, 202, 472, -500, 238, 436, -289, 197, 478, -289, 3, 397, -289, -190, 478, -289, -270, 671, -500, -328, 671, -700, -196, 871, -500, -231, 906, -289, -190, 865, -289, 3, 945, -500, 3, 1004, -289, 197, 865, -500, 238, 906, -500, 335, 671, -289, 277, 671, -700, -196, 472, -357, -92, 227, -422, 174, 279, -479, 143, -323, -201, 526, 202, -236, 495, -266, -234, -17, 741, -254, -84, 315, 240, -17, 741, 278, 255, 497, -245, 229, 706, 251, 229, 706, -212, 216, -585, 207, 526, 202, -272, 255, 497, 242, 495, -266, -222, 171, -763, 228, 171, -763, 238, -61, -811, -232, -61, -811, -235, -144, -356, -384, -142, -257, 218, 216, -585, 241, -144, -356, 260, -84, 315, 363, -92, 227, 390, -142, -257, 485, 143, -323, 428, 174, 279, -700, 202, -504, -700, -278, -703, -700, 3, -421, -700, 285, -703, -500, -231, -938, -700, 3, -985, -500, 3, -1035, -700, 202, -902, -500, 238, -938, -289, 197, -897, -289, 3, -977, -289, -190, -897, -289, -270, -703, -500, -328, -703, -700, -196, -504, -500, -231, -468, -289, -190, -509, -289, 3, -429, -500, 3, -371, -289, 197, -509, -500, 238, -468, -500, 335, -703, -289, 277, -703, -700, -196, -902, 698, 202, -902, 698, -278, -703, 698, 3, -985, 698, 285, -703, 498, -231, -468, 698, 3, -421, 498, 3, -371, 698, 202, -504, 498, 238, -468, 287, 197, -509, 287, 3, -429, 287, -190, -509, 287, -270, -703, 498, -328, -703, 698, -196, -902, 498, -231, -938, 287, -190, -897, 287, 3, -977, 498, 3, -1035, 287, 197, -897, 498, 238, -938, 498, 335, -703, 287, 277, -703, 698, -196, -504 }; static const uint16_t LCR_carTriangles[] = { 24, 26, 25, 25, 27, 24, 28, 30, 29, 30, 32, 31, 30, 34, 33, 30, 28, 35, 28, 37, 36, 25, 37, 28, 38, 39, 37, 37, 39, 40, 39, 42, 41, 26, 42, 39, 42, 44, 43, 24, 44, 42, 27, 45, 44, 27, 31, 32, 46, 45, 32, 45, 46, 43, 25, 26, 38, 27, 25, 31, 31, 25, 29, 29, 25, 47, 43, 46, 36, 43, 36, 41, 36, 40, 41, 46, 33, 36, 33, 34, 36, 35, 36, 34, 28, 29, 47, 30, 31, 29, 30, 33, 32, 30, 35, 34, 28, 36, 35, 25, 28, 47, 38, 37, 25, 37, 40, 36, 39, 41, 40, 26, 39, 38, 42, 43, 41, 24, 42, 26, 27, 44, 24, 27, 32, 45, 46, 32, 33, 45, 43, 44, 48, 50, 49, 49, 52, 51, 53, 55, 54, 56, 58, 57, 52, 50, 59, 56, 61, 60, 55, 53, 58, 51, 61, 49, 60, 51, 62, 63, 64, 59, 63, 66, 65, 54, 61, 53, 59, 50, 67, 50, 68, 67, 67, 68, 54, 63, 59, 66, 67, 66, 59, 61, 54, 49, 49, 54, 48, 57, 53, 61, 59, 69, 52, 70, 65, 66, 71, 70, 67, 48, 54, 68, 72, 74, 73, 75, 62, 74, 54, 55, 71, 57, 61, 56, 62, 69, 74, 51, 60, 61, 58, 53, 57, 60, 75, 56, 52, 62, 51, 64, 69, 59, 65, 64, 63, 71, 55, 56, 69, 70, 74, 74, 70, 73, 70, 71, 73, 64, 65, 69, 70, 69, 65, 56, 75, 71, 75, 72, 71, 58, 56, 55, 62, 52, 69, 54, 71, 67, 70, 66, 67, 72, 73, 71, 48, 68, 50, 49, 50, 52, 72, 75, 74, 75, 60, 62, 0, 2, 1, 1, 3, 0, 4, 6, 5, 6, 8, 7, 6, 10, 9, 6, 4, 11, 4, 13, 12, 1, 13, 4, 14, 15, 13, 13, 15, 16, 15, 18, 17, 2, 18, 15, 18, 20, 19, 0, 20, 18, 3, 21, 20, 3, 7, 8, 22, 21, 8, 21, 22, 19, 1, 2, 14, 3, 1, 7, 7, 1, 5, 5, 1, 23, 19, 22, 12, 19, 12, 17, 12, 16, 17, 22, 9, 12, 9, 10, 12, 11, 12, 10, 4, 5, 23, 6, 7, 5, 6, 9, 8, 6, 11, 10, 4, 12, 11, 1, 4, 23, 14, 13, 1, 13, 16, 12, 15, 17, 16, 2, 15, 14, 18, 19, 17, 0, 18, 2, 3, 20, 0, 3, 8, 21, 22, 8, 9, 21, 19, 20, 76, 78, 77, 77, 79, 76, 80, 82, 81, 82, 84, 83, 82, 86, 85, 82, 80, 87, 80, 89, 88, 77, 89, 80, 90, 91, 89, 89, 91, 92, 91, 94, 93, 78, 94, 91, 94, 96, 95, 76, 96, 94, 79, 97, 96, 79, 83, 84, 98, 97, 84, 97, 98, 95, 77, 78, 90, 79, 77, 83, 83, 77, 81, 81, 77, 99, 95, 98, 88, 95, 88, 93, 88, 92, 93, 98, 85, 88, 85, 86, 88, 87, 88, 86, 80, 81, 99, 82, 83, 81, 82, 85, 84, 82, 87, 86, 80, 88, 87, 77, 80, 99, 90, 89, 77, 89, 92, 88, 91, 93, 92, 78, 91, 90, 94, 95, 93, 76, 94, 78, 79, 96, 76, 79, 84, 97, 98, 84, 85, 97, 95, 96, 100, 102, 101, 101, 103, 100, 104, 106, 105, 106, 108, 107, 106, 110, 109, 106, 104, 111, 104, 113, 112, 101, 113, 104, 114, 115, 113, 113, 115, 116, 115, 118, 117, 102, 118, 115, 118, 120, 119, 100, 120, 118, 103, 121, 120, 103, 107, 108, 122, 121, 108, 121, 122, 119, 101, 102, 114, 103, 101, 107, 107, 101, 105, 105, 101, 123, 119, 122, 112, 119, 112, 117, 112, 116, 117, 122, 109, 112, 109, 110, 112, 111, 112, 110, 104, 105, 123, 106, 107, 105, 106, 109, 108, 106, 111, 110, 104, 112, 111, 101, 104, 123, 114, 113, 101, 113, 116, 112, 115, 117, 116, 102, 115, 114, 118, 119, 117, 100, 118, 102, 103, 120, 100, 103, 108, 121, 122, 108, 109, 121, 119, 120 }; static const uint16_t LCR_carUvs[] = { 102, 283, 59, 382, 118, 324, 61, 265, 58, 224, 119, 193, 58, 193, 119, 163, 58, 163, 0, 163, 0, 193, 0, 224, 0, 256, 58, 256, 119, 256, 119, 39, 58, 7, 58, 39, 0, 39, 0, 70, 58, 70, 119, 70, 0, 101, 58, 101, 119, 101, 119, 132, 58, 132, 0, 132, 100, 365, 19, 281, 1, 322, 18, 364, 19, 281, 59, 382, 61, 265, 1, 322, 18, 364, 102, 283, 118, 325, 101, 366, 119, 224, 119, 7, 0, 7, 249, 201, 243, 118, 369, 119, 247, 15, 361, 15, 500, 246, 397, 242, 500, 350, 103, 397, 57, 499, 57, 402, 444, 80, 200, 400, 103, 505, 3, 404, 3, 497, 181, 101, 302, 393, 200, 502, 432, 502, 393, 500, 432, 400, 497, 403, 497, 499, 229, 199, 126, 176, 406, 204, 368, 198, 234, 244, 258, 213, 484, 88, 500, 161, 130, 113, 302, 509, 393, 402, 234, 352, 126, 245, 126, 351, 397, 354, 376, 219, 250, 201, 369, 198, 368, 117, 244, 117, 361, 14, 444, 80, 247, 14, 181, 101, 229, 199, 125, 176, 407, 203, 258, 383, 485, 87, 500, 161, 129, 113, 376, 377, 102, 283, 59, 382, 118, 324, 61, 265, 58, 224, 119, 193, 58, 193, 119, 163, 58, 163, 0, 163, 0, 193, 0, 224, 0, 256, 58, 256, 119, 256, 119, 39, 58, 7, 58, 39, 0, 39, 0, 70, 58, 70, 119, 70, 0, 101, 58, 101, 119, 101, 119, 132, 58, 132, 0, 132, 100, 365, 19, 281, 1, 322, 18, 364, 19, 281, 59, 382, 61, 265, 1, 322, 18, 364, 102, 283, 118, 325, 101, 366, 119, 224, 119, 7, 0, 7, 102, 283, 59, 382, 118, 324, 61, 265, 58, 224, 119, 193, 58, 193, 119, 163, 58, 163, 0, 163, 0, 193, 0, 224, 0, 256, 58, 256, 119, 256, 119, 39, 58, 7, 58, 39, 0, 39, 0, 70, 58, 70, 119, 70, 0, 101, 58, 101, 119, 101, 119, 132, 58, 132, 0, 132, 100, 365, 19, 281, 1, 322, 18, 364, 19, 281, 59, 382, 61, 265, 1, 322, 18, 364, 102, 283, 118, 325, 101, 366, 119, 224, 119, 7, 0, 7, 102, 283, 59, 382, 118, 324, 61, 265, 58, 224, 119, 193, 58, 193, 119, 163, 58, 163, 0, 163, 0, 193, 0, 224, 0, 256, 58, 256, 119, 256, 119, 39, 58, 7, 58, 39, 0, 39, 0, 70, 58, 70, 119, 70, 0, 101, 58, 101, 119, 101, 119, 132, 58, 132, 0, 132, 100, 365, 19, 281, 1, 322, 18, 364, 19, 281, 59, 382, 61, 265, 1, 322, 18, 364, 102, 283, 118, 325, 101, 366, 119, 224, 119, 7, 0, 7 }; static const uint16_t LCR_carTriangleUvs[] = { 0, 2, 1, 1, 3, 0, 4, 6, 5, 6, 8, 7, 6, 10, 9, 6, 4, 11, 4, 13, 12, 14, 13, 4, 15, 17, 16, 16, 17, 18, 17, 20, 19, 21, 20, 17, 20, 23, 22, 24, 23, 20, 25, 26, 23, 25, 7, 8, 27, 26, 8, 26, 27, 22, 1, 2, 28, 3, 1, 29, 29, 1, 30, 30, 1, 31, 32, 34, 33, 32, 33, 35, 33, 36, 35, 34, 37, 33, 37, 38, 33, 39, 33, 38, 4, 5, 40, 6, 7, 5, 6, 9, 8, 6, 11, 10, 4, 12, 11, 14, 4, 40, 15, 16, 41, 16, 18, 42, 17, 19, 18, 21, 17, 15, 20, 22, 19, 24, 20, 21, 25, 23, 24, 25, 8, 26, 27, 8, 9, 26, 22, 23, 43, 45, 44, 44, 47, 46, 48, 50, 49, 51, 53, 52, 47, 45, 54, 51, 56, 55, 57, 58, 53, 46, 59, 44, 55, 61, 60, 62, 64, 63, 62, 66, 65, 67, 59, 68, 54, 45, 69, 45, 70, 69, 71, 72, 49, 73, 54, 74, 69, 74, 54, 59, 67, 44, 44, 67, 43, 75, 68, 59, 63, 77, 76, 78, 80, 79, 81, 78, 71, 82, 49, 72, 83, 85, 84, 86, 87, 85, 49, 50, 81, 52, 56, 51, 87, 88, 85, 61, 55, 56, 53, 58, 52, 89, 86, 90, 76, 60, 61, 64, 77, 63, 65, 64, 62, 91, 92, 90, 88, 93, 85, 85, 93, 84, 78, 81, 94, 95, 96, 88, 93, 88, 96, 90, 86, 91, 86, 83, 91, 97, 90, 92, 60, 76, 77, 49, 81, 71, 78, 79, 71, 98, 94, 81, 43, 70, 45, 44, 45, 47, 83, 86, 85, 86, 89, 87, 99, 101, 100, 100, 102, 99, 103, 105, 104, 105, 107, 106, 105, 109, 108, 105, 103, 110, 103, 112, 111, 113, 112, 103, 114, 116, 115, 115, 116, 117, 116, 119, 118, 120, 119, 116, 119, 122, 121, 123, 122, 119, 124, 125, 122, 124, 106, 107, 126, 125, 107, 125, 126, 121, 100, 101, 127, 102, 100, 128, 128, 100, 129, 129, 100, 130, 131, 133, 132, 131, 132, 134, 132, 135, 134, 133, 136, 132, 136, 137, 132, 138, 132, 137, 103, 104, 139, 105, 106, 104, 105, 108, 107, 105, 110, 109, 103, 111, 110, 113, 103, 139, 114, 115, 140, 115, 117, 141, 116, 118, 117, 120, 116, 114, 119, 121, 118, 123, 119, 120, 124, 122, 123, 124, 107, 125, 126, 107, 108, 125, 121, 122, 142, 144, 143, 143, 145, 142, 146, 148, 147, 148, 150, 149, 148, 152, 151, 148, 146, 153, 146, 155, 154, 156, 155, 146, 157, 159, 158, 158, 159, 160, 159, 162, 161, 163, 162, 159, 162, 165, 164, 166, 165, 162, 167, 168, 165, 167, 149, 150, 169, 168, 150, 168, 169, 164, 143, 144, 170, 145, 143, 171, 171, 143, 172, 172, 143, 173, 174, 176, 175, 174, 175, 177, 175, 178, 177, 176, 179, 175, 179, 180, 175, 181, 175, 180, 146, 147, 182, 148, 149, 147, 148, 151, 150, 148, 153, 152, 146, 154, 153, 156, 146, 182, 157, 158, 183, 158, 160, 184, 159, 161, 160, 163, 159, 157, 162, 164, 161, 166, 162, 163, 167, 165, 166, 167, 150, 168, 169, 150, 151, 168, 164, 165, 185, 187, 186, 186, 188, 185, 189, 191, 190, 191, 193, 192, 191, 195, 194, 191, 189, 196, 189, 198, 197, 199, 198, 189, 200, 202, 201, 201, 202, 203, 202, 205, 204, 206, 205, 202, 205, 208, 207, 209, 208, 205, 210, 211, 208, 210, 192, 193, 212, 211, 193, 211, 212, 207, 186, 187, 213, 188, 186, 214, 214, 186, 215, 215, 186, 216, 217, 219, 218, 217, 218, 220, 218, 221, 220, 219, 222, 218, 222, 223, 218, 224, 218, 223, 189, 190, 225, 191, 192, 190, 191, 194, 193, 191, 196, 195, 189, 197, 196, 199, 189, 225, 200, 201, 226, 201, 203, 227, 202, 204, 203, 206, 202, 200, 205, 207, 204, 209, 205, 206, 210, 208, 209, 210, 193, 211, 212, 193, 194, 211, 207, 208 }; static const uint8_t LCR_carVertexTypes[] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; #endif