Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader properties not stored by cpp-libawd #48

Open
GoogleCodeExporter opened this issue Jan 5, 2016 · 0 comments
Open

Shader properties not stored by cpp-libawd #48

GoogleCodeExporter opened this issue Jan 5, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Create a color material an add a shader to it, shader parameter are not placed 
into the output AWD file.
(code excerpt follows, compilable source [dumps to stdout] attached)

AWDMaterial *material = new AWDMaterial(AWD_MATTYPE_COLOR, name, len);
material->color = SILVER;
material->add_method(shader);
awd.add_material(material);

printf("AWDColorTransformMethod->calc_method_length(true) = %d\n",
                     shader->calc_method_length(true));

What is the expected output? What do you see instead?
The values for the shader multipliers and the color offset 
are expected in the output AWD file, so in this case, 
AWDColorTransformMethod->calc_method_length(true) should return something like 
30.

But AWDColorTransformMethod->calc_method_length(true) returns 10.
two bytes for type [0192, 00000000, 00000000], four bytes for properties 
length, four for user attributes length.

A hex dump of the output file is as follows (NOTE: no shader properties):
00000000  41 57 44 02 00 00 00 00  31 00 00 00 01 00 00 00  |AWD.....1.......|
00000010  00 51 00 26 00 00 00 06  00 73 69 6c 76 65 72 01  |.Q.&.....silver.|
00000020  01 0a 00 00 00 01 00 04  00 00 00 4d 41 52 53 92  |...........MARS.|
00000030  01 00 00 00 00 00 00 00  00 00 00 00 00           |.............|

What version of the product are you using? On what operating system?
$ hg identify -bint
f2c379aa1520 490 default tip

Please provide any additional information below.
It appears that the AWDColorTransformMethod::prepare_write() method is never 
called. So properties are never copied into the list. It seems all the shader 
types have this issue.

Original issue reported on code.google.com by elkq...@gmail.com on 23 Nov 2012 at 9:22

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant