summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/chihiro.cpp
diff options
context:
space:
mode:
author yz70s <yz70s@users.noreply.github.com>2016-10-09 17:39:24 +0200
committer yz70s <yz70s@users.noreply.github.com>2016-10-09 21:44:10 +0200
commit1b5843f1488ef75d74d6193c4fc245e06c36c375 (patch)
treecc52f83b8da75eb11276e85403b3da7217e1a112 /src/mame/video/chihiro.cpp
parent98753caf13ebb5c5ec7dc0dfcbdf246f6c4c4904 (diff)
chihiro.cpp: tidy up for pull (nw)
Diffstat (limited to 'src/mame/video/chihiro.cpp')
-rw-r--r--src/mame/video/chihiro.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/mame/video/chihiro.cpp b/src/mame/video/chihiro.cpp
index 0dd6aaba5d4..82d92dfe848 100644
--- a/src/mame/video/chihiro.cpp
+++ b/src/mame/video/chihiro.cpp
@@ -2360,7 +2360,6 @@ void nv2a_renderer::convert_vertices_poly(vertex_nv *source, nv2avertex_t *desti
{
vertex_nv vert[4];
int m, u;
- //float t[4];
float v[4];
// take each vertex with its attributes and obtain data for drawing
@@ -2369,32 +2368,11 @@ void nv2a_renderer::convert_vertices_poly(vertex_nv *source, nv2avertex_t *desti
// transformation matrices
// this part needs more testing
for (m = 0; m < count; m++) {
-#if 0
- for (int i = 0; i < 4; i++) {
- t[i] = 0;
- // in matrix.modelview[c][r] c is the column and r is the row of the direct3d matrix
- for (int j = 0; j < 4; j++)
- t[i] += matrix.modelview[i][j] * source[m].attribute[0].fv[j];
- };
- for (int i = 0; i < 4; i++) {
- v[i] = 0;
- for (int j = 0; j < 4; j++)
- v[i] += matrix.composite[i][j] * t[j];
- };
-#else
for (int i = 0; i < 4; i++) {
v[i] = 0;
for (int j = 0; j < 4; j++)
v[i] += matrix.composite[i][j] * source[m].attribute[0].fv[j];
};
-#endif
- /* it seems these are not needed ?
- for (int i = 0; i < 3; i++) {
- v[i] *= matrix.scale[i];
- }
- for (int i = 0; i < 3; i++) {
- v[i] += matrix.translate[i];
- }*/
destination[m].w = v[3];
destination[m].x = (v[0] / v[3])*supersample_factor_x; // source[m].attribute[0].fv[0];
destination[m].y = (v[1] / v[3])*supersample_factor_y; // source[m].attribute[0].fv[1];
@@ -3505,17 +3483,17 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
// modelview matrix
if ((maddress >= 0x0480) && (maddress < 0x04c0)) {
maddress = (maddress - 0x0480) / 4;
- /* the modelview matrix is obtained by direct3d by multiplyng the world matrix and the view matrix
+ /* the modelview matrix is obtained by direct3d by multiplying the world matrix and the view matrix
modelview = world * view
given a point in 3d space with coordinates x y and z, to find te transformed coordinates
- first create a row vector with components (x,y,z,1) then multyply the vector by the matrix
+ first create a row vector with components (x,y,z,1) then multiply the vector by the matrix
transformed = rowvector * matrix
in direct3d the matrix is stored as the sequence (first digit row, second digit column)
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
- but it is sent trasposed as the sequence
+ but it is sent transposed as the sequence
11 21 31 41 12 22 32 42 13 23 33 43 14 24 34 44
so in matrix.modelview[x][y] x is the column and y is the row of the direct3d matrix
*/