mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
parent
4a8bd688a9
commit
291d69500b
@ -364,8 +364,7 @@ func (p *Program) glslBlock(topBlock, block *Block, level int, localVarIndex int
|
|||||||
}
|
}
|
||||||
lines = append(lines, fmt.Sprintf("%s}", idt))
|
lines = append(lines, fmt.Sprintf("%s}", idt))
|
||||||
case For:
|
case For:
|
||||||
v := localVarIndex
|
v := s.ForVarIndex
|
||||||
localVarIndex++
|
|
||||||
var delta string
|
var delta string
|
||||||
switch s.ForDelta {
|
switch s.ForDelta {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -64,10 +64,11 @@ func ifStmt(cond Expr, block Block, elseBlock Block) Stmt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func forStmt(init, end int, op Op, delta int, block Block) Stmt {
|
func forStmt(index, init, end int, op Op, delta int, block Block) Stmt {
|
||||||
return Stmt{
|
return Stmt{
|
||||||
Type: For,
|
Type: For,
|
||||||
Blocks: []Block{block},
|
Blocks: []Block{block},
|
||||||
|
ForVarIndex: index,
|
||||||
ForInit: init,
|
ForInit: init,
|
||||||
ForEnd: end,
|
ForEnd: end,
|
||||||
ForOp: op,
|
ForOp: op,
|
||||||
@ -592,6 +593,7 @@ varying vec3 V0;`,
|
|||||||
Block: block(
|
Block: block(
|
||||||
nil,
|
nil,
|
||||||
forStmt(
|
forStmt(
|
||||||
|
3,
|
||||||
0,
|
0,
|
||||||
100,
|
100,
|
||||||
LessThanOp,
|
LessThanOp,
|
||||||
|
@ -67,6 +67,7 @@ type Stmt struct {
|
|||||||
Type StmtType
|
Type StmtType
|
||||||
Exprs []Expr
|
Exprs []Expr
|
||||||
Blocks []Block
|
Blocks []Block
|
||||||
|
ForVarIndex int
|
||||||
ForInit int
|
ForInit int
|
||||||
ForEnd int
|
ForEnd int
|
||||||
ForOp Op
|
ForOp Op
|
||||||
|
Loading…
Reference in New Issue
Block a user