/*
 * Copyright 2014-2016 See AUTHORS file.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.kotcrab.vis.runtime.system;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.systems.IteratingSystem;
import com.kotcrab.vis.runtime.component.Origin;
import com.kotcrab.vis.runtime.component.Tint;
import com.kotcrab.vis.runtime.component.Transform;

/** @author Kotcrab */
public class DirtyCleanerSystem extends IteratingSystem {
	private ComponentMapper<Transform> transformCm;
	private ComponentMapper<Origin> originCm;
	private ComponentMapper<Tint> tintCm;

	public DirtyCleanerSystem () {
		super(Aspect.one(Transform.class, Origin.class, Tint.class));
	}

	@Override
	protected void process (int entityId) {
		Transform transform = transformCm.getSafe(entityId);
		Origin origin = originCm.getSafe(entityId);
		Tint tint = tintCm.getSafe(entityId);

		if (transform != null) transform.setDirty(false);
		if (origin != null) origin.setDirty(false);
		if (tint != null) tint.setDirty(false);
	}
}

@@ -744,16 +744,68 @@
 System;%0A
+import com.kotcrab.vis.runtime.component.Invisible;%0A
 import c
@@ -1251,16 +1251,41 @@
 t.class)
+.exclude(Invisible.class)
 );%0A%09%7D%0A%0A%09

Fix clear dirty state on invisible entities, close #155