Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
aa89970d
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,发现更多精彩内容 >>
提交
aa89970d
编写于
5月 28, 2015
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stb_image.h: fix *comp value when loading PSDs
stb_voxel_render.h: fix STBVOX_CONFIG_OPTIMIZED_VHEIGHT
上级
947bdcd0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
15 deletion
+18
-15
README.md
README.md
+3
-3
stb_image.h
stb_image.h
+10
-6
stb_voxel_render.h
stb_voxel_render.h
+3
-3
tests/stb.dsp
tests/stb.dsp
+1
-1
tests/test_vorbis.c
tests/test_vorbis.c
+1
-2
未找到文件。
README.md
浏览文件 @
aa89970d
...
...
@@ -8,14 +8,14 @@ single-file public domain libraries for C/C++
library | lastest version | category | LoC | description
--------------------- | ---- | -------- | --- | --------------------------------
**stb_vorbis.c**
| 1.05 | audio | 5445 | decode ogg vorbis files from file/memory to float/16-bit signed output
**stb_image.h**
| 2.0
5 | graphics | 6433
| image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
**stb_image.h**
| 2.0
6 | graphics | 6437
| image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
**stb_truetype.h**
| 1.05 | graphics | 2632 | parse, decode, and rasterize characters from truetype fonts
**stb_image_write.h**
| 0.98 | graphics | 730 | image writing to disk: PNG, TGA, BMP
**stb_image_resize.h**
| 0.90 | graphics | 2585 | resize images larger/smaller with good quality
**stb_rect_pack.h**
| 0.06 | graphics | 560 | simple 2D rectangle packer with decent quality
**stretchy_buffer.h**
| 1.02 | utility | 210 | typesafe dynamic array for C (i.e. approximation to vector
<>
), doesn't compile as C++
**stb_textedit.h**
| 1.6 | UI | 1290 | guts of a text editor for games etc implementing them from scratch
**stb_voxel_render.h**
| 0.8
0
| 3D
graphics | 3644 | Minecraft-esque voxel rendering "engine" with many more features
**stb_voxel_render.h**
| 0.8
1
| 3D
graphics | 3644 | Minecraft-esque voxel rendering "engine" with many more features
**stb_dxt.h**
| 1.04 | 3D
graphics | 624 | Fabian "ryg" Giesen's real-time DXT compressor
**stb_perlin.h**
| 0.2 | 3D
graphics | 175 | revised Perlin noise (3D input, 1D output)
**stb_easy_font.h**
| 0.5 | 3D
graphics | 220 | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc
...
...
@@ -27,7 +27,7 @@ library | lastest version | category | LoC | description
**stb_leakcheck.h**
| 0.2 | misc | 117 | quick-and-dirty malloc/free leak-checking
Total libraries: 18
Total lines of C code: 4527
0
Total lines of C code: 4527
4
FAQ
...
...
stb_image.h
浏览文件 @
aa89970d
/* stb_image - v2.0
5
- public domain image loader - http://nothings.org/stb_image.h
/* stb_image - v2.0
6
- public domain image loader - http://nothings.org/stb_image.h
no warranty implied; use at your own risk
Do this:
...
...
@@ -143,6 +143,7 @@
Latest revision history:
2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
2.03 (2015-04-12) additional corruption checking
...
...
@@ -5139,7 +5140,8 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
p
=
out
+
channel
;
if
(
channel
>=
channelCount
)
{
// Fill this channel with default data.
for
(
i
=
0
;
i
<
pixelCount
;
i
++
)
*
p
=
(
channel
==
3
?
255
:
0
),
p
+=
4
;
for
(
i
=
0
;
i
<
pixelCount
;
i
++
,
p
+=
4
)
*
p
=
(
channel
==
3
?
255
:
0
);
}
else
{
// Read the RLE data.
count
=
0
;
...
...
@@ -5185,11 +5187,12 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
p
=
out
+
channel
;
if
(
channel
>
channelCount
)
{
// Fill this channel with default data.
for
(
i
=
0
;
i
<
pixelCount
;
i
++
)
*
p
=
channel
==
3
?
255
:
0
,
p
+=
4
;
for
(
i
=
0
;
i
<
pixelCount
;
i
++
,
p
+=
4
)
*
p
=
channel
==
3
?
255
:
0
;
}
else
{
// Read the data.
for
(
i
=
0
;
i
<
pixelCount
;
i
++
)
*
p
=
stbi__get8
(
s
)
,
p
+=
4
;
for
(
i
=
0
;
i
<
pixelCount
;
i
++
,
p
+=
4
)
*
p
=
stbi__get8
(
s
);
}
}
}
...
...
@@ -5199,7 +5202,7 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
if
(
out
==
NULL
)
return
out
;
// stbi__convert_format frees input on failure
}
if
(
comp
)
*
comp
=
channelCount
;
if
(
comp
)
*
comp
=
4
;
*
y
=
h
;
*
x
=
w
;
...
...
@@ -6292,6 +6295,7 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int
/*
revision history:
2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
2.03 (2015-04-12) extra corruption checking (mmozeiko)
...
...
stb_voxel_render.h
浏览文件 @
aa89970d
// stb_voxel_render.h - v0.8
0
- Sean Barrett, 2015 - public domain
// stb_voxel_render.h - v0.8
1
- Sean Barrett, 2015 - public domain
//
// This library helps render large-scale "voxel" worlds for games,
// in this case, one with blocks that can have textures and that
...
...
@@ -169,6 +169,7 @@
//
// VERSION HISTORY
//
// 0.81 (2015-05-28) fix broken STBVOX_CONFIG_OPTIMIZED_VHEIGHT
// 0.80 (2015-04-11) fix broken STBVOX_CONFIG_ROTATION_IN_LIGHTING refactoring
// change STBVOX_MAKE_LIGHTING to STBVOX_MAKE_LIGHTING_EXT so
// that header defs don't need to see config vars
...
...
@@ -2734,7 +2735,6 @@ void stbvox_make_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int fac
}
}
#ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT
// get opposite-facing normal & texgen for opposite face, used to map up-facing vheight data to down-facing data
static
unsigned
char
stbvox_reverse_face
[
STBVF_count
]
=
{
...
...
@@ -2744,7 +2744,7 @@ static unsigned char stbvox_reverse_face[STBVF_count] =
0
,
0
,
0
,
0
,
STBVF_ne_d
,
STBVF_ne_d
,
STBVF_nd
,
STBVF_nu
};
#ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT
// render non-planar quads by splitting into two triangles, rendering each as a degenerate quad
static
void
stbvox_make_12_split_mesh_for_face
(
stbvox_mesh_maker
*
mm
,
stbvox_rotate
rot
,
int
face
,
int
v_off
,
stbvox_pos
pos
,
stbvox_mesh_vertex
vertbase
,
stbvox_mesh_vertex
*
face_coord
,
unsigned
char
mesh
,
unsigned
char
*
ht
)
{
...
...
tests/stb.dsp
浏览文件 @
aa89970d
...
...
@@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "
TT
_TEST" /FR /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "
VORBIS
_TEST" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
...
...
tests/test_vorbis.c
浏览文件 @
aa89970d
...
...
@@ -8,11 +8,10 @@ extern void stb_vorbis_dumpmem(void);
int
main
(
int
argc
,
char
**
argv
)
{
size_t
memlen
;
unsigned
char
*
mem
=
stb_fileu
(
"c:/x/
01
.ogg"
,
&
memlen
);
unsigned
char
*
mem
=
stb_fileu
(
"c:/x/
theme_03
.ogg"
,
&
memlen
);
int
chan
,
samplerate
;
short
*
output
;
int
samples
=
stb_vorbis_decode_memory
(
mem
,
memlen
,
&
chan
,
&
samplerate
,
&
output
);
stb_vorbis_dumpmem
();
return
0
;
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录