diff --git a/assets-cg/levels/fxconv-metadata.txt b/assets-cg/levels/fxconv-metadata.txt index 1682884..eacf730 100644 --- a/assets-cg/levels/fxconv-metadata.txt +++ b/assets-cg/levels/fxconv-metadata.txt @@ -5,4 +5,4 @@ tileset.png: type: bopti-image name: img_tilesetnpp - profile: p8_rgb565a + profile: rgb565a diff --git a/captures/fxlink-image-2023.05.07-21h43-1.png b/captures/fxlink-image-2023.05.07-21h43-1.png new file mode 100644 index 0000000..07aaa09 Binary files /dev/null and b/captures/fxlink-image-2023.05.07-21h43-1.png differ diff --git a/captures/fxlink-image-2023.05.07-21h43-2.png b/captures/fxlink-image-2023.05.07-21h43-2.png new file mode 100644 index 0000000..08b00d7 Binary files /dev/null and b/captures/fxlink-image-2023.05.07-21h43-2.png differ diff --git a/captures/fxlink-image-2023.05.07-21h45-1.png b/captures/fxlink-image-2023.05.07-21h45-1.png new file mode 100644 index 0000000..f07338a Binary files /dev/null and b/captures/fxlink-image-2023.05.07-21h45-1.png differ diff --git a/src/level.cpp b/src/level.cpp index 259dbbb..15300ca 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -1,3 +1,6 @@ + +#include "parameters.h" + #include "level.h" #include "player.h" #include @@ -25,6 +28,9 @@ extern bool drawborders; extern bool textbacktile; extern bool textforetile; + +extern uint16_t tilecolor; + extern std::vector MyLevelBorders; @@ -97,36 +103,39 @@ void Level::Render( void ) { uint16_t xtile = (currentTile % map_level->tileset_size) * 16; uint16_t ytile = (currentTile / map_level->tileset_size) * 16; - azrp_subimage_p8( i*16, j*16, map_level->tileset, xtile, ytile, 16, 16, DIMAGE_NONE ); - - if (textbacktile) Azur_draw_text( i*16, j*16, "%d", GetTileBackgroundINT( i, j ) ); - if (textforetile) Azur_draw_text( i*16+8, j*16+8, "%d", GetTileForegroundINT( i, j ) ); + if (u==0) azrp_subimage_rgb16_dye( i*16, j*16, map_level->tileset, xtile, ytile, 16, 16, IMAGE_DYE | IMAGE_NOCLIP_INPUT, tilecolor ); + else azrp_subimage_rgb16( i*16, j*16, map_level->tileset, xtile, ytile, 16, 16, DIMAGE_NONE | IMAGE_NOCLIP_INPUT ); + + #if(DEBUG_MODE) + if (textbacktile) Azur_draw_text( i*16, j*16, "%d", GetTileBackgroundINT( i, j ) ); + if (textforetile) Azur_draw_text( i*16+8, j*16+8, "%d", GetTileForegroundINT( i, j ) ); + #endif } } } } - if (drawborders) - for( int i=0; iA.x, (int) MyLevelBorders[i]->A.y, - (int) MyLevelBorders[i]->B.x, (int) MyLevelBorders[i]->B.y, - C_GREEN ); - - if (drawnormals) - for( int i=0; iA.x+(int) MyLevelBorders[i]->B.x)/2, ((int) MyLevelBorders[i]->A.y+(int) MyLevelBorders[i]->B.y)/2, - ((int) MyLevelBorders[i]->A.x+(int) MyLevelBorders[i]->B.x)/2 + (int) MyLevelBorders[i]->N.x/2, ((int) MyLevelBorders[i]->A.y+(int) MyLevelBorders[i]->B.y)/2 + (int) MyLevelBorders[i]->N.y/2, - C_BLUE ); + #if(DEBUG_MODE) + if (drawborders) + for( int i=0; iA.x, (int) MyLevelBorders[i]->A.y, + (int) MyLevelBorders[i]->B.x, (int) MyLevelBorders[i]->B.y, + C_GREEN ); + if (drawnormals) + for( int i=0; iA.x+(int) MyLevelBorders[i]->B.x)/2, ((int) MyLevelBorders[i]->A.y+(int) MyLevelBorders[i]->B.y)/2, + ((int) MyLevelBorders[i]->A.x+(int) MyLevelBorders[i]->B.x)/2 + (int) MyLevelBorders[i]->N.x/2, ((int) MyLevelBorders[i]->A.y+(int) MyLevelBorders[i]->B.y)/2 + (int) MyLevelBorders[i]->N.y/2, + C_BLUE ); + #endif } void Level::RenderSelected( uint8_t i, uint8_t j ) { - azrp_image_p8( i*16, j*16, &img_selected, DIMAGE_NONE ); - - Azur_draw_text( i*16+1, j*16+1, "B=%d", GetTileBackgroundINT( i, j ) ); - Azur_draw_text( i*16+1, j*16+1, "F=%d", GetTileForegroundINT( i, j ) ); + //azrp_image_p8( i*16, j*16, &img_selected, DIMAGE_NONE ); + //Azur_draw_text( i*16+1, j*16+1, "B=%d", GetTileBackgroundINT( i, j ) ); + //Azur_draw_text( i*16+1, j*16+1, "F=%d", GetTileForegroundINT( i, j ) ); } diff --git a/src/main.cpp b/src/main.cpp index 4d5451f..ba1abf5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,5 @@ -#define DEBUG_MODE 1 -#define BIAS 1 -#define NOBIAS (1-BIAS) +#include "parameters.h" #include #include @@ -70,6 +68,10 @@ bool drawforeground = true; bool drawnormals = false; bool drawborders = false; +uint16_t tilecolor = C_BLACK; +uint16_t backcolor = C_WHITE; + + static void hook_prefrag(int id, void *fragment, int size) { if(!screenshot && !record) @@ -286,7 +288,7 @@ int main(void) { // all the stuff to be rendered should be put here - azrp_clear( C_WHITE ); + azrp_clear( backcolor ); render(); diff --git a/src/parameters.h b/src/parameters.h new file mode 100644 index 0000000..d7588c2 --- /dev/null +++ b/src/parameters.h @@ -0,0 +1,9 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + + +#define DEBUG_MODE 1 +#define BIAS 1 +#define NOBIAS (1-BIAS) + +#endif \ No newline at end of file diff --git a/src/player.cpp b/src/player.cpp index 4c5baf1..cc44e27 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1,3 +1,6 @@ + +#include "parameters.h" + #include "player.h" #include #include @@ -78,15 +81,16 @@ void Player::Render( void ) azrp_image_p8_effect((int) (this->currx*16.0f), (int) (this->curry*16.0f), &img_circle, DIMAGE_NONE); - - if (this->action==STATIC) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "S" ); - else if (this->action==DRAFT) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "D" ); - else if (this->action==WALK) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "W" ); - else if (this->action==RUN) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "R" ); - else if (this->action==JUMP) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "J" ); - else if (this->action==FALL) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "F" ); - else Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "X" ); - + #if(DEBUG_MODE) + if (this->action==STATIC) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "S" ); + else if (this->action==DRAFT) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "D" ); + else if (this->action==WALK) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "W" ); + else if (this->action==RUN) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "R" ); + else if (this->action==JUMP) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "J" ); + else if (this->action==FALL) Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "F" ); + else Azur_draw_text( (int) (this->currx*16.0f+4.0f), (int) (this->curry*16.0f+4.0f) , "X" ); + #endif + }