Changeset 877


Ignore:
Timestamp:
Jun 2, 2013, 1:25:34 PM (11 years ago)
Author:
alloc
Message:

Daodan: Moved flatline to subfolder, flatline enabled through patch "flatline"

Location:
Daodan
Files:
1 added
5 edited
24 moved

Legend:

Unmodified
Added
Removed
  • Daodan/makefile

    r876 r877  
     1FOLDERS = patches flatline
     2FILES = Daodan.c Daodan_BSL.c Daodan_Character.c Daodan_Cheater.c Daodan_Config.c Daodan_Console.c Daodan_GL.c Daodan_Patch.c Daodan_Persistence.c Daodan_Utility.c Daodan_Win32.c Inifile_Reader.c _DLLInfo.rc patches/Patches.c flatline/Flatline.c flatline/Flatline_BSL.c flatline/Flatline_Client.c flatline/Flatline_Hooks.c flatline/Flatline_Net.c flatline/Flatline_Packet.c flatline/Flatline_PacketReader.c flatline/Flatline_PacketBuilder.c flatline/Flatline_Server.c flatline/Flatline_Win32.c flatline/Mariusnet.c flatline/Flatline_Events.c
     3
     4DEF =
     5GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter $(addprefix -D,$(DEF))
     6LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
     7LOCALE = LC_MESSAGES=C
     8
     9#LIBS = -lwinmm -lopengl32
     10LIBS = -lgdi32 -lwsock32
     11OBJS = src/binkw32.def
     12OUT = build/binkw32.dll
     13
     14
     15###################################################
     16#                                                 #
     17# Should not be required to change anything below #
     18#                                                 #
     19###################################################
     20
    121UNAME := $(shell uname -s)
    222ifeq ("Linux","$(UNAME)")
     
    828endif
    929
    10 DEF = NOFLATLINE
    11 GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter -D $(DEF)
    12 LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
    13 LOCALE = LC_MESSAGES=C
    14 
    15 #LIBS = -lwinmm -lopengl32 -lgdi32
    16 LIBS = -lgdi32 -lwsock32
    17 OBJS = src/binkw32.def
    18 OUT = build/binkw32.dll
    19 
    20 FOLDERS = patches
    21 SRC = src/Daodan.c src/Daodan_BSL.c src/Daodan_Character.c src/Daodan_Cheater.c src/Daodan_Config.c src/Daodan_Console.c src/Daodan_GL.c src/Daodan_Patch.c src/Daodan_Persistence.c src/Daodan_Utility.c src/Daodan_Win32.c src/Inifile_Reader.c src/_DLLInfo.rc src/patches/Patches.c src/Flatline.c src/Flatline_BSL.c src/Flatline_Client.c src/Flatline_Hooks.c src/Flatline_Net.c src/Flatline_Packet.c src/Flatline_PacketReader.c src/Flatline_PacketBuilder.c src/Flatline_Server.c src/Flatline_Win32.c src/Mariusnet.c  src/Flatline_Events.c
     30DESTFOLDERS = $(addprefix build/,$(FOLDERS))
     31SRC = $(addprefix src/,$(FILES))
    2232DEST = $(patsubst src/%.rc,build/%.o,$(patsubst src/%.c,build/%.o,$(SRC)))
    2333
    24 
    25 ALL: $(FOLDERS) $(DEST) $(OBJS)
     34ALL: $(DESTFOLDERS) $(DEST) $(OBJS)
    2635        @echo "Linking"
    2736        $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS)
     
    2938clean:
    3039        rm $(DEST)
    31         rm -R $(FOLDERS)
     40        rm -R $(DESTFOLDERS)
    3241        rm $(OUT)
    3342
    34 $(FOLDERS):
    35         mkdir -p build/$@
     43$(DESTFOLDERS):
     44        mkdir -p $@
    3645
    3746build/%.o: src/%.c
  • Daodan/src/Daodan_BSL.c

    r876 r877  
    821821}
    822822
    823 extern void SLrFlatline_Initialize();
    824 
    825823void SLrDaodan_Initialize()
    826824{
     
    859857        SLrScript_Command_Register_ReturnType("st", "Prints to console in color", "", sl_void, bsl_dprintcolored);
    860858        SLrScript_Command_Register_ReturnType("d_dprint", "Prints to console in color", "", sl_void, bsl_dprintcolored);
    861 
    862 #ifdef FLATLINE
    863         SLrFlatline_Initialize();
    864 #endif
    865859}
    866860
  • Daodan/src/Daodan_Config.c

    r843 r877  
    2121bool patch_cooldowntimer = true;
    2222bool patch_daodandisplayenum = true;
    23 bool patch_daodaninit = true;
    2423bool patch_directinput = true;
    2524bool patch_disablecmdline = true;
     25bool patch_flatline = true;
    2626bool patch_fonttexturecache = true;
    2727bool patch_getcmdline = true;
     
    120120                        else if (!_stricmp(name, "daodandisplayenum"))
    121121                                patch_daodandisplayenum = !_stricmp(inifile_cleanstr(value), "true");
    122                         else if (!_stricmp(name, "daodaninit"))
    123                                 patch_daodaninit = !_stricmp(inifile_cleanstr(value), "true");
    124122                        else if (!_stricmp(name, "directinput"))
    125123                                patch_directinput = !_stricmp(inifile_cleanstr(value), "true");
    126124                        else if (!_stricmp(name, "disablecmdline"))
    127125                                patch_disablecmdline = !_stricmp(inifile_cleanstr(value), "true");
     126                        else if (!_stricmp(name, "flatline"))
     127                                patch_flatline = !_stricmp(inifile_cleanstr(value), "true");
    128128                        else if (!_stricmp(name, "fonttexturecache"))
    129129                                patch_fonttexturecache = !_stricmp(inifile_cleanstr(value), "true");
     
    304304                {
    305305                        fputs("[Options]\n", fp);
     306                        fputs("[Patch]\n", fp);
     307                        fputs("[BSL]\n", fp);
     308                        fputs("[Language]\n", fp);
    306309                        fclose(fp);
    307310                }
  • Daodan/src/Daodan_Config.h

    r843 r877  
    1616extern bool patch_cooldowntimer;
    1717extern bool patch_daodandisplayenum;
    18 extern bool patch_daodaninit;
    1918extern bool patch_directinput;
    2019extern bool patch_disablecmdline;
     20extern bool patch_flatline;
    2121extern bool patch_fonttexturecache;
    2222extern bool patch_getcmdline;
  • Daodan/src/flatline/Flatline.c

    r876 r877  
    11#include "Flatline.h"
    2 #include "Oni_Character.h"
    3 #include "Oni_Gamestate.h"
    4 #include "Oni_Symbols.h"
     2#include "../Oni_Character.h"
     3#include "../Oni_GameState.h"
     4#include "../Oni_Symbols.h"
    55#include "Flatline_Client.h"
    66#include "Flatline_Server.h"
    77#include "Flatline_Events.h"
    8 #include "Daodan_Utility.h"
    9 #include <Windows.h>
     8#include "../Daodan_Utility.h"
     9#include <windows.h>
    1010//#include <sys/time.h>
    1111#include <time.h>
    1212#include <float.h>
     13
    1314#define isnan(x) ((x) != (x))
     15
    1416uint32_t last1 = 0; uint32_t last2 = 0;
    1517player_info Players[MAX_PLAYERS] = {{0}, {0}, {0}, {0}};
  • Daodan/src/flatline/Flatline.h

    r876 r877  
    1 #pragma once
    21#ifndef FLATLINE_H
    32#define FLATLINE_H
     
    1716#include <winsock2.h>
    1817#include "Flatline_Win32.h"
    19 #else
    20 #include <sys/ioctl.h>
    21 #include <sys/types.h>
    22 #include <sys/socket.h>
    23 #include <unistd.h>
    24 #include <stropts.h>
    25 #include <arpa/inet.h>
    26 #include <netinet/in.h>
    27 
    28 #define NetPlatform_Initalize() /* */
    29 #define NetPlatform_Shutdown() /* */
    30 #define closesocket close
    31 #define ioctlsocket ioctl
    32 #endif
    33 
    34 #include "Daodan.h"
    35 #include "BFW_Utility.h"
    36 #include "Daodan_Console.h"
    37 #include "Oni_Character.h"
    38 #include "Oni_Gamestate.h"
     18
     19#include "../Daodan.h"
     20#include "../BFW_Utility.h"
     21#include "../Daodan_Console.h"
     22#include "../Oni_Character.h"
     23#include "../Oni_GameState.h"
    3924#include "Flatline_Packet.h"
    4025
    41 #include "Oni_Symbols.h"
     26#include "../Oni_Symbols.h"
    4227//#define breakpoint asm("int3")
    4328
     
    307292
    308293#define FLATLINE_PORT 27778
     294
     295#endif
  • Daodan/src/flatline/Flatline_BSL.c

    r876 r877  
    11#include <winsock2.h>
    2 #include "BFW_ScriptLang.h"
    3 
    4 #include "Daodan_Patch.h"
    5 #include "Daodan_BSL.h"
     2#include "../BFW_ScriptLang.h"
     3
     4#include "../Daodan_Patch.h"
     5#include "../Daodan_BSL.h"
    66#include "Flatline_BSL.h"
    77#include "Flatline.h"
     
    99#include "Mariusnet_Public.h"
    1010#include "Flatline_Client.h"
     11
    1112unsigned char server_started = 0;
    1213unsigned char client_connected = 0;
     
    1617char player_country[256] = {0};
    1718int update_rate = 5;
    18 #include "Oni.h"
    19 #include "Daodan_Cheater.h"
     19
     20#include "../Oni.h"
     21#include "../Daodan_Cheater.h"
     22
    2023uint16_t ONICALL start_server(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret)
    2124{
  • Daodan/src/flatline/Flatline_BSL.h

    r876 r877  
    11#ifndef FLATLINE_BSL_H
    22#define FLATLINE_BSL_H
    3 #include "Daodan.h"
     3#include "../Daodan.h"
    44void SLrFlatline_Initialize();
    55uint16_t ONICALL FLrSpawnHack(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
  • Daodan/src/flatline/Flatline_Hooks.c

    r876 r877  
    3232}
    3333
    34 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)
    35 {
    36         //flags = (1 << 10);
    37         type = 1;
    38         //DDrPatch_Byte( 0x005EB83C + 3, 0xff );
    39         DDrPatch_Int32( 0x005EB83C, 0xFF000000 );
    40         return M3rTextureMap_New(width, height, type, allocated, flags, name, output);
    41 }
    42 
    43 short FLrHook_DebugNameShadeHack( Character* Char )
    44 {
    45        
    46         return TSrContext_SetShade(*(void**)0x005EB844, ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth ));
    47         //return TSrContext_SetShade(*(void**)0x005EB844, 0xFFFFFFFF);
    48 }
    4934/*
    5035void FLrHook_Lasers( Character* PlayerChar )
  • Daodan/src/flatline/Flatline_Hooks.h

    r876 r877  
    1 #include "Oni.h"
     1#ifndef FLATLINE_HOOKS_H
     2#define FLATLINE_HOOKS_H
     3
     4#include "../Oni.h"
    25char * FLrHook_DoorOpen( DoorObject *Door, Character *Char);
    36short FLrHook_ConsoleActivate( void *inObject, Character *inCharacter );
    4 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output);
    5 short FLrHook_DebugNameShadeHack( Character* Char );
    67void FLrHook_Lasers( Character* PlayerChar );
     8
     9#endif
  • Daodan/src/flatline/Flatline_Net.c

    r876 r877  
     1#include "Flatline_Net.h"
    12#include "Flatline.h"
    23#include "Flatline_Server.h"
  • Daodan/src/flatline/Flatline_Net.h

    r876 r877  
    11#ifndef FLATLINE_NET_H
    22#define FLATLINE_NET_H
     3
     4#include "stdint.h"
    35
    46#define pad1_size (sizeof(int64_t) - sizeof(short))
  • Daodan/src/flatline/Flatline_PacketBuilder.c

    r876 r877  
    11#include "Flatline.h"
    2 #include "Oni_Symbols.h"
     2#include "../Oni_Symbols.h"
    33#include <assert.h>
    44
  • Daodan/src/flatline/Flatline_Server.c

    r876 r877  
    11#include "Flatline.h"
    22#include "Flatline_Server.h"
    3 #include <Windows.h>
     3#include <windows.h>
    44//#include "PortForwardWrapper.h"
    55#include "Mariusnet_Public.h"
  • Daodan/src/flatline/Flatline_Win32.h

    r876 r877  
    1 #pragma once
     1#ifndef FLATLINE_WIN32_H
     2#define FLATLINE_WIN32_H
    23
    34unsigned char NetPlatform_Initalize();
    45unsigned char NetPlatform_Shutdown();
     6
     7#endif
  • Daodan/src/flatline/Mariusnet.c

    r876 r877  
    66#include "Flatline_Client.h"
    77#include "Mariusnet_Defs.h"
    8 #include "Daodan_Console.h"
    9 #include "Oni_Symbols.h"
     8#include "../Daodan_Console.h"
     9#include "../Oni_Symbols.h"
    1010#include <stdio.h>
    1111
  • Daodan/src/flatline/Mariusnet_Defs.h

    r876 r877  
     1#ifndef MARIUSNET_DEFS_H
     2#define MARIUSNET_DEFS_H
     3
    14//to client
    25#include "Mariusnet_Public.h"
     
    215218        };
    216219} marius_packet;
     220
     221#endif
  • Daodan/src/patches/Patches.c

    r876 r877  
    1010#include "../Daodan_Utility.h"
    1111#include "../Daodan_Win32.h"
    12 #ifdef FLATLINE
    13 #include "../Flatline_BSL.h"
    14 #include "../Flatline_Hooks.h"
    15 #endif
     12#include "../flatline/Flatline_BSL.h"
     13#include "../flatline/Flatline_Hooks.h"
    1614#include "../Oni.h"
    1715
     
    4442        if (opt_usedaodanbsl)
    4543                SLrDaodan_Initialize();
     44        if (patch_flatline)
     45                SLrFlatline_Initialize();
    4646}
    4747
     
    8181
    8282
    83 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)
     83int DD_Patch_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)
    8484{
    8585        //flags = (1 << 10);
     
    9090}
    9191
    92 short FLrHook_DebugNameShadeHack( Character* Char )
     92short DD_Patch_DebugNameShadeHack( Character* Char )
    9393{
    9494        return TSrContext_SetShade(*(void**)(OniExe + 0x001EB844), ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth ));
     
    244244}
    245245
     246// Enable flatline multiplayer code
     247void DD_Patch_Flatline()
     248{
     249        DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 );
     250        DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers );
     251
     252       
     253        //Flatline related stuff
     254        DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook);
     255       
     256        DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack);
     257
     258        DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6);
     259
     260        DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen);
     261        DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate);
     262}
     263
    246264// Font texture cache doubled
    247265void DD_Patch_FontTextureCache()
     
    455473        DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE );
    456474
    457         DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack);
     475        DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), DD_Patch_DebugNameShadeHack);
    458476       
    459477        //Make the background black for additive blending
    460         DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit );
     478        DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), DD_Patch_DebugNameTextureInit );
    461479*/
    462480}
     
    499517                DD_Patch_DaodanDisplayEnum();
    500518       
    501         if (patch_daodaninit)
    502                 DD_Patch_DaodanInit();
    503        
    504519        if (patch_directinput)
    505520                DD_Patch_DirectInput();
     
    560575
    561576
     577        DD_Patch_DaodanInit();
     578       
    562579        DD_Patch_GammaSlider();
    563580
     
    567584        DD_Patch_ShowNames();
    568585
    569 #ifdef FLATLINE
    570         DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 );
    571         DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers );
    572        
    573 
    574 
    575         //Flatline related stuff
    576         DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook);
    577        
    578         DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack);
    579 
    580         DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6);
    581 
    582         DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen);
    583         DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate);
    584 #endif
     586        if (patch_flatline)
     587                DD_Patch_Flatline();
    585588
    586589        return true;
Note: See TracChangeset for help on using the changeset viewer.