diff --git a/stb_divide.h b/stb_divide.h index 81948ae..74ef396 100644 --- a/stb_divide.h +++ b/stb_divide.h @@ -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 } diff --git a/stb_image.h b/stb_image.h index 5a6c863..f58ee52 100644 --- a/stb_image.h +++ b/stb_image.h @@ -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 stbiw_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. // // =========================================================================== diff --git a/stb_tilemap_editor.h b/stb_tilemap_editor.h index 41b47fe..bf1fbe8 100644 --- a/stb_tilemap_editor.h +++ b/stb_tilemap_editor.h @@ -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) diff --git a/stb_truetype.h b/stb_truetype.h index 89b47c1..37b96d6 100644 --- a/stb_truetype.h +++ b/stb_truetype.h @@ -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 diff --git a/stb_voxel_render.h b/stb_voxel_render.h index 130da54..895921d 100644 --- a/stb_voxel_render.h +++ b/stb_voxel_render.h @@ -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<