diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/renderers.cpp | 38 | ||||
-rw-r--r-- | src/render/renderers.h | 6 | ||||
-rw-r--r-- | src/render/rendererslist.h | 115 |
3 files changed, 159 insertions, 0 deletions
diff --git a/src/render/renderers.cpp b/src/render/renderers.cpp new file mode 100644 index 000000000..97364f54a --- /dev/null +++ b/src/render/renderers.cpp @@ -0,0 +1,38 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * 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 for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "render/renderers.h" + +RenderType intToRenderType(const int mode) +{ + if (mode < 0 || mode > RENDER_LAST) + { +#ifdef USE_OPENGL +#ifdef ANDROID + return RENDER_GLES_OPENGL; +#else + return RENDER_NORMAL_OPENGL; +#endif +#else + return RENDER_SOFTWARE; +#endif + } + return static_cast<RenderType>(mode); +} diff --git a/src/render/renderers.h b/src/render/renderers.h index 632614599..8922f3d10 100644 --- a/src/render/renderers.h +++ b/src/render/renderers.h @@ -21,13 +21,19 @@ #ifndef RENDER_RENDERERS_H #define RENDER_RENDERERS_H +#include "utils/gettext.h" + enum RenderType { RENDER_SOFTWARE = 0, +#ifdef USE_OPENGL RENDER_NORMAL_OPENGL = 1, RENDER_SAFE_OPENGL = 2, RENDER_GLES_OPENGL = 3, +#endif RENDER_LAST }; +RenderType intToRenderType(const int mode); + #endif // RENDER_RENDERERS_H diff --git a/src/render/rendererslist.h b/src/render/rendererslist.h new file mode 100644 index 000000000..6c4e3fd0e --- /dev/null +++ b/src/render/rendererslist.h @@ -0,0 +1,115 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * 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 for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "utils/gettext.h" + +#ifndef RENDER_RENDERERSLIST_H +#define RENDER_RENDERERSLIST_H + +#ifdef USE_OPENGL +#ifdef ANDROID + +// map for index to RenderType +const RenderType indexToRender[] = +{ + RENDER_SOFTWARE, + RENDER_GLES_OPENGL, +}; + +const char *OPENGL_NAME[] = +{ + // TRANSLATORS: draw backend + N_("Software"), + // TRANSLATORS: draw backend + N_("Mobile OpenGL"), +}; + +const int renderModesListSize = 2; + +const int renderToIndex[] = +{ + 0, // RENDER_SOFTWARE + 3, // RENDER_GLES_OPENGL + 3, // RENDER_GLES_OPENGL + 3 // RENDER_GLES_OPENGL +}; + +#else // ANDROID + +// map for index to RenderType +const RenderType indexToRender[] = +{ + RENDER_SOFTWARE, + RENDER_NORMAL_OPENGL, + RENDER_SAFE_OPENGL, + RENDER_GLES_OPENGL, +}; + +const char *OPENGL_NAME[] = +{ + // TRANSLATORS: draw backend + N_("Software"), + // TRANSLATORS: draw backend + N_("Fast OpenGL"), + // TRANSLATORS: draw backend + N_("Safe OpenGL"), + // TRANSLATORS: draw backend + N_("Mobile OpenGL"), +}; + +const int renderModesListSize = 4; + +const int renderToIndex[] = +{ + 0, // RENDER_SOFTWARE + 1, // RENDER_NORMAL_OPENGL + 2, // RENDER_SAFE_OPENGL + 3 // RENDER_GLES_OPENGL +}; + +#endif // ANDROID + +#else // USE_OPENGL + +// map for index to RenderType +const RenderType indexToRender[] = +{ + RENDER_SOFTWARE +}; + +const char *OPENGL_NAME[] = +{ + // TRANSLATORS: draw backend + N_("Software") +}; + +const int renderModesListSize = 1; + +const int renderToIndex[] = +{ + 0, // RENDER_SOFTWARE + 0, // RENDER_SOFTWARE + 0, // RENDER_SOFTWARE + 0 // RENDER_SOFTWARE +}; + +#endif // USE_OPENGL + +#endif // RENDER_RENDERERSLIST_H |