aboutsummaryrefslogtreecommitdiff
path: root/src/fb/chfb.cpp
blob: cfd76352b5d2c554c55a5ed352c701a5a626a489 (plain) (blame)
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
#include "fb/chfb.h"
#include <algorithm>
#include "math/vector.h"
#include "o3d/vertex_data.h"

using namespace engine::fb;
using engine::math::Vector3, engine::o3d::VertexData;

CharacterFrameBuffer::CharacterFrameBuffer(unsigned int w, unsigned int h) {
    resize(w, h);
}

void CharacterFrameBuffer::resize(unsigned int w, unsigned int h) {
    this->w = w;
    this->h = h;
    chars_vector.resize(w * h);
    clear();
}

void CharacterFrameBuffer::clear() {
    std::fill(chars_vector.begin(), chars_vector.end(), ' ');
}

void CharacterFrameBuffer::draw_point(int x, int y, const Vector3& loc, const VertexData& vd, const engine::math::Vector3& normal) {
    (void) x;
    (void) y;
    (void) loc;
    (void) vd;
    (void) normal;
    chars_vector[x + y * w] = 'A';
}