Skip to content

Commit

Permalink
Well, it links.
Browse files Browse the repository at this point in the history
Probably won't even work.
  • Loading branch information
MaddTheSane committed Oct 15, 2023
1 parent 9b85e27 commit 25099b0
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 6 deletions.
102 changes: 100 additions & 2 deletions Boxer/BXCoalface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,19 @@ void boxer_setShader(const ShaderInfo& shader_info, const std::string& shader_so
//TODO: implement!
}

Bitu boxer_prepareForFrameSize(Bitu width, Bitu height, Bitu gfx_flags, double scalex, double scaley, GFX_CallBack_t callback, double pixel_aspect)
Bitu boxer_prepareForFrameSize(const int width, const int height,
const Fraction& render_pixel_aspect_ratio, const uint8_t flags,
const VideoMode& video_mode, GFX_CallBack_t callback)
{
BXEmulator *emulator = [BXEmulator currentEmulator];

const bool double_width = flags & GFX_DBL_W;
const bool double_height = flags & GFX_DBL_H;

NSSize outputSize = NSMakeSize((CGFloat)width, (CGFloat)height);
NSSize scale = NSMakeSize((CGFloat)scalex, (CGFloat)scaley);
NSSize scale = NSMakeSize(double_width ? 2 : 1, double_height ? 2 : 1);
[[emulator videoHandler] prepareForOutputSize: outputSize atScale: scale withCallback: callback];
//TODO: store callback!

return GFX_CAN_32;
}
Expand Down Expand Up @@ -631,6 +637,97 @@ void restart_program(std::vector<std::string> & parameters) {
return "Boxer-build";
}

#pragma mark - to work on

void GFX_CenterMouse()
{
// assert(sdl.window);
//
// int width = 0;
// int height = 0;
//
//#if defined(WIN32) && !SDL_VERSION_ATLEAST(2, 28, 1)
// const auto window_canvas_size = get_canvas_size(sdl.rendering_backend);
//
// width = window_canvas_size.w;
// height = window_canvas_size.h;
//#else
// SDL_GetWindowSize(sdl.window, &width, &height);
//#endif
//
// SDL_WarpMouseInWindow(sdl.window, width / 2, height / 2);
}

SDL_Rect GFX_CalcViewport(const int canvas_width, const int canvas_height,
const int draw_width, const int draw_height,
const Fraction& render_pixel_aspect_ratio)
{
return SDL_Rect();
}

void GFX_RefreshTitle()
{
// constexpr int8_t refresh_cycle_count = -1;
// GFX_SetTitle(refresh_cycle_count);
}

SDL_Rect GFX_GetCanvasSize()
{
// return get_canvas_size(sdl.rendering_backend);
return SDL_Rect();
}


void GFX_SetMouseHint(const MouseHint hint_id)
{

}

void GFX_SetMouseCapture(const bool requested_capture)
{

}

void GFX_SetMouseRawInput(const bool requested_raw_input)
{

}

void GFX_SetMouseVisibility(const bool requested_visible)
{

}

RenderingBackend GFX_GetRenderingBackend()
{
return RenderingBackend::Texture;
}

InterpolationMode GFX_GetInterpolationMode()
{
return InterpolationMode::NearestNeighbour;
}

IntegerScalingMode GFX_GetIntegerScalingMode()
{
return IntegerScalingMode::Auto;
}

void GFX_SetIntegerScalingMode(const IntegerScalingMode mode)
{

}

bool GFX_HaveDesktopEnvironment()
{
return true;
}

void GFX_SetTitle(const int32_t new_num_cycles, const bool is_paused = false)
{

}

#pragma mark - No-ops

//These used to be defined in sdl_mapper.cpp, which we no longer include in Boxer.
Expand All @@ -639,6 +736,7 @@ void MAPPER_AddHandler(MAPPER_Handler *handler, SDL_Scancode key, uint32_t mods,
void MAPPER_Init(void) {}
void MAPPER_StartUp(Section * sec) {}
void MAPPER_Run(bool pressed) {}
void MAPPER_AutoTypeStopImmediately() {}
void MAPPER_RunInternal() {}
void MAPPER_LosingFocus(void) {}
void MAPPER_AutoType(std::vector<std::string> &sequence,
Expand Down
7 changes: 4 additions & 3 deletions Boxer/BXVideoHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,11 @@ - (void) applyRenderingStrategy


//Finally, apply the values to DOSBox
render.aspect = NO; //We apply our own aspect correction separately
render.scale.forced = YES;
//TODO: fix/update this!
// render.aspect = NO; //We apply our own aspect correction separately
// render.scale.forced = YES;
render.scale.size = (Bitu)filterScale;
render.scale.op = (scalerOperation_t)activeType;
// render.scale.op = (scalerOperation_t)activeType;


//While we're here, sync up the CGA and hercules color modes if appropriate
Expand Down
2 changes: 1 addition & 1 deletion DOSBox-Staging

0 comments on commit 25099b0

Please sign in to comment.