default sprite origin in is now 0,0
parent
0a6242ef3c
commit
d067ea6df8
|
@ -443,7 +443,7 @@ sprite_t make_sprite(const char* file, float x, float y) {
|
||||||
sprite_t sprite=(sprite_t){
|
sprite_t sprite=(sprite_t){
|
||||||
.texture=get_texture(file),
|
.texture=get_texture(file),
|
||||||
.x=x,.y=y,
|
.x=x,.y=y,
|
||||||
.origin=(SDL_FPoint){.x=0,.y=0},
|
.origin=(SDL_FPoint){.x=0.0,.y=0.0},
|
||||||
.sx=1.0,.sy=1.0,
|
.sx=1.0,.sy=1.0,
|
||||||
.rot=0,
|
.rot=0,
|
||||||
.depth=RLAYER_SPRITES,
|
.depth=RLAYER_SPRITES,
|
||||||
|
@ -451,7 +451,6 @@ sprite_t make_sprite(const char* file, float x, float y) {
|
||||||
.flip=SDL_FLIP_NONE,
|
.flip=SDL_FLIP_NONE,
|
||||||
};
|
};
|
||||||
SDL_QueryTexture(sprite.texture, NULL, NULL, &sprite.uv.w, &sprite.uv.h);
|
SDL_QueryTexture(sprite.texture, NULL, NULL, &sprite.uv.w, &sprite.uv.h);
|
||||||
sprite.origin.x = -(float)sprite.uv.h/2.f; sprite.origin.y = -(float)sprite.uv.h/2.f;
|
|
||||||
return sprite;
|
return sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue