Files
gMod/OTM_DX9/OTM_TextureServer.h
T
code@koerner-de.net b2bade7ff8 BugFix:
- append '\0' at the end of game name (dll injection)
- Release() fake texture (if force reload) instead of calling RemoveTexture(..)

Improvements:
- template support, you can now have more than one template set one of them as default.
- update function will only update the texture if this is needed or the reload button is pressed.
- textures will also be removed, if they are removed from the package list.
2011-10-13 19:01:16 +00:00

99 lines
2.3 KiB
C++

/*
This file is part of OpenTexMod.
OpenTexMod is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenTexMod is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenTexMod. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OTM_TEXTURESERVER_H_
#define OTM_TEXTURESERVER_H_
#include "../OTM_GlobalDefines.h"
#include "OTM_ArrayHandler.h"
class OTM_TextureClient;
class OTM_TextureServer
{
public:
OTM_TextureServer(wchar_t *name);
~OTM_TextureServer(void);
int AddClient(OTM_TextureClient *client, TextureFileStruct** update, int* number);
int RemoveClient(OTM_TextureClient *client);
int OpenPipe(wchar_t *name);
int ClosePipe(void);
int MainLoop(void);
//following functions are public for testing purpose !!
int AddFile( char* buffer, unsigned int size, MyTypeHash hash, bool force);
int AddFile( wchar_t* file_name, MyTypeHash hash, bool force);
int RemoveFile( MyTypeHash hash);
int SaveAllTextures(bool val);
int SaveSingleTexture(bool val);
int SetSaveDirectory( wchar_t *dir);
int SaveTexture(OTM_IDirect3DTexture9* pTexture);
int SetKeyBack( int key);
int SetKeySave( int key);
int SetKeyNext( int key);
int SetFontColour(DWORD colour);
int SetTextureColour(DWORD colour);
private:
bool BoolSaveAllTextures;
bool BoolSaveSingleTexture;
wchar_t SavePath[MAX_PATH];
wchar_t GameName[MAX_PATH];
int PropagateUpdate(OTM_TextureClient* client=NULL);
int PrepareUpdate(TextureFileStruct** update, int* number);
int LockMutex();
int UnlockMutex();
int KeyBack;
int KeySave;
int KeyNext;
DWORD FontColour;
DWORD TextureColour;
HANDLE Mutex;
PipeStruct Pipe;
OTM_TextureClient** Clients;
int NumberOfClients;
int LenghtOfClients;
OTM_FileHandler CurrentMod;
OTM_FileHandler OldMod;
};
#endif /* OTM_TEXTURESERVER_H_ */