mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-20 13:59:57 +00:00
meow
This commit is contained in:
parent
b5fc1e4c5a
commit
99b8a43a10
2 changed files with 7 additions and 11 deletions
12
src/font.cpp
12
src/font.cpp
|
|
@ -128,7 +128,7 @@ TTF_Font *SharedFontState::getFont(std::string family, int size){
|
|||
SDL_IOStream *ops;
|
||||
|
||||
if (family.empty()){
|
||||
crash("font does not exist", Exception::RGSSError, true);
|
||||
crash(Exception::RGSSError, "font does not exist");
|
||||
}else{
|
||||
/* Use 'other' path as alternative in case
|
||||
* we have no 'regular' styled font asset */
|
||||
|
|
@ -143,8 +143,7 @@ TTF_Font *SharedFontState::getFont(std::string family, int size){
|
|||
font = TTF_OpenFontIO(ops, 1, size);
|
||||
|
||||
if (!font){
|
||||
snprintf(msg, sizeof msg, "%s", SDL_GetError());
|
||||
crash(msg, Exception::SDLError, true);
|
||||
crash(Exception::SDLError, "%s", SDL_GetError());
|
||||
}
|
||||
|
||||
p->pool.insert(key, font);
|
||||
|
|
@ -161,10 +160,7 @@ bool SharedFontState::fontPresent(std::string family) const{
|
|||
return !(set.regular.empty() && set.other.empty());
|
||||
}
|
||||
|
||||
void pickExistingFontName(const std::vector<std::string> &names,
|
||||
std::string &out,
|
||||
const SharedFontState &sfs)
|
||||
{
|
||||
void pickExistingFontName(const std::vector<std::string> &names, std::string &out, const SharedFontState &sfs){
|
||||
/* Note: In RMXP, a names array with no existing entry
|
||||
* results in no text being drawn at all (same for "" and []);
|
||||
* we can't replicate this in mkxp due to the default substitute. */
|
||||
|
|
@ -309,7 +305,7 @@ void Font::setSize(int value){
|
|||
|
||||
/* Catch illegal values (according to RMXP) */
|
||||
if (value < 6 || value > 96)
|
||||
throw Exception(Exception::ArgumentError, "%s", "bad value for size");
|
||||
crash(Exception::ArgumentError, "%s", "bad value for size");
|
||||
|
||||
p->size = value;
|
||||
p->sdlFont = 0;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "boost-hash.h"
|
||||
#include "exception.h"
|
||||
#include "meow.h"
|
||||
|
||||
#include <SDL3/SDL_video.h>
|
||||
#include <string>
|
||||
|
|
@ -32,8 +33,7 @@ GLFunctions gl;
|
|||
typedef const GLubyte* (APIENTRYP _PFNGLGETSTRINGIPROC) (GLenum, GLuint);
|
||||
|
||||
static void parseExtensionsCore(_PFNGLGETINTEGERVPROC GetIntegerv, BoostSet<std::string> &out){
|
||||
_PFNGLGETSTRINGIPROC GetStringi =
|
||||
(_PFNGLGETSTRINGIPROC) SDL_GL_GetProcAddress("glGetStringi");
|
||||
_PFNGLGETSTRINGIPROC GetStringi = (_PFNGLGETSTRINGIPROC) SDL_GL_GetProcAddress("glGetStringi");
|
||||
|
||||
GLint extCount = 0;
|
||||
GetIntegerv(GL_NUM_EXTENSIONS, &extCount);
|
||||
|
|
@ -69,7 +69,7 @@ static void parseExtensionsCompat(_PFNGLGETSTRINGPROC GetString, BoostSet<std::s
|
|||
gl.name = (type) SDL_GL_GetProcAddress("gl" #name EXT_SUFFIX);
|
||||
|
||||
#define EXC(msg) \
|
||||
Exception(Exception::MKXPError, "%s", msg)
|
||||
crash(Exception::MKXPError, "%s", msg)
|
||||
|
||||
void initGLFunctions(){
|
||||
#define EXT_SUFFIX ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue