Browse Source

Trying to correct drawing issues...

pull/363/head
Ray 7 years ago
parent
commit
b043c5e277
3 changed files with 14 additions and 11 deletions
  1. +1
    -1
      games/koala_seasons/Makefile
  2. +2
    -2
      games/koala_seasons/resources/shaders/glsl330/base.vs
  3. +11
    -8
      games/koala_seasons/screens/screen_title.c

+ 1
- 1
games/koala_seasons/Makefile View File

@ -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)

+ 2
- 2
games/koala_seasons/resources/shaders/glsl330/base.vs View File

@ -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);
}

+ 11
- 8
games/koala_seasons/screens/screen_title.c View File

@ -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();
o">//DrawParallaxBack();
o">//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)
{

Loading…
Cancel
Save