Path: blob/master/libmeteor/include/ameteor/graphics/bglayer.hpp
2 views
// Meteor - A Nintendo Gameboy Advance emulator1// Copyright (C) 2009-2011 Philippe Daouadi2//3// This program is free software: you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation, either version 3 of the License, or6// (at your option) any later version.7//8// This program is distributed in the hope that it will be useful,9// but WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11// GNU General Public License for more details.12//13// You should have received a copy of the GNU General Public License14// along with this program. If not, see <http://www.gnu.org/licenses/>.1516#ifndef __GRAPHICS_BG_LAYER_H__17#define __GRAPHICS_BG_LAYER_H__1819#include "ameteor/memory.hpp"20#include "ameteor/io.hpp"2122#include <vector>23#include <stdint.h>2425namespace AMeteor26{27namespace Graphics28{29class BgLayer30{31public :32BgLayer (int8_t num, Memory& memory, Io& io, uint16_t* pPalette);33~BgLayer ();3435inline uint8_t GetNum () const;36inline uint8_t GetPriority () const;3738void DrawLine0 (uint8_t line, uint16_t* ptr);39void DrawLine2 (uint16_t* ptr,40int32_t refX, int32_t refY,41int16_t dx, int16_t dy);42void DrawLine3 (uint16_t* ptr,43int32_t refX, int32_t refY,44int16_t dx, int16_t dy);45void DrawLine4 (uint8_t line, uint16_t* ptr,46int32_t curX, int32_t curY,47int16_t dx, int16_t dmx, int16_t dy, int16_t dmy, bool frame1);48void DrawLine5 (uint16_t* ptr,49int32_t refX, int32_t refY,50int16_t dx, int16_t dy, bool frame1);51void FillList ();5253void UpdateCnt (uint16_t cnt);54inline void UpdateXOff (uint16_t off);55inline void UpdateYOff (uint16_t off);5657private :58Memory& m_memory;59Io& m_io;6061const uint8_t m_num;62uint8_t m_priority;6364uint16_t m_cnt;65bool m_hicolor;66uint16_t m_xoff, m_yoff;67// in text mode68uint8_t m_tWidth, m_tHeight;69// in rotation/scale mode70uint8_t m_rWidth, m_rHeight;7172uint32_t m_mapAdd;73uint32_t m_charAdd;74uint16_t* m_pPalette;75};7677inline uint8_t BgLayer::GetNum () const78{79return m_num;80}8182inline uint8_t BgLayer::GetPriority () const83{84return m_priority;85}8687inline void BgLayer::UpdateXOff (uint16_t off)88{89m_xoff = off;90}9192inline void BgLayer::UpdateYOff (uint16_t off)93{94m_yoff = off;95}96}97}9899#endif100101102