FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/src/simulate/runtime_range.cpp at split-heap · Bais/daScript · GitHub
Bais
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
src
/
simulate
/
runtime_range.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (36 loc) · 1.4 KB
Breadcrumbs
daScript
/
src
/
simulate
/
runtime_range.cpp
Copy path
File metadata and controls
42 lines (36 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
include
"
daScript/misc/platform.h
"
#
include
"
daScript/simulate/runtime_range.h
"
namespace
das
{
bool
RangeIterator::first
( Context & context, IteratorContext & itc ) {
vec4f ll = subexpr->
eval
(context);
DAS_ITERATOR_EXCEPTION_POINT
;
range r = cast<range>::
to
(ll);
//
does not matter if its range or urange, hence only one type
itc.
value
= cast<
int32_t
>::
from
(r.
from
);
itc.
range_to
= r.
to
;
return
(r.
from
!=r.
to
);
}
bool
RangeIterator::next
( Context &, IteratorContext & itc ) {
int32_t
nextValue = cast<
int32_t
>::
to
(itc.
value
) +
1
;
itc.
value
= cast<
int32_t
>::
from
(nextValue);
return
(nextValue != itc.
range_to
);
}
void
RangeIterator::close
( Context &, IteratorContext & ) {
}
vec4f
SimNode_RangeIterator::eval
( Context & ) {
return
cast<Iterator *>::
from
(
static_cast
<RangeIterator *>(
this
));
}
vec4f
SimNode_ForRange::eval
( Context & context ) {
vec4f ll = sources[
0
]->
eval
(context);
DAS_EXCEPTION_POINT
;
range r = cast<range>::
to
(ll);
int32_t
* __restrict pi = (
int32_t
*)(context.
stack
.
sp
() + stackTop[
0
]);
int32_t
r_to = r.
to
;
for
(
int32_t
i = r.
from
; i != r_to && !context.
stopFlags
; ++i) {
*pi = i;
body->
eval
(context);
}
context.
stopFlags
&= ~EvalFlags::stopForBreak;
return
v_zero
();
}
}
Back
|
FazBrowse Home
|
New Git URL