diff --git a/Engine.c b/Engine.c index 5803bb6..75365f6 100644 --- a/Engine.c +++ b/Engine.c @@ -92,6 +92,16 @@ void renderForeground() drawFgObjects2(rightHere); } +void renderHUD() +{ + SDL_Rect clip; + clip.x = bookMark*16;; + clip.y = 0; + clip.w = 16; + clip.h = 16; + applySurface(300,160, spellGlyphs, screen, &clip); +} + void interact() { while(SDL_PollEvent(&event)) @@ -258,6 +268,8 @@ int init(int argc, char* args[]) nextArrow = loadImage("assets/img/windows/nextButton.gif"); selectArrow = loadImage("assets/img/windows/selectArrow.gif"); loadingTxt = TTF_RenderText_Solid(font, "loading map data...", textColor); + spellGlyphs = loadImage("assets/img/hud/spellbook.png"); + SDL_SetAlpha(spellGlyphs, SDL_SRCALPHA|SDL_RLEACCEL, 156); hero = newPlayer("assets/img/characters/kmage.png", 160, 90); diff --git a/Engine.h b/Engine.h index f083e8d..f6eaf82 100644 --- a/Engine.h +++ b/Engine.h @@ -18,6 +18,8 @@ void renderBackground(); void renderForeground(); +void renderHUD(); + void interact(); void kListen(); diff --git a/assets/img/hud/spellbook.png b/assets/img/hud/spellbook.png new file mode 100644 index 0000000..7cd1298 Binary files /dev/null and b/assets/img/hud/spellbook.png differ diff --git a/config.h b/config.h index 53503fb..999cd0b 100644 --- a/config.h +++ b/config.h @@ -14,4 +14,4 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 180 -#define SOUND_ON +//#define SOUND_ON diff --git a/extern.h b/extern.h index f71ce3b..6f3f0bd 100644 --- a/extern.h +++ b/extern.h @@ -28,6 +28,7 @@ extern SDL_Surface* choiceBox; extern SDL_Surface* nextArrow; extern SDL_Surface* selectArrow; extern SDL_Surface* loadingTxt; +extern SDL_Surface* spellGlyphs; #ifdef SOUND_ON extern Mix_Music* menuBGM; diff --git a/main.c b/main.c index 47962da..86ade44 100644 --- a/main.c +++ b/main.c @@ -41,6 +41,7 @@ SDL_Surface* choiceBox = NULL; SDL_Surface* nextArrow = NULL; SDL_Surface* selectArrow = NULL; SDL_Surface* loadingTxt = NULL; +SDL_Surface* spellGlyphs = NULL; TTF_Font* font = NULL; SDL_Color textColor = {255, 255, 255}; @@ -89,6 +90,7 @@ int main (int argc, char* args[]) movePlayer(hero, rightHere); renderBackground(); renderForeground(); + renderHUD(); SDL_Flip(screen); kListen(&kaosFlag); pager();