Skip to content

Commit

Permalink
DanmakuRenderer: skip drawing if danmaku is filtered by FILTER_TYPE_O…
Browse files Browse the repository at this point in the history
…VERLAPPING|FILTER_TYPE_MAXIMUM_LINES(ignore priority)
  • Loading branch information
ctiao committed Sep 11, 2015
1 parent 5429291 commit ee79ef6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ public boolean hasPassedFilter() {
}

public boolean isFiltered() {
return mFilterParam != 0 && filterResetFlag == GlobalFlagValues.FILTER_RESET_FLAG;
return filterResetFlag == GlobalFlagValues.FILTER_RESET_FLAG && mFilterParam != 0;
}

public boolean isFilteredBy(int flag) {
return filterResetFlag == GlobalFlagValues.FILTER_RESET_FLAG && (mFilterParam & flag) == flag;
}

public void setVisibility(boolean b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRender
}

if (drawItem.time < startRenderTime
|| (drawItem.priority == 0 && drawItem.isFiltered())) {
|| (drawItem.priority == 0 && drawItem.isFiltered())
|| drawItem.isFilteredBy(DanmakuFilters.FILTER_TYPE_OVERLAPPING)
|| drawItem.isFilteredBy(DanmakuFilters.FILTER_TYPE_MAXIMUM_LINES)) {
continue;
}

Expand Down

0 comments on commit ee79ef6

Please sign in to comment.