aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/text_out.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llrender/text_out.cpp')
-rw-r--r--linden/indra/llrender/text_out.cpp115
1 files changed, 0 insertions, 115 deletions
diff --git a/linden/indra/llrender/text_out.cpp b/linden/indra/llrender/text_out.cpp
deleted file mode 100644
index 572ed03..0000000
--- a/linden/indra/llrender/text_out.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
1/**
2 * @file text_out.cpp
3 * @brief Text rendering implementation
4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28/* DEPRECATED - Use LLFontGL for raw rendering, or make an LLTextBox to hold the text */
29
30#include "linden_common.h"
31
32#include "text_out.h"
33#include "llfontgl.h"
34//#include "vmath.h"
35#include "v4color.h"
36
37#define MAX_TEXT_LINE_LENGTH (256)
38#define MAX_TEXT_LINES (128)
39
40extern S32 gWindowWidth;
41extern S32 gWindowHeight;
42
43S32 gNumTextLines = 0;
44
45LLColor4 gCurrentColor;
46//U8 gCurrentBGColor[] = { 32, 32, 32 };
47
48//F32 gCurrentScale = 10.f;
49
50typedef struct s_text_line
51{
52// const LLFontGL *font;
53// U8 color[3];
54// U8 bg_color[3];
55 char line[MAX_TEXT_LINE_LENGTH]; /* Flawfinder: ignore */
56 S32 x, y;
57// ETextModifiers tm;
58// ETextColorModifiers fcm;
59// ETextColorModifiers bcm;
60} TEXT_LINE;
61
62TEXT_LINE gTextLine[MAX_TEXT_LINES];
63
64void set_text_color( const LLColor4& color )
65{
66 gCurrentColor = color;
67}
68/*
69void set_text_bg_color(S32 red, S32 green, S32 blue)
70{
71 gCurrentBGColor[0] = red;
72 gCurrentBGColor[1] = green;
73 gCurrentBGColor[2] = blue;
74}
75*/
76void reset_num_text_lines(void)
77{
78 gNumTextLines = 0;
79}
80
81void add_text(S32 x, S32 y, char *text) // , ETextModifiers tm, ETextColorModifiers fcm, ETextColorModifiers bcm)
82{
83 if (gNumTextLines > MAX_TEXT_LINES) return;
84
85 TEXT_LINE *linep = &gTextLine[gNumTextLines++];
86
87 strcpy(linep->line, text); /* Flawfinder: ignore */
88 linep->x = x;
89 linep->y = y;
90}
91
92
93// Writes text on the screen. Deprecated, don't write new code using this.
94void show_text_gl(void)
95{
96 S32 i;
97
98 TEXT_LINE *linep;
99
100 if (gNumTextLines > MAX_TEXT_LINES)
101 {
102 gNumTextLines = MAX_TEXT_LINES;
103 }
104
105 for (i = 0; i < gNumTextLines; i++)
106 {
107 linep = &gTextLine[i];
108
109 LLFontGL::sMonospace->renderUTF8(linep->line, 0, (F32)linep->x, (F32)linep->y, gCurrentColor,
110 LLFontGL::LEFT, LLFontGL::TOP,
111 LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE);
112 }
113 gNumTextLines = 0;
114}
115