afegida carpeta "external" al source i moguts ahi els .cpp que no son meus

This commit is contained in:
JailDesigner committed 2025-06-21 12:14:23 +02:00
1 parent ee43f1cf56
commit 97f76e122d
23 files changed
+104 -34

No files matched your search

+90 -20
View File
@@ -1,30 +1,105 @@
# CMakeLists.txt # CMakeLists.txt (Versión corregida y mejorada)
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(coffee_crisis_arcade_edition VERSION 2.00) project(coffee_crisis_arcade_edition VERSION 2.00)
# Establece las políticas
cmake_policy(SET CMP0072 NEW)
# Establecer estándar de C++ # Establecer estándar de C++
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD_REQUIRED True)
# Cargar todos los archivos fuente directamente desde el directorio # --- 1. LISTA EXPLÍCITA DE FUENTES ---
file(GLOB SOURCES "${CMAKE_SOURCE_DIR}/source/*.cpp") set(APP_SOURCES
# --- Archivos Principales del Sistema ---
source/main.cpp
source/game.cpp
source/director.cpp
source/section.cpp
source/screen.cpp
source/resource.cpp
source/asset.cpp
source/audio.cpp
source/input.cpp
source/options.cpp
source/lang.cpp
source/param.cpp
source/utils.cpp
source/global_events.cpp
source/global_inputs.cpp
# --- UI (User Interface) ---
source/ui/service_menu.cpp
source/ui/menu_renderer.cpp
source/ui/ui_message.cpp
# Verificar si se encontraron archivos fuente # --- Lógica y Escenas del Juego ---
if(NOT SOURCES) source/player.cpp
message(FATAL_ERROR "No se encontraron archivos fuente en ${CMAKE_SOURCE_DIR}/source. Verifica que el directorio existe y contiene archivos .cpp.") source/balloon.cpp
endif() source/balloon_formations.cpp
source/balloon_manager.cpp
source/bullet.cpp
source/item.cpp
source/explosions.cpp
# --- Escenas y Flujo ---
source/title.cpp
source/logo.cpp
source/game_logo.cpp
source/intro.cpp
source/credits.cpp
source/instructions.cpp
source/hiscore_table.cpp
source/enter_name.cpp
source/manage_hiscore_table.cpp
source/scoreboard.cpp
# --- Sprites y Gráficos ---
source/sprite.cpp
source/animated_sprite.cpp
source/moving_sprite.cpp
source/path_sprite.cpp
source/smart_sprite.cpp
source/background.cpp
source/tiled_bg.cpp
source/fade.cpp
source/texture.cpp
# --- Otros ---
source/define_buttons.cpp
source/mouse.cpp
source/notifier.cpp
source/stage.cpp
source/tabe.cpp
source/text.cpp
source/writer.cpp
)
# Configuración de SDL3 (usando el método recomendado) # Fuentes de librerías de terceros
set(EXTERNAL_SOURCES
source/external/jail_audio.cpp
source/external/jail_shader.cpp
source/external/json.hpp
source/external/gif.cpp
)
# Configuración de SDL3
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}") message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
# Añadir ejecutable principal # --- 2. AÑADIR EJECUTABLE ---
add_executable(${PROJECT_NAME} ${SOURCES}) add_executable(${PROJECT_NAME} ${APP_SOURCES} ${EXTERNAL_SOURCES})
# --- 3. DIRECTORIOS DE INCLUSIÓN ---
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_SOURCE_DIR}/source"
"${CMAKE_SOURCE_DIR}/source/external"
)
# Enlazar la librería SDL3
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3)
# --- 4. CONFIGURACIÓN PLATAFORMAS Y COMPILADOR ---
# Configuración de flags de compilación # Configuración de flags de compilación
target_compile_options(${PROJECT_NAME} PRIVATE -Wall) target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunction-sections -fdata-sections>) target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunction-sections -fdata-sections>)
@@ -32,9 +107,6 @@ target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunctio
# Definir _DEBUG en modo Debug # Definir _DEBUG en modo Debug
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:DEBUG>:DEBUG>) target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:DEBUG>:DEBUG>)
# Enlazar la librería SDL3
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3)
# Configuración específica para cada plataforma # Configuración específica para cada plataforma
if(WIN32) if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOWS_BUILD) target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOWS_BUILD)
@@ -47,7 +119,7 @@ elseif(UNIX AND NOT APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE LINUX_BUILD) target_compile_definitions(${PROJECT_NAME} PRIVATE LINUX_BUILD)
endif() endif()
# Configuración común para OpenGL (excepto en Windows, ya configurado) # Configuración común para OpenGL
if(NOT WIN32) if(NOT WIN32)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
if(OPENGL_FOUND) if(OPENGL_FOUND)
@@ -58,7 +130,5 @@ if(NOT WIN32)
endif() endif()
endif() endif()
# Configuración común de salida de ejecutables en el directorio raíz # Especificar la ubicación del ejecutable
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
# Especificar la ubicación del ejecutable (en la raíz del proyecto)
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}) set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
+1 -1
View File
@@ -1,5 +1,5 @@
#include "audio.h" #include "audio.h"
#include "jail_audio.h" #include "external/jail_audio.h"
#include "options.h" #include "options.h"
#include "resource.h" #include "resource.h"
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
+1 -1
View File
@@ -26,7 +26,7 @@
#include "texture.h" // Para Texture #include "texture.h" // Para Texture
#include "tiled_bg.h" // Para TiledBG, TiledBGMode #include "tiled_bg.h" // Para TiledBG, TiledBGMode
#include "utils.h" // Para Color, Zone, shdw_txt_color, no_color #include "utils.h" // Para Color, Zone, shdw_txt_color, no_color
#include "service_menu.h" #include "ui/service_menu.h"
// Textos // Textos
constexpr const char TEXT_COPYRIGHT[] = "@2020,2025 JailDesigner"; constexpr const char TEXT_COPYRIGHT[] = "@2020,2025 JailDesigner";
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -28,7 +28,7 @@
#include "scoreboard.h" // Para Scoreboard, ScoreboardMode, SCOREB... #include "scoreboard.h" // Para Scoreboard, ScoreboardMode, SCOREB...
#include "screen.h" // Para Screen #include "screen.h" // Para Screen
#include "section.h" // Para Name, name, AttractMode, Options #include "section.h" // Para Name, name, AttractMode, Options
#include "service_menu.h" // Para ServiceMenu #include "ui/service_menu.h" // Para ServiceMenu
#include "smart_sprite.h" // Para SmartSprite #include "smart_sprite.h" // Para SmartSprite
#include "stage.h" // Para number, get, Stage, total_power #include "stage.h" // Para number, get, Stage, total_power
#include "tabe.h" // Para Tabe, TabeState #include "tabe.h" // Para Tabe, TabeState
+1 -1
View File
@@ -11,7 +11,7 @@
#include "param.h" // Para Param, ParamGame, param #include "param.h" // Para Param, ParamGame, param
#include "screen.h" // Para Screen #include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options, AttractMode #include "section.h" // Para Name, name, Options, options, AttractMode
#include "service_menu.h" // Para ServiceMenu #include "ui/service_menu.h" // Para ServiceMenu
#include "utils.h" // Para boolToOnOff #include "utils.h" // Para boolToOnOff
namespace GlobalInputs namespace GlobalInputs
+1 -1
View File
@@ -1,7 +1,7 @@
#include "lang.h" #include "lang.h"
#include <fstream> #include <fstream>
#include <unordered_map> #include <unordered_map>
#include "json.hpp" #include "external/json.hpp"
#include "options.h" #include "options.h"
#include "asset.h" #include "asset.h"
+1 -1
View File
@@ -5,7 +5,7 @@
#include <array> #include <array>
#include <stdexcept> // Para runtime_error #include <stdexcept> // Para runtime_error
#include "asset.h" // Para Asset, AssetType #include "asset.h" // Para Asset, AssetType
#include "jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic #include "external/jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
#include "lang.h" // Para getText #include "lang.h" // Para getText
#include "screen.h" // Para Screen #include "screen.h" // Para Screen
#include "text.h" // Para Text, loadTextFile #include "text.h" // Para Text, loadTextFile
+1 -1
View File
@@ -7,7 +7,7 @@
#include "text.h" #include "text.h"
#include "texture.h" #include "texture.h"
#include "utils.h" #include "utils.h"
#include "jail_audio.h" #include "external/jail_audio.h"
// --- Clase Resource: gestiona todos los recursos del juego (singleton) --- // --- Clase Resource: gestiona todos los recursos del juego (singleton) ---
class Resource class Resource
+2 -2
View File
@@ -13,12 +13,12 @@
#include <memory> // Para __shared_ptr_access, shared_ptr #include <memory> // Para __shared_ptr_access, shared_ptr
#include <string> // Para allocator, char_traits, operator+ #include <string> // Para allocator, char_traits, operator+
#include "asset.h" // Para Asset #include "asset.h" // Para Asset
#include "jail_shader.h" // Para init, render #include "external/jail_shader.h" // Para init, render
#include "mouse.h" // Para updateCursorVisibility #include "mouse.h" // Para updateCursorVisibility
#include "notifier.h" // Para Notifier #include "notifier.h" // Para Notifier
#include "options.h" // Para Options, options, WindowOptions, Vid... #include "options.h" // Para Options, options, WindowOptions, Vid...
#include "resource.h" // Para Resource #include "resource.h" // Para Resource
#include "service_menu.h" // Para ServiceMenu #include "ui/service_menu.h" // Para ServiceMenu
#include "text.h" // Para Text #include "text.h" // Para Text
// Singleton // Singleton
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdexcept> // Para runtime_error #include <stdexcept> // Para runtime_error
#include <string> // Para operator+, char_traits, string, operat... #include <string> // Para operator+, char_traits, string, operat...
#include <vector> // Para vector #include <vector> // Para vector
#include "gif.h" // Para Gif #include "external/gif.h" // Para Gif
#include "stb_image.h" // Para stbi_image_free, stbi_load, STBI_rgb_a... #include "stb_image.h" // Para stbi_image_free, stbi_load, STBI_rgb_a...
#include "utils.h" // Para getFileName, Color, printWithDots #include "utils.h" // Para getFileName, Color, printWithDots
+1 -1
View File
@@ -24,7 +24,7 @@
#include "texture.h" // Para Texture #include "texture.h" // Para Texture
#include "tiled_bg.h" // Para TiledBG, TiledBGMode #include "tiled_bg.h" // Para TiledBG, TiledBGMode
#include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK #include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK
#include "service_menu.h" #include "ui/service_menu.h"
// Constructor // Constructor
Title::Title() Title::Title()
+1 -1
View File
@@ -5,7 +5,7 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <algorithm> // para std::clamp #include <algorithm> // para std::clamp
#include "service_menu.h" // Necesitamos las enums como SettingsGroup #include "ui/service_menu.h" // Necesitamos las enums como SettingsGroup
#include "options.h" // Para acceder a las variables de configuración #include "options.h" // Para acceder a las variables de configuración
#include "lang.h" // Para las traducciones #include "lang.h" // Para las traducciones
#include "section.h" // Para las acciones como Quit o Reset #include "section.h" // Para las acciones como Quit o Reset
+1 -1
View File
@@ -4,7 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include "service_menu.h" // Necesario para las enums y para acceder al estado del menú #include "ui/service_menu.h" // Necesario para las enums y para acceder al estado del menú
#include "utils.h" // Para Color #include "utils.h" // Para Color
// Forward declarations // Forward declarations
+1 -1
View File
@@ -1,4 +1,4 @@
#include "service_menu.h" #include "ui/service_menu.h"
#include "menu_renderer.h" #include "menu_renderer.h"
#include "menu_option.h" #include "menu_option.h"
#include "resource.h" #include "resource.h"