Debian Codegraph @

src/pipe.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /***************************************************************************
2 pipe.cpp - description
3 -------------------
4 begin : Wed Jan 10 1996
5 copyright : (C) 1996 by Waldemar Baraldi
6 email : [email protected]
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18 #include "pipe.h"cxx . . $ `<file>/src/pipe.h`/
19
20 Pipecxx . . $ Pipe#::Pipecxx . . $ Pipe#Pipe(49f6e7a06ebc5aa8).():AnimatedCanvascxx . . $ AnimatedCanvas#(){
21 full_levelcxx . . $ Pipe#full_level.=0;
22 used_inputcxx . . $ Pipe#used_input.=Voidcxx . . $ Void.;
23 rocxx . . $ Pipe#ro.=Voidcxx . . $ Void.;
24 fixedcxx . . $ Pipe#fixed.=false;
25 bonuscxx . . $ Pipe#bonus.=NormalBonuscxx . . $ NormalBonus.;
26 this->ownercxx . . $ Pipe#owner.=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
27 exclcxx . . $ Pipe#excl.=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
28 exclFramecxx . . $ Pipe#exclFrame.=0;
29 lastcxx . . $ Pipe#last.=false;
30 bonusFramecxx . . $ Pipe#bonusFrame.=0;
31 bonusSpritecxx . . $ Pipe#bonusSprite.=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
32 }
33
34 Pipecxx . . $ Pipe#::~cxx . . $ Pipe#`~Pipe`(ced63f7c635d850d).Pipecxx . . $ Pipe#(){
35 if (exclcxx . . $ Pipe#excl.) delete exclcxx . . $ Pipe#excl.;
36 }
37
38 bool Pipecxx . . $ Pipe#::hasLiquidcxx . . $ Pipe#hasLiquid(c9857a73d68e59ba).(){
39 return (full_levelcxx . . $ Pipe#full_level.>0);
40 }
41
42 bool Pipecxx . . $ Pipe#::isRemovablecxx . . $ Pipe#isRemovable(c9857a73d68e59ba).(){
43 return !(full_levelcxx . . $ Pipe#full_level.>0) && !fixedcxx . . $ Pipe#fixed.;
44 }
45
•46 void Pipecxx . . $ Pipe#::setFixedcxx . . $ Pipe#setFixed(b45ddcbc8423892c).(bool flag){
47 fixedcxx . . $ Pipe#fixed.=flag;
48 }
49
•50 void Pipecxx . . $ Pipe#::setBonuscxx . . $ Pipe#setBonus(e439fde3156f010b).(Bonuscxx . . $ Bonus# bonus){
51 this->bonuscxx . . $ Pipe#bonus.=bonus;
52 }
53
54 Bonuscxx . . $ Bonus# Pipecxx . . $ Pipe#::getBonuscxx . . $ Pipe#getBonus(e13c81a6292c3f1e).(){
55 return bonuscxx . . $ Pipe#bonus.;
56 }
57
58 void Pipecxx . . $ Pipe#::setOwnercxx . . $ Pipe#setOwner(34e2c302b1f0e5dd).(Playercxx . . $ Player# * owner){
59 this->ownercxx . . $ Pipe#owner.=owner;
60 }
61
62 Playercxx . . $ Player# * Pipecxx . . $ Pipe#::getOwnercxx . . $ Pipe#getOwner(b9b9f9b98b58beb1).(){
63 return ownercxx . . $ Pipe#owner.;
64 }
65
66 void Pipecxx . . $ Pipe#::tickcxx . . $ Pipe#tick(49f6e7a06ebc5aa8).(){
67 exclFramecxx . . $ Pipe#exclFrame. = (exclFramecxx . . $ Pipe#exclFrame. + 1) % 15;
68 bonusFramecxx . . $ Pipe#bonusFrame. = (bonusFramecxx . . $ Pipe#bonusFrame. +1) % 30;
69 }
70
71 void Pipecxx . . $ Pipe#::paintRestrictioncxx . . $ Pipe#paintRestriction(79d4807f4eb46d42).(VideoManagercxx . . $ VideoManager# * vm, CardinalPointcxx . . $ CardinalPoint# con){
72 Imagecxx . . $ Image# * ima;
73 switch (con){
74 case Westcxx . . $ West.:{
75 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("arrow_w.png"));
76 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.);
77 break;
78 }
79 case Southcxx . . $ South.:{
80 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("arrow_s.png"));
81 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.);
82 break;
83 }
84 case Eastcxx . . $ East.:{
85 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("arrow_e.png"));
86 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.);
87 break;
88 }
89 case Northcxx . . $ North.:{
90 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("arrow_n.png"));
91 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.);
92 break;
93 }
94 default:break;
95 }
96 }
97
98 void Pipecxx . . $ Pipe#::paintBonuscxx . . $ Pipe#paintBonus(1e922b71c0766333).(VideoManagercxx . . $ VideoManager# * vm, Bonuscxx . . $ Bonus# bonus){
99 Imagecxx . . $ Image# * ima;
100 if (!bonusSpritecxx . . $ Pipe#bonusSprite.){
101 switch (bonus){
102 case SuperBonuscxx . . $ SuperBonus.:{
103 bonusSpritecxx . . $ Pipe#bonusSprite.= new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("super_bonus"), new Strcxx . . $ Str#(".png"), 30, vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).());
104 break;
105 }
106 case UltraBonuscxx . . $ UltraBonus.:{
107 bonusSpritecxx . . $ Pipe#bonusSprite.= new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("ultra_bonus"), new Strcxx . . $ Str#(".png"), 30, vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).());
108 break;
109 }
110 case HyperBonuscxx . . $ HyperBonus.:{
111 bonusSpritecxx . . $ Pipe#bonusSprite.= new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("hyper_bonus"), new Strcxx . . $ Str#(".png"), 30, vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).());
112 break;
113 }
114 case LifeBonuscxx . . $ LifeBonus.:{
115 bonusSpritecxx . . $ Pipe#bonusSprite.= new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("life_bonus"), new Strcxx . . $ Str#(".png"), 30, vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).());
116 break;
117 }
118 default:break;
119 }
120 }
121 if (hasLiquidcxx . . $ Pipe#hasLiquid(c9857a73d68e59ba).()>0)vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(bonusSpritecxx . . $ Pipe#bonusSprite.->framecxx . . $ Sprite#frame(e8d7ae696153184b).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).(), 0), xcxx . . $ Canvas#x.+(widthcxx . . $ Pipe#width(b126dc7c1de90089).()-bonusSpritecxx . . $ Pipe#bonusSprite.->frameWidthcxx . . $ Sprite#frameWidth(57806aaf66c601ae).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).()))/2, ycxx . . $ Canvas#y.+(heightcxx . . $ Pipe#height(b126dc7c1de90089).()-bonusSpritecxx . . $ Pipe#bonusSprite.->frameHeightcxx . . $ Sprite#frameHeight(57806aaf66c601ae).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).()))/2);
122 else vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(bonusSpritecxx . . $ Pipe#bonusSprite.->framecxx . . $ Sprite#frame(e8d7ae696153184b).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).(), bonusFramecxx . . $ Pipe#bonusFrame.), xcxx . . $ Canvas#x.+(widthcxx . . $ Pipe#width(b126dc7c1de90089).()-bonusSpritecxx . . $ Pipe#bonusSprite.->frameWidthcxx . . $ Sprite#frameWidth(57806aaf66c601ae).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).()))/2, ycxx . . $ Canvas#y.+(heightcxx . . $ Pipe#height(b126dc7c1de90089).()-bonusSpritecxx . . $ Pipe#bonusSprite.->frameHeightcxx . . $ Sprite#frameHeight(57806aaf66c601ae).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).()))/2);
123 }
124
125 void Pipecxx . . $ Pipe#::paintExclamationcxx . . $ Pipe#paintExclamation(dec28a01b93bce57).(VideoManagercxx . . $ VideoManager# * vm){
126 if (exclcxx . . $ Pipe#excl.==NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) exclcxx . . $ Pipe#excl.=new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("exclam"), new Strcxx . . $ Str#(".png"), 15, vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).());
127 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(exclcxx . . $ Pipe#excl.->framecxx . . $ Sprite#frame(e8d7ae696153184b).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).(), exclFramecxx . . $ Pipe#exclFrame.), xcxx . . $ Canvas#x. + widthcxx . . $ Pipe#width(b126dc7c1de90089).()-exclcxx . . $ Pipe#excl.->frameWidthcxx . . $ Sprite#frameWidth(57806aaf66c601ae).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).()), ycxx . . $ Canvas#y.);
128 }
129
130 void Pipecxx . . $ Pipe#::setLastcxx . . $ Pipe#setLast(b45ddcbc8423892c).(bool flag){
131 lastcxx . . $ Pipe#last.=flag;
132 }
133
134 bool Pipecxx . . $ Pipe#::isLastcxx . . $ Pipe#isLast(c9857a73d68e59ba).(){
135 return lastcxx . . $ Pipe#last.;
136 }