1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef TINSEL_SCROLL_H // prevent multiple includes 24 #define TINSEL_SCROLL_H 25 26 namespace Tinsel { 27 28 #define SCROLLPIXELS 8 // Number of pixels to scroll per iteration 29 30 // Distance from edge that triggers a scroll 31 #define RLDISTANCE (TinselV2 ? g_sd.xTrigger : 50) 32 #define UDISTANCE (TinselV2 ? g_sd.yTriggerTop : 20) 33 #define DDISTANCE (TinselV2 ? g_sd.yTriggerBottom : 20) 34 35 // Number of iterations to make 36 #define RLSCROLL 160 // 20*8 = 160 = half a screen 37 #define UDSCROLL 100 // 12.5*8 = 100 = half a screen 38 39 40 // These structures defined here so boundaries can be saved 41 struct NOSCROLLB { 42 int ln; 43 int c1; 44 int c2; 45 }; 46 47 #define MAX_HNOSCROLL 10 48 #define MAX_VNOSCROLL 10 49 50 struct SCROLLDATA{ 51 NOSCROLLB NoVScroll[MAX_VNOSCROLL]; // Vertical no-scroll boundaries 52 NOSCROLLB NoHScroll[MAX_HNOSCROLL]; // Horizontal no-scroll boundaries 53 unsigned NumNoV, NumNoH; // Counts of no-scroll boundaries 54 // DW2 fields 55 int xTrigger; 56 int xDistance; 57 int xSpeed; 58 int yTriggerTop; 59 int yTriggerBottom; 60 int yDistance; 61 int ySpeed; 62 }; 63 64 65 void DontScrollCursor(); 66 void DoScrollCursor(); 67 68 void SetNoScroll(int x1, int y1, int x2, int y2); 69 void DropScroll(); 70 71 void ScrollProcess(CORO_PARAM, const void *); 72 73 void ScrollFocus(int actor); 74 int GetScrollFocus(); 75 void ScrollTo(int x, int y, int xIter, int yIter); 76 77 void KillScroll(); 78 79 void GetNoScrollData(SCROLLDATA *ssd); 80 void RestoreNoScrollData(SCROLLDATA *ssd); 81 82 void SetScrollParameters(int xTrigger, int xDistance, int xSpeed, int yTriggerTop, 83 int yTriggerBottom, int yDistance, int ySpeed); 84 85 bool IsScrolling(); 86 87 } // End of namespace Tinsel 88 89 #endif /* TINSEL_SCROLL_H */ 90