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