Detour/Demo: Fixed compile warnings and errors for VC++.
This commit is contained in:
parent
b418aba176
commit
caeb02e2fd
@ -567,7 +567,6 @@ float dtStatNavMesh::findDistanceToWall(dtStatPolyRef centerRef, const float* ce
|
||||
{
|
||||
actualNode->flags &= ~DT_NODE_CLOSED;
|
||||
actualNode->pidx = newNode.pidx;
|
||||
actualNode->cost = newNode.cost;
|
||||
actualNode->total = newNode.total;
|
||||
|
||||
if (actualNode->flags & DT_NODE_OPEN)
|
||||
@ -663,7 +662,6 @@ int dtStatNavMesh::findPolysAround(dtStatPolyRef centerRef, const float* centerP
|
||||
{
|
||||
actualNode->flags &= ~DT_NODE_CLOSED;
|
||||
actualNode->pidx = newNode.pidx;
|
||||
actualNode->cost = newNode.cost;
|
||||
actualNode->total = newNode.total;
|
||||
|
||||
if (actualNode->flags & DT_NODE_OPEN)
|
||||
|
@ -493,7 +493,7 @@ bool dtTiledNavMesh::closestPointToPoly(dtTilePolyRef ref, const float* pos, flo
|
||||
if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false;
|
||||
const dtTileHeader* h = m_tiles[it].header;
|
||||
|
||||
if (ip >= h->npolys) return false;
|
||||
if (ip >= (unsigned int)h->npolys) return false;
|
||||
const dtTilePoly* poly = &h->polys[ip];
|
||||
|
||||
float closestDistSqr = FLT_MAX;
|
||||
@ -692,7 +692,7 @@ int dtTiledNavMesh::findPath(dtTilePolyRef startRef, dtTilePolyRef endRef,
|
||||
m_openList->push(startNode);
|
||||
|
||||
dtNode* lastBestNode = startNode;
|
||||
unsigned short lastBestNodeCost = startNode->total;
|
||||
float lastBestNodeCost = startNode->total;
|
||||
while (!m_openList->empty())
|
||||
{
|
||||
dtNode* bestNode = m_openList->pop();
|
||||
@ -943,7 +943,7 @@ bool dtTiledNavMesh::getPortalPoints(dtTilePolyRef from, dtTilePolyRef to, float
|
||||
dtDecodeTileId(from, salt, it, ip);
|
||||
if (it >= DT_MAX_TILES) return false;
|
||||
if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false;
|
||||
if (ip >= m_tiles[it].header->npolys) return false;
|
||||
if (ip >= (unsigned int)m_tiles[it].header->npolys) return false;
|
||||
const dtTileHeader* fromHeader = m_tiles[it].header;
|
||||
const dtTilePoly* fromPoly = &fromHeader->polys[ip];
|
||||
|
||||
@ -1172,7 +1172,6 @@ int dtTiledNavMesh::findPolysAround(dtTilePolyRef centerRef, const float* center
|
||||
{
|
||||
actualNode->flags &= ~DT_NODE_CLOSED;
|
||||
actualNode->pidx = newNode.pidx;
|
||||
actualNode->cost = newNode.cost;
|
||||
actualNode->total = newNode.total;
|
||||
|
||||
if (actualNode->flags & DT_NODE_OPEN)
|
||||
@ -1313,7 +1312,6 @@ float dtTiledNavMesh::findDistanceToWall(dtTilePolyRef centerRef, const float* c
|
||||
{
|
||||
actualNode->flags &= ~DT_NODE_CLOSED;
|
||||
actualNode->pidx = newNode.pidx;
|
||||
actualNode->cost = newNode.cost;
|
||||
actualNode->total = newNode.total;
|
||||
|
||||
if (actualNode->flags & DT_NODE_OPEN)
|
||||
@ -1343,7 +1341,7 @@ const dtTilePoly* dtTiledNavMesh::getPolyByRef(dtTilePolyRef ref) const
|
||||
dtDecodeTileId(ref, salt, it, ip);
|
||||
if (it >= DT_MAX_TILES) return 0;
|
||||
if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0;
|
||||
if (ip >= m_tiles[it].header->npolys) return 0;
|
||||
if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0;
|
||||
return &m_tiles[it].header->polys[ip];
|
||||
}
|
||||
|
||||
@ -1353,7 +1351,7 @@ const float* dtTiledNavMesh::getPolyVertsByRef(dtTilePolyRef ref) const
|
||||
dtDecodeTileId(ref, salt, it, ip);
|
||||
if (it >= DT_MAX_TILES) return 0;
|
||||
if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0;
|
||||
if (ip >= m_tiles[it].header->npolys) return 0;
|
||||
if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0;
|
||||
return m_tiles[it].header->verts;
|
||||
}
|
||||
|
||||
@ -1363,6 +1361,6 @@ const dtTileLink* dtTiledNavMesh::getPolyLinksByRef(dtTilePolyRef ref) const
|
||||
dtDecodeTileId(ref, salt, it, ip);
|
||||
if (it >= DT_MAX_TILES) return 0;
|
||||
if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0;
|
||||
if (ip >= m_tiles[it].header->npolys) return 0;
|
||||
if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0;
|
||||
return m_tiles[it].header->links;
|
||||
}
|
||||
|
Binary file not shown.
@ -41,7 +41,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\Recast\Include;$(NOINHERIT)"
|
||||
AdditionalIncludeDirectories="..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\Recast\Include;..\..\Contrib;$(NOINHERIT)"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -117,7 +117,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\Recast\Include;$(NOINHERIT)"
|
||||
AdditionalIncludeDirectories="..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\Recast\Include;..\..\Contrib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
@ -171,196 +171,236 @@
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Source\Builder.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\BuilderStatMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\BuilderStatMeshSimple.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\BuilderStatMeshTiled.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\ChunkyTriMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourDebugDraw.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourStatNavMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourStatNavMeshBuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourTiledNavMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourTiledNavMeshBuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\glfont.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\imgui.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\MeshLoaderObj.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\Recast.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastContour.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastDebugDraw.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastFilter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastLog.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastRasterization.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastRegion.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastTimer.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Include\Builder.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\BuilderStatMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\BuilderStatMeshSimple.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\BuilderStatMeshTiled.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\BuilderTiledMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\BuilderTiledMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\ChunkyTriMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourDebugDraw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourStatNavMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourStatNavMeshBuilder.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourTiledNavMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourTiledNavMeshBuilder.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\glfont.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\imgui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\MeshLoaderObj.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\Recast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastDebugDraw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastLog.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastTimer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\SDLMain.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Recast"
|
||||
>
|
||||
<Filter
|
||||
Name="Include"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\Recast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastDebugDraw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastLog.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastTimer.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\Recast.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastContour.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastDebugDraw.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastFilter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastLog.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastRasterization.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastRegion.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastTimer.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Detour"
|
||||
>
|
||||
<Filter
|
||||
Name="Include"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourCommon.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourDebugDraw.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourNode.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourStatNavMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourStatNavMeshBuilder.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourTileNavMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourTileNavMeshBuilder.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourCommon.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourDebugDraw.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourNode.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourStatNavMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourStatNavMeshBuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourTileNavMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourTileNavMeshBuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Demo"
|
||||
>
|
||||
<Filter
|
||||
Name="Include"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Include\ChunkyTriMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\imgui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\imguiRenderGL.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\MeshLoaderObj.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\Sample.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\Sample_StatMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\Sample_StatMeshSimple.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\Sample_StatMeshTiled.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Include\Sample_TileMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Contrib\stb_truetype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Source\ChunkyTriMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\imgui.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\imguiRenderGL.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\MeshLoaderObj.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\Sample.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\Sample_StatMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\Sample_StatMeshSimple.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\Sample_StatMeshTiled.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Source\Sample_TileMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
@ -309,7 +309,7 @@ void Sample_StatMesh::toolRenderOverlay(double* proj, double* model, int* view)
|
||||
if (m_eposSet && gluProject((GLdouble)m_epos[0], (GLdouble)m_epos[1], (GLdouble)m_epos[2],
|
||||
model, proj, view, &x, &y, &z))
|
||||
{
|
||||
imguiDrawText((int)x, (float)(y-25), IMGUI_ALIGN_CENTER, "End", imguiRGBA(0,0,0,220));
|
||||
imguiDrawText((int)x, (int)(y-25), IMGUI_ALIGN_CENTER, "End", imguiRGBA(0,0,0,220));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
#include "imgui.h"
|
||||
#include "SDL.h"
|
||||
@ -280,10 +281,10 @@ static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_ind
|
||||
int round_x = STBTT_ifloor(*xpos + b->xoff);
|
||||
int round_y = STBTT_ifloor(*ypos - b->yoff);
|
||||
|
||||
q->x0 = round_x;
|
||||
q->y0 = round_y;
|
||||
q->x1 = round_x + b->x1 - b->x0;
|
||||
q->y1 = round_y - b->y1 + b->y0;
|
||||
q->x0 = (float)round_x;
|
||||
q->y0 = (float)round_y;
|
||||
q->x1 = (float)round_x + b->x1 - b->x0;
|
||||
q->y1 = (float)round_y - b->y1 + b->y0;
|
||||
|
||||
q->s0 = b->x0 / (float)pw;
|
||||
q->t0 = b->y0 / (float)pw;
|
||||
@ -366,7 +367,7 @@ void imguiRenderGLDraw()
|
||||
int nq = imguiGetRenderQueueSize();
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
for (unsigned i = 0; i < nq; ++i)
|
||||
for (int i = 0; i < nq; ++i)
|
||||
{
|
||||
const imguiGfxCmd& cmd = q[i];
|
||||
if (cmd.type == IMGUI_GFXCMD_RECT)
|
||||
|
@ -224,7 +224,7 @@ int main(int argc, char *argv[])
|
||||
const SDL_VideoInfo* vi = SDL_GetVideoInfo();
|
||||
|
||||
int width = vi->current_w - 20;
|
||||
int height = vi->current_h - 50;
|
||||
int height = vi->current_h - 80;
|
||||
SDL_Surface* screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL);
|
||||
if (!screen)
|
||||
{
|
||||
@ -241,13 +241,6 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* if(!g_font.create("font.cfnt"))
|
||||
{
|
||||
printf("Could not load font.\n");
|
||||
SDL_Quit();
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
float t = 0.0f;
|
||||
Uint32 lastTime = SDL_GetTicks();
|
||||
int mx = 0, my = 0;
|
||||
@ -721,7 +714,7 @@ int main(int argc, char *argv[])
|
||||
const float r = 25.0f;
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
const float a = (float)i / 20.0f * M_PI*2;
|
||||
const float a = (float)i / 20.0f * (float)M_PI*2;
|
||||
const float fx = (float)x + cosf(a)*r;
|
||||
const float fy = (float)y + sinf(a)*r;
|
||||
glVertex2f(fx,fy);
|
||||
|
Loading…
x
Reference in New Issue
Block a user