File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ export interface Shader {
28
28
29
29
export interface ShaderStage {
30
30
map ?: string ;
31
+ rgbGen ?: string ;
32
+ tcGen ?: string ;
33
+ tcMod ?: string ;
34
+ blendfunc ?: string ;
31
35
}
32
36
33
37
function parseShader ( tokenizer : Tokenizer , name : string ) : Shader {
@@ -139,13 +143,21 @@ function parseShaderStage(tokenizer: Tokenizer): ShaderStage {
139
143
}
140
144
break ;
141
145
case 'blendfunc' :
146
+ stage . blendfunc = tokenizer . skipLine ( ) . trim ( ) ;
147
+ break ;
142
148
case 'rgbgen' :
149
+ stage . rgbGen = tokenizer . skipLine ( ) . trim ( ) ;
150
+ break ;
143
151
case 'tcgen' :
152
+ stage . tcGen = tokenizer . skipLine ( ) . trim ( ) ;
153
+ break ;
154
+ case 'tcmod' :
155
+ stage . tcMod = tokenizer . skipLine ( ) . trim ( ) ;
156
+ break ;
144
157
case 'alphagen' :
145
158
case 'animmap' :
146
159
case 'clampmap' :
147
160
case 'videomap' :
148
- case 'tcmod' :
149
161
case 'detail' :
150
162
case 'alphafunc' :
151
163
case 'depthfunc' :
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ export class Tokenizer {
61
61
/**
62
62
* Skips all chars until a new line was found
63
63
*/
64
- public skipLine ( ) {
64
+ public skipLine ( ) : string {
65
+ let str = '' ;
65
66
while ( this . text . length > this . index ) {
66
67
const char = this . text [ this . index ++ ] ;
67
68
if ( char === '\r' ) {
@@ -74,7 +75,9 @@ export class Tokenizer {
74
75
this . lineNo += 1 ;
75
76
break ;
76
77
}
78
+ str += char ;
77
79
}
80
+ return str ;
78
81
}
79
82
80
83
public skipWhitespace ( ) : boolean {
You can’t perform that action at this time.
0 commit comments