Arreglat jail_shader.cpp en windows també

This commit is contained in:
2025-03-16 09:55:32 +01:00
parent e7359a1467
commit 4a07100e2a
23 changed files with 75 additions and 73 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // para string, basic_string
#include <vector> // para vector
#include <string> // Para string, basic_string
#include <vector> // Para vector
#include "utils.h"
enum class AssetType : int

View File

@@ -1,7 +1,7 @@
#include "balloon_formations.h"
#include "balloon.h" // para BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include "param.h" // para param
#include "utils.h" // para ParamGame, Param, Zone, BLOCK
#include "balloon.h" // Para BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include "param.h" // Para param
#include "utils.h" // Para ParamGame, Param, Zone, BLOCK
void BalloonFormations::initBalloonFormations()
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "balloon.h" // para BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include "balloon.h" // Para BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include <vector>
constexpr int NUMBER_OF_BALLOON_FORMATIONS = 100;

View File

@@ -1,7 +1,7 @@
#include "dbgtxt.h"
#include <SDL2/SDL_rect.h> // para SDL_Rect
#include <SDL2/SDL_rwops.h> // para SDL_RWFromMem
#include <SDL2/SDL_surface.h> // para SDL_LoadBMP_RW
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_rwops.h> // Para SDL_RWFromMem
#include <SDL2/SDL_surface.h> // Para SDL_LoadBMP_RW
namespace
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <SDL2/SDL_render.h> // para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // para Uint8
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint8
void dbg_init(SDL_Renderer *renderer);
void dbg_print(int x, int y, const char *text, Uint8 r, Uint8 g, Uint8 b);

View File

@@ -1,9 +1,9 @@
#pragma once
#include <SDL2/SDL_rect.h> // para SDL_Rect
#include <SDL2/SDL_render.h> // para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // para Uint8, Uint16
#include <vector> // para vector
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // Para Uint8, Uint16
#include <vector> // Para vector
// Tipos de fundido
enum class FadeType : Uint8

View File

@@ -1,6 +1,7 @@
#include "gif.h"
#include <cstdio> // Para NULL, fprintf, stderr
#include <cstdlib> // Para malloc, realloc, exit, calloc, free
#include <cstdio> // Para fprintf, stderr
#include <cstdlib> // Para exit, malloc, calloc, free, realloc
#include <vector> // Para vector
void Gif::uncompress(int code_length, const uint8_t *input, int input_length, uint8_t *out)
{

View File

@@ -1,8 +1,7 @@
#pragma once
#include <cstdint> // Para uint32_t
#include <cstdint> // Para uint8_t, uint16_t, uint32_t
#include <cstring> // Para memcpy
#include <vector>
#define EXTENSION_INTRODUCER 0x21
#define IMAGE_DESCRIPTOR 0x2C

View File

@@ -1,11 +1,11 @@
#pragma once
#include <SDL2/SDL_gamecontroller.h> // para SDL_GameControllerButton, SDL_G...
#include <SDL2/SDL_joystick.h> // para SDL_Joystick
#include <SDL2/SDL_scancode.h> // para SDL_Scancode
#include <SDL2/SDL_stdinc.h> // para Uint8
#include <string> // para string, basic_string
#include <vector> // para vector
#include <SDL2/SDL_gamecontroller.h> // Para SDL_GameControllerButton, SDL_G...
#include <SDL2/SDL_joystick.h> // Para SDL_Joystick
#include <SDL2/SDL_scancode.h> // Para SDL_Scancode
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <string> // Para string, basic_string
#include <vector> // Para vector
/*
connectedControllers es un vector donde estan todos los mandos encontrados [0 .. n]

View File

@@ -1,30 +1,30 @@
#pragma once
#include <SDL2/SDL_rect.h> // para SDL_Rect
#include <SDL2/SDL_stdinc.h> // para Uint16
#include <memory> // para shared_ptr, unique_ptr
#include <string> // para string
#include <vector> // para vector
#include "animated_sprite.h" // para SpriteAnimated
#include "utils.h" // para Circle
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_stdinc.h> // Para Uint16
#include <memory> // Para shared_ptr, unique_ptr
#include <string> // Para string
#include <vector> // Para vector
#include "animated_sprite.h" // Para SpriteAnimated
#include "utils.h" // Para Circle
class Texture;
/**
* @brief Tipos de objetos disponibles en el juego.
*
* Esta enumeración define los diferentes tipos de objetos que pueden existir en el juego,
* Esta enumeración define los diferentes tipos de objetos que pueden existir en el juego,
* cada uno con un identificador único.
*/
enum class ItemType : int
{
DISK = 1, /**< Disco */
GAVINA = 2, /**< Gavina */
PACMAR = 3, /**< Pacman */
CLOCK = 4, /**< Reloj */
COFFEE = 5, /**< Café */
DEBIAN = 6, /**< Debian */
COFFEE_MACHINE = 7,/**< Máquina de café */
NONE = 8, /**< Ninguno */
DISK = 1, /**< Disco */
GAVINA = 2, /**< Gavina */
PACMAR = 3, /**< Pacman */
CLOCK = 4, /**< Reloj */
COFFEE = 5, /**< Café */
DEBIAN = 6, /**< Debian */
COFFEE_MACHINE = 7, /**< Máquina de café */
NONE = 8, /**< Ninguno */
};
/**

View File

@@ -1,8 +1,11 @@
#include "jail_shader.h"
#include <SDL2/SDL.h> // para SDL_Point
#include <cstdlib> // para NULL, free, malloc, exit
#include <cstring> // para strncmp
#include <iostream> // para std::cout, std::endl
#include <SDL2/SDL_opengl.h> // Para GLuint, glTexCoord2f, glVertex2f, GLfloat
#include <SDL2/SDL_rect.h> // Para SDL_Point
#include <SDL2/SDL_stdinc.h> // Para SDL_bool
#include <cstring> // Para strncmp
#include <iostream> // Para basic_ostream, operator<<, endl, cout
#include <stdexcept> // Para runtime_error
#include <vector> // Para vector
#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"

View File

@@ -1,7 +1,7 @@
#pragma once
#include <SDL2/SDL_render.h> // para SDL_Texture
#include <SDL2/SDL_video.h> // para SDL_Window
#include <SDL2/SDL_render.h> // Para SDL_Texture
#include <SDL2/SDL_video.h> // Para SDL_Window
#include <string>
// TIPS:
@@ -39,7 +39,7 @@
namespace shader
{
//const bool init(SDL_Window *ventana, SDL_Texture *texturaBackBuffer, const char *vertexShader, const char *fragmentShader = nullptr);
// const bool init(SDL_Window *ventana, SDL_Texture *texturaBackBuffer, const char *vertexShader, const char *fragmentShader = nullptr);
bool init(SDL_Window *ventana, SDL_Texture *texturaBackBuffer, const std::string &vertexShader, const std::string &fragmentShader = "");
void render();
}

View File

@@ -1,6 +1,6 @@
#include "lang.h"
#include <fstream> // para basic_ifstream, basic_istream, ifstream
#include <vector> // para vector
#include <fstream> // Para basic_ifstream, basic_istream, ifstream
#include <vector> // Para vector
namespace lang
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <string> // para string
#include <string> // Para string
namespace lang
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // para string
#include <vector> // para vector
#include <string> // Para string
#include <vector> // Para vector
/*
Esta clase sirve para añadir elementos hiScoreEntry_r a un vector (tabla), de manera
@@ -45,7 +45,7 @@ public:
void clear();
// Añade un elemento a la tabla
int add(const HiScoreEntry& entry);
int add(const HiScoreEntry &entry);
// Carga la tabla con los datos de un fichero
bool loadFromFile(const std::string &file_path);

View File

@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL_rect.h> // para SDL_Rect
#include <SDL2/SDL_render.h> // para SDL_Texture
#include <vector> // para vector
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Texture
#include <vector> // Para vector
class Sprite;
class Text;

View File

@@ -1,10 +1,10 @@
#include "param.h"
#include <fstream> // para char_traits, basic_ostream, basic_ifstream, basi...
#include <iostream> // para cout
#include <fstream> // Para char_traits, basic_ostream, basic_ifstream, basi...
#include <iostream> // Para cout
#include <sstream>
#include <string>
#include <stdexcept>
#include "utils.h" // para Param, ParamGame, Zone, ParamBalloon
#include "utils.h" // Para Param, ParamGame, Zone, ParamBalloon
Param param;

View File

@@ -4,8 +4,7 @@
#include <algorithm> // Para max, min
#include <fstream> // Para basic_ifstream, ifstream
#include <iterator> // Para istreambuf_iterator, operator==
#include <string> // Para allocator, operator+, char_traits, to_s...
#include <vector> // Para vector
#include <string> // Para allocator, char_traits, operator+, to_s...
#include "asset.h" // Para Asset
#include "dbgtxt.h" // Para dbg_print
#include "global_inputs.h" // Para service_pressed_counter
@@ -43,7 +42,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
// Muestra la ventana
show();
// Inicializa los shaders
initShaders(); // Se ha de ejecutar con la ventana visible
}

View File

@@ -1,7 +1,7 @@
#pragma once
#include <memory> // para shared_ptr
#include "animated_sprite.h" // para SpriteAnimated
#include <memory> // Para shared_ptr
#include "animated_sprite.h" // Para SpriteAnimated
class Texture;
// Clase SpriteSmart

View File

@@ -427,7 +427,7 @@ extern "C"
#ifndef STBI_NO_STDIO
STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
// para stbi_load_from_file, file pointer is left pointing immediately after image
// Para stbi_load_from_file, file pointer is left pointing immediately after image
#endif
#ifndef STBI_NO_GIF
@@ -503,7 +503,7 @@ extern "C"
STBIDEF int stbi_is_16_bit_from_file(FILE *f);
#endif
// para image formats that explicitly notate that they have premultiplied alpha,
// Para image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
@@ -6869,7 +6869,7 @@ static int stbi__tga_test(stbi__context *s)
goto errorEnd; // test height
sz = stbi__get8(s); // bits per pixel
if ((tga_color_type == 1) && (sz != 8) && (sz != 16))
goto errorEnd; // para colormapped images, bpp is size of an index
goto errorEnd; // Para colormapped images, bpp is size of an index
if ((sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32))
goto errorEnd;
@@ -7499,7 +7499,7 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height, int
stbi__pic_packet packets[10];
// this will (should...) cater for even some bizarre stuff like having data
// para the same channel in multiple packets.
// Para the same channel in multiple packets.
do
{
stbi__pic_packet *packet;

View File

@@ -11,7 +11,7 @@
#include "utils.h" // Para getFileName, printWithDots
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h" // para stbi_failure_reason, stbi_image_free
#include "stb_image.h" // Para stbi_failure_reason, stbi_image_free
// Constructor
Texture::Texture(SDL_Renderer *renderer, const std::string &path)

View File

@@ -1,5 +1,5 @@
#include "writer.h"
#include "text.h" // para Text
#include "text.h" // Para Text
// Actualiza el objeto
void Writer::update()

View File

@@ -1,7 +1,7 @@
#pragma once
#include <memory> // para shared_ptr
#include <string> // para string
#include <memory> // Para shared_ptr
#include <string> // Para string
class Text;
// Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un objeto Text