return _emul_info.lcd_size_h;
}
+/* sdl bits per pixel */
+void set_emul_sdl_bpp(int bpp)
+{
+ _emul_info.sdl_bpp = bpp;
+
+ if (_emul_info.sdl_bpp != 32) {
+ INFO("?? sdl bpp = %d\n", _emul_info.sdl_bpp);
+ }
+}
+
+int get_emul_sdl_bpp(void)
+{
+ return _emul_info.sdl_bpp;
+}
+
/* emulator window scale */
void set_emul_win_scale(double scale_factor)
{
char emulator_name[256]; //TODO:
int lcd_size_w;
int lcd_size_h;
- int dpi; //not used yet
+ int guest_dpi; //not used yet
+ int sdl_bpp;
//TODO:
} EmulatorConfigInfo;
void set_emul_lcd_size(int width, int height);
void set_emul_win_scale(double scale);
void set_emul_rotation(short rotation_type);
+void set_emul_sdl_bpp(int bpp);
/* getter */
int get_emulator_condition(void);
int get_emul_lcd_height(void);
double get_emul_win_scale(void);
short get_emul_rotation(void);
+int get_emul_sdl_bpp(void);
MultiTouchState *get_emul_multi_touch_state(void);
#endif
SDL_Surface *point = SDL_CreateRGBSurface(SDL_SRCALPHA | SDL_HWSURFACE,
- mts->finger_point_size + 2, mts->finger_point_size + 2, 32, rmask, gmask, bmask, amask);
+ mts->finger_point_size + 2, mts->finger_point_size + 2, get_emul_sdl_bpp(), rmask, gmask, bmask, amask);
sdl_fill_circle(point, finger_point_size_half, finger_point_size_half,
finger_point_size_half, mts->finger_point_color); //finger point circle
int i;
SDL_Surface *processing_screen = NULL;
- if (scale_factor != 1.0 || screen_degree != 0.0) {
+ if (surface_qemu != NULL) {
+ if (scale_factor != 1.0 || screen_degree != 0.0) {
- // workaround
- if ( surface_qemu ) {
+ // workaround
// set color key 'magenta'
surface_qemu->format->colorkey = 0xFF00FF;
- }
- //image processing
- processing_screen = rotozoomSurface(surface_qemu, screen_degree, scale_factor, 1);
- SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
- } else {
- SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
+ //image processing
+ processing_screen = rotozoomSurface(surface_qemu, screen_degree, scale_factor, 1);
+ SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+ } else {
+ SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
+ }
}
/* draw multi-touch finger points */
w = lcd_size_width * scale_factor;
h = lcd_size_height * scale_factor;
+ set_emul_sdl_bpp(SDL_BPP);
+
INFO( "maru sdl initialization\n");
- surface_screen = SDL_SetVideoMode(w, h, SDL_BPP, SDL_FLAGS);
+ surface_screen = SDL_SetVideoMode(w, h, get_emul_sdl_bpp(), SDL_FLAGS);
if (surface_screen == NULL) {
- ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, SDL_BPP, SDL_GetError());
+ ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, get_emul_sdl_bpp(), SDL_GetError());
}
#ifndef _WIN32