mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-27 16:31:08 +00:00
1) Publish methods for clearing and blackening the bitmap
2) Always do the calculations for a possibly scaled view. Even if we prevent the user from changing the view size, the Monitors control panel in the emulator may still try to select a resolution which is too large for the screen, and thus the window will have to be reduced to fit, and thus the screen and bitmap co-ords may not match
This commit is contained in:
parent
18c58aa9d7
commit
1cbb3395d2
@ -396,13 +396,11 @@ static NSPoint mouse; // Previous/current mouse location
|
|||||||
|
|
||||||
mouse = location;
|
mouse = location;
|
||||||
|
|
||||||
#ifdef CAN_RESIZE_VIEW
|
|
||||||
int mouseY = y - y * mouse.y / [self height];
|
int mouseY = y - y * mouse.y / [self height];
|
||||||
int mouseX = x * mouse.x / [self width];
|
int mouseX = x * mouse.x / [self width];
|
||||||
#else
|
// If the view was not resizable, then this would be simpler:
|
||||||
int mouseY = y - (int) mouse.y;
|
// int mouseY = y - (int) mouse.y;
|
||||||
int mouseX = (int) mouse.x;
|
// int mouseX = (int) mouse.x;
|
||||||
#endif
|
|
||||||
|
|
||||||
ADBMouseMoved(mouseX, mouseY);
|
ADBMouseMoved(mouseX, mouseY);
|
||||||
return YES;
|
return YES;
|
||||||
@ -479,6 +477,28 @@ static NSPoint mouse; // Previous/current mouse location
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setTo: (int) val // Set all of bitmap to val
|
||||||
|
{
|
||||||
|
unsigned char *data
|
||||||
|
#ifdef NSBITMAP
|
||||||
|
= [bitmap bitmapData];
|
||||||
|
#else
|
||||||
|
= bitmap;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
memset(data, val, numBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) blacken // Set bitmap black
|
||||||
|
{
|
||||||
|
[self setTo: 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) clear // Set bitmap white
|
||||||
|
{
|
||||||
|
[self setTo: 0xFF];
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extra drawing stuff
|
// Extra drawing stuff
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user