Kaynağa Gözat

Added sample04-sandbox physics sample to macos port

Sean Paul Taylor 14 yıl önce
ebeveyn
işleme
4dd3828294

+ 3 - 0
gameplay.xcworkspace/contents.xcworkspacedata

@@ -19,4 +19,7 @@
    <FileRef
       location = "group:gameplay-samples/sample03-character/sample03-character.xcodeproj">
    </FileRef>
+   <FileRef
+      location = "group:gameplay-samples/sample04-sandbox/sample04-sandbox.xcodeproj">
+   </FileRef>
 </Workspace>

+ 6 - 6
gameplay/src/Font.cpp

@@ -213,8 +213,8 @@ void Font::drawText(const char* text, int x, int y, const Vector4& color, float
             xPos += (size>>1)*4;
             break;
         default:
-            unsigned int index = c - 32; // HACK for ASCII
-            if (index >= 0 && index < _glyphCount)
+            int index = c - 32; // HACK for ASCII
+            if (index >= 0 && index < (int)_glyphCount)
             {
                 Glyph& g = _glyphs[index];
                 _batch->draw(xPos, yPos, g.width * scale, size, g.uvs[0], g.uvs[1], g.uvs[2], g.uvs[3], color);
@@ -555,9 +555,9 @@ void Font::drawText(const char* text, const Rectangle& area, const Vector4& colo
         for (unsigned int i = 0; i < tokenLength; ++i)
         {
             char c = token[i];
-            unsigned int glyphIndex = c - 32; // HACK for ASCII
+            int glyphIndex = c - 32; // HACK for ASCII
         
-            if (glyphIndex >= 0 && glyphIndex < _glyphCount)
+            if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount)
             {
                 Glyph& g = _glyphs[glyphIndex];
 
@@ -971,8 +971,8 @@ unsigned int Font::getTokenWidth(const char* token, unsigned int length, float s
             tokenWidth += (size>>1)*4;
             break;
         default:
-            unsigned int glyphIndex = c - 32;
-            if (glyphIndex >= 0 && glyphIndex < _glyphCount)
+            int glyphIndex = c - 32;
+            if (glyphIndex >= 0 && glyphIndex < (int)_glyphCount)
             {
                 Glyph& g = _glyphs[glyphIndex];
                 tokenWidth += g.width * scale + (size>>3);