Skip to content

Commit aeb5f17

Browse files
committed
2 parents 3273915 + ec8649b commit aeb5f17

26 files changed

Lines changed: 344 additions & 113 deletions

include/cute_alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ CF_API void CF_CALL cf_arena_reset(CF_Arena* arena);
210210
/**
211211
* @function cf_destroy_arena
212212
* @category allocator
213-
* @brief Free's up all resources used by the allocator.
213+
* @brief Frees up all resources used by the allocator.
214214
* @param arena The arena to free.
215215
* @related cf_arena_init cf_arena_alloc cf_arena_reset cf_arena_free
216216
*/

include/cute_app.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ CF_API CF_DisplayID CF_CALL cf_default_display(void);
6161
* @function cf_display_count
6262
* @category app
6363
* @brief Returns the number of displays on the system.
64-
* @remarks Inidices >= 0 and < the return value are valid display indices.
64+
* @remarks Indices >= 0 and < the return value are valid display indices.
6565
* @related cf_make_app cf_display_count cf_display_x cf_display_y cf_display_width cf_display_height cf_display_refresh_rate cf_display_bounds cf_display_name cf_display_orientation
6666
*/
6767
CF_API int CF_CALL cf_display_count(void);
@@ -605,7 +605,7 @@ CF_API void* CF_CALL cf_app_init_imgui(void);
605605
* @enum CF_MSAA
606606
* @category app
607607
* @brief Multisample count used for MSAA for the app's offscreen canvas.
608-
* @remarks This function turns on .
608+
* @remarks This function turns on MSAA.
609609
* @related cf_app_set_msaa cf_msaa_string
610610
*/
611611
#define CF_MSAA_DEFS \
@@ -749,7 +749,7 @@ CF_API void CF_CALL cf_app_set_fullscreen_mode(void);
749749
/**
750750
* @function cf_app_set_title
751751
* @category app
752-
* @brief Sets the application' true fullscreen mode's title.
752+
* @brief Sets the application's true fullscreen mode's title.
753753
* @related cf_app_set_windowed_mode cf_app_set_borderless_fullscreen_mode cf_app_set_fullscreen_mode cf_app_set_title cf_app_set_icon
754754
*/
755755
CF_API void CF_CALL cf_app_set_title(const char* title);
@@ -775,7 +775,7 @@ CF_API float CF_CALL cf_app_get_framerate(void);
775775
/**
776776
* @function cf_app_get_smoothed_framerate
777777
* @category app
778-
* @brief Returns the smoothed framerate of the application. Last 60 frames are averaged. This values is controlled by `CF_FRAMERATE_SMOOTHING`.
778+
* @brief Returns the smoothed framerate of the application. Last 60 frames are averaged. This value is controlled by `CF_FRAMERATE_SMOOTHING`.
779779
* @related cf_app_get_framerate cf_app_get_smoothed_framerate
780780
*/
781781
CF_API float CF_CALL cf_app_get_smoothed_framerate(void);

include/cute_array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* alen(a)--;
4848
* CF_ASSERT(alen(a) == 0);
4949
* afree(a);
50-
* @remarks `a` must not by `NULL`. This function returns a proper l-value, so you can assign to it, i.e. increment/decrement can be quite useful.
50+
* @remarks `a` must not be `NULL`. This function returns a proper l-value, so you can assign to it, i.e. increment/decrement can be quite useful.
5151
* @related dyna asize acount acap afit apush apop aend alast aclear aset arev ahash adel astatic afree
5252
*/
5353
#define alen(a) cf_array_len(a)

include/cute_audio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ typedef struct CF_SoundParams
312312
/* @member Default: 1.0f. Lower numbers lower the pitch and increase playback speed. Higher numbers increase the pitch and reduce playback speed. */
313313
float pitch;
314314

315-
/* @member Default: 0. Specify the sample to start playing at. In term of seconds this would be the `cf_audio_sample_rate` * seconds. */
315+
/* @member Default: 0. Specify the sample to start playing at. In terms of seconds this would be the `cf_audio_sample_rate` * seconds. */
316316
int sample_index;
317317
} CF_SoundParams;
318318
// @end
@@ -362,7 +362,7 @@ CF_API void CF_CALL cf_sound_set_on_finish_callback(void (*on_finished)(CF_Sound
362362
* @category audio
363363
* @brief Returns whether or not a sound is active.
364364
* @param sound The sound.
365-
* @return Rreturns true if the sound is active, or false if it finished playing (and was not looped).
365+
* @return Returns true if the sound is active, or false if it finished playing (and was not looped).
366366
* @related CF_SoundParams CF_Sound cf_sound_params_defaults cf_play_sound cf_sound_is_active cf_sound_get_is_paused cf_sound_get_is_looped cf_sound_get_volume cf_sound_get_sample_index cf_sound_set_sample_index cf_sound_set_is_paused cf_sound_set_is_looped cf_sound_set_volume cf_sound_stop cf_sound_set_pitch cf_sound_get_pitch
367367
*/
368368
CF_API bool CF_CALL cf_sound_is_active(CF_Sound sound);

include/cute_base64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern "C" {
3838
* @category base64
3939
* @brief Calculates the size of data after base64 decoding it.
4040
* @param size The size of base64 encoded data.
41-
* @return Returns the number of bytes the raw dencoded data will take up. This will deflate the size ~33%.
41+
* @return Returns the number of bytes the raw decoded data will take up. This will deflate the size ~33%.
4242
* @remarks Use this for the `dst_size` in `cf_base64_decode`.
4343
* Base64 encoding is useful for storing data as text in a copy-paste-safe manner. For more information about
4444
* base64 encoding see this link: [RFC-4648](https://tools.ietf.org/html/rfc4648) or [Wikipedia Base64](https://en.wikipedia.org/wiki/Base64).

include/cute_color.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ CF_INLINE CF_Pixel cf_make_pixel_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a
203203
* @param hex An integer value, e.g. 0xFFAACC11.
204204
* @related CF_Pixel cf_make_pixel_rgb_f cf_make_pixel_rgba_f cf_make_pixel_rgb cf_make_pixel_rgba cf_make_pixel_hex cf_make_pixel_hex_string
205205
*/
206-
CF_INLINE CF_Pixel cf_make_pixel_hex(int hex) { return cf_make_pixel_rgba((uint8_t)((hex & 0xFF000000) >> 24), (uint8_t)((hex & 0x00FF0000) >> 16), (uint8_t)((hex & 0x0000FF00) >> 8), (uint8_t)(hex & 0x000000FF)); }
206+
CF_INLINE CF_Pixel cf_make_pixel_hex(int hex) { unsigned int h = (unsigned int)hex; return cf_make_pixel_rgba((uint8_t)((h & 0xFF000000) >> 24), (uint8_t)((h & 0x00FF0000) >> 16), (uint8_t)((h & 0x0000FF00) >> 8), (uint8_t)(h & 0x000000FF)); }
207207

208208
/**
209209
* @function cf_make_pixel_hex_string
@@ -618,7 +618,7 @@ CF_INLINE char* cf_pixel_to_string(CF_Pixel p) { char* s = NULL; return shex(s,
618618
* @param c The color.
619619
* @related cf_color_to_pixel cf_color_to_int_rgb cf_color_to_int_rgba cf_color_to_string
620620
*/
621-
CF_INLINE CF_Pixel cf_color_to_pixel(CF_Color c) { CF_Pixel p; p.colors.r = (int)((uint8_t)(c.r * 255.0f)); p.colors.g = (int)((uint8_t)(c.g * 255.0f)); p.colors.b = (int)((uint8_t)(c.b * 255.0f)); p.colors.a = (int)((uint8_t)(c.a * 255.0f)); return p; }
621+
CF_INLINE CF_Pixel cf_color_to_pixel(CF_Color c) { CF_Pixel p; p.colors.r = (uint8_t)(c.r * 255.0f); p.colors.g = (uint8_t)(c.g * 255.0f); p.colors.b = (uint8_t)(c.b * 255.0f); p.colors.a = (uint8_t)(c.a * 255.0f); return p; }
622622

623623
/**
624624
* @function cf_color_to_int_rgb
@@ -791,7 +791,7 @@ CF_INLINE CF_Pixel cf_pixel_black(void) { return cf_make_pixel_rgb(0, 0, 0); }
791791
/**
792792
* @function cf_pixel_white
793793
* @category graphics
794-
* @brief Helper function to return a invisible `white`.
794+
* @brief Helper function to return a white `CF_Pixel`.
795795
* @related cf_pixel_invisible cf_pixel_black cf_pixel_white cf_pixel_red cf_pixel_green cf_pixel_blue cf_pixel_yellow cf_pixel_orange cf_pixel_purple cf_pixel_grey cf_pixel_cyan cf_pixel_magenta
796796
*/
797797
CF_INLINE CF_Pixel cf_pixel_white(void) { return cf_make_pixel_rgb(255, 255, 255); }
@@ -925,8 +925,8 @@ CF_INLINE float softlight(float base, float blend) { return cf_softlight(base, b
925925
CF_INLINE CF_Color overlay(CF_Color base, CF_Color blend) { return cf_overlay_color(base, blend); }
926926
CF_INLINE CF_Color softlight(CF_Color base, CF_Color blend) { return cf_softlight_color(base, blend); }
927927

928-
CF_INLINE CF_Pixel operator*(CF_Pixel a, int s) { return cf_mul_pixel(a, s); }
929-
CF_INLINE CF_Pixel operator/(CF_Pixel a, int s) { return cf_div_pixel(a, s); }
928+
CF_INLINE CF_Pixel operator*(CF_Pixel a, int s) { return cf_mul_pixel(a, (uint8_t)s); }
929+
CF_INLINE CF_Pixel operator/(CF_Pixel a, int s) { return cf_div_pixel(a, (uint8_t)s); }
930930
CF_INLINE CF_Pixel operator+(CF_Pixel a, CF_Pixel b) { return cf_add_pixel(a, b); }
931931
CF_INLINE CF_Pixel operator-(CF_Pixel a, CF_Pixel b) { return cf_sub_pixel(a, b); }
932932
CF_INLINE bool operator==(CF_Pixel a, CF_Pixel b) { return a.val == b.val; }

include/cute_coroutine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CF_API CF_Coroutine CF_CALL cf_make_coroutine(CF_CoroutineFn* fn, int stack_size
6262
* @category coroutine
6363
* @brief Destroys a coroutine created by `cf_make_coroutine`.
6464
* @param co The coroutine.
65-
* @remarks All objects on the coroutine's stack will get automically cleaned up.
65+
* @remarks All objects on the coroutine's stack will get automatically cleaned up.
6666
* @related CF_Coroutine CF_CoroutineFn CF_CoroutineState cf_make_coroutine cf_destroy_coroutine cf_coroutine_state_to_string cf_coroutine_resume cf_coroutine_yield cf_coroutine_state cf_coroutine_get_udata cf_coroutine_push cf_coroutine_pop cf_coroutine_bytes_pushed cf_coroutine_space_remaining cf_coroutine_currently_running
6767
*/
6868
CF_API void CF_CALL cf_destroy_coroutine(CF_Coroutine co);
@@ -205,7 +205,7 @@ CF_API size_t CF_CALL cf_coroutine_space_remaining(CF_Coroutine co);
205205
* @function cf_coroutine_currently_running
206206
* @category coroutine
207207
* @brief Returns the opaque pointer to the coroutine currently running.
208-
* @remarks Each coroutine has ther `co` pointer handed to them as the only parameter in `CF_CoroutineFn`, so you likely
208+
* @remarks Each coroutine has their `co` pointer handed to them as the only parameter in `CF_CoroutineFn`, so you likely
209209
* already have access to the coroutine pointer. However, this function is made available here for convenience.
210210
* For example, your coroutines may call into other functions -- instead of passing around a `co` pointer everywhere,
211211
* your helper functions can simply fetch the `CF_Coroutine` pointer themselves on an as-needed basis by calling

include/cute_draw.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ CF_API void CF_CALL cf_draw_bezier_line2(CF_V2 a, CF_V2 c0, CF_V2 c1, CF_V2 b, i
377377
* @param b The end point.
378378
* @param thickness The thickness of the line to draw.
379379
* @param arrow_width The width of the arrow to draw.
380-
* @remarks This function is intended only for debug purposes. It's implemented in naive way so the
380+
* @remarks This function is intended only for debug purposes. It's implemented in a naive way so the
381381
* arrow shaft will overdraw atop the arrow head. This will become visible if the arrow is
382382
* drawn with any transparency.
383383
* @related cf_draw_line cf_draw_polyline cf_draw_bezier_line cf_draw_bezier_line2 cf_draw_arrow
@@ -676,8 +676,8 @@ typedef struct CF_Vertex
676676
*
677677
* Call `cf_set_vertex_callback` to setup your callback.
678678
*
679-
* There is no adjecancy info provided. If you need to know which triangles connect to others you
680-
* should probably redesign your feature to not require adjecancy information, or use your own custom
679+
* There is no adjacency info provided. If you need to know which triangles connect to others you
680+
* should probably redesign your feature to not require adjacency information, or use your own custom
681681
* rendering solution. With a custom solution you may use low-level graphics in cute_graphics.h, where
682682
* any adjacency info can be controlled 100% by you a-priori.
683683
* @related CF_Vertex CF_VertexFn cf_set_vertex_callback
@@ -1091,7 +1091,7 @@ typedef bool (CF_TextEffectFn)(CF_TextEffect* fx);
10911091
* When registering a custom text effect, any parameters in the string will be stored for you
10921092
* automatically. You only need to fetch them with the appropriate cf_text_effect_get*** function.
10931093
* Note: You can also setup parameters for markup as strings, not just numbers/colors. Example: `<color=#2c5ee8 metadata=\"Just some string.\">blue text</color>`,
1094-
* where the `color` markup contains a parameter called `metadata` and a strinf value of `"Just some string."`.
1094+
* where the `color` markup contains a parameter called `metadata` and a string value of `"Just some string."`.
10951095
* @related CF_TextEffect CF_TextEffectFn cf_text_effect_register cf_text_effect_get_number cf_text_effect_get_color cf_text_effect_get_string
10961096
*/
10971097
CF_API void CF_CALL cf_text_effect_register(const char* name, CF_TextEffectFn* fn);
@@ -1155,7 +1155,7 @@ typedef struct CF_MarkupInfo
11551155
/* @member The number of `CF_Aabb`'s in `bounds`. */
11561156
int bounds_count;
11571157

1158-
/* @member An arry of `CF_Aabb`'s, one per line the `text` string provided in the `cf_text_markup_info_fn` callback. */
1158+
/* @member An array of `CF_Aabb`'s, one per line the `text` string provided in the `cf_text_markup_info_fn` callback. */
11591159
CF_Aabb* bounds;
11601160
} CF_MarkupInfo;
11611161
// @end
@@ -1307,7 +1307,7 @@ CF_API CF_RenderState CF_CALL cf_draw_peek_render_state(void);
13071307
* can likely get away with 4096 on most devices. Larger internal atlases can be useful to decrease the number of
13081308
* draw calls used, and also enables support for high-res image rendering.
13091309
*
1310-
* Please not you should put in power of 2 atlases sizes to make the hardware happy. Here are the recommended range
1310+
* Please note you should put in power of 2 atlases sizes to make the hardware happy. Here are the recommended range
13111311
* of sizes available:
13121312
*
13131313
* - 256

include/cute_file_system.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern "C" {
3333
* const char* filename = spfname("/data/collections/rare/big_gem.txt");
3434
* printf("%s\n", filename);
3535
* // Prints: big_gem.txt
36-
* @remarks Call `sfree` on the return value when done. `sp` stands for "sting path".
36+
* @remarks Call `sfree` on the return value when done. `sp` stands for "string path".
3737
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
3838
*/
3939
#define spfname(s) cf_path_get_filename(s)
@@ -47,7 +47,7 @@ extern "C" {
4747
* const char* filename = spfname("/data/collections/rare/big_gem.txt");
4848
* printf("%s\n", filename);
4949
* // Prints: big_gem
50-
* @remarks Call `sfree` on the return value when done. `sp` stands for "sting path".
50+
* @remarks Call `sfree` on the return value when done. `sp` stands for "string path".
5151
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
5252
*/
5353
#define spfname_no_ext(s) cf_path_get_filename_no_ext(s)
@@ -61,7 +61,7 @@ extern "C" {
6161
* const char* ext = spfname("/data/collections/rare/big_gem.txt");
6262
* printf("%s\n", ext);
6363
* // Prints: .txt
64-
* @remarks Call `sfree` on the return value when done. `sp` stands for "sting path".
64+
* @remarks Call `sfree` on the return value when done. `sp` stands for "string path".
6565
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
6666
*/
6767
#define spext(s) cf_path_get_ext(s)
@@ -72,7 +72,7 @@ extern "C" {
7272
* @brief Returns true if the file's extension matches, false otherwise.
7373
* @param s The path string.
7474
* @param ext The file extension.
75-
* @remarks `sp` stands for "sting path".
75+
* @remarks `sp` stands for "string path".
7676
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
7777
*/
7878
#define spext_equ(s, ext) cf_path_ext_equ(s, ext)
@@ -84,7 +84,7 @@ extern "C" {
8484
* @param s The path string.
8585
* @return If the string is not a dynamic string from CF's string API, a new string is returned. Otherwise the
8686
* string is modified in-place. You must call `sfree` if a new dynamic string is returned, when done.
87-
* @remarks `sp` stands for "sting path".
87+
* @remarks `sp` stands for "string path".
8888
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
8989
*/
9090
#define sppop(s) cf_path_pop(s)
@@ -97,7 +97,7 @@ extern "C" {
9797
* @param n The number of files to pop from the directory path.
9898
* @return If the string is not a dynamic string from CF's string API, a new string is returned. Otherwise the
9999
* string is modified in-place. You must call `sfree` if a new dynamic string is returned, when done.
100-
* @remarks `sp` stands for "sting path".
100+
* @remarks `sp` stands for "string path".
101101
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
102102
*/
103103
#define sppopn(s, n) cf_path_pop_n(s, n)
@@ -125,7 +125,7 @@ extern "C" {
125125
* const char* filename = spfname("/data/collections/rare/big_gem.txt");
126126
* printf("%s\n", filename);
127127
* // Prints: /rare
128-
* @remarks `sp` stands for "sting path". Call `sfree` on the return value when done.
128+
* @remarks `sp` stands for "string path". Call `sfree` on the return value when done.
129129
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
130130
*/
131131
#define spdir_of(s) cf_path_directory_of(s)
@@ -139,7 +139,7 @@ extern "C" {
139139
* const char* filename = spfname("/data/collections/rare/big_gem.txt");
140140
* printf("%s\n", filename);
141141
* // Prints: /data
142-
* @remarks `sp` stands for "sting path". Call `sfree` on the return value when done.
142+
* @remarks `sp` stands for "string path". Call `sfree` on the return value when done.
143143
* @related spfname spfname_no_ext spext spext_equ sppop sppopn spcompact spdir_of sptop_of spnorm
144144
*/
145145
#define sptop_of(s) cf_path_top_directory(s)
@@ -263,7 +263,7 @@ typedef struct CF_File CF_File;
263263
* @related CF_File CF_Stat cf_file_type_to_string
264264
*/
265265
#define CF_FILE_TYPE_DEFS \
266-
/* @entry A reguler file, such as a .txt or .pdf file. */ \
266+
/* @entry A regular file, such as a .txt or .pdf file. */ \
267267
CF_ENUM(FILE_TYPE_REGULAR, 0) \
268268
/* @entry A directory/folder. */ \
269269
CF_ENUM(FILE_TYPE_DIRECTORY, 1) \
@@ -338,7 +338,7 @@ CF_API const char* CF_CALL cf_fs_get_base_directory(void);
338338
* @function cf_fs_get_working_directory
339339
* @category file
340340
* @brief Returns the current working directory in platform-dependent notation.
341-
* @remarks Not all platforms have the concept of a working directory, but this function will sill try to return something sane in these cases.
341+
* @remarks Not all platforms have the concept of a working directory, but this function will still try to return something sane in these cases.
342342
* @related cf_fs_get_base_directory cf_fs_set_write_directory cf_fs_get_user_directory cf_fs_mount cf_fs_dismount cf_fs_get_working_directory
343343
*/
344344
CF_API const char* CF_CALL cf_fs_get_working_directory(void);
@@ -395,7 +395,7 @@ CF_API const char* CF_CALL cf_fs_get_user_directory(const char* company_name, co
395395
* modding or download patches, as duplicate entries will be searched for on the path as normal,
396396
* without the need to overwrite each other on the actual disk.
397397
*
398-
* You can mount an actual directory or an archive file. If it's an archive the vitrual file
398+
* You can mount an actual directory or an archive file. If it's an archive the virtual file
399399
* system will treat it like a normal directory for you. There are a variety of archive file
400400
* formats supported (see top of file).
401401
*

0 commit comments

Comments
 (0)