DXGL r138 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r137
|
r138
|
r139
>
Date:
15:47, 16 April 2012
Author:
admin
Status:
new
Tags:
Comment:
Get textures working
Modified paths:
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -372,7 +372,6 @@
373
373
for(int i = 0; i < 8; i++)
374
374
if(VertexType[i+10].data) numtextures++;
375
375
shader |= (__int64)numtextures << 31;
376
- if(VertexType[1].data) shader |= (1i64 << 34);
377
376
if(VertexType[8].data) shader |= (1i64<<35);
378
377
if(VertexType[9].data) shader |= (1i64<<36);
379
378
if(VertexType[7].data) shader |= (1i64 << 37);
—
—
@@ -391,6 +390,7 @@
392
391
if(VertexType[i+2].data) blendweights++;
393
392
shader |= (__int64)blendweights << 46;
394
393
if(renderstate[D3DRENDERSTATE_NORMALIZENORMALS]) shader |= (1i64 << 49);
394
+ if(VertexType[1].data) shader |= (1i64 << 50);
395
395
//TODO: Implement texture stages.
396
396
for(i = 0; i < 8; i++)
397
397
{
—
—
@@ -473,7 +473,7 @@
474
474
int numtex = (dwVertexTypeDesc&D3DFVF_TEXCOUNT_MASK)>>D3DFVF_TEXCOUNT_SHIFT;
475
475
for(i = 0; i < 8; i++)
476
476
{
477
- vertdata[i+9].data = &vertptr[ptr];
477
+ vertdata[i+10].data = &vertptr[ptr];
478
478
if(i >= numtex) texformats[i] = -1;
479
479
else texformats[i] = (dwVertexTypeDesc>>(16+(2*i))&3);
480
480
switch(texformats[i])
Index: ddraw/shadergen.cpp
—
—
@@ -55,7 +55,6 @@
56
56
Bits 27-28 - Ambient material source VS
57
57
Bits 29-30 - Emissive material source VS
58
58
Bits 31-33 - Number of textures VS/FS
59
-Bit 34 - Use transformed vertices VS
60
59
Bit 35 - Use diffuse color VS
61
60
Bit 36 - Use specular color VS
62
61
Bit 37 - Enable normals VS
—
—
@@ -62,6 +61,7 @@
63
62
Bits 38-45 - Light types VS/FS
64
63
Bits 46-48 - Number of blending weights VS
65
64
Bit 49 - Normalize normals VS
65
+Bit 50 - Use transformed vertices VS
66
66
*/
67
67
68
68
/* Bits in Texture Stage ID:
—
—
@@ -320,7 +320,7 @@
321
321
vsrc->append(idstring);
322
322
// Attributes
323
323
vsrc->append(attr_xyz);
324
- if((id>>34)&1) vsrc->append(attr_rhw);
324
+ if((id>>50)&1) vsrc->append(attr_rhw);
325
325
tmp = attr_rgba;
326
326
if((id>>35)&1)
327
327
{
—
—
@@ -387,7 +387,7 @@
388
388
389
389
// Variables
390
390
vsrc->append(var_common);
391
- if(!((id>>34)&1)) vsrc->append(var_xyzw);
391
+ if(!((id>>50)&1)) vsrc->append(var_xyzw);
392
392
393
393
// Functions
394
394
if(numlights)
—
—
@@ -407,7 +407,7 @@
408
408
}
409
409
//Main
410
410
vsrc->append(mainstart);
411
- if((id>>34)&1) vsrc->append(op_passthru);
411
+ if((id>>50)&1) vsrc->append(op_passthru);
412
412
else vsrc->append(op_transform);
413
413
vsrc->append(op_resetcolor);
414
414
if((id>>49)&1) vsrc->append(op_normalize);
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version