| Index: dxgltest/Tests2D.cpp |
| — | — | @@ -936,14 +936,13 @@ |
| 937 | 937 | r1.bottom = 7;
|
| 938 | 938 | break;
|
| 939 | 939 | }
|
| 940 | | - //sprites[0].surface->Blt(NULL, sprites[2].surface, NULL, DDBLT_WAIT|DDBLT_KEYSRCOVERRIDE, &bltfx);
|
| 941 | | - sprites[0].surface->Blt(NULL, sprites[2].surface, NULL, DDBLT_WAIT, NULL);
|
| | 940 | + sprites[0].surface->Blt(NULL, sprites[2].surface, NULL, DDBLT_WAIT|DDBLT_KEYSRCOVERRIDE, &bltfx);
|
| 942 | 941 | temp1->GetDC(&hDCdest);
|
| 943 | 942 | sprites[0].surface->GetDC(&hDCsrc);
|
| 944 | 943 | if (ddver > 3) ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
| 945 | 944 | else ddsd.dwSize = sizeof(DDSURFACEDESC);
|
| 946 | 945 | temp1->GetSurfaceDesc(&ddsd);
|
| 947 | | - StretchBlt(hDCdest, ((ddsd.dwWidth / 2) - 128), ((ddsd.dwHeight / 2) - 128), 256, 256,
|
| | 946 | + StretchBlt(hDCdest, ((ddsd.dwWidth / 2) - 128), ((ddsd.dwHeight / 2) + 128), 256, -256,
|
| 948 | 947 | hDCsrc, 0, 0, r1.right, r1.bottom, SRCCOPY);
|
| 949 | 948 | sprites[0].surface->ReleaseDC(hDCsrc);
|
| 950 | 949 | SetBkColor(hDCdest, RGB(0, 0, 255));
|
| — | — | @@ -950,7 +949,7 @@ |
| 951 | 950 | SetTextColor(hDCdest, RGB(255, 255, 255));
|
| 952 | 951 | _tcscpy(message, _T("Source Color Key Override Test"));
|
| 953 | 952 | TextOut(hDCdest, 0, 0, message, _tcslen(message));
|
| 954 | | - _stprintf(message, _T("Color: 0x%08X"), bltfx.ddckSrcColorkey.dwColorSpaceHighValue);
|
| | 953 | + _stprintf(message, _T("Color: 0x%08X "), bltfx.ddckSrcColorkey.dwColorSpaceHighValue);
|
| 955 | 954 | TextOut(hDCdest, 0, 16, message, _tcslen(message));
|
| 956 | 955 | temp1->ReleaseDC(hDCdest);
|
| 957 | 956 | if (backbuffers) temp1->Release();
|
| Index: dxgltest/surfacegen.cpp |
| — | — | @@ -1287,7 +1287,7 @@ |
| 1288 | 1288 | {
|
| 1289 | 1289 | int x, y;
|
| 1290 | 1290 | DWORD i;
|
| 1291 | | - if (!index)
|
| | 1291 | + if (index)
|
| 1292 | 1292 | {
|
| 1293 | 1293 | switch (bpp)
|
| 1294 | 1294 | {
|
| — | — | @@ -1296,11 +1296,12 @@ |
| 1297 | 1297 | {
|
| 1298 | 1298 | for (int x = 0; x < 16; x++)
|
| 1299 | 1299 | {
|
| 1300 | | - i = x + (y << 4);
|
| | 1300 | + i = x + ((15 - y) << 4);
|
| 1301 | 1301 | buffer[x + (ddsd.lPitch*y)] = i;
|
| 1302 | 1302 | }
|
| 1303 | 1303 | }
|
| 1304 | 1304 | break;
|
| | 1305 | + case 15:
|
| 1305 | 1306 | for (int y = 1; y < 8; y++)
|
| 1306 | 1307 | {
|
| 1307 | 1308 | for (int x = 0; x < 32; x++)
|
| — | — | @@ -1307,30 +1308,31 @@ |
| 1308 | 1309 | {
|
| 1309 | 1310 | switch (y)
|
| 1310 | 1311 | {
|
| 1311 | | - case 1:
|
| | 1312 | + case 7:
|
| 1312 | 1313 | i = x << 10;
|
| 1313 | 1314 | break;
|
| 1314 | | - case 2:
|
| | 1315 | + case 6:
|
| 1315 | 1316 | i = x << 5;
|
| 1316 | 1317 | break;
|
| 1317 | | - case 3:
|
| | 1318 | + case 5:
|
| 1318 | 1319 | i = x;
|
| 1319 | 1320 | break;
|
| 1320 | 1321 | case 4:
|
| 1321 | 1322 | i = x + (x << 5);
|
| 1322 | 1323 | break;
|
| 1323 | | - case 5:
|
| | 1324 | + case 3:
|
| 1324 | 1325 | i = x + (x << 10);
|
| 1325 | 1326 | break;
|
| 1326 | | - case 6:
|
| | 1327 | + case 2:
|
| 1327 | 1328 | i = (x << 5) + (x << 10);
|
| 1328 | 1329 | break;
|
| 1329 | | - case 7:
|
| | 1330 | + case 1:
|
| 1330 | 1331 | default:
|
| 1331 | 1332 | i = x + (x << 5) + (x << 10);
|
| 1332 | 1333 | break;
|
| 1333 | 1334 | }
|
| 1334 | | - buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = i;
|
| | 1335 | + buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| | 1336 | + buffer[((x * 2) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| 1335 | 1337 | }
|
| 1336 | 1338 | }
|
| 1337 | 1339 | break;
|
| — | — | @@ -1341,31 +1343,31 @@ |
| 1342 | 1344 | {
|
| 1343 | 1345 | switch (y)
|
| 1344 | 1346 | {
|
| 1345 | | - case 1:
|
| | 1347 | + case 7:
|
| 1346 | 1348 | i = (x >> 1) << 11;
|
| 1347 | 1349 | break;
|
| 1348 | | - case 2:
|
| | 1350 | + case 6:
|
| 1349 | 1351 | i = x << 5;
|
| 1350 | 1352 | break;
|
| 1351 | | - case 3:
|
| | 1353 | + case 5:
|
| 1352 | 1354 | i = x >> 1;
|
| 1353 | 1355 | break;
|
| 1354 | 1356 | case 4:
|
| 1355 | 1357 | i = (x >> 1) + (x << 5);
|
| 1356 | 1358 | break;
|
| 1357 | | - case 5:
|
| | 1359 | + case 3:
|
| 1358 | 1360 | i = (x >> 1) + ((x >> 1) << 11);
|
| 1359 | 1361 | break;
|
| 1360 | | - case 6:
|
| | 1362 | + case 2:
|
| 1361 | 1363 | i = (x << 5) + ((x >> 1) << 11);
|
| 1362 | 1364 | break;
|
| 1363 | | - case 7:
|
| | 1365 | + case 1:
|
| 1364 | 1366 | default:
|
| 1365 | 1367 | i = (x >> 1) + (x << 5) + ((x >> 1) << 11);
|
| 1366 | 1368 | break;
|
| 1367 | 1369 | }
|
| 1368 | 1370 | buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| 1369 | | - buffer[((x * 2) + (ddsd.lPitch*(y - 1))) + 1] = (char)i >> 8;
|
| | 1371 | + buffer[((x * 2) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| 1370 | 1372 | }
|
| 1371 | 1373 | }
|
| 1372 | 1374 | break;
|
| — | — | @@ -1376,32 +1378,32 @@ |
| 1377 | 1379 | {
|
| 1378 | 1380 | switch (y)
|
| 1379 | 1381 | {
|
| 1380 | | - case 1:
|
| | 1382 | + case 7:
|
| 1381 | 1383 | i = x << 16;
|
| 1382 | 1384 | break;
|
| 1383 | | - case 2:
|
| | 1385 | + case 6:
|
| 1384 | 1386 | i = x << 8;
|
| 1385 | 1387 | break;
|
| 1386 | | - case 3:
|
| | 1388 | + case 5:
|
| 1387 | 1389 | i = x;
|
| 1388 | 1390 | break;
|
| 1389 | 1391 | case 4:
|
| 1390 | 1392 | i = x + (x << 8);
|
| 1391 | 1393 | break;
|
| 1392 | | - case 5:
|
| | 1394 | + case 3:
|
| 1393 | 1395 | i = x + (x << 16);
|
| 1394 | 1396 | break;
|
| 1395 | | - case 6:
|
| | 1397 | + case 2:
|
| 1396 | 1398 | i = (x << 8) + (x << 16);
|
| 1397 | 1399 | break;
|
| 1398 | | - case 7:
|
| | 1400 | + case 1:
|
| 1399 | 1401 | default:
|
| 1400 | 1402 | i = x + (x << 8) + (x << 16);
|
| 1401 | 1403 | break;
|
| 1402 | 1404 | }
|
| 1403 | 1405 | buffer[(x * 3) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| 1404 | | - buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 1] = (char)i >> 8;
|
| 1405 | | - buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 2] = (char)i >> 16;
|
| | 1406 | + buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| | 1407 | + buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 2] = (char)(i >> 16);
|
| 1406 | 1408 | }
|
| 1407 | 1409 | }
|
| 1408 | 1410 | break;
|
| — | — | @@ -1413,32 +1415,32 @@ |
| 1414 | 1416 | {
|
| 1415 | 1417 | switch (y)
|
| 1416 | 1418 | {
|
| 1417 | | - case 1:
|
| | 1419 | + case 7:
|
| 1418 | 1420 | i = x << 16;
|
| 1419 | 1421 | break;
|
| 1420 | | - case 2:
|
| | 1422 | + case 6:
|
| 1421 | 1423 | i = x << 8;
|
| 1422 | 1424 | break;
|
| 1423 | | - case 3:
|
| | 1425 | + case 5:
|
| 1424 | 1426 | i = x;
|
| 1425 | 1427 | break;
|
| 1426 | 1428 | case 4:
|
| 1427 | 1429 | i = x + (x << 8);
|
| 1428 | 1430 | break;
|
| 1429 | | - case 5:
|
| | 1431 | + case 3:
|
| 1430 | 1432 | i = x + (x << 16);
|
| 1431 | 1433 | break;
|
| 1432 | | - case 6:
|
| | 1434 | + case 2:
|
| 1433 | 1435 | i = (x << 8) + (x << 16);
|
| 1434 | 1436 | break;
|
| 1435 | | - case 7:
|
| | 1437 | + case 1:
|
| 1436 | 1438 | default:
|
| 1437 | 1439 | i = x + (x << 8) + (x << 16);
|
| 1438 | 1440 | break;
|
| 1439 | 1441 | }
|
| 1440 | 1442 | buffer[(x * 4) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| 1441 | | - buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 1] = (char)i >> 8;
|
| 1442 | | - buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 2] = (char)i >> 16;
|
| | 1443 | + buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| | 1444 | + buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 2] = (char)(i >> 16);
|
| 1443 | 1445 | buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 3] = 0;
|
| 1444 | 1446 | }
|
| 1445 | 1447 | }
|
| — | — | @@ -1454,7 +1456,7 @@ |
| 1455 | 1457 | {
|
| 1456 | 1458 | for (int x = 0; x < 16; x++)
|
| 1457 | 1459 | {
|
| 1458 | | - i = ((x + (y << 4)) + 128) & 255;
|
| | 1460 | + i = ((x + ((15 - y) << 4)) + 128) & 255;
|
| 1459 | 1461 | buffer[x + (ddsd.lPitch*y)] = i;
|
| 1460 | 1462 | }
|
| 1461 | 1463 | }
|
| — | — | @@ -1466,30 +1468,31 @@ |
| 1467 | 1469 | {
|
| 1468 | 1470 | switch (y)
|
| 1469 | 1471 | {
|
| 1470 | | - case 7:
|
| 1471 | | - i = (32 - x) << 10;
|
| | 1472 | + case 1:
|
| | 1473 | + i = (31 - x) << 10;
|
| 1472 | 1474 | break;
|
| 1473 | | - case 6:
|
| 1474 | | - i = (32 - x) << 5;
|
| | 1475 | + case 2:
|
| | 1476 | + i = (31 - x) << 5;
|
| 1475 | 1477 | break;
|
| | 1478 | + case 3:
|
| | 1479 | + i = (31 - x);
|
| | 1480 | + break;
|
| 1476 | 1481 | case 5:
|
| 1477 | | - i = (32 - x);
|
| | 1482 | + i = (31 - x) + ((31 - x) << 5);
|
| 1478 | 1483 | break;
|
| 1479 | 1484 | case 4:
|
| 1480 | | - i = x + ((32 - x) << 5);
|
| | 1485 | + i = (31 - x) + ((31 - x) << 10);
|
| 1481 | 1486 | break;
|
| 1482 | | - case 3:
|
| 1483 | | - i = x + ((32 - x) << 10);
|
| | 1487 | + case 6:
|
| | 1488 | + i = ((31 - x) << 5) + ((31 - x) << 10);
|
| 1484 | 1489 | break;
|
| 1485 | | - case 2:
|
| 1486 | | - i = ((32 - x) << 5) + ((32 - x) << 10);
|
| 1487 | | - break;
|
| 1488 | | - case 1:
|
| | 1490 | + case 7:
|
| 1489 | 1491 | default:
|
| 1490 | | - i = (32 - x) + ((32 - x) << 5) + ((32 - x) << 10);
|
| | 1492 | + i = (31 - x) + ((31 - x) << 5) + ((31 - x) << 10);
|
| 1491 | 1493 | break;
|
| 1492 | 1494 | }
|
| 1493 | | - buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = i;
|
| | 1495 | + buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| | 1496 | + buffer[((x * 2) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| 1494 | 1497 | }
|
| 1495 | 1498 | }
|
| 1496 | 1499 | break;
|
| — | — | @@ -1500,30 +1503,31 @@ |
| 1501 | 1504 | {
|
| 1502 | 1505 | switch (y)
|
| 1503 | 1506 | {
|
| 1504 | | - case 7:
|
| 1505 | | - i = ((64 - x) >> 1) << 11;
|
| | 1507 | + case 1:
|
| | 1508 | + i = ((63 - x) >> 1) << 11;
|
| 1506 | 1509 | break;
|
| 1507 | | - case 6:
|
| 1508 | | - i = (64 - x) << 5;
|
| | 1510 | + case 2:
|
| | 1511 | + i = (63 - x) << 5;
|
| 1509 | 1512 | break;
|
| | 1513 | + case 3:
|
| | 1514 | + i = (63 - x) >> 1;
|
| | 1515 | + break;
|
| 1510 | 1516 | case 5:
|
| 1511 | | - i = (64 - x) >> 1;
|
| | 1517 | + i = ((63 - x) >> 1) + ((63 - x) << 5);
|
| 1512 | 1518 | break;
|
| 1513 | 1519 | case 4:
|
| 1514 | | - i = ((64 - x) >> 1) + ((64 - x) << 5);
|
| | 1520 | + i = ((63 - x) >> 1) + (((63 - x) >> 1) << 11);
|
| 1515 | 1521 | break;
|
| 1516 | | - case 3:
|
| 1517 | | - i = ((64 - x) >> 1) + (((64 - x) >> 1) << 11);
|
| | 1522 | + case 6:
|
| | 1523 | + i = ((63 - x) << 5) + (((63 - x) >> 1) << 11);
|
| 1518 | 1524 | break;
|
| 1519 | | - case 2:
|
| 1520 | | - i = ((64 - x) << 5) + (((64 - x) >> 1) << 11);
|
| 1521 | | - break;
|
| 1522 | | - case 1:
|
| | 1525 | + case 7:
|
| 1523 | 1526 | default:
|
| 1524 | | - i = ((64 - x) >> 1) + ((64 - x) << 5) + (((64 - x) >> 1) << 11);
|
| | 1527 | + i = ((63 - x) >> 1) + ((63 - x) << 5) + (((63 - x) >> 1) << 11);
|
| 1525 | 1528 | break;
|
| 1526 | 1529 | }
|
| 1527 | | - buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = i;
|
| | 1530 | + buffer[(x * 2) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| | 1531 | + buffer[((x * 2) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| 1528 | 1532 | }
|
| 1529 | 1533 | }
|
| 1530 | 1534 | break;
|
| — | — | @@ -1534,32 +1538,32 @@ |
| 1535 | 1539 | {
|
| 1536 | 1540 | switch (y)
|
| 1537 | 1541 | {
|
| 1538 | | - case 7:
|
| 1539 | | - i = (256 - x) << 16;
|
| | 1542 | + case 1:
|
| | 1543 | + i = (255 - x) << 16;
|
| 1540 | 1544 | break;
|
| 1541 | | - case 6:
|
| 1542 | | - i = (256 - x) << 8;
|
| | 1545 | + case 2:
|
| | 1546 | + i = (255 - x) << 8;
|
| 1543 | 1547 | break;
|
| | 1548 | + case 3:
|
| | 1549 | + i = (255 - x);
|
| | 1550 | + break;
|
| 1544 | 1551 | case 5:
|
| 1545 | | - i = (256 - x);
|
| | 1552 | + i = (255 - x) + ((255 - x) << 8);
|
| 1546 | 1553 | break;
|
| 1547 | 1554 | case 4:
|
| 1548 | | - i = (256 - x) + ((256 - x) << 8);
|
| | 1555 | + i = (255 - x) + ((255 - x) << 16);
|
| 1549 | 1556 | break;
|
| 1550 | | - case 3:
|
| 1551 | | - i = (256 - x) + ((256 - x) << 16);
|
| | 1557 | + case 6:
|
| | 1558 | + i = ((255 - x) << 8) + ((255 - x) << 16);
|
| 1552 | 1559 | break;
|
| 1553 | | - case 2:
|
| 1554 | | - i = ((256 - x) << 8) + ((256 - x) << 16);
|
| 1555 | | - break;
|
| 1556 | | - case 1:
|
| | 1560 | + case 7:
|
| 1557 | 1561 | default:
|
| 1558 | | - i = (256 - x) + ((256 - x) << 8) + ((256 - x) << 16);
|
| | 1562 | + i = (255 - x) + ((255 - x) << 8) + ((255 - x) << 16);
|
| 1559 | 1563 | break;
|
| 1560 | 1564 | }
|
| 1561 | 1565 | buffer[(x * 3) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| 1562 | | - buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 1] = (char)i >> 8;
|
| 1563 | | - buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 2] = (char)i >> 16;
|
| | 1566 | + buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| | 1567 | + buffer[((x * 3) + (ddsd.lPitch*(y - 1))) + 2] = (char)(i >> 16);
|
| 1564 | 1568 | }
|
| 1565 | 1569 | }
|
| 1566 | 1570 | break;
|
| — | — | @@ -1571,32 +1575,32 @@ |
| 1572 | 1576 | {
|
| 1573 | 1577 | switch (y)
|
| 1574 | 1578 | {
|
| 1575 | | - case 7:
|
| 1576 | | - i = (256 - x) << 16;
|
| | 1579 | + case 1:
|
| | 1580 | + i = (255 - x) << 16;
|
| 1577 | 1581 | break;
|
| 1578 | | - case 6:
|
| 1579 | | - i = (256 - x) << 8;
|
| | 1582 | + case 2:
|
| | 1583 | + i = (255 - x) << 8;
|
| 1580 | 1584 | break;
|
| | 1585 | + case 3:
|
| | 1586 | + i = (255 - x);
|
| | 1587 | + break;
|
| 1581 | 1588 | case 5:
|
| 1582 | | - i = (256 - x);
|
| | 1589 | + i = (255 - x) + ((255 - x) << 8);
|
| 1583 | 1590 | break;
|
| 1584 | 1591 | case 4:
|
| 1585 | | - i = (256 - x) + ((256 - x) << 8);
|
| | 1592 | + i = (255 - x) + ((255 - x) << 16);
|
| 1586 | 1593 | break;
|
| 1587 | | - case 3:
|
| 1588 | | - i = (256 - x) + ((256 - x) << 16);
|
| | 1594 | + case 6:
|
| | 1595 | + i = ((255 - x) << 8) + ((255 - x) << 16);
|
| 1589 | 1596 | break;
|
| 1590 | | - case 2:
|
| 1591 | | - i = ((256 - x) << 8) + ((256 - x) << 16);
|
| 1592 | | - break;
|
| 1593 | | - case 1:
|
| | 1597 | + case 7:
|
| 1594 | 1598 | default:
|
| 1595 | | - i = (256 - x) + ((256 - x) << 8) + ((256 - x) << 16);
|
| | 1599 | + i = (255 - x) + ((255 - x) << 8) + ((255 - x) << 16);
|
| 1596 | 1600 | break;
|
| 1597 | 1601 | }
|
| 1598 | 1602 | buffer[(x * 4) + (ddsd.lPitch*(y - 1))] = (char)i;
|
| 1599 | | - buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 1] = (char)i >> 8;
|
| 1600 | | - buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 2] = (char)i >> 16;
|
| | 1603 | + buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 1] = (char)(i >> 8);
|
| | 1604 | + buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 2] = (char)(i >> 16);
|
| 1601 | 1605 | buffer[((x * 4) + (ddsd.lPitch*(y - 1))) + 3] = 0;
|
| 1602 | 1606 | }
|
| 1603 | 1607 | }
|