2012-11-01 16:19:01 +01:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 23:01:49 +01:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "ui/screen.h"
|
|
|
|
#include "ui/ui.h"
|
|
|
|
#include "file/file_util.h"
|
|
|
|
|
|
|
|
class LogoScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LogoScreen(const std::string &bootFilename)
|
|
|
|
: bootFilename_(bootFilename), frames_(0) {}
|
2013-07-17 22:27:05 +02:00
|
|
|
void key(const KeyInput &key);
|
2012-11-01 16:19:01 +01:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-03-31 18:06:25 -07:00
|
|
|
void sendMessage(const char *message, const char *value);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
private:
|
2013-07-17 22:27:05 +02:00
|
|
|
void Next();
|
2012-11-01 16:19:01 +01:00
|
|
|
std::string bootFilename_;
|
|
|
|
int frames_;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MenuScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
2013-05-31 23:10:14 +02:00
|
|
|
MenuScreen();
|
2012-11-01 16:19:01 +01:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-03-29 19:32:20 +01:00
|
|
|
void sendMessage(const char *message, const char *value);
|
2013-06-26 21:26:44 +02:00
|
|
|
void dialogFinished(const Screen *dialog, DialogResult result);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
int frames_;
|
2013-06-25 23:29:49 +02:00
|
|
|
bool showAtracShortcut_;
|
2012-11-01 16:19:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// Dialog box, meant to be pushed
|
2013-03-29 18:50:08 +01:00
|
|
|
class PauseScreen : public Screen
|
2012-11-01 16:19:01 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-03-29 18:50:08 +01:00
|
|
|
virtual void sendMessage(const char *msg, const char *value);
|
2013-07-17 02:33:26 -03:00
|
|
|
|
|
|
|
struct Message
|
|
|
|
{
|
|
|
|
Message(const char *m, const char *v)
|
|
|
|
: msg(m), value(v) {}
|
|
|
|
|
|
|
|
const char *msg;
|
|
|
|
const char *value;
|
|
|
|
};
|
|
|
|
|
2013-07-17 03:34:43 -03:00
|
|
|
virtual void *dialogData()
|
2013-07-17 02:33:26 -03:00
|
|
|
{
|
|
|
|
return m_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
PauseScreen() : m_data(NULL) {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Message* m_data;
|
2012-11-01 16:19:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SettingsScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-03-07 00:10:53 +01:00
|
|
|
class DeveloperScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
2013-04-17 05:11:39 +08:00
|
|
|
class AudioScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
2013-04-28 08:55:03 +08:00
|
|
|
class GraphicsScreenP1 : public Screen
|
2013-04-17 05:11:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
2013-03-07 00:10:53 +01:00
|
|
|
|
2013-04-28 08:55:03 +08:00
|
|
|
class GraphicsScreenP2 : public Screen
|
2013-04-27 23:58:10 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
2013-06-03 16:25:48 +08:00
|
|
|
class GraphicsScreenP3 : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
2013-04-17 05:11:39 +08:00
|
|
|
class SystemScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
2013-04-21 00:09:09 +08:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
|
|
|
|
|
|
|
class LanguageScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LanguageScreen();
|
2013-04-17 05:11:39 +08:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-04-18 23:42:44 +02:00
|
|
|
private:
|
|
|
|
std::vector<FileInfo> langs_;
|
2013-04-23 22:39:17 +02:00
|
|
|
std::map<std::string, std::pair<std::string, int>> langValuesMapping;
|
2013-04-17 05:11:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ControlsScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
};
|
2013-04-21 00:09:09 +08:00
|
|
|
|
2013-05-23 17:20:29 -07:00
|
|
|
class KeyMappingScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
2013-07-06 19:08:59 +02:00
|
|
|
KeyMappingScreen() : currentMap_(0) {}
|
2013-05-23 17:20:29 -07:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-07-06 19:08:59 +02:00
|
|
|
private:
|
|
|
|
int currentMap_;
|
2013-05-23 17:20:29 -07:00
|
|
|
};
|
2013-05-23 18:07:01 -07:00
|
|
|
|
2013-05-23 17:20:29 -07:00
|
|
|
// Dialog box, meant to be pushed
|
|
|
|
class KeyMappingNewKeyDialog : public Screen
|
|
|
|
{
|
|
|
|
public:
|
2013-07-06 19:08:59 +02:00
|
|
|
KeyMappingNewKeyDialog(int btn, int currentMap) {
|
2013-05-23 21:06:27 -07:00
|
|
|
pspBtn = btn;
|
2013-07-06 19:08:59 +02:00
|
|
|
last_kb_deviceid = 0;
|
2013-06-27 20:05:54 -07:00
|
|
|
last_kb_key = 0;
|
2013-07-07 15:21:40 -07:00
|
|
|
last_axis_deviceid = 0;
|
|
|
|
last_axis_id = -1;
|
2013-07-06 19:08:59 +02:00
|
|
|
currentMap_ = currentMap;
|
2013-05-23 21:06:27 -07:00
|
|
|
}
|
2013-05-23 17:20:29 -07:00
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
2013-07-06 19:08:59 +02:00
|
|
|
void key(const KeyInput &key);
|
2013-07-07 15:21:40 -07:00
|
|
|
void axis(const AxisInput &axis);
|
2013-07-06 19:08:59 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
int pspBtn;
|
|
|
|
int last_kb_deviceid;
|
|
|
|
int last_kb_key;
|
2013-07-07 15:21:40 -07:00
|
|
|
int last_axis_deviceid;
|
|
|
|
int last_axis_id;
|
|
|
|
int last_axis_direction;
|
2013-07-06 19:08:59 +02:00
|
|
|
int currentMap_;
|
2013-05-23 18:07:01 -07:00
|
|
|
};
|
2013-05-23 17:20:29 -07:00
|
|
|
|
2012-11-01 16:19:01 +01:00
|
|
|
struct FileSelectScreenOptions {
|
2012-11-20 11:35:48 +01:00
|
|
|
const char* filter; // Enforced extension filter. Case insensitive, extensions separated by ":".
|
2012-11-01 16:19:01 +01:00
|
|
|
bool allowChooseDirectory;
|
|
|
|
int folderIcon;
|
|
|
|
std::map<std::string, int> iconMapping;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FileSelectScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FileSelectScreen(const FileSelectScreenOptions &options);
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
|
|
|
|
// Override these to for example write the current directory to a config file.
|
|
|
|
virtual void onSelectFile() {}
|
|
|
|
virtual void onCancel() {}
|
2013-07-08 11:04:03 +02:00
|
|
|
void key(const KeyInput &key);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void updateListing();
|
|
|
|
|
|
|
|
FileSelectScreenOptions options_;
|
|
|
|
UIList list_;
|
|
|
|
std::string currentDirectory_;
|
|
|
|
std::vector<FileInfo> listing_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CreditsScreen : public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CreditsScreen() : frames_(0) {}
|
|
|
|
void update(InputState &input);
|
|
|
|
void render();
|
|
|
|
private:
|
|
|
|
int frames_;
|
|
|
|
};
|
|
|
|
|
|
|
|
void DrawWatermark();
|