2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
|
|
|
|
using CodeImp.DoomBuilder.Data;
|
2012-09-17 21:57:08 +00:00
|
|
|
|
using CodeImp.DoomBuilder.GZBuilder.Geometry;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Rendering
|
|
|
|
|
{
|
|
|
|
|
public interface IRenderer2D
|
|
|
|
|
{
|
|
|
|
|
// Properties
|
|
|
|
|
float OffsetX { get; }
|
|
|
|
|
float OffsetY { get; }
|
|
|
|
|
float TranslateX { get; }
|
|
|
|
|
float TranslateY { get; }
|
|
|
|
|
float Scale { get; }
|
|
|
|
|
int VertexSize { get; }
|
|
|
|
|
ViewMode ViewMode { get; }
|
2015-08-24 21:49:15 +00:00
|
|
|
|
|
2009-08-21 14:11:18 +00:00
|
|
|
|
// View methods
|
|
|
|
|
Vector2D DisplayToMap(Vector2D mousepos);
|
|
|
|
|
Vector2D MapToDisplay(Vector2D mappos);
|
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
|
// Color methods
|
|
|
|
|
PixelColor DetermineLinedefColor(Linedef l);
|
|
|
|
|
PixelColor DetermineThingColor(Thing t);
|
|
|
|
|
int DetermineVertexColor(Vertex v);
|
2009-07-12 09:58:05 +00:00
|
|
|
|
int CalculateBrightness(int level);
|
2013-07-29 08:50:50 +00:00
|
|
|
|
void UpdateExtraFloorFlag(); //mxd
|
2009-07-12 09:58:05 +00:00
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
|
// Rendering management methods
|
|
|
|
|
bool StartPlotter(bool clear);
|
|
|
|
|
bool StartThings(bool clear);
|
|
|
|
|
bool StartOverlay(bool clear);
|
|
|
|
|
void Finish();
|
|
|
|
|
void SetPresentation(Presentation present);
|
|
|
|
|
void Present();
|
|
|
|
|
|
|
|
|
|
// Drawing methods
|
|
|
|
|
void PlotLine(Vector2D start, Vector2D end, PixelColor c);
|
|
|
|
|
void PlotLinedef(Linedef l, PixelColor c);
|
|
|
|
|
void PlotLinedefSet(ICollection<Linedef> linedefs);
|
|
|
|
|
void PlotSector(Sector s);
|
|
|
|
|
void PlotSector(Sector s, PixelColor c);
|
|
|
|
|
void PlotVertex(Vertex v, int colorindex);
|
|
|
|
|
void PlotVertexAt(Vector2D v, int colorindex);
|
|
|
|
|
void PlotVerticesSet(ICollection<Vertex> vertices);
|
|
|
|
|
void RenderThing(Thing t, PixelColor c, float alpha);
|
|
|
|
|
void RenderThingSet(ICollection<Thing> things, float alpha);
|
|
|
|
|
void RenderRectangle(RectangleF rect, float bordersize, PixelColor c, bool transformrect);
|
|
|
|
|
void RenderRectangleFilled(RectangleF rect, PixelColor c, bool transformrect);
|
2009-08-02 21:47:44 +00:00
|
|
|
|
void RenderRectangleFilled(RectangleF rect, PixelColor c, bool transformrect, ImageData texture);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void RenderLine(Vector2D start, Vector2D end, float thickness, PixelColor c, bool transformcoords);
|
2015-08-08 21:56:43 +00:00
|
|
|
|
void RenderArrows(ICollection<Line3D> line); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void RenderText(TextLabel text);
|
|
|
|
|
void RenderGeometry(FlatVertex[] vertices, ImageData texture, bool transformcoords);
|
2013-12-10 12:19:27 +00:00
|
|
|
|
void RenderHighlight(FlatVertex[] vertices, int color); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void RedrawSurface();
|
|
|
|
|
}
|
|
|
|
|
}
|