| 1 | /*************************************************************************** |
| 2 | exit.cpp - description |
| 3 | ------------------- |
| 4 | begin : Sat Oct 21 2000 |
| 5 | copyright : (C) 2000 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 "exit.h"cxx . . $ `<file>/src/exit.h`/ |
| 19 | |
| 20 | Exitcxx . . $ Exit#::Exitcxx . . $ Exit#Exit(c47d336573415769).(CardinalPointcxx . . $ CardinalPoint# connection):Pipecxx . . $ Pipe#(){ |
| 21 | concxx . . $ Exit#con.=connection; |
| 22 | } |
| 23 | |
| 24 | Exitcxx . . $ Exit#::~cxx . . $ Exit#`~Exit`(ced63f7c635d850d).Exitcxx . . $ Exit#(){} |
| 25 | |
| 26 | bool Exitcxx . . $ Exit#::hasConnectioncxx . . $ Exit#hasConnection(eebf787ddd78fff5).(CardinalPointcxx . . $ CardinalPoint# con){ |
| 27 | return (this->concxx . . $ Exit#con.==con); |
| 28 | } |
| 29 | |
| 30 | CardinalPointcxx . . $ CardinalPoint# Exitcxx . . $ Exit#::getOutputcxx . . $ Exit#getOutput(fbd438076a101a96).(CardinalPointcxx . . $ CardinalPoint# input){ |
| 31 | return Voidcxx . . $ Void.; |
| 32 | } |
| 33 | |
| 34 | bool Exitcxx . . $ Exit#::isRemovablecxx . . $ Exit#isRemovable(c9857a73d68e59ba).(){ |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | void Exitcxx . . $ Exit#::incFullLevelcxx . . $ Exit#incFullLevel(5c0eb7cda63e3855).(CardinalPointcxx . . $ CardinalPoint# input,unsigned int amount){ |
| 39 | full_levelcxx . . $ Pipe#full_level.+=amount; |
| 40 | used_inputcxx . . $ Pipe#used_input.=Voidcxx . . $ Void.; |
| 41 | } |
| 42 | |
| 43 | int Exitcxx . . $ Exit#::getFullLevelcxx . . $ Exit#getFullLevel(bad1fd3a9fbe27b6).(CardinalPointcxx . . $ CardinalPoint# input){ |
| 44 | return this->full_levelcxx . . $ Pipe#full_level.; |
| 45 | } |
| 46 | |
| 47 | Pointercxx . . $ Pointer# * Exitcxx . . $ Exit#::getPointercxx . . $ Exit#getPointer(519f973faac47112).(){ |
| 48 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 49 | } |
| 50 | |
| 51 | void Exitcxx . . $ Exit#::paintcxx . . $ Exit#paint(dec28a01b93bce57).(VideoManagercxx . . $ VideoManager# * vm){ |
| 52 | Imagecxx . . $ Image# * aux, *ima; |
| 53 | |
| 54 | if (concxx . . $ Exit#con.==Eastcxx . . $ East. || concxx . . $ Exit#con.==Westcxx . . $ West.) |
| 55 | ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("exit_h.png")); |
| 56 | else |
| 57 | ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("exit_v.png")); |
| 58 | aux=new Imagecxx . . $ Image#(ima); |
| 59 | switch (concxx . . $ Exit#con.){ |
| 60 | case Southcxx . . $ South.:{aux->flipcxx . . $ Graphic#flip(cf90abbfd5bcb432).(HAxiscxx . . $ HAxis.);break;} |
| 61 | case Westcxx . . $ West.:{aux->flipcxx . . $ Graphic#flip(cf90abbfd5bcb432).(VAxiscxx . . $ VAxis.);break;} |
| 62 | default:break; |
| 63 | } |
| 64 | vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(aux, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.); |
| 65 | delete aux; |
| 66 | |
| 67 | if (full_levelcxx . . $ Pipe#full_level.>0){ |
| 68 | ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("flow.png")); |
| 69 | vm->setClippingcxx . . $ Graphic#setClipping(748afa4755bc9595).(xcxx . . $ Canvas#x., ycxx . . $ Canvas#y., PipeWidthcxx . . $ PipeWidth., PipeHeightcxx . . $ PipeHeight.); |
| 70 | vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(true); |
| 71 | switch (concxx . . $ Exit#con.){ |
| 72 | case Northcxx . . $ North.:case Southcxx . . $ South.:{ |
| 73 | int xof=xcxx . . $ Canvas#x.+PipeWidthcxx . . $ PipeWidth./2-ima->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2; |
| 74 | int yof; |
| 75 | float factor=(float)PipeHeightcxx . . $ PipeHeight./(float)(fullcxx . . $ Pipe#full(b126dc7c1de90089).()); |
| 76 | if (concxx . . $ Exit#con.==Northcxx . . $ North.) yof=ycxx . . $ Canvas#y.-ima->heightcxx . . $ Surface#height(b126dc7c1de90089).()/2; |
| 77 | else{ |
| 78 | yof=ycxx . . $ Canvas#y.+PipeHeightcxx . . $ PipeHeight.-ima->heightcxx . . $ Surface#height(b126dc7c1de90089).()/2; |
| 79 | factor =-factor; |
| 80 | } |
| 81 | for (int i=0;i<full_levelcxx . . $ Pipe#full_level./2+Grancxx . . $ Pipe#Gran.;i+=Grancxx . . $ Pipe#Gran.) |
| 82 | vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xof, (int)(yof+(float)i*factor)); |
| 83 | break; |
| 84 | } |
| 85 | case Eastcxx . . $ East.: case Westcxx . . $ West.:{ |
| 86 | int xof; |
| 87 | int yof=ycxx . . $ Canvas#y.+PipeHeightcxx . . $ PipeHeight./2-ima->heightcxx . . $ Surface#height(b126dc7c1de90089).()/2;; |
| 88 | float factor=(float)PipeWidthcxx . . $ PipeWidth./(float)(fullcxx . . $ Pipe#full(b126dc7c1de90089).()); |
| 89 | if (concxx . . $ Exit#con.==Westcxx . . $ West.) xof=xcxx . . $ Canvas#x.-ima->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2; |
| 90 | else{ |
| 91 | xof=xcxx . . $ Canvas#x.+PipeWidthcxx . . $ PipeWidth.-ima->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2; |
| 92 | factor =-factor; |
| 93 | } |
| 94 | for (int i=0;i<full_levelcxx . . $ Pipe#full_level./2+Grancxx . . $ Pipe#Gran.;i+=Grancxx . . $ Pipe#Gran.) |
| 95 | vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, (int)(xof+(float)i*factor), yof); |
| 96 | break; |
| 97 | } |
| 98 | default:break; |
| 99 | } |
| 100 | vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(false); |
| 101 | } |
| 102 | } |
| 103 |