Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmeteor/include/ameteor/graphics/bglayer.hpp
2 views
1
// Meteor - A Nintendo Gameboy Advance emulator
2
// Copyright (C) 2009-2011 Philippe Daouadi
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef __GRAPHICS_BG_LAYER_H__
18
#define __GRAPHICS_BG_LAYER_H__
19
20
#include "ameteor/memory.hpp"
21
#include "ameteor/io.hpp"
22
23
#include <vector>
24
#include <stdint.h>
25
26
namespace AMeteor
27
{
28
namespace Graphics
29
{
30
class BgLayer
31
{
32
public :
33
BgLayer (int8_t num, Memory& memory, Io& io, uint16_t* pPalette);
34
~BgLayer ();
35
36
inline uint8_t GetNum () const;
37
inline uint8_t GetPriority () const;
38
39
void DrawLine0 (uint8_t line, uint16_t* ptr);
40
void DrawLine2 (uint16_t* ptr,
41
int32_t refX, int32_t refY,
42
int16_t dx, int16_t dy);
43
void DrawLine3 (uint16_t* ptr,
44
int32_t refX, int32_t refY,
45
int16_t dx, int16_t dy);
46
void DrawLine4 (uint8_t line, uint16_t* ptr,
47
int32_t curX, int32_t curY,
48
int16_t dx, int16_t dmx, int16_t dy, int16_t dmy, bool frame1);
49
void DrawLine5 (uint16_t* ptr,
50
int32_t refX, int32_t refY,
51
int16_t dx, int16_t dy, bool frame1);
52
void FillList ();
53
54
void UpdateCnt (uint16_t cnt);
55
inline void UpdateXOff (uint16_t off);
56
inline void UpdateYOff (uint16_t off);
57
58
private :
59
Memory& m_memory;
60
Io& m_io;
61
62
const uint8_t m_num;
63
uint8_t m_priority;
64
65
uint16_t m_cnt;
66
bool m_hicolor;
67
uint16_t m_xoff, m_yoff;
68
// in text mode
69
uint8_t m_tWidth, m_tHeight;
70
// in rotation/scale mode
71
uint8_t m_rWidth, m_rHeight;
72
73
uint32_t m_mapAdd;
74
uint32_t m_charAdd;
75
uint16_t* m_pPalette;
76
};
77
78
inline uint8_t BgLayer::GetNum () const
79
{
80
return m_num;
81
}
82
83
inline uint8_t BgLayer::GetPriority () const
84
{
85
return m_priority;
86
}
87
88
inline void BgLayer::UpdateXOff (uint16_t off)
89
{
90
m_xoff = off;
91
}
92
93
inline void BgLayer::UpdateYOff (uint16_t off)
94
{
95
m_yoff = off;
96
}
97
}
98
}
99
100
#endif
101
102