From b043c5e2775b519e9cbb6147a2389091ad4b27de Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 2 Oct 2017 00:12:52 +0200 Subject: [PATCH] Trying to correct drawing issues... --- games/koala_seasons/Makefile | 2 +- .../resources/shaders/glsl330/base.vs | 4 ++-- games/koala_seasons/screens/screen_title.c | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/games/koala_seasons/Makefile b/games/koala_seasons/Makefile index c9eee6ff7..921c3aa3c 100644 --- a/games/koala_seasons/Makefile +++ b/games/koala_seasons/Makefile @@ -36,7 +36,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # define raylib directory for include and library -RAYLIB_PATH ?= C:\raylib\raylib +RAYLIB_PATH ?= C:\GitHub\raylib # determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) diff --git a/games/koala_seasons/resources/shaders/glsl330/base.vs b/games/koala_seasons/resources/shaders/glsl330/base.vs index 395cee1b6..4bd31d940 100644 --- a/games/koala_seasons/resources/shaders/glsl330/base.vs +++ b/games/koala_seasons/resources/shaders/glsl330/base.vs @@ -6,7 +6,7 @@ in vec2 vertexTexCoord; in vec4 vertexColor; // Input uniform values -uniform mat4 mvpMatrix; +uniform mat4 mvp; // Output vertex attributes (to fragment shader) out vec2 fragTexCoord; @@ -21,5 +21,5 @@ void main() fragColor = vertexColor; // Calculate final vertex position - gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); + gl_Position = mvp*vec4(vertexPosition, 1.0); } \ No newline at end of file diff --git a/games/koala_seasons/screens/screen_title.c b/games/koala_seasons/screens/screen_title.c index ee99da031..fd1661963 100644 --- a/games/koala_seasons/screens/screen_title.c +++ b/games/koala_seasons/screens/screen_title.c @@ -855,11 +855,11 @@ void DrawTitleScreen(void) { BeginShaderMode(colorBlend); - DrawTexturePro(atlas02,gameplay_background, (Rectangle){0, 0, gameplay_background.width*2, gameplay_background.height*2}, (Vector2){0, 0}, 0, color02); + DrawTexturePro(atlas02, gameplay_background, (Rectangle){0, 0, gameplay_background.width*2, gameplay_background.height*2}, (Vector2){0, 0}, 0, color02); // Draw parallax - DrawParallaxBack(); - DrawParallaxMiddle(); + //DrawParallaxBack(); + //DrawParallaxMiddle(); for (int i = 0; i < MAX_particle; i++) { @@ -946,7 +946,6 @@ void DrawTitleScreen(void) (Rectangle){ rainParticle.particle[i].position.x, rainParticle.particle[i].position.y, particle_waterdrop.width*rainParticle.particle[i].size, particle_waterdrop.height*rainParticle.particle[i].size }, (Vector2){ particle_waterdrop.width*rainParticle.particle[i].size/2, particle_waterdrop.height*rainParticle.particle[i].size/2 }, rainParticle.particle[i].rotation, Fade(rainParticle.particle[i].color, rainParticle.particle[i].alpha)); - } for (int i = 0; i < 1024; i++) @@ -959,7 +958,6 @@ void DrawTitleScreen(void) for (int i = 0; i < 256; i++) { - if (snowStormParticle.particle[i].active) DrawTexturePro(atlas01, particle_icecrystal, (Rectangle){ snowStormParticle.particle[i].position.x, snowStormParticle.particle[i].position.y, particle_icecrystal.width*snowStormParticle.particle[i].size, particle_icecrystal.height*snowStormParticle.particle[i].size }, (Vector2){ particle_icecrystal.width*snowStormParticle.particle[i].size/2, particle_icecrystal.height*snowStormParticle.particle[i].size/2 }, snowStormParticle.particle[i].rotation, @@ -969,8 +967,7 @@ void DrawTitleScreen(void) for (int i = 0; i < 20; i++) { - - if (rayparticle.particle[i].active) DrawTexturePro(atlas01, gameplay_fx_lightraymid, + if (rayparticle.particle[i].active) DrawTexturePro(atlas01, gameplay_fx_lightraymid, (Rectangle){ rayparticle.particle[i].position.x, rayparticle.particle[i].position.y, gameplay_fx_lightraymid.width*rayparticle.particle[i].size, gameplay_fx_lightraymid.height*rayparticle.particle[i].size }, (Vector2){ gameplay_fx_lightraymid.width*rayparticle.particle[i].size/2, gameplay_fx_lightraymid.height*rayparticle.particle[i].size/2 }, rayparticle.particle[i].rotation, Fade(rayparticle.particle[i].color, rayparticle.particle[i].alpha)); @@ -987,6 +984,8 @@ void DrawTitleScreen(void) if (musicActive)DrawTexturePro(atlas01, title_speaker_on, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_on.width, title_speaker_on.height}, (Vector2){0,0}, 0, WHITE); else DrawTexturePro(atlas01, title_speaker_off, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_off.width, title_speaker_off.height}, (Vector2){0,0}, 0, WHITE); */ + + DrawParallaxFront(); } // Title Screen Unload logic @@ -1004,7 +1003,10 @@ int FinishTitleScreen(void) static void DrawParallaxFront(void) { Rectangle ground01 = gameplay_back_ground01; + + DrawTexturePro(atlas02, gameplay_back_tree01_layer01, (Rectangle){0, 0, gameplay_back_tree01_layer01.width*2, gameplay_back_tree01_layer01.height*2}, (Vector2){0,0}, 0, WHITE); + /* //DrawTexturePro(atlas02, gameplay_back_tree01_layer03, (Rectangle){0, 21, gameplay_back_tree01_layer03.width*2, gameplay_back_tree01_layer03.height*2}, (Vector2){0,0}, 0, color02); DrawTexturePro(atlas02, gameplay_back_tree01_layer01, (Rectangle){(int)parallaxFrontOffset, 60, gameplay_back_tree01_layer01.width*2, gameplay_back_tree01_layer01.height*2}, (Vector2){0,0}, 0, color02); DrawTexturePro(atlas02, gameplay_back_tree02_layer01, (Rectangle){(int)parallaxFrontOffset + 140, 60, gameplay_back_tree02_layer01.width*2, gameplay_back_tree02_layer01.height*2}, (Vector2){0,0}, 0, color02); @@ -1016,7 +1018,8 @@ static void DrawParallaxFront(void) DrawTexturePro(atlas02, gameplay_back_tree08_layer01, (Rectangle){(int)parallaxFrontOffset + 140*7, 60, gameplay_back_tree08_layer01.width*2, gameplay_back_tree08_layer01.height*2}, (Vector2){0,0}, 0, color02); DrawTexturePro(atlas02, gameplay_back_ground01, (Rectangle){0, 559, ground01.width*2, ground01.height*2}, (Vector2){0,0}, 0, color01); DrawTexturePro(atlas02, (Rectangle){ground01.x, ground01.y + ground01.height, ground01.width, -ground01.height}, (Rectangle){0, -33, ground01.width*2, ground01.height*2}, (Vector2){0,0}, 0, color01); - } + */ +} static void DrawParallaxMiddle(void) {