Files
gMod/header/uMod_TextureServer.h
T
DubbleClick ab2d8cdb0a 1.5.4 (#7)
* toggle use_folders on

* Rename pipelines

* its a strcpy :(

* add miniz, add xorstream, add non-working ziploader

* start integrating libzip (WIP)

* use ExternalProject test (doesnt work maybe?!)

* further work in integrating libzippp [WIP]
can't build libzip yet (neither manually nor in the vs build), as it doesn't find zlib

* LibZip build script

* make libzip build too
todo: specify cmake find_library to check the paths we install to

* prepare everything in cmake

* fix rebuilding of libzip/zlib

* fix stupid double quotes

* libzippp works

* Setup libzippp archive loading

* Remove allocation of new data when adding file to TextureServer

* Enable CI on dev

* Create LICENSE (#5)

* add mbedtls

* fix cmake (forgot to substitute, woops)

* fix %lu warnings for printing addresses

* enable debug messages, some formatting

* remove mbedtls, fix libzip for /MD(d)

* some code changes

* fix cmake logic, str replace min cmake version in libzip-src/CMakeLists.txt to 3.15

* linker errors in release

* c++ify a little

* remove unnecessary duplicate c++23 definition

* Fixes to gMod_XorStream when calculating stream length

* Fix loading tpf contents with password

* Implemented complete parsing

* Cleanup file loading

* Change to NI

* Revert "Change to NI"

This reverts commit 19b511d907.

* update XorStreamReader to read whole file, then xor

* delete a lot of unused code

* loading logic

* rename console window

* 1.5.4

* remove pointless mutex

* wtf is this code

---------

Co-authored-by: Alex Macocian <amacocian@yahoo.com>
2023-11-17 21:58:04 +01:00

55 lines
2.1 KiB
C++

#pragma once
#include "uMod_GlobalDefines.h"
#include "uMod_ArrayHandler.h"
/*
* An object of this class is created only once.
* The Mainloop functions is executed by a server thread,
* which listen on a pipe.
*
* Functions called by the Client are called from the a thread instance of the game itself.
* Nearly all other functions are called from the server thread instance.
*/
class uMod_TextureClient;
class uMod_TextureServer {
public:
uMod_TextureServer(char* name, char* uModName);
~uMod_TextureServer();
int AddClient(uMod_TextureClient* client, TextureFileStruct** update, int* number); // called from a Client
int RemoveClient(uMod_TextureClient* client); // called from a Client
int Initialize(); // is executed in a server thread
// following functions are only public for testing purpose !!
// they should be private and only be called from the Mainloop
int AddFile(char* buffer, unsigned int size, MyTypeHash hash, bool force); // called from Mainloop(), if the content of the texture is sent
private:
wchar_t SavePath[MAX_PATH];
wchar_t GameName[MAX_PATH];
char UModName[MAX_PATH];
void LoadModsFromFile(const char* source);
int PropagateUpdate(uMod_TextureClient* client = nullptr); // called from Mainloop() if texture are loaded or removed
int PrepareUpdate(TextureFileStruct** update, int* number); // called from PropagateUpdate() and AddClient()
// generate a copy of the current texture to be modded
// the file content of the textures are not copied, the clients get the pointer to the file content
// but the arrays allocate by this function, must be deleted by the client
uMod_TextureClient** Clients;
int NumberOfClients;
int LenghtOfClients;
uMod_FileHandler CurrentMod; // hold the file content of texture
uMod_FileHandler OldMod; // hold the file content of texture which were added previously but are not needed any more
// this is needed, because a texture clients might not have merged the last update and thus hold pointers to the file content of old textures
};