@@ -16,7 +16,7 @@ RasterizeWorldContext InitRasterizeWorldContext(uint32_t RenderTargetWidth, uint
16
16
.RenderTargetWidth = RenderTargetWidth,
17
17
.RenderTargetHeight = RenderTargetHeight,
18
18
.FloorVerticalOffset = ComputeVerticalOffset (cam, RenderTargetHeight),
19
- .CamCurrentSectorElevationOffset = 0 ,// ComputeElevationOffset(cam, world, RenderTargetHeight),
19
+ .CamCurrentSectorElevationOffset = 0 , // TODO : ComputeElevationOffset(cam, world, RenderTargetHeight),
20
20
};
21
21
22
22
context.yBoundaries .resize (RenderTargetWidth);
@@ -110,11 +110,11 @@ void RasterizeInRenderArea(RasterizeWorldContext& worldContext, SectorRenderCont
110
110
{
111
111
// Floor / ceiling rendering
112
112
{
113
- // Draw floor
114
- float centerY = ((RenderTargetHeight / 2 ) - FloorVerticalOffset) + CamCurrentSectorElevationOffset;
115
- DrawLine (x, yMinMax.min , x, centerY, currentSector.ceilingColor );
116
- // Draw Ceiling
117
- DrawLine (x, centerY, x, yMinMax.max , currentSector.floorColor );
113
+ // // Draw floor
114
+ // float centerY = ((RenderTargetHeight / 2) - FloorVerticalOffset) + CamCurrentSectorElevationOffset;
115
+ // DrawLine(x, yMinMax.min, x, centerY, currentSector.ceilingColor);
116
+ // // Draw Ceiling
117
+ // DrawLine(x, centerY, x, yMinMax.max, currentSector.floorColor);
118
118
}
119
119
120
120
// Means this is a slid wall
@@ -156,7 +156,7 @@ void RasterizeInRenderArea(RasterizeWorldContext& worldContext, SectorRenderCont
156
156
}
157
157
else
158
158
{
159
- renderAreaToPushInStack[ nextSectorId] .renderArea .xEnd = x;
159
+ renderAreaToPushInStack. at ( nextSectorId) .renderArea .xEnd = x;
160
160
}
161
161
162
162
// Draw a Purple placeholder where next sector will be drawn
@@ -176,6 +176,12 @@ void RasterizeInRenderArea(RasterizeWorldContext& worldContext, SectorRenderCont
176
176
177
177
void RenderNextAreaBorders (RasterizeWorldContext& worldContext, RenderAreaYMinMax& yMinMax, const Sector& currentSector, const Sector& nextSector, uint32_t x, float hitDistance)
178
178
{
179
+ // TODO :
180
+ // zCeilling shloud not be < to current zFloor
181
+ // And this is the same in the other way
182
+ // zFloor should not be > to current zCeiling
183
+
184
+ // Top Border
179
185
{
180
186
bool nextSectCelingHigher = nextSector.zCeiling >= currentSector.zCeiling ;
181
187
@@ -190,14 +196,15 @@ void RenderNextAreaBorders(RasterizeWorldContext& worldContext, RenderAreaYMinMa
190
196
191
197
if (!nextSectCelingHigher)
192
198
{
193
- bool topBorder = !nextSectCelingHigher;
194
- RenderCameraYLine (topBorderLineData, nextSector.topBorderColor , topBorder , true );
199
+ bool topEdge = !nextSectCelingHigher;
200
+ RenderCameraYLine (topBorderLineData, nextSector.topBorderColor , topEdge , true );
195
201
}
196
202
197
203
// Apply Y min
198
204
yMinMax.min = topBorderLineData.bottom .y ;
199
205
}
200
206
207
+ // Bottom Border
201
208
{
202
209
bool nextSectFloorHigher = nextSector.zFloor >= currentSector.zFloor ;
203
210
@@ -212,8 +219,8 @@ void RenderNextAreaBorders(RasterizeWorldContext& worldContext, RenderAreaYMinMa
212
219
213
220
if (!nextSectFloorHigher)
214
221
{
215
- bool bottomBorder = !nextSectFloorHigher;
216
- RenderCameraYLine (bottomBorderLineData, nextSector.bottomBorderColor , true , bottomBorder );
222
+ bool bottomEdge = !nextSectFloorHigher;
223
+ RenderCameraYLine (bottomBorderLineData, nextSector.bottomBorderColor , true , bottomEdge );
217
224
}
218
225
219
226
// Apply Y max
@@ -228,7 +235,7 @@ float ComputeVerticalOffset(const RaycastingCamera& cam, uint32_t RenderTargetHe
228
235
229
236
float ComputeElevationOffset (const RaycastingCamera& cam, const World& world, uint32_t RenderTargetHeight)
230
237
{
231
- // const float OneSectorHeight = RenderTargetHeight * cam.nearPlaneDistance;
238
+ // TODO : const float OneSectorHeight = RenderTargetHeight * cam.nearPlaneDistance;
232
239
233
240
const Sector& currentSector = world.Sectors .at (cam.currentSectorId );
234
241
return Lerp ((float )RenderTargetHeight, 0 .f , currentSector.zFloor );
@@ -270,7 +277,7 @@ CameraYLineData ComputeCameraYAxis(
270
277
};
271
278
}
272
279
273
- void RenderCameraYLine (CameraYLineData renderData, Color color, bool topBorder , bool bottomBorder )
280
+ void RenderCameraYLine (CameraYLineData renderData, Color color, bool topEdge , bool bottomEdge )
274
281
{
275
282
float darkness = Lerp (1 , 0 , renderData.normalizedDepth );
276
283
@@ -281,8 +288,8 @@ void RenderCameraYLine(CameraYLineData renderData, Color color, bool topBorder,
281
288
// color
282
289
);
283
290
284
- if (topBorder )
291
+ if (topEdge )
285
292
DrawRectangle (renderData.top .x - 1 , renderData.top .y - 1 , 3 , 3 , GRAY);
286
- if (bottomBorder )
293
+ if (bottomEdge )
287
294
DrawRectangle (renderData.bottom .x - 1 , renderData.bottom .y - 1 , 3 , 3 , GRAY);
288
295
}
0 commit comments