- if (topLeft.x < 0) {
- begin.x -= topLeft.x;
- topLeft.x = 0;
- }
- if (topLeft.y < 0) {
- begin.y -= topLeft.y;
- topLeft.y = 0;
- }
- if (bottomRight.x > clip.x) {
- end.x -= bottomRight.x - clip.x;
- bottomRight.x = clip.x;
- }
- if (bottomRight.y > clip.y) {
- end.y -= bottomRight.y - clip.y;
- bottomRight.y = clip.y;
- }
-
- for (Vector<int> pos(begin), cur(topLeft); pos.y < end.y; ++pos.y, ++cur.y) {
- for (pos.x = begin.x, cur.x = topLeft.x; pos.x < end.x; ++pos.x, ++cur.x) {
- canvas.SetColor(world.ColorAt(pos));
- canvas.Dot(cur);
- }
- }
+ const Vector<int> pos = cam.ToScreen(Vector<float>(0, 0));
+ canvas.Copy(worldTex, pos);