mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-15 08:11:22 +00:00
Moved to git
Assembla's decision to remove Trac incited us to ditch them entirely. Further, the repository no longer includes binaries or libraries; these can be downloaded from niotso.org/pub/ and updated with the included update-libraries script.
This commit is contained in:
parent
6b0b0c1d9c
commit
227617b540
33 changed files with 368 additions and 95 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
$(find -iname "_build/") $(find -iname "_deps/") $(find -iname "_dist/") $(find -iname "*.o") $(find -iname "*.lo") $(find -iname "*.slo") $(find -iname "*.res") $(find -iname "*.obj") $(find -iname "*.pch") $(find -iname "*.gch") $(find -iname "*.a") $(find -iname "*.la") $(find -iname "*.lai") $(find -iname "*.lib") $(find -iname "*.dll") $(find -iname "*.so") $(find -iname "*.so.*") $(find -iname "*.dylib") $(find -iname "*.exe") $(find -iname "*.app") $(find -iname "*.gcno") $(find -iname "*.gcda") $(find -iname "*.gcov") $(find -iname "Makefile.in") $(find -iname "autom4te.cache") $(find -iname "*.am") $(find -iname "*.ac") $(find -iname "*.m4") $(find -iname "*.po") $(find -iname "*.gmo") $(find -iname "*.at") $(find -iname "*.texi") $(find -iname "*.pc") $(find -iname "compile") $(find -iname "configure") $(find -iname "depcomp") $(find -iname "install-sh") $(find -iname "missing") $(find -iname "CMakeCache.txt") $(find -iname "CMakeFiles") $(find -iname "cmake_install.cmake") $(find -iname "install_manifest.txt") $(find -iname "*.sln.*") $(find -iname "*.ncb") $(find -iname "*.user") $(find -iname "*.ilk") $(find -iname "*.pdb") $(find -iname "*.idb") $(find -iname "*.pgc") $(find -iname "*.pgd") $(find -iname "*.rsp") $(find -iname "*.sbr") $(find -iname "*.tlb") $(find -iname "*.tli") $(find -iname "*.tlh") $(find -iname "*.aps") $(find -iname "*.opensdf") $(find -iname "*.sdf") $(find -iname "*.psess") $(find -iname "*.vsp") $(find -iname "*.vspx") $(find -iname "*.vspscc") $(find -iname "*.vssscc") $(find -iname "*.Resources") $(find -iname "*.Cache") $(find -iname "*.gpState") $(find -iname "_ReSharper*") $(find -iname "*.ncrunch*") $(find -iname ".*crunch*.local.xml") $(find -iname "csx") $(find -iname "*.build.csdef") $(find -iname "*.dbmdl") $(find -iname ".builds") $(find -iname "*.scc") $(find -iname "ipch/") $(find -iname "AppPackages/") $(find -iname "_UpgradeReport_Files/") $(find -iname "BuildLog.htm") $(find -iname "UpgradeLog*.XML") $(find -iname "*.pro.user") $(find -iname "*.pro.user.*") $(find -iname "moc_*.cpp") $(find -iname "qrc_*.cpp") $(find -iname "*.dmg") $(find -iname "*.xpi") $(find -iname "*.gem") $(find -iname "*.egg") $(find -iname "*.deb") $(find -iname "*.rpm") $(find -iname "*.apk") $(find -iname "*.ap_") $(find -iname "*.db") $(find -iname "Desktop.ini") $(find -iname "$RECYCLE.BIN/") $(find -iname ".DS_Store") $(find -iname ".AppleDouble") $(find -iname ".LSOverride") $(find -iname "Icon") $(find -iname ".Spotlight-V100") $(find -iname ".Trashes") $(find -iname ".~*")
|
|
@ -110,6 +110,26 @@ endif()
|
|||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
|
||||
if(WIN32)
|
||||
set(FREETYPE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/freetype/include ${CMAKE_SOURCE_DIR}/_deps/freetype/include/freetype/config)
|
||||
set(LIBJPEGTURBO_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/libjpeg-turbo)
|
||||
set(LIBMPG123_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/libmpg123)
|
||||
set(LIBPNG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/libpng)
|
||||
set(LIBPQ_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/libpq ${CMAKE_SOURCE_DIR}/_deps/libpq/include ${CMAKE_SOURCE_DIR}/_deps/libpq/include/port/win32 ${CMAKE_SOURCE_DIR}/_deps/libpq/include/port)
|
||||
set(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/_deps/zlib)
|
||||
|
||||
add_subdirectory(_deps/freetype)
|
||||
add_subdirectory(_deps/libjpeg-turbo)
|
||||
add_subdirectory(_deps/libmpg123)
|
||||
add_subdirectory(_deps/libpng)
|
||||
add_subdirectory(_deps/libpq)
|
||||
add_subdirectory(_deps/zlib)
|
||||
endif()
|
||||
|
||||
set(FILEHANDLER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
set(LIBGLDEMO_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/Libraries/libgldemo)
|
||||
set(LIBVITABOY_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/Libraries/libvitaboy)
|
||||
|
||||
add_subdirectory(Client)
|
||||
add_subdirectory(Libraries)
|
||||
add_subdirectory(Server)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(NiotsoClient)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/freetype/include)
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
set(NIOTSOCLIENT_SOURCES
|
||||
|
|
|
@ -15,7 +15,7 @@ These restrictions are not enforced by us, but may potentially be used
|
|||
by EA in attempt to take down your game.
|
||||
|
||||
If you have any questions, you may visit
|
||||
<http://www.assembla.com/spaces/niotso/wiki/About_-_Legal_Summary>
|
||||
<http://wiki.niotso.org/Niotso/Legal_Summary>
|
||||
|
||||
---
|
||||
|
||||
|
|
11
Client/TODO
11
Client/TODO
|
@ -11,8 +11,11 @@ Development Phase: Planning
|
|||
|
||||
Technical Preview 1
|
||||
Schedule: (Not very subject to change)
|
||||
1. Implement cst and uis parsers [40%]
|
||||
1. Implement cst, uis, ini, and xml parsers with support for UTF-8 [20%]
|
||||
2. Replicate functionality up until the login dialog [90%]
|
||||
3. Implement the OpenGL-based windowing system
|
||||
4. Replicate character selection and creation features and the city selection dialog
|
||||
5. Implement the code needed to allow the game to read all necessary files from the TSOClient folder
|
||||
3. Implement the audio engine
|
||||
4. Implement the OpenGL-based windowing system
|
||||
5. Replicate character selection and creation features and the city selection dialog
|
||||
6. Implement debug logging and support for configuration files
|
||||
7. Implement the code needed to allow the game to read all necessary files from the TSOClient folder
|
||||
8. Port the client to Linux
|
|
@ -1,25 +0,0 @@
|
|||
All you need installed to compile Niotso for Windows, Linux, or Mac is cmake 2.6 or newer, a compatible compiler (such as GCC 4.6 or newer), and NASM 2.0 or newer for libjpeg-turbo and libmpg123.
|
||||
|
||||
cd into the _build directory and run
|
||||
$ cmake -G "<Generator name>" ..
|
||||
|
||||
The list of generators can be found with cmake --help.
|
||||
|
||||
//-- Makefile
|
||||
|
||||
Run "make" to compile every package. -j # will greatly speed up the compile time for processors with # cores.
|
||||
Run "make install" after compiling to install Niotso to your game directory; please specify it first in the Makefile.
|
||||
|
||||
Run "make objclean" to delete all object files created during compilation.
|
||||
Run "make clean" to delete all object files and executable files created during compilation.
|
||||
Run "make distclean" to delete all files of any kind created during compilation. (Includes profile-collection files.)
|
||||
Run "make uninstall" to delete Niotso from your game directory.
|
||||
Run "make uninstall_all" to delete Niotso from your game directory as well as all Niotso.ini files created by Niotso.
|
||||
|
||||
Run "make <component>" to compile only a specific package.
|
||||
For a list of packages, run "make help".
|
||||
Note that packages must and will compile any other packages required as a dependency.
|
||||
|
||||
//-- Code::Blocks, Visual Studio, XCode
|
||||
|
||||
Open the solution or project file; you may select between a Release, Debug, Release64, and Debug64 build configuration.
|
|
@ -1,7 +0,0 @@
|
|||
All documentation is centralized online rather than scattered around the codebase.
|
||||
|
||||
For documentation regarding the packages in the repository, that will be at the Trac:
|
||||
http://trac-hg.assembla.com/niotso
|
||||
|
||||
For all other documentation (including format specifications), that will be at Niotso Wiki:
|
||||
http://wiki.niotso.org
|
|
@ -7,7 +7,5 @@ else()
|
|||
endif()
|
||||
|
||||
add_subdirectory(FileHandler)
|
||||
add_subdirectory(freetype)
|
||||
add_subdirectory(libgldemo)
|
||||
add_subdirectory(libpq)
|
||||
add_subdirectory(libvitaboy)
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
*/
|
||||
|
||||
#include "FileHandler.hpp"
|
||||
#include <mpg123.h>
|
||||
#include "wav/read_wav.h"
|
||||
#include "xa/read_xa.h"
|
||||
#include "utk/read_utk.h"
|
||||
#include "libmpg123/mpg123.h"
|
||||
|
||||
namespace File {
|
||||
|
||||
|
|
|
@ -11,13 +11,8 @@ endif()
|
|||
|
||||
add_subdirectory(far)
|
||||
add_subdirectory(iff)
|
||||
add_subdirectory(libexpat)
|
||||
add_subdirectory(libjpeg-turbo)
|
||||
add_subdirectory(libmpg123)
|
||||
add_subdirectory(libpng)
|
||||
add_subdirectory(utk)
|
||||
add_subdirectory(xa)
|
||||
add_subdirectory(zlib)
|
||||
|
||||
set(FILEHANDLER_SOURCES
|
||||
Audio.cpp
|
||||
|
@ -33,7 +28,7 @@ if(WIN32)
|
|||
set(FILEHANDLER_SOURCES ${FILEHANDLER_SOURCES} resource.rc)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR} ${LIBMPG123_INCLUDE_DIR} ${LIBJPEGTURBO_INCLUDE_DIR} ${LIBPNG_INCLUDE_DIR})
|
||||
|
||||
#### Static library (uncomment to build)
|
||||
#add_library(FileHandler_static STATIC ${FILEHANDLER_SOURCES})
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include "FileHandler.hpp"
|
||||
#include <setjmp.h> //Used by libpng
|
||||
#include <jpeglib.h>
|
||||
#include <png.h>
|
||||
#include "bmp/read_bmp.h"
|
||||
#include "libjpeg-turbo/jpeglib.h"
|
||||
#include "libpng/png.h"
|
||||
|
||||
namespace File {
|
||||
|
||||
|
|
17
Libraries/FileHandler/Text.cpp
Normal file
17
Libraries/FileHandler/Text.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
Text.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
|
@ -49,8 +49,6 @@ static void KillGLWindow()
|
|||
DestroyWindow(hWnd);
|
||||
hWnd = NULL;
|
||||
}
|
||||
|
||||
UnregisterClass("OpenGL", hInst);
|
||||
}
|
||||
|
||||
static int CreateGLWindow(const char *__restrict title, uint16_t width, uint16_t height)
|
||||
|
@ -71,7 +69,6 @@ static int CreateGLWindow(const char *__restrict title, uint16_t width, uint16_t
|
|||
0, /* Reserved */
|
||||
0, 0, 0 /* Masks */
|
||||
};
|
||||
DEVMODE dm;
|
||||
DWORD dwStyle, dwExStyle;
|
||||
RECT WindowRect;
|
||||
int PixelFormat;
|
||||
|
@ -79,10 +76,11 @@ static int CreateGLWindow(const char *__restrict title, uint16_t width, uint16_t
|
|||
int (WINAPI *wglGetSwapIntervalEXT)(void);
|
||||
|
||||
if(fullscreen){
|
||||
width = dm.dmPelsWidth;
|
||||
height = dm.dmPelsHeight;
|
||||
dwExStyle = WS_EX_APPWINDOW | WS_EX_TOPMOST;
|
||||
dwStyle = WS_POPUP;
|
||||
|
||||
width = ResWidth;
|
||||
height = ResHeight;
|
||||
ShowCursor(0);
|
||||
}else{
|
||||
dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
||||
|
@ -227,7 +225,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||
wc.hInstance = hInst = hInstance;
|
||||
wc.hIcon = (HICON) LoadImage(NULL, IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_SHARED);
|
||||
wc.hCursor = (HCURSOR) LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE);
|
||||
hInstance = GetModuleHandle(NULL);
|
||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
|
||||
ResWidth = dm.dmPelsWidth;
|
||||
ResHeight = dm.dmPelsHeight;
|
||||
|
@ -259,6 +256,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||
|
||||
if(msg.message == WM_QUIT){
|
||||
KillGLWindow();
|
||||
UnregisterClass("OpenGL", hInstance);
|
||||
return (!Demo.Shutdown || Demo.Shutdown()) ? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ else()
|
|||
add_definitions(-Dstricmp=strcasecmp)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/libgldemo)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
include_directories(${LIBGLDEMO_INCLUDE_DIR})
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR})
|
||||
|
||||
#### Static library (uncomment to build)
|
||||
#add_library(libvitaboy_static STATIC ${LIBVITABOY_SOURCES})
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
i,j,k,l: Translate the sim around the screen
|
||||
z,x: Rotate the sim like a clock
|
||||
a,s: Zoom in, out
|
||||
q: Toggle skeleton
|
||||
n: Animate the character
|
||||
F11: Enter/leave fullscreen
|
||||
*/
|
||||
|
@ -81,6 +82,8 @@ static float AnimationTime = 0;
|
|||
static bool ShowMesh = true;
|
||||
static bool ShowSkeleton = true;
|
||||
|
||||
static bool PressedQ = false;
|
||||
|
||||
static void DisplayFileError(const char * Filename){
|
||||
const char * Message;
|
||||
switch(File::Error){
|
||||
|
@ -372,6 +375,7 @@ static int DrawScene(float TimeDelta, uint8_t keys[256])
|
|||
if(keys['I']){ Character.Translation.y+=3*TimeDelta; }
|
||||
if(keys['J']){ Character.Translation.x-=3*TimeDelta; }
|
||||
if(keys['L']){ Character.Translation.x+=3*TimeDelta; }
|
||||
if(keys['Q']){ if(!PressedQ){ PressedQ = 1; ShowSkeleton = !ShowSkeleton; }} else PressedQ = 0;
|
||||
if(keys['N']){ AdvanceFrame(Skeleton, Animation, TimeDelta); }
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the screen and the depth buffer
|
||||
|
|
35
README.md
Normal file
35
README.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Niotso
|
||||
|
||||
[Niotso](http://niotso.org/) is the “New Implementation of The Sims Online”, aiming to restore The Sims Online as free software.
|
||||
|
||||
## Binaries
|
||||
|
||||
Nightlies for 32-bit Windows and 64-bit Linux are provided at http://niotso.org/pub/snapshots/.
|
||||
|
||||
Stable builds and source packages are provided at http://niotso.org/pub/stable/.
|
||||
|
||||
## Compiling instructions
|
||||
|
||||
For compiling instructions, please see http://wiki.niotso.org/Niotso_-_Compiling_instructions.
|
||||
|
||||
## Documentation
|
||||
|
||||
One of these days, when we finalize the interface for a package, we will document it using doxygen.
|
||||
|
||||
Documentation over the game itself (including format specifications) occurs at Niotso Wiki:
|
||||
http://wiki.niotso.org/
|
||||
|
||||
## Copying
|
||||
|
||||
Niotso Client and Niotso Server are distributed under the terms of the GNU GPLv3.
|
||||
|
||||
While this license does permit others to compile, distribute, change, and distribute changes to Niotso, in reality, many of these freedoms cannot legally be enacted by anybody.
|
||||
|
||||
Specifically, if you make changes to Niotso such that it significantly changes the "game experience as presented to the player", it cannot be distributed to others. You also may not distribute a version of Niotso that has stripped the EA or Maxis trademarked names or logos anywhere from the game. Personal use of these modifications is okay.
|
||||
|
||||
These restrictions are not enforced by us, but may potentially be used by EA in attempt to take down your game.
|
||||
|
||||
If you have any questions, you may visit
|
||||
http://wiki.niotso.org/Niotso/Legal_Summary
|
||||
|
||||
All other packages released by this project are typically either licensed under the ISC License or are public domain.
|
|
@ -12,7 +12,7 @@ if(WIN32)
|
|||
windows/Dialog/AddToArchive.cpp
|
||||
windows/Dialog/NewArchive.cpp
|
||||
)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler/libpng)
|
||||
include_directories(${LIBPNG_INCLUDE_DIR})
|
||||
add_executable(FARDive WIN32 ${FARDIVE_SOURCES})
|
||||
target_link_libraries(FARDive ole32 uxtheme FileHandler_shared)
|
||||
endif()
|
52
Tools/TSOSimulatorClient/TSOEdithEditor/TSOEdithEditor.cpp
Normal file
52
Tools/TSOSimulatorClient/TSOEdithEditor/TSOEdithEditor.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
TSOEdithEditor - TSOEdithEditorD.dll injector
|
||||
TSOEdithEditor.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include "TSOEdithEditor.hpp"
|
||||
|
||||
int main(){
|
||||
HMODULE dllmodule = LoadLibrary("TSOEdithEditorD.dll");
|
||||
if(dllmodule == NULL){
|
||||
printf("TSOEdithEditor: Error: Failed to load DLL \"TSOEdithEditorD.dll\".");
|
||||
return -1;
|
||||
}
|
||||
|
||||
cEdithEditorCOMDirector * (__stdcall *GZDllGetGZCOMDirector)(void) =
|
||||
(cEdithEditorCOMDirector * (__stdcall *)(void)) GetProcAddress(dllmodule, "GZDllGetGZCOMDirector");
|
||||
if(GZDllGetGZCOMDirector == NULL){
|
||||
printf("TSOEdithEditor: Error: Failed to find GZDllGetGZCOMDirector() in TSOEdithEditorD.dll.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("TSOEdithEditor: Calling GZDllGetGZCOMDirector() ...\n");
|
||||
cEdithEditorCOMDirector * Edith = GZDllGetGZCOMDirector();
|
||||
printf("TSOEdithEditor: Finished calling GZDllGetGZCOMDirector().\nThe value returned was: %p.\n", (void *) Edith);
|
||||
|
||||
while(true){
|
||||
char buffer[8];
|
||||
printf("\nCall a function (0, 1, 2, ...) or q to exit. ");
|
||||
fgets(buffer, 8, stdin);
|
||||
if(buffer[0] == 'q') break;
|
||||
Edith->Object1.vtable5[atoi(buffer)]();
|
||||
}
|
||||
|
||||
printf("TSOEdithEditor: Exiting.\n");
|
||||
FreeLibrary(dllmodule);
|
||||
return 0;
|
||||
}
|
68
Tools/TSOSimulatorClient/TSOEdithEditor/TSOEdithEditor.hpp
Normal file
68
Tools/TSOSimulatorClient/TSOEdithEditor/TSOEdithEditor.hpp
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
TSOEdithEditor - TSOEdithEditorD.dll injector
|
||||
TSOEdithEditor.hpp - Copyright (c) 2012 Fatbag <X-Fi6@phppoll.org>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <basetyps.h>
|
||||
#pragma pack(0)
|
||||
|
||||
DECLARE_INTERFACE(cUnknownObject1)
|
||||
{
|
||||
DWORD Zero1;
|
||||
DWORD Zero2;
|
||||
void * vtable5;
|
||||
char ** Strings1;
|
||||
char ** Strings2;
|
||||
char ** Strings3;
|
||||
DWORD Zero3;
|
||||
DWORD Zero4;
|
||||
DWORD Zero5;
|
||||
void ** Pointer1; //12 bytes
|
||||
void ** Pointer2; //4 bytes
|
||||
void ** Pointer3;
|
||||
DWORD Flags;
|
||||
DWORD * Pointer4; //4 bytes
|
||||
void * Pointer5;
|
||||
void * Pointer6;
|
||||
DWORD Unknown11;
|
||||
DWORD Unknown12;
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE(cEdithEditorCOMDirector)
|
||||
{
|
||||
void * vtable2;
|
||||
void * vtable1;
|
||||
cUnknownObject1 Object1;
|
||||
void * vtable4;
|
||||
void * vtable3;
|
||||
cUnknownObject1 Object2;
|
||||
cUnknownObject1 Object3;
|
||||
|
||||
DWORD Zero1;
|
||||
DWORD Zero2;
|
||||
DWORD Zero3;
|
||||
DWORD Zero4;
|
||||
DWORD Zero5;
|
||||
DWORD Zero6;
|
||||
DWORD Zero7;
|
||||
DWORD Zero8;
|
||||
DWORD Zero9;
|
||||
DWORD Zero10;
|
||||
DWORD Unknown1;
|
||||
DWORD Pointer1;
|
||||
DWORD Pointer2;
|
||||
DWORD Zero11;
|
||||
};
|
1
Tools/TSOSimulatorClient/TSOEdithEditor/compile.bat
Normal file
1
Tools/TSOSimulatorClient/TSOEdithEditor/compile.bat
Normal file
|
@ -0,0 +1 @@
|
|||
gcc -Wall -Wextra -Wabi -pedantic -m32 -o TSOEdithEditor.exe TSOEdithEditor.cpp -mconsole
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TSOSimulatorClient - TSOSimulatorClientD.dll injector
|
||||
iff2html.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
TSOSimulatorClient.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -27,15 +27,15 @@ int main(){
|
|||
return -1;
|
||||
}
|
||||
|
||||
GZCOMDirector * (__stdcall *GZDllGetGZCOMDirector)(void) =
|
||||
(GZCOMDirector * (__stdcall *)(void)) GetProcAddress(dllmodule, "GZDllGetGZCOMDirector");
|
||||
cTSOSimulatorClientDCOMDirector * (__stdcall *GZDllGetGZCOMDirector)(void) =
|
||||
(cTSOSimulatorClientDCOMDirector * (__stdcall *)(void)) GetProcAddress(dllmodule, "GZDllGetGZCOMDirector");
|
||||
if(GZDllGetGZCOMDirector == NULL){
|
||||
printf("TSOSimulatorClient: Error: Failed to find GZDllGetGZCOMDirector() in TSOSimulatorClientD.dll.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("TSOSimulatorClient: Calling GZDllGetGZCOMDirector() ...\n");
|
||||
GZCOMDirector * Simulator = GZDllGetGZCOMDirector();
|
||||
cTSOSimulatorClientDCOMDirector * Simulator = GZDllGetGZCOMDirector();
|
||||
printf("TSOSimulatorClient: Finished calling GZDllGetGZCOMDirector().\nThe value returned was: %p.\n", (void *) Simulator);
|
||||
|
||||
printf("%s\n%s\n%s\n", Simulator->Object1.Strings1[0], Simulator->Object1.Strings2[0], Simulator->Object1.Strings3[0]);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
TSOSimulatorClient - TSOSimulatorClientD.dll injector
|
||||
TSOSimulatorClient.hpp - Copyright (c) 2012 Fatbag <X-Fi6@phppoll.org>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -17,7 +19,7 @@
|
|||
#include <basetyps.h>
|
||||
#pragma pack(0)
|
||||
|
||||
DECLARE_INTERFACE(UnknownObject1_t)
|
||||
DECLARE_INTERFACE(cUnknownObject1)
|
||||
{
|
||||
DWORD Zero1;
|
||||
DWORD Zero2;
|
||||
|
@ -39,15 +41,15 @@ DECLARE_INTERFACE(UnknownObject1_t)
|
|||
DWORD Unknown12;
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE(GZCOMDirector)
|
||||
DECLARE_INTERFACE(cTSOSimulatorClientDCOMDirector)
|
||||
{
|
||||
void * vtable2;
|
||||
void * vtable1;
|
||||
UnknownObject1_t Object1;
|
||||
cUnknownObject1 Object1;
|
||||
void * vtable4;
|
||||
void * vtable3;
|
||||
UnknownObject1_t Object2;
|
||||
UnknownObject1_t Object3;
|
||||
cUnknownObject1 Object2;
|
||||
cUnknownObject1 Object3;
|
||||
|
||||
DWORD Zero1;
|
||||
DWORD Zero2;
|
||||
|
|
|
@ -9,7 +9,7 @@ set(IFF2HTML_SOURCES
|
|||
../../Libraries/FileHandler/bmp/read_bmp.c
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR} ${LIBPNG_INCLUDE_DIR})
|
||||
|
||||
add_executable(iff2html ${IFF2HTML_SOURCES})
|
||||
target_link_libraries(iff2html iff_static libpng_static zlib_static m)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <iff/iff.h>
|
||||
#include <bmp/read_bmp.h>
|
||||
#include <setjmp.h>
|
||||
#include <libpng/png.h>
|
||||
#include <png.h>
|
||||
#include "opngreduc.h"
|
||||
|
||||
int WritePNG(const char * OutName, const IFFChunk * ChunkData, int ZBuffer,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef OPNGREDUC_H
|
||||
#define OPNGREDUC_H
|
||||
|
||||
#include <libpng/png.h>
|
||||
#include <png.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
1
Tools/inputtest/Readme.txt
Normal file
1
Tools/inputtest/Readme.txt
Normal file
|
@ -0,0 +1 @@
|
|||
This is for testing Windows input messages, at the moment.
|
1
Tools/inputtest/compile.bat
Normal file
1
Tools/inputtest/compile.bat
Normal file
|
@ -0,0 +1 @@
|
|||
gcc -Wall -Wextra -Wabi -pedantic -m32 -o inputtest.exe inputtest.cpp -mconsole
|
96
Tools/inputtest/inputtest.cpp
Normal file
96
Tools/inputtest/inputtest.cpp
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
inputtest - Windows input testing
|
||||
inputtest.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
|
||||
switch(uMsg){
|
||||
|
||||
case WM_KEYDOWN:
|
||||
printf("[WM_KEYDOWN] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_KEYUP:
|
||||
printf("[WM_KEYUP] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_CHAR:
|
||||
printf("[WM_CHAR] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_DEADCHAR:
|
||||
printf("[WM_DEADCHAR] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_SYSKEYDOWN:
|
||||
printf("[WM_SYSKEYDOWN] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_SYSKEYUP:
|
||||
printf("[WM_SYSKEYUP] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_SYSDEADCHAR:
|
||||
printf("[WM_SYSDEADCHAR] key = %u, lParam = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_HOTKEY:
|
||||
printf("[WM_HOTKEY] keys1 = %u, keys2 = %lu\n", wParam, lParam);
|
||||
return 0;
|
||||
case WM_APPCOMMAND:
|
||||
printf("[WM_APPCOMMAND] cmd = %u, device = %u, keys = %u\n", GET_APPCOMMAND_LPARAM(lParam), GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam));
|
||||
return 0;
|
||||
|
||||
case WM_CLOSE:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
printf("Received message %u with wParam = %u, lParam = %lu\n", uMsg, wParam, lParam);
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
const WNDCLASS wc = {
|
||||
0, //style
|
||||
WndProc, //lpfnWndProc
|
||||
0, //cbClsExtra
|
||||
0, //cbWndExtra
|
||||
hInstance, //hInstance
|
||||
(HICON) LoadImage(NULL, IDI_APPLICATION, //hIcon
|
||||
IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE),
|
||||
(HCURSOR) LoadImage(NULL, IDC_ARROW, //hCursor
|
||||
IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE),
|
||||
(HBRUSH) COLOR_WINDOW, //hbrBackground
|
||||
NULL, //lpszMenuName
|
||||
"INPUTTEST" //lpszClassName
|
||||
};
|
||||
|
||||
RegisterClass(&wc);
|
||||
|
||||
// Create the main window.
|
||||
const HWND hWnd = CreateWindowEx(WS_EX_APPWINDOW, "INPUTTEST", "Input test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, 0, 0, hInstance, NULL);
|
||||
|
||||
SetForegroundWindow(hWnd);
|
||||
SetFocus(hWnd);
|
||||
|
||||
MSG msg;
|
||||
while(GetMessage(&msg, NULL, 0, 0)){
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -7,7 +7,7 @@ set(TSOSCAN_SOURCES
|
|||
stats.c
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR})
|
||||
|
||||
add_executable(tsoscan ${TSOSCAN_SOURCES})
|
||||
target_link_libraries(tsoscan iff_static)
|
1
update-libraries.bat
Normal file
1
update-libraries.bat
Normal file
|
@ -0,0 +1 @@
|
|||
mkdir _deps 2>NUL & mingw32-make -C _deps -f ../update-libraries.mk CMD=1
|
12
update-libraries.mk
Normal file
12
update-libraries.mk
Normal file
|
@ -0,0 +1,12 @@
|
|||
LIBS = freetype libjpeg-turbo libmpg123 libpng libpq zlib
|
||||
all: .PHONY ../_deps/$(LIBS)
|
||||
.PHONY: $(LIBS)
|
||||
wget -N http://niotso.org/pub/environment/windows/lib/$<.tar.xz
|
||||
../_deps/%: %.tar.xz
|
||||
ifdef CMD
|
||||
del /F /S /Q "$@"
|
||||
else
|
||||
rm -rf "$@/*"
|
||||
endif
|
||||
xzdec $< | tar -x
|
||||
echo . > "$@/temp"
|
1
update-libraries.sh
Normal file
1
update-libraries.sh
Normal file
|
@ -0,0 +1 @@
|
|||
mkdir _deps; make -C _deps -f ../update-libraries.mk
|
Loading…
Add table
Reference in a new issue