Add support for drag & drop in Drive 1.
And add disk names in the setting window. Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
cbf9b078c6
commit
3d8ac1bee3
3 changed files with 51 additions and 0 deletions
|
@ -8,6 +8,8 @@
|
|||
#include "Core.h"
|
||||
#include "CPU.h"
|
||||
#include "CardManager.h"
|
||||
#include "Disk.h"
|
||||
#include "Harddisk.h"
|
||||
#include "Speaker.h"
|
||||
#include "Mockingboard.h"
|
||||
#include "Registry.h"
|
||||
|
@ -176,6 +178,7 @@ namespace sa2
|
|||
ImGui::Text("FPS: %d", int(io.Framerate));
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Hardware"))
|
||||
{
|
||||
if (ImGui::BeginTable("Cards", 2, ImGuiTableFlags_RowBg))
|
||||
|
@ -228,6 +231,32 @@ namespace sa2
|
|||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Disks"))
|
||||
{
|
||||
CardManager & cardManager = GetCardMgr();
|
||||
if (cardManager.QuerySlot(SLOT6) == CT_Disk2)
|
||||
{
|
||||
Disk2InterfaceCard * card2 = dynamic_cast<Disk2InterfaceCard*>(cardManager.GetObj(SLOT6));
|
||||
ImGui::Button("Drive 1");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(card2->GetFullDiskFilename(DRIVE_1).c_str());
|
||||
|
||||
ImGui::Button("Drive 2");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(card2->GetFullDiskFilename(DRIVE_2).c_str());
|
||||
}
|
||||
|
||||
ImGui::Button("Hard disk 1");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(HD_GetFullName(HARDDISK_1).c_str());
|
||||
|
||||
ImGui::Button("Hard disk 2");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(HD_GetFullName(HARDDISK_2).c_str());
|
||||
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Audio"))
|
||||
{
|
||||
const int volumeMax = GetPropertySheet().GetVolumeMax();
|
||||
|
|
|
@ -236,6 +236,27 @@ namespace sa2
|
|||
ProcessText(e.text);
|
||||
break;
|
||||
}
|
||||
case SDL_DROPFILE:
|
||||
{
|
||||
ProcessDropEvent(e.drop);
|
||||
SDL_free(e.drop.file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SDLFrame::ProcessDropEvent(const SDL_DropEvent & drop)
|
||||
{
|
||||
CardManager & cardManager = GetCardMgr();
|
||||
if (cardManager.QuerySlot(SLOT6) == CT_Disk2)
|
||||
{
|
||||
// for now we insert in DRIVE_1
|
||||
Disk2InterfaceCard * card2 = dynamic_cast<Disk2InterfaceCard*>(cardManager.GetObj(SLOT6));
|
||||
const ImageError_e error = card2->InsertDisk(DRIVE_1, drop.file, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
if (error != eIMAGE_ERROR_NONE)
|
||||
{
|
||||
card2->NotifyInvalidImage(DRIVE_1, drop.file, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace sa2
|
|||
void ProcessKeyDown(const SDL_KeyboardEvent & key);
|
||||
void ProcessKeyUp(const SDL_KeyboardEvent & key);
|
||||
void ProcessText(const SDL_TextInputEvent & text);
|
||||
void ProcessDropEvent(const SDL_DropEvent & drop);
|
||||
|
||||
std::shared_ptr<SDL_Window> myWindow;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue