Commit Graph

20 Commits (8e66f180d887972c8597d54eea4f7655c6d21d61)

Author SHA1 Message Date
Skid-Inc baebfd0ce8 text-freetype2: Fix file reader occasionally not updating 2017-06-27 11:15:00 +01:00
Richard Stanway 8f3289fc4d
text-freetype2: Fix a crash if there's insufficient glyph texture space 2016-04-24 20:21:07 +02:00
Richard Stanway 215f2441e2
text-freetype2: Don't create vertex buffer if text is empty 2016-04-23 17:49:04 +02:00
jp9000 d8a357e01a image-source: Use os_stat instead of stat
(Note: This commit also modified text-freetype2)

Prevents issues from being able to update files that may not be using
the current system encoding on windows.
2016-04-03 18:03:52 -07:00
Jim 32358ba636 Merge pull request #518 from hwdro/TFT-A8
text-freetype2: Use GS_A8 type glyphs texture
2016-03-24 01:23:55 -07:00
Christoph Hohmann 18a2b61b85 image-source: Fix reloading bug when stat fails
(Note: This commit also modified text-freetype2)

The implementation of get_modified_timestamp() did not check the return
value of stat(), so in case the check fails the values in the stats
structure can be any garbage on the stack and the value of
stats.st_mtime can change on every call. This can trigger a reload of
the image every second, even if the file was not actually modified.

Closes jp9000/obs-studio#520
2016-03-24 01:14:23 -07:00
hwdro e0592beab3 text-freetype2: Use GS_A8 type glyphs texture
Since glyphs are rendered by FT as 8-bit gray levels bitmaps, it would
be a waste of memory to cache glyphs in a RGBA texture.
2016-03-10 15:23:42 +02:00
Richard Stanway d1fbacd784 text-freetype2: Fix loading from files with unicode names 2015-10-08 00:57:12 +02:00
Palana 78ad3ec132 text-freetype2: Fix undefined behavior for alpha > 127
Found via UBSan, actual (sample) error:
"plugins/text-freetype2/text-functionality.c:284:26: runtime error: left
shift of 194 by 24 places cannot be represented in type 'int'"
2015-05-31 04:45:40 +02:00
Lexsus a2deddfa77 text-freetype2: Fix CR char. rendering as space
On windows, carriage return characters are used along with line feed
characters. When the carriage return is used, it's rendered as a space.
This removes carriage returns from strings before rendering them via
freetype.
2014-11-18 04:04:54 -08:00
jp9000 ce99829d01 text-freetype2: Remove null pointer dereference 2014-11-17 06:47:49 -08:00
jp9000 f199e2c096 text-freetype2: Do not call wcslen in loop expr.
Doing this in the expression will cause it to execute the function every
time the expression is evaluated, which is needless cycles wasted.
Instead, call wcslen before the loops begin.
2014-11-17 06:47:49 -08:00
jp9000 c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
jp9000 cabc47c147 Add more null pointer checks to text source 2014-09-02 20:44:50 -07:00
jp9000 ab4efe4dd1 text-freetype2: Fix null poitner dereference 2014-08-26 10:20:13 -07:00
jp9000 ff9c0528b7 text-freetype2: Check for 2 bytes instead of 1 2014-08-25 09:14:20 -07:00
jp9000 07c46ab468 text-freetype2: Fix GCC fread warnings
GCC marks fread as a function that will throw a warning if you do not
use its return value.  This is most likely done as a measure to ensure
code security.
2014-08-25 09:10:57 -07:00
jp9000 d95d20aa46 text-freetype2: Avoid spamming the log
When polling the file for changes, if the file doesn't exist, avoid
repeating the message over and over again that it couldn't find the
file.
2014-08-24 16:59:02 -07:00
jp9000 428c89ad4a Remove unused variable 2014-08-23 18:20:23 -07:00
paibox e1611b431c Merge Freetype text plugin 2014-08-18 00:14:02 -07:00