@@ -261,11 +261,15 @@ namespace
261
261
if (radius2 > 2.5 - NEAR_ZERO) {
262
262
auto radiusSquared1 = radius1 * radius1;
263
263
auto radiusSquared2 = radius2 * radius2;
264
+ auto middleRadiusSquared = (radiusSquared1 + radiusSquared2) / 2 ;
265
+
264
266
for (float x = -radius2; x <= radius2; x += 1 .0f ) {
265
267
for (float y = -radius2; y <= radius2; y += 1 .0f ) {
266
268
auto rSquared = x * x + y * y;
267
269
if (rSquared <= radiusSquared2 && rSquared >= radiusSquared1) {
268
- drawDot (imageData, imageSize, pos + float2 {x, y}, color);
270
+ auto weight = rSquared < middleRadiusSquared ? (rSquared - radiusSquared1) / (middleRadiusSquared - radiusSquared1)
271
+ : (radiusSquared2 - rSquared) / (radiusSquared2 - middleRadiusSquared);
272
+ drawDot (imageData, imageSize, pos + float2 {x, y}, color * weight * 0 .6f );
269
273
}
270
274
}
271
275
}
@@ -402,12 +406,14 @@ __global__ void cudaDrawCells(uint64_t timestep, int2 worldSize, float2 rectUppe
402
406
drawCircle (imageData, imageSize, cellImagePos, float3 {0 .3f , 0 .3f , 0 .3f }, radius, shadedCells);
403
407
}
404
408
405
- // draw attacks
406
- if (cell->cellFunction == CellFunction_Attacker && abs (cell->activity .channels [0 ]) > NEAR_ZERO) {
407
- drawDisc (imageData, imageSize, cellImagePos, {0 .0f , 1 .0f , 0 .0f }, radius * 1 .4f , radius * 2 .0f );
408
- }
409
- if (abs (cell->activity .channels [7 ] - AttackNotificationActivity) < NEAR_ZERO) {
410
- drawDisc (imageData, imageSize, cellImagePos, {1 .0f , 0 .0f , 0 .0f }, radius * 1 .4f , radius * 2 .0f );
409
+ // draw events
410
+ if (cell->eventCounter > 0 ) {
411
+ if (cell->event == CellEvent_Attacking) {
412
+ drawDisc (imageData, imageSize, cellImagePos, {0 .0f , 1 .0f , 0 .0f }, radius * 1 .4f , radius * 2 .0f );
413
+ }
414
+ if (cell->event == CellEvent_Hit) {
415
+ drawDisc (imageData, imageSize, cellImagePos, {1 .0f , 0 .0f , 0 .0f }, radius * 1 .4f , radius * 2 .0f );
416
+ }
411
417
}
412
418
413
419
// draw detonation
0 commit comments