Changeset 875 for Daodan/src


Ignore:
Timestamp:
May 28, 2013, 1:23:10 AM (12 years ago)
Author:
alloc
Message:

Daodan: Patches changes (ShowNames patch, Flatline related patches)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Daodan/src/patches/Patches.c

    r847 r875  
    7676        return result;
    7777}
     78
     79
     80int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)
     81{
     82        //flags = (1 << 10);
     83        type = 1;
     84        //DDrPatch_Byte( 0x005EB83C + 3, 0xff );
     85        DDrPatch_Int32((int*)(OniExe + 0x001EB83C), 0xFF000000 );
     86        return M3rTextureMap_New(width, height, type, allocated, flags, name, output);
     87}
     88
     89short FLrHook_DebugNameShadeHack( Character* Char )
     90{
     91        return TSrContext_SetShade(*(void**)(OniExe + 0x001EB844), ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth ));
     92        //return TSrContext_SetShade(*(void**)0x005EB844, 0xFFFFFFFF);
     93}
     94
    7895
    7996// Disable UUrPlatform_Initalize/Terminate, this enables the Alt-Tab and the
     
    418435}
    419436
     437//Fix crappy ai2_shownames
     438void DD_Patch_ShowNames()
     439{
     440        //Set distance above head to 4.0
     441        DDrPatch_Int32((int*)(OniExe + 0x0008C998), 0x005296C8);
     442        //texture height
     443        DDrPatch_Byte((char*)(OniExe + 0x0008C9DF), 0x3F );
     444        //texture       width
     445        DDrPatch_NOOP((char*)(OniExe + 0x0008C9CA), 6 );
     446
     447/*
     448// Crashes game.
     449        //Set the text color to whatever we like ;)
     450        DDrPatch_NOOP((char*)(OniExe + 0x0008C898), 6 );
     451        DDrPatch_Byte((char*)(OniExe + 0x0008C898), 0x8B );
     452        DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE );
     453
     454        DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack);
     455       
     456        //Make the background black for additive blending
     457        DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit );
     458*/
     459}
     460
    420461bool DD_Patch_Init()
    421462{
     
    520561        DD_Patch_PrintWarning();
    521562
    522         //Fix crappy ai2_shownames
    523         if(1)
    524         {
    525                 //Set distance above head to 4.0
    526                 DDrPatch_Int32((int*)(OniExe + 0x0008C998), 0x005296C8);
    527                 //texture height
    528                 DDrPatch_Byte((char*)(OniExe + 0x0008C9DF), 0x3F );
    529                 //texture       width
    530                 DDrPatch_NOOP((char*)(OniExe + 0x0008C9CA), 6 );
    531 /* Crashes game. Perhaps only valid with the additional FLr-callhooks? Those
    532    didn't exist in source though.
    533                 //Set the text color to whatever we like ;)
    534                 DDrPatch_NOOP((char*)(OniExe + 0x0008C898), 6 );
    535                 DDrPatch_Byte((char*)(OniExe + 0x0008C898), 0x8B );
    536                 DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE );
    537 */
    538 //FLATLINE?             DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack);
    539                
    540                 //Make the background black for additive blending
    541 //FLATLINE?             DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit );
    542         }
     563        DD_Patch_ShowNames();
    543564
    544565        if(1)
Note: See TracChangeset for help on using the changeset viewer.