diff --git a/Docs/changelog.txt b/Docs/changelog.txt index 37a554c..5a3d445 100644 --- a/Docs/changelog.txt +++ b/Docs/changelog.txt @@ -2,9 +2,12 @@ N'gine Changelog -------------------------------------------------------------------------------- -W.I.P. +2017-11-14 Ver.0.4.0-a -------------------------------------------------------------------------------- - Añadidas las funciones de colision entre Sprites por "Pixel Perfect". +- Añadidas las sobrecargas para poder usar el tipo de dato "Vector2" en la + mayoria de funciones de desplazamiento y de posicionamiento. + (Translate() y Position()) diff --git a/Docs/user manual.esp/ngn_camera.h.pdf b/Docs/user manual.esp/ngn_camera.h.pdf index 83ba5a2..a59687d 100644 Binary files a/Docs/user manual.esp/ngn_camera.h.pdf and b/Docs/user manual.esp/ngn_camera.h.pdf differ diff --git a/Docs/user manual.esp/ngn_canvas.h.pdf b/Docs/user manual.esp/ngn_canvas.h.pdf index 3b471fd..83377d9 100644 Binary files a/Docs/user manual.esp/ngn_canvas.h.pdf and b/Docs/user manual.esp/ngn_canvas.h.pdf differ diff --git a/Docs/user manual.esp/ngn_collisions.h.pdf b/Docs/user manual.esp/ngn_collisions.h.pdf index 03841da..29bea31 100644 Binary files a/Docs/user manual.esp/ngn_collisions.h.pdf and b/Docs/user manual.esp/ngn_collisions.h.pdf differ diff --git a/Docs/user manual.esp/ngn_sprite.h.pdf b/Docs/user manual.esp/ngn_sprite.h.pdf index 97d70ac..0995978 100644 Binary files a/Docs/user manual.esp/ngn_sprite.h.pdf and b/Docs/user manual.esp/ngn_sprite.h.pdf differ diff --git a/Docs/user manual.esp/ngn_text_layer.h.pdf b/Docs/user manual.esp/ngn_text_layer.h.pdf index 695670a..fbb3303 100644 Binary files a/Docs/user manual.esp/ngn_text_layer.h.pdf and b/Docs/user manual.esp/ngn_text_layer.h.pdf differ diff --git a/Docs/user manual.esp/ngn_texture.h.pdf b/Docs/user manual.esp/ngn_texture.h.pdf index 683efad..c921037 100644 Binary files a/Docs/user manual.esp/ngn_texture.h.pdf and b/Docs/user manual.esp/ngn_texture.h.pdf differ diff --git a/Docs/user manual.esp/ngn_tiledbg.h.pdf b/Docs/user manual.esp/ngn_tiledbg.h.pdf index 2577248..896f5e1 100644 Binary files a/Docs/user manual.esp/ngn_tiledbg.h.pdf and b/Docs/user manual.esp/ngn_tiledbg.h.pdf differ diff --git a/Library/linux/include/ngn.h b/Library/linux/include/ngn.h index 1880fcb..2f82f1e 100644 --- a/Library/linux/include/ngn.h +++ b/Library/linux/include/ngn.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_audio_clip.h b/Library/linux/include/ngn_audio_clip.h index 79868b7..2afcd91 100644 --- a/Library/linux/include/ngn_audio_clip.h +++ b/Library/linux/include/ngn_audio_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_camera.h b/Library/linux/include/ngn_camera.h index d245a43..e5814d1 100644 --- a/Library/linux/include/ngn_camera.h +++ b/Library/linux/include/ngn_camera.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -128,6 +128,7 @@ class NGN_Camera { // Selecciona donde mira la camara void LookAt(NGN_Sprite* target_sprite); // Sigue a un sprite void LookAt(uint32_t position_x, uint32_t position_y); // Colocala en la coordenada indicada + void LookAt(Vector2I32 pos); // Actualiza la vista de la camara void Update(); diff --git a/Library/linux/include/ngn_canvas.h b/Library/linux/include/ngn_canvas.h index 348386b..06c4979 100644 --- a/Library/linux/include/ngn_canvas.h +++ b/Library/linux/include/ngn_canvas.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -111,9 +111,11 @@ class NGN_Canvas { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Library/linux/include/ngn_collisions.h b/Library/linux/include/ngn_collisions.h index 3998a9f..df574d1 100644 --- a/Library/linux/include/ngn_collisions.h +++ b/Library/linux/include/ngn_collisions.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_defines.h b/Library/linux/include/ngn_defines.h index f1292f1..6116d77 100644 --- a/Library/linux/include/ngn_defines.h +++ b/Library/linux/include/ngn_defines.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_graphics.h b/Library/linux/include/ngn_graphics.h index 9a60105..75d5796 100644 --- a/Library/linux/include/ngn_graphics.h +++ b/Library/linux/include/ngn_graphics.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_gui.h b/Library/linux/include/ngn_gui.h index c18f68e..abd7a90 100644 --- a/Library/linux/include/ngn_gui.h +++ b/Library/linux/include/ngn_gui.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_input.h b/Library/linux/include/ngn_input.h index c1ee332..49495d8 100644 --- a/Library/linux/include/ngn_input.h +++ b/Library/linux/include/ngn_input.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_load.h b/Library/linux/include/ngn_load.h index bd9e279..533ec5e 100644 --- a/Library/linux/include/ngn_load.h +++ b/Library/linux/include/ngn_load.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_music_clip.h b/Library/linux/include/ngn_music_clip.h index d948f52..3ab9317 100644 --- a/Library/linux/include/ngn_music_clip.h +++ b/Library/linux/include/ngn_music_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_render.h b/Library/linux/include/ngn_render.h index e3218eb..a16bf97 100644 --- a/Library/linux/include/ngn_render.h +++ b/Library/linux/include/ngn_render.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_sound.h b/Library/linux/include/ngn_sound.h index aed78dd..5c2fc69 100644 --- a/Library/linux/include/ngn_sound.h +++ b/Library/linux/include/ngn_sound.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_sprite.h b/Library/linux/include/ngn_sprite.h index c6f2280..56f85d3 100644 --- a/Library/linux/include/ngn_sprite.h +++ b/Library/linux/include/ngn_sprite.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -99,9 +99,11 @@ class NGN_Sprite { // Posiciona el sprite void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el sprite void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño del Sprite void Size(float w, float h); diff --git a/Library/linux/include/ngn_system.h b/Library/linux/include/ngn_system.h index 6d34e4e..1a120a0 100644 --- a/Library/linux/include/ngn_system.h +++ b/Library/linux/include/ngn_system.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/linux/include/ngn_text_layer.h b/Library/linux/include/ngn_text_layer.h index f970325..45ac6f2 100644 --- a/Library/linux/include/ngn_text_layer.h +++ b/Library/linux/include/ngn_text_layer.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -102,9 +102,11 @@ class NGN_TextLayer { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Library/linux/include/ngn_texture.h b/Library/linux/include/ngn_texture.h index ca15553..b1ccede 100644 --- a/Library/linux/include/ngn_texture.h +++ b/Library/linux/include/ngn_texture.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -95,9 +95,11 @@ class NGN_Texture { // Posiciona la textura void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la textura void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la textura void Size(float w, float h); diff --git a/Library/linux/include/ngn_tiledbg.h b/Library/linux/include/ngn_tiledbg.h index 98c0188..69e9391 100644 --- a/Library/linux/include/ngn_tiledbg.h +++ b/Library/linux/include/ngn_tiledbg.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -96,9 +96,11 @@ class NGN_TiledBg { // Posiciona el fondo void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el fondo void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Escala el fondo void Scale(float w, float h); // [Sobrecarga 1] Escala los dos ejes por separado diff --git a/Library/linux/lib/libngn.a b/Library/linux/lib/libngn.a index e04f350..2ecc30c 100644 Binary files a/Library/linux/lib/libngn.a and b/Library/linux/lib/libngn.a differ diff --git a/Library/linux/lib/libngn_d.a b/Library/linux/lib/libngn_d.a index a16dd04..10fa932 100644 Binary files a/Library/linux/lib/libngn_d.a and b/Library/linux/lib/libngn_d.a differ diff --git a/Library/windows/include/ngn.h b/Library/windows/include/ngn.h index 1880fcb..2f82f1e 100644 --- a/Library/windows/include/ngn.h +++ b/Library/windows/include/ngn.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_audio_clip.h b/Library/windows/include/ngn_audio_clip.h index 79868b7..2afcd91 100644 --- a/Library/windows/include/ngn_audio_clip.h +++ b/Library/windows/include/ngn_audio_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_camera.h b/Library/windows/include/ngn_camera.h index d245a43..e5814d1 100644 --- a/Library/windows/include/ngn_camera.h +++ b/Library/windows/include/ngn_camera.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -128,6 +128,7 @@ class NGN_Camera { // Selecciona donde mira la camara void LookAt(NGN_Sprite* target_sprite); // Sigue a un sprite void LookAt(uint32_t position_x, uint32_t position_y); // Colocala en la coordenada indicada + void LookAt(Vector2I32 pos); // Actualiza la vista de la camara void Update(); diff --git a/Library/windows/include/ngn_canvas.h b/Library/windows/include/ngn_canvas.h index 348386b..06c4979 100644 --- a/Library/windows/include/ngn_canvas.h +++ b/Library/windows/include/ngn_canvas.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -111,9 +111,11 @@ class NGN_Canvas { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Library/windows/include/ngn_collisions.h b/Library/windows/include/ngn_collisions.h index 3998a9f..df574d1 100644 --- a/Library/windows/include/ngn_collisions.h +++ b/Library/windows/include/ngn_collisions.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_defines.h b/Library/windows/include/ngn_defines.h index f1292f1..6116d77 100644 --- a/Library/windows/include/ngn_defines.h +++ b/Library/windows/include/ngn_defines.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_graphics.h b/Library/windows/include/ngn_graphics.h index 9a60105..75d5796 100644 --- a/Library/windows/include/ngn_graphics.h +++ b/Library/windows/include/ngn_graphics.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_gui.h b/Library/windows/include/ngn_gui.h index c18f68e..abd7a90 100644 --- a/Library/windows/include/ngn_gui.h +++ b/Library/windows/include/ngn_gui.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_input.h b/Library/windows/include/ngn_input.h index c1ee332..49495d8 100644 --- a/Library/windows/include/ngn_input.h +++ b/Library/windows/include/ngn_input.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_load.h b/Library/windows/include/ngn_load.h index bd9e279..533ec5e 100644 --- a/Library/windows/include/ngn_load.h +++ b/Library/windows/include/ngn_load.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_music_clip.h b/Library/windows/include/ngn_music_clip.h index d948f52..3ab9317 100644 --- a/Library/windows/include/ngn_music_clip.h +++ b/Library/windows/include/ngn_music_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_render.h b/Library/windows/include/ngn_render.h index e3218eb..a16bf97 100644 --- a/Library/windows/include/ngn_render.h +++ b/Library/windows/include/ngn_render.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_sound.h b/Library/windows/include/ngn_sound.h index aed78dd..5c2fc69 100644 --- a/Library/windows/include/ngn_sound.h +++ b/Library/windows/include/ngn_sound.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_sprite.h b/Library/windows/include/ngn_sprite.h index c6f2280..56f85d3 100644 --- a/Library/windows/include/ngn_sprite.h +++ b/Library/windows/include/ngn_sprite.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -99,9 +99,11 @@ class NGN_Sprite { // Posiciona el sprite void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el sprite void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño del Sprite void Size(float w, float h); diff --git a/Library/windows/include/ngn_system.h b/Library/windows/include/ngn_system.h index 6d34e4e..1a120a0 100644 --- a/Library/windows/include/ngn_system.h +++ b/Library/windows/include/ngn_system.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Library/windows/include/ngn_text_layer.h b/Library/windows/include/ngn_text_layer.h index f970325..45ac6f2 100644 --- a/Library/windows/include/ngn_text_layer.h +++ b/Library/windows/include/ngn_text_layer.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -102,9 +102,11 @@ class NGN_TextLayer { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Library/windows/include/ngn_texture.h b/Library/windows/include/ngn_texture.h index ca15553..b1ccede 100644 --- a/Library/windows/include/ngn_texture.h +++ b/Library/windows/include/ngn_texture.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -95,9 +95,11 @@ class NGN_Texture { // Posiciona la textura void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la textura void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la textura void Size(float w, float h); diff --git a/Library/windows/include/ngn_tiledbg.h b/Library/windows/include/ngn_tiledbg.h index 98c0188..69e9391 100644 --- a/Library/windows/include/ngn_tiledbg.h +++ b/Library/windows/include/ngn_tiledbg.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -96,9 +96,11 @@ class NGN_TiledBg { // Posiciona el fondo void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el fondo void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Escala el fondo void Scale(float w, float h); // [Sobrecarga 1] Escala los dos ejes por separado diff --git a/Library/windows/lib/libngn.a b/Library/windows/lib/libngn.a index 789a6ba..489c90e 100644 Binary files a/Library/windows/lib/libngn.a and b/Library/windows/lib/libngn.a differ diff --git a/Library/windows/lib/libngn_d.a b/Library/windows/lib/libngn_d.a index 20d6302..7607260 100644 Binary files a/Library/windows/lib/libngn_d.a and b/Library/windows/lib/libngn_d.a differ diff --git a/Source/ngn.cpp b/Source/ngn.cpp index 36ea2b1..9c4a277 100644 --- a/Source/ngn.cpp +++ b/Source/ngn.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn.h b/Source/ngn.h index 1880fcb..2f82f1e 100644 --- a/Source/ngn.h +++ b/Source/ngn.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_audio_clip.cpp b/Source/ngn_audio_clip.cpp index 313c72f..281366f 100644 --- a/Source/ngn_audio_clip.cpp +++ b/Source/ngn_audio_clip.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_audio_clip.h b/Source/ngn_audio_clip.h index 79868b7..2afcd91 100644 --- a/Source/ngn_audio_clip.h +++ b/Source/ngn_audio_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_camera.cpp b/Source/ngn_camera.cpp index f048c83..c453e5c 100644 --- a/Source/ngn_camera.cpp +++ b/Source/ngn_camera.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -309,6 +309,20 @@ void NGN_Camera::LookAt(uint32_t position_x, uint32_t position_y) { +/*** Haz que la camara se mueva a una coordenada concreta [Sobrecarga 3] ***/ +void NGN_Camera::LookAt(Vector2I32 pos) { + + // Anula el target actual si este existe + target = NULL; + + // Posiciona la camara en estas coordenadas + position.x = (pos.x >= 0) ? (uint32_t)pos.x : 0; + position.y = (pos.y >= 0) ? (uint32_t)pos.y : 0; + +} + + + /*** Actualiza la vista de la camara ***/ void NGN_Camera::Update() { diff --git a/Source/ngn_camera.h b/Source/ngn_camera.h index d245a43..e5814d1 100644 --- a/Source/ngn_camera.h +++ b/Source/ngn_camera.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -128,6 +128,7 @@ class NGN_Camera { // Selecciona donde mira la camara void LookAt(NGN_Sprite* target_sprite); // Sigue a un sprite void LookAt(uint32_t position_x, uint32_t position_y); // Colocala en la coordenada indicada + void LookAt(Vector2I32 pos); // Actualiza la vista de la camara void Update(); diff --git a/Source/ngn_canvas.cpp b/Source/ngn_canvas.cpp index 4a899d1..e12d034 100644 --- a/Source/ngn_canvas.cpp +++ b/Source/ngn_canvas.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -128,11 +128,18 @@ NGN_Canvas::~NGN_Canvas() { /*** Posiciona el canvas ***/ void NGN_Canvas::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion al canvas position.x = position_x; position.y = position_y; } +void NGN_Canvas::Position(Vector2 pos) { + + // Asigna la posicion al canvas + position.x = pos.x; + position.y = pos.y; + +} @@ -144,6 +151,13 @@ void NGN_Canvas::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Canvas::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Source/ngn_canvas.h b/Source/ngn_canvas.h index 348386b..06c4979 100644 --- a/Source/ngn_canvas.h +++ b/Source/ngn_canvas.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -111,9 +111,11 @@ class NGN_Canvas { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Source/ngn_collisions.cpp b/Source/ngn_collisions.cpp index a6b2fef..aabadd8 100644 --- a/Source/ngn_collisions.cpp +++ b/Source/ngn_collisions.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_collisions.h b/Source/ngn_collisions.h index 3998a9f..df574d1 100644 --- a/Source/ngn_collisions.h +++ b/Source/ngn_collisions.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_defines.cpp b/Source/ngn_defines.cpp index 7fb858a..ae7b76d 100644 --- a/Source/ngn_defines.cpp +++ b/Source/ngn_defines.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_defines.h b/Source/ngn_defines.h index f1292f1..6116d77 100644 --- a/Source/ngn_defines.h +++ b/Source/ngn_defines.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_graphics.cpp b/Source/ngn_graphics.cpp index 4d18d3c..a61acda 100644 --- a/Source/ngn_graphics.cpp +++ b/Source/ngn_graphics.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_graphics.h b/Source/ngn_graphics.h index 9a60105..75d5796 100644 --- a/Source/ngn_graphics.h +++ b/Source/ngn_graphics.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_gui.cpp b/Source/ngn_gui.cpp index 6ae5af8..3e9cd62 100644 --- a/Source/ngn_gui.cpp +++ b/Source/ngn_gui.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_gui.h b/Source/ngn_gui.h index c18f68e..abd7a90 100644 --- a/Source/ngn_gui.h +++ b/Source/ngn_gui.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_input.cpp b/Source/ngn_input.cpp index 1a1e848..ee7f7a4 100644 --- a/Source/ngn_input.cpp +++ b/Source/ngn_input.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_input.h b/Source/ngn_input.h index c1ee332..49495d8 100644 --- a/Source/ngn_input.h +++ b/Source/ngn_input.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_load.cpp b/Source/ngn_load.cpp index ef9ba69..55c66b5 100644 --- a/Source/ngn_load.cpp +++ b/Source/ngn_load.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_load.h b/Source/ngn_load.h index bd9e279..533ec5e 100644 --- a/Source/ngn_load.h +++ b/Source/ngn_load.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_music_clip.cpp b/Source/ngn_music_clip.cpp index f5f78b6..72f1ad2 100644 --- a/Source/ngn_music_clip.cpp +++ b/Source/ngn_music_clip.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_music_clip.h b/Source/ngn_music_clip.h index d948f52..3ab9317 100644 --- a/Source/ngn_music_clip.h +++ b/Source/ngn_music_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_render.cpp b/Source/ngn_render.cpp index 6497063..0cfbdbd 100644 --- a/Source/ngn_render.cpp +++ b/Source/ngn_render.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_render.h b/Source/ngn_render.h index e3218eb..a16bf97 100644 --- a/Source/ngn_render.h +++ b/Source/ngn_render.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_sound.cpp b/Source/ngn_sound.cpp index 161f554..8ad8aa4 100644 --- a/Source/ngn_sound.cpp +++ b/Source/ngn_sound.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_sound.h b/Source/ngn_sound.h index aed78dd..5c2fc69 100644 --- a/Source/ngn_sound.h +++ b/Source/ngn_sound.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_sprite.cpp b/Source/ngn_sprite.cpp index b21aa56..1431dcf 100644 --- a/Source/ngn_sprite.cpp +++ b/Source/ngn_sprite.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -150,6 +150,13 @@ void NGN_Sprite::Position(float position_x, float position_y) { position.y = position_y; } +void NGN_Sprite::Position(Vector2 pos) { + + // Asigna la posicion al Sprite + position.x = pos.x; + position.y = pos.y; + +} @@ -161,6 +168,13 @@ void NGN_Sprite::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Sprite::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Source/ngn_sprite.h b/Source/ngn_sprite.h index c6f2280..56f85d3 100644 --- a/Source/ngn_sprite.h +++ b/Source/ngn_sprite.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -99,9 +99,11 @@ class NGN_Sprite { // Posiciona el sprite void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el sprite void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño del Sprite void Size(float w, float h); diff --git a/Source/ngn_system.cpp b/Source/ngn_system.cpp index da08df4..82e8302 100644 --- a/Source/ngn_system.cpp +++ b/Source/ngn_system.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_system.h b/Source/ngn_system.h index 6d34e4e..1a120a0 100644 --- a/Source/ngn_system.h +++ b/Source/ngn_system.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Source/ngn_text_layer.cpp b/Source/ngn_text_layer.cpp index 8a67178..2100ee6 100644 --- a/Source/ngn_text_layer.cpp +++ b/Source/ngn_text_layer.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -353,11 +353,18 @@ void NGN_TextLayer::Print(std::string text) { /*** Posiciona la capa ***/ void NGN_TextLayer::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion a la capa position.x = position_x; position.y = position_y; } +void NGN_TextLayer::Position(Vector2 pos) { + + // Asigna la posicion a la capa + position.x = pos.x; + position.y = pos.y; + +} @@ -369,6 +376,13 @@ void NGN_TextLayer::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_TextLayer::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Source/ngn_text_layer.h b/Source/ngn_text_layer.h index f970325..45ac6f2 100644 --- a/Source/ngn_text_layer.h +++ b/Source/ngn_text_layer.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -102,9 +102,11 @@ class NGN_TextLayer { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Source/ngn_texture.cpp b/Source/ngn_texture.cpp index 532c618..57d3c09 100644 --- a/Source/ngn_texture.cpp +++ b/Source/ngn_texture.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -135,11 +135,18 @@ NGN_Texture::~NGN_Texture() { /*** Posiciona la textura ***/ void NGN_Texture::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion a la Textura position.x = position_x; position.y = position_y; } +void NGN_Texture::Position(Vector2 pos) { + + // Asigna la posicion a la Textura + position.x = pos.x; + position.y = pos.y; + +} @@ -151,6 +158,13 @@ void NGN_Texture::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Texture::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Source/ngn_texture.h b/Source/ngn_texture.h index ca15553..b1ccede 100644 --- a/Source/ngn_texture.h +++ b/Source/ngn_texture.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -95,9 +95,11 @@ class NGN_Texture { // Posiciona la textura void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la textura void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la textura void Size(float w, float h); diff --git a/Source/ngn_tiledbg.cpp b/Source/ngn_tiledbg.cpp index 31a0396..1c9761a 100644 --- a/Source/ngn_tiledbg.cpp +++ b/Source/ngn_tiledbg.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -162,6 +162,13 @@ void NGN_TiledBg::Position(float position_x, float position_y) { position.y = position_y; } +void NGN_TiledBg::Position(Vector2 pos) { + + // Asigna la posicion + position.x = pos.x; + position.y = pos.y; + +} @@ -173,6 +180,13 @@ void NGN_TiledBg::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_TiledBg::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Source/ngn_tiledbg.h b/Source/ngn_tiledbg.h index 98c0188..69e9391 100644 --- a/Source/ngn_tiledbg.h +++ b/Source/ngn_tiledbg.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -96,9 +96,11 @@ class NGN_TiledBg { // Posiciona el fondo void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el fondo void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Escala el fondo void Scale(float w, float h); // [Sobrecarga 1] Escala los dos ejes por separado diff --git a/Tools/StaticLib/source/ngn.cpp b/Tools/StaticLib/source/ngn.cpp index 36ea2b1..9c4a277 100644 --- a/Tools/StaticLib/source/ngn.cpp +++ b/Tools/StaticLib/source/ngn.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn.h b/Tools/StaticLib/source/ngn.h index 1880fcb..2f82f1e 100644 --- a/Tools/StaticLib/source/ngn.h +++ b/Tools/StaticLib/source/ngn.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Archivo principal de la libreria Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_audio_clip.cpp b/Tools/StaticLib/source/ngn_audio_clip.cpp index 313c72f..281366f 100644 --- a/Tools/StaticLib/source/ngn_audio_clip.cpp +++ b/Tools/StaticLib/source/ngn_audio_clip.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_audio_clip.h b/Tools/StaticLib/source/ngn_audio_clip.h index 79868b7..2afcd91 100644 --- a/Tools/StaticLib/source/ngn_audio_clip.h +++ b/Tools/StaticLib/source/ngn_audio_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de audio Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_camera.cpp b/Tools/StaticLib/source/ngn_camera.cpp index f048c83..c453e5c 100644 --- a/Tools/StaticLib/source/ngn_camera.cpp +++ b/Tools/StaticLib/source/ngn_camera.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -309,6 +309,20 @@ void NGN_Camera::LookAt(uint32_t position_x, uint32_t position_y) { +/*** Haz que la camara se mueva a una coordenada concreta [Sobrecarga 3] ***/ +void NGN_Camera::LookAt(Vector2I32 pos) { + + // Anula el target actual si este existe + target = NULL; + + // Posiciona la camara en estas coordenadas + position.x = (pos.x >= 0) ? (uint32_t)pos.x : 0; + position.y = (pos.y >= 0) ? (uint32_t)pos.y : 0; + +} + + + /*** Actualiza la vista de la camara ***/ void NGN_Camera::Update() { diff --git a/Tools/StaticLib/source/ngn_camera.h b/Tools/StaticLib/source/ngn_camera.h index d245a43..e5814d1 100644 --- a/Tools/StaticLib/source/ngn_camera.h +++ b/Tools/StaticLib/source/ngn_camera.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Camara virtual en 2D Proyecto iniciado el 1 de Febrero del 2016 @@ -128,6 +128,7 @@ class NGN_Camera { // Selecciona donde mira la camara void LookAt(NGN_Sprite* target_sprite); // Sigue a un sprite void LookAt(uint32_t position_x, uint32_t position_y); // Colocala en la coordenada indicada + void LookAt(Vector2I32 pos); // Actualiza la vista de la camara void Update(); diff --git a/Tools/StaticLib/source/ngn_canvas.cpp b/Tools/StaticLib/source/ngn_canvas.cpp index 4a899d1..e12d034 100644 --- a/Tools/StaticLib/source/ngn_canvas.cpp +++ b/Tools/StaticLib/source/ngn_canvas.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -128,11 +128,18 @@ NGN_Canvas::~NGN_Canvas() { /*** Posiciona el canvas ***/ void NGN_Canvas::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion al canvas position.x = position_x; position.y = position_y; } +void NGN_Canvas::Position(Vector2 pos) { + + // Asigna la posicion al canvas + position.x = pos.x; + position.y = pos.y; + +} @@ -144,6 +151,13 @@ void NGN_Canvas::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Canvas::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Tools/StaticLib/source/ngn_canvas.h b/Tools/StaticLib/source/ngn_canvas.h index 348386b..06c4979 100644 --- a/Tools/StaticLib/source/ngn_canvas.h +++ b/Tools/StaticLib/source/ngn_canvas.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Canvas - Capa de dibujo Proyecto iniciado el 1 de Febrero del 2016 @@ -111,9 +111,11 @@ class NGN_Canvas { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Tools/StaticLib/source/ngn_collisions.cpp b/Tools/StaticLib/source/ngn_collisions.cpp index 1818a7b..aabadd8 100644 --- a/Tools/StaticLib/source/ngn_collisions.cpp +++ b/Tools/StaticLib/source/ngn_collisions.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 @@ -101,7 +101,7 @@ uint32_t NGN_Collisions::GetPixel(NGN_CollisionMapData* cmap, int32_t position_x } -/*** Devuelve el tamaño de un mapa de colisiones ***/ +/*** Devuelve el tamaño de un mapa de colisiones ***/ Size2 NGN_Collisions::GetMapSize(NGN_CollisionMapData* cmap) { Size2 temp; @@ -126,12 +126,12 @@ bool NGN_Collisions::HitBox(NGN_Sprite* spr1, NGN_Sprite* spr2) { // Calculos previos (distancia entre sprites) Vector2 distance; - distance.x = std::abs(spr1->position.x - spr2->position.x); - distance.y = std::abs(spr1->position.y - spr2->position.y); - // Calculos previos (tamaño de la colision) + distance.x = (int32_t)(std::abs(spr1->position.x - spr2->position.x)); + distance.y = (int32_t)(std::abs(spr1->position.y - spr2->position.y)); + // Calculos previos (tamaño de la colision) Size2 collision_size; - collision_size.width = ((spr1->box.width / 2.0f) + (spr2->box.width / 2.0f)); - collision_size.height = ((spr1->box.height / 2.0f) + (spr2->box.height / 2.0f)); + collision_size.width = (int32_t)((spr1->box.width / 2.0f) + (spr2->box.width / 2.0f)); + collision_size.height = (int32_t)((spr1->box.height / 2.0f) + (spr2->box.height / 2.0f)); // Verifica si existe la colision if ((distance.x <= collision_size.width) && (distance.y <= collision_size.height)) { @@ -141,3 +141,239 @@ bool NGN_Collisions::HitBox(NGN_Sprite* spr1, NGN_Sprite* spr2) { } } + + + +/*** Devuelve si hay colision entre 2 sprites, con precision de pixel ***/ +bool NGN_Collisions::PixelPerfect(NGN_Sprite* spr1, NGN_Sprite* spr2) { + + // Proteccion de errores + if ((spr1 == NULL) || (spr2 == NULL)) return false; + + // Verifica que ambos sprites sean visibles + if (!spr1->visible || !spr2->visible) return false; + + // Variables + int32_t r1 = 0, r2 = 0, dist = 0; // Colision por circulos + Vector2 distance; // Colision por cajas + Size2 collision_size; + + // Decide el metodo para la primera comprobacion + if ((spr1->rotation != 0.0f) || (spr2->rotation != 0.0f)) { + // Si alguno esta rotado, colision por circulos + r1 = (int32_t)(std::sqrt(std::pow(spr1->width, 2.0f) + std::pow(spr1->height, 2.0f)) / 2.0f); + r2 = (int32_t)(std::sqrt(std::pow(spr2->width, 2.0f) + std::pow(spr2->height, 2.0f)) / 2.0f); + dist = (int32_t)std::sqrt(std::pow((spr1->position.x - spr2->position.x), 2.0f) + std::pow((spr1->position.y - spr2->position.y), 2.0f)); + if (dist > (r1 + r2)) return false; + } else { + // Si no lo estan, colision por cajas + distance.x = (int32_t)(std::abs(spr1->position.x - spr2->position.x)); + distance.y = (int32_t)(std::abs(spr1->position.y - spr2->position.y)); + collision_size.width = (int32_t)((spr1->width / 2.0f) + (spr2->width / 2.0f)); + collision_size.height = (int32_t)((spr1->height / 2.0f) + (spr2->height / 2.0f)); + if ((distance.x > collision_size.width) || (distance.y > collision_size.height)) return false; + } + + // Calculo de la zona de interseccion + int32_t xa = 0, ya = 0, xb = 0, yb = 0; + int32_t vx[4], vy[4]; + // Calculo del tamaño segun la rotacion + float w1 = 0.0f, w2 = 0.0f, h1 = 0.0f, h2 = 0.0f; + if (spr1->rotation == 0.0f) { + w1 = (spr1->width / 2.0f); + h1 = (spr1->height / 2.0f); + } else { + w1 = (std::sqrt(std::pow(spr1->width, 2.0f) + std::pow(spr1->height, 2.0f)) / 2.0f); + h1 = w1; + } + if (spr2->rotation == 0.0f) { + w2 = (spr2->width / 2.0f); + h2 = (spr2->height / 2.0f); + } else { + w2 = (std::sqrt(std::pow(spr2->width, 2.0f) + std::pow(spr2->height, 2.0f)) / 2.0f); + h2 = w2; + } + + // Lineas verticales + vx[0] = (int32_t)(spr1->position.x - w1); + vx[1] = (int32_t)(spr2->position.x - w2); + vx[2] = (int32_t)(spr1->position.x + w1); + vx[3] = (int32_t)(spr2->position.x + w2); + // Ordena las lineas verticales (indice mas bajo, valor mas bajo) + for (uint32_t n = 0; n < 3; n ++) { + for (uint32_t i = (n + 1); i < 4; i ++) { + if (vx[i] < vx[n]) { + std::swap(vx[i], vx[n]); + } + } + } + // Lineas horizontales + vy[0] = (int32_t)(spr1->position.y - h1); + vy[1] = (int32_t)(spr2->position.y - h2); + vy[2] = (int32_t)(spr1->position.y + h1); + vy[3] = (int32_t)(spr2->position.y + h2); + // Ordena las lineas horizontales (indice mas bajo, valor mas bajo) + for (uint32_t n = 0; n < 3; n ++) { + for (uint32_t i = (n + 1); i < 4; i ++) { + if (vy[i] < vy[n]) { + std::swap(vy[i], vy[n]); + } + } + } + // Asigna los puntos de la interseccion + xa = vx[1]; xb = vx[2]; + ya = vy[1]; yb = vy[2]; + + // Renderiza las dos subtexturas para la comparacion + int32_t area_w = std::abs(xa - xb) + 1; // Calcula el tamaño de los buffers + int32_t area_h = std::abs(ya - yb) + 1; + int32_t x = 0, y = 0; // Posicion del sprite en la textura + // Sprite 1 + x = ((int32_t)spr1->position.x - xa); + y = ((int32_t)spr1->position.y - ya); + SDL_Surface* srf1 = NULL; + srf1 = RenderSpriteInSurface(spr1, x, y, area_w, area_h); + // Sprite 2 + x = (spr2->position.x - xa); + y = (spr2->position.y - ya); + SDL_Surface* srf2 = NULL; + srf2 = RenderSpriteInSurface(spr2, x, y, area_w, area_h); + + // Deteccion de la colision + bool collision = false; + uint32_t* pixels1 = (uint32_t*)srf1->pixels; + uint32_t* pixels2 = (uint32_t*)srf2->pixels; + uint32_t _size = (area_w * area_h); + for (uint32_t i = 0; i < _size; i ++) { + if ((pixels1[i] & 0x000000FF) & (pixels2[i] & 0x000000FF)) { + collision = true; + break; + } + } + + // Paso de limpieza + SDL_FreeSurface(srf1); + srf1 = NULL; + SDL_FreeSurface(srf2); + srf2 = NULL; + + // Resultado de la colision + return collision; + +} + + + +/*** Renderiza un sprite en una superficie ***/ +SDL_Surface* NGN_Collisions::RenderSpriteInSurface(NGN_Sprite* sprite, int32_t x, int32_t y, int32_t w, int32_t h) { + + // Crea una nueva textura como buffer del tamaño necesario + SDL_Texture* backbuffer = NULL; + backbuffer = SDL_CreateTexture( + ngn->graphics->renderer, // Renderer + SDL_PIXELFORMAT_BGRA8888, // Formato del pixel + SDL_TEXTUREACCESS_TARGET, // Textura como destino del renderer (modo edicion) + w, // Ancho de la textura + h // Alto de la textura + ); + + // Informa al renderer que la textura "backbuffer" es su destino + SDL_SetRenderTarget(ngn->graphics->renderer, backbuffer); + // Borra el contenido de la textura actual (con el fondo listo para el blending) + SDL_SetRenderDrawColor(ngn->graphics->renderer, 0x00, 0x00, 0x00, 0x00); + SDL_SetTextureBlendMode(backbuffer, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(backbuffer, 0xFF); + SDL_RenderFillRect(ngn->graphics->renderer, NULL); + + // Calculos + int32_t _x, _y; + _x = (int32_t)(x - (sprite->width / 2.0f)); + _y = (int32_t)(y - (sprite->height / 2.0f)); + + int32_t _width = (int32_t)sprite->width; + int32_t _height = (int32_t)sprite->height; + double _rotation = 0.0f; + SDL_RendererFlip _flip; + + // Centro de la rotacion + SDL_Point* _center = new SDL_Point(); + _center->x = ((sprite->width / 2.0f) + sprite->center.x); + _center->y = ((sprite->height / 2.0f) + sprite->center.y); + + // Flip + if (!sprite->flip_h && !sprite->flip_v) { + _flip = SDL_FLIP_NONE; + } else if (sprite->flip_h && !sprite->flip_v) { + _flip = SDL_FLIP_HORIZONTAL; + } else if (!sprite->flip_h && sprite->flip_v) { + _flip = SDL_FLIP_VERTICAL; + } else { + _flip = SDL_FLIP_NONE; + _rotation = 180.0f; + } + + // Alpha + if (sprite->alpha == -1) { + // Deshabilita el canal Alpha + SDL_SetTextureBlendMode(sprite->data->gfx, SDL_BLENDMODE_NONE); + } else { + int32_t _alpha = sprite->alpha; + if (_alpha < 0) { + _alpha = 0; + } else if (_alpha > 0xFF) { + _alpha = 0xFF; + } + SDL_SetTextureBlendMode(sprite->data->gfx, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(sprite->data->gfx, (Uint8)_alpha); + } + + /* Dibujado del sprite */ + // Define el area de origen + int32_t frame = (sprite->frame * sprite->data->header.frame_height); + SDL_Rect source = { + 0, // Posicion X + frame, // Posicion Y + (int32_t)sprite->data->header.frame_width, // Ancho + (int32_t)sprite->data->header.frame_height // Alto + }; + // Define el area de destino + SDL_Rect destination = { + _x, // Posicion X + _y, // Posicion Y + _width, // Ancho + _height // Alto + }; + + // Renderiza la textura + SDL_RenderCopyEx(ngn->graphics->renderer, sprite->data->gfx, &source, &destination, (sprite->rotation + _rotation), _center, _flip); + + // Area a extraer + SDL_Rect area = {0, 0, w, h}; + // Superficie para guardar los pixeles extraidos + SDL_Surface *surface = SDL_CreateRGBSurface( + 0, // Flag (siempre 0) + w, // Ancho + h, // Alto + 32, // Bits por pixels + 0x000000FF, // Mascara R + 0x0000FF00, // Mascara G + 0x00FF0000, // Mascara B + 0xFF000000 // Mascara A + ); + // Extrae los pixeles + SDL_RenderReadPixels(ngn->graphics->renderer, &area, SDL_PIXELFORMAT_BGRA8888, surface->pixels, surface->pitch); + + // Cambia el destino del renderer a la pantalla + SDL_SetRenderTarget(ngn->graphics->renderer, NULL); + // Restaura el color y alpha del renderer + SDL_SetRenderDrawColor(ngn->graphics->renderer, 0x00, 0x00, 0x00, 0xFF); + + // Paso de limpieza + delete _center; + SDL_DestroyTexture(backbuffer); + backbuffer = NULL; + + // Devuelve la superficie creada + return surface; + +} diff --git a/Tools/StaticLib/source/ngn_collisions.h b/Tools/StaticLib/source/ngn_collisions.h index b4bd6cf..df574d1 100644 --- a/Tools/StaticLib/source/ngn_collisions.h +++ b/Tools/StaticLib/source/ngn_collisions.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sistema de colisiones Proyecto iniciado el 1 de Febrero del 2016 @@ -73,10 +73,22 @@ class NGN_Collisions { // Consulta si hay colision por cajas entre 2 sprites bool HitBox(NGN_Sprite* spr1, NGN_Sprite* spr2); + // Consulta si hay colision por "pixel perfect" entre 2 sprites + bool PixelPerfect(NGN_Sprite* spr1, NGN_Sprite* spr2); + // Private private: + // Deteccion de colisiones entre sprites por "pixel perfect" + SDL_Surface* RenderSpriteInSurface( + NGN_Sprite* sprite, // Sprite a renderizar + int32_t x, // Posicion + int32_t y, + int32_t w, // Tamaño del buffer + int32_t h + ); + }; diff --git a/Tools/StaticLib/source/ngn_defines.cpp b/Tools/StaticLib/source/ngn_defines.cpp index 7fb858a..ae7b76d 100644 --- a/Tools/StaticLib/source/ngn_defines.cpp +++ b/Tools/StaticLib/source/ngn_defines.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_defines.h b/Tools/StaticLib/source/ngn_defines.h index f1292f1..6116d77 100644 --- a/Tools/StaticLib/source/ngn_defines.h +++ b/Tools/StaticLib/source/ngn_defines.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Definiciones de prototipos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_graphics.cpp b/Tools/StaticLib/source/ngn_graphics.cpp index 4d18d3c..a61acda 100644 --- a/Tools/StaticLib/source/ngn_graphics.cpp +++ b/Tools/StaticLib/source/ngn_graphics.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_graphics.h b/Tools/StaticLib/source/ngn_graphics.h index 9a60105..75d5796 100644 --- a/Tools/StaticLib/source/ngn_graphics.h +++ b/Tools/StaticLib/source/ngn_graphics.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_gui.cpp b/Tools/StaticLib/source/ngn_gui.cpp index 6ae5af8..3e9cd62 100644 --- a/Tools/StaticLib/source/ngn_gui.cpp +++ b/Tools/StaticLib/source/ngn_gui.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_gui.h b/Tools/StaticLib/source/ngn_gui.h index c18f68e..abd7a90 100644 --- a/Tools/StaticLib/source/ngn_gui.h +++ b/Tools/StaticLib/source/ngn_gui.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** GUI - Interfaz grafica de usuario Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_input.cpp b/Tools/StaticLib/source/ngn_input.cpp index 1a1e848..ee7f7a4 100644 --- a/Tools/StaticLib/source/ngn_input.cpp +++ b/Tools/StaticLib/source/ngn_input.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_input.h b/Tools/StaticLib/source/ngn_input.h index c1ee332..49495d8 100644 --- a/Tools/StaticLib/source/ngn_input.h +++ b/Tools/StaticLib/source/ngn_input.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Meotodos de entrada Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_load.cpp b/Tools/StaticLib/source/ngn_load.cpp index ef9ba69..55c66b5 100644 --- a/Tools/StaticLib/source/ngn_load.cpp +++ b/Tools/StaticLib/source/ngn_load.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_load.h b/Tools/StaticLib/source/ngn_load.h index bd9e279..533ec5e 100644 --- a/Tools/StaticLib/source/ngn_load.h +++ b/Tools/StaticLib/source/ngn_load.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de carga de archivos Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_music_clip.cpp b/Tools/StaticLib/source/ngn_music_clip.cpp index f5f78b6..72f1ad2 100644 --- a/Tools/StaticLib/source/ngn_music_clip.cpp +++ b/Tools/StaticLib/source/ngn_music_clip.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_music_clip.h b/Tools/StaticLib/source/ngn_music_clip.h index d948f52..3ab9317 100644 --- a/Tools/StaticLib/source/ngn_music_clip.h +++ b/Tools/StaticLib/source/ngn_music_clip.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Clips de musica Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_render.cpp b/Tools/StaticLib/source/ngn_render.cpp index 6497063..0cfbdbd 100644 --- a/Tools/StaticLib/source/ngn_render.cpp +++ b/Tools/StaticLib/source/ngn_render.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_render.h b/Tools/StaticLib/source/ngn_render.h index e3218eb..a16bf97 100644 --- a/Tools/StaticLib/source/ngn_render.h +++ b/Tools/StaticLib/source/ngn_render.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Gestion del Renderer de SDL Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_sound.cpp b/Tools/StaticLib/source/ngn_sound.cpp index 161f554..8ad8aa4 100644 --- a/Tools/StaticLib/source/ngn_sound.cpp +++ b/Tools/StaticLib/source/ngn_sound.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_sound.h b/Tools/StaticLib/source/ngn_sound.h index aed78dd..5c2fc69 100644 --- a/Tools/StaticLib/source/ngn_sound.h +++ b/Tools/StaticLib/source/ngn_sound.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sonido (sin streaming) Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_sprite.cpp b/Tools/StaticLib/source/ngn_sprite.cpp index b21aa56..1431dcf 100644 --- a/Tools/StaticLib/source/ngn_sprite.cpp +++ b/Tools/StaticLib/source/ngn_sprite.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -150,6 +150,13 @@ void NGN_Sprite::Position(float position_x, float position_y) { position.y = position_y; } +void NGN_Sprite::Position(Vector2 pos) { + + // Asigna la posicion al Sprite + position.x = pos.x; + position.y = pos.y; + +} @@ -161,6 +168,13 @@ void NGN_Sprite::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Sprite::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Tools/StaticLib/source/ngn_sprite.h b/Tools/StaticLib/source/ngn_sprite.h index 6a7321d..56f85d3 100644 --- a/Tools/StaticLib/source/ngn_sprite.h +++ b/Tools/StaticLib/source/ngn_sprite.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Sprites Proyecto iniciado el 1 de Febrero del 2016 @@ -67,7 +67,7 @@ class NGN_Sprite { // Contructor NGN_Sprite( - NGN_SpriteData* sprite, // Objeto de la clase Sprite Data + NGN_SpriteData* sprite, // Objeto de la clase Sprite Data int32_t position_x = DEFAULT_VALUE, // Posicion X inicial (oculto por defecto) int32_t position_y = DEFAULT_VALUE, // Posicion Y inicial (oculto por defecto) int32_t sprite_width = DEFAULT_VALUE, // Ancho del sprite (por defecto, el de la textura) @@ -89,7 +89,7 @@ class NGN_Sprite { Size2 box; // Caja de colisiones bool visible; // Visibilidad - int32_t alpha; // Nivel de alpha + int32_t alpha; // Nivel de alpha bool on_screen; // Usar este flag para indicar si esta o no en pantalla double rotation; // Rotacion del Sprite @@ -99,9 +99,11 @@ class NGN_Sprite { // Posiciona el sprite void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el sprite void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño del Sprite void Size(float w, float h); diff --git a/Tools/StaticLib/source/ngn_system.cpp b/Tools/StaticLib/source/ngn_system.cpp index da08df4..82e8302 100644 --- a/Tools/StaticLib/source/ngn_system.cpp +++ b/Tools/StaticLib/source/ngn_system.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_system.h b/Tools/StaticLib/source/ngn_system.h index 6d34e4e..1a120a0 100644 --- a/Tools/StaticLib/source/ngn_system.h +++ b/Tools/StaticLib/source/ngn_system.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Funciones de sistema Proyecto iniciado el 1 de Febrero del 2016 diff --git a/Tools/StaticLib/source/ngn_text_layer.cpp b/Tools/StaticLib/source/ngn_text_layer.cpp index 8a67178..2100ee6 100644 --- a/Tools/StaticLib/source/ngn_text_layer.cpp +++ b/Tools/StaticLib/source/ngn_text_layer.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -353,11 +353,18 @@ void NGN_TextLayer::Print(std::string text) { /*** Posiciona la capa ***/ void NGN_TextLayer::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion a la capa position.x = position_x; position.y = position_y; } +void NGN_TextLayer::Position(Vector2 pos) { + + // Asigna la posicion a la capa + position.x = pos.x; + position.y = pos.y; + +} @@ -369,6 +376,13 @@ void NGN_TextLayer::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_TextLayer::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Tools/StaticLib/source/ngn_text_layer.h b/Tools/StaticLib/source/ngn_text_layer.h index f970325..45ac6f2 100644 --- a/Tools/StaticLib/source/ngn_text_layer.h +++ b/Tools/StaticLib/source/ngn_text_layer.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Text Layer - Capa de texto con soporte TTF Proyecto iniciado el 1 de Febrero del 2016 @@ -102,9 +102,11 @@ class NGN_TextLayer { // Posiciona la capa void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la capa void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la capa void Size(float w, float h); diff --git a/Tools/StaticLib/source/ngn_texture.cpp b/Tools/StaticLib/source/ngn_texture.cpp index 532c618..57d3c09 100644 --- a/Tools/StaticLib/source/ngn_texture.cpp +++ b/Tools/StaticLib/source/ngn_texture.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -135,11 +135,18 @@ NGN_Texture::~NGN_Texture() { /*** Posiciona la textura ***/ void NGN_Texture::Position(float position_x, float position_y) { - // Asigna la posicion al Texture + // Asigna la posicion a la Textura position.x = position_x; position.y = position_y; } +void NGN_Texture::Position(Vector2 pos) { + + // Asigna la posicion a la Textura + position.x = pos.x; + position.y = pos.y; + +} @@ -151,6 +158,13 @@ void NGN_Texture::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_Texture::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Tools/StaticLib/source/ngn_texture.h b/Tools/StaticLib/source/ngn_texture.h index ca15553..b1ccede 100644 --- a/Tools/StaticLib/source/ngn_texture.h +++ b/Tools/StaticLib/source/ngn_texture.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos con texturas Proyecto iniciado el 1 de Febrero del 2016 @@ -95,9 +95,11 @@ class NGN_Texture { // Posiciona la textura void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve la textura void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Cambia el tamaño de la textura void Size(float w, float h); diff --git a/Tools/StaticLib/source/ngn_tiledbg.cpp b/Tools/StaticLib/source/ngn_tiledbg.cpp index 31a0396..1c9761a 100644 --- a/Tools/StaticLib/source/ngn_tiledbg.cpp +++ b/Tools/StaticLib/source/ngn_tiledbg.cpp @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -162,6 +162,13 @@ void NGN_TiledBg::Position(float position_x, float position_y) { position.y = position_y; } +void NGN_TiledBg::Position(Vector2 pos) { + + // Asigna la posicion + position.x = pos.x; + position.y = pos.y; + +} @@ -173,6 +180,13 @@ void NGN_TiledBg::Translate(float speed_x, float speed_y) { position.y += speed_y; } +void NGN_TiledBg::Translate(Vector2 spd) { + + // Calcula la nueva posicion + position.x += spd.x; + position.y += spd.y; + +} diff --git a/Tools/StaticLib/source/ngn_tiledbg.h b/Tools/StaticLib/source/ngn_tiledbg.h index fc76d0d..69e9391 100644 --- a/Tools/StaticLib/source/ngn_tiledbg.h +++ b/Tools/StaticLib/source/ngn_tiledbg.h @@ -1,7 +1,7 @@ /****************************************************************************** N'gine Lib for C++ - *** Version 0.2.1-alpha *** + *** Version 0.4.0-alpha *** Fondos Tileados Proyecto iniciado el 1 de Febrero del 2016 @@ -62,11 +62,11 @@ class NGN_TiledBg { // Constructor NGN_TiledBg( - NGN_TiledBgData* bg, // Datos del fondo - int32_t position_x = 0, // Posicion X del fondo [0 por defecto] - int32_t position_y = 0, // Posicion Y del fondo [0 por defecto] - bool over_scan = false // Uso de over scan en el fondo - ); + NGN_TiledBgData* bg, // Datos del fondo + int32_t position_x = 0, // Posicion X del fondo [0 por defecto] + int32_t position_y = 0, // Posicion Y del fondo [0 por defecto] + bool over_scan = false // Uso de over scan en el fondo + ); // Destructor ~NGN_TiledBg(); @@ -96,9 +96,11 @@ class NGN_TiledBg { // Posiciona el fondo void Position(float position_x, float position_y); + void Position(Vector2 pos); // Mueve el fondo void Translate(float speed_x, float speed_y); + void Translate(Vector2 spd); // Escala el fondo void Scale(float w, float h); // [Sobrecarga 1] Escala los dos ejes por separado