Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Temple Run: the game's scenery grid
Mason3633ae86fb2df8f
diff --git a/docs/media/gallery/templerun.gif b/docs/media/gallery/templerun.gifindex 8f0f1d58..9ec67e67 100644Binary files a/docs/media/gallery/templerun.gif and b/docs/media/gallery/templerun.gif differdiff --git a/docs/media/thumb_templerun.png b/docs/media/thumb_templerun.pngindex ea54b456..43062f2d 100644Binary files a/docs/media/thumb_templerun.png and b/docs/media/thumb_templerun.png differdiff --git a/games/templerun/docs/boost.png b/games/templerun/docs/boost.pngindex 1d58223c..d54284da 100644Binary files a/games/templerun/docs/boost.png and b/games/templerun/docs/boost.png differdiff --git a/games/templerun/docs/bridge.png b/games/templerun/docs/bridge.pngindex 5a1d76b8..f100e0a4 100644Binary files a/games/templerun/docs/bridge.png and b/games/templerun/docs/bridge.png differdiff --git a/games/templerun/docs/coins.png b/games/templerun/docs/coins.pngindex ddbc70b3..3c410caf 100644Binary files a/games/templerun/docs/coins.png and b/games/templerun/docs/coins.png differdiff --git a/games/templerun/docs/shot.png b/games/templerun/docs/shot.pngindex bde0eb3a..9d108185 100644Binary files a/games/templerun/docs/shot.png and b/games/templerun/docs/shot.png differdiff --git a/games/templerun/docs/store.png b/games/templerun/docs/store.pngindex db409458..eaae6400 100644Binary files a/games/templerun/docs/store.png and b/games/templerun/docs/store.png differdiff --git a/games/templerun/docs/title.png b/games/templerun/docs/title.pngindex 5c1008b6..781ef881 100644Binary files a/games/templerun/docs/title.png and b/games/templerun/docs/title.png differdiff --git a/games/templerun/src/data.c b/games/templerun/src/data.cindex 08a28fd4..ad62c14d 100644--- a/games/templerun/src/data.c+++ b/games/templerun/src/data.c@@ -603,24 +603,84 @@ static const MFace f_boost[] = {{0,4,-127,0,0,0,0,0x3FCF5F}, {4,4,127,0,0,0,0,0xstatic const MVert v_coin_bonus[] = {{0,26,0}, {0,17,9}, {9,17,0}, {0,8,0}, {-9,17,0}, {0,17,-9}};static const uint16_t i_coin_bonus[] = {0,1,2,2,1,3,0,4,1,1,4,3,0,5,4,4,5,3,0,2,5,5,2,3};static const MFace f_coin_bonus[] = {{0,3,73,73,73,0,0,0xE0A818}, {3,3,73,-73,73,0,0,0xFFD21E}, {6,3,-73,73,73,0,0,0xFFD21E}, {9,3,-73,-73,73,0,0,0xE0A818}, {12,3,-73,73,-73,0,0,0xE0A818}, {15,3,-73,-73,-73,0,0,0xFFD21E}, {18,3,73,73,-73,0,0,0xFFD21E}, {21,3,73,-73,-73,0,0,0xE0A818}};-static const MVert v_jungle_tree[] = {{-9,-280,-9}, {-9,-280,9}, {-9,104,9}, {-9,104,-9}, {9,-280,-9}, {9,104,-9}, {9,104,9}, {9,-280,9}, {-36,96,-36}, {-36,96,36}, {-36,128,36}, {-36,128,-36}, {36,96,-36}, {36,128,-36}, {36,128,36}, {36,96,36}, {-24,128,-24}, {-24,128,24}, {-24,144,24}, {-24,144,-24}, {24,128,-24}, {24,144,-24}, {24,144,24}, {24,128,24}};-static const uint16_t i_jungle_tree[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,16,19,21,20,17,23,22,18,16,20,23,17,19,18,22,21};-static const MFace f_jungle_tree[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x3A6B2C}, {24,4,127,0,0,0,0,0x3A6B2C}, {28,4,0,0,-127,0,0,0x3A6B2C}, {32,4,0,0,127,0,0,0x447A34}, {36,4,0,-127,0,0,0,0x3A6B2C}, {40,4,0,127,0,0,0,0x3A6B2C}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,-127,0,0,0x2F5A26}, {56,4,0,0,127,0,0,0x4F8A3C}, {60,4,0,-127,0,0,0,0x2F5A26}, {64,4,0,127,0,0,0,0x2F5A26}};-static const MVert v_jungle_tree_far[] = {{-36,96,-36}, {-36,96,36}, {-36,128,36}, {-36,128,-36}, {36,96,-36}, {36,128,-36}, {36,128,36}, {36,96,36}, {-9,-160,-9}, {-9,-160,9}, {-9,96,9}, {-9,96,-9}, {9,-160,-9}, {9,96,-9}, {9,96,9}, {9,-160,9}};-static const uint16_t i_jungle_tree_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};-static const MFace f_jungle_tree_far[] = {{0,4,-127,0,0,0,0,0x3A6B2C}, {4,4,127,0,0,0,0,0x3A6B2C}, {8,4,0,0,127,0,0,0x447A34}, {12,4,0,-127,0,0,0,0x3A6B2C}, {16,4,0,127,0,0,0,0x3A6B2C}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};-static const MVert v_jungle_tall[] = {{-9,-280,-9}, {-9,-280,9}, {-9,176,9}, {-9,176,-9}, {9,-280,-9}, {9,176,-9}, {9,176,9}, {9,-280,9}, {-36,168,-36}, {-36,168,36}, {-36,200,36}, {-36,200,-36}, {36,168,-36}, {36,200,-36}, {36,200,36}, {36,168,36}, {-24,200,-24}, {-24,200,24}, {-24,216,24}, {-24,216,-24}, {24,200,-24}, {24,216,-24}, {24,216,24}, {24,200,24}};-static const uint16_t i_jungle_tall[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,16,19,21,20,17,23,22,18,16,20,23,17,19,18,22,21};-static const MFace f_jungle_tall[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x3A6B2C}, {24,4,127,0,0,0,0,0x3A6B2C}, {28,4,0,0,-127,0,0,0x3A6B2C}, {32,4,0,0,127,0,0,0x447A34}, {36,4,0,-127,0,0,0,0x3A6B2C}, {40,4,0,127,0,0,0,0x3A6B2C}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,-127,0,0,0x2F5A26}, {56,4,0,0,127,0,0,0x4F8A3C}, {60,4,0,-127,0,0,0,0x2F5A26}, {64,4,0,127,0,0,0,0x2F5A26}};-static const MVert v_jungle_tall_far[] = {{-36,168,-36}, {-36,168,36}, {-36,200,36}, {-36,200,-36}, {36,168,-36}, {36,200,-36}, {36,200,36}, {36,168,36}, {-9,-160,-9}, {-9,-160,9}, {-9,168,9}, {-9,168,-9}, {9,-160,-9}, {9,168,-9}, {9,168,9}, {9,-160,9}};-static const uint16_t i_jungle_tall_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};-static const MFace f_jungle_tall_far[] = {{0,4,-127,0,0,0,0,0x3A6B2C}, {4,4,127,0,0,0,0,0x3A6B2C}, {8,4,0,0,127,0,0,0x447A34}, {12,4,0,-127,0,0,0,0x3A6B2C}, {16,4,0,127,0,0,0,0x3A6B2C}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};-static const MVert v_pillar[] = {{-12,-200,-12}, {-12,-200,12}, {-12,56,12}, {-12,56,-12}, {12,-200,-12}, {12,56,-12}, {12,56,12}, {12,-200,12}, {-16,56,-16}, {-16,56,16}, {-16,66,16}, {-16,66,-16}, {16,56,-16}, {16,66,-16}, {16,66,16}, {16,56,16}};-static const uint16_t i_pillar[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13};-static const MFace f_pillar[] = {{0,4,-127,0,0,0,0,0x8E7F66}, {4,4,127,0,0,0,0,0x8E7F66}, {8,4,0,0,127,0,0,0x9E8F74}, {12,4,0,-127,0,0,0,0x8E7F66}, {16,4,0,127,0,0,0,0x8E7F66}, {20,4,-127,0,0,0,0,0x9E8F74}, {24,4,127,0,0,0,0,0x9E8F74}, {28,4,0,0,-127,0,0,0x9E8F74}, {32,4,0,0,127,0,0,0x9E8F74}, {36,4,0,-127,0,0,0,0x9E8F74}, {40,4,0,127,0,0,0,0x9E8F74}};-static const MVert v_cliff_wall[] = {{-60,80,-120}, {-60,80,120}, {-44,0,120}, {-44,0,-120}, {-120,80,-120}, {-120,80,120}};-static const uint16_t i_cliff_wall[] = {0,1,2,3,4,5,1,0};-static const MFace f_cliff_wall[] = {{0,4,125,25,0,0,0,0x8A8274}, {4,4,0,127,0,0,0,0x56743A}};+static const MVert v_treealone[] = {{-14,-360,-14}, {-14,-360,14}, {-14,480,14}, {-14,480,-14}, {14,-360,-14}, {14,480,-14}, {14,480,14}, {14,-360,14}, {-88,464,-88}, {-88,464,88}, {-88,568,88}, {-88,568,-88}, {88,464,-88}, {88,568,-88}, {88,568,88}, {88,464,88}, {-59,568,-59}, {-59,568,59}, {-59,600,59}, {-59,600,-59}, {59,568,-59}, {59,600,-59}, {59,600,59}, {59,568,59}};+static const uint16_t i_treealone[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_treealone[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x3A6B2C}, {24,4,127,0,0,0,0,0x3A6B2C}, {28,4,0,0,-127,0,0,0x3A6B2C}, {32,4,0,0,127,0,0,0x4F8A3C}, {36,4,0,-127,0,0,0,0x3A6B2C}, {40,4,0,127,0,0,0,0x3A6B2C}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,127,0,0,0x5A9444}, {56,4,0,-127,0,0,0,0x2F5A26}, {60,4,0,127,0,0,0,0x2F5A26}};+static const MVert v_treealone_far[] = {{-88,464,-88}, {-88,464,88}, {-88,600,88}, {-88,600,-88}, {88,464,-88}, {88,600,-88}, {88,600,88}, {88,464,88}, {-14,-240,-14}, {-14,-240,14}, {-14,464,14}, {-14,464,-14}, {14,-240,-14}, {14,464,-14}, {14,464,14}, {14,-240,14}};+static const uint16_t i_treealone_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};+static const MFace f_treealone_far[] = {{0,4,-127,0,0,0,0,0x3A6B2C}, {4,4,127,0,0,0,0,0x3A6B2C}, {8,4,0,0,127,0,0,0x4F8A3C}, {12,4,0,-127,0,0,0,0x3A6B2C}, {16,4,0,127,0,0,0,0x3A6B2C}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};+static const MVert v_treealone2[] = {{-14,-360,-14}, {-14,-360,14}, {-14,440,14}, {-14,440,-14}, {14,-360,-14}, {14,440,-14}, {14,440,14}, {14,-360,14}, {-80,424,-80}, {-80,424,80}, {-80,528,80}, {-80,528,-80}, {80,424,-80}, {80,528,-80}, {80,528,80}, {80,424,80}, {-53,528,-53}, {-53,528,53}, {-53,560,53}, {-53,560,-53}, {53,528,-53}, {53,560,-53}, {53,560,53}, {53,528,53}};+static const uint16_t i_treealone2[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_treealone2[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x2F5A26}, {24,4,127,0,0,0,0,0x2F5A26}, {28,4,0,0,-127,0,0,0x2F5A26}, {32,4,0,0,127,0,0,0x4F8A3C}, {36,4,0,-127,0,0,0,0x2F5A26}, {40,4,0,127,0,0,0,0x2F5A26}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,127,0,0,0x5A9444}, {56,4,0,-127,0,0,0,0x2F5A26}, {60,4,0,127,0,0,0,0x2F5A26}};+static const MVert v_treealone2_far[] = {{-80,424,-80}, {-80,424,80}, {-80,560,80}, {-80,560,-80}, {80,424,-80}, {80,560,-80}, {80,560,80}, {80,424,80}, {-14,-240,-14}, {-14,-240,14}, {-14,424,14}, {-14,424,-14}, {14,-240,-14}, {14,424,-14}, {14,424,14}, {14,-240,14}};+static const uint16_t i_treealone2_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};+static const MFace f_treealone2_far[] = {{0,4,-127,0,0,0,0,0x2F5A26}, {4,4,127,0,0,0,0,0x2F5A26}, {8,4,0,0,127,0,0,0x4F8A3C}, {12,4,0,-127,0,0,0,0x2F5A26}, {16,4,0,127,0,0,0,0x2F5A26}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};+static const MVert v_treealone3[] = {{-14,-360,-14}, {-14,-360,14}, {-14,520,14}, {-14,520,-14}, {14,-360,-14}, {14,520,-14}, {14,520,14}, {14,-360,14}, {-96,504,-96}, {-96,504,96}, {-96,608,96}, {-96,608,-96}, {96,504,-96}, {96,608,-96}, {96,608,96}, {96,504,96}, {-64,608,-64}, {-64,608,64}, {-64,640,64}, {-64,640,-64}, {64,608,-64}, {64,640,-64}, {64,640,64}, {64,608,64}};+static const uint16_t i_treealone3[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_treealone3[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x447A34}, {24,4,127,0,0,0,0,0x447A34}, {28,4,0,0,-127,0,0,0x447A34}, {32,4,0,0,127,0,0,0x4F8A3C}, {36,4,0,-127,0,0,0,0x447A34}, {40,4,0,127,0,0,0,0x447A34}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,127,0,0,0x5A9444}, {56,4,0,-127,0,0,0,0x2F5A26}, {60,4,0,127,0,0,0,0x2F5A26}};+static const MVert v_treealone3_far[] = {{-96,504,-96}, {-96,504,96}, {-96,640,96}, {-96,640,-96}, {96,504,-96}, {96,640,-96}, {96,640,96}, {96,504,96}, {-14,-240,-14}, {-14,-240,14}, {-14,504,14}, {-14,504,-14}, {14,-240,-14}, {14,504,-14}, {14,504,14}, {14,-240,14}};+static const uint16_t i_treealone3_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};+static const MFace f_treealone3_far[] = {{0,4,-127,0,0,0,0,0x447A34}, {4,4,127,0,0,0,0,0x447A34}, {8,4,0,0,127,0,0,0x4F8A3C}, {12,4,0,-127,0,0,0,0x447A34}, {16,4,0,127,0,0,0,0x447A34}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};+static const MVert v_treealone4[] = {{-14,-360,-14}, {-14,-360,14}, {-14,400,14}, {-14,400,-14}, {14,-360,-14}, {14,400,-14}, {14,400,14}, {14,-360,14}, {-76,384,-76}, {-76,384,76}, {-76,488,76}, {-76,488,-76}, {76,384,-76}, {76,488,-76}, {76,488,76}, {76,384,76}, {-51,488,-51}, {-51,488,51}, {-51,520,51}, {-51,520,-51}, {51,488,-51}, {51,520,-51}, {51,520,51}, {51,488,51}};+static const uint16_t i_treealone4[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,8,11,13,12,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_treealone4[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x3E7030}, {24,4,127,0,0,0,0,0x3E7030}, {28,4,0,0,-127,0,0,0x3E7030}, {32,4,0,0,127,0,0,0x4F8A3C}, {36,4,0,-127,0,0,0,0x3E7030}, {40,4,0,127,0,0,0,0x3E7030}, {44,4,-127,0,0,0,0,0x2F5A26}, {48,4,127,0,0,0,0,0x2F5A26}, {52,4,0,0,127,0,0,0x5A9444}, {56,4,0,-127,0,0,0,0x2F5A26}, {60,4,0,127,0,0,0,0x2F5A26}};+static const MVert v_treealone4_far[] = {{-76,384,-76}, {-76,384,76}, {-76,520,76}, {-76,520,-76}, {76,384,-76}, {76,520,-76}, {76,520,76}, {76,384,76}, {-14,-240,-14}, {-14,-240,14}, {-14,384,14}, {-14,384,-14}, {14,-240,-14}, {14,384,-14}, {14,384,14}, {14,-240,14}};+static const uint16_t i_treealone4_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15};+static const MFace f_treealone4_far[] = {{0,4,-127,0,0,0,0,0x3E7030}, {4,4,127,0,0,0,0,0x3E7030}, {8,4,0,0,127,0,0,0x4F8A3C}, {12,4,0,-127,0,0,0,0x3E7030}, {16,4,0,127,0,0,0,0x3E7030}, {20,4,-127,0,0,0,0,0x6A4A2D}, {24,4,127,0,0,0,0,0x6A4A2D}};+static const MVert v_rock[] = {{-80,-160,-68}, {-80,-160,68}, {-80,104,68}, {-80,104,-68}, {80,-160,-68}, {80,104,-68}, {80,104,68}, {80,-160,68}, {-53,104,-45}, {-53,104,34}, {-53,136,34}, {-53,136,-45}, {40,104,-45}, {40,136,-45}, {40,136,34}, {40,104,34}};+static const uint16_t i_rock[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_rock[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}, {20,4,-127,0,0,0,0,0x787266}, {24,4,127,0,0,0,0,0x787266}, {28,4,0,0,127,0,0,0x8E887C}, {32,4,0,-127,0,0,0,0x787266}, {36,4,0,127,0,0,0,0x787266}};+static const MVert v_rock_far[] = {{-80,-120,-68}, {-80,-120,68}, {-80,104,68}, {-80,104,-68}, {80,-120,-68}, {80,104,-68}, {80,104,68}, {80,-120,68}};+static const uint16_t i_rock_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_rock_far[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}};+static const MVert v_rock2[] = {{-60,-160,-56}, {-60,-160,56}, {-60,72,56}, {-60,72,-56}, {60,-160,-56}, {60,72,-56}, {60,72,56}, {60,-160,56}, {-40,72,-37}, {-40,72,28}, {-40,104,28}, {-40,104,-37}, {30,72,-37}, {30,104,-37}, {30,104,28}, {30,72,28}};+static const uint16_t i_rock2[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_rock2[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}, {20,4,-127,0,0,0,0,0x787266}, {24,4,127,0,0,0,0,0x787266}, {28,4,0,0,127,0,0,0x8E887C}, {32,4,0,-127,0,0,0,0x787266}, {36,4,0,127,0,0,0,0x787266}};+static const MVert v_rock2_far[] = {{-60,-120,-56}, {-60,-120,56}, {-60,72,56}, {-60,72,-56}, {60,-120,-56}, {60,72,-56}, {60,72,56}, {60,-120,56}};+static const uint16_t i_rock2_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_rock2_far[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}};+static const MVert v_rock3[] = {{-100,-160,-80}, {-100,-160,80}, {-100,136,80}, {-100,136,-80}, {100,-160,-80}, {100,136,-80}, {100,136,80}, {100,-160,80}, {-67,136,-53}, {-67,136,40}, {-67,168,40}, {-67,168,-53}, {50,136,-53}, {50,168,-53}, {50,168,40}, {50,136,40}};+static const uint16_t i_rock3[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_rock3[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}, {20,4,-127,0,0,0,0,0x787266}, {24,4,127,0,0,0,0,0x787266}, {28,4,0,0,127,0,0,0x8E887C}, {32,4,0,-127,0,0,0,0x787266}, {36,4,0,127,0,0,0,0x787266}};+static const MVert v_rock3_far[] = {{-100,-120,-80}, {-100,-120,80}, {-100,136,80}, {-100,136,-80}, {100,-120,-80}, {100,136,-80}, {100,136,80}, {100,-120,80}};+static const uint16_t i_rock3_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_rock3_far[] = {{0,4,-127,0,0,0,0,0x6C665C}, {4,4,127,0,0,0,0,0x6C665C}, {8,4,0,0,127,0,0,0x847E72}, {12,4,0,-127,0,0,0,0x6C665C}, {16,4,0,127,0,0,0,0x6C665C}};+static const MVert v_cliff[] = {{-112,-360,-88}, {-112,-360,88}, {-112,360,88}, {-112,360,-88}, {112,-360,-88}, {112,360,-88}, {112,360,88}, {112,-360,88}, {-75,360,-59}, {-75,360,59}, {-75,416,59}, {-75,416,-59}, {75,360,-59}, {75,416,-59}, {75,416,59}, {75,360,59}};+static const uint16_t i_cliff[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_cliff[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}, {20,4,-127,0,0,0,0,0x847C70}, {24,4,127,0,0,0,0,0x847C70}, {28,4,0,0,127,0,0,0x5E7E40}, {32,4,0,-127,0,0,0,0x847C70}, {36,4,0,127,0,0,0,0x847C70}};+static const MVert v_cliff_far[] = {{-112,-240,-88}, {-112,-240,88}, {-112,360,88}, {-112,360,-88}, {112,-240,-88}, {112,360,-88}, {112,360,88}, {112,-240,88}};+static const uint16_t i_cliff_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_cliff_far[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}};+static const MVert v_cliff2[] = {{-96,-360,-80}, {-96,-360,80}, {-96,440,80}, {-96,440,-80}, {96,-360,-80}, {96,440,-80}, {96,440,80}, {96,-360,80}, {-64,440,-53}, {-64,440,53}, {-64,496,53}, {-64,496,-53}, {64,440,-53}, {64,496,-53}, {64,496,53}, {64,440,53}};+static const uint16_t i_cliff2[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_cliff2[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}, {20,4,-127,0,0,0,0,0x847C70}, {24,4,127,0,0,0,0,0x847C70}, {28,4,0,0,127,0,0,0x5E7E40}, {32,4,0,-127,0,0,0,0x847C70}, {36,4,0,127,0,0,0,0x847C70}};+static const MVert v_cliff2_far[] = {{-96,-240,-80}, {-96,-240,80}, {-96,440,80}, {-96,440,-80}, {96,-240,-80}, {96,440,-80}, {96,440,80}, {96,-240,80}};+static const uint16_t i_cliff2_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_cliff2_far[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}};+static const MVert v_cliff3[] = {{-128,-360,-104}, {-128,-360,104}, {-128,320,104}, {-128,320,-104}, {128,-360,-104}, {128,320,-104}, {128,320,104}, {128,-360,104}, {-85,320,-69}, {-85,320,69}, {-85,376,69}, {-85,376,-69}, {85,320,-69}, {85,376,-69}, {85,376,69}, {85,320,69}};+static const uint16_t i_cliff3[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13};+static const MFace f_cliff3[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}, {20,4,-127,0,0,0,0,0x847C70}, {24,4,127,0,0,0,0,0x847C70}, {28,4,0,0,127,0,0,0x5E7E40}, {32,4,0,-127,0,0,0,0x847C70}, {36,4,0,127,0,0,0,0x847C70}};+static const MVert v_cliff3_far[] = {{-128,-240,-104}, {-128,-240,104}, {-128,320,104}, {-128,320,-104}, {128,-240,-104}, {128,320,-104}, {128,320,104}, {128,-240,104}};+static const uint16_t i_cliff3_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_cliff3_far[] = {{0,4,-127,0,0,0,0,0x7A7266}, {4,4,127,0,0,0,0,0x7A7266}, {8,4,0,0,127,0,0,0x56743A}, {12,4,0,-127,0,0,0,0x7A7266}, {16,4,0,127,0,0,0,0x7A7266}};+static const MVert v_overgrowthtrees[] = {{-68,-360,-44}, {-68,-360,-20}, {-68,440,-20}, {-68,440,-44}, {-44,-360,-44}, {-44,440,-44}, {-44,440,-20}, {-44,-360,-20}, {-128,432,-104}, {-128,432,40}, {-128,560,40}, {-128,560,-104}, {16,432,-104}, {16,560,-104}, {16,560,40}, {16,432,40}, {36,-360,-28}, {36,-360,-4}, {36,380,-4}, {36,380,-28}, {60,-360,-28}, {60,380,-28}, {60,380,-4}, {60,-360,-4}, {-24,372,-88}, {-24,372,56}, {-24,500,56}, {-24,500,-88}, {120,372,-88}, {120,500,-88}, {120,500,56}, {120,372,56}, {-12,-360,44}, {-12,-360,68}, {-12,480,68}, {-12,480,44}, {12,-360,44}, {12,480,44}, {12,480,68}, {12,-360,68}, {-72,472,-16}, {-72,472,128}, {-72,600,128}, {-72,600,-16}, {72,472,-16}, {72,600,-16}, {72,600,128}, {72,472,128}};+static const uint16_t i_overgrowthtrees[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21,24,25,26,27,28,29,30,31,25,31,30,26,24,28,31,25,27,26,30,29,32,33,34,35,36,37,38,39,33,39,38,34,32,36,39,33,35,34,38,37,40,41,42,43,44,45,46,47,41,47,46,42,40,44,47,41,43,42,46,45};+static const MFace f_overgrowthtrees[] = {{0,4,-127,0,0,0,0,0x6A4A2D}, {4,4,127,0,0,0,0,0x6A4A2D}, {8,4,0,0,127,0,0,0x6A4A2D}, {12,4,0,-127,0,0,0,0x6A4A2D}, {16,4,0,127,0,0,0,0x6A4A2D}, {20,4,-127,0,0,0,0,0x3A6B2C}, {24,4,127,0,0,0,0,0x3A6B2C}, {28,4,0,0,127,0,0,0x4F8A3C}, {32,4,0,-127,0,0,0,0x3A6B2C}, {36,4,0,127,0,0,0,0x3A6B2C}, {40,4,-127,0,0,0,0,0x6A4A2D}, {44,4,127,0,0,0,0,0x6A4A2D}, {48,4,0,0,127,0,0,0x6A4A2D}, {52,4,0,-127,0,0,0,0x6A4A2D}, {56,4,0,127,0,0,0,0x6A4A2D}, {60,4,-127,0,0,0,0,0x3A6B2C}, {64,4,127,0,0,0,0,0x3A6B2C}, {68,4,0,0,127,0,0,0x4F8A3C}, {72,4,0,-127,0,0,0,0x3A6B2C}, {76,4,0,127,0,0,0,0x3A6B2C}, {80,4,-127,0,0,0,0,0x6A4A2D}, {84,4,127,0,0,0,0,0x6A4A2D}, {88,4,0,0,127,0,0,0x6A4A2D}, {92,4,0,-127,0,0,0,0x6A4A2D}, {96,4,0,127,0,0,0,0x6A4A2D}, {100,4,-127,0,0,0,0,0x3A6B2C}, {104,4,127,0,0,0,0,0x3A6B2C}, {108,4,0,0,127,0,0,0x4F8A3C}, {112,4,0,-127,0,0,0,0x3A6B2C}, {116,4,0,127,0,0,0,0x3A6B2C}};+static const MVert v_overgrowthtrees_far[] = {{-128,432,-104}, {-128,432,40}, {-128,560,40}, {-128,560,-104}, {16,432,-104}, {16,560,-104}, {16,560,40}, {16,432,40}, {-24,372,-88}, {-24,372,56}, {-24,500,56}, {-24,500,-88}, {120,372,-88}, {120,500,-88}, {120,500,56}, {120,372,56}, {-72,472,-16}, {-72,472,128}, {-72,600,128}, {-72,600,-16}, {72,472,-16}, {72,600,-16}, {72,600,128}, {72,472,128}};+static const uint16_t i_overgrowthtrees_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_overgrowthtrees_far[] = {{0,4,-127,0,0,0,0,0x3A6B2C}, {4,4,127,0,0,0,0,0x3A6B2C}, {8,4,0,0,127,0,0,0x4F8A3C}, {12,4,0,-127,0,0,0,0x3A6B2C}, {16,4,0,127,0,0,0,0x3A6B2C}, {20,4,-127,0,0,0,0,0x3A6B2C}, {24,4,127,0,0,0,0,0x3A6B2C}, {28,4,0,0,127,0,0,0x4F8A3C}, {32,4,0,-127,0,0,0,0x3A6B2C}, {36,4,0,127,0,0,0,0x3A6B2C}, {40,4,-127,0,0,0,0,0x3A6B2C}, {44,4,127,0,0,0,0,0x3A6B2C}, {48,4,0,0,127,0,0,0x4F8A3C}, {52,4,0,-127,0,0,0,0x3A6B2C}, {56,4,0,127,0,0,0,0x3A6B2C}};+static const MVert v_templehead[] = {{-64,-160,-56}, {-64,-160,56}, {-64,120,56}, {-64,120,-56}, {64,-160,-56}, {64,120,-56}, {64,120,56}, {64,-160,56}, {-48,120,-48}, {-48,120,48}, {-48,160,48}, {-48,160,-48}, {48,120,-48}, {48,160,-48}, {48,160,48}, {48,120,48}, {-32,24,56}, {32,24,56}, {32,80,56}, {-32,80,56}};+static const uint16_t i_templehead[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19};+static const MFace f_templehead[] = {{0,4,-127,0,0,0,0,0x8C7C62}, {4,4,127,0,0,0,0,0x8C7C62}, {8,4,0,0,127,0,0,0x6F7F4A}, {12,4,0,-127,0,0,0,0x8C7C62}, {16,4,0,127,0,0,0,0x8C7C62}, {20,4,-127,0,0,0,0,0x9A8A70}, {24,4,127,0,0,0,0,0x9A8A70}, {28,4,0,0,127,0,0,0x6F7F4A}, {32,4,0,-127,0,0,0,0x9A8A70}, {36,4,0,127,0,0,0,0x9A8A70}, {40,4,0,0,127,0,0,0x3A3026}};+static const MVert v_templehead_far[] = {{-64,-120,-56}, {-64,-120,56}, {-64,160,56}, {-64,160,-56}, {64,-120,-56}, {64,160,-56}, {64,160,56}, {64,-120,56}};+static const uint16_t i_templehead_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_templehead_far[] = {{0,4,-127,0,0,0,0,0x8C7C62}, {4,4,127,0,0,0,0,0x8C7C62}, {8,4,0,0,127,0,0,0x6F7F4A}, {12,4,0,-127,0,0,0,0x8C7C62}, {16,4,0,127,0,0,0,0x8C7C62}};+static const MVert v_groundpatchtemple[] = {{-104,-24,-104}, {-104,-24,104}, {-104,0,104}, {-104,0,-104}, {104,-24,-104}, {104,0,-104}, {104,0,104}, {104,-24,104}, {-80,0,32}, {-80,0,72}, {-80,24,72}, {-80,24,32}, {-24,0,32}, {-24,24,32}, {-24,24,72}, {-24,0,72}, {40,0,-64}, {40,0,-16}, {40,16,-16}, {40,16,-64}, {72,0,-64}, {72,16,-64}, {72,16,-16}, {72,0,-16}};+static const uint16_t i_groundpatchtemple[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5,8,9,10,11,12,13,14,15,9,15,14,10,8,12,15,9,11,10,14,13,16,17,18,19,20,21,22,23,17,23,22,18,16,20,23,17,19,18,22,21};+static const MFace f_groundpatchtemple[] = {{0,4,-127,0,0,0,0,0x8E7E64}, {4,4,127,0,0,0,0,0x8E7E64}, {8,4,0,0,127,0,0,0x9C8B6F}, {12,4,0,-127,0,0,0,0x8E7E64}, {16,4,0,127,0,0,0,0x8E7E64}, {20,4,-127,0,0,0,0,0x8C7C62}, {24,4,127,0,0,0,0,0x8C7C62}, {28,4,0,0,127,0,0,0x8C7C62}, {32,4,0,-127,0,0,0,0x8C7C62}, {36,4,0,127,0,0,0,0x8C7C62}, {40,4,-127,0,0,0,0,0x8C7C62}, {44,4,127,0,0,0,0,0x8C7C62}, {48,4,0,0,127,0,0,0x8C7C62}, {52,4,0,-127,0,0,0,0x8C7C62}, {56,4,0,127,0,0,0,0x8C7C62}};+static const MVert v_groundpatchtemple_far[] = {{-104,-24,-104}, {-104,-24,104}, {-104,0,104}, {-104,0,-104}, {104,-24,-104}, {104,0,-104}, {104,0,104}, {104,-24,104}};+static const uint16_t i_groundpatchtemple_far[] = {0,1,2,3,4,5,6,7,1,7,6,2,0,4,7,1,3,2,6,5};+static const MFace f_groundpatchtemple_far[] = {{0,4,-127,0,0,0,0,0x8E7E64}, {4,4,127,0,0,0,0,0x8E7E64}, {8,4,0,0,127,0,0,0x9C8B6F}, {12,4,0,-127,0,0,0,0x8E7E64}, {16,4,0,127,0,0,0,0x8E7E64}};const Mesh meshes[M_COUNT] = {{v_templestraightvert, i_templestraightvert, f_templestraightvert, 8, M_templeStraightVert_far, 51.5f},@@ -823,10 +883,30 @@ const Mesh meshes[M_COUNT] = {{v_invisibility, i_invisibility, f_invisibility, 8, -1, 7.2f},{v_boost, i_boost, f_boost, 11, -1, 6.5f},{v_coin_bonus, i_coin_bonus, f_coin_bonus, 8, -1, 7.0f},- {v_jungle_tree, i_jungle_tree, f_jungle_tree, 17, M_JUNGLE_TREE_FAR, 70.6f},- {v_jungle_tree_far, i_jungle_tree_far, f_jungle_tree_far, 7, -1, 40.6f},- {v_jungle_tall, i_jungle_tall, f_jungle_tall, 17, M_JUNGLE_TALL_FAR, 70.6f},- {v_jungle_tall_far, i_jungle_tall_far, f_jungle_tall_far, 7, -1, 52.1f},- {v_pillar, i_pillar, f_pillar, 11, -1, 50.7f},- {v_cliff_wall, i_cliff_wall, f_cliff_wall, 2, -1, 47.4f},+ {v_treealone, i_treealone, f_treealone, 16, M_treeAlone_far, 151.9f},+ {v_treealone_far, i_treealone_far, f_treealone_far, 7, -1, 153.7f},+ {v_treealone2, i_treealone2, f_treealone2, 16, M_treeAlone2_far, 141.7f},+ {v_treealone2_far, i_treealone2_far, f_treealone2_far, 7, -1, 143.3f},+ {v_treealone3, i_treealone3, f_treealone3, 16, M_treeAlone3_far, 162.1f},+ {v_treealone3_far, i_treealone3_far, f_treealone3_far, 7, -1, 164.1f},+ {v_treealone4, i_treealone4, f_treealone4, 16, M_treeAlone4_far, 131.7f},+ {v_treealone4_far, i_treealone4_far, f_treealone4_far, 7, -1, 133.2f},+ {v_rock, i_rock, f_rock, 10, M_rock_far, 48.3f},+ {v_rock_far, i_rock_far, f_rock_far, 5, -1, 40.4f},+ {v_rock2, i_rock2, f_rock2, 10, M_rock2_far, 45.5f},+ {v_rock2_far, i_rock2_far, f_rock2_far, 5, -1, 36.8f},+ {v_rock3, i_rock3, f_rock3, 10, M_rock3_far, 51.7f},+ {v_rock3_far, i_rock3_far, f_rock3_far, 5, -1, 47.2f},+ {v_cliff, i_cliff, f_cliff, 10, M_cliff_far, 107.2f},+ {v_cliff_far, i_cliff_far, f_cliff_far, 5, -1, 97.3f},+ {v_cliff2, i_cliff2, f_cliff2, 10, M_cliff2_far, 126.2f},+ {v_cliff2_far, i_cliff2_far, f_cliff2_far, 5, -1, 114.9f},+ {v_cliff3, i_cliff3, f_cliff3, 10, M_cliff3_far, 99.5f},+ {v_cliff3_far, i_cliff3_far, f_cliff3_far, 5, -1, 90.5f},+ {v_overgrowthtrees, i_overgrowthtrees, f_overgrowthtrees, 30, M_overgrowthTrees_far, 154.9f},+ {v_overgrowthtrees_far, i_overgrowthtrees_far, f_overgrowthtrees_far, 15, -1, 154.9f},+ {v_templehead, i_templehead, f_templehead, 11, M_templeHead_far, 45.8f},+ {v_templehead_far, i_templehead_far, f_templehead_far, 5, -1, 45.8f},+ {v_groundpatchtemple, i_groundpatchtemple, f_groundpatchtemple, 15, M_groundPatchTemple_far, 37.8f},+ {v_groundpatchtemple_far, i_groundpatchtemple_far, f_groundpatchtemple_far, 5, -1, 37.8f},};diff --git a/games/templerun/src/data.h b/games/templerun/src/data.hindex 79a78534..caed85f1 100644--- a/games/templerun/src/data.h+++ b/games/templerun/src/data.h@@ -205,12 +205,32 @@ enum {M_INVISIBILITY,M_BOOST,M_COIN_BONUS,- M_JUNGLE_TREE,- M_JUNGLE_TREE_FAR,- M_JUNGLE_TALL,- M_JUNGLE_TALL_FAR,- M_PILLAR,- M_CLIFF_WALL,+ M_treeAlone,+ M_treeAlone_far,+ M_treeAlone2,+ M_treeAlone2_far,+ M_treeAlone3,+ M_treeAlone3_far,+ M_treeAlone4,+ M_treeAlone4_far,+ M_rock,+ M_rock_far,+ M_rock2,+ M_rock2_far,+ M_rock3,+ M_rock3_far,+ M_cliff,+ M_cliff_far,+ M_cliff2,+ M_cliff2_far,+ M_cliff3,+ M_cliff3_far,+ M_overgrowthTrees,+ M_overgrowthTrees_far,+ M_templeHead,+ M_templeHead_far,+ M_groundPatchTemple,+ M_groundPatchTemple_far,M_COUNT,M_PIECES = 88 /* (the path pieces: floor.c's, in its order) */};diff --git a/games/templerun/src/path.c b/games/templerun/src/path.cindex 2eb516c6..ab354e12 100644--- a/games/templerun/src/path.c+++ b/games/templerun/src/path.c@@ -250,7 +250,7 @@ static bool sides_have_obstacles(const Tile *t) {return false;}-/* ---------------------------------------------------------------- coins, power-ups, scenery */+/* ---------------------------------------------------------------- coins, power-ups */static void coins_for(Tile *t, const Tile *p) {if (t->mesh < 0 || t->obst == OB_SLIDE || t->obst == OB_NARROW || t->obst == OB_LEVEL) return;if (!p->coin_count && p->since_coins < ps.gap_coins) return;@@ -285,15 +285,6 @@ static void bonus_for(Tile *t, const Tile *p) {else t->skipped_item = 1;}-static void scenery(Tile *t) {- t->scenery = 0;- if (!path_is_straight(t) && t->obst != OB_HOLE) return;- if (t->level != TH_CLIFF && rnd(10) < 3) t->scenery |= 1;- if (rnd(10) < 3) t->scenery |= 2;- if (rnd(3) == 0) t->scenery |= 4;- if (t->level == TH_TEMPLE && rnd(6) == 0) t->scenery |= 8;-}-static uint8_t inc(uint8_t v) { return v < 255 ? (uint8_t)(v + 1) : v; }/* UpdatePathDescription: the spacing, from the parent on */@@ -417,7 +408,6 @@ static int lay(int pi, int d) {bonus_for(t, p);}describe(t, p);- scenery(t);p->next[d] = (int8_t)ni;t->next[OPP(d)] = (int8_t)pi;return ni;diff --git a/games/templerun/src/path.h b/games/templerun/src/path.hindex a8d2e521..b7e6ad8e 100644--- a/games/templerun/src/path.h+++ b/games/templerun/src/path.h@@ -38,7 +38,6 @@ typedef struct {uint8_t since_turn, since_obstacle, back_to_back, since_coins, coin_count, since_bonus;uint8_t coin, coin_kind, coins; /* how its coins lie (COIN_*), which (1 yellow, 2 red, 3 blue), those still there */uint8_t item, skipped_item;- uint8_t scenery; /* 1 a jungle tree left, 2 right, 4 a tall one, 8 a pillar */uint8_t turned;float y; /* its level's height */} Tile;diff --git a/games/templerun/src/scene.c b/games/templerun/src/scene.cindex f80278b1..40235585 100644--- a/games/templerun/src/scene.c+++ b/games/templerun/src/scene.c@@ -1,3 +1,4 @@+#include <string.h>/* The world on the screen (scene.h): the path, its jungle, the runner and the pursuers, coins and power-ups,* every one a mesh of data.c by number, placed and turned in the game's units, then drawn by r3d.c in metres* through a camera that follows the runner round the corners. */@@ -12,6 +13,7 @@static float cx_, cy_, cz_, cyaw, cc, cs; /* the camera (game units) and its yaw's cosine and sine */static float run_yaw, cam_yaw, cam_h; /* smoothed */static float t_anim;+static uint32_t scenery_seed; /* (the scenery of this run: draw_scenery) */static bool title;static uint16_t rowc[SCREEN_H]; /* the sky and the depths, row by row */static int horizon = -1000;@@ -40,6 +42,7 @@ void scene_follow(void) {}void scene_reset(void) {+ scenery_seed = plat_random();run_yaw = cam_yaw = dir_yaw(pl.dir);cam_h = pl.ground;}@@ -79,20 +82,12 @@ void scene_mesh(int m, float ox, float oy, float oz, float yaw, int alpha) {}}-static void draw_tile(const Tile *t, bool ahead) {- float x = path_cx(t), z = path_cz(t), yaw = dir_yaw(t->dir);+static void draw_tile(const Tile *t) {+ float x = path_cx(t), z = path_cz(t);float dx = x - cx_, dz = z - cz_;if (dx * cs + dz * cc < -60 || dx * dx + dz * dz > (VIEW + 60) * (VIEW + 60)) return;/* the piece: the game's prefab, laid unturned (its far version: data.c's next block) */if (t->mesh >= 0) scene_mesh(t->mesh, x, 0, z, 0, 255);- /* the cliffs' rock wall: only along the way the runner goes (it would stand in the camera's way) */- if (t->level == TH_CLIFF && path_is_straight(t) && ahead && t->dir == pl.dir) scene_mesh(M_CLIFF_WALL, x, t->y, z, yaw, 255);- int d = t->dir;- float rx = (float)(d == 0 ? 1 : d == 2 ? -1 : 0), rz = (float)(d == 1 ? -1 : d == 3 ? 1 : 0);- float fx = -rz, fz = rx;- if (t->scenery & 1) scene_mesh(t->scenery & 4 ? M_JUNGLE_TALL : M_JUNGLE_TREE, x - rx * 27 + fx * 8, t->y, z - rz * 27 + fz * 8, yaw, 255);- if (t->scenery & 2) scene_mesh(t->scenery & 4 ? M_JUNGLE_TREE : M_JUNGLE_TALL, x + rx * 27 - fx * 10, t->y, z + rz * 27 - fz * 10, yaw, 255);- if (t->scenery & 8) scene_mesh(M_PILLAR, x - rx * 15 + fx * 18, t->y, z - rz * 15 + fz * 18, yaw, 255);if (t->obst == OB_FLAME) {/* the fire across the flame tower (a vertical piece's runs along x) */bool v = t->type == PT_FLAME_V;@@ -124,6 +119,42 @@ static int runner_mesh(void) {return M_RUNNER_RUN0 + (((int)(pl.anim * 4)) & 3);}+/* ---------------------------------------------------------------- the scenery (the game's SceneryManager) */+/* A grid of 19 x 19 squares of 60 around the camera's square: those the path is in are left out (FillMask), and+ * so is the start, in front of the temple; each other one has a piece of scenery, the game's odds of each kind,+ * seen one time in four (ObjectDensity), 10 or less off the square's middle, at y 0. What each square has is+ * worked out from where it is (and the run), so it stays the same while it is seen. */+#define SGRID 19+static uint32_t mix(uint32_t h) {+ h ^= h >> 16, h *= 0x7FEB352Du, h ^= h >> 15, h *= 0x846CA68Bu, h ^= h >> 16;+ return h;+}++static void draw_scenery(void) {+ static const uint8_t trees[4] = {M_treeAlone, M_treeAlone2, M_treeAlone3, M_treeAlone4};+ static const uint8_t rocks[3] = {M_rock, M_rock2, M_rock3}, cliffs[3] = {M_cliff, M_cliff2, M_cliff3};+ int gx = (int)(cx_ / TILE), gz = (int)(cz_ / TILE); /* (the game's: truncated) */+ int x0 = gx - SGRID / 2, z0 = gz - SGRID / 2;+ static uint8_t mask[SGRID][SGRID];+ memset(mask, 0, sizeof mask);+ for (int i = 0; i < NTILES; i++)+ if (tiles[i].alive) {+ int a = tiles[i].gx - x0, b = tiles[i].gz - z0;+ if (a >= 0 && b >= 0 && a < SGRID && b < SGRID) mask[a][b] = 1;+ }+ for (int a = 0; a < SGRID; a++)+ for (int b = 0; b < SGRID; b++) {+ int cx = x0 + a, cz = z0 + b;+ if (mask[a][b] || (cx >= -1 && cx <= 1 && cz >= 0 && cz <= 4)) continue;+ uint32_t h = mix((uint32_t)cx * 0x9E3779B1u ^ mix((uint32_t)cz + scenery_seed));+ if (h % 1000 >= 250) continue; /* (ObjectDensity 0.25) */+ uint32_t k = (h >> 10) % 21, v = h >> 15;+ int m = k <= 10 ? trees[v % 4] : k <= 14 ? rocks[v % 3] : k <= 16 ? cliffs[v % 3] : k <= 18 ? M_overgrowthTrees : k == 19 ? M_templeHead : M_groundPatchTemple;+ float ox = (float)((int)((h >> 20) % 21) - 10), oz = (float)((int)((h >> 25) % 21) - 10);+ scene_mesh(m, (float)cx * TILE + ox, 0, (float)cz * TILE + oz, 0, 255);+ }+}+/* ---------------------------------------------------------------- the sky and the depths */static void bg(void) {for (int y = r_y0; y < r_y1; y++) {@@ -176,8 +207,10 @@ void scene_draw(r_band_fn overlay, bool on_title) {if (tiles[i].alive) {const Tile *t = &tiles[i];float a = (path_cx(t) - pl.x) * (float)(pl.dir == 1 ? 1 : pl.dir == 3 ? -1 : 0) + (path_cz(t) - pl.z) * (float)(pl.dir == 0 ? 1 : pl.dir == 2 ? -1 : 0);- draw_tile(t, a > -30);+ (void)a;+ draw_tile(t);}+ draw_scenery();for (int f = 0; f < NFLY; f++)if (fly[f].on) scene_mesh(fly[f].kind == 3 ? M_COIN_B : fly[f].kind == 2 ? M_COIN_R : M_COIN_Y, fly[f].x, fly[f].y - 3, fly[f].z, t_anim * 6, 255);/* the runner's shadow on the floor */diff --git a/games/templerun/tools/models.py b/games/templerun/tools/models.pyindex e627c82b..26a0cda0 100644--- a/games/templerun/tools/models.py+++ b/games/templerun/tools/models.py@@ -2,7 +2,7 @@"""Makes src/data.c and src/data.h: every model Temple Run draws, as a table of meshes (src/models.h).These are plain stand-in models: boxes and wedges in the game's colours for the runner, the pursuers, the-coins and power-ups and the jungle beside the path. The path pieces are named after the game's prefabs+coins and power-ups and the scenery (named after the game's scenery prefabs: treeAlone, rock, cliff...). The path pieces are named after the game's prefabs(tools/pieces.py: M_templeStraightVert...), and their stand-ins are made from where each one has ground andobstacles (src/floor.c, tools/floor.py): flat tops, sides going down, a box for each obstacle. Each model is amesh by number (data.h), its far version a second, simpler mesh. The game only draws meshes by number, so the@@ -298,13 +298,6 @@ def path_piece(name, cells, obstacles, far=False):return [([[q[0], q[1] + level, q[2]] for q in pts], rgb, n, two) for pts, rgb, n, two in out]-def cliff_face():- """the rock wall rising on the cliff path's left"""- out = [face([[-11, 0, -30], [-11, 0, 30], [-15, 20, 30], [-15, 20, -30]], 0x8A8274, [1, 0, 0])]- out.append(face([[-15, 20, -30], [-15, 20, 30], [-30, 20, 30], [-30, 20, -30]], 0x56743A, [0, 1, 0]))- return out--# ---------------------------------------------------------------- obstacles, coins, power-ups, scenerydef fire(t):"""the fire across a flame tower piece (jump over it or slide under it): tongues between the towers, at the@@ -358,25 +351,6 @@ def boost():return out-def jungle_tree(tall):- """a jungle tree rising from below the path, its leaves above"""- out = box(-2.2, -70, -2.2, 2.2, tall, 2.2, TRUNK, skip="b")- out += box(-9, tall - 2, -9, 9, tall + 6, 9, LEAF, top=0x447A34)- out += box(-6, tall + 6, -6, 6, tall + 10, 6, LEAF2, top=0x4F8A3C)- return out---def jungle_far(tall):- return box(-9, tall - 2, -9, 9, tall + 6, 9, LEAF, top=0x447A34, skip="b") + box(-2.2, -40, -2.2, 2.2, tall - 2, 2.2, TRUNK, skip="btfk")---def pillar():- """a broken temple pillar beside the path"""- out = box(-3, -50, -3, 3, 14, 3, 0x8E7F66, top=0x9E8F74, skip="b")- out += box(-4, 14, -4, 4, 16.5, 4, 0x9E8F74, skip="")- return out--def temple():"""the temple the run starts from: a stone block with a dark doorway (behind the start)"""out = box(-34, -40, -50, 34, 46, -30, 0x8A7A5E, top=0x6F7F4A, skip="b")@@ -385,6 +359,40 @@ def temple():return out+def scenery():+ """stand-ins for the game's scenery prefabs, about their size: trees about 150 tall rising from below the+ path, rocks, cliffs, a stone head of the temple, a patch of temple ground (laid at y 0, around their cell)"""+ out = []+ for i, (h, w, col) in enumerate(((150, 44, LEAF), (140, 40, LEAF2), (160, 48, 0x447A34), (130, 38, 0x3E7030))):+ near = box(-3.5, -90, -3.5, 3.5, h - 30, 3.5, TRUNK, skip="b")+ near += box(-w / 2, h - 34, -w / 2, w / 2, h - 8, w / 2, col, top=0x4F8A3C)+ near += box(-w / 3, h - 8, -w / 3, w / 3, h, w / 3, LEAF2, top=0x5A9444, skip="b")+ far = box(-w / 2, h - 34, -w / 2, w / 2, h, w / 2, col, top=0x4F8A3C, skip="b") + box(-3.5, -60, -3.5, 3.5, h - 34, 3.5, TRUNK, skip="btfk")+ out.append((f"treeAlone{i + 1 if i else ''}", near, far))+ for i, (w, h, d) in enumerate(((40, 26, 34), (30, 18, 28), (50, 34, 40))):+ near = box(-w / 2, -40, -d / 2, w / 2, h, d / 2, 0x6C665C, top=0x847E72, skip="b")+ near += box(-w / 3, h, -d / 3, w / 4, h + 8, d / 4, 0x787266, top=0x8E887C, skip="b")+ out.append((f"rock{i + 1 if i else ''}", near, box(-w / 2, -30, -d / 2, w / 2, h, d / 2, 0x6C665C, top=0x847E72, skip="b")))+ for i, (w, h, d) in enumerate(((56, 90, 44), (48, 110, 40), (64, 80, 52))):+ near = box(-w / 2, -90, -d / 2, w / 2, h, d / 2, 0x7A7266, top=0x56743A, skip="b")+ near += box(-w / 3, h, -d / 3, w / 3, h + 14, d / 3, 0x847C70, top=0x5E7E40, skip="b")+ out.append((f"cliff{i + 1 if i else ''}", near, box(-w / 2, -60, -d / 2, w / 2, h, d / 2, 0x7A7266, top=0x56743A, skip="b")))+ near, far = [], []+ for dx, dz, h in ((-14, -8, 140), (12, -4, 125), (0, 14, 150)):+ near += box(dx - 3, -90, dz - 3, dx + 3, h - 30, dz + 3, TRUNK, skip="b")+ near += box(dx - 18, h - 32, dz - 18, dx + 18, h, dz + 18, LEAF, top=0x4F8A3C, skip="b")+ far += box(dx - 18, h - 32, dz - 18, dx + 18, h, dz + 18, LEAF, top=0x4F8A3C, skip="b")+ out.append(("overgrowthTrees", near, far))+ near = box(-16, -40, -14, 16, 30, 14, 0x8C7C62, top=0x6F7F4A, skip="b")+ near += box(-12, 30, -12, 12, 40, 12, 0x9A8A70, top=0x6F7F4A, skip="b")+ near.append(face([[-8, 6, 14.1], [8, 6, 14.1], [8, 20, 14.1], [-8, 20, 14.1]], 0x3A3026, [0, 0, 1]))+ out.append(("templeHead", near, box(-16, -30, -14, 16, 40, 14, 0x8C7C62, top=0x6F7F4A, skip="b")))+ near = box(-26, -6, -26, 26, 0, 26, 0x8E7E64, top=0x9C8B6F, skip="b")+ near += box(-20, 0, 8, -6, 6, 18, 0x8C7C62, skip="b") + box(10, 0, -16, 18, 4, -4, 0x8C7C62, skip="b")+ out.append(("groundPatchTemple", near, box(-26, -6, -26, 26, 0, 26, 0x8E7E64, top=0x9C8B6F, skip="b")))+ return out++def build(src):# the game's path pieces first, in floor.c's order (their numbers are the same), then their far versionscells, obstacles = read_floor(src)@@ -411,21 +419,24 @@ def build(src):add("INVISIBILITY", diamond(0x9FE8FF, 0x6CC4E8))add("BOOST", boost())add("COIN_BONUS", diamond(0xFFD21E, 0xE0A818, y=4.2, r=2.2, h=2.2))- add("JUNGLE_TREE", jungle_tree(26), "JUNGLE_TREE_FAR")- add("JUNGLE_TREE_FAR", jungle_far(26))- add("JUNGLE_TALL", jungle_tree(44), "JUNGLE_TALL_FAR")- add("JUNGLE_TALL_FAR", jungle_far(44))- add("PILLAR", pillar())- add("CLIFF_WALL", cliff_face())+ # the game's scenery (SceneryManager: Trees/...), and their far versions+ for name, faces, far in scenery():+ add(name, faces, name + "_far")+ add(name + "_far", far)def write(src):build(src)+ emit(src)+++def emit(src, made_by="tools/models.py", what="Temple Run's stand-in models (boxes and wedges)"):+ """MODELS as src/data.c and src/data.h"""names = [m[0] for m in MODELS]- h = ["/* Temple Run: the mesh numbers (data.c, made by tools/models.py). */", "#ifndef TR_DATA_H", "#define TR_DATA_H",+ h = [f"/* Temple Run: the mesh numbers (data.c, made by {made_by}). */", "#ifndef TR_DATA_H", "#define TR_DATA_H",'#include "models.h"', '#include "r3d.h"', "", "enum {"]h += [f" M_{n}," for n in names] + [" M_COUNT,", f" M_PIECES = {len(pieces.PREFABS)} /* (the path pieces: floor.c's, in its order) */", "};", "#endif", ""]- c = ["/* Made by tools/models.py: Temple Run's stand-in models (boxes and wedges), as a mesh table. */",+ c = [f"/* Made by {made_by}: {what}, as a mesh table. */",'#include "data.h"', "", "const Texture *const r_tex[1] = {0};", ""]table = []for name, faces, far in MODELS: