// ---------------------------------------------------------------------------
// Project Name : Nook
// File Name : LevelSelect.c
// Author : Mary Khuu
// Creation Date : 19 Mar 2021
// Purpose : Level Select
//
// All content © 2021 DigiPen (USA) Corporation, all rights reserved.
// ---------------------------------------------------------------------------
#include "framework.h"
#include "AEEngine.h"
#include "Audio.h"
#include "GameStateManager.h"
#include "Sprite.h"
#include "object_data.h"
#include "LevelSelect.h"
//------------------------------------------------------------------------------
// Private Constants:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Private Structures:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Public Variables:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Private Variables:
//------------------------------------------------------------------------------
static vec2 backgroundSize = { 1670.0f, 564.0f };
static vec2 buttonSize = { 100.0f, 30.0f };
static vec2 textSize = { 150.0f, 50.0f };
static vec2 iconSize = { 30.0f, 30.0f };
static vec2 menuPos = { 0.0f, 200.0f };
static vec2 tutorialPos = { 0.0f, 100.0f };
static vec2 level1Pos = { 0.0f, 0.0f };
static vec2 level2Pos = { 0.0f, -100.0f };
static vec2 level3Pos = { 0.0f, -200.0f };
static signed long mouseX, mouseY;
static float mouseInWorldX, mouseInWorldY;
static AEGfxVertexList* bgMesh;
static AEGfxVertexList* buttonMesh;
static AEGfxVertexList* fontMesh;
static AEGfxVertexList* iconMesh;
static AEGfxVertexList* numMesh;
static AEGfxTexture* bgTexture;
static AEGfxTexture* buttonTexture;
static AEGfxTexture* fontTexture;
static AEGfxTexture* iconTexture;
static AEGfxTexture* numTexture;
static TextureOffset numOffsets[10];
static TextureOffset fontOffsets[30];
static int* currentfontOffset = 0;
static int currfontFrame = 0;
static float* fontTime;
//------------------------------------------------------------------------------
// Private Function Declarations:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Public Functions:
//------------------------------------------------------------------------------
void LevelSelectLoad()
{
/*mesh for bg*/
AEGfxMeshStart();
AEGfxTriAdd(
-backgroundSize.x, -backgroundSize.y, 0xFF00FF00, 0.0f, 1.0f,
backgroundSize.x, -backgroundSize.y, 0xFF00FF00, 1.0f, 1.0f,
-backgroundSize.x, backgroundSize.y, 0xFF00FF00, 0.0f, 0.0f);
AEGfxTriAdd(
backgroundSize.x, -backgroundSize.y, 0xFF00FF00, 1.0f, 1.0f,
backgroundSize.x, backgroundSize.y, 0xFF00FF00, 1.0f, 0.0f,
-backgroundSize.x, backgroundSize.y, 0xFF00FF00, 0.0f, 0.0f);
bgMesh = AEGfxMeshEnd();
AE_ASSERT_MESG(bgMesh, "Failed to create button!");
bgTexture = AEGfxTextureLoad("Assets/CityscapeGrey.png");
AE_ASSERT_MESG(bgTexture, "Failed to create pTex!!");
/*mesh for buttons: green*/
AEGfxMeshStart();
AEGfxTriAdd(
-buttonSize.x, -buttonSize.y, 0xFF00FF00, 0.0f, 1.0f,
buttonSize.x, -buttonSize.y, 0xFF00FF00, 1.0f, 1.0f,
-buttonSize.x, buttonSize.y, 0xFF00FF00, 0.0f, 0.0f);
AEGfxTriAdd(
buttonSize.x, -buttonSize.y, 0xFF00FF00, 1.0f, 1.0f,
buttonSize.x, buttonSize.y, 0xFF00FF00, 1.0f, 0.0f,
-buttonSize.x, buttonSize.y, 0xFF00FF00, 0.0f, 0.0f);
buttonMesh = AEGfxMeshEnd();
AE_ASSERT_MESG(buttonMesh, "Failed to create button!");
buttonTexture = AEGfxTextureLoad("Assets/NookButtonBright.png");
AE_ASSERT_MESG(buttonTexture, "Failed to create texture!");
/*mesh for hover icon*/
iconMesh = createQuadMesh(iconSize.x, iconSize.y, 1.0f, 1.0f, "yarn");
iconTexture = AEGfxTextureLoad("Assets/TempHover.png");
AE_ASSERT_MESG(iconTexture, "Failed to create texture!");
/*mesh for text*/
fontMesh = createQuadMesh(15.0f, 15.0f, 1.0 / 5, 1.0f / 6, "alphabets");
fontTexture = AEGfxTextureLoad("Assets/NookFontSheet_alphabet.png");
AE_ASSERT_MESG(fontTexture, "Failed to create texture!");
fontOffsets[0].mX = 0.0f; fontOffsets[0].mY = 0.0f / 6; //A
fontOffsets[1].mX = 1.0f / 5; fontOffsets[1].mY = 0.0f / 6; //B
fontOffsets[2].mX = 2.0f / 5; fontOffsets[2].mY = 0.0f / 6; //C
fontOffsets[3].mX = 3.0f / 5; fontOffsets[3].mY = 0.0f / 6; //D
fontOffsets[4].mX = 4.0f / 5; fontOffsets[4].mY = 0.0f / 6; //E
fontOffsets[5].mX = 0.0f; fontOffsets[5].mY = 1.0f / 6; //F
fontOffsets[6].mX = 1.0f / 5; fontOffsets[6].mY = 1.0f / 6; //G
fontOffsets[7].mX = 2.0f / 5; fontOffsets[7].mY = 1.0f / 6; //H
fontOffsets[8].mX = 3.0f / 5; fontOffsets[8].mY = 1.0f / 6; //I
fontOffsets[9].mX = 4.0f / 5; fontOffsets[9].mY = 1.0f / 6; //J
fontOffsets[10].mX = 0.0f; fontOffsets[10].mY = 2.0f / 6; //K
fontOffsets[11].mX = 1.0f / 5; fontOffsets[11].mY = 2.0f / 6; //L
fontOffsets[12].mX = 2.0f / 5; fontOffsets[12].mY = 2.0f / 6; //M
fontOffsets[13].mX = 3.0f / 5; fontOffsets[13].mY = 2.0f / 6; //N
fontOffsets[14].mX = 4.0f / 5; fontOffsets[14].mY = 2.0f / 6; //O
fontOffsets[15].mX = 0.0f; fontOffsets[15].mY = 3.0f / 6; //P
fontOffsets[16].mX = 1.0f / 5; fontOffsets[16].mY = 3.0f / 6; //Q
fontOffsets[17].mX = 2.0f / 5; fontOffsets[17].mY = 3.0f / 6; //R
fontOffsets[18].mX = 3.0f / 5; fontOffsets[18].mY = 3.0f / 6; //S
fontOffsets[19].mX = 4.0f / 5; fontOffsets[19].mY = 3.0f / 6; //T
fontOffsets[20].mX = 0.0f; fontOffsets[20].mY = 4.0f / 6; //U
fontOffsets[21].mX = 1.0f / 5; fontOffsets[21].mY = 4.0f / 6; //V
fontOffsets[22].mX = 2.0f / 5; fontOffsets[22].mY = 4.0f / 6; //W
fontOffsets[23].mX = 3.0f / 5; fontOffsets[23].mY = 4.0f / 6; //X
fontOffsets[24].mX = 4.0f / 5; fontOffsets[24].mY = 4.0f / 6; //Y
fontOffsets[25].mX = 0.0f; fontOffsets[25].mY = 5.0f / 6; //Z
fontOffsets[26].mX = 1.0f / 5; fontOffsets[26].mY = 5.0f / 6; //blank (1)
fontOffsets[27].mX = 2.0f / 5; fontOffsets[27].mY = 5.0f / 6; //blank (2)
fontOffsets[28].mX = 3.0f / 5; fontOffsets[28].mY = 5.0f / 6; //blank (3)
fontOffsets[29].mX = 4.0f / 5; fontOffsets[29].mY = 5.0f / 6; //blank (4)
/*mesh for numbers*/
numMesh = createQuadMesh(15.0f, 15.0f, 1.0 / 3, 1.0f / 4, "numbers");
numTexture = AEGfxTextureLoad("Assets/NookFontSheet_numbers.png");
AE_ASSERT_MESG(numTexture, "Failed to create texture!");
numOffsets[0].mX = 0.0f; numOffsets[0].mY = 0.0f / 4; //0
numOffsets[1].mX = 1.0f / 3; numOffsets[1].mY = 0.0f / 4; //1
numOffsets[2].mX = 2.0f / 3; numOffsets[2].mY = 0.0f / 4; //2
numOffsets[3].mX = 0.0f; numOffsets[3].mY = 1.0f / 4; //3
numOffsets[4].mX = 1.0f / 3; numOffsets[4].mY = 1.0f / 4; //4
numOffsets[5].mX = 2.0f / 3; numOffsets[5].mY = 1.0f / 4; //5
numOffsets[6].mX = 0.0f; numOffsets[6].mY = 2.0f / 4; //6
numOffsets[7].mX = 1.0f / 3; numOffsets[7].mY = 2.0f / 4; //7
numOffsets[8].mX = 2.0f / 3; numOffsets[8].mY = 2.0f / 4; //8
numOffsets[9].mX = 0.0f / 3; numOffsets[9].mY = 3.0f / 4; //9
}
void LevelSelectInit()
{
AEGfxSetBackgroundColor(1.0f, 1.0f, 1.0f);
AEGfxSetBlendMode(AE_GFX_BM_BLEND);
}
void LevelSelectUpdate(float dt)
{
/* Tell the compiler that the 'dt' variable is unused. */
UNREFERENCED_PARAMETER(dt);
/*draw background*/
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxTextureSet(bgTexture, 0, 0);
AEGfxSetTransparency(1.0f);
AEGfxSetPosition(-250.0f, 0.0f);
AEGfxMeshDraw(bgMesh, AE_GFX_MDM_TRIANGLES);
//draw menu button
AEGfxSetPosition(menuPos.x, menuPos.y);
AEGfxTextureSet(buttonTexture, 0, 0); // no texture
AEGfxMeshDraw(buttonMesh, AE_GFX_MDM_TRIANGLES);
//draw tutorial button
AEGfxSetPosition(tutorialPos.x, tutorialPos.y);
AEGfxTextureSet(buttonTexture, 0, 0); // no texture
AEGfxMeshDraw(buttonMesh, AE_GFX_MDM_TRIANGLES);
//draw level1 button
AEGfxSetPosition(level1Pos.x, level1Pos.y);
AEGfxTextureSet(buttonTexture, 0, 0); // no texture
AEGfxMeshDraw(buttonMesh, AE_GFX_MDM_TRIANGLES);
//draw level2 button
AEGfxSetPosition(level2Pos.x, level2Pos.y);
AEGfxTextureSet(buttonTexture, 0, 0); // no texture
AEGfxMeshDraw(buttonMesh, AE_GFX_MDM_TRIANGLES);
//draw level3 button
AEGfxSetPosition(level3Pos.x, level3Pos.y);
AEGfxTextureSet(buttonTexture, 0, 0); // no texture
AEGfxMeshDraw(buttonMesh, AE_GFX_MDM_TRIANGLES);
/*MENU*/
AEGfxSetPosition(menuPos.x - 45.0f, menuPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[12].mX, fontOffsets[12].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(menuPos.x - 13.0f, menuPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(menuPos.x + 15.0f, menuPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[13].mX, fontOffsets[13].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(menuPos.x + 45.0f, menuPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[20].mX, fontOffsets[20].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
/*MENU - end*/
/*TUTORIAL*/
AEGfxSetPosition(tutorialPos.x - 86.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[19].mX, fontOffsets[19].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x - 58.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[20].mX, fontOffsets[20].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x - 30.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[19].mX, fontOffsets[19].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[14].mX, fontOffsets[14].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x + 30.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[17].mX, fontOffsets[17].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x + 46.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[8].mX, fontOffsets[8].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x + 65.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[0].mX, fontOffsets[0].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(tutorialPos.x + 90.0f, tutorialPos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
/*TUTORIAL - end*/
/*LEVEL 1*/
AEGfxSetPosition(level1Pos.x - 85.0f, level1Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level1Pos.x - 60.0f, level1Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level1Pos.x - 34.0f, level1Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[21].mX, fontOffsets[21].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level1Pos.x - 5.0f, level1Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level1Pos.x + 17.5f, level1Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level1Pos.x + 85.0f, level1Pos.y);
AEGfxTextureSet(numTexture, numOffsets[1].mX, numOffsets[1].mY, 0.0f); // 1
AEGfxMeshDraw(numMesh, AE_GFX_MDM_TRIANGLES);
/*LEVEL 1 - end*/
/*LEVEL 2*/
AEGfxSetPosition(level2Pos.x - 85.0f, level2Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level2Pos.x - 60.0f, level2Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level2Pos.x - 34.0f, level2Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[21].mX, fontOffsets[21].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level2Pos.x - 5.0f, level2Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level2Pos.x + 17.5f, level2Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level2Pos.x + 85.0f, level2Pos.y);
AEGfxTextureSet(numTexture, numOffsets[2].mX, numOffsets[2].mY, 0.0f); // 2
AEGfxMeshDraw(numMesh, AE_GFX_MDM_TRIANGLES);
/*LEVEL 2 - end*/
/*LEVEL 3*/
AEGfxSetPosition(level3Pos.x - 85.0f, level3Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level3Pos.x - 60.0f, level3Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level3Pos.x - 34.0f, level3Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[21].mX, fontOffsets[21].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level3Pos.x - 5.0f, level3Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[4].mX, fontOffsets[4].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level3Pos.x + 17.5f, level3Pos.y);
AEGfxTextureSet(fontTexture, fontOffsets[11].mX, fontOffsets[11].mY, 0.0f);
AEGfxMeshDraw(fontMesh, AE_GFX_MDM_TRIANGLES);
AEGfxSetPosition(level3Pos.x + 85.0f, level3Pos.y);
AEGfxTextureSet(numTexture, numOffsets[3].mX, numOffsets[3].mY, 0.0f); // 3
AEGfxMeshDraw(numMesh, AE_GFX_MDM_TRIANGLES);
/*LEVEL 3 - end*/
/*get the mouse position*/
AEInputGetCursorPosition(&mouseX, &mouseY);
AEGfxConvertScreenCoordinatesToWorld(mouseX, mouseY, &mouseInWorldX, &mouseInWorldY);
/*if menu is hovered*/
if ((mouseInWorldX > (menuPos.x - buttonSize.x) && mouseInWorldX < (menuPos.x + buttonSize.x)) &&
(mouseInWorldY > (menuPos.y - buttonSize.y) && mouseInWorldY < (menuPos.y + buttonSize.y)))
{
// Hover texture
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxSetPosition(menuPos.x - 140.0f, menuPos.y);
AEGfxTextureSet(iconTexture, 0.0f, 0.0f);
AEGfxMeshDraw(iconMesh, AE_GFX_MDM_TRIANGLES);
if (AEInputCheckTriggered(RI_MOUSE_LEFT_BUTTON_DOWN))
{
GameStateManagerSetNextState(Menu);
}
}
/*if tutorial is hovered*/
if ((mouseInWorldX > (tutorialPos.x - buttonSize.x) && mouseInWorldX < (tutorialPos.x + buttonSize.x)) &&
(mouseInWorldY > (tutorialPos.y - buttonSize.y) && mouseInWorldY < (tutorialPos.y + buttonSize.y)))
{
// Hover texture
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxSetPosition(tutorialPos.x - 140.0f, tutorialPos.y);
AEGfxTextureSet(iconTexture, 0.0f, 0.0f);
AEGfxMeshDraw(iconMesh, AE_GFX_MDM_TRIANGLES);
if (AEInputCheckTriggered(RI_MOUSE_LEFT_BUTTON_DOWN))
{
GameStateManagerSetNextState(Tutorial);
}
}
/*if level1 is hovered*/
if ((mouseInWorldX > (level1Pos.x - buttonSize.x) && mouseInWorldX < (level1Pos.x + buttonSize.x)) &&
(mouseInWorldY > (level1Pos.y - buttonSize.y) && mouseInWorldY < (level1Pos.y + buttonSize.y)))
{
// Hover texture
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxSetPosition(level1Pos.x - 140.0f, level1Pos.y);
AEGfxTextureSet(iconTexture, 0.0f, 0.0f);
AEGfxMeshDraw(iconMesh, AE_GFX_MDM_TRIANGLES);
if (AEInputCheckTriggered(RI_MOUSE_LEFT_BUTTON_DOWN))
{
GameStateManagerSetNextState(Demo);
}
}
/*if level2 is hovered*/
if ((mouseInWorldX > (level2Pos.x - buttonSize.x) && mouseInWorldX < (level2Pos.x + buttonSize.x)) &&
(mouseInWorldY > (level2Pos.y - buttonSize.y) && mouseInWorldY < (level2Pos.y + buttonSize.y)))
{
// Hover texture
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxSetPosition(level2Pos.x - 140.0f, level2Pos.y);
AEGfxTextureSet(iconTexture, 0.0f, 0.0f);
AEGfxMeshDraw(iconMesh, AE_GFX_MDM_TRIANGLES);
if (AEInputCheckTriggered(RI_MOUSE_LEFT_BUTTON_DOWN))
{
GameStateManagerSetNextState(Level2);
}
}
/*if level3 is hovered*/
if ((mouseInWorldX > (level3Pos.x - buttonSize.x) && mouseInWorldX < (level3Pos.x + buttonSize.x)) &&
(mouseInWorldY > (level3Pos.y - buttonSize.y) && mouseInWorldY < (level3Pos.y + buttonSize.y)))
{
// Hover texture
AEGfxSetRenderMode(AE_GFX_RM_TEXTURE);
AEGfxSetPosition(level3Pos.x - 140.0f, level3Pos.y);
AEGfxTextureSet(iconTexture, 0.0f, 0.0f);
AEGfxMeshDraw(iconMesh, AE_GFX_MDM_TRIANGLES);
if (AEInputCheckTriggered(RI_MOUSE_LEFT_BUTTON_DOWN))
{
GameStateManagerSetNextState(Level3);
}
}
}
void LevelSelectShutdown()
{
AudioCleanup();
}
void LevelSelectUnload()
{
// Unload all textures.
AEGfxTextureUnload(buttonTexture);
AEGfxTextureUnload(fontTexture);
AEGfxTextureUnload(bgTexture);
AEGfxTextureUnload(iconTexture);
AEGfxTextureUnload(numTexture);
// Free all meshes.
AEGfxMeshFree(buttonMesh);
AEGfxMeshFree(fontMesh);
AEGfxMeshFree(bgMesh);
AEGfxMeshFree(iconMesh);
AEGfxMeshFree(numMesh);
}
//------------------------------------------------------------------------------
// Private Functions:
//------------------------------------------------------------------------------