Map::Map(DBItem item, BackgroundLayer *bgLayer, MapLayer *mapLayer, FoWLayer *fowLayer, DrawingLayer *drawingLayer, bool isMj) : DBItem(), ui(new Ui::Map) { ui->setupUi(this); QHash<QString, QVariant> itemHashMap = item.getHashMap(); columnsValues_ = item.getHashMap(); int id = itemHashMap.value("id").toInt(); QString windowtitle = itemHashMap.value("windowtitle").toString(); int sceneHeight = itemHashMap.value("sceneheight").toInt(); int sceneWidth = itemHashMap.value("scenewidth").toInt(); bool isImage = itemHashMap.value("isimage").toBool(); id_ = id; setWindowTitle(windowtitle); initRole(isMj); m_Layers = new Layers(bgLayer, mapLayer, fowLayer, drawingLayer); initScene(sceneWidth, sceneHeight); initLayers(false); initDisplay(); initTooltip(); m_IsImage = isImage; if(isImage){ initAsImage(); } }
int main(void) { static uint8_t bSak[1]; static uint8_t bUid[10]; static uint8_t bMoreCardsAvailable; static uint8_t bLength; PH_CHECK_SUCCESS_FCT(status, initLayers()); uint8_t key1[6] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}; uint8_t key2[6] = {0xb4, 0xce, 0x31, 0x75, 0x17, 0xda}; uint8_t key3[6] = {0xfe, 0xa7, 0xe1, 0x1b, 0x47, 0xb3}; uint8_t key4[6] = {0x58, 0x23, 0xc4, 0xec, 0xfa, 0x01}; uint8_t key5[6] = {0x8f, 0xef, 0x64, 0x3e, 0x56, 0x04}; uint8_t key6[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; uint8_t key7[6] = {0x04, 0x91, 0xa7, 0x84, 0x17, 0x1a}; static const uint16_t nbKeys = 7; uint8_t * keys[7] = {key1, key2, key3, key4, key5, key6, key7}; uint8_t sector = 43; uint8_t buffer[64]; uint8_t i; for (sector = 0; sector < 16; sector++) { printf("Sector %02d:\n", sector); if(forceReadSector(sector, keys, nbKeys, buffer) == PH_ERR_SUCCESS) { for (i = 0; i < 64; i++) { printf("%02X ", buffer[i]); if ((i + 1) % 16 == 0) printf("\n"); } } else { for (i = 0; i < 64; i++) { printf("xx "); if ((i + 1) % 16 == 0) printf("\n"); } } printf("\n"); } return 0; }
bool GraphicEngine::update() { if (!_win->isOpen()) return false; if (_cord->get("map") == 0 && _cord->get("map.w") != 0) { _camera->init(); initLayers(); } _camera->update(); if (_cord->get("map") == 0 && _cord->get("map.w") != 0) _map->generateEnv(); _map->update(); _renderEnv->update(); _renderObj->update(); _renderInter->update(); return true; }
Map::Map(bool isImage, QString mapName, QString bgFilename, int bgWidth, int bgHeight , TokenItem *tokenItem, int tileStep, bool isMj, QWidget *parent) : QWidget(parent), DBItem(), ui(new Ui::Map) { ui->setupUi(this); this->setWindowTitle(mapName); initRole(isMj); QPixmap bgPixmap = createBgPixmap(bgFilename, bgWidth, bgHeight, tileStep); m_Layers = new Layers(bgPixmap, 2, 2, Qt::black, tileStep, tokenItem, isMj); initScene(tileStep); initLayers(); initDisplay(); initTooltip(); m_IsImage = isImage; if(isImage){ initAsImage(); } }