if(flag) {
emit sig_draw_timing(true);
draw_frames = p_emu->draw_screen();
- //p = p_emu->getPseudoVramClass();
- //emit sig_update_screen(p);
} else {
draw_frames = 1;
}
bStartRecordSoundReq = false;
bStopRecordSoundReq = false;
- next_time = SDL_GetTicks();
+ next_time = 0;
mouse_flag = false;
p_emu->SetHostCpus(this->idealThreadCount());
sleep_period = 0;
if(p_emu) {
// drive machine
-#ifdef USE_DIG_RESOLUTION
- //p_emu->get_screen_resolution(&width, &height);
- //emit sig_set_grid_vertical(width, false);
- //emit sig_set_grid_horizonal(height, false);
-#endif
#ifdef USE_STATE
if(bLoadStateReq != false) {
p_emu->load_state();
interval += get_interval();
now_skip = p_emu->now_skip() && !p_emu->now_rec_video();
- //p_emu->UnlockVM();
if((prev_skip && !now_skip) || next_time == 0) {
next_time = SDL_GetTicks();
if(bRunThread == false){
goto _exit;
}
- if(sleep_period <= 0) sleep_period = 1;
+ if(sleep_period <= 0) sleep_period = 1;
msleep(sleep_period);
} while(1);
_exit:
}
if(vertex_bitmap->isCreated()) {
main_shader->setUniformValue("texture", 0);
- //main_shader->setUniformValue("v_texcoord", *texture_texcoord);
extfunc->glClear(GL_COLOR_BUFFER_BIT);
vertex_bitmap->bind();
extfunc->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
extfunc->glViewport(0, 0, width, height);
crt_flag = true;
- req_draw_grids_horiz = true;
- req_draw_grids_vert = true;
-
- if(draw_width < ((horiz_pixels * 4) / 2)) req_draw_grids_horiz = false;
- if(draw_height < ((vert_lines * 2) / 2)) req_draw_grids_vert = false;
doSetGridsHorizonal(vert_lines, true);
#if defined(USE_VERTICAL_PIXEL_LINES)
doSetGridsVertical(horiz_pixels, true);
setNormalVAO(main_shader, vertex_screen,
buffer_screen_vertex,
vertexFormat, 4);
- this->doSetGridsHorizonal(screen_height, false);
- this->doSetGridsVertical(screen_width, false);
}
#endif
#if defined(MAX_BUTTONS)
updateButtonTexture();
- for(int i = 0; i < MAX_BUTTONS; i++) {
-#if 0
- fButtonX[i] = -1.0 + (float)(buttons[i].x * 2) / (float)SCREEN_WIDTH;
- fButtonY[i] = 1.0 - (float)(buttons[i].y * 2) / (float)SCREEN_HEIGHT;
- fButtonWidth[i] = (float)(buttons[i].width * 2) / (float)SCREEN_WIDTH;
- fButtonHeight[i] = (float)(buttons[i].height * 2) / (float)SCREEN_HEIGHT;
- VertexTexCoord_t vt[4];
-
- vt[0] = vertexButtons->value(i * 4);
- vt[1] = vertexButtons->value(i * 4 + 1);
- vt[2] = vertexButtons->value(i * 4 + 2);
- vt[3] = vertexButtons->value(i * 4 + 3);
-
- vt[0].x = fButtonX[i];
- vt[0].y = fButtonY[i];
-
- vt[1].x = fButtonX[i] + fButtonWidth[i];
- vt[1].y = fButtonY[i];
-
- vt[2].x = fButtonX[i] + fButtonWidth[i];
- vt[2].y = fButtonY[i] - fButtonHeight[i];
-
- vt[3].x = fButtonX[i];
- vt[3].y = fButtonY[i] - fButtonHeight[i];
-
- vertexButtons->replace(i * 4, vt[0]);
- vertexButtons->replace(i * 4 + 1, vt[1]);
- vertexButtons->replace(i * 4 + 2, vt[2]);
- vertexButtons->replace(i * 4 + 3, vt[3]);
- setNormalVAO(button_shader[i], vertex_button[i],
- buffer_button_vertex[i],
- vt, 4);
-#endif
}
#endif
redraw_required = true;
#endif
if(!redraw_required) return;
if(p_emu != NULL) {
- //if(imgptr == NULL) return;
- //drawUpdateTexture(imgptr);
crt_flag = false;
}
if(redraw_required) {
button_updated = false;
button_drawn = false;
#endif
- req_draw_grids_horiz = false;
- req_draw_grids_vert = false;
fBrightR = 1.0; // 輝度の初期化
fBrightG = 1.0;
fBrightB = 1.0;
GLfloat *glVertGrids;
GLfloat *glHorizGrids;
- bool req_draw_grids_horiz;
- bool req_draw_grids_vert;
-
int screen_texture_width;
int screen_texture_width_old;
int screen_texture_height;
int drvs;
hRunEmu = new EmuThreadClass(rMainWindow, emu, this);
- emu->set_parent_handler(hRunEmu);
connect(hRunEmu, SIGNAL(message_changed(QString)), this, SLOT(message_status_bar(QString)));
//connect(hRunEmu, SIGNAL(sig_finished()), this, SLOT(delete_emu_thread()));
#ifdef USE_TAPE_BUTTON
hRunEmu->set_tape_play(false);
#endif
-#ifdef USE_DIG_RESOLUTION
- connect(hRunEmu, SIGNAL(sig_set_grid_vertical(int, bool)), graphicsView, SLOT(doSetGridsVertical(int, bool)));
- connect(hRunEmu, SIGNAL(sig_set_grid_horizonal(int, bool)), graphicsView, SLOT(doSetGridsHorizonal(int, bool)));
-#endif
#ifdef SUPPORT_DUMMY_DEVICE_LED
connect(hRunEmu, SIGNAL(sig_send_data_led(quint32)), this, SLOT(do_recv_data_led(quint32)));
#endif
hRunEmu->setObjectName(objNameStr);
hDrawEmu = new DrawThreadClass(emu, this);
+ emu->set_parent_handler(hRunEmu);
#ifdef ONE_BOARD_MICRO_COMPUTER
QImageReader *reader = new QImageReader(":/background.png");
QImage *result = new QImage(reader->read()); // this acts as a default if the size is not matched
glv->updateBitmap(result);
delete result;
delete reader;
-#endif
-
+#endif
AGAR_DebugLog(AGAR_LOG_DEBUG, "DrawThread : Start.");
connect(hDrawEmu, SIGNAL(sig_draw_frames(int)), hRunEmu, SLOT(print_framerate(int)));
connect(hDrawEmu, SIGNAL(message_changed(QString)), this, SLOT(message_status_bar(QString)));
- connect(hDrawEmu, SIGNAL(sig_update_screen(screen_buffer_t *)), glv, SLOT(update_screen(screen_buffer_t *)), Qt::QueuedConnection);
connect(actionCapture_Screen, SIGNAL(triggered()), glv, SLOT(do_save_frame_screen()));
connect(hRunEmu, SIGNAL(sig_draw_thread(bool)), hDrawEmu, SLOT(doDraw(bool)));
class GLDrawClass;
class EmuThreadClass;
+class DrawThreadClass;
class Ui_MainWindow;
class EMU;
class VM;