Start maybe working on a native app
This commit is contained in:
+3
-10
@@ -36,7 +36,6 @@ export abstract class Player extends Entity {
|
||||
// which way the body lies while swimming, radians up from flat: the way they're going, or looking when still
|
||||
swim_pitch = 0;
|
||||
prev_swim_pitch = 0;
|
||||
#skin_version = 0;
|
||||
|
||||
constructor(level: ClientLevel, id: string, name: string) {
|
||||
super(level, id, PLAYER_WIDTH, PLAYER_HEIGHT, PLAYER_EYE_HEIGHT);
|
||||
@@ -72,15 +71,9 @@ export abstract class Player extends Entity {
|
||||
};
|
||||
}
|
||||
|
||||
// a base64 png from the server, or undefined for the default. the old skin stays until the new one is decoded
|
||||
async set_skin(skin: string | undefined, slim = false) {
|
||||
const version = ++this.#skin_version;
|
||||
const texture = skin ? await decode_skin(skin) : undefined;
|
||||
if (version !== this.#skin_version) {
|
||||
// a newer skin came while this one was decoding
|
||||
texture?.tex.destroy();
|
||||
return;
|
||||
}
|
||||
// a base64 png from the server, or undefined for the default
|
||||
set_skin(skin: string | undefined, slim = false) {
|
||||
const texture = skin ? decode_skin(skin) : undefined;
|
||||
this.skin?.tex.destroy();
|
||||
this.skin = texture;
|
||||
this.slim = slim;
|
||||
|
||||
Reference in New Issue
Block a user