本文整理汇总了C++中MultiScreenHeader::read方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiScreenHeader::read方法的具体用法?C++ MultiScreenHeader::read怎么用?C++ MultiScreenHeader::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiScreenHeader
的用法示例。
在下文中一共展示了MultiScreenHeader::read方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
byte *Sword2Engine::fetchScreenHeader(byte *screenFile) {
if (isPsx()) { // In PSX version there's no MultiScreenHeader, so just skip resource header
return screenFile + ResHeader::size();
} else {
MultiScreenHeader mscreenHeader;
mscreenHeader.read(screenFile + ResHeader::size());
return screenFile + ResHeader::size() + mscreenHeader.screen;
}
}
示例2:
byte *Sword2Engine::fetchLayerHeader(byte *screenFile, uint16 layerNo) {
#ifdef SWORD2_DEBUG
ScreenHeader screenHead;
screenHead.read(fetchScreenHeader(screenFile));
assert(layerNo < screenHead.noLayers);
#endif
if (isPsx()) {
return screenFile + ResHeader::size() + ScreenHeader::size() + 2 + 0x400 + layerNo * LayerHeader::size();
} else {
MultiScreenHeader mscreenHeader;
mscreenHeader.read(screenFile + ResHeader::size());
return screenFile + ResHeader::size() + mscreenHeader.layers + layerNo * LayerHeader::size();
}
}
示例3: buildDisplay
void Screen::buildDisplay() {
if (_thisScreen.new_palette) {
// start the layer palette fading up
startNewPalette();
// should be reset to zero at start of each screen change
_largestLayerArea = 0;
_largestSpriteArea = 0;
}
// Does this ever happen?
if (!_thisScreen.background_layer_id)
return;
// there is a valid screen to run
setScrollTarget(_thisScreen.scroll_offset_x, _thisScreen.scroll_offset_y);
_vm->_mouse->animateMouse();
startRenderCycle();
byte *file = _vm->_resman->openResource(_thisScreen.background_layer_id);
MultiScreenHeader screenLayerTable;
memset(&screenLayerTable, 0, sizeof(screenLayerTable));
if (!Sword2Engine::isPsx()) // On PSX version, there would be nothing to read here
screenLayerTable.read(file + ResHeader::size());
// Render at least one frame, but if the screen is scrolling, and if
// there is time left, we will render extra frames to smooth out the
// scrolling.
do {
// first background parallax + related anims
if (Sword2Engine::isPsx() || screenLayerTable.bg_parallax[0]) { // No need to check on PSX version
renderParallax(_vm->fetchBackgroundParallaxLayer(file, 0), 0);
drawBackPar0Frames();
}
// second background parallax + related anims
if (!Sword2Engine::isPsx() && screenLayerTable.bg_parallax[1]) { // Nothing here in PSX version
renderParallax(_vm->fetchBackgroundParallaxLayer(file, 1), 1);
drawBackPar1Frames();
}
// normal backround layer (just the one!)
renderParallax(_vm->fetchBackgroundLayer(file), 2);
// sprites & layers
drawBackFrames(); // background sprites
drawSortFrames(file); // sorted sprites & layers
drawForeFrames(); // foreground sprites
// first foreground parallax + related anims
if (Sword2Engine::isPsx() || screenLayerTable.fg_parallax[0]) {
renderParallax(_vm->fetchForegroundParallaxLayer(file, 0), 3);
drawForePar0Frames();
}
// second foreground parallax + related anims
if (!Sword2Engine::isPsx() && screenLayerTable.fg_parallax[1]) {
renderParallax(_vm->fetchForegroundParallaxLayer(file, 1), 4);
drawForePar1Frames();
}
_vm->_debugger->drawDebugGraphics();
_vm->_fontRenderer->printTextBlocs();
_vm->_mouse->processMenu();
updateDisplay();
_frameCount++;
if (getTick() > _cycleTime) {
_fps = _frameCount;
_frameCount = 0;
_cycleTime = getTick() + 1000;
}
} while (!endRenderCycle());
_vm->_resman->closeResource(_thisScreen.background_layer_id);
}