| 1 |
/*************************************************************************** |
| 2 |
* Copyright (C) 2005-2019 by the FIFE team * |
| 3 |
* http://www.fifengine.net * |
| 4 |
* This file is part of FIFE. * |
| 5 |
* * |
| 6 |
* FIFE is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Lesser General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2.1 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 14 |
* Lesser General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Lesser General Public * |
| 17 |
* License along with this library; if not, write to the * |
| 18 |
* Free Software Foundation, Inc., * |
| 19 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
| 20 |
***************************************************************************/ |
| 21 |
|
| 22 |
%module fife |
| 23 |
%{ |
| 24 |
#include "view/camera.h" |
| 25 |
#include "view/rendererbase.h" |
| 26 |
%} |
| 27 |
|
| 28 |
%include "view/rendererbase.i" |
| 29 |
|
| 30 |
namespace FIFE { |
| 31 |
typedef Point3D ScreenPoint; |
| 32 |
%template(ScreenPoint) PointType3D<int32_t>; |
| 33 |
|
| 34 |
%apply std::list<Instance*> &OUTPUT { std::list<Instance*>& instances }; |
| 35 |
class Camera: public IRendererContainer { |
| 36 |
public: |
| 37 |
~Camera(); |
| 38 |
const std::string& getId() const; |
| 39 |
void setId(const std::string& id); |
| 40 |
void setTilt(double tilt); |
| 41 |
double getTilt() const; |
| 42 |
void setRotation(double rotation); |
| 43 |
double getRotation() const; |
| 44 |
void setZoom(double zoom); |
| 45 |
double getZoom() const; |
| 46 |
double getOriginalZToY() const; |
| 47 |
void setZToY(double zToY); |
| 48 |
double getZToY() const; |
| 49 |
void setZToYEnabled(bool enabled); |
| 50 |
bool isZToYEnabled() const; |
| 51 |
void setLocation(Location location); |
| 52 |
Location getLocation(); |
| 53 |
void setPosition(const ExactModelCoordinate& position); |
| 54 |
ExactModelCoordinate getPosition() const; |
| 55 |
Point3D getOrigin() const; |
| 56 |
void attach(Instance *instance); |
| 57 |
void detach(); |
| 58 |
Instance* getAttached() const; |
| 59 |
void setViewPort(const Rect& viewport); |
| 60 |
const Rect& getViewPort() const; |
| 61 |
const Rect& getMapViewPort(); |
| 62 |
Rect getLayerViewPort(Layer* layer); |
| 63 |
void setCellImageDimensions(uint32_t width, uint32_t height); |
| 64 |
Point getCellImageDimensions(); |
| 65 |
Point getCellImageDimensions(Layer* layer); |
| 66 |
ScreenPoint toScreenCoordinates(const ExactModelCoordinate& map_coords); |
| 67 |
ExactModelCoordinate toMapCoordinates(ScreenPoint screen_coords, bool z_calculated=true); |
| 68 |
void setEnabled(bool enabled); |
| 69 |
bool isEnabled(); |
| 70 |
|
| 71 |
void getMatchingInstances(ScreenPoint screen_coords, Layer& layer, std::list<Instance*>& instances, uint8_t alpha = 0); |
| 72 |
void getMatchingInstances(Rect screen_rect, Layer& layer, std::list<Instance*>& instances, uint8_t alpha = 0); |
| 73 |
void getMatchingInstances(Location& loc, std::list<Instance*>& instances, bool use_exactcoordinates=false); |
| 74 |
RendererBase* getRenderer(const std::string& name); |
| 75 |
void resetRenderers(); |
| 76 |
|
| 77 |
void setLightingColor(float red, float green, float blue); |
| 78 |
void resetLightingColor(); |
| 79 |
std::vector<float> getLightingColor(); |
| 80 |
|
| 81 |
void setOverlayColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); |
| 82 |
std::vector<uint8_t> getOverlayColor(); |
| 83 |
void resetOverlayColor(); |
| 84 |
void setOverlayImage(int32_t id, bool fill = false); |
| 85 |
int32_t getOverlayImage(); |
| 86 |
void resetOverlayImage(); |
| 87 |
void setOverlayAnimation(AnimationPtr anim, bool fill = false); |
| 88 |
AnimationPtr getOverlayAnimation(); |
| 89 |
void resetOverlayAnimation(); |
| 90 |
|
| 91 |
void refresh(); |
| 92 |
private: |
| 93 |
Camera(); |
| 94 |
}; |
| 95 |
%clear std::list<Instance*>& instances; |
| 96 |
} |
| 97 |
|
| 98 |
%clear InstanceLst& instances; |