Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions common/platform_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ bool IsFile(const string& sPath)
if (hFind == INVALID_HANDLE_VALUE)
return false;

if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
FindClose(hFind);
return false;
}

return true;
}
Expand All @@ -181,8 +183,10 @@ bool IsDirectory(const string& sPath)
if (hFind == INVALID_HANDLE_VALUE)
return false;

if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
FindClose(hFind);
return true;
}

return false;
}
Expand Down
3 changes: 1 addition & 2 deletions glfw-2.7.9/lib/tga.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ int _glfwReadTGA( _GLFWstream *s, GLFWimage *img, int flags )
swapy = 0;
break;
}
if( (swapy && !(flags & GLFW_ORIGIN_UL_BIT)) ||
(!swapy && (flags & GLFW_ORIGIN_UL_BIT)) )
if( swapy != (flags & GLFW_ORIGIN_UL_BIT))
{
src = pix;
dst = &pix[ (h.height-1)*h.width*bpp ];
Expand Down
4 changes: 2 additions & 2 deletions math/spline.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
struct CubicSpline
{
vec3 m_points[SPLINE_POINTS];
vec3 m_coeffs[SPLINE_POINTS-1][4];
vec3 m_coeffs[SPLINE_POINTS][4];
float m_lengths[SPLINE_POINTS - 1];

// Spline construction, Burden & Faires - Numerical Analysis 9th, algorithm 3.4
Expand All @@ -15,7 +15,7 @@ struct CubicSpline

vec3 a[SPLINE_POINTS];
for (int i = 1; i <= n - 1; i++)
a[i] = 3 * ((m_points[i + 1] - 2*m_points[i] + m_points[i - 1]));
a[i] = 3 * (m_points[i + 1] - 2*m_points[i] + m_points[i - 1]);

float l[SPLINE_POINTS];
float mu[SPLINE_POINTS];
Expand Down
2 changes: 1 addition & 1 deletion renderer/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool CApplication::OpenWindow(size_t iWidth, size_t iHeight, bool bFullscreen, b
return false;
}

glfwSetWindowTitle((char*)L"Math for Game Developers");
glfwSetWindowTitle("Math for Game Developers");

int iScreenWidth;
int iScreenHeight;
Expand Down
7 changes: 6 additions & 1 deletion renderer/image_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,10 @@ static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
skip(s, tga_palette_start );
// load the palette
tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 );
if (!tga_palette) return epuc("outofmem", "Out of memory");
if (!tga_palette) {
free(tga_data);
return epuc("outofmem", "Out of memory");
}
if (!getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
free(tga_data);
free(tga_palette);
Expand Down Expand Up @@ -3492,6 +3495,8 @@ static stbi_uc *pic_load(stbi *s,int *px,int *py,int *comp,int req_comp)

// intermediate buffer is RGBA
result = (stbi_uc *) malloc(x*y*4);
if (!result) return epuc("cannot allocate", "cannot allocate memory");

memset(result, 0xff, x*y*4);

if (!pic_load2(s,x,y,comp, result)) {
Expand Down