Skip to content

Commit

Permalink
Trying a fix for the automated CI build...
Browse files Browse the repository at this point in the history
  • Loading branch information
glampert committed Dec 17, 2015
1 parent 10cdf72 commit e0daadc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
13 changes: 7 additions & 6 deletions debug_draw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,30 +1152,31 @@ void pushStringGlyphs(float x, float y, const char * text, ddVec3Param color, co
const float fixedHeight = DD_FONT_CHAR_SET.charHeight;
const float tabsWidth = fixedWidth * 4.0f; // TAB = 4 spaces.

for (const char * p = text; *p != '\0'; ++p)
for (; *text != '\0'; ++text)
{
if (static_cast<int>(*p) >= FontCharSet::MaxChars)
const int charVal = *text;
if (charVal >= FontCharSet::MaxChars)
{
continue;
}
if (*p == ' ')
if (charVal == ' ')
{
x += fixedWidth * scaling;
continue;
}
if (*p == '\t')
if (charVal == '\t')
{
x += tabsWidth * scaling;
continue;
}
if (*p == '\n')
if (charVal == '\n')
{
y += fixedHeight * scaling;
x = initialX;
continue;
}

const FontChar fontChar = DD_FONT_CHAR_SET.chars[static_cast<int>(*p)];
const FontChar fontChar = DD_FONT_CHAR_SET.chars[charVal];
const float u0 = (fontChar.x + 0.5f) / scaleU;
const float v0 = (fontChar.y + 0.5f) / scaleV;
const float u1 = u0 + (fixedWidth / scaleU);
Expand Down
20 changes: 14 additions & 6 deletions samples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Brief: Makefile for the Debug Draw samples.
#
# Remarks:
# - Tested only on Mac OSX.
# - GLFW must be installed in the system.
# - Tested only on Mac OSX; Should work on Linux.
# - GLFW must be installed on the system.
# (http://www.glfw.org)
#------------------------------------------------

# Select the proper OpenGL library for Mac (-framework OpenGL)
Expand All @@ -17,14 +18,21 @@ else
OPENGL_LIB = -lGL
endif

# Should be installed and visible in the system path!
GLFW_LIB = -lGLFW3
# GLFW Should be installed and visible in the system path!
ifeq ($(UNAME), Darwin)
CXXFLAGS = -Weffc++
GLFW_LIB = -L/usr/local/lib -lglfw3
endif
ifeq ($(UNAME), Linux)
CXXFLAGS = `pkg-config --cflags glfw3`
GLFW_LIB = `pkg-config --static --libs glfw3`
endif

# Define 'VERBOSE' to get the full console output.
# Otherwise we print a shorter message for each rule.
ifndef VERBOSE
QUIET = @
ECHO_COMPILING = @echo "-> Building OpenGL samples ..."
ECHO_COMPILING = @echo "-> Building Debug Draw samples ..."
ECHO_CLEANING = @echo "-> Cleaning ..."
endif

Expand All @@ -34,7 +42,7 @@ endif

LIB_FILES = $(OPENGL_LIB) $(GLFW_LIB)
INC_DIRS = -I. -I.. -Ivectormath -Igl3w/include
CXXFLAGS = $(INC_DIRS) -Wall -Wextra -Weffc++ -Winit-self -Wunused -Wshadow
CXXFLAGS += $(INC_DIRS) -O2 -Wall -Wextra -Winit-self -Wunused -Wshadow

SRC_FILES_GL_LEGACY_SAMP = sample_gl_legacy.cpp
BIN_TARGET_GL_LEGACY_SAMP = sample_gl_legacy
Expand Down

0 comments on commit e0daadc

Please sign in to comment.