Issue 61: Everything compiles now without errors in warning level 4.
This commit is contained in:
parent
1d8c7dac84
commit
9bb95ef45b
Binary file not shown.
@ -122,7 +122,7 @@
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
|
@ -1091,12 +1091,12 @@ void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *ad
|
||||
}
|
||||
}
|
||||
|
||||
int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
|
||||
int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo * /*info*/, int /*glyph1*/, int /*glyph2*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2)
|
||||
int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo * /*info*/, int /*ch1*/, int /*ch2*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ static int compareItemY(const void* va, const void* vb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void calcExtends(BoundsItem* items, int nitems, int imin, int imax,
|
||||
static void calcExtends(const BoundsItem* items, const int /*nitems*/,
|
||||
const int imin, const int imax,
|
||||
float* bmin, float* bmax)
|
||||
{
|
||||
bmin[0] = items[imin].bmin[0];
|
||||
|
@ -270,6 +270,6 @@ void ConvexVolumeTool::handleRender()
|
||||
dd.end();
|
||||
}
|
||||
|
||||
void ConvexVolumeTool::handleRenderOverlay(double* proj, double* model, int* view)
|
||||
void ConvexVolumeTool::handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/)
|
||||
{
|
||||
}
|
||||
|
@ -222,9 +222,9 @@ bool InputGeom::load(const char* filePath)
|
||||
sscanf(row+1, "%f %f %f %f %f %f %f %d %d %d",
|
||||
&v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &rad, &bidir, &area, &flags);
|
||||
m_offMeshConRads[m_offMeshConCount] = rad;
|
||||
m_offMeshConDirs[m_offMeshConCount] = bidir;
|
||||
m_offMeshConAreas[m_offMeshConCount] = area;
|
||||
m_offMeshConFlags[m_offMeshConCount] = flags;
|
||||
m_offMeshConDirs[m_offMeshConCount] = (unsigned char)bidir;
|
||||
m_offMeshConAreas[m_offMeshConCount] = (unsigned char)area;
|
||||
m_offMeshConFlags[m_offMeshConCount] = (unsigned short)flags;
|
||||
m_offMeshConCount++;
|
||||
}
|
||||
}
|
||||
@ -396,7 +396,7 @@ void InputGeom::deleteConvexVolume(int i)
|
||||
m_volumes[i] = m_volumes[m_volumeCount];
|
||||
}
|
||||
|
||||
void InputGeom::drawConvexVolumes(struct duDebugDraw* dd, bool hilight)
|
||||
void InputGeom::drawConvexVolumes(struct duDebugDraw* dd, bool /*hilight*/)
|
||||
{
|
||||
dd->depthMask(false);
|
||||
|
||||
|
@ -130,7 +130,7 @@ void Sample::handleRender()
|
||||
duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f);
|
||||
}
|
||||
|
||||
void Sample::handleRenderOverlay(double* proj, double* model, int* view)
|
||||
void Sample::handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/*
|
||||
static int loadBin(const char* path, unsigned char** data)
|
||||
{
|
||||
FILE* fp = fopen(path, "rb");
|
||||
@ -47,7 +48,7 @@ static int loadBin(const char* path, unsigned char** data)
|
||||
fclose(fp);
|
||||
return size;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
Sample_Debug::Sample_Debug() :
|
||||
m_chf(0),
|
||||
@ -167,7 +168,7 @@ void Sample_Debug::handleRender()
|
||||
duDebugDrawRawContours(&dd, *m_cset);
|
||||
}
|
||||
|
||||
void Sample_Debug::handleRenderOverlay(double* proj, double* model, int* view)
|
||||
void Sample_Debug::handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
imguiValue("Click LMB to highlight a tile.");
|
||||
}
|
||||
|
||||
virtual void handleClick(const float* p, bool shift)
|
||||
virtual void handleClick(const float* p, bool /*shift*/)
|
||||
{
|
||||
m_hitPosSet = true;
|
||||
vcopy(m_hitPos,p);
|
||||
@ -561,7 +561,7 @@ static void drawLabels(int x, int y, int w, int h,
|
||||
}
|
||||
|
||||
static void drawGraph(const char* name, int x, int y, int w, int h, float sd,
|
||||
const int* samples, int n, int nsamples, const char* unit)
|
||||
const int* samples, int n, int /*nsamples*/, const char* unit)
|
||||
{
|
||||
char text[64];
|
||||
int first, last, maxval;
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void handleRenderOverlay(double* proj, double* model, int* view)
|
||||
virtual void handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -506,7 +506,7 @@ bool imguiCollapse(const char* text, bool checked, bool enabled)
|
||||
const int cx = x+BUTTON_HEIGHT/2-CHECK_SIZE/2;
|
||||
const int cy = y+BUTTON_HEIGHT/2-CHECK_SIZE/2;
|
||||
|
||||
bool over = inRect(x, y, w, h);
|
||||
bool over = enabled && inRect(x, y, w, h);
|
||||
bool res = buttonLogic(id, over);
|
||||
|
||||
if (checked)
|
||||
@ -514,8 +514,11 @@ bool imguiCollapse(const char* text, bool checked, bool enabled)
|
||||
else
|
||||
addGfxCmdTriangle(cx, cy, CHECK_SIZE, CHECK_SIZE, 1, imguiRGBA(255,255,255,isActive(id)?255:200));
|
||||
|
||||
addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
|
||||
if (enabled)
|
||||
addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
else
|
||||
addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -557,7 +560,7 @@ bool imguiSlider(const char* text, float* val, float vmin, float vmax, float vin
|
||||
if (u > 1) u = 1;
|
||||
int m = (int)(u * range);
|
||||
|
||||
bool over = inRect(x+m, y, SLIDER_MARKER_WIDTH, SLIDER_HEIGHT);
|
||||
bool over = enabled && inRect(x+m, y, SLIDER_MARKER_WIDTH, SLIDER_HEIGHT);
|
||||
bool res = buttonLogic(id, over);
|
||||
bool valChanged = false;
|
||||
|
||||
@ -592,8 +595,16 @@ bool imguiSlider(const char* text, float* val, float vmin, float vmax, float vin
|
||||
char msg[128];
|
||||
snprintf(msg, 128, fmt, *val);
|
||||
|
||||
addGfxCmdText(x+SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
addGfxCmdText(x+w-SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, msg, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
if (enabled)
|
||||
{
|
||||
addGfxCmdText(x+SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
addGfxCmdText(x+w-SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, msg, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200));
|
||||
}
|
||||
else
|
||||
{
|
||||
addGfxCmdText(x+SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200));
|
||||
addGfxCmdText(x+w-SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, msg, imguiRGBA(128,128,128,200));
|
||||
}
|
||||
|
||||
return res || valChanged;
|
||||
}
|
||||
|
@ -21,11 +21,25 @@
|
||||
#include "imgui.h"
|
||||
#include "SDL.h"
|
||||
#include "SDL_opengl.h"
|
||||
#define STBTT_malloc(x,y) malloc(x)
|
||||
#define STBTT_free(x,y) free(x)
|
||||
|
||||
void imguifree(void* ptr, void* userptr);
|
||||
void* imguimalloc(size_t size, void* userptr);
|
||||
|
||||
#define STBTT_malloc(x,y) imguimalloc(x,y)
|
||||
#define STBTT_free(x,y) imguifree(x,y)
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
#include "stb_truetype.h"
|
||||
|
||||
void imguifree(void* ptr, void* /*userptr*/)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void* imguimalloc(size_t size, void* /*userptr*/)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
static const unsigned TEMP_COORD_COUNT = 100;
|
||||
static float g_tempCoords[TEMP_COORD_COUNT*2];
|
||||
static float g_tempNormals[TEMP_COORD_COUNT*2];
|
||||
|
@ -149,7 +149,7 @@ static SampleItem g_samples[] =
|
||||
static const int g_nsamples = sizeof(g_samples)/sizeof(SampleItem);
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int /*argc*/, char** /*argv*/)
|
||||
{
|
||||
// Init SDL
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user