mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
Finalized DynamicFont implementation
-DynamicFont uses Freetype by default -Editor fonts are now scalable thanks to this -Cleaned up documentation browser and added fonts for this
This commit is contained in:
parent
a5777994cb
commit
3e8eb396d7
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,6 +20,7 @@ tools/editor/doc_data_compressed.h
|
||||
tools/editor/certs_compressed.h
|
||||
tools/editor/editor_icons.cpp
|
||||
tools/editor/translations.h
|
||||
tools/editor/builtin_fonts.h
|
||||
-fpic
|
||||
.fscache
|
||||
make.bat
|
||||
|
2636
core/hq2x.cpp
Normal file
2636
core/hq2x.cpp
Normal file
File diff suppressed because it is too large
Load Diff
19
core/hq2x.h
Normal file
19
core/hq2x.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef HQ2X_H
|
||||
#define HQ2X_H
|
||||
|
||||
#include "typedefs.h"
|
||||
|
||||
|
||||
uint32_t *hq2x_resize(
|
||||
const uint32_t *image,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t *output,
|
||||
uint32_t trY = 0x30,
|
||||
uint32_t trU = 0x07,
|
||||
uint32_t trV = 0x06,
|
||||
uint32_t trA = 0x50,
|
||||
bool wrapX = false,
|
||||
bool wrapY = false );
|
||||
|
||||
#endif // HQ2X_H
|
@ -30,7 +30,7 @@
|
||||
#include "hash_map.h"
|
||||
#include "core/io/image_loader.h"
|
||||
#include "core/os/copymem.h"
|
||||
|
||||
#include "hq2x.h"
|
||||
#include "print_string.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@ -901,6 +901,44 @@ static void _generate_po2_mipmap(const uint8_t* p_src, uint8_t* p_dst, uint32_t
|
||||
}
|
||||
|
||||
|
||||
void Image::expand_x2_hq2x() {
|
||||
|
||||
ERR_FAIL_COND(format>=FORMAT_INDEXED);
|
||||
|
||||
Format current = format;
|
||||
bool mipmaps=get_mipmaps();
|
||||
if (mipmaps) {
|
||||
clear_mipmaps();
|
||||
}
|
||||
|
||||
if (current!=FORMAT_RGBA)
|
||||
convert(FORMAT_RGBA);
|
||||
|
||||
DVector<uint8_t> dest;
|
||||
dest.resize(width*2*height*2*4);
|
||||
|
||||
{
|
||||
DVector<uint8_t>::Read r = data.read();
|
||||
DVector<uint8_t>::Write w = dest.write();
|
||||
|
||||
hq2x_resize((const uint32_t*)r.ptr(),width,height,(uint32_t*)w.ptr());
|
||||
|
||||
}
|
||||
|
||||
width*=2;
|
||||
height*=2;
|
||||
data=dest;
|
||||
|
||||
|
||||
if (current!=FORMAT_RGBA)
|
||||
convert(current);
|
||||
|
||||
if (mipmaps) {
|
||||
generate_mipmaps();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Image::shrink_x2() {
|
||||
|
||||
ERR_FAIL_COND(format==FORMAT_INDEXED || format==FORMAT_INDEXED_ALPHA);
|
||||
|
@ -250,6 +250,7 @@ public:
|
||||
void resize( int p_width, int p_height, Interpolation p_interpolation=INTERPOLATE_BILINEAR );
|
||||
Image resized( int p_width, int p_height, int p_interpolation=INTERPOLATE_BILINEAR );
|
||||
void shrink_x2();
|
||||
void expand_x2_hq2x();
|
||||
/**
|
||||
* Crop the image to a specific size, if larger, then the image is filled by black
|
||||
*/
|
||||
|
@ -59,6 +59,8 @@ if (env['musepack']=='yes'):
|
||||
SConscript("mpc/SCsub");
|
||||
if (env["squish"]=="yes" and env["tools"]=="yes"):
|
||||
SConscript("squish/SCsub");
|
||||
if (env["freetype"]!="no"):
|
||||
SConscript("freetype/SCsub");
|
||||
|
||||
num = 0
|
||||
cur_base = ""
|
||||
|
@ -66,4 +66,6 @@ if (env["freetype"]=="builtin"):
|
||||
# lib = env.Library("freetype_builtin",ft_sources)
|
||||
# env.Prepend(LIBS=[lib])
|
||||
|
||||
|
||||
|
||||
Export('env')
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user