Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
32358ba6
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32358ba6
编写于
3月 24, 2016
作者:
J
Jim
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #518 from hwdro/TFT-A8
text-freetype2: Use GS_A8 type glyphs texture
上级
18a2b61b
e0592bea
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
9 deletion
+7
-9
plugins/text-freetype2/data/text_default.effect
plugins/text-freetype2/data/text_default.effect
+2
-1
plugins/text-freetype2/text-freetype2.c
plugins/text-freetype2/text-freetype2.c
+1
-1
plugins/text-freetype2/text-freetype2.h
plugins/text-freetype2/text-freetype2.h
+1
-1
plugins/text-freetype2/text-functionality.c
plugins/text-freetype2/text-functionality.c
+3
-6
未找到文件。
plugins/text-freetype2/data/text_default.effect
浏览文件 @
32358ba6
...
...
@@ -24,7 +24,8 @@ VertInOut VSDefault(VertInOut vert_in)
float4 PSDrawBare(VertInOut vert_in) : TARGET
{
return image.Sample(def_sampler, vert_in.uv) * vert_in.col;
vert_in.col.a *= image.Sample(def_sampler, vert_in.uv).a;
return vert_in.col;
}
technique Draw
...
...
plugins/text-freetype2/text-freetype2.c
浏览文件 @
32358ba6
...
...
@@ -367,7 +367,7 @@ static void ft2_source_update(void *data, obs_data_t *settings)
bfree
(
srcdata
->
texbuf
);
srcdata
->
texbuf
=
NULL
;
}
srcdata
->
texbuf
=
bzalloc
(
texbuf_w
*
texbuf_h
*
4
);
srcdata
->
texbuf
=
bzalloc
(
texbuf_w
*
texbuf_h
);
if
(
srcdata
->
font_face
)
cache_standard_glyphs
(
srcdata
);
...
...
plugins/text-freetype2/text-freetype2.h
浏览文件 @
32358ba6
...
...
@@ -53,7 +53,7 @@ struct ft2_source {
FT_Face
font_face
;
uint
32
_t
*
texbuf
;
uint
8
_t
*
texbuf
;
gs_vertbuffer_t
*
vbuf
;
gs_effect_t
*
draw_effect
;
...
...
plugins/text-freetype2/text-functionality.c
浏览文件 @
32358ba6
...
...
@@ -241,7 +241,6 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
slot
=
srcdata
->
font_face
->
glyph
;
uint32_t
dx
=
srcdata
->
texbuf_x
,
dy
=
srcdata
->
texbuf_y
;
uint8_t
alpha
;
int32_t
cached_glyphs
=
0
;
size_t
len
=
wcslen
(
cache_glyphs
);
...
...
@@ -278,11 +277,9 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
src_glyph
->
xadv
=
slot
->
advance
.
x
>>
6
;
for
(
uint32_t
y
=
0
;
y
<
g_h
;
y
++
)
{
for
(
uint32_t
x
=
0
;
x
<
g_w
;
x
++
)
{
alpha
=
slot
->
bitmap
.
buffer
[
glyph_pos
];
for
(
uint32_t
x
=
0
;
x
<
g_w
;
x
++
)
srcdata
->
texbuf
[
buf_pos
]
=
0x00FFFFFF
^
((
uint32_t
)
alpha
<<
24
);
}
slot
->
bitmap
.
buffer
[
glyph_pos
];
}
dx
+=
(
g_w
+
1
);
...
...
@@ -310,7 +307,7 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
}
srcdata
->
tex
=
gs_texture_create
(
texbuf_w
,
texbuf_h
,
GS_
RGBA
,
1
,
(
const
uint8_t
**
)
&
srcdata
->
texbuf
,
0
);
GS_
A8
,
1
,
(
const
uint8_t
**
)
&
srcdata
->
texbuf
,
0
);
obs_leave_graphics
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录