CameraProcess.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2004 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef CAMERAPROCESS_H
00020 #define CAMERAPROCESS_H
00021 
00022 #include "Process.h"
00023 #include "intrinsics.h"
00024 
00025 //
00026 // The camera process. This works in 3 ways
00027 //
00028 // It can be set to stay where it currently is
00029 // It can be set to follow an item.
00030 // It can be set to scroll to an item
00031 // It can be set to stay at a location
00032 //
00033 
00034 class CameraProcess : public Process
00035 {
00036 public:
00037         CameraProcess();
00038         CameraProcess(uint16 itemnum);                                                  // Follow item/Do nothing
00039         CameraProcess(sint32 x, sint32 y, sint32 z);                            // Goto location
00040         CameraProcess(sint32 x, sint32 y, sint32 z, sint32 time);       // Scroll to location
00041 
00042         virtual ~CameraProcess();
00043 
00044         // p_dynamic_cast stuff
00045         ENABLE_RUNTIME_CLASSTYPE();
00046 
00047         virtual bool run(const uint32 framenum);
00048 
00049         // You will notice that this isn't the same as how Item::GetLerped works
00050         void GetLerped(sint32 &x, sint32 &y, sint32 &z, sint32 factor, bool noupdate=false);
00051 
00055         uint16 FindRoof(sint32 factor);
00056 
00057         INTRINSIC(I_setCenterOn);
00058         INTRINSIC(I_move_to);
00059         INTRINSIC(I_scrollTo);
00060         INTRINSIC(I_startQuake);
00061         INTRINSIC(I_stopQuake);
00062 
00063         static void                             GetCameraLocation(sint32 &x, sint32 &y, sint32 &z);
00064         static CameraProcess*   GetCameraProcess() { return camera; }
00065         static uint16                   SetCameraProcess(CameraProcess *);      // Set the current camera process. Adds process. Return PID
00066         static void                             ResetCameraProcess();
00067 
00068         static void                             SetEarthquake(sint32 e) { 
00069                 earthquake = e; 
00070                 if (!e)  eq_x = eq_y = 0;
00071         }
00072 
00073         void                                    ItemMoved();
00074 
00075         virtual void terminate();       // Terminate NOW!
00076 
00077         bool loadData(IDataSource* ids, uint32 version);
00078 private:
00079         virtual void saveData(ODataSource* ods);
00080 
00081         sint32 sx, sy, sz;
00082         sint32 ex, ey, ez;
00083         sint32 time;
00084         sint32 elapsed;
00085         uint16 itemnum;
00086 
00087         sint32 last_framenum;
00088 
00089         static CameraProcess    *camera;
00090         static sint32 earthquake;
00091         static sint32 eq_x, eq_y;
00092 };
00093 
00094 #endif //CAMERAPROCESS_H

Generated on Fri Jul 27 22:27:10 2007 for pentagram by  doxygen 1.4.7