- [NEW] Habitació de prova de parts

- [NEW] Templates de les parts
- [NEW] Mòdul de debug
- [NEW] Debug info de la posicio dels actors
- [FIX] Al reiniciar partida el heroi estava en posició incorrecta
- [NEW] Mòdul de config
- [NEW] El joc ja permet canviar zoom i ficar fullscreen
- [NEW] F1, F2 i F3 per a zoom i fullscreen
- [NEW] Ja es guarda en arxiu de config el zoom, fullscreen, musica i só.
- [FIX] Al eixir prematurament del logo de vegades la paleta estava loca
- [NEW] Menú de configuració del àudio
- [NEW] Menú de pausa dins del joc (es veu peces que falten per arreplegar)
- [ONGOING] Comença l'implementació de tecles redefinides
This commit is contained in:
2024-07-08 13:35:03 +02:00
parent 0315a88cf2
commit c7f6ad7538
21 changed files with 700 additions and 60 deletions

View File

@@ -5,6 +5,8 @@
#include "jutil.h"
#include "room.h"
#include "editor.h"
#include "debug.h"
#include "config.h"
#include <vector>
namespace actor
@@ -455,7 +457,7 @@ namespace actor
vec3_t max = room::getMax();
bool moving = false;
if ( input::keyDown(SDL_SCANCODE_LEFT) )
if ( input::keyDown(SDL_SCANCODE_LEFT) || input::keyDown(config::getKey(KEY_LEFT)) )
{
hero::useBoostRun();
act->orient=PUSH_XN;
@@ -473,7 +475,7 @@ namespace actor
act->push |= PUSH_XN;
}
}
else if ( input::keyDown(SDL_SCANCODE_RIGHT) )
else if ( input::keyDown(SDL_SCANCODE_RIGHT) || input::keyDown(config::getKey(KEY_RIGHT)) )
{
hero::useBoostRun();
act->orient=PUSH_XP;
@@ -491,7 +493,7 @@ namespace actor
act->push |= PUSH_XP;
}
}
else if ( input::keyDown(SDL_SCANCODE_UP) )
else if ( input::keyDown(SDL_SCANCODE_UP) || input::keyDown(config::getKey(KEY_UP)) )
{
hero::useBoostRun();
act->orient=PUSH_YN;
@@ -509,7 +511,7 @@ namespace actor
act->push |= PUSH_YN;
}
}
else if ( input::keyDown(SDL_SCANCODE_DOWN) )
else if ( input::keyDown(SDL_SCANCODE_DOWN) || input::keyDown(config::getKey(KEY_DOWN)) )
{
hero::useBoostRun();
act->orient=PUSH_YP;
@@ -527,7 +529,7 @@ namespace actor
act->push |= PUSH_YP;
}
}
if (input::keyPressed(SDL_SCANCODE_RETURN) && (hero::getSkills()&SKILL_PANTS))
if ((input::keyPressed(SDL_SCANCODE_RETURN) || input::keyDown(config::getKey(KEY_PICK)) ) && (hero::getSkills()&SKILL_PANTS))
{
if (picked)
{
@@ -552,10 +554,10 @@ namespace actor
{
const int height = act->below->size.z;
pick(act->below);
if (!input::keyDown(SDL_SCANCODE_SPACE)) act->pos.z -= height;
if (!input::keyDown(SDL_SCANCODE_SPACE) && !input::keyDown(config::getKey(KEY_JUMP))) act->pos.z -= height;
}
}
if ( input::keyDown(SDL_SCANCODE_SPACE) && (hero::getSkills()&SKILL_SHOES) && (act->pos.y+act->size.y)<=max.y && act->pos.y>=min.y && (act->pos.x+act->size.x)<=max.x && act->pos.x>=min.x && act->react_mask==0 && (act->pos.z==0 || act->below))
if (( input::keyDown(SDL_SCANCODE_SPACE) || input::keyDown(config::getKey(KEY_JUMP)) ) && (hero::getSkills()&SKILL_SHOES) && (act->pos.y+act->size.y)<=max.y && act->pos.y>=min.y && (act->pos.x+act->size.x)<=max.x && act->pos.x>=min.x && act->react_mask==0 && (act->pos.z==0 || act->below))
{
// [RZC 14/05/2024] hack usant react_mask i react_push del heroi. Llegir més avall.
act->react_mask=hero::getBoostJump()>0 ? 2 : 1; // =1 estic botant (anant cap amunt)
@@ -992,11 +994,13 @@ namespace actor
draw::draw(x, y, act->bmp_rect.w, act->bmp_rect.h, act->bmp_rect.x+ao, act->bmp_rect.y+oo, flip);
draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
draw::popSource();
//print(x+5,y,act->pos.x);
//print(x+5,y+6,act->pos.y);
//print(x+5,y+12,act->pos.z);
//print(x+5,y+12,order);
//print(x+5,y,act->flags);
if (debug::isEnabled(DEBUG_ACTOR_POS))
{
char tmp[100];
draw::print(SDL_itoa(act->inner_x, tmp, 10), x+9,y+20, LIGHT+WHITE, BLACK);
draw::print(SDL_itoa(act->inner_y, tmp, 10), x+9,y+26, LIGHT+WHITE, BLACK);
draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
}
}
if (draw_all && act->next) draw(act->next);
}
@@ -1113,14 +1117,14 @@ namespace actor
actor_t *getPicked() { return picked; }
void clear()
void clear(const bool all)
{
actor_t *hero = nullptr;
actor_t *act = first;
while (act)
{
actor_t *tmp = act->next;
if (act->flags & FLAG_HERO) {
if (!all && (act->flags & FLAG_HERO)) {
hero = act;
} else {
//draw::freeSurface(act->surface);