ScummVM API documentation
Ultima::Ultima8::CameraProcess Class Reference

#include <camera_process.h>

Inheritance diagram for Ultima::Ultima8::CameraProcess:
Ultima::Ultima8::Process

Public Member Functions

 CameraProcess (uint16 itemnum)
 
 CameraProcess (const Point3 &p)
 
 CameraProcess (const Point3 &p, int32 time)
 
void run () override
 
Point3 GetLerped (int32 factor, bool noupdate=false)
 
uint16 findRoof (int32 factor)
 
void moveToLocation (int32 x, int32 y, int32 z)
 
void moveToLocation (const Point3 &p)
 
 INTRINSIC (I_setCenterOn)
 
 INTRINSIC (I_moveTo)
 
 INTRINSIC (I_scrollTo)
 
 INTRINSIC (I_startQuake)
 
 INTRINSIC (I_stopQuake)
 
 INTRINSIC (I_getCameraX)
 
 INTRINSIC (I_getCameraY)
 
 INTRINSIC (I_getCameraZ)
 
void itemMoved ()
 
void terminate () override
 terminate the process. This wakes up all processes waiting for it.
 
bool loadData (Common::ReadStream *rs, uint32 version)
 
void saveData (Common::WriteStream *ws) override
 save Process data
 
uint16 getTrackedItem () const
 
- Public Member Functions inherited from Ultima::Ultima8::Process
 Process (ObjId _itemNum=0, uint16 type=0)
 
uint32 getProcessFlags () const
 
bool is_active () const
 
bool is_terminated () const
 
bool is_suspended () const
 
void fail ()
 terminate the process and recursively fail all processes waiting for it
 
void terminateDeferred ()
 terminate next frame
 
void setRunPaused ()
 run even when paused
 
void waitFor (ProcId pid)
 suspend until process 'pid' returns. If pid is 0, suspend indefinitely
 
void waitFor (Process *proc)
 suspend until process returns. If proc is 0, suspend indefinitely
 
void suspend ()
 suspend process
 
void wakeUp (uint32 result)
 Wake up when the process we were waiting for has finished.
 
virtual void onWakeUp ()
 A hook to add aditional behavior on wakeup, before anything else happens.
 
void setItemNum (ObjId it)
 
void setType (uint16 ty)
 
void setTicksPerRun (uint32 val)
 
ProcId getPid () const
 
ObjId getItemNum () const
 
uint16 getType () const
 
uint32 getTicksPerRun () const
 
virtual Common::String dumpInfo () const
 dump some info about this process to a string
 
bool loadData (Common::ReadStream *rs, uint32 version)
 load Process data
 
bool validateWaiters () const
 

Static Public Member Functions

static Point3 GetCameraLocation ()
 
static CameraProcessGetCameraProcess ()
 
static uint16 SetCameraProcess (CameraProcess *)
 
static void ResetCameraProcess ()
 
static void SetEarthquake (int32 e)
 

Additional Inherited Members

- Public Types inherited from Ultima::Ultima8::Process
enum  processflags {
  PROC_ACTIVE = 0x0001, PROC_SUSPENDED = 0x0002, PROC_TERMINATED = 0x0004, PROC_TERM_DEFERRED = 0x0008,
  PROC_FAILED = 0x0010, PROC_RUNPAUSED = 0x0020, PROC_TERM_DISPOSE = 0x0040, PROC_PREVENT_SAVE = 0x0080
}
 
- Protected Attributes inherited from Ultima::Ultima8::Process
ProcId _pid
 process id
 
uint32 _flags
 
uint32 _ticksPerRun
 
ObjId _itemNum
 item we are assigned to
 
uint16 _type
 
uint32 _result
 process result
 
Std::vector< ProcId > _waiting
 

Detailed Description

The camera process. This works in 4 ways:

It can be set to stay where it currently is It can be set to follow an item. It can be set to scroll to an item It can be set to stay at a location

Member Function Documentation

◆ findRoof()

uint16 Ultima::Ultima8::CameraProcess::findRoof ( int32  factor)

Find the roof above the camera.

Parameters
factorInterpolation factor for this frame
Returns
0 if no roof found, objid of roof if found

◆ moveToLocation()

void Ultima::Ultima8::CameraProcess::moveToLocation ( int32  x,
int32  y,
int32  z 
)

Move the existing camera process to a new location. If the current process is focused on an item, remove that focus.

This is not the same as setting a new process, because execution order will not change, so other pending events will all happen before the fast area is updated

◆ SetCameraProcess()

static uint16 Ultima::Ultima8::CameraProcess::SetCameraProcess ( CameraProcess )
static

Set the current camera process. Adds process and returns PID. The new process will go on the front of the process queue, so the fast area will be updated before any other pending actions occur.

◆ itemMoved()

void Ultima::Ultima8::CameraProcess::itemMoved ( )

Notify the Camera that the target item has moved


The documentation for this class was generated from the following file: