fix: enum class amb base std::uint8_t (33 troballes)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory> // Para shared_ptr
|
||||
#include <string> // Para string
|
||||
#include <cstdint> // Para uint8_t
|
||||
#include <memory> // Para shared_ptr
|
||||
#include <string> // Para string
|
||||
#include <utility>
|
||||
#include <vector> // Para vector
|
||||
|
||||
@@ -54,7 +55,7 @@ namespace Resource {
|
||||
};
|
||||
|
||||
// Etapas del loader incremental
|
||||
enum class LoadStage {
|
||||
enum class LoadStage : std::uint8_t {
|
||||
SOUNDS,
|
||||
MUSICS,
|
||||
SURFACES,
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Resource {
|
||||
class List {
|
||||
public:
|
||||
// --- Enums ---
|
||||
enum class Type : int {
|
||||
enum class Type : std::uint8_t {
|
||||
DATA, // Datos
|
||||
BITMAP, // Imágenes
|
||||
ANIMATION, // Animaciones
|
||||
|
||||
@@ -6,19 +6,18 @@
|
||||
#include <SDL3/SDL_filesystem.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
|
||||
namespace Resource {
|
||||
|
||||
// Calculate CRC32 checksum for data verification
|
||||
auto Pack::calculateChecksum(const std::vector<uint8_t>& data) -> uint32_t { // NOLINT(readability-convert-member-functions-to-static)
|
||||
return std::accumulate(data.begin(), data.end(), uint32_t{0x12345678},
|
||||
[](uint32_t acc, unsigned char byte) -> uint32_t {
|
||||
return ((acc << 5) + acc) + byte;
|
||||
});
|
||||
return std::accumulate(data.begin(), data.end(), uint32_t{0x12345678}, [](uint32_t acc, unsigned char byte) -> uint32_t {
|
||||
return ((acc << 5) + acc) + byte;
|
||||
});
|
||||
}
|
||||
|
||||
// XOR encryption (symmetric - same function for encrypt/decrypt)
|
||||
|
||||
Reference in New Issue
Block a user