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;
|
|
|
|
|
|
|
|
|
|
#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; }
|
2016-06-16 22:05:17 +00:00
|
|
|
|
bool DrawMapCenter { get; set; } //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
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);
|
2023-08-13 19:19:25 +00:00
|
|
|
|
bool StartOverlay(bool clear, int layernum = 0);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void Finish();
|
|
|
|
|
void SetPresentation(Presentation present);
|
|
|
|
|
void Present();
|
|
|
|
|
|
|
|
|
|
// Drawing methods
|
|
|
|
|
void PlotLine(Vector2D start, Vector2D end, PixelColor c);
|
2016-06-16 22:05:17 +00:00
|
|
|
|
void PlotLine(Vector2D start, Vector2D end, PixelColor c, float lengthscaler); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void PlotLinedef(Linedef l, PixelColor c);
|
|
|
|
|
void PlotLinedefSet(ICollection<Linedef> linedefs);
|
|
|
|
|
void PlotSector(Sector s);
|
|
|
|
|
void PlotSector(Sector s, PixelColor c);
|
2022-02-06 11:19:03 +00:00
|
|
|
|
void PlotVertex(Vertex v, int colorindex, bool checkMode = true);
|
|
|
|
|
void PlotVertexAt(Vector2D v, int colorindex, bool checkMode = true);
|
|
|
|
|
void PlotVerticesSet(ICollection<Vertex> vertices, bool checkMode = true);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
void RenderThing(Thing t, PixelColor c, float alpha);
|
|
|
|
|
void RenderThingSet(ICollection<Thing> things, float alpha);
|
2023-08-13 19:19:25 +00:00
|
|
|
|
void RenderThingSet(ICollection<Thing> things, PixelColor c, float alpha);
|
2023-06-15 10:25:46 +00:00
|
|
|
|
void RenderSRB2Extras();
|
2009-04-19 18:07:22 +00:00
|
|
|
|
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
|
2023-06-15 10:25:46 +00:00
|
|
|
|
void RenderArrows(ICollection<Line3D> line, bool transformcoords, bool sizecheck); //mxd
|
2016-05-19 21:44:39 +00:00
|
|
|
|
void RenderText(TextLabel text); //mxd, DB2 compatibility
|
|
|
|
|
void RenderText(ITextLabel text); //mxd
|
2016-04-25 14:48:39 +00:00
|
|
|
|
void RenderText(IList<ITextLabel> labels); //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|