5 * Created by Alyssa Milburn on Tue May 25 2004.
6 * Copyright (c) 2004 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #ifndef _OPENC2E_CAMERA_H
21 #define _OPENC2E_CAMERA_H
26 enum cameratransition
{ none
= 0, fliphorz
= 1, burst
= 2 };
27 enum trackstyle
{ brittle
= 0, flexible
= 1, hard
= 2 };
28 enum panstyle
{ jump
= 0, smoothscroll
= 1, smoothscrollifvisible
= 2 };
33 unsigned int metaroom
;
36 unsigned int destx
, desty
;
39 AgentRef trackedagent
;
40 trackstyle trackingstyle
;
44 virtual unsigned int const getWidth() = 0;
45 virtual unsigned int const getHeight() = 0;
47 unsigned int const getX() { return x
; }
48 unsigned int const getY() { return y
; }
49 unsigned int const getXCentre() { return x
+ (getWidth() / 2); }
50 unsigned int const getYCentre() { return y
+ (getHeight() / 2); }
52 class MetaRoom
* const getMetaRoom();
53 void goToMetaRoom(unsigned int m
);
54 void goToMetaRoom(unsigned int m
, int x
, int y
, cameratransition transition
);
55 virtual void moveTo(int _x
, int _y
, panstyle pan
= jump
);
56 void trackAgent(AgentRef a
, int xp
, int yp
, trackstyle s
, cameratransition transition
);
57 AgentRef
trackedAgent() { return trackedagent
; }
61 void updateTracking();
66 class PartCamera
: public Camera
{
68 class CameraPart
*part
;
71 PartCamera(class CameraPart
*p
) { part
= p
; }
72 unsigned int const getWidth();
73 unsigned int const getHeight();
75 void setZoom(int pixels
, int _x
, int _y
);
80 class MainCamera
: public Camera
{
82 boost::shared_ptr
<Backend
> backend
;
83 std::vector
<AgentRef
> floated
;
87 void setBackend(boost::shared_ptr
<Backend
> b
) { backend
= b
; }
88 unsigned int const getWidth();
89 unsigned int const getHeight();
90 void moveTo(int _x
, int _y
, panstyle pan
= jump
);
92 void addFloated(AgentRef
);
93 void delFloated(AgentRef
);