00001 00002 // Copyright (C) 2004-2007 by The Allacrost Project 00003 // All Rights Reserved 00004 // 00005 // This code is licensed under the GNU GPL version 2. It is free software 00006 // and you may modify it and/or redistribute it under the terms of this license. 00007 // See http://www.gnu.org/copyleft/gpl.html for details. 00009 00010 /*!**************************************************************************** 00011 * \file scene.cpp 00012 * \author Tyler Olsen, roots@allacrost.org 00013 * \brief Source file for scene mode interface. 00014 *****************************************************************************/ 00015 00016 #include "utils.h" 00017 #include <iostream> 00018 #include "scene.h" 00019 #include "audio.h" 00020 #include "video.h" 00021 #include "input.h" 00022 #include "system.h" 00023 00024 using namespace std; 00025 using namespace hoa_mode_manager; 00026 using namespace hoa_input; 00027 using namespace hoa_system; 00028 using namespace hoa_video; 00029 using namespace hoa_pause; 00030 using namespace hoa_scene::private_scene; 00031 00032 namespace hoa_scene { 00033 00034 bool SCENE_DEBUG = false; 00035 00036 SceneMode::SceneMode() { 00037 if (SCENE_DEBUG) cout << "SCENE: SceneMode constructor invoked" << endl; 00038 mode_type = MODE_MANAGER_SCENE_MODE; 00039 00040 00041 // setup the scene Image Descriptor 00042 00043 // VideoManager->LoadImage(scene); 00044 } 00045 00046 00047 00048 // The destructor frees up our scene image 00049 SceneMode::~SceneMode() { 00050 if (SCENE_DEBUG) cout << "SCENE: SceneMode destructor invoked" << endl; 00051 // VideoManager->FreeImage(scene); 00052 } 00053 00054 00055 // Resets class members appropriately 00056 void SceneMode::Reset() { 00057 _scene_timer = 0; 00058 } 00059 00060 00061 00062 // Restores volume or unpauses audio, then pops itself from the game stack 00063 void SceneMode::Update() { 00064 uint32 time_elapsed = SystemManager->GetUpdateTime(); 00065 _scene_timer += time_elapsed; 00066 00067 // User must wait 0.75 seconds before they can exit the scene 00068 if ((InputManager->ConfirmPress() || InputManager->CancelPress()) && _scene_timer < MIN_SCENE_UPDATES) { 00069 ModeManager->Pop(); 00070 } 00071 } 00072 00073 00074 00075 // Draws the scene 00076 void SceneMode::Draw() { 00077 // Draw the scene, maybe with a filter that lets it fade in and out....? 00078 } 00079 00080 } // namespace hoa_scene
1.5.1