importation of Cursomers Seats and Sushi Drop Areas from map with converter.py

This commit is contained in:
Sylvain PILLOT 2023-09-29 22:43:33 +02:00
parent 00b58e845e
commit 7070dbf263
9 changed files with 44 additions and 8 deletions

View File

@ -7,8 +7,8 @@
<layer id="1" name="Restaurant" width="25" height="14">
<data encoding="csv">
93,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,93,0,0,0,0,
31,83,42,42,42,42,61,63,42,42,10,42,42,61,63,42,42,42,42,82,33,0,0,0,0,
41,71,42,10,42,4,5,5,6,4,5,6,4,5,5,6,42,10,42,71,43,0,0,0,0,
31,83,42,42,42,42,61,63,42,42,103,42,42,61,63,42,42,42,42,82,33,0,0,0,0,
41,71,42,103,42,4,5,5,6,4,5,6,4,5,5,6,42,103,42,71,43,0,0,0,0,
41,81,4,22,22,23,12,15,21,23,42,21,23,12,15,21,5,5,6,81,43,0,0,0,0,
41,91,13,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,11,91,43,0,0,0,0,
41,42,13,11,42,42,34,35,34,35,42,34,35,34,35,42,42,13,11,42,43,0,0,0,0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -227,7 +227,7 @@ def convert_map(input, output, params, target):
o_seat_ymaxdata += seat_ymax
structMap += fxconv.ptr( o_seat_xmindata )
structMap += fxconv.ptr( o_seat_xmaxdata )
structMap += fxconv.ptr( o_seat_xmindata )
structMap += fxconv.ptr( o_seat_ymindata )
structMap += fxconv.ptr( o_seat_ymaxdata )

2
build
View File

@ -1,3 +1 @@
rm -r build-cg
rm *.g3a
fxsdk build-cg VERBOSE=1

2
rebuild Executable file
View File

@ -0,0 +1,2 @@
./clean
fxsdk build-cg VERBOSE=1 -B

View File

@ -3,7 +3,7 @@
#define DEBUG_MODE 0
#define DEBUG_MODE 1
#define USB 0
#define MORE_RAM 1
#define CALCEMU 1

View File

@ -1,5 +1,6 @@
#include "../config.h"
#include "../shaders/MyAzurShaders.h"
#include "../utilities/utilities.h"
#include "background.h"
#include <azur/azur.h>
@ -46,6 +47,7 @@ void Background::Render( void )
}
}
#if(DEBUG_MODE)
for( int u=0; u<map_Level->nbConveyorPoints; u++)
{
int p1 = u % map_Level->nbConveyorPoints;
@ -56,6 +58,29 @@ void Background::Render( void )
azrp_filledcircle( map_Level->conveyorX[p1], map_Level->conveyorY[p1], 3, C_RED );
}
for (int v=0; v<map_Level->nbSeatAreas; v++)
{
azrp_rectangle(map_Level->SeatAreaXmin[v], map_Level->SeatAreaYmin[v],
map_Level->SeatAreaXmax[v], map_Level->SeatAreaYmax[v], C_BLUE );
}
for (int w=0; w<map_Level->nbDropAreas; w++)
{
azrp_rectangle(map_Level->DropAreaXmin[w], map_Level->DropAreaYmin[w],
map_Level->DropAreaXmax[w], map_Level->DropAreaYmax[w], C_GREEN );
int x1 = (map_Level->DropAreaXmin[w]+map_Level->DropAreaXmax[w])/2;
int y1 = (map_Level->DropAreaYmin[w]+map_Level->DropAreaYmax[w])/2;
int index = map_Level->DropPointOnBelt[w];
int x2 = map_Level->conveyorX[index];
int y2 = map_Level->conveyorY[index];
azrp_line(x1, y1, x2, y2, C_GREEN);
azrp_filledcircle(x1, y1, 3, C_GREEN);
azrp_filledcircle(x2, y2, 3, C_GREEN);
}
#endif
}
void Background::Update( float dt )

View File

@ -19,5 +19,7 @@ void azrp_poly(int *x, int *y, int nb_vertices, uint16_t color);
/* azrp_filledpoly() : Draw a filled polygon with clipping*/
void azrp_filledpoly(int *x, int *y, int nb_vertices, uint16_t color);
/* azrp_rectangle() : Draw a rectangle between [xmin, ymin) and (xmax, ymax)*/
void azrp_rectangle( int xmin, int ymin, int xmax, int ymax, uint16_t color);
#endif //MYAZURSHADERS_H

View File

@ -2,7 +2,7 @@
#include "MyAzurShaders.h"
void azrp_poly(int *x, int *y, int nb_vertices, uint16_t color) {
prof_enter(azrp_perf_cmdgen);
//prof_enter(azrp_perf_cmdgen);
for( int i=0 ; i<nb_vertices ; i++) {
int px = x[i];
@ -12,5 +12,14 @@ void azrp_poly(int *x, int *y, int nb_vertices, uint16_t color) {
azrp_line( px, py, px2, py2, color );
}
prof_leave(azrp_perf_cmdgen);
//prof_leave(azrp_perf_cmdgen);
}
void azrp_rectangle( int xmin, int ymin, int xmax, int ymax, uint16_t color)
{
azrp_line( xmin, ymin, xmin, ymax, color );
azrp_line( xmax, ymin, xmax, ymax, color );
azrp_line( xmin, ymin, xmax, ymin, color );
azrp_line( xmin, ymax, xmax, ymax, color );
};