mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
changed LUMINOSITY_ALPHA to LUMINANCE_ALPHA (more consistent with opengl's phrasing)
This commit is contained in:
@@ -32,7 +32,7 @@ namespace font
|
|||||||
{
|
{
|
||||||
if (metrics.width && metrics.height) {
|
if (metrics.width && metrics.height) {
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case GlyphData::FORMAT_LUMINOSITY_ALPHA:
|
case GlyphData::FORMAT_LUMINANCE_ALPHA:
|
||||||
data = new unsigned char[metrics.width * metrics.height * 2];
|
data = new unsigned char[metrics.width * metrics.height * 2];
|
||||||
break;
|
break;
|
||||||
case GlyphData::FORMAT_RGBA:
|
case GlyphData::FORMAT_RGBA:
|
||||||
@@ -56,7 +56,7 @@ namespace font
|
|||||||
int GlyphData::getSize() const
|
int GlyphData::getSize() const
|
||||||
{
|
{
|
||||||
switch(format) {
|
switch(format) {
|
||||||
case GlyphData::FORMAT_LUMINOSITY_ALPHA:
|
case GlyphData::FORMAT_LUMINANCE_ALPHA:
|
||||||
return getWidth() * getHeight() * 2;
|
return getWidth() * getHeight() * 2;
|
||||||
break;
|
break;
|
||||||
case GlyphData::FORMAT_RGBA:
|
case GlyphData::FORMAT_RGBA:
|
||||||
@@ -125,13 +125,13 @@ namespace font
|
|||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
int pw = next_p2(w);
|
int pw = next_p2(w);
|
||||||
int ph = next_p2(h);
|
int ph = next_p2(h);
|
||||||
unsigned char * d = new unsigned char[pw * ph * (format == GlyphData::FORMAT_LUMINOSITY_ALPHA ? 2 : 4)];
|
unsigned char * d = new unsigned char[pw * ph * (format == GlyphData::FORMAT_LUMINANCE_ALPHA ? 2 : 4)];
|
||||||
for (int j = 0; j < ph; j++) {
|
for (int j = 0; j < ph; j++) {
|
||||||
for (int i = 0; i < pw; i++) {
|
for (int i = 0; i < pw; i++) {
|
||||||
int n = i+j*w;
|
int n = i+j*w;
|
||||||
int p = i+j*pw;
|
int p = i+j*pw;
|
||||||
if (i < w && j < h) {
|
if (i < w && j < h) {
|
||||||
if (format == GlyphData::FORMAT_LUMINOSITY_ALPHA) {
|
if (format == GlyphData::FORMAT_LUMINANCE_ALPHA) {
|
||||||
p *= 2;
|
p *= 2;
|
||||||
n *= 2;
|
n *= 2;
|
||||||
d[p] = data[n];
|
d[p] = data[n];
|
||||||
@@ -145,7 +145,7 @@ namespace font
|
|||||||
d[p+3] = data[n+3];
|
d[p+3] = data[n+3];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (format == GlyphData::FORMAT_LUMINOSITY_ALPHA) {
|
if (format == GlyphData::FORMAT_LUMINANCE_ALPHA) {
|
||||||
p *= 2;
|
p *= 2;
|
||||||
d[p] = d[p+1] = 0;
|
d[p] = d[p+1] = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace font
|
|||||||
public:
|
public:
|
||||||
enum Format
|
enum Format
|
||||||
{
|
{
|
||||||
FORMAT_LUMINOSITY_ALPHA,
|
FORMAT_LUMINANCE_ALPHA,
|
||||||
FORMAT_RGBA
|
FORMAT_RGBA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace opengl
|
|||||||
bool Glyph::loadVolatile()
|
bool Glyph::loadVolatile()
|
||||||
{
|
{
|
||||||
GLint format = GL_RGBA;
|
GLint format = GL_RGBA;
|
||||||
if (data->getFormat() == love::font::GlyphData::FORMAT_LUMINOSITY_ALPHA) format = GL_LUMINANCE_ALPHA;
|
if (data->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA) format = GL_LUMINANCE_ALPHA;
|
||||||
|
|
||||||
glGenTextures(1,&texture);
|
glGenTextures(1,&texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
|
|||||||
Reference in New Issue
Block a user