Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
5fe7fb52
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5fe7fb52
编写于
2月 25, 2019
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
various fixes for clang
also fix a comment typo
上级
5715e6fa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
32 deletion
+22
-32
stb_divide.h
stb_divide.h
+6
-5
stb_image.h
stb_image.h
+1
-1
stb_tilemap_editor.h
stb_tilemap_editor.h
+5
-3
stb_truetype.h
stb_truetype.h
+0
-13
stb_voxel_render.h
stb_voxel_render.h
+10
-10
未找到文件。
stb_divide.h
浏览文件 @
5fe7fb52
...
...
@@ -163,20 +163,21 @@ int stb_div_floor(int v1, int v2)
#ifdef C_INTEGER_DIVISION_FLOORS
return
v1
/
v2
;
#else
if
(
v1
>=
0
&&
v2
<
0
)
if
(
v1
>=
0
&&
v2
<
0
)
{
if
((
-
v1
)
+
v2
+
1
<
0
)
// check if increasing v1's magnitude overflows
return
-
stb__div
(
-
v1
+
v2
+
1
,
v2
);
// nope, so just compute it
else
return
-
stb__div
(
-
v1
,
v2
)
+
((
-
v1
)
%
v2
?
-
1
:
0
);
if
(
v1
<
0
&&
v2
>=
0
)
if
(
v1
!=
INT_MIN
)
}
if
(
v1
<
0
&&
v2
>=
0
)
{
if
(
v1
!=
INT_MIN
)
{
if
(
v1
-
v2
+
1
<
0
)
// check if increasing v1's magnitude overflows
return
-
stb__div
(
v1
-
v2
+
1
,
-
v2
);
// nope, so just compute it
else
return
-
stb__div
(
-
v1
,
v2
)
+
(
stb__mod
(
v1
,
-
v2
)
?
-
1
:
0
);
else
// it must be possible to compute -(v1+v2) without overflowing
}
else
// it must be possible to compute -(v1+v2) without overflowing
return
-
stb__div
(
-
(
v1
+
v2
),
v2
)
+
(
stb__mod
(
-
(
v1
+
v2
),
v2
)
?
-
2
:
-
1
);
else
}
else
return
v1
/
v2
;
// same sign, so expect truncation
#endif
}
...
...
stb_image.h
浏览文件 @
5fe7fb52
...
...
@@ -168,7 +168,7 @@ RECENT REVISION HISTORY:
// If compiling for Windows and you wish to use Unicode filenames, compile
// with
// #define STBI_WINDOWS_UTF8
// and pass utf8-encoded filenames. Call stbi
w
_convert_wchar_to_utf8 to convert
// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert
// Windows wchar_t filenames to utf8.
//
// ===========================================================================
...
...
stb_tilemap_editor.h
浏览文件 @
5fe7fb52
...
...
@@ -1061,8 +1061,9 @@ stbte_tilemap *stbte_create_map(int map_x, int map_y, int map_layers, int spacin
void
stbte_set_background_tile
(
stbte_tilemap
*
tm
,
short
id
)
{
int
i
;
STBTE_ASSERT
(
id
>=
-
1
&&
id
<
32768
);
if
(
id
>=
32768
||
id
<
-
1
)
STBTE_ASSERT
(
id
>=
-
1
);
// STBTE_ASSERT(id < 32768);
if
(
id
<
-
1
)
return
;
for
(
i
=
0
;
i
<
STBTE_MAX_TILEMAP_X
*
STBTE_MAX_TILEMAP_Y
;
++
i
)
if
(
tm
->
data
[
0
][
i
][
0
]
==
-
1
)
...
...
@@ -1222,7 +1223,8 @@ void stbte_set_tile(stbte_tilemap *tm, int x, int y, int layer, signed short til
{
STBTE_ASSERT
(
x
>=
0
&&
x
<
tm
->
max_x
&&
y
>=
0
&&
y
<
tm
->
max_y
);
STBTE_ASSERT
(
layer
>=
0
&&
layer
<
tm
->
num_layers
);
STBTE_ASSERT
(
tile
>=
-
1
&&
tile
<
32768
);
STBTE_ASSERT
(
tile
>=
-
1
);
//STBTE_ASSERT(tile < 32768);
if
(
x
<
0
||
x
>=
STBTE_MAX_TILEMAP_X
||
y
<
0
||
y
>=
STBTE_MAX_TILEMAP_Y
)
return
;
if
(
layer
<
0
||
layer
>=
tm
->
num_layers
||
tile
<
-
1
)
...
...
stb_truetype.h
浏览文件 @
5fe7fb52
...
...
@@ -243,19 +243,6 @@
// recommend it.
//
//
// SOURCE STATISTICS (based on v0.6c, 2050 LOC)
//
// Documentation & header file 520 LOC )___ 660 LOC documentation
// Sample code 140 LOC )
// Truetype parsing 620 LOC ---- 620 LOC TrueType
// Software rasterization 240 LOC )
// Curve tessellation 120 LOC )___ 550 LOC Bitmap creation
// Bitmap management 100 LOC )
// Baked bitmap interface 70 LOC )
// Font name matching & access 150 LOC ---- 150
// C runtime library abstraction 60 LOC ---- 60
//
//
// PERFORMANCE MEASUREMENTS FOR 1.06:
//
// 32-bit 64-bit
...
...
stb_voxel_render.h
浏览文件 @
5fe7fb52
...
...
@@ -2370,16 +2370,16 @@ static unsigned short stbvox_face_visible[STBVOX_FT_count] =
{
// we encode the table by listing which cases cause *obscuration*, and bitwise inverting that
// table is pre-shifted by 5 to save a shift when it's accessed
(
unsigned
short
)
((
~
0x07ff
)
<<
5
),
// none is completely obscured by everything
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_upper
)
))
<<
5
),
// upper
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_lower
)
))
<<
5
),
// lower
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
))
<<
5
),
// solid is only completely obscured only by solid
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_013
)))
<<
5
),
// diag012 matches diag013
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_123
)))
<<
5
),
// diag023 matches diag123
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_012
)))
<<
5
),
// diag013 matches diag012
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_023
)))
<<
5
),
// diag123 matches diag023
(
unsigned
short
)
((
~
0
)
<<
5
),
// force is always rendered regardless, always forces neighbor
(
unsigned
short
)
((
~
((
1
<<
STBVOX_FT_solid
)
))
<<
5
),
// partial is only completely obscured only by solid
(
unsigned
short
)
((
~
0x07ff
u
)
<<
5
),
// none is completely obscured by everything
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_upper
)
))
<<
5
),
// upper
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_lower
)
))
<<
5
),
// lower
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
))
<<
5
),
// solid is only completely obscured only by solid
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_013
)))
<<
5
),
// diag012 matches diag013
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_123
)))
<<
5
),
// diag023 matches diag123
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_012
)))
<<
5
),
// diag013 matches diag012
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
|
(
1
<<
STBVOX_FT_diag_023
)))
<<
5
),
// diag123 matches diag023
(
unsigned
short
)
((
~
0
u
)
<<
5
),
// force is always rendered regardless, always forces neighbor
(
unsigned
short
)
((
~
((
1
u
<<
STBVOX_FT_solid
)
))
<<
5
),
// partial is only completely obscured only by solid
};
// the vertex heights of the block types, in binary vertex order (zyx):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录