Skip to content

Commit

Permalink
rotのラジアン計算も事前にしておく
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Ojii committed Mar 7, 2024
1 parent fcfa5ac commit cf1271e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dll_src/Bevel_And_Emboss_M.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ int bevel_and_emboss(lua_State *L) {

// 事前計算できるものは計算しておく
high = std::cos(rad(high));
rot = rad(rot);
uint8_t bgcol_r = (bgcol >> 16) & 0xff;
uint8_t bgcol_g = (bgcol >> 8) & 0xff;
uint8_t bgcol_b = (bgcol) & 0xff;
Expand Down Expand Up @@ -400,7 +401,7 @@ int bevel_and_emboss(lua_State *L) {
info->dis = std::sqrt(info->dis);
info->x = (info->x - (i - 0.5)) / info->dis;
info->y = (info->y - (j - 0.5)) / info->dis;
info->gray = std::cos(std::atan2(info->y, info->x) + rad(rot)) * high * (info->line < 0 ? -1 : 1);
info->gray = std::cos(std::atan2(info->y, info->x) + rot) * high * (info->line < 0 ? -1 : 1);
}
}

Expand Down

0 comments on commit cf1271e

Please sign in to comment.