Commit Graph

100 Commits

Author SHA1 Message Date
Helloyunho
0191be7461
Make draw cursor feature work for modern platforms (#480) 2025-07-03 18:05:46 +02:00
Christian Semmler
10b6d28cf8
Revert "Add resizable property to window creation (#477)"
This reverts commit 0e70735549.
2025-07-02 08:06:09 -07:00
VoxelTek
0e70735549
Add resizable property to window creation (#477)
Add resizable property to window creation. Allows Close button to be present in some cases where it did not appear.
2025-07-02 15:16:54 +02:00
Joshua Peisach
1ff768935e
3DS Port (#450)
* [WIP] 3ds port

Recommit of everything after the 2d renderer merge

* VERY AWESOME FEATURE FRFR

* Stopped CPU suicide and app crashing for now

* put in Texture3DS function thing

* Fix clear color

* Implement 2D rendering via Citro3D

* Set 3dsx smdh metadata

* Render world content, sort of

* Push mesh dynamically

* Remove Citro3D init hacks

* Clean up Citro3D implementation

* Try to upload meshes and convert matricies

* Fix 3D rendering

* Apply optimizations

* Implement lighting

* Set 3dsx smdh metadata

* Revert "Apply optimizations"

This reverts commit 6660082fef.

* Apply optimizations

* Added a cleaner icon (#4)

* Fix pure buffer clear frames (#9)

* Disable OpenGL on 3DS (#10)

* Fix tiled textures and improve UI image quality (#11)

* Create 3DS default config overrides

* 3ds: implement apt hooks

* remove unused import

* Apply suggestions from code review

Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Update miniwin/src/d3drm/backends/citro3d/renderer.cpp

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Separate 3DS apt hook code + move cmake 3ds into ISLE_BUILD_APP

* miniwin: use citro3dd if debugging

* Optimize texture encoding (#12)

* Cleanup

* Set correct mipmap level for UI textures (#13)

* cpack: include the .3dsx

* Add 3DS CI

* Fix CI

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* syntax

* Refactor c3d renderer (#14)

* Refactor c3d renderer

* format

* Apply suggestions from code review

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

---------

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

* n3ds: just distribute the .3dsx

* upload 3dsx

* Skip uploading 3DS artifacts

* Update ci.yml

* Update ci.yml

* Remove extraneous ifdef

---------

Co-authored-by: MaxBrick <maximusbrick@gmail.com>
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Co-authored-by: Steven <139715581+StevenSYS@users.noreply.github.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-07-01 02:43:10 +00:00
David Gow
e87184b502
Fix the OpenGL backends on non-glx Linux platforms (and remove GLEW dependency) (#446)
* Work around issues with depth-buffer size on EGL-based platforms

The OpenGL 1.1 and OpenGL ES 2.0 backends can break on EGL-based platforms,
such as Wayland, or X11 with SDL_VIDEO_FORCE_EGL=1. One of the reasons for
this (the other being glew on the GL1.1 backend) is that SDL/egl get very
confused by the way we set OpenGL attributes, particularly SDL_GL_DEPTH_SIZE,
resulting in SDL_GL_CreateContext() failing with EGL_BAD_MATCH.

The exact cause of this is unknown, but it seems to be a combination of:
- SDL_GL_SetAttribute() is supposed to be called _before_ the window is
  created, and we're calling it afterward.
- Creating several test windows during the enumeration process, mixing
  and matching between OpenGL and OpenGL ES profiles.

The "most correct" solution is probably to delay creating the game window
until the backend creation process, rather than before the enumeration
occurs. But that's a real refactor, which could cause other issues.

Instead, set the 24-bit bit depth (which we've hardcoded anyway) before
creating the window, and use SDL_GL_ResetAttributes() when creating backends.

This seems to work here in all of the cases I was able to try (modulo the GLEW
dependency, which is removed in the next patch).

* miniwin: Remove GLEW dependency for OpenGL 1.1

GLEW normally backs directly onto glXGetProcAddress on Linux, which is broken
on non-GLX setups, such as Wayland (but also X11 with EGL, and presumably KMSDRM).

Replace it with manual calls to SDL_GL_GetProcAddress() for the VBO path.

Note, however, that SDL_opengl.h includes "windows.h", so conflicts with the
miniwin implementation, which breaks builds on windows.

In order to work around this, we do what the Direct3D9 implementation does and
push all of the OpenGL calls to a separate file, actual.cpp.

Going forward, it may make sense to load _all_ OpenGL entry points via SDL,
which would allow us to avoid linking directly with libGL/libOpenGL, and
therefore eliminate the separate build dependency altogether, as well as
allowing more runtime configurability as to the OpenGL library to load.

(But that's definitely a bit uglier, and also useful very rarely.)
2025-06-29 17:47:09 +02:00
Christian Semmler
020969c483
Add transition type to ini (#441) 2025-06-29 02:49:46 +02:00
Christian Semmler
a987595e1e
1.0 compatibility (#434)
* Make Infocenter compatible with 1.0 versions

* Fix

* Emscripten patch

* Fix

* Fix Emscripten patch

* Window title

* Naming

* Don't exit car build automatically in 1.0

* Disable character selection by clicking icon in 1.0

* Remove obsolete includes
2025-06-27 02:30:24 +02:00
Carson
7797729a3f
Add option to remove startup delay (#395)
* Add startup delay option

* Remove build option

* Add comment back
2025-06-25 20:27:53 -07:00
Anders Jenbo
b65284a7a0
Move 2D drawing and upscaling to the renderer (#348) 2025-06-25 19:45:26 +02:00
Christian Semmler
5a756f033b
Set UseJoystick to true by default (#397) 2025-06-22 18:49:06 +02:00
Christian Semmler
92e0cb0845
Fix JoystickIndex ini default (#400) 2025-06-22 18:34:05 +02:00
Christian Semmler
c2b8abea36
Fix Windows file finding (#369) 2025-06-21 18:06:08 +02:00
Steven
ed71ac8ec2
Added in game fullscreen toggling (#358) 2025-06-21 07:09:33 -07:00
Anders Jenbo
922794e7ea
Fix loading files from CD or HD (#357) 2025-06-21 15:19:25 +02:00
Christian Semmler
48fd42ea36
Check for files (#352)
* Check for files

* Fix
2025-06-21 00:45:21 +02:00
Anders Jenbo
eab95514d6
Add an OpenGL ES 2.0 renderer (#287) 2025-06-17 03:47:23 +02:00
Christian Semmler
2733ffcf69
Fix presenter progress event (#300) 2025-06-13 16:32:25 +00:00
Christian Semmler
5080e372f9
Emscripten port (#229)
* Emscripten port

* Fix NCC

* Update CMakeLists.txt

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Update CMakeLists.txt

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Update CMakeLists.txt

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Update CMakeLists.txt

* cmake: set iniparser cmake options in local scope

* ci: try adding emscripten to test matrix

* cmake: try to make CMake install package more usable

* cmake: fix typo

* Update CMakeLists.txt

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Add support for .ini loading

* Different default full screen behavior for Emscripten

* Add comments

* Add web platform

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2025-06-13 00:26:43 +02:00
Anders Jenbo
bbb0de6e9a
Implement full screen (#290) 2025-06-12 22:51:52 +02:00
Christian Semmler
9ebeda5c0e
Add Max LOD and Max Allowed Extras configs (#273)
* Add new config options

* Fix defaults

* Use global for `m_maxAllowedExtras`

* Revert
2025-06-10 01:08:13 +00:00
Anonymous Maarten
7e9acc8d04
Add IDirect3DRMMiniwinDevice interface (#267) 2025-06-09 16:34:37 +00:00
Joshua Peisach
e520a47e2f
Port CONFIG to Qt (#210)
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-06-03 03:48:04 +02:00
Anders Jenbo
ef7499bdb9 Restructure miniwin and add support for 3D backends 2025-05-29 04:07:53 +02:00
Anonymous Maarten
b24271a51b
Move miniwin to sdl3gpu subdirectory + add suffix to classes (#170) 2025-05-25 17:38:02 +00:00
Christian Semmler
110d9d4f7d
Update isleapp.cpp (#169) 2025-05-25 07:39:41 -07:00
Anonymous Maarten
183efa3d8f
More debug features: pause/step/resume (#140)
* More debug features: pause/step/resume

* Fix palette order (I think)

* Revert "Fix palette order (I think)"

This reverts commit a81de08f78.
2025-05-21 19:54:22 +02:00
Wouter Wijsman
911330e61c
Use SDL_EVENT_QUIT for window close (#126) 2025-05-21 19:33:53 +02:00
Anonymous Maarten
9d06cd9e53
Show imgui window when starting app with --debug (#138)
* Show imgui window when starting app with --debug

* g_closed test in SDL_AppIterate is still needed

* Allow disabling isleapp debugging by configuring with -DISLE_DEBUG=OFF

* clang-format
2025-05-20 23:36:51 +02:00
Christian Semmler
23182618cc
Merge remote-tracking branch 'isle/master' 2025-05-19 17:16:56 -07:00
Erik Schulze
d67318e78b
propagate name changes from commit fce97ea (#1508)
* propagate name changes from commit fce97ea

* remove dependency on omni types

* rename parameter too
2025-05-19 21:25:52 +02:00
AllMeatball
b1dfbe9925
isleapp: Show error dialog if NOCD.si or ISLE.si fails to load (#95)
* isleapp: Show error dialog if NOCD.si fails to load

* isleapp: Return bool in IsleApp::Tick

foxtacles recommended me to return a boolean for if tick failed
instead of just setting `g_closed` and setting `g_closeResult`
to set the return value of the program exit.

I also think this is the better solution. since a similar solution
was used in LoadConfig.

* isleapp: Better error logs & return false in places

foxtacles recommended to use SDL's logging api to show detailed errors
and using false in two places where it should exit because of failure.

This commit adds these two things.

* isleapp: Add missing error dialog when ISLE.si fails

* isleapp: Add missing error dialog when ISLE.si fails

* isleapp: Remove weird duplicate message box

* Move error dialog to loop

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-16 23:08:45 +02:00
Anders Jenbo
9ae96cbff6
Implement a functional DirectDraw (#81) 2025-05-15 20:45:53 -07:00
Christian Semmler
662385e60a
Merge branch 'master' of github.com:isledecomp/isle-portable 2025-05-14 16:40:16 -07:00
Christian Semmler
aec7426665
Merge remote-tracking branch 'isle/master' 2025-05-14 16:40:05 -07:00
Anders Jenbo
fce97ea06f
Correct check for lighting support (#1486) 2025-05-15 01:39:55 +02:00
AllMeatball
da056ee45f
isleapp: Add icon upon window creation (#85)
* isleapp/res: Add icon.h

* isleapp: Set icon on non-windows systems

* isleapp: Fix formating to match with .clang-format

* isleapp: Remove _WIN32 ifdefs

This is closer to the original code. I thought it would let Windows
set the icon itself not set the icon upon window creation.

* isleapp: Load internal .BMP instead of raw pixels

This should fix the endianess problem I mentioned in the PR.

* isleapp: Only load icon from IOStream if it's valid

* isleapp: Disable format checking in ISLE/res/

* ISLE/res/resource.h: Prevent recursive inclusion

* ISLE: Remove isle.h from resource.h

also rename isle.h to isle_bmp.h

* isleapp: Fix formatting
2025-05-15 01:18:41 +02:00
AllMeatball
c48935a64b
Create config with sane defaults if not already present (#71)
* Create config with sane defaults if not present

* isleapp: Use binary mode for iniFP

Windows treats newlines differently then on *nix systems. Using binary mode makes this consistent.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* isleapp: Remove extern "C"

It seems like it's fine including these libraries without extern "C"

* isleapp: Use boolean return in LoadConfig

This to check if the config loaded correctly or not.
Seems to be a good solution to the file loading issue.

Maybe there's a better solution
SetupWindow failing because of a config erroring seems a bit odd.

* isleapp: Remove that dumb use after free.

I forgot you don't specify a filename you specify a *file pointer*

* isleapp: Fix iniFP to be in proper scope

This also fixes the missing parameter in `iniparser_dump_ini`

* .gitignore: Exclude the kate .cache folder

* isleapp: Match prototype of LoadConfig in header

* isleapp: Fix formating to comply with .clang-format

* isleapp: Don't create new config if manually set

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-05-12 17:25:16 -07:00
Ramen2X
2b3e7176d3
make all calls to winapi format-agnostic (#1470) 2025-05-11 15:03:32 -04:00
Anonymous Maarten
b97aea42d2
Use SDL_KeyCode in LEGO1.dll (#51)
* Pass SDL_Keycode in LEGO1.dll

* ISLE.EXE: use iniparser for getting isle.mediaPath

* Use SDL_isdigit instead of isdigit

* clang-format

* hdPath is a better default for mediaPath

* Replaced a stray 'A' with SDLK_A

* Use SDL_Keycode to store the ogel cheat code
2024-12-29 18:56:47 +01:00
Anonymous Maarten
05cfe4ee25
Even more SDL usage (#49)
* Texture pixel data is passed through as const data

* Use SDL_Surface/SDL_Palette in LegoImage

* Use SDL_Process to run subprocess

* Pass SDL_Window handle to SDL_ShowSimpleMessageBox

this makes sure the message dialog is shown as modal dialog and is on top

* Log errors during initialization

* Show SDL error during initialization

* Include <climits> for INT_MAX

* Replace _access with SDL_GetPathInfo

* Use SDL_RemovePath instead of DeleteFile

* Use SDL_RenamePath instead of MoveFile

* Use MxS32 in legoutils.cpp

* Update LEGO1/lego/legoomni/src/common/legoutils.cpp

* Naming

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-12-28 16:52:34 +01:00
Anonymous Maarten
65adfe7d64
More use of SDL (#47)
* Use SDL_GetPerformance(Counter|Frequency) in MxStopWatch

* Fix flic.h for gcc Linux compiler

* cmake: remove left-over message

* Replace some more stricmp with SDL_strcasecmp

* Pass SDL_Window* to LEGO1.DLL, and pass window events through SDL event handler

* clang-format

* Use SDL_Timer for unknown input dragging events

* Fix naming

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-12-27 18:44:14 +01:00
Anonymous Maarten
bb4db6caac
Use SDL3 functions in more locations (#44)
* Use strcasecmp, strncasecmp, strlwr, strupr and itoa from SDL

* Use SDL_GetTicks instead of timeGetTime

* Use MxDSFile::OPEN_READ instead of OF_READ

* Use SDL_IOStream to read bitmaps

* Use SDL_LogXXX instead of OutputDebugString

* Undo mxvideoparam.h change

* Revert "Undo mxvideoparam.h change"

This reverts commit 4a20cf6c46.

* Fix _MxTrace

* Reapply "Undo mxvideoparam.h change"

This reverts commit b3a09dc520.

* fix _MxTrace

* Use __declspec(dllexport) for exporting symbols from dll

Refactored CMake script such that all objects are passed to the lego1 library.

* clang-format

* fix msvc build

* MSVC fixed for real now?

* Forgot about d3drm_guid

* Fix naming issue

* Use Uint64 in LegoCarBuild::Tickle for dTime
2024-12-24 18:04:46 -07:00
Ramen2X
4cd4b55ae7
replace directinput joystick APIs with SDL (#41) 2024-12-19 19:25:49 -05:00
Christian Semmler
e7a604c61c
SDL3 fixes (#32) 2024-10-03 21:50:32 +02:00
Christian Semmler
0f3f6b6940
Fix SDL3 interfaces 2024-09-05 12:19:29 -07:00
Christian Semmler
9b48c8e5b1
Fix SDL3 interfaces 2024-09-05 12:15:04 -07:00
Christian Semmler
be12560248
SDL3 fixes (#31) 2024-07-28 19:18:01 +02:00
Anonymous Maarten
196259c6c9
Parse cli arguments + log with SDL_Log (#30)
* cmake: copy DLL dependencies to output path

This also copies SDL3.dll from an external path when using system
dependencies.

* Only include <SDL3/SDL.h>

* isle: parse cli argument (--ini for custom ini path)

* Use SDL_CreateWIndowWithProperties to create SDL window

Less branching => Clearer code

* Log mxdirectx failure using SDL_Log + E_NOINTERFACE

* Fix d3drm32.def for msvc

* Define D3DRM_WINE when using d3drm from wine

* Ignore failed assertions from d3drm unimplemented functions

* inparser will/should create libiniparser.lib for static libraries and iniparser.lib for a shared library
2024-06-26 11:24:40 -07:00
Anonymous Maarten
659a54b221
Add support for building x64 executables (#29)
* d3drm: store LPVOID data instead of DWORD

* m_extraCharacterId is an integer, not a pointer

* cmake: look for iniparser using config file first, then try our custom module file

Our custom module file is still useful.
My linux distro does not package the cmake files.

* x86's stdcall becomes MS's x64 calling canvention

* Fix 64-bit mxdsbuffer pointer arithmetic

* Casting from void* to a smaller-sized integer needs an intermediate equally-sized integer

* Don't cast address to scalar (this is fishy)

* Add mingw64 build to the ci matrix

* Ignore -Wdiscarded-qualifiers warning with const vtables

* Ignore different 'const' qualifiers with MSVC

* Create d3dxof import library for MSVC

* DESCRIPTION in .def file(s) is deprecated

* Assume mmx is supported on x64, require a test for x86 and disabled on other archs

* 32- and 64-bit LEGO1.dll export different symbol names

* Introduce d3drm_guid containing the guids of d3drm

* Disable __wine_dbg_cdecl

* Include d3drm directory with EXCLUDE_FROM_ALL

* lego1 leaks d3drm headers

* Add dxfile.h

* Add 64-bit MSVC to the build matrix

* cmake: using ISLE_USE_DX5 means going all-in

* Load d3dxof.dll dynamically

* cmake: don't emit a warning about bitness anymore
2024-06-25 18:47:43 -07:00
Anonymous Maarten
ec19d5edb0 Fix mingw build + copy d3drm from wine (#25)
* Fix engineConfig declaration crossing jump

This fixes the following error:
```
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp: In member function 'virtual MxResult MxSoundManager::Create(MxU32, MxBool)':
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:119:1: error: jump to label 'done'
  119 | done:
      | ^~~~
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:78:22: note:   from here
   78 |                 goto done;
      |                      ^~~~
/src/isle-portable/LEGO1/omni/src/audio/mxsoundmanager.cpp:84:26: note:   crosses initialization of 'ma_engine_config engineConfig'
   84 |         ma_engine_config engineConfig = ma_engine_config_init();
      |                          ^~~~~~~~~~~~
```

* Fix 'invalid conversion from 'SDL_FunctionPointer' {aka 'void (*)()'} to 'void*'

* /SAFESEH:NO is a VC thing

* SDL3 is still instable

* Cannot forward declare and use enum

* Remove MusicManager from public LEGO1.DLL interface

* Copy d3d from wine git 6c5d17af07a318d754c0c21023b2d162a0d3725d

* Build d3drm-wine with 32-bit mingw

* cmake: move 3rd party targets to cmake script in 3rdparty directory

* cmake: bump minimum required CMake version to 3.25 to allow adding a subproject with SYSTEM automatically applied

An alternative would be to use SYSTEM in target_include_directories in the 3rd party cmake script.

* Add a minimal Findiniparser.cmake (not all distributions carry the upstream iniparser-config.cmake files)

* Add wine's d3drm headers

* cmake: merge ISLE_USE_DX5_LIBS into ISLE_USE_DX5

* cmake: Build all shared libraries in the binary output directory (to avoid PATH issues)

* ci: enable msys2 mingw32 build

* Disable clang-tidy on d3drm wine

* Thread functions must have SDLCALL call convention

* cmake: disable clang-tidy for miniaudio and libsmacker as well

* Hopefully fix c++ format and skip ncc naming violation

* clang-format violations keep up popping out of nowhere

* No need for lego/legoomni/include

* ncc: define SDLCALL as empty instead
2024-06-25 20:02:58 +02:00