[Scummvm-cvs-logs] CVS: scummvm gfx.cpp,1.92,1.93 scumm.h,1.166,1.167
Max Horn
fingolfin at users.sourceforge.net
Wed May 22 15:37:02 CEST 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm object.cpp,1.70,1.71
- Next message: [Scummvm-cvs-logs] CVS: scummvm scummvm.cpp,1.159,1.160 actor.cpp,1.72,1.73 actor.h,1.5,1.6 scumm.h,1.167,1.168 costume.cpp,1.33,1.34 akos.cpp,1.19,1.20 akos.h,1.7,1.8 script_v2.cpp,1.65,1.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv11986
Modified Files:
gfx.cpp scumm.h
Log Message:
renamed unkScreenEffect7 to transitionEffect; added some comments, renamed vars etc.; fixed typoe in screen_eff7_table1 which caused effects 2&3 to be completly messed up
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- gfx.cpp 22 May 2002 12:10:37 -0000 1.92
+++ gfx.cpp 22 May 2002 22:36:58 -0000 1.93
@@ -582,7 +582,7 @@
case 1:
case 2:
case 3:
- unkScreenEffect7(a - 1);
+ transitionEffect(a - 1);
break;
case 128:
unkScreenEffect6();
@@ -1742,40 +1742,49 @@
}
static const int8 screen_eff7_table1[4][16] = {
- {1, 1, -1, 1, -1, 1, -1, -1,
- 1, -1, -1, -1, 1, 1, 1, -1},
- {0, 1, 2, 1, 2, 0, 2, 1,
- 2, 0, 2, 1, 0, 0, 0, 0},
- {-2, -1, 0, -1, -2, -1, -2, 0 - 2, -1, -2, 0, 0, 0, 0, 0},
- {0, -1, -2, -1, -2, 0, -2, -1 - 2, 0, -2, -1, 0, 0, 0, 0}
+ { 1, 1, -1, 1, -1, 1, -1, -1,
+ 1, -1, -1, -1, 1, 1, 1, -1},
+ { 0, 1, 2, 1, 2, 0, 2, 1,
+ 2, 0, 2, 1, 0, 0, 0, 0},
+ {-2, -1, 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, 0, 0, 0, 0},
+ { 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, -2, -1, 0, 0, 0, 0}
};
static const byte screen_eff7_table2[4][16] = {
- {0, 0, 39, 0, 39, 0, 39, 24,
- 0, 24, 39, 24, 0, 0, 0, 24},
- {0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 1, 0, 255, 0, 0, 0},
- {39, 24, 39, 24, 39, 24, 39, 24,
- 38, 24, 38, 24, 255, 0, 0, 0},
- {0, 24, 39, 24, 39, 0, 39, 24,
- 38, 0, 38, 24, 255, 0, 0, 0}
+ { 0, 0, 39, 0, 39, 0, 39, 24,
+ 0, 24, 39, 24, 0, 0, 0, 24},
+ { 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0, 255, 0, 0, 0},
+ {39, 24, 39, 24, 39, 24, 39, 24,
+ 38, 24, 38, 24, 255, 0, 0, 0},
+ { 0, 24, 39, 24, 39, 0, 39, 24,
+ 38, 0, 38, 24, 255, 0, 0, 0}
};
-static const byte screen_eff7_table3[4] = {
+static const byte transition_num_of_iterations[4] = {
13, 25, 25, 25
};
-/* Transition effect */
-void Scumm::unkScreenEffect7(int a)
+/* Transition effect. There are four different effects possible,
+ * indicated by the value of a:
+ * 0: Iris effect
+ * 1: ?
+ * 2: ?
+ * 3: ?
+ * All effects basically operate on 8x8 blocks of the screen. These blocks
+ * are updated in a certain order; the exact order determines how the
+ * effect appears to the user.
+ */
+void Scumm::transitionEffect(int a)
{
- int tab_1[16];
+ int delta[16]; // Offset applied during each iteration
int tab_2[16];
int i, j;
int bottom;
int l, t, r, b;
for (i = 0; i < 16; i++) {
- tab_1[i] = screen_eff7_table1[a][i];
+ delta[i] = screen_eff7_table1[a][i];
j = screen_eff7_table2[a][i];
if (j == 24)
j = (virtscr[0].height >> 3) - 1;
@@ -1783,7 +1792,7 @@
}
bottom = virtscr[0].height >> 3;
- for (j = 0; j < screen_eff7_table3[a]; j++) {
+ for (j = 0; j < transition_num_of_iterations[a]; j++) {
for (i = 0; i < 4; i++) {
l = tab_2[i * 4];
t = tab_2[i * 4 + 1];
@@ -1809,8 +1818,10 @@
}
for (i = 0; i < 16; i++)
- tab_2[i] += tab_1[i];
+ tab_2[i] += delta[i];
+ // Draw the current state to the screen and wait half a sec so the user
+ // can watch the effect taking place.
updatePalette();
_system->update_screen();
waitForTimer(30);
@@ -2177,7 +2188,7 @@
case 1:
case 2:
case 3:
- unkScreenEffect7(effect - 1);
+ transitionEffect(effect - 1);
break;
case 128:
unkScreenEffect6();
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- scumm.h 20 May 2002 16:02:29 -0000 1.166
+++ scumm.h 22 May 2002 22:36:58 -0000 1.167
@@ -1169,7 +1169,7 @@
void unkScreenEffect4();
void unkScreenEffect5(int a);
void unkScreenEffect6();
- void unkScreenEffect7(int a);
+ void transitionEffect(int a); // former unkScreenEffect7
void decompressBomp(byte *dst, byte *src, int w, int h);
uint _shakeFrame;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm object.cpp,1.70,1.71
- Next message: [Scummvm-cvs-logs] CVS: scummvm scummvm.cpp,1.159,1.160 actor.cpp,1.72,1.73 actor.h,1.5,1.6 scumm.h,1.167,1.168 costume.cpp,1.33,1.34 akos.cpp,1.19,1.20 akos.h,1.7,1.8 script_v2.cpp,1.65,1.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list