Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected clipping issue with battlezone, major havoc #53

Merged
merged 3 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion advance/osd/dvg.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ static uint32_t s_in_vec_last_y;
static vector_t *s_out_vec_list;
static uint32_t s_out_vec_cnt;

static void transform_final(int *px, int *py);

//
// Function to compute region code for a point(x, y)
//
Expand Down Expand Up @@ -465,6 +467,7 @@ static void cmd_add_point(int x, int y, int r, int g, int b)
}
}
}
transform_final(&x, &y);
cmd = (FLAG_XY << 29) | ((blank & 0x1) << 28) | ((x & 0x3fff) << 14) | (y & 0x3fff);
if (s_cmd_offs <= (CMD_BUF_SIZE - 8)) {
s_cmd_buf[s_cmd_offs++] = cmd >> 24;
Expand Down Expand Up @@ -723,6 +726,18 @@ static void transform_final(int *px, int *py)
if (s_flip_y) {
y = DVG_RES_MAX - y;
}
if (x < 0) {
x = 0;
}
else if (x > DVG_RES_MAX) {
x = DVG_RES_MAX;
}
if (y < 0) {
y = 0;
}
else if (y > DVG_RES_MAX) {
y = DVG_RES_MAX;
}
*px = x;
*py = y;
}
Expand Down Expand Up @@ -769,6 +784,19 @@ int dvg_update(point *p, int num_points)
y1 = p->arg2;
transform_coords(&x0, &y0);
transform_coords(&x1, &y1);
// Make sure the clip coordinates fall within the display coordinates.
if (x0 > DVG_RES_MAX) {
x0 = DVG_RES_MAX;
}
if (y0 > DVG_RES_MAX) {
y0 = DVG_RES_MAX;
}
if (x1 > DVG_RES_MAX) {
x1 = DVG_RES_MAX;
}
if (y1 > DVG_RES_MAX) {
y1 = DVG_RES_MAX;
}
s_clipx_min = x0;
s_clipy_min = y0;
s_clipx_max = x1;
Expand All @@ -790,7 +818,6 @@ int dvg_update(point *p, int num_points)
b = RGB_BLUE(col);
}
transform_coords(&x, &y);
transform_final(&x, &y);
cmd_add_vec(x, y, r, g, b);
}
p++;
Expand Down
8 changes: 7 additions & 1 deletion advance/osd/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ static struct glue_keyboard_name GLUE_KEYBOARD_STD[] = {
KR2("period", "period", ".")
KR2("slash", "slash", "/")
KR2("colon", "colon", ":")
KR2("pound", "pound", "")
KR2("pound", "pound", "£")
KR2("doublequote", "doublequote", "\"")
KR2("diesis", "diessi", "#")

Expand Down Expand Up @@ -2595,6 +2595,12 @@ static int on_exit_menu(int selected)
int sel;
int total;

/* Quiet option - no dialog */
if (options.skip_warnings) {
/* Return exit */
return -5;
}

sel = selected;

total = 0;
Expand Down