[Scummvm-cvs-logs] CVS: residual bitmap.h,1.12,1.13 driver_gl.cpp,1.22,1.23 engine.cpp,1.55,1.56 scene.cpp,1.32,1.33 screen.cpp,1.18,1.19 screen.h,1.5,1.6
Pawel Kolodziejski
aquadran at users.sourceforge.net
Wed Jan 5 14:15:02 CET 2005
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8806
Modified Files:
bitmap.h driver_gl.cpp engine.cpp scene.cpp screen.cpp
screen.h
Log Message:
corrected zbuffer data access, but screenblock not works for me (or rather never for me)
Index: bitmap.h
===================================================================
RCS file: /cvsroot/scummvm/residual/bitmap.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- bitmap.h 1 Jan 2005 12:27:55 -0000 1.12
+++ bitmap.h 5 Jan 2005 22:13:56 -0000 1.13
@@ -42,6 +42,7 @@
int y() const { return _y; }
char *getData() { return _data[_currImage]; }
+ char *getZbufferData() { return _data[_currImage - 1]; }
~Bitmap();
Index: driver_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- driver_gl.cpp 5 Jan 2005 21:20:01 -0000 1.22
+++ driver_gl.cpp 5 Jan 2005 22:13:56 -0000 1.23
@@ -323,10 +323,10 @@
if(winZ > bestDepth)
bestDepth = winZ;
-
}
- //screenBlocksAddRectangle(top, right, left, bottom, bestDepth);
+// if (SCREENBLOCKS_GLOBAL)
+// screenBlocksAddRectangle(top, right, left, bottom, bestDepth);
}
glDisable(GL_DEPTH_TEST);
Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- engine.cpp 5 Jan 2005 18:28:50 -0000 1.55
+++ engine.cpp 5 Jan 2005 22:13:56 -0000 1.56
@@ -125,9 +125,6 @@
}
}
} else if (_mode == ENGINE_MODE_NORMAL) {
- if (SCREENBLOCKS_GLOBAL)
- screenBlocksReset();
-
if (_currScene != NULL) {
// Update actor costumes
for (ActorListType::iterator i = _actors.begin(); i != _actors.end(); i++) {
@@ -137,6 +134,9 @@
}
}
+ if (SCREENBLOCKS_GLOBAL)
+ screenBlocksReset();
+
g_driver->clearScreen();
if (SCREENBLOCKS_GLOBAL)
@@ -176,7 +176,9 @@
if (_currScene != NULL && a->inSet(_currScene->name()) && a->visible())
a->draw();
}
- //screenBlocksDrawDebug();
+
+ if (SCREENBLOCKS_GLOBAL)
+ screenBlocksDrawDebug();
}
// Draw text
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/scene.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- scene.cpp 5 Jan 2005 18:28:50 -0000 1.32
+++ scene.cpp 5 Jan 2005 22:13:56 -0000 1.33
@@ -172,7 +172,7 @@
return;
if (_currSetup->_bkgndZBm)
- screenBlocksInit(_currSetup->_bkgndZBm->getData() );
+ screenBlocksInit(_currSetup->_bkgndZBm->getZbufferData());
else
screenBlocksInitEmpty();
}
@@ -229,7 +229,7 @@
void Scene::setSoundPosition(const char *soundName, Vector3d pos) {
Vector3d cameraPos = _currSetup->_pos;
- Vector3d vector;
+ Vector3d vector, vector2;
vector.set(fabs(cameraPos.x() - pos.x()), fabs(cameraPos.y() - pos.y()), fabs(cameraPos.z() - pos.z()));
float distance = vector.magnitude();
float maxDistance = 8.0f;
@@ -238,8 +238,16 @@
newVolume += _minVolume;
g_imuse->setVolume(soundName, newVolume);
- // TODO: pan
- // roll, fov
+ vector.set(_currSetup->_interest.x() - cameraPos.x(), _currSetup->_interest.y() - cameraPos.y(),
+ _currSetup->_interest.z() - cameraPos.z());
+ vector2.set(pos.x() - cameraPos.x(), pos.y() - cameraPos.y(), pos.z() - cameraPos.z());
+// printf("a pos (%2.2f, %2.2f, %2.2f) i pos (%2.2f, %2.2f, %2.2f) c pos (%2.2f, %2.2f, %2.2f)\n", pos.x(), pos.y(), pos.z(),
+// _currSetup->_interest.x(), _currSetup->_interest.y(), _currSetup->_interest.z(),
+// cameraPos.x(), cameraPos.y(), cameraPos.z());
+ float a = angle(vector, vector2);
+ int pan = a * 127 * 1.5;
+ pan = (pan / 2) + 64;
+// g_imuse->setPan(soundName, pan);
}
void Scene::setSoundParameters(int minVolume, int maxVolume) {
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/screen.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- screen.cpp 5 Jan 2005 21:20:02 -0000 1.18
+++ screen.cpp 5 Jan 2005 22:13:56 -0000 1.19
@@ -46,7 +46,7 @@
unsigned short int bDepth = 0xFFFF;
- for (i = 0; i < SCREEN_BLOCK_SIZE; i++ ) {
+ for (i = 0; i < SCREEN_BLOCK_SIZE; i++) {
if (bDepth > buffer[i])
bDepth = buffer[i];
}
@@ -105,19 +105,14 @@
if ((left > right) || (top > bottom))
return;
- int firstLeft;
- int firstTop;
- int width;
- int height;
-
- firstLeft = left / 16;
- firstTop = top /16;
+ int firstLeft = left / 16;
+ int firstTop = top /16;
- width = (right - left) / 16;
- if ((right-left) % 16)
+ int width = (right - left) / 16;
+ if ((right - left) % 16)
width++;
- height = (bottom - top) / 16;
+ int height = (bottom - top) / 16;
if ((bottom - top) % 16)
height++;
@@ -142,7 +137,7 @@
glDisable(GL_DEPTH_TEST);
glColor4f(1.f, 0.3f, 1.f, 0.4f);
- glDisable(GL_TEXTURE_2D );
+ glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -173,10 +168,10 @@
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_ALWAYS);
- glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_TRUE);
- for (int j = 0;j < 30; j++) {
+ for (int j = 0; j < 30; j++) {
for (int i = 0; i < 40; i++) {
if (screenBlockData[i][j].isDirty) {
int width = 1;
@@ -197,4 +192,3 @@
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthFunc(GL_LESS);
}
-
Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/residual/screen.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- screen.h 1 Jan 2005 10:23:16 -0000 1.5
+++ screen.h 5 Jan 2005 22:13:56 -0000 1.6
@@ -48,4 +48,3 @@
void screenBlocksBlitDirtyBlocks();
#endif // _SCREEN_H_
-
More information about the Scummvm-git-logs
mailing list