added some TODO comments and some cleanup

This commit is contained in:
ZappoMan 2015-01-28 11:03:05 -08:00
parent 6821f31f14
commit 7d9de6d0eb
12 changed files with 18 additions and 10 deletions

View file

@ -2799,7 +2799,6 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
if (!selfAvatarOnly) {
// draw a red sphere
float originSphereRadius = 0.05f;
glColor3f(1,0,0);
DependencyManager::get<GeometryCache>()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
// also, metavoxels

View file

@ -106,7 +106,10 @@ void drawText(int x, int y, float scale, float radians, int mono,
//
glPushMatrix();
glTranslatef(static_cast<float>(x), static_cast<float>(y), 0.0f);
// TODO: add support for color to rendering text
glColor3fv(color);
glRotated(double(radians * DEGREES_PER_RADIAN), 0.0, 0.0, 1.0);
glScalef(scale / 0.1f, scale / 0.1f, 1.0f);
textRenderer(mono)->draw(0, 0, string);

View file

@ -56,7 +56,8 @@ void AudioIOStatsRenderer::render(const float* color, int width, int height) {
int w = STATS_WIDTH;
int h = statsHeight;
DependencyManager::get<GeometryCache>()->renderQuad(x, y, w, h, backgroundColor);
glColor4f(1, 1, 1, 1);
glColor4f(1, 1, 1, 1); // TODO: change text rendering to use collor as parameter
int horizontalOffset = x + 5;
int verticalOffset = y;

View file

@ -196,8 +196,6 @@ void AudioScope::renderLineStrip(int id, const glm::vec4& color, int x, int y, i
geometryCache->updateVertices(id, points, color);
geometryCache->renderVertices(gpu::LINE_STRIP, id);
glColor4f(1, 1, 1, 1);
}
int AudioScope::addBufferToScope(QByteArray* byteArray, int frameOffset, const int16_t* source, int sourceSamplesPerChannel,

View file

@ -703,7 +703,7 @@ void Avatar::renderDisplayName() {
DependencyManager::get<GeometryCache>()->renderBevelCornersRect(left, bottom, right - left, top - bottom, 3,
glm::vec4(0.2f, 0.2f, 0.2f, _displayNameAlpha * DISPLAYNAME_BACKGROUND_ALPHA / DISPLAYNAME_ALPHA));
glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha);
glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha); // TODO: change text rendering to use collor as parameter
QByteArray ba = _displayName.toLocal8Bit();
const char* text = ba.data();

View file

@ -88,6 +88,7 @@ void BandwidthMeter::Stream::updateValue(double amount) {
void BandwidthMeter::setColorRGBA(unsigned c) {
// TODO: add support for color to rendering text, since that's why this method is used
glColor4ub(GLubyte( c >> 24),
GLubyte((c >> 16) & 0xff),
GLubyte((c >> 8) & 0xff),

View file

@ -49,7 +49,6 @@ void Line3DOverlay::render(RenderArgs* args) {
float alpha = getAlpha();
xColor color = getColor();
const float MAX_COLOR = 255.0f;
glColor4f(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
glm::vec3 position = getPosition();
@ -60,6 +59,8 @@ void Line3DOverlay::render(RenderArgs* args) {
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
if (getIsDashedLine()) {
// TODO: add support for color to renderDashedLine()
glColor4f(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
DependencyManager::get<GeometryCache>()->renderDashedLine(_position, _end, _geometryCacheID);
} else {
DependencyManager::get<GeometryCache>()->renderLine(_start, _end, colorv4, _geometryCacheID);

View file

@ -124,6 +124,7 @@ void Text3DOverlay::render(RenderArgs* args) {
enableClipPlane(GL_CLIP_PLANE2, 0.0f, -1.0f, 0.0f, clipMinimum.y + clipDimensions.y);
enableClipPlane(GL_CLIP_PLANE3, 0.0f, 1.0f, 0.0f, -clipMinimum.y);
// TODO: add support for color to rendering text
glColor3f(_color.red / MAX_COLOR, _color.green / MAX_COLOR, _color.blue / MAX_COLOR);
float alpha = getAlpha();
QStringList lines = _text.split("\n");

View file

@ -90,6 +90,7 @@ void TextOverlay::render(RenderArgs* args) {
int x = _bounds.left() + _leftMargin + leftAdjust;
int y = _bounds.top() + _topMargin + topAdjust;
// TODO: add support for color to rendering text
glColor3f(_color.red / MAX_COLOR, _color.green / MAX_COLOR, _color.blue / MAX_COLOR);
float alpha = getAlpha();
QStringList lines = _text.split("\n");

View file

@ -63,7 +63,7 @@ void RenderableLightEntityItem::render(RenderArgs* args) {
}
#ifdef WANT_DEBUG
glColor4f(diffuseR, diffuseG, diffuseB, 1.0f);
glm::vec4 color(diffuseR, diffuseG, diffuseB, 1.0f);
glPushMatrix();
glTranslatef(position.x, position.y, position.z);
glm::vec3 axis = glm::axis(rotation);
@ -73,7 +73,7 @@ void RenderableLightEntityItem::render(RenderArgs* args) {
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
glScalef(dimensions.x, dimensions.y, dimensions.z);
DependencyManager::get<DeferredLightingEffect>()->renderWireSphere(0.5f, 15, 15);
DependencyManager::get<DeferredLightingEffect>()->renderWireSphere(0.5f, 15, 15, color);
glPopMatrix();
glPopMatrix();
#endif

View file

@ -78,6 +78,7 @@ void RenderableTextEntityItem::render(RenderArgs* args) {
enableClipPlane(GL_CLIP_PLANE3, 0.0f, 1.0f, 0.0f, -clipMinimum.y);
xColor textColor = getTextColorX();
// TODO: add support for color to rendering text
glColor3f(textColor.red / MAX_COLOR, textColor.green / MAX_COLOR, textColor.blue / MAX_COLOR);
QStringList lines = _text.split("\n");
int lineOffset = maxHeight;

View file

@ -154,14 +154,16 @@ const gpu::TexturePointer& TextureCache::getPermutationNormalTexture() {
}
const unsigned char OPAQUE_WHITE[] = { 0xFF, 0xFF, 0xFF, 0xFF };
const unsigned char TRANSPARENT_WHITE[] = { 0xFF, 0xFF, 0xFF, 0x0 };
const unsigned char OPAQUE_BLACK[] = { 0x0, 0x0, 0x0, 0xFF };
//const unsigned char TRANSPARENT_WHITE[] = { 0xFF, 0xFF, 0xFF, 0x0 };
//const unsigned char OPAQUE_BLACK[] = { 0x0, 0x0, 0x0, 0xFF };
const unsigned char OPAQUE_BLUE[] = { 0x80, 0x80, 0xFF, 0xFF };
/*
static void loadSingleColorTexture(const unsigned char* color) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, color);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
*/
const gpu::TexturePointer& TextureCache::getWhiteTexture() {
if (_whiteTexture.isNull()) {