-
Notifications
You must be signed in to change notification settings - Fork 17
/
ClientInfo.cpp
52 lines (44 loc) · 1.16 KB
/
ClientInfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* This file is part of TSRE5.
*
* TSRE5 - train sim game engine and MSTS/OR Editors.
* Copyright (C) 2016 Piotr Gadecki <[email protected]>
*
* Licensed under GNU General Public License 3.0 or later.
*
* See LICENSE.md or https://www.gnu.org/licenses/gpl.html
*/
#include "ClientInfo.h"
#include "OglObj.h"
#include "TextObj.h"
ClientInfo::ClientInfo() {
username = "UNDEFINED";
X = Z = x = y = z = 0;
}
ClientInfo::ClientInfo(const ClientInfo& orig) {
}
ClientInfo::~ClientInfo() {
}
void ClientInfo::render(float playerRot) {
if (stick == NULL) {
stick = new OglObj();
float *punkty = new float[3 * 2];
int ptr = 0;
int i = 0;
punkty[ptr++] = 0;
punkty[ptr++] = 0;
punkty[ptr++] = 0;
punkty[ptr++] = 0;
punkty[ptr++] = 20;
punkty[ptr++] = 0;
stick->setMaterial(1.0, 1.0, 0.0);
stick->init(punkty, ptr, RenderItem::V, GL_LINES);
delete[] punkty;
}
if(name == NULL){
name = new TextObj(this->username, 16, 2.0);
name->setColor(0,0,0);
name->pos[1] = 20;
}
stick->render();
name->render(playerRot);
};