mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-04-28 13:07:59 +03:00
Merge remote-tracking branch 'origin/ph3nom/miami' into skmp/miami-col-repack-with-ph3nom
This commit is contained in:
commit
f2dbe73304
22 changed files with 571 additions and 354 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -386,6 +386,7 @@ dreamcast/extract-sfx*
|
|||
dreamcast/pack-sfx*
|
||||
dreamcast/analyze-profile*
|
||||
dreamcast/aud2adpcm*
|
||||
dreamcast/adf2mp3*
|
||||
dreamcast/repack-data
|
||||
dreamcast/output.map
|
||||
dreamcast/dca3.ds.iso
|
||||
|
|
|
@ -41,6 +41,9 @@ MKDCDISC_PAD_OPTION=-N
|
|||
ifeq ($(FOR_DISC),1)
|
||||
AUDIO_STREAM_OPTION=-q
|
||||
MKDCDISC_PAD_OPTION=
|
||||
else ifeq ($(FOR_DISC),2)
|
||||
AUDIO_STREAM_OPTION=-m
|
||||
MKDCDISC_PAD_OPTION=
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
|
|
@ -558,6 +558,7 @@ void usage() {
|
|||
printf("based on wav2adpcm: 16bit mono wav to aica adpcm and vice-versa (c)2002 BERO\n"
|
||||
" wav2adpcm -q <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
||||
" wav2adpcm -t <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm long stream)\n"
|
||||
" wav2adpcm -m <infile.wav/mp3/ima adpcm> <outfile.wav> (To adpcm MONO long stream)\n"
|
||||
" wav2adpcm -raw <infile.wav/mp3/ima adpcm> <outfile.raw> (To adpcm sfx)\n"
|
||||
"\n"
|
||||
"If you are having trouble with your input wav file you can run it"
|
||||
|
@ -571,8 +572,10 @@ int main(int argc, char **argv) {
|
|||
if (argc == 4) {
|
||||
if (!strcmp(argv[1], "-t")) {
|
||||
return aud2adpcm(argv[2], argv[3], 1, 0, 0);
|
||||
} else if (!strcmp(argv[1], "-m")) {
|
||||
return aud2adpcm(argv[2], argv[3], 1, 1, 0);
|
||||
} else if (!strcmp(argv[1], "-q")) {
|
||||
return aud2adpcm(argv[2], argv[3], 1, 1, 1);
|
||||
return aud2adpcm(argv[2], argv[3], 1, 1, 1);
|
||||
} else if (!strcmp(argv[1], "-raw")) {
|
||||
return aud2adpcm(argv[2], argv[3], 0, 0, 0);
|
||||
} else {
|
||||
|
|
|
@ -689,6 +689,298 @@ CFileLoader::LoadObjectTypes(const char *filename)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef RW_DC
|
||||
// PH3NOM - I just searched the extracted img folder for the following DFF names:
|
||||
//find . -type f -name "*tree*.dff" ! -name "*shad*"
|
||||
//find . -type f -name "*palm*.dff" ! -name "*shad*"
|
||||
//find . -type f -name "*fence*.dff" ! -name "*shad*"
|
||||
//find . -type f -name "*bush*.dff" ! -name "*shad*"
|
||||
//find . -type f -name "*rail*.dff" ! -name "*shad*"
|
||||
//find . -type f -name "*veg*.dff" ! -name "*shad*"
|
||||
char *AlphaTestNames[] = {
|
||||
"xpolytrees2_dt",
|
||||
"gf_treesfw3_01",
|
||||
"ci_trees05",
|
||||
"xpolytrees3_dt",
|
||||
"LODrtrees5",
|
||||
"LODrtrees2",
|
||||
"nbt_mansiontrees04",
|
||||
"malltreereflect2",
|
||||
"veg_treeb1",
|
||||
"LODrtrees4",
|
||||
"Streetlamp2",
|
||||
"nbt_mansiontrees02",
|
||||
"LODmrgtrees4",
|
||||
"gf_tree2_02",
|
||||
"malltreereflect",
|
||||
"nbt_hoteltrees02",
|
||||
"veg_treea1",
|
||||
"Streetlamp1",
|
||||
"gf_treesfw5_01",
|
||||
"nbt_mansiontrees05",
|
||||
"malltrees01",
|
||||
"xpolytrees4_dt",
|
||||
"nbt_mansiontrees03",
|
||||
"xpolytrees1_dt",
|
||||
"hoteltrees01",
|
||||
"hoteltrees03",
|
||||
"gf_treesfw1_01",
|
||||
"veg_tree3",
|
||||
"ap_treeshot1_02",
|
||||
"hoteltrees02",
|
||||
"ci_trees03",
|
||||
"veg_treea3",
|
||||
"mc_treesfw3_01",
|
||||
"ap_treesfw1_01",
|
||||
"nbt_hoteltrees01",
|
||||
"ci_trees04",
|
||||
"gf_treesfw2_01",
|
||||
"LODrtrees3",
|
||||
"ci_trees1",
|
||||
"mc_treesfw1_01",
|
||||
"LODrtrees1",
|
||||
"gf_treesfw4_01",
|
||||
"nbt_mansiontrees01",
|
||||
"hoteltrees06",
|
||||
"mn_treesis_int",
|
||||
"hoteltrees05",
|
||||
"mc_treesfw2_01",
|
||||
"gf_tree1_01",
|
||||
"mn_treesisl05",
|
||||
"doublestreetlght1",
|
||||
"ci_trees02",
|
||||
"bank_palms09",
|
||||
"veg_palmkb3",
|
||||
"lw_palm1",
|
||||
"veg_palmkb5",
|
||||
"bank_palms21",
|
||||
"veg_palmkb1",
|
||||
"veg_palmbig14",
|
||||
"veg_palmkb14",
|
||||
"veg_palm02",
|
||||
"veg_palmkb2",
|
||||
"veg_palmkb9",
|
||||
"bank_palms28",
|
||||
"veg_palmkb7",
|
||||
"bank_palms23",
|
||||
"bank_palms32",
|
||||
"veg_palmkb8",
|
||||
"bank_palms02",
|
||||
"bank_palms33",
|
||||
"veg_palmkbb11",
|
||||
"veg_palmkb4",
|
||||
"veg_palm01",
|
||||
"veg_palm03",
|
||||
"veg_palmkb13",
|
||||
"veg_palmkb10",
|
||||
"veg_palm04",
|
||||
"gf_tennisfence",
|
||||
"marinafence04",
|
||||
"marinafence01",
|
||||
"b_hse_pierfence",
|
||||
"ap_wallfence5",
|
||||
"dockfence",
|
||||
"dtn_hospital_fence",
|
||||
"mc_fence1",
|
||||
"od_clubfence_dy",
|
||||
"ap_wallfence1",
|
||||
"const_woodfence30",
|
||||
"bb_fence1",
|
||||
"ap_seafences",
|
||||
"marinafence03",
|
||||
"nbthotel08fence02",
|
||||
"dt_sheraton_fence",
|
||||
"dt_scabby_fence04",
|
||||
"nbt_barfence01",
|
||||
"ap_wallfence2",
|
||||
"od_clevelfence",
|
||||
"mc_fence2",
|
||||
"ci_fence2",
|
||||
"dt_scabby_fence03",
|
||||
"mansionfence",
|
||||
"nbt_hotel07fence",
|
||||
"marinafence02",
|
||||
"fence01",
|
||||
"compound_fence",
|
||||
"ap_wallfence7",
|
||||
"fencehaitism",
|
||||
"od_clubfence_nt",
|
||||
"marinafence05",
|
||||
"ap_wallfence6",
|
||||
"Mansion2_C_fence",
|
||||
"dt_scabby_fence07",
|
||||
"kickfence",
|
||||
"pw_backfence1",
|
||||
"mc_fence3",
|
||||
"washfence1",
|
||||
"LODst_woodfence30",
|
||||
"washfence2",
|
||||
"carparkfence0",
|
||||
"ap_wallfence3",
|
||||
"fencesmallb",
|
||||
"ap_wallfence4",
|
||||
"fencehaiti",
|
||||
"stationfence",
|
||||
"dt_scabby_fence01",
|
||||
"pw_bayfence2_01",
|
||||
"lha_carfence",
|
||||
"tall_fence",
|
||||
"ap_seaplanfence1",
|
||||
"LODse_pierfence",
|
||||
"marinaveg3",
|
||||
"ml_vegbits05",
|
||||
"svegrgedoor",
|
||||
"ml_vegbits04",
|
||||
"nrth3veg35",
|
||||
"nrth3veg05",
|
||||
"ht_veg01_nt",
|
||||
"nbeachvegy1",
|
||||
"odnvegbush1",
|
||||
"washvegy4",
|
||||
"ht_veg02_nt",
|
||||
"wshotelveg1",
|
||||
"dtn_veg3",
|
||||
"nrth7veg09",
|
||||
"washvegy238",
|
||||
"veg_palwee02",
|
||||
"nrth3veg50",
|
||||
"washpshoutveg",
|
||||
"nrth4veg08",
|
||||
"washvegy3",
|
||||
"washvegy241",
|
||||
"washvegy2",
|
||||
"washvegy239",
|
||||
"odnvegbush2b",
|
||||
"veg_gaz",
|
||||
"nrth1veg21",
|
||||
"ht_veg04_dy",
|
||||
"ml_vegbits03",
|
||||
"nbeachvegy2",
|
||||
"nrth3veg16",
|
||||
"ht_veg02_dy",
|
||||
"nrth4veg05",
|
||||
"ht_veg04_nt",
|
||||
"veg_palwee01",
|
||||
"ht_veg01_dy",
|
||||
"vegeha1",
|
||||
"veged",
|
||||
"veg_ivy_balcny_kb3",
|
||||
"nrth1veg42",
|
||||
"marinaveg1",
|
||||
"nrth3veg25",
|
||||
"veg_fern_balcny_kb1",
|
||||
"spad_veg1",
|
||||
"washvegy2413",
|
||||
"marinaveg2",
|
||||
"washvegy240",
|
||||
"vegetationb",
|
||||
"nrth1veg37",
|
||||
"ml_vegbits01",
|
||||
"veged01",
|
||||
"dtn_veg4",
|
||||
"washvegy242",
|
||||
"veg_palwee03",
|
||||
"nrth3veg59",
|
||||
"nrth4veg212",
|
||||
"nrth4veg21",
|
||||
"nrth7veg",
|
||||
"washvegy237",
|
||||
"nrth3veg08",
|
||||
"nrth4veg09",
|
||||
"veg_fern_balcny_kb2",
|
||||
"ml_vegbits02",
|
||||
"odnvegbush2",
|
||||
"vegetationb03",
|
||||
"veged02",
|
||||
"kb_planterbox",
|
||||
"plants05b",
|
||||
"nbdecoshplants",
|
||||
"ap_planters2_01",
|
||||
"ml_planterbed",
|
||||
"marinaplanter1",
|
||||
"washskyplant1",
|
||||
"dzplant",
|
||||
"ci_planter2",
|
||||
"ap_planters1_01",
|
||||
"gf_planters4",
|
||||
"washskyplant2",
|
||||
"kb_planter+bush",
|
||||
"marinaplanter2",
|
||||
"ci_planter1",
|
||||
"plants04",
|
||||
"gf_planters2",
|
||||
"kb_planterbush2",
|
||||
"plants01",
|
||||
"kb_planter+bush2",
|
||||
"plants05",
|
||||
"ci_busht_04",
|
||||
"starsbush2",
|
||||
"mansbushes2",
|
||||
"odnvegbush1",
|
||||
"odrv_bushes",
|
||||
"ci_busht_02",
|
||||
"mlmallbush",
|
||||
"mansbushes",
|
||||
"nbw_bush02",
|
||||
"ci_busht_08",
|
||||
"nbw_bush01",
|
||||
"odnvegbush2b",
|
||||
"ap_carbush2_01",
|
||||
"new_bushtest42",
|
||||
"new_bushsm",
|
||||
"mallbushs",
|
||||
"odrv_bushes01",
|
||||
"kb_planter+bush",
|
||||
"ci_busht_06",
|
||||
"beach_bush08s",
|
||||
"beach_bush06s",
|
||||
"new_bushtest",
|
||||
"doontoon66_bushes01",
|
||||
"beach_bush04",
|
||||
"starbitbush",
|
||||
"beach_bush02",
|
||||
"lhavnew_bush",
|
||||
"kb_planterbush2",
|
||||
"ci_busht_11",
|
||||
"odnvegbush2",
|
||||
"kb_planter+bush2",
|
||||
"mallbushdense",
|
||||
"dk_rail06",
|
||||
"cl_railing",
|
||||
"docks10rail",
|
||||
"cl_railingb",
|
||||
"dk_rail05",
|
||||
"shpfrnts03rail01",
|
||||
"dk_rail02",
|
||||
"nbeachbit03rails",
|
||||
"ci_mans1rail",
|
||||
"dk_rail07",
|
||||
"dk_rail01",
|
||||
"ci_mans2rail1",
|
||||
"ci_mans1rail1",
|
||||
"dk_rail04",
|
||||
"shpfrnts03rail02",
|
||||
"dk_rail03",
|
||||
"",
|
||||
};
|
||||
|
||||
static bool
|
||||
MatchModelName(char *name, char **list)
|
||||
{
|
||||
int i;
|
||||
char *s;
|
||||
for(i = 0; *list[i] != '\0'; i++)
|
||||
if(strncmp(name, "LOD", 3) == 0){
|
||||
if(!CGeneral::faststricmp(name+3, list[i]+3))
|
||||
return true;
|
||||
}else{
|
||||
if(!CGeneral::faststricmp(name, list[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
SetModelInfoFlags(CSimpleModelInfo *mi, uint32 flags)
|
||||
{
|
||||
|
@ -703,6 +995,10 @@ SetModelInfoFlags(CSimpleModelInfo *mi, uint32 flags)
|
|||
mi->m_ignoreDrawDist = !!(flags & 0x100);
|
||||
mi->m_isCodeGlass = !!(flags & 0x200);
|
||||
mi->m_isArtistGlass = !!(flags & 0x400);
|
||||
|
||||
#ifdef RW_DC
|
||||
if(MatchModelName(mi->GetModelName(), AlphaTestNames)) mi->m_isAlphaTest = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -497,12 +497,14 @@ CMenuScreenCustom aScreens[] = {
|
|||
{ "FET_LG", MENUPAGE_NEW_GAME, nil, nil,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL1", {nil, SAVESLOT_1, 0}, 40, 90, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL2", {nil, SAVESLOT_2, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
#ifndef RW_DC
|
||||
MENUACTION_CHECKSAVE, "FEM_SL3", {nil, SAVESLOT_3, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL4", {nil, SAVESLOT_4, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL5", {nil, SAVESLOT_5, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL6", {nil, SAVESLOT_6, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL7", {nil, SAVESLOT_7, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL8", {nil, SAVESLOT_8, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
#endif
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 345, MENUALIGN_CENTER,
|
||||
},
|
||||
|
||||
|
@ -510,12 +512,14 @@ CMenuScreenCustom aScreens[] = {
|
|||
{ "FES_DEL", MENUPAGE_NEW_GAME, nil, nil,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL1", {nil, SAVESLOT_1, 0}, 40, 90, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL2", {nil, SAVESLOT_2, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
#ifndef RW_DC
|
||||
MENUACTION_CHECKSAVE, "FEM_SL3", {nil, SAVESLOT_3, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL4", {nil, SAVESLOT_4, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL5", {nil, SAVESLOT_5, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL6", {nil, SAVESLOT_6, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL7", {nil, SAVESLOT_7, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL8", {nil, SAVESLOT_8, 0}, 0, 0, MENUALIGN_LEFT,
|
||||
#endif
|
||||
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 345, MENUALIGN_CENTER,
|
||||
},
|
||||
|
||||
|
@ -551,12 +555,14 @@ CMenuScreenCustom aScreens[] = {
|
|||
{ "FET_SG", MENUPAGE_DISABLED, nil, nil,
|
||||
MENUACTION_SAVEGAME, "FEM_SL1", {nil, SAVESLOT_1, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 40, 90, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL2", {nil, SAVESLOT_2, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
#ifndef RW_DC
|
||||
MENUACTION_SAVEGAME, "FEM_SL3", {nil, SAVESLOT_3, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL4", {nil, SAVESLOT_4, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL5", {nil, SAVESLOT_5, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL6", {nil, SAVESLOT_6, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL7", {nil, SAVESLOT_7, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
MENUACTION_SAVEGAME, "FEM_SL8", {nil, SAVESLOT_8, MENUPAGE_SAVE_OVERWRITE_CONFIRM}, 0, 0, MENUALIGN_LEFT,
|
||||
#endif
|
||||
MENUACTION_RESUME_FROM_SAVEZONE,"FESZ_CA", {nil, SAVESLOT_NONE, 0}, 320, 345, MENUALIGN_CENTER,
|
||||
},
|
||||
|
||||
|
|
|
@ -188,8 +188,8 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
|||
#define SCREEN_HEIGHT ((float)448)
|
||||
#endif
|
||||
#else
|
||||
#define SCREEN_WIDTH ((float)RsGlobal.width)
|
||||
#define SCREEN_HEIGHT ((float)RsGlobal.height)
|
||||
extern float SCREEN_WIDTH;
|
||||
extern float SCREEN_HEIGHT;
|
||||
#endif
|
||||
|
||||
#define SCREEN_HEIGHT_PAL ((float)512)
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
enum Config {
|
||||
NUMPLAYERS = 1,
|
||||
|
||||
NUMCDIMAGES = 6, // gta3.img duplicates (not used on PC)
|
||||
MAX_CDIMAGES = 8, // additional cdimages
|
||||
MAX_CDCHANNELS = 5,
|
||||
NUMCDIMAGES = 1, // default = 6 // gta3.img duplicates (not used on PC)
|
||||
MAX_CDIMAGES = 1, // default = 8 // additional cdimages
|
||||
MAX_CDCHANNELS = 2, // default = 5
|
||||
|
||||
MODELINFOSIZE = 6500, // 4900 on PS2
|
||||
MODELINFOSIZE = 4900, // default = 6500 // 4900 on PS2
|
||||
TXDSTORESIZE = 1385,
|
||||
COLSTORESIZE = 31,
|
||||
EXTRADIRSIZE = 256,
|
||||
|
@ -26,15 +26,15 @@ enum Config {
|
|||
VEHICLEMODELSIZE = 110,
|
||||
TWODFXSIZE = 1210,
|
||||
|
||||
MAXVEHICLESLOADED = 50, // 70 on mobile
|
||||
MAXVEHICLESLOADED = 25, // default = 50 // 70 on mobile
|
||||
|
||||
NUMOBJECTINFO = 210,
|
||||
|
||||
// Pool sizes
|
||||
NUMPTRNODES = 50000,
|
||||
NUMENTRYINFOS = 3200,
|
||||
NUMPEDS = 140,
|
||||
NUMVEHICLES = 110,
|
||||
NUMPTRNODES = 40000, // default = 50000
|
||||
NUMENTRYINFOS = 3200, // default = 3200
|
||||
NUMPEDS = 30, // default = 140
|
||||
NUMVEHICLES = 30, // default = 110
|
||||
NUMBUILDINGS = 7000,
|
||||
NUMTREADABLES = 1,
|
||||
NUMOBJECTS = 460,
|
||||
|
@ -125,8 +125,8 @@ enum Config {
|
|||
NUMROADBLOCKS = 300,
|
||||
NUM_SCRIPT_ROADBLOCKS = 16,
|
||||
|
||||
NUMVISIBLEENTITIES = 2000,
|
||||
NUMINVISIBLEENTITIES = 150,
|
||||
NUMVISIBLEENTITIES = 1000, // default = 2000
|
||||
NUMINVISIBLEENTITIES = 100, // default = 150
|
||||
|
||||
NUM_AUDIOENTITY_EVENTS = 4,
|
||||
NUM_PED_COMMENTS_SLOTS = 20,
|
||||
|
@ -310,8 +310,8 @@ enum Config {
|
|||
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
|
||||
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
|
||||
#define PS2_ALPHA_TEST // emulate ps2 alpha test
|
||||
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
|
||||
//#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
//#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
|
||||
#define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync
|
||||
#define ANISOTROPIC_FILTERING // set all textures to max anisotropic filtering
|
||||
//#define USE_TEXTURE_POOL
|
||||
|
@ -322,7 +322,7 @@ enum Config {
|
|||
// #define NEW_RENDERER // leeds-like world rendering, needs librw
|
||||
#endif
|
||||
|
||||
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
||||
//#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
||||
|
||||
#ifndef EXTENDED_COLOURFILTER
|
||||
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
|
||||
|
@ -373,7 +373,7 @@ enum Config {
|
|||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
|
||||
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
//# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
# define MULTISAMPLING // adds MSAA option
|
||||
# define INVERT_LOOK_FOR_PAD // enable the hidden option
|
||||
|
|
|
@ -30,6 +30,9 @@ public:
|
|||
uint16 m_ignoreDrawDist : 1;
|
||||
uint16 m_isCodeGlass : 1;
|
||||
uint16 m_isArtistGlass : 1;
|
||||
#ifdef RW_DC
|
||||
bool m_isAlphaTest;
|
||||
#endif
|
||||
|
||||
CSimpleModelInfo(void) : CBaseModelInfo(MITYPE_SIMPLE) {}
|
||||
CSimpleModelInfo(ModelInfoType id) : CBaseModelInfo(id) {}
|
||||
|
|
|
@ -125,7 +125,7 @@ CClouds::Render(void)
|
|||
CCoronas::SunBlockedByClouds = false;
|
||||
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
||||
|
|
|
@ -235,6 +235,10 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
|||
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
|
||||
|
||||
if(mi->m_isAlphaTest && !mi->IsClump()) {
|
||||
rw::SetRenderState(rw::ALPHATESTREF, 129);
|
||||
}
|
||||
|
||||
if(e->bDistanceFade){
|
||||
DeActivateDirectional();
|
||||
SetAmbientColours();
|
||||
|
@ -246,6 +250,10 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
|||
}else
|
||||
CRenderer::RenderOneNonRoad(e);
|
||||
|
||||
if(mi->m_isAlphaTest && !mi->IsClump()) {
|
||||
rw::SetRenderState(rw::ALPHATESTREF, 3);
|
||||
}
|
||||
|
||||
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
#include "Timecycle.h"
|
||||
#include "Fluff.h"
|
||||
|
||||
#include "../vmu/vmu.h"
|
||||
|
||||
#define BLOCK_COUNT 22
|
||||
#define SIZE_OF_SIMPLEVARS 0xE4
|
||||
|
||||
|
@ -94,11 +96,10 @@ PopulateRadioStationPositionList()
|
|||
|
||||
#define LoadSaveDataBlock()\
|
||||
do {\
|
||||
if (!ReadDataFromFile(file, (uint8 *) &size, 4))\
|
||||
return false;\
|
||||
size = align4bytes(size);\
|
||||
if (!ReadDataFromFile(file, work_buff, size))\
|
||||
return false;\
|
||||
size = C_PcSave::PcClassLoadRoutine(file, work_buff); \
|
||||
if (!size) {\
|
||||
return false; \
|
||||
} \
|
||||
buf = work_buff;\
|
||||
} while (0)
|
||||
|
||||
|
@ -285,6 +286,7 @@ GenericSave(int file)
|
|||
bool
|
||||
GenericLoad()
|
||||
{
|
||||
printf("GenericLoad\n");
|
||||
uint8 *buf;
|
||||
int32 file;
|
||||
uint32 size;
|
||||
|
@ -299,12 +301,14 @@ GenericLoad()
|
|||
CheckSum = 0;
|
||||
CDate dummy; // unused
|
||||
CPad::ResetCheats();
|
||||
if (!ReadInSizeofSaveFileBuffer(file, size))
|
||||
return false;
|
||||
size = align4bytes(size);
|
||||
ReadDataFromFile(file, work_buff, size);
|
||||
|
||||
file = CFileMgr::OpenFile(LoadFileName, "rb");
|
||||
assert(file != 0);
|
||||
size = C_PcSave::PcClassLoadRoutine(file, work_buff);
|
||||
assert(size != 0);
|
||||
buf = (work_buff + 0x40);
|
||||
ReadDataFromBufferPointer(buf, saveSize);
|
||||
|
||||
#ifdef MISSION_REPLAY // a hack to keep compatibility but get new data from save
|
||||
qs = saveSize >> 24;
|
||||
#endif
|
||||
|
@ -562,13 +566,8 @@ CheckDataNotCorrupt(int32 slot, char *name)
|
|||
strcpy(name, filename);
|
||||
while (SIZE_OF_ONE_GAME_IN_BYTES - sizeof(uint32) > bytes_processed && blocknum < 40) {
|
||||
int32 blocksize;
|
||||
if (!ReadDataFromFile(file, (uint8*)&blocksize, sizeof(blocksize))) {
|
||||
CloseFile(file);
|
||||
return false;
|
||||
}
|
||||
if (blocksize > align4bytes(sizeof(work_buff)))
|
||||
blocksize = sizeof(work_buff) - sizeof(uint32);
|
||||
if (!ReadDataFromFile(file, work_buff, align4bytes(blocksize))) {
|
||||
blocksize = C_PcSave::PcClassLoadRoutine(file, work_buff);
|
||||
if (blocksize == 0) {
|
||||
CloseFile(file);
|
||||
return false;
|
||||
}
|
||||
|
@ -606,14 +605,16 @@ CheckDataNotCorrupt(int32 slot, char *name)
|
|||
bool
|
||||
RestoreForStartLoad()
|
||||
{
|
||||
uint8 buf[999];
|
||||
|
||||
int file = CFileMgr::OpenFile(LoadFileName, "rb");
|
||||
if (file == 0) {
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_OPEN;
|
||||
return false;
|
||||
}
|
||||
ReadDataFromFile(file, buf, sizeof(buf));
|
||||
|
||||
uint32_t size = C_PcSave::PcClassLoadRoutine(file, work_buff);
|
||||
assert(size != 0);
|
||||
uint8 *buf = work_buff;
|
||||
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_READ;
|
||||
if (!CloseFile(file))
|
||||
|
@ -1220,6 +1221,8 @@ void DisplaySaveResult(int unk, char* name)
|
|||
|
||||
bool SaveGameForPause(int type)
|
||||
{
|
||||
//TODO: Fix this for VMU!
|
||||
return true;
|
||||
if (AllowMissionReplay != MISSION_RETRY_STAGE_NORMAL && AllowMissionReplay != MISSION_RETRY_STAGE_WAIT_FOR_TIMER_AFTER_RESTART) {
|
||||
debug("SaveGameForPause failed during AllowMissionReplay %d", AllowMissionReplay);
|
||||
return false;
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
#include "Game.h"
|
||||
#include "PCSave.h"
|
||||
|
||||
#ifdef RW_DC
|
||||
#define SLOT_COUNT (2)
|
||||
#elif
|
||||
#define SLOT_COUNT (8)
|
||||
#endif
|
||||
|
||||
void InitRadioStationPositionList();
|
||||
int32 GetSavedRadioStationPosition(int32 station);
|
||||
|
|
|
@ -12,6 +12,11 @@
|
|||
#include "PCSave.h"
|
||||
#include "Text.h"
|
||||
|
||||
#include "minilzo.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "../vmu/vmu.h"
|
||||
|
||||
const char* _psGetUserFilesFolder();
|
||||
|
||||
C_PcSave PcSaveHelper;
|
||||
|
@ -19,7 +24,11 @@ C_PcSave PcSaveHelper;
|
|||
void
|
||||
C_PcSave::SetSaveDirectory(const char *path)
|
||||
{
|
||||
#if defined(RW_DC)
|
||||
sprintf(DefaultPCSaveFileName, "%s/%s", path, "GTAVCsf");
|
||||
#else
|
||||
sprintf(DefaultPCSaveFileName, "%s\\%s", path, "GTAVCsf");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -65,14 +74,39 @@ C_PcSave::SaveSlot(int32 slot)
|
|||
bool
|
||||
C_PcSave::PcClassSaveRoutine(int32 file, uint8 *data, uint32 size)
|
||||
{
|
||||
CFileMgr::Write(file, (const char*)&size, sizeof(size));
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
nErrorCode = SAVESTATUS_ERR_SAVE_WRITE;
|
||||
strncpy(SaveFileNameJustSaved, ValidSaveName, sizeof(ValidSaveName) - 1);
|
||||
void* wrkmem = malloc(LZO1X_1_MEM_COMPRESS);
|
||||
uint8* compressed = (uint8*)malloc(size*2);
|
||||
lzo_uint compressed_size;
|
||||
int crv = lzo1x_1_compress(data, size, compressed, &compressed_size, wrkmem);
|
||||
free(wrkmem);
|
||||
|
||||
if (crv == LZO_E_OK) {
|
||||
uint32_t compressed_size32 = compressed_size | 0x80000000;
|
||||
CFileMgr::Write(file, (const char*)&compressed_size32, sizeof(compressed_size32));
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
free(compressed);
|
||||
nErrorCode = SAVESTATUS_ERR_SAVE_WRITE;
|
||||
strncpy(SaveFileNameJustSaved, ValidSaveName, sizeof(ValidSaveName) - 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
CFileMgr::Write(file, (const char*)compressed, compressed_size);
|
||||
free(compressed);
|
||||
} else if (crv == LZO_E_NOT_COMPRESSIBLE) {
|
||||
free(compressed);
|
||||
uint32_t compressed_size32 = size;
|
||||
CFileMgr::Write(file, (const char*)&compressed_size32, sizeof(compressed_size32));
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
nErrorCode = SAVESTATUS_ERR_SAVE_WRITE;
|
||||
strncpy(SaveFileNameJustSaved, ValidSaveName, sizeof(ValidSaveName) - 1);
|
||||
return false;
|
||||
}
|
||||
CFileMgr::Write(file, (const char*)data, align4bytes(size));
|
||||
} else {
|
||||
free(compressed);
|
||||
return false;
|
||||
}
|
||||
|
||||
CFileMgr::Write(file, (const char*)data, align4bytes(size));
|
||||
CheckSum += (uint8) size;
|
||||
CheckSum += (uint8) (size >> 8);
|
||||
CheckSum += (uint8) (size >> 16);
|
||||
|
@ -89,6 +123,44 @@ C_PcSave::PcClassSaveRoutine(int32 file, uint8 *data, uint32 size)
|
|||
return true;
|
||||
}
|
||||
|
||||
uint32_t C_PcSave::PcClassLoadRoutine(int32 file, uint8 *data) {
|
||||
uint32 size;
|
||||
CFileMgr::Read(file, (char*)&size, sizeof(size));
|
||||
|
||||
|
||||
assert(data == work_buff);
|
||||
|
||||
if (!(size & 0x80000000)) {
|
||||
assert(align4bytes(size) == size);
|
||||
CFileMgr::Read(file, (char*)data, align4bytes(size));
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
return 0;
|
||||
}
|
||||
return size;
|
||||
} else {
|
||||
size &= ~0x80000000;
|
||||
uint8* compressed = (uint8*)malloc(size);
|
||||
CFileMgr::Read(file, (const char*)compressed, size);
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
free(compressed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
lzo_uint decompressed_size = 0;
|
||||
auto crv = lzo1x_decompress(compressed, size, data, &decompressed_size, NULL);
|
||||
free(compressed);
|
||||
if (crv != LZO_E_OK) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (align4bytes(decompressed_size) != decompressed_size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return decompressed_size;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
C_PcSave::PopulateSlotInfo()
|
||||
{
|
||||
|
@ -103,16 +175,16 @@ C_PcSave::PopulateSlotInfo()
|
|||
#else
|
||||
char savename[52];
|
||||
#endif
|
||||
struct {
|
||||
int size;
|
||||
struct header_t {
|
||||
wchar FileName[24];
|
||||
SYSTEMTIME SaveDateTime;
|
||||
} header;
|
||||
sprintf(savename, "%s%i%s", DefaultPCSaveFileName, i + 1, ".b");
|
||||
int file = CFileMgr::OpenFile(savename, "rb");
|
||||
if (file != 0) {
|
||||
CFileMgr::Read(file, (char*)&header, sizeof(header));
|
||||
if (strncmp((char*)&header, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1) != 0) {
|
||||
if (C_PcSave::PcClassLoadRoutine(file, (uint8*)work_buff)) {
|
||||
header = *(header_t*)work_buff;
|
||||
|
||||
Slots[i] = SLOT_OK;
|
||||
memcpy(SlotFileName[i], &header.FileName, sizeof(header.FileName));
|
||||
|
||||
|
@ -120,6 +192,9 @@ C_PcSave::PopulateSlotInfo()
|
|||
}
|
||||
CFileMgr::CloseFile(file);
|
||||
}
|
||||
#if defined(RW_DC)
|
||||
continue;
|
||||
#endif
|
||||
if (Slots[i] == SLOT_OK) {
|
||||
if (CheckDataNotCorrupt(i, savename)) {
|
||||
#ifdef FIX_INCOMPATIBLE_SAVES
|
||||
|
@ -163,4 +238,4 @@ C_PcSave::PopulateSlotInfo()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@ public:
|
|||
bool DeleteSlot(int32 slot);
|
||||
int8 SaveSlot(int32 slot);
|
||||
bool PcClassSaveRoutine(int32 file, uint8 *data, uint32 size);
|
||||
static uint32_t PcClassLoadRoutine(int32 file, uint8 *data);
|
||||
static void SetSaveDirectory(const char *path);
|
||||
};
|
||||
|
||||
|
|
|
@ -890,10 +890,6 @@ psSelectDevice()
|
|||
|
||||
/* Get the default selection */
|
||||
GcurSel = RwEngineGetCurrentSubSystem();
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if(FrontEndMenuManager.m_nPrefsSubsystem < GnumSubSystems)
|
||||
GcurSel = FrontEndMenuManager.m_nPrefsSubsystem;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set the driver to use the correct sub system */
|
||||
|
@ -902,11 +898,6 @@ psSelectDevice()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
FrontEndMenuManager.m_nPrefsSubsystem = GcurSel;
|
||||
#endif
|
||||
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if ( !useDefault )
|
||||
{
|
||||
if ( _psGetVideoModeList()[FrontEndMenuManager.m_nDisplayVideoMode] && FrontEndMenuManager.m_nDisplayVideoMode )
|
||||
|
@ -916,97 +907,11 @@ psSelectDevice()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
// get the native video mode
|
||||
HDC hDevice = GetDC(NULL);
|
||||
int w = GetDeviceCaps(hDevice, HORZRES);
|
||||
int h = GetDeviceCaps(hDevice, VERTRES);
|
||||
int d = GetDeviceCaps(hDevice, BITSPIXEL);
|
||||
#else
|
||||
const int w = 640;
|
||||
const int h = 480;
|
||||
const int d = 16;
|
||||
#endif
|
||||
while ( !modeFound && GcurSelVM < RwEngineGetNumVideoModes() )
|
||||
{
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
if ( defaultFullscreenRes && vm.width != w
|
||||
|| vm.height != h
|
||||
|| vm.depth != d
|
||||
|| !(vm.flags & rwVIDEOMODEEXCLUSIVE) )
|
||||
++GcurSelVM;
|
||||
else
|
||||
modeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( !modeFound )
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
GcurSelVM = 1;
|
||||
#else
|
||||
printf("WARNING: Cannot find 640x480 video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
GcurSelVM = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ( !useDefault )
|
||||
{
|
||||
if(FrontEndMenuManager.m_nPrefsWidth == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsHeight == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsDepth == 0){
|
||||
// Defaults if nothing specified
|
||||
// const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
||||
FrontEndMenuManager.m_nPrefsWidth = 640; //mode->width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = 480; //mode->height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = 16;
|
||||
FrontEndMenuManager.m_nPrefsWindowed = 0;
|
||||
}
|
||||
|
||||
// Find the videomode that best fits what we got from the settings file
|
||||
RwInt32 bestFsMode = -1;
|
||||
RwInt32 bestWidth = -1;
|
||||
RwInt32 bestHeight = -1;
|
||||
RwInt32 bestDepth = -1;
|
||||
for(GcurSelVM = 0; GcurSelVM < RwEngineGetNumVideoModes(); GcurSelVM++){
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
bestWndMode = GcurSelVM;
|
||||
bestWidth = vm.width;
|
||||
bestHeight = vm.height;
|
||||
bestDepth = vm.depth;
|
||||
bestFsMode = GcurSelVM;
|
||||
break;
|
||||
}
|
||||
|
||||
if(bestFsMode < 0){
|
||||
printf("WARNING: Cannot find desired video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
}
|
||||
GcurSelVM = bestFsMode;
|
||||
|
||||
FrontEndMenuManager.m_nDisplayVideoMode = GcurSelVM;
|
||||
FrontEndMenuManager.m_nPrefsVideoMode = FrontEndMenuManager.m_nDisplayVideoMode;
|
||||
|
||||
FrontEndMenuManager.m_nSelectedScreenMode = FrontEndMenuManager.m_nPrefsWindowed;
|
||||
}
|
||||
#endif
|
||||
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if (FrontEndMenuManager.m_nPrefsWindowed)
|
||||
GcurSelVM = bestWndMode;
|
||||
|
||||
// Now GcurSelVM is 0 but vm has sizes(and fullscreen flag) of the video mode we want, that's why we changed the rwVIDEOMODEEXCLUSIVE conditions below
|
||||
FrontEndMenuManager.m_nPrefsWidth = vm.width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = vm.height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = vm.depth;
|
||||
#endif
|
||||
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_nCurrOption = 0;
|
||||
#endif
|
||||
|
||||
/* Set up the video mode and set the apps window
|
||||
* dimensions to match */
|
||||
|
@ -1029,25 +934,6 @@ psSelectDevice()
|
|||
}
|
||||
}
|
||||
*/
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if (vm.flags & rwVIDEOMODEEXCLUSIVE)
|
||||
{
|
||||
RsGlobal.maximumWidth = vm.width;
|
||||
RsGlobal.maximumHeight = vm.height;
|
||||
RsGlobal.width = vm.width;
|
||||
RsGlobal.height = vm.height;
|
||||
|
||||
PSGLOBAL(fullScreen) = TRUE;
|
||||
}
|
||||
#else
|
||||
RsGlobal.maximumWidth = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.maximumHeight = FrontEndMenuManager.m_nPrefsHeight;
|
||||
RsGlobal.width = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.height = FrontEndMenuManager.m_nPrefsHeight;
|
||||
|
||||
PSGLOBAL(fullScreen) = !FrontEndMenuManager.m_nPrefsWindowed;
|
||||
#endif
|
||||
|
||||
#ifdef MULTISAMPLING
|
||||
RwD3D8EngineSetMultiSamplingLevels(1 << FrontEndMenuManager.m_nPrefsMSAALevel);
|
||||
#endif
|
||||
|
@ -2126,6 +2012,11 @@ const char* getExecutableTag() {
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
/*
|
||||
dbgio_dev_select("fb");
|
||||
bfont_set_foreground_color(0x00000000);
|
||||
bfont_set_background_color(0xFFFFFFFF);
|
||||
*/
|
||||
dbglog(DBG_CRITICAL, "DCA3: %s\n", getExecutableTag());
|
||||
#if !defined(DC_SIM)
|
||||
std::set_terminate([]() {
|
||||
|
|
|
@ -136,31 +136,28 @@ void CBulletInfo::Update(void)
|
|||
}
|
||||
pPed->InflictDamage(pBullet->m_pSource, pBullet->m_eWeaponType, pBullet->m_nDamage, (ePedPieceTypes)point.pieceB, pPed->GetLocalDirection(pPed->GetPosition() - point.point));
|
||||
CEventList::RegisterEvent(pPed->m_nPedType == PEDTYPE_COP ? EVENT_SHOOT_COP : EVENT_SHOOT_PED, EVENT_ENTITY_PED, pPed, (CPed*)pBullet->m_pSource, 1000);
|
||||
pBullet->m_bInUse = false;
|
||||
#ifdef SQUEEZE_PERFORMANCE
|
||||
bulletInfoInUse--;
|
||||
#endif
|
||||
vecNewPos = point.point;
|
||||
}
|
||||
if (CGame::nastyGame) {
|
||||
CVector vecParticleDirection = (point.point - pPed->GetPosition()) * 0.01f;
|
||||
vecParticleDirection.z = 0.01f;
|
||||
if (pPed->GetIsOnScreen()) {
|
||||
for (int j = 0; j < NUM_PED_BLOOD_PARTICLES; j++)
|
||||
CParticle::AddParticle(PARTICLE_BLOOD_SMALL, point.point + BLOOD_PARTICLE_OFFSET, vecParticleDirection);
|
||||
}
|
||||
if (pPed->GetPedState() == PED_DEAD) {
|
||||
CAnimBlendAssociation* pAnim;
|
||||
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL))
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f);
|
||||
else
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f);
|
||||
if (pAnim) {
|
||||
pAnim->SetCurrentTime(0.0f);
|
||||
pAnim->flags |= ASSOC_RUNNING;
|
||||
pAnim->flags &= ~ASSOC_FADEOUTWHENDONE;
|
||||
|
||||
if (CGame::nastyGame) {
|
||||
CVector vecParticleDirection = (point.point - pPed->GetPosition()) * 0.01f;
|
||||
vecParticleDirection.z = 0.01f;
|
||||
if (pPed->GetIsOnScreen()) {
|
||||
for (int j = 0; j < NUM_PED_BLOOD_PARTICLES; j++)
|
||||
CParticle::AddParticle(PARTICLE_BLOOD_SMALL, point.point + BLOOD_PARTICLE_OFFSET, vecParticleDirection);
|
||||
}
|
||||
if (pPed->GetPedState() == PED_DEAD) {
|
||||
CAnimBlendAssociation* pAnim;
|
||||
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL))
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f);
|
||||
else
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f);
|
||||
if (pAnim) {
|
||||
pAnim->SetCurrentTime(0.0f);
|
||||
pAnim->flags |= ASSOC_RUNNING;
|
||||
pAnim->flags &= ~ASSOC_FADEOUTWHENDONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pBullet->m_bInUse = false;
|
||||
#ifdef SQUEEZE_PERFORMANCE
|
||||
bulletInfoInUse--;
|
||||
|
|
|
@ -187,8 +187,8 @@ __always_inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
|||
#define SCREEN_HEIGHT ((float)448)
|
||||
#endif
|
||||
#else
|
||||
#define SCREEN_WIDTH ((float)640)
|
||||
#define SCREEN_HEIGHT ((float)480)
|
||||
extern float SCREEN_WIDTH;
|
||||
extern float SCREEN_HEIGHT;
|
||||
#endif
|
||||
|
||||
#define SCREEN_HEIGHT_PAL ((float)512)
|
||||
|
|
|
@ -311,7 +311,7 @@ enum Config {
|
|||
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
|
||||
// #define USE_TXD_CDIMAGE // generate and load textures from txd.img
|
||||
// #define PS2_ALPHA_TEST // emulate ps2 alpha test
|
||||
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
//#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
// #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
|
||||
#ifdef DISABLE_LOADING_SCREEN
|
||||
// enable the PC splash
|
||||
|
@ -327,7 +327,7 @@ enum Config {
|
|||
//#define NEW_RENDERER // leeds-like world rendering, needs librw
|
||||
#endif
|
||||
|
||||
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
||||
// #define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc) // JP - Disabled this as it produces incorrect aspect ratio with custom screen resolutions and is not needed otherwise
|
||||
|
||||
#ifndef EXTENDED_COLOURFILTER
|
||||
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
|
||||
|
|
|
@ -41,7 +41,11 @@ CDraw::FindAspectRatio(void)
|
|||
#else
|
||||
switch (FrontEndMenuManager.m_PrefsUseWideScreen) {
|
||||
case AR_AUTO:
|
||||
#ifdef DC_SH4
|
||||
return 4.0f / 3.0f;
|
||||
#else
|
||||
return SCREEN_WIDTH / SCREEN_HEIGHT;
|
||||
#endif
|
||||
default:
|
||||
case AR_4_3:
|
||||
return 4.0f / 3.0f;
|
||||
|
|
|
@ -134,7 +134,7 @@ CMBlur::MotionBlurOpen(RwCamera *cam)
|
|||
|
||||
return TRUE;
|
||||
#else
|
||||
RwRect rect = { 0, 0, 640, 480 };
|
||||
RwRect rect = { 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT };
|
||||
CreateImmediateModeData(cam, &rect);
|
||||
return TRUE;
|
||||
#endif
|
||||
|
|
|
@ -877,10 +877,6 @@ psSelectDevice()
|
|||
|
||||
/* Get the default selection */
|
||||
GcurSel = RwEngineGetCurrentSubSystem();
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if(FrontEndMenuManager.m_nPrefsSubsystem < GnumSubSystems)
|
||||
GcurSel = FrontEndMenuManager.m_nPrefsSubsystem;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set the driver to use the correct sub system */
|
||||
|
@ -889,11 +885,6 @@ psSelectDevice()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
FrontEndMenuManager.m_nPrefsSubsystem = GcurSel;
|
||||
#endif
|
||||
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if ( !useDefault )
|
||||
{
|
||||
if ( _psGetVideoModeList()[FrontEndMenuManager.m_nDisplayVideoMode] && FrontEndMenuManager.m_nDisplayVideoMode )
|
||||
|
@ -903,97 +894,11 @@ psSelectDevice()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
// get the native video mode
|
||||
HDC hDevice = GetDC(NULL);
|
||||
int w = GetDeviceCaps(hDevice, HORZRES);
|
||||
int h = GetDeviceCaps(hDevice, VERTRES);
|
||||
int d = GetDeviceCaps(hDevice, BITSPIXEL);
|
||||
#else
|
||||
const int w = 640;
|
||||
const int h = 480;
|
||||
const int d = 16;
|
||||
#endif
|
||||
while ( !modeFound && GcurSelVM < RwEngineGetNumVideoModes() )
|
||||
{
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
if ( defaultFullscreenRes && vm.width != w
|
||||
|| vm.height != h
|
||||
|| vm.depth != d
|
||||
|| !(vm.flags & rwVIDEOMODEEXCLUSIVE) )
|
||||
++GcurSelVM;
|
||||
else
|
||||
modeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( !modeFound )
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
GcurSelVM = 1;
|
||||
#else
|
||||
printf("WARNING: Cannot find 640x480 video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
GcurSelVM = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ( !useDefault )
|
||||
{
|
||||
if(FrontEndMenuManager.m_nPrefsWidth == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsHeight == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsDepth == 0){
|
||||
// Defaults if nothing specified
|
||||
//const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
||||
FrontEndMenuManager.m_nPrefsWidth = 640; //mode->width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = 480; //mode->height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = 16;
|
||||
FrontEndMenuManager.m_nPrefsWindowed = 0;
|
||||
}
|
||||
|
||||
// Find the videomode that best fits what we got from the settings file
|
||||
RwInt32 bestFsMode = -1;
|
||||
RwInt32 bestWidth = -1;
|
||||
RwInt32 bestHeight = -1;
|
||||
RwInt32 bestDepth = -1;
|
||||
for(GcurSelVM = 0; GcurSelVM < RwEngineGetNumVideoModes(); GcurSelVM++){
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
bestWndMode = GcurSelVM;
|
||||
bestWidth = vm.width;
|
||||
bestHeight = vm.height;
|
||||
bestDepth = vm.depth;
|
||||
bestFsMode = GcurSelVM;
|
||||
break;
|
||||
}
|
||||
|
||||
if(bestFsMode < 0){
|
||||
printf("WARNING: Cannot find desired video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
}
|
||||
GcurSelVM = bestFsMode;
|
||||
|
||||
FrontEndMenuManager.m_nDisplayVideoMode = GcurSelVM;
|
||||
FrontEndMenuManager.m_nPrefsVideoMode = FrontEndMenuManager.m_nDisplayVideoMode;
|
||||
|
||||
FrontEndMenuManager.m_nSelectedScreenMode = FrontEndMenuManager.m_nPrefsWindowed;
|
||||
}
|
||||
#endif
|
||||
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if (FrontEndMenuManager.m_nPrefsWindowed)
|
||||
GcurSelVM = bestWndMode;
|
||||
|
||||
// Now GcurSelVM is 0 but vm has sizes(and fullscreen flag) of the video mode we want, that's why we changed the rwVIDEOMODEEXCLUSIVE conditions below
|
||||
FrontEndMenuManager.m_nPrefsWidth = vm.width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = vm.height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = vm.depth;
|
||||
#endif
|
||||
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_nCurrOption = 0;
|
||||
#endif
|
||||
|
||||
/* Set up the video mode and set the apps window
|
||||
* dimensions to match */
|
||||
|
@ -1016,25 +921,6 @@ psSelectDevice()
|
|||
}
|
||||
}
|
||||
*/
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if (vm.flags & rwVIDEOMODEEXCLUSIVE)
|
||||
{
|
||||
RsGlobal.maximumWidth = vm.width;
|
||||
RsGlobal.maximumHeight = vm.height;
|
||||
RsGlobal.width = vm.width;
|
||||
RsGlobal.height = vm.height;
|
||||
|
||||
PSGLOBAL(fullScreen) = TRUE;
|
||||
}
|
||||
#else
|
||||
RsGlobal.maximumWidth = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.maximumHeight = FrontEndMenuManager.m_nPrefsHeight;
|
||||
RsGlobal.width = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.height = FrontEndMenuManager.m_nPrefsHeight;
|
||||
|
||||
PSGLOBAL(fullScreen) = !FrontEndMenuManager.m_nPrefsWindowed;
|
||||
#endif
|
||||
|
||||
#ifdef MULTISAMPLING
|
||||
RwD3D8EngineSetMultiSamplingLevels(1 << FrontEndMenuManager.m_nPrefsMSAALevel);
|
||||
#endif
|
||||
|
|
132
vendor/librw/src/dc/rwdc.cpp
vendored
132
vendor/librw/src/dc/rwdc.cpp
vendored
|
@ -29,6 +29,7 @@ extern const char* currentFile;
|
|||
#include "rwdc.h"
|
||||
#include "vq.h"
|
||||
#include "tex-util.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
@ -59,6 +60,12 @@ bool doEnvironmentMaps = true;
|
|||
#define fclamp0_1(n) ((n) > 1.0f ? 1.0f : n < 0.0f ? 0.0f : n)
|
||||
#define fclamp1(n) ((n) > 1.0f ? 1.0f : n)
|
||||
|
||||
const unsigned short VIDEO_MODES = 2;
|
||||
unsigned short VIDEO_MODE = 0;
|
||||
rw::VideoMode videoModes[VIDEO_MODES];
|
||||
float SCREEN_WIDTH = 640;
|
||||
float SCREEN_HEIGHT = 480;
|
||||
|
||||
struct alignas(32) pvr_vertex16_t {
|
||||
uint32_t flags; /**< \brief TA command (vertex flags) */
|
||||
float x; /**< \brief X coordinate */
|
||||
|
@ -177,8 +184,6 @@ static pvr_dr_state_t drState;
|
|||
#if !defined(DC_TEXCONV) && !defined(DC_SIM)
|
||||
#include <kos.h>
|
||||
|
||||
#define VIDEO_MODE_WIDTH vid_mode->width
|
||||
#define VIDEO_MODE_HEIGHT vid_mode->height
|
||||
|
||||
#define mat_trans_nodiv_nomod(x, y, z, x2, y2, z2, w2) do { \
|
||||
register float __x __asm__("fr12") = (x); \
|
||||
|
@ -289,8 +294,6 @@ void rw_mat_load_4x4(rw::Matrix* mtx) {
|
|||
}
|
||||
|
||||
#include <dc/matrix.h>
|
||||
#define VIDEO_MODE_WIDTH 640
|
||||
#define VIDEO_MODE_HEIGHT 480
|
||||
#define frsqrt(a) (1.0f/sqrt(a))
|
||||
#define dcache_pref_block(a) __builtin_prefetch(a)
|
||||
|
||||
|
@ -495,7 +498,7 @@ void DCE_InitMatrices() {
|
|||
|
||||
mat_store(&DCE_MAT_SCREENVIEW);
|
||||
|
||||
DCE_MatrixViewport(0, 0, VIDEO_MODE_WIDTH, VIDEO_MODE_HEIGHT);
|
||||
DCE_MatrixViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -747,8 +750,9 @@ std::vector<std::function<void()>> blendCallbacks;
|
|||
std::vector<std::function<void()>> ptCallbacks;
|
||||
|
||||
void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
|
||||
uint32_t col = (a << 24) | (r << 16) | (g << 8) | b;
|
||||
int strip_width = SCREEN_WIDTH / 320;
|
||||
int strip_mult = SCREEN_WIDTH / 640;
|
||||
|
||||
blendCallbacks.emplace_back([=]() {
|
||||
pvr_poly_cxt_t cxt;
|
||||
|
@ -764,8 +768,6 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
auto addr2 = (pvr_ptr_t)&emu_vram[addr64b + 640 * 2];
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PVR_SET(PVR_TEXTURE_MODULO, 640/32);
|
||||
|
||||
auto doquad = [=](float x, float y, float w, float h, float tx, float ty, float tw, float th) {
|
||||
|
@ -790,23 +792,23 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX;
|
||||
//vtx->flags = PVR_CMD_VERTEX;
|
||||
vtx->x = x;
|
||||
vtx->y = y+h;
|
||||
vtx->z = 1000000.0f;
|
||||
//vtx->z = 1000000.0f;
|
||||
vtx->u = tx/1024.f;
|
||||
vtx->v = (ty+th)/512.0f;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX_EOL;
|
||||
vtx->x = x+w;
|
||||
vtx->y = y+h;
|
||||
vtx->z = 1000000.0f;
|
||||
//vtx->z = 1000000.0f;
|
||||
vtx->u = (tx+tw)/1024.f;
|
||||
vtx->v = (ty+th)/512.0f;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
};
|
||||
{
|
||||
|
@ -829,7 +831,7 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_dr_commit(hdr);
|
||||
}
|
||||
for (int x = 0; x < 320; x+=2) {
|
||||
doquad(x, 0, 2, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
doquad(x*strip_mult, 0, strip_width, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
}
|
||||
{
|
||||
pvr_poly_cxt_txr(&cxt,
|
||||
|
@ -851,7 +853,7 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_dr_commit(hdr);
|
||||
}
|
||||
for (int x = 0; x < 320; x+=2) {
|
||||
doquad(320+x, 0, 2, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
doquad(SCREEN_WIDTH/2 + x*strip_mult, 0, strip_width, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -894,23 +896,23 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX;
|
||||
//vtx->flags = PVR_CMD_VERTEX;
|
||||
vtx->x = x;
|
||||
vtx->y = y+h;
|
||||
vtx->z = z;
|
||||
//vtx->z = z;
|
||||
vtx->u = umin;
|
||||
vtx->v = vmax;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX_EOL;
|
||||
vtx->x = x+w;
|
||||
vtx->y = y+h;
|
||||
vtx->z = z;
|
||||
//vtx->z = z;
|
||||
vtx->u = umax;
|
||||
vtx->v = vmax;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
};
|
||||
|
||||
|
@ -929,7 +931,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 1e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 1e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, mask_col);
|
||||
|
||||
pvr_poly_cxt_txr(&cxt, PVR_LIST_TR_POLY,
|
||||
|
@ -948,10 +950,10 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 2e6f, 320.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 2e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
0.0f, 640.0f / 1024.0f,
|
||||
0.0f, 960.0f / 1024.0f, col);
|
||||
doquad(320.0f, 0.0f, 2e6f, 320.0f, 480.0f,
|
||||
doquad(SCREEN_WIDTH / 2.0f, 0.0f, 2e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
0.0f, 640.0f / 1024.0f,
|
||||
1.0f / 1024.0f, 961.0f / 1024.0f, col);
|
||||
|
||||
|
@ -962,10 +964,10 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 3e6f, 320.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 3e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
-1.0f / 1024.0f, 639.0f / 1024.0f,
|
||||
0.0f, 960.0f / 1024.0f, col);
|
||||
doquad(320.0f, 0.0f, 3e6f, 320.0f, 480.0f,
|
||||
doquad(SCREEN_WIDTH / 2.0f, 0.0f, 3e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
-1.0f / 1024.0f, 639.0f / 1024.0f,
|
||||
1.0f / 1024.0f, 961.0f / 1024.0f, col);
|
||||
|
||||
|
@ -981,7 +983,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
|
||||
cxt.blend.src = PVR_BLEND_ONE;
|
||||
|
@ -991,7 +993,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0x000f0f0f);
|
||||
|
||||
cxt.blend.src = PVR_BLEND_INVDESTCOLOR;
|
||||
|
@ -1001,7 +1003,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
|
||||
cxt.blend.dst_enable = PVR_BLEND_DISABLE;
|
||||
|
@ -1013,7 +1015,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
});
|
||||
}
|
||||
|
@ -1053,7 +1055,7 @@ void endUpdate(Camera* cam) {
|
|||
}
|
||||
pvr_list_finish();
|
||||
if (ptCallbacks.size()) {
|
||||
PVR_SET(0x11C, 128); // PT Alpha test value
|
||||
PVR_SET(0x11C, 64); // PT Alpha test value
|
||||
pvr_dr_init(&drState);
|
||||
pvr_list_begin(PVR_LIST_PT_POLY);
|
||||
for (auto&& cb: ptCallbacks) {
|
||||
|
@ -1128,6 +1130,8 @@ static float fogStart = 0.0f;
|
|||
static uint32 cullModePvr;
|
||||
|
||||
static inline unsigned pvrCullMode(uint32_t cullMode) {
|
||||
// PH3NOM - Prevents missing geometry
|
||||
return PVR_CULLING_NONE;
|
||||
switch(cullMode) {
|
||||
case CULLNONE: return PVR_CULLING_SMALL;
|
||||
case CULLBACK: return PVR_CULLING_CW;
|
||||
|
@ -4327,6 +4331,32 @@ rasterToImage(Raster*)
|
|||
return nil;
|
||||
}
|
||||
|
||||
static pvr_init_params_t pvr_params = {
|
||||
.opb_sizes = {
|
||||
PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_8, PVR_BINSIZE_0,
|
||||
PVR_BINSIZE_8
|
||||
},
|
||||
.vertex_buf_size = (1024 + 512) * 1024,
|
||||
.dma_enabled = 0,
|
||||
.fsaa_enabled = 0,
|
||||
.autosort_disabled = true,
|
||||
.opb_overflow_count = 7 // 268800 bytes
|
||||
};
|
||||
|
||||
static void makeVideoModeList() {
|
||||
videoModes[0].width = 640;
|
||||
videoModes[0].height = 480;
|
||||
videoModes[0].depth = 16;
|
||||
videoModes[0].flags = VIDEOMODEEXCLUSIVE;
|
||||
|
||||
videoModes[1].width = 1280;
|
||||
videoModes[1].height = 480;
|
||||
videoModes[1].depth = 16;
|
||||
videoModes[1].flags = VIDEOMODEEXCLUSIVE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
deviceSystem(DeviceReq req, void *arg0, int32 n)
|
||||
{
|
||||
|
@ -4355,14 +4385,14 @@ deviceSystem(DeviceReq req, void *arg0, int32 n)
|
|||
// TODO: implement subsystems
|
||||
|
||||
case DEVICEGETVIDEOMODEINFO:{
|
||||
makeVideoModeList(); // On startup this is not yet called
|
||||
auto rwmode = (VideoMode*)arg0;
|
||||
rwmode->width = 640;
|
||||
rwmode->height = 480;
|
||||
rwmode->depth = 16;
|
||||
rwmode->flags = VIDEOMODEEXCLUSIVE;
|
||||
rwmode->width = videoModes[n].width;
|
||||
rwmode->height = videoModes[n].height;
|
||||
rwmode->depth = videoModes[n].depth;
|
||||
rwmode->flags = videoModes[n].flags;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case DEVICEGETMAXMULTISAMPLINGLEVELS:
|
||||
{
|
||||
|
@ -4375,11 +4405,21 @@ deviceSystem(DeviceReq req, void *arg0, int32 n)
|
|||
case DEVICESETSUBSYSTEM:
|
||||
return 1;
|
||||
case DEVICEGETNUMVIDEOMODES:
|
||||
return 1;
|
||||
return VIDEO_MODES;
|
||||
case DEVICEGETCURRENTVIDEOMODE:
|
||||
return 0;
|
||||
return VIDEO_MODE;
|
||||
case DEVICESETVIDEOMODE:
|
||||
return 1;
|
||||
{
|
||||
makeVideoModeList(); // On startup this is called before driverOpen
|
||||
|
||||
VIDEO_MODE = n;
|
||||
SCREEN_WIDTH = videoModes[VIDEO_MODE].width;
|
||||
SCREEN_HEIGHT = videoModes[VIDEO_MODE].height;
|
||||
pvr_params.fsaa_enabled = n;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0 && "not implemented");
|
||||
return 0;
|
||||
|
@ -4407,15 +4447,7 @@ Device renderdevice = {
|
|||
deviceSystem
|
||||
};
|
||||
|
||||
static pvr_init_params_t pvr_params = {
|
||||
.opb_sizes = {
|
||||
PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_8, PVR_BINSIZE_0,
|
||||
PVR_BINSIZE_8
|
||||
},
|
||||
.vertex_buf_size = (1024 + 1024) * 1024,
|
||||
.autosort_disabled = true,
|
||||
.opb_overflow_count = 7 // 268800 bytes
|
||||
};
|
||||
|
||||
|
||||
void defaultInstance(ObjPipeline *pipe, Atomic *atomic) {
|
||||
#if defined(DC_TEXCONV)
|
||||
|
@ -4441,6 +4473,8 @@ ObjPipeline* makeDefaultPipeline(void)
|
|||
static void*
|
||||
driverOpen(void *o, int32, int32)
|
||||
{
|
||||
makeVideoModeList();
|
||||
|
||||
pvr_init(&pvr_params);
|
||||
|
||||
fake_tex = pvr_mem_malloc(sizeof(fake_tex_data));
|
||||
|
@ -4476,6 +4510,8 @@ driverClose(void *o, int32, int32)
|
|||
{
|
||||
pvr_mem_free(fake_tex);
|
||||
|
||||
pvr_shutdown();
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue