Changeset 447


Ignore:
Timestamp:
Jul 21, 2009, 5:33:07 AM (12 years ago)
Author:
rossy
Message:

widescreen patch

Location:
Daodan
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Daodan/src/Daodan.c

    r445 r447  
    4747bool patch_windowhack = true;
    4848bool patch_daodaninit = true;
     49bool patch_bsl = true;
    4950
    5051bool opt_usedaodanbsl = true;
     
    241242                        else if (!stricmp(name, "daodaninit"))
    242243                                patch_daodaninit = !stricmp(value, "true");
     244                        else if (!stricmp(name, "bsl"))
     245                                patch_bsl = !stricmp(value, "true");
    243246                        else
    244247                                DDrStartupMessage("unrecognised patch \"%s\"", name);
     
    427430                DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init);
    428431       
     432        // Patches for existing BSL functions
     433        if (patch_bsl)
     434                SLrDaodan_Patch();
     435       
    429436        init_daodan_gl();
    430437       
  • Daodan/src/Daodan_BSL.c

    r446 r447  
    55#include "Daodan_BSL.h"
    66#include "Daodan_Utility.h"
     7#include "Daodan_Patch.h"
    78#include "Daodan_Console.h"
    89#include "BFW_ScriptLang.h"
    910#include "Oni.h"
    1011#include "Oni_Character.h"
     12#include "oni_gl.h"
    1113#include "dSFMT\dSFMT.h"
    1214#include "Daodan_Character.h"
     
    343345}
    344346
     347// Widescreen patch for talking heads.
     348uint16_t ONICALL cinematic_start_patch(sl_callinfo* callinfo, unsigned int numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
     349{
     350        args[1].value_int32 = (double)args[1].value_int32 / (double)(gl->DisplayMode.Width) * (4.0 / 3.0 * (double)(gl->DisplayMode.Height));
     351        return ((sl_func)(OniExe + 0x000f3830))(callinfo, numargs, args, dontuse1, dontuse2, ret);
     352}
     353
    345354void SLrDaodan_Initalize()
    346355{
     
    365374       
    366375        SLrScript_Command_Register_ReturnType("sprintf", "C-style sprintf.", "format:string arg1 arg2 ...", sl_str32, bsl_sprintf);
    367 
    368376        SLrScript_Command_Register_ReturnType("dprintcolor", "prints to console in color", "text:string [color: r b g] [color: r b g]", sl_void, bsl_dprintcolored);
    369377}
     378
     379void SLrDaodan_Patch()
     380{
     381        DDrPatch_Int32(OniExe + 0x000f3755, (int)cinematic_start_patch);
     382}
  • Daodan/src/Daodan_BSL.h

    r439 r447  
    66
    77void SLrDaodan_Initalize();
     8void SLrDaodan_Patch();
    89
    910#endif
Note: See TracChangeset for help on using the changeset viewer.