rnd-20090623-4-src
[rocksndiamonds.git] / src / game_sp / Display.c
1 // ----------------------------------------------------------------------------
2 // Display.c
3 // ----------------------------------------------------------------------------
4
5 #include "Display.h"
6
7 // static char *VB_Name = "modDisplay";
8
9 // --- Option Explicit
10
11 int ScreenScrollXPos, ScreenScrollYPos;
12 int ScreenPosition, data_h_Xtmp, data_h_Ytmp;
13
14 int ShowRedDiskCounter, ShowPanel;
15 int ExplosionShake;
16 boolean NoDisplayFlag;
17
18 long DisplayMinX, DisplayMaxX, DisplayWidth;
19 long DisplayMinY, DisplayMaxY, DisplayHeight;
20
21
22 int subDisplayInfotronsNeeded()
23 {
24   int subDisplayInfotronsNeeded;
25
26   if (NoDisplayFlag)
27     return subDisplayInfotronsNeeded;
28
29   {
30 #if 0
31     MainForm.lblInfoCount.Caption = InfotronsNeeded;
32     MainForm.lblInfoCount.Refresh;
33 #endif
34   }
35
36   return subDisplayInfotronsNeeded;
37 }
38
39 int subDisplayPlayingTime()
40 {
41   int subDisplayPlayingTime;
42
43
44   return subDisplayPlayingTime;
45 }
46
47 int subDisplayLevel()
48 {
49   int subDisplayLevel;
50
51   if (NoDisplayFlag || ! LevelLoaded)
52     return subDisplayLevel;
53
54 #if 0
55   MainForm.DisplayLevel();
56 #endif
57
58   return subDisplayLevel;
59 }
60
61 void subDisplayPanel()
62 {
63 }
64
65 int subCheckRestoreRedDiskCountDisplay()
66 {
67   int subCheckRestoreRedDiskCountDisplay;
68
69   if (NoDisplayFlag)
70     return subCheckRestoreRedDiskCountDisplay;
71
72   if (ShowRedDiskCounter == 0)
73     return subCheckRestoreRedDiskCountDisplay;
74
75   ShowRedDiskCounter = ShowRedDiskCounter - 1;
76   if (ShowRedDiskCounter == 0)
77   {
78     {
79 #if 0
80       MainForm.lblRedDiskCount.Caption = 0;
81       MainForm.lblRedDiskCount.Refresh;
82 #endif
83     }
84   }
85
86   return subCheckRestoreRedDiskCountDisplay;
87 }
88
89 void subDisplayRedDiskCount()
90 {
91   if (NoDisplayFlag)
92     return;
93
94   {
95 #if 0
96     MainForm.lblRedDiskCount.Caption = RedDiskCount;
97     MainForm.lblRedDiskCount.Refresh;
98 #endif
99   }
100   ShowRedDiskCounter = 0x46;
101 }
102
103 void ScrollTo(int X, int Y)
104 {
105   long oldX, oldY;
106
107   if (NoDisplayFlag)
108     return;
109
110   oldX = ScrollX;
111   oldY = ScrollY;
112   X = ScrollDelta * (X / ScrollDelta);
113   X = Max(X, ScrollMinX);
114   X = Min(X, ScrollMaxX);
115   Y = ScrollDelta * (Y / ScrollDelta);
116   Y = Max(Y, ScrollMinY);
117   Y = Min(Y, ScrollMaxY);
118   //  ScrollX = X
119   //  ScrollY = Y
120   Stage.ScrollTo(X, Y);
121 }
122
123 void ScrollTowards(int X, int Y)
124 {
125   long oldX, oldY;
126
127   if (NoDisplayFlag)
128     return;
129
130   oldX = ScrollX;
131   oldY = ScrollY;
132   X = ScrollDelta * (X / ScrollDelta);
133   X = Max(X, ScrollMinX);
134   X = Min(X, ScrollMaxX);
135   Y = ScrollDelta * (Y / ScrollDelta);
136   Y = Max(Y, ScrollMinY);
137   Y = Min(Y, ScrollMaxY);
138   //  ScrollX = X
139   //  ScrollY = Y
140   Stage.ScrollTowards(X, Y, 2 * Stretch);
141 }
142
143 void SoftScrollTo(int X, int Y, long TimeMS, int FPS)
144 {
145   long oldX, oldY;
146
147   if (NoDisplayFlag)
148     return;
149
150   oldX = ScrollX;
151   oldY = ScrollY;
152   X = ScrollDelta * (X / ScrollDelta);
153   X = Max(X, ScrollMinX);
154   X = Min(X, ScrollMaxX);
155   Y = ScrollDelta * (Y / ScrollDelta);
156   Y = Max(Y, ScrollMinY);
157   Y = Min(Y, ScrollMaxY);
158   //  ScrollX = X
159   //  ScrollY = Y
160   Stage.SoftScrollTo(X, Y, TimeMS, FPS);
161 }