- [FIX] Corregits errors per a que compile en Windows
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
||||
syntax: glob
|
||||
|
||||
mathwars
|
||||
mathwars.exe
|
||||
recursos/*
|
||||
bin/*
|
||||
obj/*
|
||||
@@ -16,4 +17,5 @@ data/*
|
||||
trick.ini
|
||||
*.xcuserstate
|
||||
project.xcworkspace/
|
||||
xcuserdata/
|
||||
xcuserdata/
|
||||
*.zip
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Score.h"
|
||||
#include "api.h"
|
||||
#include <stdio.h>
|
||||
|
||||
namespace {
|
||||
int lives = 3;
|
||||
|
||||
@@ -4,7 +4,23 @@
|
||||
#include "System.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define message_eq(m) (strncmp(msg, m, 20)==0)
|
||||
// En tu archivo .h común (ej. mensajes.h)
|
||||
|
||||
static inline int message_eq_func(const char *msg, const char *m) {
|
||||
// Compara carácter por carácter hasta el final de la cadena 'm' o máximo 20
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (msg[i] != m[i]) {
|
||||
return 0; // No son iguales
|
||||
}
|
||||
if (m[i] == '\0') {
|
||||
return 1; // Llegamos al final de 'm' y coinciden perfectamente
|
||||
}
|
||||
}
|
||||
return 1; // Llegó a 20 caracteres idénticos
|
||||
}
|
||||
|
||||
// Tu macro ahora llama a esta función inline
|
||||
#define message_eq(m) message_eq_func(msg, m)
|
||||
|
||||
enum BlendMode { BlendNone, BlendBlend, BlendAdd, BlendMod };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user