~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/newgrf_spritegroup.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: newgrf_spritegroup.cpp 13199 2008-05-20 20:03:45Z rubidium $ */
 
1
/* $Id: newgrf_spritegroup.cpp 15711 2009-03-14 18:16:29Z rubidium $ */
2
2
 
3
 
/** @file newgrf_spritegroup.cpp */
 
3
/** @file newgrf_spritegroup.cpp Handling of primarily NewGRF action 2. */
4
4
 
5
5
#include "stdafx.h"
6
 
#include "openttd.h"
7
 
#include "variables.h"
8
 
#include "landscape.h"
9
6
#include "oldpool.h"
10
7
#include "newgrf.h"
11
 
#include "newgrf_callbacks.h"
12
8
#include "newgrf_spritegroup.h"
13
9
#include "sprite.h"
14
 
#include "date_func.h"
15
 
#include "settings_type.h"
16
10
 
17
11
static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item);
18
12
 
93
87
                case 0x18: return object->callback_param2;
94
88
                case 0x1C: return object->last_value;
95
89
 
 
90
                case 0x5F: return (object->GetRandomBits(object) << 8) | object->GetTriggers(object);
 
91
 
96
92
                case 0x7D: return _temp_store.Get(parameter);
97
93
 
 
94
                case 0x7F:
 
95
                        if (object == NULL || object->grffile == NULL || parameter >= object->grffile->param_end) return 0;
 
96
                        return object->grffile->param[parameter];
 
97
 
98
98
                /* Not a common variable, so evalute the feature specific variables */
99
99
                default: return object->GetVariable(object, variable, parameter, available);
100
100
        }
117
117
 
118
118
 
119
119
/* Evaluate an adjustment for a variable of the given size.
120
 
* U is the unsigned type and S is the signed type to use. */
 
120
 * U is the unsigned type and S is the signed type to use. */
121
121
template <typename U, typename S>
122
122
static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ResolverObject *object, U last_value, uint32 value)
123
123
{
226
226
        byte index;
227
227
 
228
228
        object->scope = group->g.random.var_scope;
 
229
        object->count = group->g.random.count;
229
230
 
230
231
        if (object->trigger != 0) {
231
232
                /* Handle triggers */