Finalize Multiplayer v2.0.0 with CMake ws2_32 fix

This commit is contained in:
Michael Howard 2026-04-23 17:11:20 -05:00
parent acf6d84d7c
commit dea13eaf2c
8 changed files with 36 additions and 8 deletions

View File

@ -16,8 +16,11 @@ FetchContent_MakeAvailable(raylib)
# Create executable
add_executable(MorriCraft src/main.cpp)
# Link Raylib
# Link Raylib and Networking
target_link_libraries(MorriCraft PRIVATE raylib)
if(WIN32)
target_link_libraries(MorriCraft PRIVATE ws2_32)
endif()
# Copy assets to build directory
add_custom_command(TARGET MorriCraft POST_BUILD

Binary file not shown.

View File

@ -1 +1 @@
v1.9.1
v2.0.0

Binary file not shown.

View File

@ -1 +1 @@
v1.9.1
v2.0.0

View File

@ -1,3 +1,4 @@
#include "network.h"
#include "raylib.h"
#include "raymath.h"
#include "rcamera.h"
@ -11,7 +12,6 @@
#include <filesystem>
#include <fstream>
#include "rlgl.h"
#include "network.h"
#define CHUNK_SIZE 32
#ifndef PI
@ -703,7 +703,7 @@ int main(void)
// By default, windows have minimize, maximize, and close buttons on the top bar.
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT);
InitWindow(screenWidth, screenHeight, "MorriCraft v1.9.1");
InitWindow(screenWidth, screenHeight, "MorriCraft v2.0.0");
LoadConfig();
SetExitKey(KEY_NULL); // Prevent ESC from closing the window
@ -771,6 +771,7 @@ int main(void)
std::vector<Socket> clientSockets;
InitNetworking();
InventorySlot mouseHeldItem(AIR, 0);
float gameTime = 75.0f; // Start at 6:00 AM
float breakProgress = 0.0f;
int lastHitX = -1, lastHitY = -1, lastHitZ = -1;
@ -1417,8 +1418,8 @@ int main(void)
DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE);
EndMode2D();
// Show Version Number (v1.9.1) in Red
DrawTextEx(customFont, "v1.9.1", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
// Show Version Number (v2.0.0) in Red
DrawTextEx(customFont, "v2.0.0", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
// --- PLAYER NAME POPUP (IF MISSING) ---
if (playerName == "") {

View File

@ -3,10 +3,34 @@
#include <string>
#include <vector>
#include <cstdint>
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOGDI
#define NOGDI
#endif
#ifndef NOUSER
#define NOUSER
#endif
// Rename conflicting functions before including windows/winsock
#define CloseWindow CloseWindow_Win
#define ShowCursor ShowCursor_Win
#define DrawTextEx DrawTextEx_Win
#define PlaySound PlaySound_Win
#include <winsock2.h>
#include <ws2tcpip.h>
#undef CloseWindow
#undef ShowCursor
#undef DrawTextEx
#undef PlaySound
#undef near
#undef far
#pragma comment(lib, "ws2_32.lib")
typedef SOCKET Socket;
#define INVALID_SOCKET_VAL INVALID_SOCKET

View File

@ -1 +1 @@
v1.9.1
v2.0.0