-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Barebones, but functional.
- Loading branch information
TheWindowsPro98
committed
Sep 17, 2023
1 parent
dc25080
commit b2c6f91
Showing
14 changed files
with
194 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
project(project_daisy LANGUAGES CXX VERSION 0.0.1.0) | ||
link_libraries(sfml-window sfml-graphics sfml-audio sfml-system) | ||
add_executable(project_daisy main.cxx version.cxx resources.cxx prefs.cxx utils.cxx structs.cxx title.cxx) | ||
add_executable(project_daisy main.cxx version.cxx resources.cxx prefs.cxx utils.cxx structs.cxx title.cxx jukebox.cxx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Sonic Advance 2 - Character Select Theme: Tatsuyuki Maeda, Yutaka Minobe, Teruhiko Nakagawa, Hironobu Inagaki, Atsuyoshi Isemura (temporary) | ||
Sonic Advance 2 - Zone Select Theme: Tatsuyuki Maeda, Yutaka Minobe, Teruhiko Nakagawa, Hironobu Inagaki, Atsuyoshi Isemura (temporary) | ||
Sonic the Hedgehog 3 - Angel Island Zone (Act 2): Jun Senoue, Tetsuyuki Maeda, Masaru Setsumaru, Tomonori Sawada, Masayuki Nagao, Sachio Ogawa, Howard Drossin (temporary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include "includes.hxx" | ||
|
||
void jukebox(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#include "inc/includes.hxx" | ||
|
||
const u8 sndAmnt = 7; | ||
const u8 musX = 0; | ||
const u8 musY = 0; | ||
const u8 musTitleXDelta = 5; | ||
const u8 musAlbumXDelta = 5; | ||
const u8 musArtistXDelta = 6; | ||
const structs::SndMData musHdr[] = | ||
{ | ||
{testTrack,"Test Track","Game","TheWindowsPro98",true,false}, | ||
{lvlClearTrack,"Act Complete","Game","TheWindowsPro98",false,false}, | ||
{titleTrack,"Character Select","Sonic Advance","Tatsuyuki Maeda, Yutaka Minobe, Teruhiko Nakagawa",true,false}, | ||
{lfTrack,"Angel Island Zone (Act 2)","Sonic the Hedgehog 3","Unknown Artist",true,false}, | ||
{lsTrack,"Zone Select","Sonic Advance","Tatsuyuki Maeda, Yutaka Minobe, Teruhiko Nakagawa",true,false}, | ||
{hoverSFX,"Menu Hover","Game","TheWindowsPro98",false,true}, | ||
{confSFX,"Menu Select","Game","TheWindowsPro98",false,true} | ||
}; | ||
|
||
void jukebox() | ||
{ | ||
fadeRect.setFillColor(sf::Color::Black); | ||
sf::Text songDrawable(templateText); | ||
songDrawable.setPosition(pixelToTile(musX+musTitleXDelta),pixelToTile(musY)); | ||
sf::Text songAlbumDrawable(templateText); | ||
songAlbumDrawable.setPosition(pixelToTile(musX+musAlbumXDelta),pixelToTile(musY+1)); | ||
sf::Text songArtistDrawable(templateText); | ||
songArtistDrawable.setPosition(pixelToTile(musX+musArtistXDelta),pixelToTile(musY+2)); | ||
sf::Text songLabel(templateText); | ||
songLabel.setString("Title:"); | ||
songLabel.setPosition(pixelToTile(musX),pixelToTile(musY)); | ||
sf::Text songAlbumLabel(templateText); | ||
songAlbumLabel.setString("Album:"); | ||
songAlbumLabel.setPosition(pixelToTile(musX),pixelToTile(musY+1)); | ||
sf::Text songArtistLabel(templateText); | ||
songArtistLabel.setString("Artist:"); | ||
songArtistLabel.setPosition(pixelToTile(musX),pixelToTile(musY+2)); | ||
sf::SoundBuffer sb; | ||
sf::Sound snd; | ||
while(window.isOpen()) | ||
{ | ||
sf::Event e; | ||
songDrawable.setString(musHdr[*menuIndex].songTitle); | ||
songAlbumDrawable.setString(musHdr[*menuIndex].songAlbum); | ||
songArtistDrawable.setString(musHdr[*menuIndex].songArtist); | ||
screenFade(volFadeSpeed*3,true); | ||
window.clear(); | ||
window.draw(songDrawable); | ||
window.draw(songAlbumDrawable); | ||
window.draw(songArtistDrawable); | ||
window.draw(songLabel); | ||
window.draw(songAlbumLabel); | ||
window.draw(songArtistLabel); | ||
window.draw(fadeRect); | ||
window.display(); | ||
while(window.pollEvent(e)) | ||
{ | ||
switch (e.type) | ||
{ | ||
case sf::Event::Closed: | ||
{ | ||
window.close(); | ||
break; | ||
} | ||
case sf::Event::KeyPressed: | ||
{ | ||
if (!window.hasFocus() or fadeRect.getFillColor().a != 0) | ||
{ | ||
break; | ||
} | ||
if (e.key.scancode == sf::Keyboard::Scan::Left) | ||
{ | ||
sndHvr.play(); | ||
if (*menuIndex == 0) | ||
{ | ||
*menuIndex = sndAmnt-1; | ||
} | ||
else | ||
{ | ||
(*menuIndex)--; | ||
} | ||
} | ||
else if (e.key.scancode == sf::Keyboard::Scan::Right) | ||
{ | ||
sndHvr.play(); | ||
if (*menuIndex == sndAmnt-1) | ||
{ | ||
*menuIndex = 0; | ||
} | ||
else | ||
{ | ||
(*menuIndex)++; | ||
} | ||
} | ||
if (e.key.scancode == sf::Keyboard::Scan::Enter) | ||
{ | ||
if (!musHdr[*menuIndex].isSFX) | ||
{ | ||
music.openFromFile(musHdr[*menuIndex].songPath); | ||
music.setLoop(musHdr[*menuIndex].loop); | ||
music.play(); | ||
} | ||
else | ||
{ | ||
sb.loadFromFile(musHdr[*menuIndex].songPath); | ||
snd.setBuffer(sb); | ||
snd.setLoop(musHdr[*menuIndex].loop); | ||
snd.play(); | ||
} | ||
} | ||
else if (e.key.scancode == sf::Keyboard::Scan::Escape) | ||
{ | ||
sndCnf.play(); | ||
} | ||
break; | ||
} | ||
default: | ||
{ | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
namespace structs | ||
{ | ||
Option::~Option(){}; | ||
SndMData::~SndMData(){}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters