~ubuntu-branches/ubuntu/natty/spring/natty

« back to all changes in this revision

Viewing changes to rts/Game/UI/CursorIcons.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-09-23 18:56:03 UTC
  • mfrom: (3.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100923185603-st97s5chplo42y7w
Tags: 0.82.5.1+dfsg1-1ubuntu1
* Latest upstream version for online play
* debian/control: Replace (rather than conflict) spring-engine
  - spring-engine will be a dummy package (LP: #612905)
  - also set maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
 
2
 
1
3
#include "StdAfx.h"
2
4
#include <algorithm>
3
5
 
11
13
#include "Game/Camera.h"
12
14
#include "Game/GameHelper.h"
13
15
#include "Rendering/glFont.h"
 
16
#include "Rendering/UnitDrawer.h"
14
17
#include "Rendering/GL/myGL.h"
15
 
#include "Rendering/UnitModels/UnitDrawer.h"
16
18
#include "Sim/Units/UnitDef.h"
17
19
#include "Sim/Units/UnitDefHandler.h"
18
20
 
19
21
 
20
 
 
21
 
 
22
22
CCursorIcons cursorIcons;
23
23
 
24
24
 
123
123
 
124
124
void CCursorIcons::DrawTexts()
125
125
{
126
 
        glViewport(gu->viewPosX, 0, gu->viewSizeX, gu->viewSizeY);
 
126
        glViewport(globalRendering->viewPosX, 0, globalRendering->viewSizeX, globalRendering->viewSizeY);
127
127
        glColor4f(1.0f,  1.0f, 1.0f, 1.0f);
128
128
 
129
129
        const float fontScale = 1.0f;
130
 
        const float yOffset = 50.0f * gu->pixelY;
 
130
        const float yOffset = 50.0f * globalRendering->pixelY;
131
131
 
132
132
        font->Begin();
133
133
        font->SetColors(); //default
136
136
        for (it = texts.begin(); it != texts.end(); ++it) {
137
137
                const float3 winPos = camera->CalcWindowCoordinates(it->pos);
138
138
                if (winPos.z <= 1.0f) {
139
 
                        const float x = (winPos.x * gu->pixelX);
140
 
                        const float y = (winPos.y * gu->pixelY) + yOffset;
 
139
                        const float x = (winPos.x * globalRendering->pixelX);
 
140
                        const float y = (winPos.y * globalRendering->pixelY) + yOffset;
141
141
 
142
142
                        if (guihandler->GetOutlineFonts()) {
143
143
                                font->glPrint(x, y, fontScale, FONT_OUTLINE | FONT_CENTER | FONT_TOP | FONT_SCALE | FONT_NORM, it->text);
152
152
 
153
153
void CCursorIcons::DrawBuilds()
154
154
{
155
 
        glViewport(gu->viewPosX, 0, gu->viewSizeX, gu->viewSizeY);
 
155
        glViewport(globalRendering->viewPosX, 0, globalRendering->viewSizeX, globalRendering->viewSizeY);
156
156
 
157
157
        glEnable(GL_DEPTH_TEST);
158
158
        glColor4f(1.0f, 1.0f, 1.0f, 0.3f);