Changeset 1250 for trunk/core/gui_draw.c
- Timestamp:
- 07/28/11 11:42:13 (22 months ago)
- File:
-
- 1 edited
-
trunk/core/gui_draw.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/gui_draw.c
r1234 r1250 60 60 draw_set_aspect_xcorrection_proc(xcorrection_proc); 61 61 draw_set_aspect_ycorrection_proc(ycorrection_proc); 62 } 63 64 #endif 65 66 //------------------------------------------------------------------- 67 #ifdef CAM_DETECT_SCREEN_ERASE 68 69 #define GUARD_VAL SCREEN_COLOR 70 71 void draw_set_guard() 72 { 73 *((unsigned char*)(frame_buffer[0])) = GUARD_VAL; 74 *((unsigned char*)(frame_buffer[1])) = GUARD_VAL; 75 } 76 77 int draw_test_guard() 78 { 79 if (*((unsigned char*)(frame_buffer[0])) != GUARD_VAL) return 0; 80 if (*((unsigned char*)(frame_buffer[1])) != GUARD_VAL) return 0; 81 return 1; 82 } 83 84 // Test a pixel value in both frame buffers, returns 0 if either doesn't match or co-ords out of range 85 int draw_test_pixel(coord x, coord y, color c) 86 { 87 if (x >= screen_width || y >= screen_height) return 0; 88 #if CAM_USES_ASPECT_CORRECTION 89 return (frame_buffer[0][y * screen_buffer_width + aspect_xcorrection_proc(x)] == c) && 90 (frame_buffer[1][y * screen_buffer_width + aspect_xcorrection_proc(x)] == c); 91 #else 92 return (frame_buffer[0][y * screen_buffer_width + x] == c) && 93 (frame_buffer[1][y * screen_buffer_width + x] == c); 94 #endif 62 95 } 63 96 … … 81 114 draw_set_aspect_ycorrection_proc(NULL); 82 115 #endif 116 117 #ifdef CAM_DETECT_SCREEN_ERASE 118 draw_set_guard(); 119 #endif 83 120 } 84 121 … … 377 414 void draw_restore() { 378 415 vid_bitmap_refresh(); 416 417 #ifdef CAM_DETECT_SCREEN_ERASE 418 draw_set_guard(); 419 #endif 379 420 } 380 421
Note: See TracChangeset
for help on using the changeset viewer.