- "Info" ara es una unitat simple

This commit is contained in:
2024-01-29 14:52:53 +01:00
parent aca0f646b3
commit 80234e195e
11 changed files with 56 additions and 62 deletions

View File

@@ -6,9 +6,10 @@
#include "jsound.h"
#include <stdlib.h>
#include <string>
#include "info.h"
ModuleSelect::ModuleSelect(Info* info) {
this->info = info;
ModuleSelect::ModuleSelect() {
}
ModuleSelect::~ModuleSelect(void) {
@@ -37,7 +38,7 @@ int ModuleSelect::Go() {
int num_personatges = 3;
if (!this->info->rosita_enabled) {
if (!info::rosita_enabled) {
num_personatges--;
for (int i = 137; i <= 212; i++) for (int j = 11; j <= 91; j++) JD8_PutPixel(fondo, i, j, 0);
JD8_PutPixel(fondo, 145, 19, 14);
@@ -52,7 +53,7 @@ int ModuleSelect::Go() {
JD8_PutPixel(fondo, 139, 37, 9);
JD8_PutPixel(fondo, 211, 81, 9);
}
if (!this->info->job_enabled) {
if (!info::job_enabled) {
num_personatges--;
for (int i = 219; i <= 294; i++) for (int j = 11; j <= 91; j++) JD8_PutPixel(fondo, i, j, 0);
JD8_PutPixel(fondo, 228, 65, 14);
@@ -78,9 +79,9 @@ int ModuleSelect::Go() {
while (!JG_ShouldUpdate()) { JI_Update(); }
}
int opcio_seleccionada = this->info->dificultat;
int opcio_seleccionada = info::dificultat;
int opcio_triada = SENSE_OPCIO;
int personatge_seleccionat = this->info->personatge;
int personatge_seleccionat = info::personatge;
bool fletxa_amunt_pulsada = false;
bool fletxa_avall_pulsada = false;
bool fletxa_esquerra_pulsada = false;
@@ -165,8 +166,8 @@ int ModuleSelect::Go() {
if (JG_Quitting()) {
return ESTAT_EIXIR;
} else {
this->info->dificultat = opcio_triada;
this->info->personatge = personatge_seleccionat;
info::dificultat = opcio_triada;
info::personatge = personatge_seleccionat;
return ESTAT_SEQUENCIA;
}
}