| [5] | 1 | #include "rc1.0_combiners.h" |
|---|
| 2 | #include "nvparse_errors.h" |
|---|
| 3 | #include "nvparse_externs.h" |
|---|
| 4 | #include <string.h> |
|---|
| 5 | #include <OgreGLPrerequisites.h> |
|---|
| 6 | |
|---|
| 7 | void CombinersStruct::Validate() |
|---|
| 8 | { |
|---|
| 9 | if (2 == numConsts && |
|---|
| 10 | cc[0].reg.bits.name == cc[1].reg.bits.name) |
|---|
| 11 | errors.set("global constant set twice"); |
|---|
| 12 | |
|---|
| 13 | generals.Validate(numConsts, &cc[0]); |
|---|
| 14 | |
|---|
| 15 | final.Validate(); |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | void CombinersStruct::Invoke() |
|---|
| 19 | { |
|---|
| 20 | for (int i = 0; i < numConsts; i++) |
|---|
| 21 | glCombinerParameterfvNV(cc[i].reg.bits.name, &(cc[i].v[0])); |
|---|
| 22 | |
|---|
| 23 | generals.Invoke(); |
|---|
| 24 | |
|---|
| 25 | final.Invoke(); |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | bool is_rc10(const char * s) |
|---|
| 29 | { |
|---|
| 30 | return ! strncmp(s, "!!RC1.0", 7); |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | bool rc10_init_more() |
|---|
| 35 | { |
|---|
| 36 | bool rcinit = false; |
|---|
| 37 | if(rcinit == false) |
|---|
| 38 | { |
|---|
| 39 | /* |
|---|
| 40 | if(! glh_init_extensions("GL_NV_register_combiners")) |
|---|
| 41 | { |
|---|
| 42 | errors.set("unable to initialize GL_NV_register_combiners\n"); |
|---|
| 43 | return false; |
|---|
| 44 | } |
|---|
| 45 | else |
|---|
| 46 | { |
|---|
| 47 | */ |
|---|
| 48 | rcinit = true; |
|---|
| 49 | /* |
|---|
| 50 | } |
|---|
| 51 | */ |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | bool rc2init = false; |
|---|
| 55 | if(rc2init == false) |
|---|
| 56 | { |
|---|
| 57 | //glh_init_extensions("GL_NV_register_combiners2"); |
|---|
| 58 | // Don't fail if this doesn't initialize. |
|---|
| 59 | // We will run even if it doesn't exist. |
|---|
| 60 | rc2init = true; |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | errors.reset(); |
|---|
| 64 | line_number = 1; |
|---|
| 65 | |
|---|
| 66 | return true; |
|---|
| 67 | } |
|---|
| 68 | /* |
|---|
| 69 | else if(!strncmp(instring, "!!RC1.0", 7)) |
|---|
| 70 | { |
|---|
| 71 | if(glCombinerParameterfvNV == 0) |
|---|
| 72 | { |
|---|
| 73 | if(! glh_init_extensions("GL_NV_register_combiners")) |
|---|
| 74 | { |
|---|
| 75 | errors.set("unable to initialize GL_NV_register_combiners\n"); |
|---|
| 76 | free(instring); |
|---|
| 77 | return; |
|---|
| 78 | } |
|---|
| 79 | } |
|---|
| 80 | if(glCombinerStageParameterfvNV == 0) |
|---|
| 81 | { |
|---|
| 82 | glh_init_extensions("GL_NV_register_combiners2"); |
|---|
| 83 | // Don't fail if this doesn't initialize. |
|---|
| 84 | // We will run even if it doesn't exist. |
|---|
| 85 | } |
|---|
| 86 | errors.reset(); |
|---|
| 87 | line_number = 1; |
|---|
| 88 | rc10_init(instring+7); |
|---|
| 89 | rc10_parse(); |
|---|
| 90 | } |
|---|
| 91 | */ |
|---|