test to create a tilesmap shader

This commit is contained in:
Sylvain PILLOT 2023-01-30 22:31:33 +01:00
parent f4fa7b0c48
commit bc90a2d6c5
12 changed files with 232 additions and 227 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,44 @@
{ "compressionlevel":-1,
"height":14,
"infinite":false,
"layers":[
{
"data":[0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 1310, 0, 1310, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 759, 760, 759, 760, 759, 760, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 791, 792, 791, 792, 791, 792, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 834, 842, 0, 0, 919, 77, 921, 0, 0, 0, 0, 0, 852, 661, 724, 0, 0, 919, 77, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 919, 77, 921, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 810, 0, 0, 919, 77, 921, 601, 601, 877, 0, 691, 630, 819, 0, 0, 0, 919, 77, 921, 0, 820, 0, 0, 0, 0, 0, 0, 691, 692, 693, 694, 691, 692, 693, 694, 919, 77, 921, 0, 601, 0, 601, 919, 77, 921, 919, 77, 921, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 851, 0, 0, 0, 116, 533, 118, 601, 601, 907, 852, 661, 724, 0, 0, 0, 0, 116, 533, 118, 886, 601, 0, 0, 0, 0, 0, 0, 723, 724, 725, 726, 723, 724, 725, 726, 116, 533, 118, 0, 601, 0, 601, 116, 533, 118, 116, 533, 118, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 628, 629, 630, 308, 213, 310, 601, 0, 629, 630, 819, 0, 0, 0, 0, 0, 308, 213, 310, 627, 628, 0, 0, 0, 0, 0, 0, 627, 628, 629, 630, 627, 628, 629, 630, 308, 213, 310, 0, 601, 0, 0, 308, 213, 310, 308, 213, 310, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 659, 660, 661, 662, 919, 77, 921, 601, 852, 661, 662, 0, 0, 0, 0, 0, 0, 919, 77, 921, 659, 660, 0, 0, 0, 0, 0, 0, 659, 660, 661, 662, 659, 660, 661, 662, 919, 77, 921, 0, 601, 0, 0, 919, 77, 921, 919, 77, 921, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 692, 693, 694, 919, 77, 921, 691, 692, 819, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 691, 692, 0, 0, 0, 0, 0, 0, 691, 692, 693, 694, 691, 692, 693, 694, 919, 77, 921, 0, 601, 0, 0, 919, 77, 921, 919, 77, 921, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 723, 724, 725, 726, 116, 533, 118, 723, 724, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 723, 724, 0, 0, 0, 0, 0, 0, 723, 724, 725, 726, 723, 724, 725, 726, 116, 533, 118, 0, 601, 0, 0, 116, 533, 118, 116, 533, 118, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 917, 308, 213, 310, 918, 0, 0, 0, 0, 0, 0, 0, 0, 620, 541, 542, 509, 619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 308, 213, 310, 0, 0, 0, 0, 308, 213, 310, 308, 213, 310, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652, 653, 695, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 919, 77, 921, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 0, 0, 0, 0, 811, 0, 0, 727, 0, 0, 810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 919, 77, 921, 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, 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, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 542, 509, 510, 542, 543, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 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, 0, 524, 756, 525, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":14,
"id":2,
"name":"Background",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":90,
"x":0,
"y":0
},
{
"data":[866, 1986, 1991, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 976, 1011, 977, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 0, 0, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 1991, 0, 1972, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 898, 1986, 1991, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1498, 1497, 1499, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 0, 0, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 1991, 0, 1972, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 899, 2018, 2023, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 0, 0, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2023, 0, 2004, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 612, 908, 874, 877, 0, 0, 0, 908, 874, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 601, 627, 628, 691, 692, 693, 694, 0, 0, 0, 0, 0, 0, 601, 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, 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, 644, 0, 908, 907, 0, 0, 0, 0, 908, 0, 877, 0, 0, 0, 0, 843, 875, 0, 0, 0, 0, 0, 659, 660, 723, 724, 725, 726, 0, 0, 0, 0, 0, 0, 601, 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, 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, 0, 0, 0, 0, 0, 1398, 569, 855, 908, 907, 842, 0, 0, 843, 875, 810, 0, 0, 1398, 569, 855, 629, 630, 627, 628, 629, 630, 0, 0, 0, 0, 0, 0, 854, 569, 1398, 0, 265, 569, 569, 0, 855, 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, 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, 0, 908, 874, 842, 843, 875, 810, 0, 0, 0, 0, 0, 0, 661, 662, 659, 660, 661, 662, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 601, 0, 0, 0, 811, 907, 875, 810, 0, 0, 0, 0, 0, 0, 0, 693, 694, 691, 692, 693, 694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 6, 38, 39, 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, 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, 535, 503, 408, 504, 537, 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, 535, 503, 408, 504, 537, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":14,
"id":1,
"name":"Foreground",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":90,
"x":0,
"y":0
}],
"nextlayerid":4,
"nextobjectid":1,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.8.0",
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"source":"Tileset_Space.tsx"
}],
"tilewidth":16,
"type":"map",
"version":"1.8",
"width":90
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.9" tiledversion="1.9.2" orientation="orthogonal" renderorder="right-down" width="90" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="4" nextobjectid="1">
<tileset firstgid="1" source="Tileset_Space.tsx"/>
<layer id="2" name="Background" width="90" height="14">
<data encoding="csv">
0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,1310,0,1310,1310,0,1310,0,0,0,0,1310,0,1310,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,0,759,760,759,760,759,760,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,2003,2003,2003,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,0,791,792,791,792,791,792,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
834,842,0,0,919,77,921,0,0,0,0,0,852,661,724,0,0,919,77,921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,919,77,921,0,0,0,0,919,77,921,919,77,921,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,810,0,0,919,77,921,601,601,877,0,691,630,819,0,0,0,919,77,921,0,820,0,0,0,0,0,0,691,692,693,694,691,692,693,694,919,77,921,0,601,0,601,919,77,921,919,77,921,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
851,0,0,0,116,533,118,601,601,907,852,661,724,0,0,0,0,116,533,118,886,601,0,0,0,0,0,0,723,724,725,726,723,724,725,726,116,533,118,0,601,0,601,116,533,118,116,533,118,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
627,628,629,630,308,213,310,601,0,629,630,819,0,0,0,0,0,308,213,310,627,628,0,0,0,0,0,0,627,628,629,630,627,628,629,630,308,213,310,0,601,0,0,308,213,310,308,213,310,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
659,660,661,662,919,77,921,601,852,661,662,0,0,0,0,0,0,919,77,921,659,660,0,0,0,0,0,0,659,660,661,662,659,660,661,662,919,77,921,0,601,0,0,919,77,921,919,77,921,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
691,692,693,694,919,77,921,691,692,819,0,0,0,0,0,0,0,919,77,921,691,692,0,0,0,0,0,0,691,692,693,694,691,692,693,694,919,77,921,0,601,0,0,919,77,921,919,77,921,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
723,724,725,726,116,533,118,723,724,0,0,0,0,0,0,0,0,919,77,921,723,724,0,0,0,0,0,0,723,724,725,726,723,724,725,726,116,533,118,0,601,0,0,116,533,118,116,533,118,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
918,0,0,917,308,213,310,918,0,0,0,0,0,0,0,0,620,541,542,509,619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,917,308,213,310,0,0,0,0,308,213,310,308,213,310,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,919,77,921,0,0,0,0,0,0,0,0,0,652,653,695,650,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,919,77,921,0,0,0,0,919,77,921,919,77,921,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,919,77,921,0,0,0,0,0,0,0,0,811,0,0,727,0,0,810,0,0,0,0,0,0,0,0,0,0,0,0,0,0,919,77,921,0,0,0,0,919,77,921,919,77,921,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,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,0,0,0,1497,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,541,542,509,510,542,543,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,524,756,525,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,0,524,756,525,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="1" name="Foreground" width="90" height="14">
<data encoding="csv">
866,1986,1991,1971,976,1011,977,1971,741,742,1971,976,1011,977,976,1011,977,976,1011,977,1971,741,742,1971,976,1011,977,0,0,976,1011,977,1971,741,742,1971,976,1011,977,1971,1991,0,1972,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
898,1986,1991,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1498,1497,1499,1498,1497,1499,1973,773,774,1974,1498,1497,1499,0,0,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,1991,0,1972,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
899,2018,2023,2020,0,0,0,2002,2003,2003,2020,0,0,0,0,0,0,0,0,0,2002,2003,2003,2020,0,0,0,0,0,0,0,0,2002,2003,2003,2020,0,0,0,2002,2023,0,2004,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
612,908,874,877,0,0,0,908,874,0,0,0,0,0,0,0,876,0,0,0,0,601,627,628,691,692,693,694,0,0,0,0,0,0,601,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,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,
644,0,908,907,0,0,0,0,908,0,877,0,0,0,0,843,875,0,0,0,0,0,659,660,723,724,725,726,0,0,0,0,0,0,601,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,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,0,0,0,0,0,1398,569,855,908,907,842,0,0,843,875,810,0,0,1398,569,855,629,630,627,628,629,630,0,0,0,0,0,0,854,569,1398,0,265,569,569,0,855,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,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,0,908,874,842,843,875,810,0,0,0,0,0,0,661,662,659,660,661,662,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,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,0,0,0,0,0,0,
0,0,0,0,0,0,0,601,0,0,0,811,907,875,810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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,535,503,408,504,537,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,535,503,408,504,537,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
</map>

View File

@ -0,0 +1,14 @@
{ "columns":32,
"image":"tileset.png",
"imageheight":1024,
"imagewidth":512,
"margin":0,
"name":"Tileset_Space",
"spacing":0,
"tilecount":2048,
"tiledversion":"1.8.0",
"tileheight":16,
"tilewidth":16,
"type":"tileset",
"version":"1.8"
}

Binary file not shown.

View File

@ -1,14 +1,8 @@
#ifndef MYAZURSHADERS_H
#define MYAZURSHADERS_H
#include "starfield.h"
#include <vector>
void azrp_pixel(int x1, int y1, int color);
void azrp_pixellist(std::vector<Pixel*> const &list, int fragnum );
#define SHOW_PIXELS 1
#define SHOW_STARS 2
@ -18,4 +12,6 @@ void azrp_starfield_init( uint8_t nbstars );
void azrp_starfield_close( void );
void azrp_starfield_USBDEBUG( uint8_t info );
void azrp_tilesmap( int shifttile, int *tilemap, bopti_image_t *image, int tileset_size );
#endif //MYAZURSHADERS_H

View File

@ -22,7 +22,7 @@ Background::~Background( )
void Background::Render( void )
{
int x0 = (int) xlevel;
/* int x0 = (int) xlevel;
int shifttile = (int) (16*xlevel.frac());
for(int u=0; u<map_Level1.nblayers;u++)
@ -40,8 +40,25 @@ void Background::Render( void )
}
}
}
*/
int x0 = (int) xlevel;
int shifttile = (int) (16*xlevel.frac());
uint16_t tilemap[25*14]={0};
for(int u=0; u<map_Level1.nblayers;u++)
{
for(int j=0; j<14; j++)
{
for(int i=0; i<=25; i++)
{
uint16_t index = j * map_Level1.w + (x0+i) % map_Level1.w;
tilemap[25*j+i]= cmap_Level1.layers[u][ index ];
}
}
azrp_tilesmap( shifttile, tilemap, map_Level1.tileset, map_Level1.tileset_size);
}
}
void Background::Update( float dt )

View File

@ -8,7 +8,6 @@ extern std::vector<Particle*> MyParticles;
extern std::vector<Bullet*> MyPlayerBullets;
extern std::vector<Enemy*> MyEnemies;
extern std::vector<Impact*> MyImpacts;
extern Starfield *MyStarField;
extern Player *MyPlayer;

View File

@ -24,12 +24,14 @@
#include "collections.h"
#include "MyAzurShaders.h"
#include "player.h"
#include "utilities.h"
#include "particles.h"
#include "bullet.h"
#include "enemy.h"
#include "MyAzurShaders.h"
#include "impact.h"
#include "background.h"
@ -75,8 +77,6 @@ std::vector<Impact*> MyImpacts;
Background MyBackground;
Starfield *MyStarField;
Player *MyPlayer;
KeyboardExtra MyKeyboard;

View File

@ -1,159 +0,0 @@
#include "starfield.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <gint/rtc.h>
#include <num/num.h>
#include "MyAzurShaders.h"
Star::Star( void )
{
x = libnum::num( rand() % 396 );
y = libnum::num( rand() % 224 );
size = 1 + ( rand() % 4 );
sx = libnum::num( -1*size );
sy = 0;
int colorrandom = rand() % 4;
color = 0xFFFF;
/*
if (colorrandom==0) color = 0xFFFF;
else if (colorrandom==1) color = 0xFFE0;
else if (colorrandom==2) color = 0xFB80;
else color = 0xF80D;
*/
}
Star::~Star()
{
}
void Star::Update( libnum::num dt )
{
//libnum::num a = libnum::num( dt / 12000.0f );
//y += sy * a;
x += sx * dt;
y += sy * dt;
if (y<-3 || y > 226 || x<-3 || x>398)
{
x = 396;
y = libnum::num( rand() % 224 );
}
}
Starfield::Starfield( )
{
srand(rtc_ticks());
for(int i=0; i<100; i++)
{
Star *s = new Star( );
MyStars.push_back( s );
}
}
Starfield::~Starfield( )
{
for(auto& s : MyStars)
delete(s);
for(auto& list : PixelListPerFragment)
{
for(auto& p : list)
delete(p);
list.clear();
}
MyStars.clear();
}
void Starfield::Update( float dt )
{
libnum::num a = libnum::num( dt / 50000.f );
for(auto& s : MyStars)
s->Update( a );
}
void Starfield::AddPixel( int x, int y, int c )
{
// check if the point is in the range screen
if(x >= azrp_width || x < 0 || y >= azrp_height || y < 0)
return;
uint8_t current_frag = y >> 4; // each fragment is 16pixel high : so fragment number for the current point is y/16 or y>>4
Pixel *MyPix = new Pixel( x, y & 15, c ); // consider the local offset of the point in the current fragment (y & 15)
PixelListPerFragment[ current_frag ].push_back( MyPix ); // add the pixel to the appropriate list
}
void Starfield::Render( void )
{
for(auto& list : PixelListPerFragment)
{
for(auto& p : list)
{
delete(p);
}
list.clear();
}
for(auto& s : MyStars)
{
//TODO :The only considered case is for a small star 1x1 pixel
//TODO :Other sizes to be added right after this case
if (s->size==1)
{
AddPixel( s->x, (int) s->y, s->color );
}
else if (s->size==2)
{
AddPixel( s->x, (int) s->y, s->color );
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
}
else if (s->size==3)
{
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x-1, (int) s->y+1, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+2, s->color );
}
else if (s->size==4)
{
AddPixel( s->x-1, (int) s->y-1, s->color );
AddPixel( s->x-1, (int) s->y, s->color );
AddPixel( s->x-1, (int) s->y+1, s->color );
AddPixel( s->x, (int) s->y-1, s->color );
AddPixel( s->x, (int) s->y, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y-1, s->color );
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
}
}
// call the PixelList shader with the appropriate lists
for(unsigned int i=0; i<14; i++)
//for(unsigned int i=0; i<PixelListPerFragment.size(); i++)
if (!PixelListPerFragment[i].empty())
azrp_pixellist( PixelListPerFragment[i], i );
}

View File

@ -1,57 +0,0 @@
#ifndef STARS_H
#define STARS_H
#include <cstdint>
#include <num/num.h>
#include <vector>
#include <array>
class Star
{
public:
Star();
~Star();
//void Update( float dt );
void Update( libnum::num dt );
libnum::num x;
libnum::num y;
libnum::num sx;
libnum::num sy;
uint8_t size;
uint16_t color;
};
class Pixel
{
public:
int x, y, c;
Pixel( int _x, int _y, int _c)
{
x = _x;
y = _y;
c = _c;
};
~Pixel() {};
};
class Starfield
{
public:
// the Star collection
std::vector<Star*> MyStars;
// list of all pixels to be rendered by Azur pixel shader fragment by fragment
std::array<std::vector<Pixel*>,14> PixelListPerFragment;
Starfield( );
~Starfield( );
void Update( float dt );
void Render( void );
private:
void AddPixel( int x, int y, int c );
};
#endif //STARS_H

67
src/tilesmapshader.cpp Normal file
View File

@ -0,0 +1,67 @@
#include <azur/gint/render.h>
#include "MyAzurShaders.h"
#include <cstdlib>
#include <cstdio>
#include <gint/rtc.h>
#include <gint/usb.h>
#include <gint/usb-ff-bulk.h>
uint8_t AZRP_SHADER_TILESMAP = -1;
__attribute__((constructor))
static void register_shader(void)
{
extern azrp_shader_t azrp_shader_tilesmap;
AZRP_SHADER_TILESMAP = azrp_register_shader(azrp_shader_tilesmap);
}
void azrp_shader_tilesmap_configure(void)
{
azrp_set_uniforms(AZRP_SHADER_TILESMAP, (void *)azrp_width);
}
struct command {
uint8_t shader_id;
uint8_t current_frag;
int shifttile;
int *tilemap;
bopti_image_t *image;
int tileset_size;
};
void azrp_tilesmap( int shifttile, int *tilemap, bopti_image_t *image, int tileset_size );
{
prof_enter(azrp_perf_cmdgen);
struct command cmd;
cmd.shader_id = AZRP_SHADER_TILESMAP;
cmd.current_frag = 0;
cmd.shifttile = shifttile;
cmd.tilemap = tilemap;
cmd.image = image;
cmd.tileset_size = tileset_size;
azrp_queue_command(&cmd, sizeof cmd, 0, azrp_frag_count);
prof_leave(azrp_perf_cmdgen);
}
void azrp_shader_tilesmap( void *uniforms, void *comnd, void *fragment )
{
struct command *cmd = (struct command *) comnd;
uint16_t *frag = (uint16_t *) fragment;
int currentile = cmd->tilemap[cmd->current_frag*25];
for(int u=0; u<=25;u++)
cmd->current_frag++;
}