aboutsummaryrefslogtreecommitdiff
path: root/description.txt
diff options
context:
space:
mode:
authorOch Noe <och_noe@forksworld.de>2018-11-26 20:22:48 +0100
committerOch Noe <och_noe@forksworld.de>2018-11-26 20:22:48 +0100
commit3abadd74789388a31b9c59bbcacfe6ae933e6c49 (patch)
tree107e3b024ea663b0d9da9ad8b4273486acd89349 /description.txt
parentecff614f1af52ea26f6edb5cd3c0500631da8298 (diff)
downloadmoreblocks-3abadd74789388a31b9c59bbcacfe6ae933e6c49.tar.gz
moreblocks-3abadd74789388a31b9c59bbcacfe6ae933e6c49.tar.bz2
moreblocks-3abadd74789388a31b9c59bbcacfe6ae933e6c49.zip
register_abm commented out
Diffstat (limited to 'description.txt')
0 files changed, 0 insertions, 0 deletions
n103'>103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
/*
Copyright (C) 2015 Aaron Suen <warr1024@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "guiscalingfilter.h"
#include "imagefilters.h"
#include "settings.h"
#include "util/numeric.h"
#include <stdio.h>

/* Maintain a static cache to store the images that correspond to textures
 * in a format that's manipulable by code.  Some platforms exhibit issues
 * converting textures back into images repeatedly, and some don't even
 * allow it at all.
 */
std::map<io::path, video::IImage *> g_imgCache;

/* Maintain a static cache of all pre-scaled textures.  These need to be
 * cleared as well when the cached images.
 */
std::map<io::path, video::ITexture *> g_txrCache;

/* Manually insert an image into the cache, useful to avoid texture-to-image
 * conversion whenever we can intercept it.
 */
void guiScalingCache(io::path key, video::IVideoDriver *driver, video::IImage *value)
{
	if (!g_settings->getBool("gui_scaling_filter"))
		return;
	video::IImage *copied = driver->createImage(value->getColorFormat(),
			value->getDimension());
	value->copyTo(copied);
	g_imgCache[key] = copied;
}