Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
more accurate hair rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon32767 committed Jun 1, 2020
1 parent 16bfa5e commit 3ffcdee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions celeste.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ static void set_hair_color(int djump) {
}

static void draw_hair(OBJ* obj, int facing) {
int last_x=obj->x+4-facing*2;
int last_y=obj->y+(P8btn(k_down) ? 4 : 3);
float last_x=obj->x+4-facing*2;
float last_y=obj->y+(P8btn(k_down) ? 4 : 3);
HAIR* h;
int i = 0;
while (!(h = &obj->hair[i++])->isLast) {
Expand Down
6 changes: 4 additions & 2 deletions sdl12main.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,13 @@ Celeste_P8_val pico8emu(CELESTE_P8_CALLBACK_TYPE call, ...) {
ResetPalette();
)
CASE(CELESTE_P8_CIRCFILL, //circfill(x,y,r,col)
float cx = FLOAT_ARG() - camera_x;
float cy = FLOAT_ARG() - camera_y;
float cx_ = FLOAT_ARG() - camera_x;
float cy_ = FLOAT_ARG() - camera_y;
float r = FLOAT_ARG();
int col = INT_ARG();

int cx = floorf(cx_), cy = floorf(cy_);

int realcolor = getcolor(col);

if (r <= 1) {
Expand Down

0 comments on commit 3ffcdee

Please sign in to comment.