~marten-r/widelands/feature-3d-rendering-open-gl-es-compat

« back to all changes in this revision

Viewing changes to src/logic/carrier.cc

  • Committer: Marten Richter \
  • Date: 2013-12-07 16:34:54 UTC
  • Revision ID: marten.richter@freenet.de-20131207163454-ssy014khpxtrgvq9
Add z-Ordering for rendering, fix some drawing glitches, change api for 3d rendering

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                        (game,
108
108
                         road.get_path(),
109
109
                         road.get_idle_index(),
110
 
                         descr().get_right_walk_anims(does_carry_ware())))
 
110
                         descr().get_right_walk_anims(does_carry_ware()),false))
111
111
                return;
112
112
 
113
113
        // Be bored. There's nothing good on TV, either.
203
203
                else if
204
204
                        ((flag.has_capacity() || !swap_or_wait(game, state))
205
205
                         &&
206
 
                         !start_task_walktoflag(game, state.ivar1 ^ 1))
 
206
                         !start_task_walktoflag(game, state.ivar1 ^ 1, false))
207
207
                        // Drop the item, possible exchanging it with another one
208
208
                        drop_item(game, state);
209
209
        }
252
252
                return
253
253
                        start_task_move
254
254
                                (game,
255
 
                                 WALK_SE,
 
255
                                 WALK_SE, true,
256
256
                                 descr().get_right_walk_anims(does_carry_ware()),
257
257
                                 true);
258
258
        } else {
272
272
void Carrier::pickup_from_flag(Game & game, State & state)
273
273
{
274
274
        int32_t const ivar1 = state.ivar1;
275
 
        if (!start_task_walktoflag(game, ivar1)) {
 
275
        if (!start_task_walktoflag(game, ivar1, false)) {
276
276
 
277
277
                m_promised_pickup_to = NOONE;
278
278
 
351
351
 */
352
352
void Carrier::enter_building(Game & game, State & state)
353
353
{
354
 
        if (!start_task_walktoflag(game, state.ivar1 ^ 1)) {
 
354
        if (!start_task_walktoflag(game, state.ivar1 ^ 1, true)) {
355
355
                state.ivar1 = -1;
356
356
                return
357
357
                        start_task_move
358
358
                                (game,
359
 
                                 WALK_NW,
 
359
                                 WALK_NW, true,
360
360
                                 descr().get_right_walk_anims(does_carry_ware()),
361
361
                                 true);
362
362
        }
394
394
 
395
395
                m_promised_pickup_to = state.ivar1 ^ 1;
396
396
                return false;
397
 
        } else if (!start_task_walktoflag(game, state.ivar1 ^ 1, true))
 
397
        } else if (!start_task_walktoflag(game, state.ivar1 ^ 1, false, true))
398
398
                start_task_waitforcapacity(game, flag); //  wait one node away
399
399
 
400
400
        return true;
547
547
 * the target field.
548
548
 */
549
549
bool Carrier::start_task_walktoflag
550
 
        (Game & game, int32_t const flag, bool const offset)
 
550
        (Game & game, int32_t const flag, bool const ismove2d, bool const offset)
551
551
{
552
552
        const Path & path =
553
553
                ref_cast<Road, PlayerImmovable>(*get_location(game)).get_path();
565
565
 
566
566
        return
567
567
                start_task_movepath
568
 
                        (game, path, idx, descr().get_right_walk_anims(does_carry_ware()));
 
568
                        (game, path, idx, descr().get_right_walk_anims(does_carry_ware()), ismove2d);
569
569
}
570
570
 
571
571
void Carrier::log_general_info(const Widelands::Editor_Game_Base & egbase)