~ubuntu-branches/ubuntu/precise/pingus/precise

« back to all changes in this revision

Viewing changes to src/display/scene_context.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-02-28 19:44:25 UTC
  • mfrom: (4.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080228194425-e8ilohlijv02kgcf
Tags: 0.7.2-2
* Fix FTBFS with gcc-4.3 by adding the missing include in
  src/input/evdev_device.cpp (Closes: #462238):
   + debian/patches/20_fix_FTBFS_with_gcc-4.3.
* Rename former patch so that the filename reflects the order in which
  the patches are applied:
   - debian/patches/data_dir.patch
   + debian/patches/10_fix_data_directory.
* Bump Standards-Version from 3.7.2 to 3.7.3, no changes needed.
* Add a dh_desktop call in the arch-dep part of debian/rules.
* Adjust the “missing-dep-for-interpreter guile” override since lintian
  now lists an alternative for that dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  $Id: scene_context.hpp 3096 2007-09-06 16:12:02Z grumbel $
 
2
// 
 
3
//  Pingus - A free Lemmings clone
 
4
//  Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
 
5
//
 
6
//  This program is free software; you can redistribute it and/or
 
7
//  modify it under the terms of the GNU General Public License
 
8
//  as published by the Free Software Foundation; either version 2
 
9
//  of the License, or (at your option) any later version.
 
10
//
 
11
//  This program 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
 
14
//  GNU General Public License for more details.
 
15
// 
 
16
//  You should have received a copy of the GNU General Public License
 
17
//  along with this program; if not, write to the Free Software
 
18
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 
 
20
#ifndef HEADER_SCENE_CONTEXT_HXX
 
21
#define HEADER_SCENE_CONTEXT_HXX
 
22
 
 
23
#include "SDL.h"
 
24
#include "drawing_context.hpp"
 
25
 
 
26
class SceneContextImpl;
 
27
 
 
28
/** The SceneContext maintains all the different drawing layers to
 
29
    which a game object can draw. Each drawing layer serves a
 
30
    different purporse and all are combined in the end to form the
 
31
    final image. */
 
32
class SceneContext
 
33
{
 
34
public:
 
35
  SceneContext();
 
36
  SceneContext(const Rect& rect);
 
37
  ~SceneContext();
 
38
  
 
39
  /** The main drawing context, also known as color buffer, to this
 
40
      you draw all normal graphics, sprites and enemies, as you would
 
41
      do with a normal framebuffer */
 
42
  DrawingContext& color();
 
43
 
 
44
  /** This is the lightmap, to this you draw all lights, meaning that
 
45
      a color of white will result in a area that is completly
 
46
      visible, while a value of black will mean that the area will be
 
47
      not lighted at all and be completly black. This lightmap is
 
48
      multiplied with the color buffer to get the light effect */
 
49
  DrawingContext& light();
 
50
 
 
51
  /** The highlight map is usefull for all objects that are extremly
 
52
      bright so that they generate a lenseflare or a glow. The
 
53
      highlight map doesn't light the scenario itself, but gets
 
54
      additionally rendered above the color and light buffer, thus its
 
55
      allows to add glow without risking to losing it in an area of
 
56
      darkness */
 
57
  DrawingContext& highlight();
 
58
 
 
59
  /** Translate the drawing context */
 
60
  void translate(float x, float y);
 
61
 
 
62
  /** Set the rotation of the drawing context */
 
63
  void rotate(float angel);
 
64
 
 
65
  /** Set the scaling of the drawing context */
 
66
  void scale(float x, float y);
 
67
 
 
68
  void push_modelview();
 
69
  void pop_modelview();
 
70
  void reset_modelview();
 
71
 
 
72
  void set_cliprect(const Rect& rect);
 
73
  void reset_cliprect();
 
74
 
 
75
  /** Takes all the buffers and combines them to form the final image
 
76
      that will be shown on the screen */
 
77
  void render(SDL_Surface* gc, const Rect& rect);
 
78
 
 
79
  void clear();
 
80
private:
 
81
  SceneContextImpl* impl;
 
82
 
 
83
  SceneContext (const SceneContext&);
 
84
  SceneContext& operator= (const SceneContext&);
 
85
};
 
86
 
 
87
class SceneContextDrawingRequest : public DrawingRequest
 
88
{
 
89
private:
 
90
  SceneContext* sc;
 
91
 
 
92
public:
 
93
  SceneContextDrawingRequest(SceneContext* sc, const Vector3f& pos_ = Vector3f(0,0,0));
 
94
  virtual ~SceneContextDrawingRequest();
 
95
  void render(SDL_Surface* gc, const Rect& render);
 
96
};
 
97
 
 
98
 
 
99
#endif
 
100
 
 
101
/* EOF */