Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
7d4f7c56
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,发现更多精彩内容 >>
提交
7d4f7c56
编写于
1月 22, 2016
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/eugeneopalev/stb
into stb_h_fix
上级
c41629f2
a5bbc930
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
9 deletion
+22
-9
README.md
README.md
+6
-6
docs/other_libs.md
docs/other_libs.md
+1
-0
stb.h
stb.h
+7
-1
stb_c_lexer.h
stb_c_lexer.h
+2
-1
stb_tilemap_editor.h
stb_tilemap_editor.h
+2
-0
stb_truetype.h
stb_truetype.h
+4
-1
未找到文件。
README.md
浏览文件 @
7d4f7c56
...
...
@@ -7,10 +7,10 @@ single-file public domain libraries for C/C++ <a name="stb_libs"></a>
library | lastest version | category | LoC | description
--------------------- | ---- | -------- | --- | --------------------------------
**stb_vorbis.c**
| 1.0
6 | audio | 5441
| decode ogg vorbis files from file/memory to float/16-bit signed output
**stb_image.h**
| 2.0
8 | graphics | 6509
| image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
**stb_truetype.h**
| 1.0
8 | graphics | 3235
| parse, decode, and rasterize characters from truetype fonts
**stb_image_write.h**
| 1.0
0 | graphics | 993
| image writing to disk: PNG, TGA, BMP
**stb_vorbis.c**
| 1.0
7 | audio | 5462
| decode ogg vorbis files from file/memory to float/16-bit signed output
**stb_image.h**
| 2.0
9 | graphics | 6610
| image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
**stb_truetype.h**
| 1.0
9 | graphics | 3246
| parse, decode, and rasterize characters from truetype fonts
**stb_image_write.h**
| 1.0
1 | graphics | 1044
| image writing to disk: PNG, TGA, BMP
**stb_image_resize.h**
| 0.90 | graphics | 2586 | resize images larger/smaller with good quality
**stb_rect_pack.h**
| 0.08 | graphics | 572 | simple 2D rectangle packer with decent quality
**stretchy_buffer.h**
| 1.02 | utility | 216 | typesafe dynamic array for C (i.e. approximation to vector
<>
), doesn't compile as C++
...
...
@@ -21,13 +21,13 @@ library | lastest version | category | LoC | description
**stb_easy_font.h**
| 0.6 | 3D
graphics | 232 | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc
**stb_tilemap_editor.h**
| 0.36 | game
dev | 4127 | embeddable tilemap editor
**stb_herringbone_wa...**
| 0.6 | game
dev | 1220 | herringbone Wang tile map generator
**stb_c_lexer.h**
| 0.0
6 | parsing | 815
| simplify writing parsers for C-like languages
**stb_c_lexer.h**
| 0.0
7 | parsing | 816
| simplify writing parsers for C-like languages
**stb_divide.h**
| 0.91 | math | 379 | more useful 32-bit modulus e.g. "euclidean divide"
**stb.h**
| 2.25 | misc | 14136 | helper functions for C, mostly redundant in C++; basically author's personal stuff
**stb_leakcheck.h**
| 0.2 | misc | 124 | quick-and-dirty malloc/free leak-checking
Total libraries: 18
Total lines of C code: 46
448
Total lines of C code: 46
633
FAQ
...
...
docs/other_libs.md
浏览文件 @
7d4f7c56
...
...
@@ -64,6 +64,7 @@ this! But you might like them anyway:
-
**network**
[
yocto
](
https://github.com/tom-seddon/yhs
)
: non-production-use http server (public domain)
-
**network**
[
happyhttp
](
http://scumways.com/happyhttp/happyhttp.html
)
: http client requests (zlib license)
-
**network**
[
mongoose
](
https://github.com/cesanta/mongoose
)
: http server (GPL v2)
-
_
**network**
[
LUrlParser
](
https://github.com/corporateshark/LUrlParser
)
: lightweight URL & URI parser RFC 1738, RFC 3986 (MIT license)_
-
**crypto**
[
TweetNaCl
](
http://tweetnacl.cr.yp.to/software.html
)
: high-quality tiny cryptography library (public domain)
-
**AI**
[
micropather
](
http://www.grinninglizard.com/MicroPather/
)
: pathfinding with A
*
(zlib license)
-
**compression**
[
miniz.c
](
https://github.com/richgel999/miniz
)
: zlib compression,decompression, zip file, png writing (public domain)
...
...
stb.h
浏览文件 @
7d4f7c56
...
...
@@ -207,9 +207,15 @@ CREDITS
#endif
#ifdef _WIN32
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#ifndef _CRT_NON_CONFORMING_SWPRINTFS
#define _CRT_NON_CONFORMING_SWPRINTFS
#endif
#if !defined(_MSC_VER) || _MSC_VER > 1700
#include <intrin.h> // _BitScanReverse
#endif
...
...
@@ -7824,7 +7830,7 @@ stb_ps *stb_ps_remove_any(stb_ps *ps, void **value)
void
**
stb_ps_getlist
(
stb_ps
*
ps
,
int
*
count
)
{
int
i
,
n
=
0
;
void
**
p
;
void
**
p
=
NULL
;
switch
(
3
&
(
int
)
ps
)
{
case
STB_ps_direct
:
if
(
ps
==
NULL
)
{
*
count
=
0
;
return
NULL
;
}
...
...
stb_c_lexer.h
浏览文件 @
7d4f7c56
// stb_c_lexer.h - v0.0
6
- public domain Sean Barrett 2013
// stb_c_lexer.h - v0.0
7
- public domain Sean Barrett 2013
// lexer for making little C-like languages with recursive-descent parsers
//
// This file provides both the interface and the implementation.
...
...
@@ -10,6 +10,7 @@
// suffixes on integer constants are not handled (you can override this).
//
// History:
// 0.07 fix mishandling of hexadecimal constants parsed by strtol
// 0.06 fix missing next character after ending quote mark (Andreas Fredriksson)
// 0.05 refixed get_location because github version had lost the fix
// 0.04 fix octal parsing bug
...
...
stb_tilemap_editor.h
浏览文件 @
7d4f7c56
...
...
@@ -328,7 +328,9 @@
#define STB_TILEMAP_INCLUDE_STB_TILEMAP_EDITOR_H
#ifdef _WIN32
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdlib.h>
#include <stdio.h>
#endif
...
...
stb_truetype.h
浏览文件 @
7d4f7c56
...
...
@@ -50,7 +50,7 @@
//
// VERSION HISTORY
//
// 1.09 (
????-??-??) warning fix; avoid crash on outofmem
// 1.09 (
2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly
// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges
// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
// variant PackFontRanges to pack and render in separate phases;
...
...
@@ -2522,6 +2522,7 @@ STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // fo
float
scale
;
int
x
,
y
,
bottom_y
,
i
;
stbtt_fontinfo
f
;
f
.
userdata
=
NULL
;
if
(
!
stbtt_InitFont
(
&
f
,
data
,
offset
))
return
-
1
;
STBTT_memset
(
pixels
,
0
,
pw
*
ph
);
// background of 0 around pixels
...
...
@@ -2986,6 +2987,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd
if
(
rects
==
NULL
)
return
0
;
info
.
userdata
=
spc
->
user_allocator_context
;
stbtt_InitFont
(
&
info
,
fontdata
,
stbtt_GetFontOffsetForIndex
(
fontdata
,
font_index
));
n
=
stbtt_PackFontRangesGatherRects
(
spc
,
&
info
,
ranges
,
num_ranges
,
rects
);
...
...
@@ -3203,6 +3205,7 @@ STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const
// FULL VERSION HISTORY
//
// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges
// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges
// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
// allow PackFontRanges to pack and render in separate phases;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录