mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fixed anjo's freeing issues & hopefully padding works
This commit is contained in:
@@ -4,7 +4,7 @@ Section: games
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: %ARCHITECTURE%
|
Architecture: %ARCHITECTURE%
|
||||||
Essential: no
|
Essential: no
|
||||||
Depends: libdevil1c2, libfreetype6, libgl1-mesa-glx, liblua5.1-0, libphysfs-1.0-0, libsdl1.2debian, libopenal1, libogg0, libvorbis0a, libvorbisfile3, libmodplug0c2, libmpg123-0
|
Depends: libdevil1c2, libfreetype6, libgl1-mesa-glx, liblua5.1-0, libphysfs1, libsdl1.2debian, libopenal1, libogg0, libvorbis0a, libvorbisfile3, libmodplug0c2, libmpg123-0
|
||||||
Installed-Size: %INSTALLSIZE%
|
Installed-Size: %INSTALLSIZE%
|
||||||
Maintainer: Bart van Strien [bart.bes@gmail.com]
|
Maintainer: Bart van Strien [bart.bes@gmail.com]
|
||||||
Provides: love
|
Provides: love
|
||||||
|
|||||||
@@ -20,22 +20,24 @@
|
|||||||
|
|
||||||
#include "GlyphData.h"
|
#include "GlyphData.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
namespace font
|
namespace font
|
||||||
{
|
{
|
||||||
|
|
||||||
GlyphData::GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, GlyphData::Format f)
|
GlyphData::GlyphData(unsigned short glyph, GlyphMetrics glyphMetrics, GlyphData::Format f)
|
||||||
: glyph(glyph), metrics(glyphMetrics), format(f), padded(false)
|
: glyph(glyph), metrics(glyphMetrics), format(f), padded(false), data(0)
|
||||||
{
|
{
|
||||||
if (getWidth() && getHeight()) {
|
if (metrics.width && metrics.height) {
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case GlyphData::FORMAT_LUMINOSITY_ALPHA:
|
case GlyphData::FORMAT_LUMINOSITY_ALPHA:
|
||||||
data = new unsigned char[getWidth() * getHeight() * 2];
|
data = new unsigned char[metrics.width * metrics.height * 2];
|
||||||
break;
|
break;
|
||||||
case GlyphData::FORMAT_RGBA:
|
case GlyphData::FORMAT_RGBA:
|
||||||
default:
|
default:
|
||||||
data = new unsigned char[getWidth() * getHeight() * 4];
|
data = new unsigned char[metrics.width * metrics.height * 4];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,6 +119,8 @@ namespace font
|
|||||||
|
|
||||||
void GlyphData::pad()
|
void GlyphData::pad()
|
||||||
{
|
{
|
||||||
|
if (data == 0)
|
||||||
|
return;
|
||||||
int w = getWidth();
|
int w = getWidth();
|
||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
int pw = next_p2(w);
|
int pw = next_p2(w);
|
||||||
|
|||||||
Reference in New Issue
Block a user