mirror of
https://github.com/dborth/fceugx.git
synced 2024-10-31 22:45:05 +01:00
add sound effects
This commit is contained in:
parent
98ed387f26
commit
78d82f5ebd
@ -4,9 +4,10 @@
|
||||
*
|
||||
* Tantric January 2009
|
||||
*
|
||||
* imagelist.h
|
||||
* filelist.h
|
||||
*
|
||||
* Contains a list of all of the images in the images/ folder
|
||||
* Contains a list of all of the files stored in the images/, fonts/, and
|
||||
* sounds/ folders
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _FILELIST_H_
|
||||
@ -20,9 +21,18 @@ extern const u32 font_ttf_size;
|
||||
extern const u8 bg_music_ogg[];
|
||||
extern const u32 bg_music_ogg_size;
|
||||
|
||||
extern const u8 enter_ogg[];
|
||||
extern const u32 enter_ogg_size;
|
||||
|
||||
extern const u8 exit_ogg[];
|
||||
extern const u32 exit_ogg_size;
|
||||
|
||||
extern const u8 button_over_pcm[];
|
||||
extern const u32 button_over_pcm_size;
|
||||
|
||||
extern const u8 button_click_pcm[];
|
||||
extern const u32 button_click_pcm_size;
|
||||
|
||||
extern const u8 logo_png[];
|
||||
extern const u32 logo_png_size;
|
||||
|
||||
|
@ -530,8 +530,8 @@ InitGCVideo ()
|
||||
// widescreen fix
|
||||
if(CONF_GetAspectRatio())
|
||||
{
|
||||
vmode->viWidth = 678;
|
||||
vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2;
|
||||
vmode->viWidth = VI_MAX_WIDTH_PAL-12;
|
||||
vmode->viXOrigin = ((VI_MAX_WIDTH_PAL - vmode->viWidth) / 2) + 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,16 +1,35 @@
|
||||
/****************************************************************************
|
||||
* FCE Ultra 0.98.12
|
||||
* Nintendo Wii/Gamecube Port
|
||||
/*!\mainpage libwiigui Documentation
|
||||
*
|
||||
* Tantric February 2009
|
||||
* \section Introduction
|
||||
* libwiigui is a GUI library for the Wii, created to help structure the
|
||||
* design of a complicated GUI interface, and to enable an author to create
|
||||
* a sophisticated, feature-rich GUI. It was originally conceived and written
|
||||
* after I started to design a GUI for Snes9x GX, and found libwiisprite and
|
||||
* GRRLIB inadequate for the purpose. It uses GX for drawing, and makes use
|
||||
* of PNGU for displaying images and FreeTypeGX for text. It was designed to
|
||||
* be flexible and is easy to modify - don't be afraid to change the way it
|
||||
* works or expand it to suit your GUI's purposes! If you do, and you think
|
||||
* your changes might benefit others, please share them so they might be
|
||||
* added to the project!
|
||||
*
|
||||
* gui.h
|
||||
*
|
||||
* GUI class definitions
|
||||
***************************************************************************/
|
||||
* \section Quickstart
|
||||
* Start from the supplied template example. For more advanced uses, see the
|
||||
* source code for Snes9x GX, FCE Ultra GX, and Visual Boy Advance GX.
|
||||
|
||||
#ifndef GUI_H
|
||||
#define GUI_H
|
||||
* \section Contact
|
||||
* If you have any suggestions for the library or documentation, or want to
|
||||
* contribute, please visit the libwiigui website:
|
||||
* http://code.google.com/p/libwiigui/
|
||||
|
||||
* \section Credits
|
||||
* This library was wholly designed and written by Tantric. Thanks to the
|
||||
* authors of PNGU and FreeTypeGX, of which this library makes use. Thanks
|
||||
* also to the authors of GRRLIB and libwiisprite for laying the foundations.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LIBWIIGUI_H
|
||||
#define LIBWIIGUI_H
|
||||
|
||||
#include <gccore.h>
|
||||
#include <malloc.h>
|
||||
@ -82,233 +101,478 @@ enum
|
||||
|
||||
extern FreeTypeGX *fontSystem;
|
||||
|
||||
//!Sound conversion and playback. A wrapper for other sound libraries - ASND, libmad, ltremor, etc
|
||||
class GuiSound
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
//!\param s Pointer to the sound data
|
||||
//!\param l Length of sound data
|
||||
//!\param t Sound format type (SOUND_PCM or SOUND_OGG)
|
||||
GuiSound(const u8 * s, int l, int t);
|
||||
//!Destructor
|
||||
~GuiSound();
|
||||
//!Start sound playback
|
||||
void Play();
|
||||
//!Stop sound playback
|
||||
void Stop();
|
||||
//!Pause sound playback
|
||||
void Pause();
|
||||
//!Resume sound playback
|
||||
void Resume();
|
||||
//!Checks if the sound is currently playing
|
||||
//!\return true if sound is playing, false otherwise
|
||||
bool IsPlaying();
|
||||
//!Set sound volume
|
||||
//!\param v Sound volume (0-100)
|
||||
void SetVolume(int v);
|
||||
//!Set the sound to loop playback (only applies to OGG)
|
||||
//!\param l Loop (true to loop)
|
||||
void SetLoop(bool l);
|
||||
protected:
|
||||
const u8 * sound;
|
||||
int type;
|
||||
s32 length;
|
||||
s32 voice;
|
||||
s32 volume;
|
||||
const u8 * sound; //!< Pointer to the sound data
|
||||
int type; //!< Sound format type (SOUND_PCM or SOUND_OGG)
|
||||
s32 length; //!< Length of sound data
|
||||
s32 voice; //!< Currently assigned ASND voice channel
|
||||
s32 volume; //!< Sound volume (0-100)
|
||||
bool loop; //!< Loop sound playback
|
||||
};
|
||||
|
||||
//!Primary Gui class
|
||||
class GuiElement
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
GuiElement();
|
||||
//!Destructor
|
||||
~GuiElement();
|
||||
//!Set the element's parent
|
||||
//!\param e Pointer to parent element
|
||||
void SetParent(GuiElement * e);
|
||||
//!Gets the current leftmost coordinate of the element
|
||||
//!Considers horizontal alignment, x offset, width, and parent element's GetLeft() / GetWidth() values
|
||||
//!\return left coordinate
|
||||
int GetLeft();
|
||||
//!Gets the current topmost coordinate of the element
|
||||
//!Considers vertical alignment, y offset, height, and parent element's GetTop() / GetHeight() values
|
||||
//!\return top coordinate
|
||||
int GetTop();
|
||||
//!Gets the current width of the element. Does not currently consider the scale
|
||||
//!\return width
|
||||
int GetWidth();
|
||||
//!Gets the height of the element. Does not currently consider the scale
|
||||
//!\return height
|
||||
int GetHeight();
|
||||
//!Sets the size (width/height) of the element
|
||||
//!\param w Width of element
|
||||
//!\param h Height of element
|
||||
void SetSize(int w, int h);
|
||||
//!Checks whether or not the element is visible
|
||||
//!\return true if visible, false otherwise
|
||||
bool IsVisible();
|
||||
//!Checks whether or not the element is selectable
|
||||
//!\return true if selectable, false otherwise
|
||||
bool IsSelectable();
|
||||
//!Checks whether or not the element is clickable
|
||||
//!\return true if clickable, false otherwise
|
||||
bool IsClickable();
|
||||
//!Sets whether or not the element is selectable
|
||||
//!\param s Selectable
|
||||
void SetSelectable(bool s);
|
||||
//!Sets whether or not the element is clickable
|
||||
//!\param c Clickable
|
||||
void SetClickable(bool c);
|
||||
//!Gets the element's current state
|
||||
//!\return state
|
||||
int GetState();
|
||||
//!Sets the element's alpha value
|
||||
//!\param a alpha value
|
||||
void SetAlpha(int a);
|
||||
//!Gets the element's alpha value
|
||||
//!Considers alpha, alphaDyn, and the parent element's GetAlpha() value
|
||||
//!\return alpha
|
||||
int GetAlpha();
|
||||
//!Sets the element's scale
|
||||
//!\param s scale (1 is 100%)
|
||||
void SetScale(float s);
|
||||
//!Gets the element's current scale
|
||||
//!Considers scale, scaleDyn, and the parent element's GetScale() value
|
||||
float GetScale();
|
||||
//!Set a new GuiTrigger for the element
|
||||
//!\param t Pointer to GuiTrigger
|
||||
void SetTrigger(GuiTrigger * t);
|
||||
//!\overload
|
||||
//!\param i Index of trigger array to set
|
||||
//!\param t Pointer to GuiTrigger
|
||||
void SetTrigger(u8 i, GuiTrigger * t);
|
||||
//!Checks whether rumble was requested by the element
|
||||
//!\return true is rumble was requested, false otherwise
|
||||
bool Rumble();
|
||||
//!Sets whether or not the element is requesting a rumble event
|
||||
//!\param r true if requesting rumble, false if not
|
||||
void SetRumble(bool r);
|
||||
//!Set an effect for the element
|
||||
//!\param e Effect to enable
|
||||
//!\param a Amount of the effect (usage varies on effect)
|
||||
//!\param t Target amount of the effect (usage varies on effect)
|
||||
void SetEffect(int e, int a, int t=0);
|
||||
//!Sets an effect to be enabled on wiimote cursor over
|
||||
//!\param e Effect to enable
|
||||
//!\param a Amount of the effect (usage varies on effect)
|
||||
//!\param t Target amount of the effect (usage varies on effect)
|
||||
void SetEffectOnOver(int e, int a, int t=0);
|
||||
//!Shortcut to SetEffectOnOver(EFFECT_SCALE, 4, 110)
|
||||
void SetEffectGrow();
|
||||
//!Gets the current element effects
|
||||
//!\return element effects
|
||||
int GetEffect();
|
||||
//!Checks whether the specified coordinates are within the element's boundaries
|
||||
//!\param x X coordinate
|
||||
//!\param y Y coordinate
|
||||
//!\return true if contained within, false otherwise
|
||||
bool IsInside(int x, int y);
|
||||
//!Sets the element's position
|
||||
//!\param x X coordinate
|
||||
//!\param y Y coordinate
|
||||
void SetPosition(int x, int y);
|
||||
//!Updates the element's effects (dynamic values)
|
||||
//!Called by Draw(), used for animation purposes
|
||||
void UpdateEffects();
|
||||
//!Sets a function to called after after Update()
|
||||
//!Callback function can be used to response to changes in the state of the element, and/or update the element's attributes
|
||||
void SetUpdateCallback(UpdateCallback u);
|
||||
//!Checks whether the element is in focus
|
||||
//!\return true if element is in focus, false otherwise
|
||||
int IsFocused();
|
||||
//!Sets the element's visibility
|
||||
//!\param v Visibility (true = visible)
|
||||
virtual void SetVisible(bool v);
|
||||
//!Sets the element's focus
|
||||
//!\param v Focus (true = in focus)
|
||||
virtual void SetFocus(int f);
|
||||
//!Sets the element's state
|
||||
//!\param v State (STATE_DEFAULT, STATE_SELECTED, STATE_CLICKED, STATE_DISABLED)
|
||||
virtual void SetState(int s);
|
||||
//!Resets the element's state to STATE_DEFAULT
|
||||
virtual void ResetState();
|
||||
//!Gets whether or not the element is in STATE_SELECTED
|
||||
//!\return true if selected, false otherwise
|
||||
virtual int GetSelected();
|
||||
//!Sets the element's alignment respective to its parent element
|
||||
//!\param hor Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE)
|
||||
//!\param vert Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE)
|
||||
virtual void SetAlignment(int hor, int vert);
|
||||
//!Called constantly to allow the element to respond to the current input data
|
||||
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
|
||||
virtual void Update(GuiTrigger * t);
|
||||
//!Called constantly to redraw the element
|
||||
virtual void Draw();
|
||||
protected:
|
||||
bool visible;
|
||||
int focus; // -1 = cannot focus, 0 = not focused, 1 = focused
|
||||
int width;
|
||||
int height;
|
||||
int xoffset;
|
||||
int yoffset;
|
||||
int xoffsetDyn;
|
||||
int yoffsetDyn;
|
||||
int alpha;
|
||||
f32 scale;
|
||||
int alphaDyn;
|
||||
f32 scaleDyn;
|
||||
bool rumble;
|
||||
int effects;
|
||||
int effectAmount;
|
||||
int effectTarget;
|
||||
int effectsOver;
|
||||
int effectAmountOver;
|
||||
int effectTargetOver;
|
||||
int alignmentHor; // LEFT, RIGHT, CENTRE
|
||||
int alignmentVert; // TOP, BOTTOM, MIDDLE
|
||||
int state; // DEFAULT, SELECTED, CLICKED, DISABLED
|
||||
bool selectable; // is SELECTED a valid state?
|
||||
bool clickable; // is CLICKED a valid state?
|
||||
GuiTrigger * trigger[2];
|
||||
GuiElement * parentElement;
|
||||
UpdateCallback updateCB;
|
||||
bool visible; //!< Visibility of the element. If false, Draw() is skipped
|
||||
int focus; //!< Element focus (-1 = focus disabled, 0 = not focused, 1 = focused)
|
||||
int width; //!< Element width
|
||||
int height; //!< Element height
|
||||
int xoffset; //!< Element X offset
|
||||
int yoffset; //!< Element Y offset
|
||||
int xoffsetDyn; //!< Element X offset, dynamic (added to xoffset value for animation effects)
|
||||
int yoffsetDyn; //!< Element Y offset, dynamic (added to yoffset value for animation effects)
|
||||
int alpha; //!< Element alpha value (0-255)
|
||||
f32 scale; //!< Element scale (1 = 100%)
|
||||
int alphaDyn; //!< Element alpha, dynamic (multiplied by alpha value for blending/fading effects)
|
||||
f32 scaleDyn; //!< Element scale, dynamic (multiplied by alpha value for blending/fading effects)
|
||||
bool rumble; //!< Wiimote rumble (on/off) - set to on when this element requests a rumble event
|
||||
int effects; //!< Currently enabled effect(s). 0 when no effects are enabled
|
||||
int effectAmount; //!< Effect amount. Used by different effects for different purposes
|
||||
int effectTarget; //!< Effect target amount. Used by different effects for different purposes
|
||||
int effectsOver; //!< Effects to enable when wiimote cursor is over this element. Copied to effects variable on over event
|
||||
int effectAmountOver; //!< EffectAmount to set when wiimote cursor is over this element
|
||||
int effectTargetOver; //!< EffectTarget to set when wiimote cursor is over this element
|
||||
int alignmentHor; //!< Horizontal element alignment, respective to parent element (LEFT, RIGHT, CENTRE)
|
||||
int alignmentVert; //!< Horizontal element alignment, respective to parent element (TOP, BOTTOM, MIDDLE)
|
||||
int state; //!< Element state (DEFAULT, SELECTED, CLICKED, DISABLED)
|
||||
bool selectable; //!< Whether or not this element selectable (can change to SELECTED state)
|
||||
bool clickable; //!< Whether or not this element is clickable (can change to CLICKED state)
|
||||
GuiTrigger * trigger[2]; //!< GuiTriggers (input actions) that this element responds to
|
||||
GuiElement * parentElement; //!< Parent element
|
||||
UpdateCallback updateCB; //!< Callback function to call when this element is updated
|
||||
};
|
||||
|
||||
//!Groups elements into one window in which they can be managed.
|
||||
//!Allows GuiElements to be grouped together into a "window"
|
||||
class GuiWindow : public GuiElement
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
GuiWindow();
|
||||
//!\overload
|
||||
//!\param w Width of window
|
||||
//!\param h Height of window
|
||||
GuiWindow(int w, int h);
|
||||
//!Destructor.
|
||||
//!Destructor
|
||||
~GuiWindow();
|
||||
|
||||
//!Appends a element at the end, thus drawing it at last.
|
||||
//!\param element The element to append. If it is already in the list, it gets removed first.
|
||||
//!Appends a GuiElement to the GuiWindow
|
||||
//!\param e The GuiElement to append. If it is already in the GuiWindow, it is removed first
|
||||
void Append(GuiElement* e);
|
||||
//!Inserts a element into the manager.
|
||||
//!\param element The element to insert. If it is already in the list, it gets removed first.
|
||||
//!\param index The new index of the element.
|
||||
void Insert(GuiElement* e, u32 index);
|
||||
//!Removes a element from the list.
|
||||
//!\param element A element that is in the list.
|
||||
//!Inserts a GuiElement into the GuiWindow at the specified index
|
||||
//!\param e The GuiElement to insert. If it is already in the GuiWindow, it is removed first
|
||||
//!\param i Index in which to insert the element
|
||||
void Insert(GuiElement* e, u32 i);
|
||||
//!Removes the specified GuiElement from the GuiWindow
|
||||
//!\param e GuiElement to be removed
|
||||
void Remove(GuiElement* e);
|
||||
//!Clears the whole GuiWindow from all GuiElement.
|
||||
//!Removes all GuiElements
|
||||
void RemoveAll();
|
||||
|
||||
//!Returns a element at a specified index.
|
||||
//!\param index The index from where to poll the element.
|
||||
//!\return A pointer to the element at the index. NULL if index is out of bounds.
|
||||
//!Returns the GuiElement at the specified index
|
||||
//!\param index The index of the element
|
||||
//!\return A pointer to the element at the index, NULL on error (eg: out of bounds)
|
||||
GuiElement* GetGuiElementAt(u32 index) const;
|
||||
//!Returns the size of the list of elements.
|
||||
//!\return The size of the current elementlist.
|
||||
//!Returns the size of the list of elements
|
||||
//!\return The size of the current element list
|
||||
u32 GetSize();
|
||||
//!Sets the visibility of the window
|
||||
//!\param v visibility (true = visible)
|
||||
void SetVisible(bool v);
|
||||
//!Resets the window's state to STATE_DEFAULT
|
||||
void ResetState();
|
||||
//!Sets the window's state
|
||||
//!\param s State
|
||||
void SetState(int s);
|
||||
//!Gets the index of the GuiElement inside the window that is currently selected
|
||||
//!\return index of selected GuiElement
|
||||
int GetSelected();
|
||||
//!Sets the window focus
|
||||
//!\param f Focus
|
||||
void SetFocus(int f);
|
||||
//!Change the focus to the specified element
|
||||
//!This is intended for the primary GuiWindow only
|
||||
//!\param e GuiElement that should have focus
|
||||
void ChangeFocus(GuiElement * e);
|
||||
//!Changes window focus to the next focusable window or element
|
||||
//!If no element is in focus, changes focus to the first available element
|
||||
//!If B or 1 button is pressed, changes focus to the next available element
|
||||
//!This is intended for the primary GuiWindow only
|
||||
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
|
||||
void ToggleFocus(GuiTrigger * t);
|
||||
//!Moves the selected element to the element to the left or right
|
||||
//!\param d Direction to move (-1 = left, 1 = right)
|
||||
void MoveSelectionHor(int d);
|
||||
//!Moves the selected element to the element above or below
|
||||
//!\param d Direction to move (-1 = up, 1 = down)
|
||||
void MoveSelectionVert(int d);
|
||||
|
||||
//!Draws all the elements in this GuiWindow.
|
||||
//!Draws all the elements in this GuiWindow
|
||||
void Draw();
|
||||
//!Updates the window and all elements contains within
|
||||
//!Allows the GuiWindow and all elements to respond to the input data specified
|
||||
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
|
||||
void Update(GuiTrigger * t);
|
||||
|
||||
protected:
|
||||
std::vector<GuiElement*> _elements;
|
||||
std::vector<GuiElement*> _elements; //!< Contains all elements within the GuiWindow
|
||||
};
|
||||
|
||||
//!Converts image data into GX-useable RGBA8
|
||||
//!Currently designed for use only with PNG files
|
||||
class GuiImageData
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
//!Converts the image data to RGBA8 - expects PNG format
|
||||
//!\param i Image data
|
||||
GuiImageData(const u8 * i);
|
||||
//!Destructor
|
||||
~GuiImageData();
|
||||
//!Gets a pointer to the image data
|
||||
//!\return pointer to image data
|
||||
u8 * GetImage();
|
||||
//!Gets the image width
|
||||
//!\return image width
|
||||
int GetWidth();
|
||||
//!Gets the image height
|
||||
//!\return image height
|
||||
int GetHeight();
|
||||
protected:
|
||||
u8 * data;
|
||||
int height;
|
||||
int width;
|
||||
u8 * data; //!< Image data
|
||||
int height; //!< Height of image
|
||||
int width; //!< Width of image
|
||||
};
|
||||
|
||||
//!Display, manage, and manipulate images in the Gui
|
||||
class GuiImage : public GuiElement
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
//!\param img Pointer to GuiImageData element
|
||||
GuiImage(GuiImageData * img);
|
||||
//!\overload
|
||||
//!Sets up a new image from the image data specified
|
||||
//!\param img
|
||||
//!\param w Image width
|
||||
//!\param h Image height
|
||||
GuiImage(u8 * img, int w, int h);
|
||||
//!\overload
|
||||
//!Creates an image filled with the specified color
|
||||
//!\param w Image width
|
||||
//!\param h Image height
|
||||
//!\param c Image color
|
||||
GuiImage(int w, int h, GXColor c);
|
||||
//!Destructor
|
||||
~GuiImage();
|
||||
//!Sets the image rotation angle for drawing
|
||||
//!\param a Angle (in degrees)
|
||||
void SetAngle(float a);
|
||||
//!Sets the number of times to draw the image horizontally
|
||||
//!\param t Number of times to draw the image
|
||||
void SetTile(int t);
|
||||
//!Constantly called to draw the image
|
||||
void Draw();
|
||||
//!Gets the image data
|
||||
//!\return pointer to image data
|
||||
u8 * GetImage();
|
||||
//!Sets up a new image using the GuiImageData object specified
|
||||
//!\param img Pointer to GuiImageData object
|
||||
void SetImage(GuiImageData * img);
|
||||
//!\overload
|
||||
//!\param img Pointer to image data
|
||||
//!\param w Width
|
||||
//!\param h Height
|
||||
void SetImage(u8 * img, int w, int h);
|
||||
//!Gets the pixel color at the specified coordinates of the image
|
||||
//!\param x X coordinate
|
||||
//!\param y Y coordinate
|
||||
GXColor GetPixel(int x, int y);
|
||||
//!Sets the pixel color at the specified coordinates of the image
|
||||
//!\param x X coordinate
|
||||
//!\param y Y coordinate
|
||||
//!\param color Pixel color
|
||||
void SetPixel(int x, int y, GXColor color);
|
||||
//!Directly modifies the image data to create a color-striped effect
|
||||
//!Alters the RGB values by the specified amount
|
||||
//!\param s Amount to increment/decrement the RGB values in the image
|
||||
void ColorStripe(int s);
|
||||
//!Sets a stripe effect on the image, overlaying alpha blended rectangles
|
||||
//!Does not alter the image data
|
||||
//!\param s Alpha amount to draw over the image
|
||||
void SetStripe(int s);
|
||||
protected:
|
||||
int imgType;
|
||||
u8 * image;
|
||||
f32 imageangle;
|
||||
int tile;
|
||||
int stripe;
|
||||
int imgType; //!< Type of image data (IMAGE_TEXTURE, IMAGE_COLOR, IMAGE_DATA)
|
||||
u8 * image; //!< Poiner to image data. May be shared with GuiImageData data
|
||||
f32 imageangle; //!< Angle to draw the image
|
||||
int tile; //!< Number of times to draw (tile) the image horizontally
|
||||
int stripe; //!< Alpha value (0-255) to apply a stripe effect to the texture
|
||||
};
|
||||
|
||||
//!Display, manage, and manipulate text in the Gui
|
||||
class GuiText : public GuiElement
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
//!\param t Text
|
||||
//!\param s Font size
|
||||
//!\param c Font color
|
||||
GuiText(const char * t, int s, GXColor c);
|
||||
//!\overload
|
||||
//!\Assumes SetPresets() has been called to setup preferred text attributes
|
||||
//!\param t Text
|
||||
GuiText(const char * t);
|
||||
//!Destructor
|
||||
~GuiText();
|
||||
//!Sets the text of the GuiText element
|
||||
//!\param t Text
|
||||
void SetText(const char * t);
|
||||
//!Sets up preset values to be used by GuiText(t)
|
||||
//!Useful when printing multiple text elements, all with the same attributes set
|
||||
//!\param sz Font size
|
||||
//!\param c Font color
|
||||
//!\param w Maximum width of texture image (for text wrapping)
|
||||
//!\param s Font size
|
||||
//!\param h Text alignment (horizontal)
|
||||
//!\param v Text alignment (vertical)
|
||||
void SetPresets(int sz, GXColor c, int w, u16 s, int h, int v);
|
||||
//!Sets the font size
|
||||
//!\param s Font size
|
||||
void SetFontSize(int s);
|
||||
//!Sets the maximum width of the drawn texture image
|
||||
//!If the text exceeds this, it is wrapped to the next line
|
||||
//!\param w Maximum width
|
||||
void SetMaxWidth(int w);
|
||||
//!Sets the font color
|
||||
//!\param c Font color
|
||||
void SetColor(GXColor c);
|
||||
//!Sets the FreeTypeGX style attributes
|
||||
//!\param s Style attributes
|
||||
void SetStyle(u16 s);
|
||||
//!Sets the text alignment
|
||||
//!\param hor Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE)
|
||||
//!\param vert Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE)
|
||||
void SetAlignment(int hor, int vert);
|
||||
//!Constantly called to draw the text
|
||||
void Draw();
|
||||
protected:
|
||||
wchar_t* text;
|
||||
int size;
|
||||
int maxWidth;
|
||||
u16 style;
|
||||
GXColor color;
|
||||
wchar_t* text; //!< Unicode text value
|
||||
int size; //!< Font size
|
||||
int maxWidth; //!< Maximum width of the generated text object (for text wrapping)
|
||||
u16 style; //!< FreeTypeGX style attributes
|
||||
GXColor color; //!< Font color
|
||||
};
|
||||
|
||||
//!Display, manage, and manipulate buttons in the Gui
|
||||
//!Buttons can have images, icons, text, and sound set (all of which are optional)
|
||||
class GuiButton : public GuiElement
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
//!\param w Width
|
||||
//!\param h Height
|
||||
GuiButton(int w, int h);
|
||||
//!Destructor
|
||||
~GuiButton();
|
||||
//!Sets the button's image
|
||||
//!\param i Pointer to GuiImage object
|
||||
void SetImage(GuiImage* i);
|
||||
//!Sets the button's image on over
|
||||
//!\param i Pointer to GuiImage object
|
||||
void SetImageOver(GuiImage* i);
|
||||
//!Sets the button's icon
|
||||
//!\param i Pointer to GuiImage object
|
||||
void SetIcon(GuiImage* i);
|
||||
//!Sets the button's icon on over
|
||||
//!\param i Pointer to GuiImage object
|
||||
void SetIconOver(GuiImage* i);
|
||||
//!Sets the button's label
|
||||
//!\param t Pointer to GuiText object
|
||||
void SetLabel(GuiText* t);
|
||||
void SetLabelOver(GuiText* t);
|
||||
//!\overload
|
||||
//!\param t Pointer to GuiText object
|
||||
//!\param n Index of label to set
|
||||
void SetLabel(GuiText* t, int n);
|
||||
//!Sets the button's label on over (eg: different colored text)
|
||||
//!\param t Pointer to GuiText object
|
||||
void SetLabelOver(GuiText* t);
|
||||
//!\overload
|
||||
//!\param t Pointer to GuiText object
|
||||
//!\param n Index of label to set
|
||||
void SetLabelOver(GuiText* t, int n);
|
||||
//!Sets the sound to play on over
|
||||
//!\param s Pointer to GuiSound object
|
||||
void SetSoundOver(GuiSound * s);
|
||||
//!Sets the sound to play on click
|
||||
//!\param s Pointer to GuiSound object
|
||||
void SetSoundClick(GuiSound * s);
|
||||
//!Constantly called to draw the GuiButton
|
||||
void Draw();
|
||||
//!Constantly called to allow the GuiButton to respond to updated input data
|
||||
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
|
||||
void Update(GuiTrigger * t);
|
||||
protected:
|
||||
GuiImage * image;
|
||||
GuiImage * imageOver;
|
||||
GuiImage * icon;
|
||||
GuiImage * iconOver;
|
||||
GuiText * label[3];
|
||||
GuiText * labelOver[3];
|
||||
GuiSound * soundOver;
|
||||
GuiSound * soundClick;
|
||||
GuiImage * image; //!< Button image
|
||||
GuiImage * imageOver; //!< Button image on wiimote cursor over
|
||||
GuiImage * icon; //!< Button icon (drawn after button image)
|
||||
GuiImage * iconOver; //!< Button icon on wiimote cursor over
|
||||
GuiText * label[3]; //!< Label(s) to display
|
||||
GuiText * labelOver[3]; //!< Label(s) to display on wiimote cursor over
|
||||
GuiSound * soundOver; //!< Sound to play on wiimote cursor over
|
||||
GuiSound * soundClick; //!< Sound to play on click
|
||||
};
|
||||
|
||||
//!Display a list of files
|
||||
class GuiFileBrowser : public GuiElement
|
||||
{
|
||||
public:
|
||||
@ -352,6 +616,8 @@ class GuiFileBrowser : public GuiElement
|
||||
GuiImageData * scrollbarBox;
|
||||
GuiImageData * scrollbarBoxOver;
|
||||
|
||||
GuiSound * btnSoundOver;
|
||||
GuiSound * btnSoundClick;
|
||||
GuiTrigger * trigA;
|
||||
};
|
||||
|
||||
@ -361,6 +627,7 @@ typedef struct _optionlist {
|
||||
char value[MAX_OPTIONS][150];
|
||||
} OptionList;
|
||||
|
||||
//!Display a list of menu options
|
||||
class GuiOptionBrowser : public GuiElement
|
||||
{
|
||||
public:
|
||||
@ -407,6 +674,8 @@ class GuiOptionBrowser : public GuiElement
|
||||
GuiImageData * scrollbarBox;
|
||||
GuiImageData * scrollbarBoxOver;
|
||||
|
||||
GuiSound * btnSoundOver;
|
||||
GuiSound * btnSoundClick;
|
||||
GuiTrigger * trigA;
|
||||
};
|
||||
|
||||
@ -420,6 +689,7 @@ typedef struct _savelist {
|
||||
int files[2][100];
|
||||
} SaveList;
|
||||
|
||||
//!Display a list of game save files, with screenshots and file information
|
||||
class GuiSaveBrowser : public GuiElement
|
||||
{
|
||||
public:
|
||||
@ -468,6 +738,8 @@ class GuiSaveBrowser : public GuiElement
|
||||
GuiImageData * scrollbarBox;
|
||||
GuiImageData * scrollbarBoxOver;
|
||||
|
||||
GuiSound * btnSoundOver;
|
||||
GuiSound * btnSoundClick;
|
||||
GuiTrigger * trigA;
|
||||
};
|
||||
|
||||
@ -475,6 +747,7 @@ typedef struct _keytype {
|
||||
char ch, chShift;
|
||||
} Key;
|
||||
|
||||
//!On-screen keyboard
|
||||
class GuiKeyboard : public GuiWindow
|
||||
{
|
||||
public:
|
||||
@ -516,6 +789,7 @@ class GuiKeyboard : public GuiWindow
|
||||
GuiImageData * keyLarge;
|
||||
GuiImageData * keyLargeOver;
|
||||
GuiSound * keySoundOver;
|
||||
GuiSound * keySoundClick;
|
||||
GuiTrigger * trigA;
|
||||
};
|
||||
|
||||
|
@ -30,6 +30,9 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
|
||||
else
|
||||
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
|
||||
bgGameSelection = new GuiImageData(bg_game_selection_png);
|
||||
bgGameSelectionImg = new GuiImage(bgGameSelection);
|
||||
bgGameSelectionImg->SetParent(this);
|
||||
@ -64,6 +67,8 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
|
||||
arrowUpBtn->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||
arrowUpBtn->SetSelectable(false);
|
||||
arrowUpBtn->SetTrigger(trigA);
|
||||
arrowUpBtn->SetSoundOver(btnSoundOver);
|
||||
arrowUpBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
|
||||
arrowDownBtn->SetParent(this);
|
||||
@ -72,6 +77,8 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
|
||||
arrowDownBtn->SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||
arrowDownBtn->SetSelectable(false);
|
||||
arrowDownBtn->SetTrigger(trigA);
|
||||
arrowDownBtn->SetSoundOver(btnSoundOver);
|
||||
arrowDownBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());
|
||||
scrollbarBoxBtn->SetParent(this);
|
||||
@ -95,6 +102,7 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
|
||||
gameList[i]->SetImageOver(gameListBg[i]);
|
||||
gameList[i]->SetPosition(2,30*i+3);
|
||||
gameList[i]->SetTrigger(trigA);
|
||||
gameList[i]->SetSoundClick(btnSoundClick);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,6 +135,8 @@ GuiFileBrowser::~GuiFileBrowser()
|
||||
delete scrollbarBox;
|
||||
delete scrollbarBoxOver;
|
||||
|
||||
delete btnSoundOver;
|
||||
delete btnSoundClick;
|
||||
delete trigA;
|
||||
|
||||
for(int i=0; i<PAGESIZE; i++)
|
||||
|
@ -100,6 +100,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keyLargeOver = new GuiImageData(keyboard_largekey_over_png);
|
||||
|
||||
keySoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
keySoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
trigA = new GuiTrigger;
|
||||
|
||||
if(GCSettings.WiimoteOrientation)
|
||||
@ -115,6 +116,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keyBack->SetImageOver(keyBackOverImg);
|
||||
keyBack->SetLabel(keyBackText);
|
||||
keyBack->SetSoundOver(keySoundOver);
|
||||
keyBack->SetSoundClick(keySoundClick);
|
||||
keyBack->SetTrigger(trigA);
|
||||
keyBack->SetPosition(10*42+40, 0*42+80);
|
||||
keyBack->SetEffectGrow();
|
||||
@ -128,6 +130,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keyCaps->SetImageOver(keyCapsOverImg);
|
||||
keyCaps->SetLabel(keyCapsText);
|
||||
keyCaps->SetSoundOver(keySoundOver);
|
||||
keyCaps->SetSoundClick(keySoundClick);
|
||||
keyCaps->SetTrigger(trigA);
|
||||
keyCaps->SetPosition(0, 2*42+80);
|
||||
keyCaps->SetEffectGrow();
|
||||
@ -141,6 +144,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keyShift->SetImageOver(keyShiftOverImg);
|
||||
keyShift->SetLabel(keyShiftText);
|
||||
keyShift->SetSoundOver(keySoundOver);
|
||||
keyShift->SetSoundClick(keySoundClick);
|
||||
keyShift->SetTrigger(trigA);
|
||||
keyShift->SetPosition(21, 3*42+80);
|
||||
keyShift->SetEffectGrow();
|
||||
@ -152,6 +156,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keySpace->SetImage(keySpaceImg);
|
||||
keySpace->SetImageOver(keySpaceOverImg);
|
||||
keySpace->SetSoundOver(keySoundOver);
|
||||
keySpace->SetSoundClick(keySoundClick);
|
||||
keySpace->SetTrigger(trigA);
|
||||
keySpace->SetPosition(0, 4*42+80);
|
||||
keySpace->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
@ -171,6 +176,7 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
|
||||
keyBtn[i][j]->SetImage(keyImg[i][j]);
|
||||
keyBtn[i][j]->SetImageOver(keyImgOver[i][j]);
|
||||
keyBtn[i][j]->SetSoundOver(keySoundOver);
|
||||
keyBtn[i][j]->SetSoundClick(keySoundClick);
|
||||
keyBtn[i][j]->SetTrigger(trigA);
|
||||
keyBtn[i][j]->SetLabel(keyTxt[i][j]);
|
||||
keyBtn[i][j]->SetPosition(j*42+21*i+40, i*42+80);
|
||||
@ -210,6 +216,7 @@ GuiKeyboard::~GuiKeyboard()
|
||||
delete keyLarge;
|
||||
delete keyLargeOver;
|
||||
delete keySoundOver;
|
||||
delete keySoundClick;
|
||||
delete trigA;
|
||||
|
||||
for(int i=0; i<4; i++)
|
||||
|
@ -31,6 +31,9 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
||||
else
|
||||
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
|
||||
bgOptions = new GuiImageData(bg_options_png);
|
||||
bgOptionsImg = new GuiImage(bgOptions);
|
||||
bgOptionsImg->SetParent(this);
|
||||
@ -64,6 +67,8 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
||||
arrowUpBtn->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||
arrowUpBtn->SetSelectable(false);
|
||||
arrowUpBtn->SetTrigger(trigA);
|
||||
arrowUpBtn->SetSoundOver(btnSoundOver);
|
||||
arrowUpBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
|
||||
arrowDownBtn->SetParent(this);
|
||||
@ -72,6 +77,8 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
||||
arrowDownBtn->SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||
arrowDownBtn->SetSelectable(false);
|
||||
arrowDownBtn->SetTrigger(trigA);
|
||||
arrowDownBtn->SetSoundOver(btnSoundOver);
|
||||
arrowDownBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());
|
||||
scrollbarBoxBtn->SetParent(this);
|
||||
@ -99,6 +106,7 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
||||
optionBtn[i]->SetImageOver(optionBg[i]);
|
||||
optionBtn[i]->SetPosition(0,30*i+3);
|
||||
optionBtn[i]->SetTrigger(trigA);
|
||||
optionBtn[i]->SetSoundClick(btnSoundClick);
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,6 +139,8 @@ GuiOptionBrowser::~GuiOptionBrowser()
|
||||
delete scrollbarBoxOver;
|
||||
|
||||
delete trigA;
|
||||
delete btnSoundOver;
|
||||
delete btnSoundClick;
|
||||
|
||||
for(int i=0; i<PAGESIZE; i++)
|
||||
{
|
||||
|
@ -38,6 +38,9 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
||||
else
|
||||
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
||||
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
|
||||
gameSave = new GuiImageData(button_gamesave_png);
|
||||
gameSaveOver = new GuiImageData(button_gamesave_over_png);
|
||||
gameSaveBlank = new GuiImageData(button_gamesave_blank_png);
|
||||
@ -68,6 +71,8 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
||||
arrowUpBtn->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||
arrowUpBtn->SetSelectable(false);
|
||||
arrowUpBtn->SetTrigger(trigA);
|
||||
arrowUpBtn->SetSoundOver(btnSoundOver);
|
||||
arrowUpBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
|
||||
arrowDownBtn->SetParent(this);
|
||||
@ -76,6 +81,8 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
||||
arrowDownBtn->SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||
arrowDownBtn->SetSelectable(false);
|
||||
arrowDownBtn->SetTrigger(trigA);
|
||||
arrowDownBtn->SetSoundOver(btnSoundOver);
|
||||
arrowDownBtn->SetSoundClick(btnSoundClick);
|
||||
|
||||
scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());
|
||||
scrollbarBoxBtn->SetParent(this);
|
||||
@ -117,6 +124,8 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
||||
saveBtn[i]->SetState(STATE_DISABLED);
|
||||
saveBtn[i]->SetEffectGrow();
|
||||
saveBtn[i]->SetVisible(false);
|
||||
saveBtn[i]->SetSoundOver(btnSoundOver);
|
||||
saveBtn[i]->SetSoundClick(btnSoundClick);
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,6 +157,8 @@ GuiSaveBrowser::~GuiSaveBrowser()
|
||||
delete scrollbarBox;
|
||||
delete scrollbarBoxOver;
|
||||
|
||||
delete btnSoundOver;
|
||||
delete btnSoundClick;
|
||||
delete trigA;
|
||||
|
||||
for(int i=0; i<SAVELISTSIZE; i++)
|
||||
|
@ -21,6 +21,7 @@ GuiSound::GuiSound(const u8 * snd, s32 len, int t)
|
||||
type = t;
|
||||
voice = -1;
|
||||
volume = 100;
|
||||
loop = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,6 +29,10 @@ GuiSound::GuiSound(const u8 * snd, s32 len, int t)
|
||||
*/
|
||||
GuiSound::~GuiSound()
|
||||
{
|
||||
#ifndef NO_SOUND
|
||||
if(type == SOUND_OGG)
|
||||
StopOgg();
|
||||
#endif
|
||||
}
|
||||
|
||||
void GuiSound::Play()
|
||||
@ -41,13 +46,16 @@ void GuiSound::Play()
|
||||
vol = 255*(volume/100.0)*(GCSettings.SFXVolume/100.0);
|
||||
voice = ASND_GetFirstUnusedVoice();
|
||||
if(voice >= 0)
|
||||
ASND_SetVoice(voice, VOICE_MONO_8BIT, 8000, 0,
|
||||
ASND_SetVoice(voice, VOICE_STEREO_16BIT, 48000, 0,
|
||||
(u8 *)sound, length, vol, vol, NULL);
|
||||
break;
|
||||
|
||||
case SOUND_OGG:
|
||||
voice = 0;
|
||||
PlayOgg(mem_open((char *)sound, length), 0, OGG_INFINITE_TIME);
|
||||
if(loop)
|
||||
PlayOgg(mem_open((char *)sound, length), 0, OGG_INFINITE_TIME);
|
||||
else
|
||||
PlayOgg(mem_open((char *)sound, length), 0, OGG_ONE_TIME);
|
||||
SetVolumeOgg(255*(volume/100.0));
|
||||
break;
|
||||
}
|
||||
@ -111,6 +119,14 @@ void GuiSound::Resume()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GuiSound::IsPlaying()
|
||||
{
|
||||
if(ASND_StatusVoice(voice) == SND_WORKING || ASND_StatusVoice(voice) == SND_WAITING)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void GuiSound::SetVolume(int vol)
|
||||
{
|
||||
#ifndef NO_SOUND
|
||||
@ -133,3 +149,8 @@ void GuiSound::SetVolume(int vol)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GuiSound::SetLoop(bool l)
|
||||
{
|
||||
loop = l;
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ static GuiImage * bgImg = NULL;
|
||||
static GuiImage * bgTopImg = NULL;
|
||||
static GuiImage * bgBottomImg = NULL;
|
||||
static GuiSound * bgMusic = NULL;
|
||||
static GuiSound * enterSound = NULL;
|
||||
static GuiSound * exitSound = NULL;
|
||||
static GuiWindow * mainWindow = NULL;
|
||||
static GuiText * settingText = NULL;
|
||||
static int lastMenu = MENU_NONE;
|
||||
@ -117,6 +119,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiTrigger trigA;
|
||||
@ -156,6 +159,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
|
||||
btn1.SetImage(&btn1Img);
|
||||
btn1.SetImageOver(&btn1ImgOver);
|
||||
btn1.SetSoundOver(&btnSoundOver);
|
||||
btn1.SetSoundClick(&btnSoundClick);
|
||||
btn1.SetTrigger(&trigA);
|
||||
btn1.SetState(STATE_SELECTED);
|
||||
btn1.SetEffectGrow();
|
||||
@ -170,6 +174,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
|
||||
btn2.SetImage(&btn2Img);
|
||||
btn2.SetImageOver(&btn2ImgOver);
|
||||
btn2.SetSoundOver(&btnSoundOver);
|
||||
btn2.SetSoundClick(&btnSoundClick);
|
||||
btn2.SetTrigger(&trigA);
|
||||
btn2.SetEffectGrow();
|
||||
|
||||
@ -235,12 +240,6 @@ EmulatorUpdate (void *arg)
|
||||
*
|
||||
* Primary thread to allow GUI to respond to state changes, and draws GUI
|
||||
***************************************************************************/
|
||||
|
||||
/*static u32 arena1mem = 0;
|
||||
static u32 arena2mem = 0;
|
||||
static char mem[150] = { 0 };
|
||||
static GuiText * memTxt = NULL;*/
|
||||
|
||||
static void *
|
||||
UpdateGUI (void *arg)
|
||||
{
|
||||
@ -252,13 +251,6 @@ UpdateGUI (void *arg)
|
||||
}
|
||||
else
|
||||
{
|
||||
/*arena1mem = (u32)SYS_GetArena1Hi() - (u32)SYS_GetArena1Lo();
|
||||
#ifdef HW_RVL
|
||||
arena2mem = (u32)SYS_GetArena2Hi() - (u32)SYS_GetArena2Lo();
|
||||
#endif
|
||||
sprintf(mem, "A1: %u / A2: %u", arena1mem, arena2mem);
|
||||
if(memTxt) memTxt->SetText(mem);*/
|
||||
|
||||
mainWindow->Draw();
|
||||
|
||||
#ifdef HW_RVL
|
||||
@ -319,6 +311,7 @@ ProgressWindow(char *title, char *msg)
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiTrigger trigA;
|
||||
@ -556,6 +549,7 @@ static void OnScreenKeyboard(char * var, u16 maxlen)
|
||||
GuiKeyboard keyboard(var, maxlen);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiTrigger trigA;
|
||||
@ -576,6 +570,7 @@ static void OnScreenKeyboard(char * var, u16 maxlen)
|
||||
okBtn.SetImage(&okBtnImg);
|
||||
okBtn.SetImageOver(&okBtnImgOver);
|
||||
okBtn.SetSoundOver(&btnSoundOver);
|
||||
okBtn.SetSoundClick(&btnSoundClick);
|
||||
okBtn.SetTrigger(&trigA);
|
||||
okBtn.SetEffectGrow();
|
||||
|
||||
@ -589,6 +584,7 @@ static void OnScreenKeyboard(char * var, u16 maxlen)
|
||||
cancelBtn.SetImage(&cancelBtnImg);
|
||||
cancelBtn.SetImageOver(&cancelBtnImgOver);
|
||||
cancelBtn.SetSoundOver(&btnSoundOver);
|
||||
cancelBtn.SetSoundClick(&btnSoundClick);
|
||||
cancelBtn.SetTrigger(&trigA);
|
||||
cancelBtn.SetEffectGrow();
|
||||
|
||||
@ -637,6 +633,7 @@ SettingWindow(const char * title, GuiWindow * w)
|
||||
GuiWindow promptWindow(448,288);
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiTrigger trigA;
|
||||
@ -664,6 +661,7 @@ SettingWindow(const char * title, GuiWindow * w)
|
||||
okBtn.SetImage(&okBtnImg);
|
||||
okBtn.SetImageOver(&okBtnImgOver);
|
||||
okBtn.SetSoundOver(&btnSoundOver);
|
||||
okBtn.SetSoundClick(&btnSoundClick);
|
||||
okBtn.SetTrigger(&trigA);
|
||||
okBtn.SetEffectGrow();
|
||||
|
||||
@ -677,6 +675,7 @@ SettingWindow(const char * title, GuiWindow * w)
|
||||
cancelBtn.SetImage(&cancelBtnImg);
|
||||
cancelBtn.SetImageOver(&cancelBtnImgOver);
|
||||
cancelBtn.SetSoundOver(&btnSoundOver);
|
||||
cancelBtn.SetSoundClick(&btnSoundClick);
|
||||
cancelBtn.SetTrigger(&trigA);
|
||||
cancelBtn.SetEffectGrow();
|
||||
|
||||
@ -878,6 +877,7 @@ static int MenuGameSelection()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData iconHome(icon_home_png);
|
||||
GuiImageData iconSettings(icon_settings_png);
|
||||
GuiImageData btnOutline(button_png);
|
||||
@ -904,6 +904,7 @@ static int MenuGameSelection()
|
||||
settingsBtn.SetImage(&settingsBtnImg);
|
||||
settingsBtn.SetImageOver(&settingsBtnImgOver);
|
||||
settingsBtn.SetSoundOver(&btnSoundOver);
|
||||
settingsBtn.SetSoundClick(&btnSoundClick);
|
||||
settingsBtn.SetTrigger(&trigA);
|
||||
settingsBtn.SetEffectGrow();
|
||||
|
||||
@ -921,6 +922,7 @@ static int MenuGameSelection()
|
||||
exitBtn.SetImage(&exitBtnImg);
|
||||
exitBtn.SetImageOver(&exitBtnImgOver);
|
||||
exitBtn.SetSoundOver(&btnSoundOver);
|
||||
exitBtn.SetSoundClick(&btnSoundClick);
|
||||
exitBtn.SetTrigger(&trigA);
|
||||
exitBtn.SetTrigger(&trigHome);
|
||||
exitBtn.SetEffectGrow();
|
||||
@ -1105,6 +1107,7 @@ static int MenuGame()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnCloseOutline(button_small_png);
|
||||
@ -1142,6 +1145,7 @@ static int MenuGame()
|
||||
saveBtn.SetImageOver(&saveBtnImgOver);
|
||||
saveBtn.SetIcon(&saveBtnIcon);
|
||||
saveBtn.SetSoundOver(&btnSoundOver);
|
||||
saveBtn.SetSoundClick(&btnSoundClick);
|
||||
saveBtn.SetTrigger(&trigA);
|
||||
saveBtn.SetEffectGrow();
|
||||
|
||||
@ -1157,6 +1161,7 @@ static int MenuGame()
|
||||
loadBtn.SetImageOver(&loadBtnImgOver);
|
||||
loadBtn.SetIcon(&loadBtnIcon);
|
||||
loadBtn.SetSoundOver(&btnSoundOver);
|
||||
loadBtn.SetSoundClick(&btnSoundClick);
|
||||
loadBtn.SetTrigger(&trigA);
|
||||
loadBtn.SetEffectGrow();
|
||||
|
||||
@ -1172,6 +1177,7 @@ static int MenuGame()
|
||||
resetBtn.SetImageOver(&resetBtnImgOver);
|
||||
resetBtn.SetIcon(&resetBtnIcon);
|
||||
resetBtn.SetSoundOver(&btnSoundOver);
|
||||
resetBtn.SetSoundClick(&btnSoundClick);
|
||||
resetBtn.SetTrigger(&trigA);
|
||||
resetBtn.SetEffectGrow();
|
||||
|
||||
@ -1187,6 +1193,7 @@ static int MenuGame()
|
||||
controllerBtn.SetImageOver(&controllerBtnImgOver);
|
||||
controllerBtn.SetIcon(&controllerBtnIcon);
|
||||
controllerBtn.SetSoundOver(&btnSoundOver);
|
||||
controllerBtn.SetSoundClick(&btnSoundClick);
|
||||
controllerBtn.SetTrigger(&trigA);
|
||||
controllerBtn.SetEffectGrow();
|
||||
|
||||
@ -1202,6 +1209,7 @@ static int MenuGame()
|
||||
cheatsBtn.SetImageOver(&cheatsBtnImgOver);
|
||||
cheatsBtn.SetIcon(&cheatsBtnIcon);
|
||||
cheatsBtn.SetSoundOver(&btnSoundOver);
|
||||
cheatsBtn.SetSoundClick(&btnSoundClick);
|
||||
cheatsBtn.SetTrigger(&trigA);
|
||||
cheatsBtn.SetEffectGrow();*/
|
||||
|
||||
@ -1215,6 +1223,7 @@ static int MenuGame()
|
||||
mainmenuBtn.SetImage(&mainmenuBtnImg);
|
||||
mainmenuBtn.SetImageOver(&mainmenuBtnImgOver);
|
||||
mainmenuBtn.SetSoundOver(&btnSoundOver);
|
||||
mainmenuBtn.SetSoundClick(&btnSoundClick);
|
||||
mainmenuBtn.SetTrigger(&trigA);
|
||||
mainmenuBtn.SetEffectGrow();
|
||||
|
||||
@ -1228,6 +1237,7 @@ static int MenuGame()
|
||||
closeBtn.SetImage(&closeBtnImg);
|
||||
closeBtn.SetImageOver(&closeBtnImgOver);
|
||||
closeBtn.SetSoundOver(&btnSoundOver);
|
||||
closeBtn.SetSoundClick(&btnSoundClick);
|
||||
closeBtn.SetTrigger(&trigA);
|
||||
closeBtn.SetTrigger(&trigHome);
|
||||
closeBtn.SetEffectGrow();
|
||||
@ -1297,6 +1307,7 @@ static int MenuGame()
|
||||
|
||||
if(lastMenu == MENU_NONE)
|
||||
{
|
||||
enterSound->Play();
|
||||
bgTopImg->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 35);
|
||||
closeBtn.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 35);
|
||||
titleTxt.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 35);
|
||||
@ -1398,6 +1409,7 @@ static int MenuGame()
|
||||
{
|
||||
menu = MENU_EXIT;
|
||||
|
||||
exitSound->Play();
|
||||
bgTopImg->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
closeBtn.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
titleTxt.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
@ -1411,13 +1423,13 @@ static int MenuGame()
|
||||
batteryBtn[3]->SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 35);
|
||||
#endif
|
||||
|
||||
saveBtn.SetEffect(EFFECT_FADE, -15);
|
||||
loadBtn.SetEffect(EFFECT_FADE, -15);
|
||||
resetBtn.SetEffect(EFFECT_FADE, -15);
|
||||
controllerBtn.SetEffect(EFFECT_FADE, -15);
|
||||
//cheatsBtn.SetEffect(EFFECT_FADE, -15);
|
||||
saveBtn.SetEffect(EFFECT_FADE, -20);
|
||||
loadBtn.SetEffect(EFFECT_FADE, -20);
|
||||
resetBtn.SetEffect(EFFECT_FADE, -20);
|
||||
controllerBtn.SetEffect(EFFECT_FADE, -20);
|
||||
//cheatsBtn.SetEffect(EFFECT_FADE, -20);
|
||||
|
||||
usleep(150000); // wait for effects to finish
|
||||
usleep(200000); // wait for effects to finish
|
||||
}
|
||||
}
|
||||
|
||||
@ -1472,6 +1484,7 @@ static int MenuGameSaves(int action)
|
||||
titleTxt.SetText("Save Game");
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnCloseOutline(button_small_png);
|
||||
@ -1496,6 +1509,7 @@ static int MenuGameSaves(int action)
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -1509,6 +1523,7 @@ static int MenuGameSaves(int action)
|
||||
closeBtn.SetImage(&closeBtnImg);
|
||||
closeBtn.SetImageOver(&closeBtnImgOver);
|
||||
closeBtn.SetSoundOver(&btnSoundOver);
|
||||
closeBtn.SetSoundClick(&btnSoundClick);
|
||||
closeBtn.SetTrigger(&trigA);
|
||||
closeBtn.SetTrigger(&trigHome);
|
||||
closeBtn.SetEffectGrow();
|
||||
@ -1691,6 +1706,7 @@ static int MenuGameSaves(int action)
|
||||
{
|
||||
menu = MENU_EXIT;
|
||||
|
||||
exitSound->Play();
|
||||
bgTopImg->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
closeBtn.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
titleTxt.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
@ -1698,9 +1714,9 @@ static int MenuGameSaves(int action)
|
||||
bgBottomImg->SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 35);
|
||||
btnLogo->SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 35);
|
||||
|
||||
w.SetEffect(EFFECT_FADE, -15);
|
||||
w.SetEffect(EFFECT_FADE, -20);
|
||||
|
||||
usleep(150000); // wait for effects to finish
|
||||
usleep(200000); // wait for effects to finish
|
||||
}
|
||||
}
|
||||
|
||||
@ -1740,6 +1756,7 @@ static int MenuGameCheats()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnCloseOutline(button_small_png);
|
||||
@ -1764,6 +1781,7 @@ static int MenuGameCheats()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -1777,6 +1795,7 @@ static int MenuGameCheats()
|
||||
closeBtn.SetImage(&closeBtnImg);
|
||||
closeBtn.SetImageOver(&closeBtnImgOver);
|
||||
closeBtn.SetSoundOver(&btnSoundOver);
|
||||
closeBtn.SetSoundClick(&btnSoundClick);
|
||||
closeBtn.SetTrigger(&trigA);
|
||||
closeBtn.SetTrigger(&trigHome);
|
||||
closeBtn.SetEffectGrow();
|
||||
@ -1816,6 +1835,7 @@ static int MenuGameCheats()
|
||||
{
|
||||
menu = MENU_EXIT;
|
||||
|
||||
exitSound->Play();
|
||||
bgTopImg->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
closeBtn.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
titleTxt.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 35);
|
||||
@ -1823,9 +1843,9 @@ static int MenuGameCheats()
|
||||
bgBottomImg->SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 35);
|
||||
btnLogo->SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 35);
|
||||
|
||||
w.SetEffect(EFFECT_FADE, -15);
|
||||
w.SetEffect(EFFECT_FADE, -20);
|
||||
|
||||
usleep(150000); // wait for effects to finish
|
||||
usleep(200000); // wait for effects to finish
|
||||
}
|
||||
}
|
||||
HaltGui();
|
||||
@ -1847,6 +1867,7 @@ static int MenuSettings()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnLargeOutline(button_large_png);
|
||||
@ -1876,6 +1897,7 @@ static int MenuSettings()
|
||||
mappingBtn.SetImageOver(&mappingBtnImgOver);
|
||||
mappingBtn.SetIcon(&mappingBtnIcon);
|
||||
mappingBtn.SetSoundOver(&btnSoundOver);
|
||||
mappingBtn.SetSoundClick(&btnSoundClick);
|
||||
mappingBtn.SetTrigger(&trigA);
|
||||
mappingBtn.SetEffectGrow();
|
||||
|
||||
@ -1892,6 +1914,7 @@ static int MenuSettings()
|
||||
videoBtn.SetImageOver(&videoBtnImgOver);
|
||||
videoBtn.SetIcon(&videoBtnIcon);
|
||||
videoBtn.SetSoundOver(&btnSoundOver);
|
||||
videoBtn.SetSoundClick(&btnSoundClick);
|
||||
videoBtn.SetTrigger(&trigA);
|
||||
videoBtn.SetEffectGrow();
|
||||
|
||||
@ -1913,6 +1936,7 @@ static int MenuSettings()
|
||||
savingBtn.SetImageOver(&savingBtnImgOver);
|
||||
savingBtn.SetIcon(&fileBtnIcon);
|
||||
savingBtn.SetSoundOver(&btnSoundOver);
|
||||
savingBtn.SetSoundClick(&btnSoundClick);
|
||||
savingBtn.SetTrigger(&trigA);
|
||||
savingBtn.SetEffectGrow();
|
||||
|
||||
@ -1929,6 +1953,7 @@ static int MenuSettings()
|
||||
menuBtn.SetImageOver(&menuBtnImgOver);
|
||||
menuBtn.SetIcon(&menuBtnIcon);
|
||||
menuBtn.SetSoundOver(&btnSoundOver);
|
||||
menuBtn.SetSoundClick(&btnSoundClick);
|
||||
menuBtn.SetTrigger(&trigA);
|
||||
menuBtn.SetEffectGrow();
|
||||
|
||||
@ -1945,6 +1970,7 @@ static int MenuSettings()
|
||||
networkBtn.SetImageOver(&networkBtnImgOver);
|
||||
networkBtn.SetIcon(&networkBtnIcon);
|
||||
networkBtn.SetSoundOver(&btnSoundOver);
|
||||
networkBtn.SetSoundClick(&btnSoundClick);
|
||||
networkBtn.SetTrigger(&trigA);
|
||||
networkBtn.SetEffectGrow();
|
||||
|
||||
@ -1958,6 +1984,7 @@ static int MenuSettings()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -1971,6 +1998,7 @@ static int MenuSettings()
|
||||
resetBtn.SetImage(&resetBtnImg);
|
||||
resetBtn.SetImageOver(&resetBtnImgOver);
|
||||
resetBtn.SetSoundOver(&btnSoundOver);
|
||||
resetBtn.SetSoundClick(&btnSoundClick);
|
||||
resetBtn.SetTrigger(&trigA);
|
||||
resetBtn.SetEffectGrow();
|
||||
|
||||
@ -2056,6 +2084,7 @@ static int MenuSettingsMappings()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnLargeOutline(button_large_png);
|
||||
@ -2082,6 +2111,7 @@ static int MenuSettingsMappings()
|
||||
nesBtn.SetImageOver(&nesBtnImgOver);
|
||||
nesBtn.SetIcon(&nesBtnIcon);
|
||||
nesBtn.SetSoundOver(&btnSoundOver);
|
||||
nesBtn.SetSoundClick(&btnSoundClick);
|
||||
nesBtn.SetTrigger(&trigA);
|
||||
nesBtn.SetEffectGrow();
|
||||
|
||||
@ -2098,6 +2128,7 @@ static int MenuSettingsMappings()
|
||||
zapperBtn.SetImageOver(&zapperBtnImgOver);
|
||||
zapperBtn.SetIcon(&zapperBtnIcon);
|
||||
zapperBtn.SetSoundOver(&btnSoundOver);
|
||||
zapperBtn.SetSoundClick(&btnSoundClick);
|
||||
zapperBtn.SetTrigger(&trigA);
|
||||
zapperBtn.SetEffectGrow();
|
||||
|
||||
@ -2111,6 +2142,7 @@ static int MenuSettingsMappings()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -2167,6 +2199,7 @@ static int MenuSettingsMappingsController()
|
||||
subtitleTxt.SetPosition(50,60);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiImageData btnLargeOutline(button_large_png);
|
||||
@ -2195,6 +2228,7 @@ static int MenuSettingsMappingsController()
|
||||
gamecubeBtn.SetImageOver(&gamecubeBtnImgOver);
|
||||
gamecubeBtn.SetIcon(&gamecubeBtnIcon);
|
||||
gamecubeBtn.SetSoundOver(&btnSoundOver);
|
||||
gamecubeBtn.SetSoundClick(&btnSoundClick);
|
||||
gamecubeBtn.SetTrigger(&trigA);
|
||||
gamecubeBtn.SetEffectGrow();
|
||||
|
||||
@ -2210,6 +2244,7 @@ static int MenuSettingsMappingsController()
|
||||
wiimoteBtn.SetImageOver(&wiimoteBtnImgOver);
|
||||
wiimoteBtn.SetIcon(&wiimoteBtnIcon);
|
||||
wiimoteBtn.SetSoundOver(&btnSoundOver);
|
||||
wiimoteBtn.SetSoundClick(&btnSoundClick);
|
||||
wiimoteBtn.SetTrigger(&trigA);
|
||||
wiimoteBtn.SetEffectGrow();
|
||||
|
||||
@ -2226,6 +2261,7 @@ static int MenuSettingsMappingsController()
|
||||
classicBtn.SetImageOver(&classicBtnImgOver);
|
||||
classicBtn.SetIcon(&classicBtnIcon);
|
||||
classicBtn.SetSoundOver(&btnSoundOver);
|
||||
classicBtn.SetSoundClick(&btnSoundClick);
|
||||
classicBtn.SetTrigger(&trigA);
|
||||
classicBtn.SetEffectGrow();
|
||||
|
||||
@ -2247,6 +2283,7 @@ static int MenuSettingsMappingsController()
|
||||
nunchukBtn.SetImageOver(&nunchukBtnImgOver);
|
||||
nunchukBtn.SetIcon(&nunchukBtnIcon);
|
||||
nunchukBtn.SetSoundOver(&btnSoundOver);
|
||||
nunchukBtn.SetSoundClick(&btnSoundClick);
|
||||
nunchukBtn.SetTrigger(&trigA);
|
||||
nunchukBtn.SetEffectGrow();
|
||||
|
||||
@ -2260,6 +2297,7 @@ static int MenuSettingsMappingsController()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -2328,6 +2366,7 @@ ButtonMappingWindow()
|
||||
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
promptWindow.SetPosition(0, -10);
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
GuiTrigger trigA;
|
||||
@ -2462,6 +2501,7 @@ static int MenuSettingsMappingsMap()
|
||||
subtitleTxt.SetPosition(50,60);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
|
||||
@ -2481,6 +2521,7 @@ static int MenuSettingsMappingsMap()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -2792,6 +2833,7 @@ static int MenuSettingsVideo()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
|
||||
@ -2811,6 +2853,7 @@ static int MenuSettingsVideo()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -2937,6 +2980,7 @@ static int MenuSettingsFile()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
|
||||
@ -2956,6 +3000,7 @@ static int MenuSettingsFile()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -3117,6 +3162,7 @@ static int MenuSettingsMenu()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
|
||||
@ -3136,6 +3182,7 @@ static int MenuSettingsMenu()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -3249,6 +3296,7 @@ static int MenuSettingsNetwork()
|
||||
titleTxt.SetPosition(50,50);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
|
||||
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
|
||||
GuiImageData btnOutline(button_png);
|
||||
GuiImageData btnOutlineOver(button_over_png);
|
||||
|
||||
@ -3268,6 +3316,7 @@ static int MenuSettingsNetwork()
|
||||
backBtn.SetImage(&backBtnImg);
|
||||
backBtn.SetImageOver(&backBtnImgOver);
|
||||
backBtn.SetSoundOver(&btnSoundOver);
|
||||
backBtn.SetSoundClick(&btnSoundClick);
|
||||
backBtn.SetTrigger(&trigA);
|
||||
backBtn.SetEffectGrow();
|
||||
|
||||
@ -3389,12 +3438,6 @@ MainMenu (int menu)
|
||||
mainWindow->Append(bgBottomImg);
|
||||
mainWindow->Append(btnLogo);
|
||||
|
||||
/*// memory usage - for debugging
|
||||
memTxt = new GuiText(NULL, 18, (GXColor){255, 255, 255, 255});
|
||||
memTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||
memTxt->SetPosition(20, 20);
|
||||
mainWindow->Append(memTxt);*/
|
||||
|
||||
if(currentMenu == MENU_GAMESELECTION)
|
||||
ResumeGui();
|
||||
|
||||
@ -3405,6 +3448,11 @@ MainMenu (int menu)
|
||||
#ifndef NO_SOUND
|
||||
bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG);
|
||||
bgMusic->SetVolume(GCSettings.MusicVolume);
|
||||
bgMusic->SetLoop(true);
|
||||
enterSound = new GuiSound(enter_ogg, enter_ogg_size, SOUND_OGG);
|
||||
enterSound->SetVolume(GCSettings.SFXVolume);
|
||||
exitSound = new GuiSound(exit_ogg, exit_ogg_size, SOUND_OGG);
|
||||
exitSound->SetVolume(GCSettings.SFXVolume);
|
||||
if(currentMenu == MENU_GAMESELECTION) bgMusic->Play(); // startup music
|
||||
#endif
|
||||
|
||||
@ -3462,15 +3510,20 @@ MainMenu (int menu)
|
||||
ShutoffRumble();
|
||||
#endif
|
||||
|
||||
#ifndef NO_SOUND
|
||||
if(exitSound->IsPlaying())
|
||||
usleep(150000); // give sound more time to play
|
||||
#endif
|
||||
|
||||
CancelAction();
|
||||
HaltGui();
|
||||
|
||||
#ifndef NO_SOUND
|
||||
bgMusic->Stop();
|
||||
delete bgMusic;
|
||||
delete enterSound;
|
||||
delete exitSound;
|
||||
#endif
|
||||
|
||||
//delete memTxt;
|
||||
delete btnLogo;
|
||||
delete bgImg;
|
||||
delete bgTopImg;
|
||||
|
BIN
source/ngc/sounds/button_click.pcm
Normal file
BIN
source/ngc/sounds/button_click.pcm
Normal file
Binary file not shown.
BIN
source/ngc/sounds/enter.ogg
Normal file
BIN
source/ngc/sounds/enter.ogg
Normal file
Binary file not shown.
BIN
source/ngc/sounds/exit.ogg
Normal file
BIN
source/ngc/sounds/exit.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user