More bad ""fixes"" to get it compiling

At least it now compiles...???

This definitely needs to be fixed up later.
This commit is contained in:
VoxelTek 2025-08-07 14:44:37 +10:00
parent eba3ff6613
commit f30144c239
7 changed files with 84 additions and 16 deletions

View File

@ -2,11 +2,19 @@ set(CMAKE_C_CLANG_TIDY)
if(DOWNLOAD_DEPENDENCIES)
include(FetchContent)
FetchContent_Declare(
miniaudio
URL https://github.com/mackron/miniaudio/archive/refs/tags/0.11.22.tar.gz
URL_MD5 4944268151ad037f148b089237566d05
)
if (NXDK)
FetchContent_Declare(
miniaudio
GIT_REPOSITORY "https://github.com/mackron/miniaudio.git"
GIT_TAG "dev"
)
else()
FetchContent_Declare(
miniaudio
URL https://github.com/mackron/miniaudio/archive/refs/tags/0.11.22.tar.gz
URL_MD5 4944268151ad037f148b089237566d05
)
endif()
FetchContent_MakeAvailable(miniaudio)
else()
add_library(miniaudio STATIC

View File

@ -12,13 +12,6 @@ if (WINDOWS_STORE)
add_compile_definitions(WINDOWS_STORE)
endif()
#[[
if (NXDK)
add_compile_definitions(MA_NO_WIN32_FILEIO)
add_definitions("-DMA_NO_WIN32_FILEIO -fms-compatibility-version=1000 -D_MSC_VER=1000")
endif()
]]#
if (EMSCRIPTEN)
add_compile_options(-pthread)
add_link_options(-sUSE_WEBGL2=1 -sMIN_WEBGL_VERSION=2 -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
@ -512,6 +505,12 @@ if (ISLE_EXTENSIONS)
)
endif()
if (NXDK)
target_sources(lego1 PRIVATE
ISLE/xbox/atof.c
)
endif()
if (ISLE_BUILD_APP)
add_executable(isle WIN32
ISLE/res/isle.rc
@ -592,6 +591,11 @@ if (ISLE_BUILD_APP)
ISLE/ios/config.cpp
)
endif()
if (NXDK)
target_sources(isle PRIVATE
ISLE/xbox/atof.c
)
endif()
if(Python3_FOUND)
if(NOT DEFINED PYTHON_PIL_AVAILABLE)
execute_process(

40
ISLE/xbox/atof.c Normal file
View File

@ -0,0 +1,40 @@
// atof.c
#include <ctype.h>
// A lightweight atof alternative
double atof(const char *s) {
double result = 0.0;
int sign = 1;
double fraction = 0.0;
int divisor = 1;
// Skip whitespace
while (*s == ' ' || *s == '\t') s++;
// Handle sign
if (*s == '-') {
sign = -1;
s++;
} else if (*s == '+') {
s++;
}
// Integer part
while (*s >= '0' && *s <= '9') {
result = result * 10.0 + (*s - '0');
s++;
}
// Fractional part
if (*s == '.') {
s++;
while (*s >= '0' && *s <= '9') {
fraction = fraction * 10.0 + (*s - '0');
divisor *= 10;
s++;
}
result += fraction / divisor;
}
return sign * result;
}

12
ISLE/xbox/atof.h Normal file
View File

@ -0,0 +1,12 @@
// atof.h
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
double atof(const char *s);
#ifdef __cplusplus
}
#endif

View File

@ -79,7 +79,8 @@ void MxControlPresenter::EndAction()
MxBool MxControlPresenter::CheckButtonDown(MxS32 p_x, MxS32 p_y, MxPresenter* p_presenter)
{
assert(p_presenter);
MxVideoPresenter* presenter = dynamic_cast<MxVideoPresenter*>(p_presenter);
//MxVideoPresenter* presenter = dynamic_cast<MxVideoPresenter*>(p_presenter);
MxVideoPresenter* presenter = (MxVideoPresenter*)(p_presenter);
assert(presenter);
if (m_style == e_map) {

View File

@ -119,7 +119,8 @@ void LegoEntity::SetWorld()
{
LegoWorld* world = CurrentWorld();
LegoWorld* maybeWorld = dynamic_cast<LegoWorld*>(this);
//LegoWorld* maybeWorld = dynamic_cast<LegoWorld*>(this);
LegoWorld* maybeWorld = (LegoWorld*)(this);
if (world != NULL && world != maybeWorld) {
world->Add(this);
}

View File

@ -30,7 +30,8 @@ HRESULT FrameBufferImpl::QueryInterface(const GUID& riid, void** ppvObject)
// IDirectDrawSurface interface
HRESULT FrameBufferImpl::AddAttachedSurface(LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
{
if (dynamic_cast<DummySurfaceImpl*>(lpDDSAttachedSurface)) {
//if (dynamic_cast<DummySurfaceImpl*>(lpDDSAttachedSurface)) {
if ((DummySurfaceImpl*)(lpDDSAttachedSurface)) {
return DD_OK;
}
MINIWIN_NOT_IMPLEMENTED();
@ -49,7 +50,8 @@ HRESULT FrameBufferImpl::Blt(
return DDERR_GENERIC;
}
if (dynamic_cast<FrameBufferImpl*>(lpDDSrcSurface) == this) {
//if (dynamic_cast<FrameBufferImpl*>(lpDDSrcSurface) == this) {
if ((FrameBufferImpl*)(lpDDSrcSurface) == this) {
return Flip(nullptr, DDFLIP_WAIT);
}