mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Huge rendering performance improvements and minor other changes, lots of refactorings
This commit is contained in:
@@ -374,7 +374,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
// HACK to draw the entity sprite
|
||||
const previewSprite = metaBuilding.getBlueprintSprite(rotationVariant, this.currentVariant.get());
|
||||
staticComp.origin = worldPos.divideScalar(globalConfig.tileSize).subScalars(0.5, 0.5);
|
||||
staticComp.drawSpriteOnFullEntityBounds(parameters, previewSprite);
|
||||
staticComp.drawSpriteOnBoundsClipped(parameters, previewSprite);
|
||||
staticComp.origin = mouseTile;
|
||||
|
||||
// Draw ejectors
|
||||
|
||||
@@ -64,11 +64,16 @@ export class HUDWireInfo extends BaseHUDPart {
|
||||
const network = networks[0];
|
||||
|
||||
if (network.valueConflict) {
|
||||
this.spriteConflict.draw(parameters.context, mousePos.x + 10, mousePos.y - 10, 40, 40);
|
||||
this.spriteConflict.draw(parameters.context, mousePos.x + 15, mousePos.y - 10, 60, 60);
|
||||
} else if (!network.currentValue) {
|
||||
this.spriteEmpty.draw(parameters.context, mousePos.x + 10, mousePos.y - 10, 40, 40);
|
||||
this.spriteEmpty.draw(parameters.context, mousePos.x + 15, mousePos.y - 10, 60, 60);
|
||||
} else {
|
||||
network.currentValue.drawCentered(mousePos.x + 20, mousePos.y, parameters, 40);
|
||||
network.currentValue.drawItemCenteredClipped(
|
||||
mousePos.x + 40,
|
||||
mousePos.y + 10,
|
||||
parameters,
|
||||
60
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user