51 Commits

Author SHA1 Message Date
Er2
bf78dd4bf1 clang-tidy: fix many warnings 2023-12-02 21:04:21 +03:00
Er2
56ce7e8073 Input: Use SDL scancodes instead of SDLK 2023-12-02 18:40:11 +03:00
Er2
17b11a5b98 Platforms: Add FreeBSD support 2023-12-02 18:37:38 +03:00
SanyaSho
b055b37b02 HaikuOS port (#97)
* ExternalFileLevelStorageSource: add workaround for d_type on Haiku

* raknet: FileList: do not include io.h on Haiku

* raknet: SocketLayer: add sockio.h for Haiku

* cmake: link -lnetwork on Haiku

* readme: add Haiku build dependencies

* cmake: use link_libraries instead of add_link_options

* ExternalFileLevelStorageSource: use scary stdstring instead of char
2023-11-05 21:33:57 +02:00
iProgramInCpp
3b60855ad0 * Android: Determine feature availability at compile time.
Since assets are baked in to the APK, we can simply check for the existence of assets at compile time using CMake.
2023-11-05 21:30:33 +02:00
jonkadelic
e6ab1214af Biome colour and grass side tint options (#98)
* Added biome colour and grass side tint options

* Moved GrassColor and FoliageColor to client/renderer/

* * Fix some build issues.

* * Add the new files to the CMakeLists.txt

---------

Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2023-11-05 18:19:41 +02:00
iProgramInCpp
8e69df37bb * Fix SDL build. 2023-11-03 14:54:16 +02:00
f
f83ead9f8d WIP Android Port (#79)
* WIP Android Port

Android port. Still needs touch controls and mouse turning (if that's even possible on android) and file saving and SoundSystemSL
You control the camera and movement with your controller for now. You can navigate the gui using touch.
Options.cpp,LocalPlayer.cpp,Minecraft.cpp is configured to use controller.
Blocked out some code in ControllerTurnInput.cpp,Controller.cpp that didn't make sense.

* Fix glClear

glClear is supossed to use GL_DEPTH_BUFFER_BIT (thx TheBrokenRail)

* * Fix build.

* * Ignore assets.

* * More stuff

* * Fix more build errors.

* * It finally built

What I needed to do is rebuild the debug keystore because apparently android studio created it with sha1 digest alg which isn't supported by ant

* * Clean up filters.

* * Add cramped mode to the pause screen.

* * Fix a bug with the hotbar

* * In NinecraftApp::handleBack, pause the game if there is no screen.

* * AppPlatform_android: Add placeholder SoundSystem instance till we get SoundSystemSL working

* * Add properly working touch code.

* * Oh, remove some testing things

* * Fix state resetting when going in background and back in foreground
* Fix bug where the sky isn't being regenerated on graphics reset
* Fix bug where the m_currBoundTex isn't reset in Textures::clear potentially leaving a texture with that ID unassigned and corrupted
* Fix bug in CThread where the thread is detached and then also joined.
* Don't log anything if the program isn't in debug mode.

* * Add virtual keyboard support.

The screen instance slides so that the focused text box is kept visible.

* Rename from com.minecraftcpp to com.reminecraftpe

---------

Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2023-11-03 12:54:39 +02:00
iProgramInCpp
8c6c5a0b39 Merge pull request #91 into master 2023-11-03 03:17:28 +02:00
iProgramInCpp
eba8f1b467 Merge pull request #82 into master 2023-11-03 03:01:59 +02:00
TheBrokenRail
f62fd3e7f5 Fix Touch In WASM 2023-11-03 02:48:47 +02:00
iProgramInCpp
65be786140 * Fix SDL related touch issues. 2023-11-03 02:47:08 +02:00
TheBrokenRail
5bf7fae0b1 Fix DoesAssetExist 2023-11-02 13:31:24 -04:00
TheBrokenRail
3b580eeed3 Reduce Number Of CMake Projects 2023-11-01 21:59:13 -04:00
TheBrokenRail
100dd1db5d Some Code Clean Up 2023-11-01 21:53:23 -04:00
TheBrokenRail
8278e2993d More CMake Clean Up 2023-11-01 21:53:23 -04:00
TheBrokenRail
bba3099b71 Clean Up CMake Build System 2023-11-01 21:48:41 -04:00
TheBrokenRail
4830a6fcab SDL Multitouch! 2023-11-01 20:54:56 -04:00
iProgramInCpp
4ff68d1f87 * Fix CMake build issues.
* Remove accidentally packed in binary.
2023-11-02 01:30:46 +02:00
iProgramInCpp
c503eccd9d * Move AppPlatform_emscripten to the sdl directory
As pointed out by #82, the behavior before this commit is unintuitive.
2023-10-22 10:52:38 +03:00
Brent
f12a3c1c61 Visual Studio Project Overhaul + Cleanup (#80)
* Visual Studio Project Overhaul + Cleanup
* SDL2 project for Windows
* Re-added game client icon to SDL2 code
* Renamed "AppPlatform_windows" to "AppPlatform_win32" (this is the name of the Windows API and is not representative of the architecture type)
* Renamed "LoggerWindows" to "LoggerWin32"
* Renamed "SoundSystemWindows to "SoundSystemDS" (DirectSound). This may be used for the 360, so it wouldn't really be Windows-specific then.
* Moved "ClientSideNetworkHandler" from "network" to "client/network". We don't need it being compiled for the server if the client's the only thing that needs it.
* I wonder if this still works on macOS...

* Bugfixes & Fixed for macOS

* Options::savePropertiesToFile Logging Bugfix

* Silence Winsock Deprecation Warnings in RakNet

* VS Project Improvements
- Replaced 50 billion relative paths with $(MC_ROOT)
- Added $(RAKNET_PATH) variable to override RakNet location
- Re-added gitignore for .vcxproj.user files
- Added debugging config to Directory.Builds.props
- Slimmed down project configurations for SDL2

* VS Project Config Bugfixes
- Fixed RakNet header path for additional includes

* RakNet Target for XCode

* XCode Project Config Fixes

* Packet logging

* Network VS Project Filter Fix

* Fix RakNet Packet ID Length
We previously didn't have consistency between old and new C++ regarding PacketType enum length. Now we do. This is required or else it completely breaks networking between the versions.

* Additional RakNet Error Handling

* Disable packet logging

* * Fix CMakeLists.txt

This reflects the relocation of ClientSideNetworkHandler.cpp.

* * Also add renderer/GL/GL.cpp to the CMakeLists.txt

* * Replace libpng with stb_image

* * Fix buggy water behavior.

* * Put the CMakeLists of the SDL project in debug mode

* Visual Studio 2010 Support

* * Change the SdlIoCallbacks from an array to a single member.

This fixes compilation of the sdl2 target on VS.

* * Fix missing _error label.

* Revert "* Fix missing _error label."

This reverts commit 99a057fc84049a16c864bd840fb439a008af5c74.

* Revert "* Replace libpng with stb_image"

* info_updateGame Tiles

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2023-10-22 10:08:59 +03:00
Brent
2e55f99a54 Options Logic Cleanup (#71)
* Output/Logging Overhaul
* Added StandardOut class
* Renamed LOGX macros to LOG_X
* Removed LogMsg macros in favor of LOG_X
* Added console window for debug Windows builds

* Options Refactor
* Moved options loading code from AppPlatform classes to Options class
* Added AppPlatform::singleton()
* Minecraft::m_options is now only accessible via Minecraft::getOptions() (as it should be)
* Making this work with SDL2 next

* Options Cleanup for SDL2

* Added AppPlatform::hasFileSystemAccess()
* Options won't try to load if hasFileSystemAccess returns false. Emscripten build will be happy.

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
2023-09-04 12:11:36 +03:00
iProgramInCpp
6e2fffdd68 * Rename Logger_windows -> LoggerWindows
* Add logger support for SDL base
2023-08-28 11:13:57 +03:00
Brent
5c1ea03747 Logging cleanup (#69)
* Mac OS X 10.6 & More C++03 Support

* Fix SDL2 options.txt loading for C++03

* Output/Logging Overhaul
* Added StandardOut class
* Renamed LOGX macros to LOG_X
* Removed LogMsg macros in favor of LOG_X
* Added console window for debug Windows builds

* Updated Xcode Project
+ StandardOut.hpp
+ StandardOut.cpp

* StandardOut_windows
* Replaced the Windows #ifdefs in StandardOut with StandardOut_windows

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
2023-08-28 10:55:41 +03:00
Brent
f7915a1dab Mac OS X 10.6 & More C++03 Support (#68)
* Mac OS X 10.6 & More C++03 Support

* Fix SDL2 options.txt loading for C++03

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
2023-08-27 11:46:15 +03:00
iProgramInCpp
0c38c01c28 * Add option saving to main.cpp when exiting.. 2023-08-25 20:35:26 +03:00
iProgramInCpp
4d5f087ae5 I am going insane 2023-08-25 20:21:26 +03:00
iProgramInCpp
6798c7a6a5 dswgaadgssdg3t22t135 2023-08-25 20:17:09 +03:00
iProgramInCpp
71d7f00f30 asdasdasdasd 2023-08-25 20:09:03 +03:00
iProgramInCpp
c177af0ad0 * fix 2023-08-25 20:08:46 +03:00
iProgramInCpp
cbe1853144 * Add options.txt saving and loading to SDL target. 2023-08-25 19:58:18 +03:00
iProgramInCpp
3388c773f9 * Fix linux build 2023-08-23 21:45:20 +03:00
iProgramInCpp
b9373e3c03 * Fix big bad init bug in regards to window icons. 2023-08-23 20:15:47 +03:00
iProgramInCpp
bf5114e684 * Also fix support for SDL again... 2023-08-22 18:23:31 +03:00
iProgramInCpp
82770d3436 * Small clean ups to the project. 2023-08-19 16:12:32 +03:00
Brent Da Mage
d5ee7bfc08 Cleaned Up AppPlatform & Input Classes
* Cleaned up AppPlatform classes
* Documented & improved Keyboard & Mouse classes
* Improved input-handling code in the Windows & SDL main.cpp files
2023-08-19 15:57:50 +03:00
iProgramInCpp
30f35ef724 More updates to fix stuff... 2023-08-19 10:09:49 +03:00
iProgramInCpp
0ed807eaf3 * Oops 2023-08-17 17:52:46 +03:00
iProgramInCpp
8a38dee562 * A couple of fixes for SDL/Emscripten build. 2023-08-17 17:49:52 +03:00
iProgramInCpp
acaf4aa614 * Fix WebGL build. 2023-08-17 14:26:35 +03:00
iProgramInCpp
a08478d527 * Slight refactor to the resize code. 2023-08-17 11:44:24 +03:00
Brent
5ac3aa6d9e macOS Support & AppPlatform Cleanup (#57)
* macOS Support & Cleanup

* Fix malformed comments in build-wasm.bat

* Emscripten Fixes

* * Add shebang to the grabsounds.py script

Since it was changed from rw- to rwx, I'll add the shebang so that it actually runs properly.

* * Re-add the patch_data and readme files.

* * Remove sound data.

* Fix some more things.

* Think it's ready to pull now...

---------

Co-authored-by: BrentDaMage <BrentDaMage@users.noreply.github.com>
Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2023-08-17 11:20:59 +03:00
Alexander Argentakis
5e8119d279 fixed some mouse related mistakes in main.cpp of the SDL build (#55) 2023-08-16 11:38:36 +03:00
iProgramInCpp
2da5c2e2fe * Add clouds! (optional feature) 2023-08-13 20:38:52 +03:00
iProgramInCpp
d1de430d14 * Add optional 3d panorama background 2023-08-11 00:13:06 +03:00
iProgramInCpp
6036304087 * Add preliminary raspberry pi support.
Currently it appears to be using software acceleration, so sucks, but I'll be
working on it.
2023-08-08 14:01:01 +03:00
Vruk
3447669f04 OpenAL Seperation and Adjustments (#34)
* OpenAL adjustments and improvements mk.1

Seperated SoundSystemAl from the sdl section and into platform/openal.
Made PlatformDefinitions.hpp require a "USE_OPENAL" definition instead of "USE_SDL" definition for OpenAL
Added SoundSystemAl.cpp  and SoundSystemAL.hpp files to the actual solution file so it can be compiled properly.
Made the SoundSystemAl use headers from thirdparty/OpenAL/include folder.
Made the SoundSystemAl use #pragma comment(lib, "OpenAL32.lib") to include the library if needed without adding it to the linker input value in the solution file.
Added thirdparty/OpenAL/libs/Win64/thirdparty/OpenAL/libs/Win32 to the additional libraries so that it can find the OpenAL32.lib library.

* OpenAL adjustments and improvements mk.2

Removed specific USE_SDL preprocessor definitions related to OpenAL which were unhelpful/unneeded for multi-platform use.
Made the OpenAl sound system inherit from the SoundSystem class and implement the functions properly without requiring a custom update function.
Fixed an error that would happen when closing the game related to OpenAl closing the sound device.
Removed unnecessary is_ui check in OpenAL sound system, UI sounds work just fine without it.
Adjusted rolloff factor, not sure if this is just placebo but it felt a bit better?

* Update sdl/CMakeLists.txt for new OpenAL stuff

* CMakeLists name fix

* Minor fixes for SDL compatibility

* Added check for absolute zero position

Made the OpenAL sound system consider any sound that is at absolute zero non-spatial

Also removed unneeded ORIGINAL_CODE check in SoundSystem.hpp and SoundSystem.cpp

* Fixed OpenAL popping strangeness

OpenAL apparently makes weird popping noises when the gain of a sound is below 0, so I added a check to see if the distance is too far (for the new updated settings)

I did some graphing and the previous settings for OpenAL were limiting the sound distance to 8 blocks (which was causing popping when sounds were between 8-16 blocks away as the gain was 0 or below) so I changed the rolloff factor to 1.0f to make sounds falloff at 16 blocks instead which seems reasonable/like the original intention.

* Minor Fix to solution additional includes

* Forgot an sdl compat change
2023-08-08 11:12:08 +03:00
iProgramInCpp
14562fc8ce * Allow the same thing on the emscripten version. 2023-08-06 22:48:09 +03:00
TheBrokenRail
4b8791100c Address Review Comments 2023-08-05 23:03:13 +03:00
TheBrokenRail
cc3310b556 Fix Loading Stereo Sound Data 2023-08-05 23:03:13 +03:00