Fixing all other macros by adding RL_ prefix.

This commit is contained in:
Marco Lizza 2018-12-20 16:15:55 +01:00
commit b6cb51e3e8
4 changed files with 1821 additions and 1821 deletions

View file

@ -72,26 +72,26 @@ void UpdateEndingScreen(void)
// Ending Screen Draw logic
void DrawEndingScreen(void)
{
DrawTexture(texBackground, 0, 0, WHITE);
DrawTexture(texBackground, 0, 0, RL_WHITE);
if (endingStatus == 1) // Win
{
DrawTexture(texWin, GetScreenWidth()/2 - texWin.width/2, 90, WHITE);
DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.baseSize, 0, WHITE);
DrawTexture(texWin, GetScreenWidth()/2 - texWin.width/2, 90, RL_WHITE);
DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.baseSize, 0, RL_WHITE);
}
else if (endingStatus == 2) // Lose
{
DrawTexture(texLose, GetScreenWidth()/2 - texWin.width/2, 90, WHITE);
DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.baseSize, 0, WHITE);
DrawTexture(texLose, GetScreenWidth()/2 - texWin.width/2, 90, RL_WHITE);
DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.baseSize, 0, RL_WHITE);
}
DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RAYWHITE, 0.8f));
DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, DARKBLUE);
DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RL_RAYWHITE, 0.8f));
DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, RL_DARKBLUE);
DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY);
DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE);
DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, RL_DARKGRAY);
DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, RL_WHITE);
if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.baseSize, 0, SKYBLUE);
if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.baseSize, 0, RL_SKYBLUE);
}
// Ending Screen Unload logic

View file

@ -142,7 +142,7 @@ void InitGameplayScreen(void)
player.width = 20;
player.height = 60;
player.speed = (Vector2){ 15, 15 };
player.color = GOLD;
player.color = RL_GOLD;
player.position = (Vector2){ playerArea.x + playerArea.width/2 - texPlayer.width/2,
playerArea.y + playerArea.height/2 - texPlayer.height/2 };
@ -199,7 +199,7 @@ void InitGameplayScreen(void)
samples[i].radius = 6;
samples[i].active = true;
samples[i].collected = false;
samples[i].color = RED;
samples[i].color = RL_RED;
samples[i].renderable = false;
}
@ -351,12 +351,12 @@ void UpdateGameplayScreen(void)
void DrawGameplayScreen(void)
{
// Draw background
DrawTexture(texBackground, 0, 0, WHITE);
DrawTexture(texBackground, 0, 0, RL_WHITE);
// Screen elements drawing
//DrawRectangleLines(playerArea.x, playerArea.y, playerArea.width, playerArea.height, BLUE);
DrawRectangle(0, GetScreenHeight()/2 - 1, GetScreenWidth(), 2, Fade(BLUE, 0.3f));
//DrawRectangleLines(0, GetScreenHeight()/2 - MAX_GAME_HEIGHT/2, GetScreenWidth(), MAX_GAME_HEIGHT, GRAY);
//DrawRectangleLines(playerArea.x, playerArea.y, playerArea.width, playerArea.height, RL_BLUE);
DrawRectangle(0, GetScreenHeight()/2 - 1, GetScreenWidth(), 2, Fade(RL_BLUE, 0.3f));
//DrawRectangleLines(0, GetScreenHeight()/2 - MAX_GAME_HEIGHT/2, GetScreenWidth(), MAX_GAME_HEIGHT, RL_GRAY);
// Draw samples
for (int i = 0; i < totalSamples - 1; i++)
@ -365,8 +365,8 @@ void DrawGameplayScreen(void)
{
Color col = samples[i].color;
if (i < (currentSample + 1)) col = Fade(DARKGRAY, 0.5f);
else col = WHITE;
if (i < (currentSample + 1)) col = Fade(RL_DARKGRAY, 0.5f);
else col = RL_WHITE;
if (!samples[i].collected)
{
@ -377,8 +377,8 @@ void DrawGameplayScreen(void)
else DrawTexture(texSampleBig, samples[i].position.x - texSampleBig.width/2, samples[i].position.y - texSampleBig.height/2, col);
}
if (i < (currentSample + 1)) col = Fade(GRAY, 0.3f);
else col = Fade(RED, 0.5f);
if (i < (currentSample + 1)) col = Fade(RL_GRAY, 0.3f);
else col = Fade(RL_RED, 0.5f);
// Draw line between samples
DrawLineEx(samples[i].position, samples[i + 1].position, 3.0f, col);
@ -387,58 +387,58 @@ void DrawGameplayScreen(void)
// Draw player
//DrawRectangle((int)player.position.x, (int)player.position.y, player.width, player.height, player.color);
DrawTexture(texPlayer, player.position.x - 32, player.position.y - 24, WHITE);
DrawTexture(texPlayer, player.position.x - 32, player.position.y - 24, RL_WHITE);
// Draw pause message
if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.baseSize*2, 0, WHITE);
if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.baseSize*2, 0, RL_WHITE);
// Draw number of samples
//DrawText(FormatText("%05i", collectedSamples), 900, 200, 40, GRAY);
//DrawText(FormatText("%05i", totalSamples), 900, 250, 40, GRAY);
DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.baseSize, -2, SKYBLUE);
//DrawText(FormatText("%05i", collectedSamples), 900, 200, 40, RL_GRAY);
//DrawText(FormatText("%05i", totalSamples), 900, 250, 40, RL_GRAY);
DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.baseSize, -2, RL_SKYBLUE);
// Draw combo
DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.baseSize/2, -2, SKYBLUE);
DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.baseSize/2, -2, RL_SKYBLUE);
// Draw synchonicity level
DrawRectangle(99, 622, 395, 32, Fade(RAYWHITE, 0.8f));
DrawRectangle(99, 622, 395, 32, Fade(RL_RAYWHITE, 0.8f));
if (synchro <= 0.3f) DrawRectangle(99, 622, synchro*395, 32, Fade(RED, 0.8f));
else if (synchro <= 0.8f) DrawRectangle(99, 622, synchro*395, 32, Fade(ORANGE,0.8f));
else if (synchro < 1.0f) DrawRectangle(99, 622, synchro*395, 32, Fade(LIME,0.8f));
else DrawRectangle(99, 622, synchro*395, 32, Fade(GREEN, 0.9f));
if (synchro <= 0.3f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_RED, 0.8f));
else if (synchro <= 0.8f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_ORANGE,0.8f));
else if (synchro < 1.0f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_LIME,0.8f));
else DrawRectangle(99, 622, synchro*395, 32, Fade(RL_GREEN, 0.9f));
DrawRectangleLines(99, 622, 395, 32, MAROON);
DrawRectangleLines(99, 622, 395, 32, RL_MAROON);
if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, GREEN);
else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, SKYBLUE);
if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, RL_GREEN);
else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, RL_SKYBLUE);
// Draw time warp coool-down bar
DrawRectangle(754, 622, 395, 32, Fade(RAYWHITE, 0.8f));
DrawRectangle(754, 622, warpCounter, 32, Fade(SKYBLUE, 0.8f));
DrawRectangleLines(754, 622, 395, 32, DARKGRAY);
//DrawText(FormatText("%02i%%", (int)(synchro*100)), 754 + 410, 628, 20, DARKGRAY);
DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.baseSize, -2, SKYBLUE);
DrawRectangle(754, 622, 395, 32, Fade(RL_RAYWHITE, 0.8f));
DrawRectangle(754, 622, warpCounter, 32, Fade(RL_SKYBLUE, 0.8f));
DrawRectangleLines(754, 622, 395, 32, RL_DARKGRAY);
//DrawText(FormatText("%02i%%", (int)(synchro*100)), 754 + 410, 628, 20, RL_DARKGRAY);
DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.baseSize, -2, RL_SKYBLUE);
// Draw wave
if (waveTarget.texture.id <= 0) // Render target could not be loaded (OpenGL 1.1)
{
// Draw wave directly on screen
DrawSamplesMap(samples, totalSamples, currentSample, waveRec, MAROON);
DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, DARKGRAY);
DrawSamplesMap(samples, totalSamples, currentSample, waveRec, RL_MAROON);
DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, RL_DARKGRAY);
}
else
{
// Draw wave using render target
BeginTextureMode(waveTarget);
ClearBackground(BLANK);
DrawSamplesMap(samples, totalSamples, currentSample, (Rectangle){ 0, 0, waveTarget.texture.width, waveTarget.texture.height }, MAROON);
ClearBackground(RL_BLANK);
DrawSamplesMap(samples, totalSamples, currentSample, (Rectangle){ 0, 0, waveTarget.texture.width, waveTarget.texture.height }, RL_MAROON);
EndTextureMode();
// TODO: Apply antialiasing shader
DrawTextureEx(waveTarget.texture, (Vector2){ waveRec.x, waveRec.y }, 0.0f, 1.0f, WHITE);
DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, DARKGRAY);
DrawTextureEx(waveTarget.texture, (Vector2){ waveRec.x, waveRec.y }, 0.0f, 1.0f, RL_WHITE);
DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, RL_DARKGRAY);
}
}
@ -487,7 +487,7 @@ static void DrawSamplesMap(Sample *samples, int sampleCount, int playedSamples,
for (int i = 0; i < sampleCount - 1; i++)
{
if (i < playedSamples) col = GRAY;
if (i < playedSamples) col = RL_GRAY;
else col = color;
DrawLineV((Vector2){ (float)bounds.x + (float)i*sampleIncrementX, (float)(bounds.y + bounds.height/2) + samples[i].value*bounds.height },

View file

@ -137,34 +137,34 @@ void DrawLogoScreen(void)
{
if (state == 0)
{
if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK);
if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK);
}
else if (state == 1)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK);
}
else if (state == 2)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK);
DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK);
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK);
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK);
}
else if (state == 3)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha));
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha));
DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha));
DrawText(SubText("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha));
DrawText(SubText("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha));
if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(DARKGRAY, alpha));
if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(RL_DARKGRAY, alpha));
}
}

View file

@ -82,16 +82,16 @@ void UpdateTitleScreen(void)
// Title Screen Draw logic
void DrawTitleScreen(void)
{
DrawTexture(texBackground, 0, 0, WHITE);
DrawTexture(texTitle, GetScreenWidth()/2 - texTitle.width/2, -25, Fade(WHITE, titleAlpha));
DrawTexture(texBackground, 0, 0, RL_WHITE);
DrawTexture(texTitle, GetScreenWidth()/2 - texTitle.width/2, -25, Fade(RL_WHITE, titleAlpha));
DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RAYWHITE, 0.8f));
DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, DARKBLUE);
DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RL_RAYWHITE, 0.8f));
DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, RL_DARKBLUE);
DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY);
DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE);
DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, RL_DARKGRAY);
DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, RL_WHITE);
if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.baseSize, 0, SKYBLUE);
if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.baseSize, 0, RL_SKYBLUE);
}
// Title Screen Unload logic