Example #1
0
bool Scene::drawCutscene() {
  if (_cutscene.isPlaying()) {
    if (_cutscene.hasNewFrame()) {
      DGFrame* frame = _cutscene.currentFrame();
      _cutsceneTexture->loadRawData(frame->data, frame->width, frame->height);
    }
    
    _cutsceneTexture->bind();
    
    // Note this is inverted
    float coords[] = {
                               0,                           0,
      float(config.displayWidth),                           0,
      float(config.displayWidth), float(config.displayHeight),
                               0, float(config.displayHeight)
    };

    renderManager.enablePostprocess();
    cameraManager.beginOrthoView();
    renderManager.enableTextures();
    renderManager.drawSlide(coords);
    renderManager.disablePostprocess();
    renderManager.drawPostprocessedView();
    
    return true;
  }
  
  return false;
}
Example #2
0
void Scene::loadCutscene(const char* fileName) {
  _cutsceneTexture = new Texture;
  
  _cutscene.setResource(config.path(kPathResources, fileName, kObjectVideo).c_str());
  videoManager.requestVideo(&_cutscene);
  
  if (_cutscene.isLoaded()) {
    _cutscene.play();
    
    DGFrame* frame = _cutscene.currentFrame();
    _cutsceneTexture->loadRawData(frame->data, frame->width, frame->height);
    
    _isCutsceneLoaded = true;
  }
}