Fix the majority of the compiler warnings unearthed by the addition of
the new warning flags.
This commit is contained in:
parent
18e69acc15
commit
0ffdd2607f
|
@ -232,70 +232,70 @@ float passive_lock(float x)
|
||||||
|
|
||||||
void matrix_decode(const float *in, const int k, const int il,
|
void matrix_decode(const float *in, const int k, const int il,
|
||||||
const int ir, bool decode_rear,
|
const int ir, bool decode_rear,
|
||||||
const int dlbuflen,
|
const int _dlbuflen,
|
||||||
float l_fwr, float r_fwr,
|
float _l_fwr, float _r_fwr,
|
||||||
float lpr_fwr, float lmr_fwr,
|
float _lpr_fwr, float _lmr_fwr,
|
||||||
float *adapt_l_gain, float *adapt_r_gain,
|
float *_adapt_l_gain, float *_adapt_r_gain,
|
||||||
float *adapt_lpr_gain, float *adapt_lmr_gain,
|
float *_adapt_lpr_gain, float *_adapt_lmr_gain,
|
||||||
float *lf, float *rf, float *lr,
|
float *_lf, float *_rf, float *_lr,
|
||||||
float *rr, float *cf)
|
float *_rr, float *_cf)
|
||||||
{
|
{
|
||||||
static const float M9_03DB = 0.3535533906f;
|
static const float M9_03DB = 0.3535533906f;
|
||||||
static const float MATAGCTRIG = 8.0f; /* (Fuzzy) AGC trigger */
|
static const float MATAGCTRIG = 8.0f; /* (Fuzzy) AGC trigger */
|
||||||
static const float MATAGCDECAY = 1.0f; /* AGC baseline decay rate (1/samp.) */
|
static const float MATAGCDECAY = 1.0f; /* AGC baseline decay rate (1/samp.) */
|
||||||
static const float MATCOMPGAIN = 0.37f; /* Cross talk compensation gain, 0.50 - 0.55 is full cancellation. */
|
static const float MATCOMPGAIN = 0.37f; /* Cross talk compensation gain, 0.50 - 0.55 is full cancellation. */
|
||||||
|
|
||||||
const int kr = (k + olddelay) % dlbuflen;
|
const int kr = (k + olddelay) % _dlbuflen;
|
||||||
float l_gain = (l_fwr + r_fwr) / (1 + l_fwr + l_fwr);
|
float l_gain = (_l_fwr + _r_fwr) / (1 + _l_fwr + _l_fwr);
|
||||||
float r_gain = (l_fwr + r_fwr) / (1 + r_fwr + r_fwr);
|
float r_gain = (_l_fwr + _r_fwr) / (1 + _r_fwr + _r_fwr);
|
||||||
/* The 2nd axis has strong gain fluctuations, and therefore require
|
/* The 2nd axis has strong gain fluctuations, and therefore require
|
||||||
limits. The factor corresponds to the 1 / amplification of (Lt
|
limits. The factor corresponds to the 1 / amplification of (Lt
|
||||||
- Rt) when (Lt, Rt) is strongly correlated. (e.g. during
|
- Rt) when (Lt, Rt) is strongly correlated. (e.g. during
|
||||||
dialogues). It should be bigger than -12 dB to prevent
|
dialogues). It should be bigger than -12 dB to prevent
|
||||||
distortion. */
|
distortion. */
|
||||||
float lmr_lim_fwr = lmr_fwr > M9_03DB * lpr_fwr ? lmr_fwr : M9_03DB * lpr_fwr;
|
float lmr_lim_fwr = _lmr_fwr > M9_03DB * _lpr_fwr ? _lmr_fwr : M9_03DB * _lpr_fwr;
|
||||||
float lpr_gain = (lpr_fwr + lmr_lim_fwr) / (1 + lpr_fwr + lpr_fwr);
|
float lpr_gain = (_lpr_fwr + lmr_lim_fwr) / (1 + _lpr_fwr + _lpr_fwr);
|
||||||
float lmr_gain = (lpr_fwr + lmr_lim_fwr) / (1 + lmr_lim_fwr + lmr_lim_fwr);
|
float lmr_gain = (_lpr_fwr + lmr_lim_fwr) / (1 + lmr_lim_fwr + lmr_lim_fwr);
|
||||||
float lmr_unlim_gain = (lpr_fwr + lmr_fwr) / (1 + lmr_fwr + lmr_fwr);
|
float lmr_unlim_gain = (_lpr_fwr + _lmr_fwr) / (1 + _lmr_fwr + _lmr_fwr);
|
||||||
float lpr, lmr;
|
float lpr, lmr;
|
||||||
float l_agc, r_agc, lpr_agc, lmr_agc;
|
float l_agc, r_agc, lpr_agc, lmr_agc;
|
||||||
float f, d_gain, c_gain, c_agc_cfk;
|
float f, d_gain, c_gain, c_agc_cfk;
|
||||||
|
|
||||||
/*** AXIS NO. 1: (Lt, Rt) -> (C, Ls, Rs) ***/
|
/*** AXIS NO. 1: (Lt, Rt) -> (C, Ls, Rs) ***/
|
||||||
/* AGC adaption */
|
/* AGC adaption */
|
||||||
d_gain = (fabs(l_gain - *adapt_l_gain) + fabs(r_gain - *adapt_r_gain)) * 0.5f;
|
d_gain = (fabs(l_gain - *_adapt_l_gain) + fabs(r_gain - *_adapt_r_gain)) * 0.5f;
|
||||||
f = d_gain * (1.0f / MATAGCTRIG);
|
f = d_gain * (1.0f / MATAGCTRIG);
|
||||||
f = MATAGCDECAY - MATAGCDECAY / (1 + f * f);
|
f = MATAGCDECAY - MATAGCDECAY / (1 + f * f);
|
||||||
*adapt_l_gain = (1 - f) * *adapt_l_gain + f * l_gain;
|
*_adapt_l_gain = (1 - f) * *_adapt_l_gain + f * l_gain;
|
||||||
*adapt_r_gain = (1 - f) * *adapt_r_gain + f * r_gain;
|
*_adapt_r_gain = (1 - f) * *_adapt_r_gain + f * r_gain;
|
||||||
/* Matrix */
|
/* Matrix */
|
||||||
l_agc = in[il] * passive_lock(*adapt_l_gain);
|
l_agc = in[il] * passive_lock(*_adapt_l_gain);
|
||||||
r_agc = in[ir] * passive_lock(*adapt_r_gain);
|
r_agc = in[ir] * passive_lock(*_adapt_r_gain);
|
||||||
cf[k] = (l_agc + r_agc) * (float)M_SQRT1_2;
|
_cf[k] = (l_agc + r_agc) * (float)M_SQRT1_2;
|
||||||
if (decode_rear)
|
if (decode_rear)
|
||||||
{
|
{
|
||||||
lr[kr] = rr[kr] = (l_agc - r_agc) * (float)M_SQRT1_2;
|
_lr[kr] = _rr[kr] = (l_agc - r_agc) * (float)M_SQRT1_2;
|
||||||
/* Stereo rear channel is steered with the same AGC steering as
|
/* Stereo rear channel is steered with the same AGC steering as
|
||||||
the decoding matrix. Note this requires a fast updating AGC
|
the decoding matrix. Note this requires a fast updating AGC
|
||||||
at the order of 20 ms (which is the case here). */
|
at the order of 20 ms (which is the case here). */
|
||||||
lr[kr] *= (l_fwr + l_fwr) / (1 + l_fwr + r_fwr);
|
_lr[kr] *= (_l_fwr + _l_fwr) / (1 + _l_fwr + _r_fwr);
|
||||||
rr[kr] *= (r_fwr + r_fwr) / (1 + l_fwr + r_fwr);
|
_rr[kr] *= (_r_fwr + _r_fwr) / (1 + _l_fwr + _r_fwr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** AXIS NO. 2: (Lt + Rt, Lt - Rt) -> (L, R) ***/
|
/*** AXIS NO. 2: (Lt + Rt, Lt - Rt) -> (L, R) ***/
|
||||||
lpr = (in[il] + in[ir]) * (float)M_SQRT1_2;
|
lpr = (in[il] + in[ir]) * (float)M_SQRT1_2;
|
||||||
lmr = (in[il] - in[ir]) * (float)M_SQRT1_2;
|
lmr = (in[il] - in[ir]) * (float)M_SQRT1_2;
|
||||||
/* AGC adaption */
|
/* AGC adaption */
|
||||||
d_gain = fabs(lmr_unlim_gain - *adapt_lmr_gain);
|
d_gain = fabs(lmr_unlim_gain - *_adapt_lmr_gain);
|
||||||
f = d_gain * (1.0f / MATAGCTRIG);
|
f = d_gain * (1.0f / MATAGCTRIG);
|
||||||
f = MATAGCDECAY - MATAGCDECAY / (1 + f * f);
|
f = MATAGCDECAY - MATAGCDECAY / (1 + f * f);
|
||||||
*adapt_lpr_gain = (1 - f) * *adapt_lpr_gain + f * lpr_gain;
|
*_adapt_lpr_gain = (1 - f) * *_adapt_lpr_gain + f * lpr_gain;
|
||||||
*adapt_lmr_gain = (1 - f) * *adapt_lmr_gain + f * lmr_gain;
|
*_adapt_lmr_gain = (1 - f) * *_adapt_lmr_gain + f * lmr_gain;
|
||||||
/* Matrix */
|
/* Matrix */
|
||||||
lpr_agc = lpr * passive_lock(*adapt_lpr_gain);
|
lpr_agc = lpr * passive_lock(*_adapt_lpr_gain);
|
||||||
lmr_agc = lmr * passive_lock(*adapt_lmr_gain);
|
lmr_agc = lmr * passive_lock(*_adapt_lmr_gain);
|
||||||
lf[k] = (lpr_agc + lmr_agc) * (float)M_SQRT1_2;
|
_lf[k] = (lpr_agc + lmr_agc) * (float)M_SQRT1_2;
|
||||||
rf[k] = (lpr_agc - lmr_agc) * (float)M_SQRT1_2;
|
_rf[k] = (lpr_agc - lmr_agc) * (float)M_SQRT1_2;
|
||||||
|
|
||||||
/*** CENTER FRONT CANCELLATION ***/
|
/*** CENTER FRONT CANCELLATION ***/
|
||||||
/* A heuristic approach exploits that Lt + Rt gain contains the
|
/* A heuristic approach exploits that Lt + Rt gain contains the
|
||||||
|
@ -303,16 +303,16 @@ void matrix_decode(const float *in, const int k, const int il,
|
||||||
the front and rear "cones" to concentrate Lt + Rt to C and
|
the front and rear "cones" to concentrate Lt + Rt to C and
|
||||||
introduce Lt - Rt in L, R. */
|
introduce Lt - Rt in L, R. */
|
||||||
/* 0.67677 is the empirical lower bound for lpr_gain. */
|
/* 0.67677 is the empirical lower bound for lpr_gain. */
|
||||||
c_gain = 8 * (*adapt_lpr_gain - 0.67677f);
|
c_gain = 8 * (*_adapt_lpr_gain - 0.67677f);
|
||||||
c_gain = c_gain > 0 ? c_gain : 0;
|
c_gain = c_gain > 0 ? c_gain : 0;
|
||||||
/* c_gain should not be too high, not even reaching full
|
/* c_gain should not be too high, not even reaching full
|
||||||
cancellation (~ 0.50 - 0.55 at current AGC implementation), or
|
cancellation (~ 0.50 - 0.55 at current AGC implementation), or
|
||||||
the center will sound too narrow. */
|
the center will sound too narrow. */
|
||||||
c_gain = MATCOMPGAIN / (1 + c_gain * c_gain);
|
c_gain = MATCOMPGAIN / (1 + c_gain * c_gain);
|
||||||
c_agc_cfk = c_gain * cf[k];
|
c_agc_cfk = c_gain * _cf[k];
|
||||||
lf[k] -= c_agc_cfk;
|
_lf[k] -= c_agc_cfk;
|
||||||
rf[k] -= c_agc_cfk;
|
_rf[k] -= c_agc_cfk;
|
||||||
cf[k] += c_agc_cfk + c_agc_cfk;
|
_cf[k] += c_agc_cfk + c_agc_cfk;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dpl2decode(float *samples, int numsamples, float *out)
|
void dpl2decode(float *samples, int numsamples, float *out)
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
|
|
||||||
std::mutex& MixerCritical() { return m_csMixing; }
|
std::mutex& MixerCritical() { return m_csMixing; }
|
||||||
|
|
||||||
volatile float GetCurrentSpeed() const { return m_speed; }
|
float GetCurrentSpeed() const { return m_speed; }
|
||||||
void UpdateSpeed(volatile float val) { m_speed = val; }
|
void UpdateSpeed(volatile float val) { m_speed = val; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -316,7 +316,7 @@ void OpenALStream::SoundLoop()
|
||||||
if (iBuffersFilled == numBuffers)
|
if (iBuffersFilled == numBuffers)
|
||||||
{
|
{
|
||||||
alSourcePlay(uiSource);
|
alSourcePlay(uiSource);
|
||||||
ALenum err = alGetError();
|
err = alGetError();
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(AUDIO, "Error occurred during playback: %08x", err);
|
ERROR_LOG(AUDIO, "Error occurred during playback: %08x", err);
|
||||||
|
@ -328,7 +328,7 @@ void OpenALStream::SoundLoop()
|
||||||
{
|
{
|
||||||
// Buffer underrun occurred, resume playback
|
// Buffer underrun occurred, resume playback
|
||||||
alSourcePlay(uiSource);
|
alSourcePlay(uiSource);
|
||||||
ALenum err = alGetError();
|
err = alGetError();
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(AUDIO, "Error occurred resuming playback: %08x", err);
|
ERROR_LOG(AUDIO, "Error occurred resuming playback: %08x", err);
|
||||||
|
|
|
@ -171,9 +171,9 @@ bool InstallCodeHandler()
|
||||||
Memory::Write_U8(1, 0x80001807);
|
Memory::Write_U8(1, 0x80001807);
|
||||||
|
|
||||||
// Invalidate the icache
|
// Invalidate the icache
|
||||||
for (unsigned int i = 0; i < data.length(); i += 32)
|
for (unsigned int j = 0; j < data.length(); j += 32)
|
||||||
{
|
{
|
||||||
PowerPC::ppcState.iCache.Invalidate(0x80001800 + i);
|
PowerPC::ppcState.iCache.Invalidate(0x80001800 + j);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ private:
|
||||||
|
|
||||||
virtual void TransferByte(u8 &_uByte);
|
virtual void TransferByte(u8 &_uByte);
|
||||||
bool IsWriteCommand() const { return !!(m_uAddress & (1 << 31)); }
|
bool IsWriteCommand() const { return !!(m_uAddress & (1 << 31)); }
|
||||||
const u32 CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; }
|
u32 CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; }
|
||||||
|
|
||||||
void LoadFileToIPL(std::string filename, u32 offset);
|
void LoadFileToIPL(std::string filename, u32 offset);
|
||||||
};
|
};
|
||||||
|
|
|
@ -382,18 +382,18 @@ void ExecuteCommand(u32 _Address)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IWII_IPC_HLE_Device* pDevice = CreateFileIO(DeviceID, DeviceName);
|
IWII_IPC_HLE_Device* _pDevice = CreateFileIO(DeviceID, DeviceName);
|
||||||
CmdSuccess = pDevice->Open(_Address, Mode);
|
CmdSuccess = _pDevice->Open(_Address, Mode);
|
||||||
|
|
||||||
INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)",
|
INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)",
|
||||||
pDevice->GetDeviceName().c_str(), DeviceID, Mode);
|
_pDevice->GetDeviceName().c_str(), DeviceID, Mode);
|
||||||
if (Memory::Read_U32(_Address + 4) == (u32)DeviceID)
|
if (Memory::Read_U32(_Address + 4) == (u32)DeviceID)
|
||||||
{
|
{
|
||||||
g_FdMap[DeviceID] = pDevice;
|
g_FdMap[DeviceID] = _pDevice;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete pDevice;
|
delete _pDevice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ void JitILAsmRoutineManager::Generate()
|
||||||
#endif
|
#endif
|
||||||
// INT3();
|
// INT3();
|
||||||
|
|
||||||
const u8 *outerLoop = GetCodePtr();
|
const u8 *outer_loop = GetCodePtr();
|
||||||
ABI_CallFunction(reinterpret_cast<void *>(&CoreTiming::Advance));
|
ABI_CallFunction(reinterpret_cast<void *>(&CoreTiming::Advance));
|
||||||
FixupBranch skipToRealDispatch = J(); //skip the sync and compare first time
|
FixupBranch skipToRealDispatch = J(); //skip the sync and compare first time
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ void JitILAsmRoutineManager::Generate()
|
||||||
MOV(32, M(&PC), R(EAX));
|
MOV(32, M(&PC), R(EAX));
|
||||||
|
|
||||||
TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF));
|
TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF));
|
||||||
J_CC(CC_Z, outerLoop, true);
|
J_CC(CC_Z, outer_loop, true);
|
||||||
//Landing pad for drec space
|
//Landing pad for drec space
|
||||||
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||||
RET();
|
RET();
|
||||||
|
|
|
@ -129,10 +129,10 @@ bool CVolumeWAD::GetWName(std::vector<std::wstring>& _rwNames) const
|
||||||
_rwNames.push_back(L"");
|
_rwNames.push_back(L"");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 42; ++i)
|
for (int j = 0; j < 42; ++j)
|
||||||
{
|
{
|
||||||
u16 t = Common::swap16(temp[i]);
|
u16 t = Common::swap16(temp[j]);
|
||||||
if (t == 0 && i > 0)
|
if (t == 0 && j > 0)
|
||||||
{
|
{
|
||||||
if (out_temp.at(out_temp.size()-1) != ' ')
|
if (out_temp.at(out_temp.size()-1) != ' ')
|
||||||
out_temp.push_back(' ');
|
out_temp.push_back(' ');
|
||||||
|
|
|
@ -483,8 +483,7 @@ void FifoPlayerDlg::OnBeginSearch(wxCommandEvent& event)
|
||||||
SearchResult result;
|
SearchResult result;
|
||||||
result.frame_idx = frame_idx;
|
result.frame_idx = frame_idx;
|
||||||
|
|
||||||
int obj_idx = m_objectsList->GetSelection();
|
result.obj_idx = m_objectsList->GetSelection();
|
||||||
result.obj_idx = obj_idx;
|
|
||||||
result.cmd_idx = 0;
|
result.cmd_idx = 0;
|
||||||
for (unsigned int cmd_idx = 1; cmd_idx < m_objectCmdOffsets.size(); ++cmd_idx)
|
for (unsigned int cmd_idx = 1; cmd_idx < m_objectCmdOffsets.size(); ++cmd_idx)
|
||||||
{
|
{
|
||||||
|
@ -642,8 +641,8 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
m_objectCmdOffsets.push_back(objectdata - objectdata_start);
|
m_objectCmdOffsets.push_back(objectdata - objectdata_start);
|
||||||
int new_offset = objectdata - &fifo_frame.fifoData[frame.objectStarts[0]];
|
int new_offset = objectdata - &fifo_frame.fifoData[frame.objectStarts[0]];
|
||||||
int cmd = *objectdata++;
|
int command = *objectdata++;
|
||||||
switch (cmd)
|
switch (command)
|
||||||
{
|
{
|
||||||
case GX_NOP:
|
case GX_NOP:
|
||||||
newLabel = _("NOP");
|
newLabel = _("NOP");
|
||||||
|
@ -691,9 +690,9 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
|
||||||
case GX_LOAD_INDX_C:
|
case GX_LOAD_INDX_C:
|
||||||
case GX_LOAD_INDX_D:
|
case GX_LOAD_INDX_D:
|
||||||
objectdata += 4;
|
objectdata += 4;
|
||||||
newLabel = wxString::Format(wxT("LOAD INDX %s"), (cmd == GX_LOAD_INDX_A) ? _("A") :
|
newLabel = wxString::Format(wxT("LOAD INDX %s"), (command == GX_LOAD_INDX_A) ? _("A") :
|
||||||
(cmd == GX_LOAD_INDX_B) ? _("B") :
|
(command == GX_LOAD_INDX_B) ? _("B") :
|
||||||
(cmd == GX_LOAD_INDX_C) ? _("C") : _("D"));
|
(command == GX_LOAD_INDX_C) ? _("C") : _("D"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GX_CMD_CALL_DL:
|
case GX_CMD_CALL_DL:
|
||||||
|
|
|
@ -1099,8 +1099,8 @@ wxBitmap TASInputDlg::CreateStickBitmap(int x, int y)
|
||||||
y = y/2;
|
y = y/2;
|
||||||
|
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
wxBitmap bitmap(127, 127);
|
wxBitmap stick_bitmap(127, 127);
|
||||||
memDC.SelectObject(bitmap);
|
memDC.SelectObject(stick_bitmap);
|
||||||
memDC.SetBackground(*wxLIGHT_GREY_BRUSH);
|
memDC.SetBackground(*wxLIGHT_GREY_BRUSH);
|
||||||
memDC.Clear();
|
memDC.Clear();
|
||||||
memDC.SetBrush(*wxWHITE_BRUSH);
|
memDC.SetBrush(*wxWHITE_BRUSH);
|
||||||
|
@ -1116,5 +1116,5 @@ wxBitmap TASInputDlg::CreateStickBitmap(int x, int y)
|
||||||
memDC.SetBrush(*wxBLUE_BRUSH);
|
memDC.SetBrush(*wxBLUE_BRUSH);
|
||||||
memDC.DrawCircle(x,y,5);
|
memDC.DrawCircle(x,y,5);
|
||||||
memDC.SelectObject(wxNullBitmap);
|
memDC.SelectObject(wxNullBitmap);
|
||||||
return bitmap;
|
return stick_bitmap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace HwRasterizer
|
||||||
float efbHalfHeight;
|
float efbHalfHeight;
|
||||||
bool hasTexture;
|
bool hasTexture;
|
||||||
|
|
||||||
u8 *temp;
|
u8 *temp;
|
||||||
|
|
||||||
// Programs
|
// Programs
|
||||||
static GLuint colProg, texProg, clearProg;
|
static GLuint colProg, texProg, clearProg;
|
||||||
|
@ -61,7 +61,7 @@ namespace HwRasterizer
|
||||||
" gl_FragColor = " TEXFUNC "(Texture, TexCoordOut.xy);\n"
|
" gl_FragColor = " TEXFUNC "(Texture, TexCoordOut.xy);\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
// Clear shader
|
// Clear shader
|
||||||
static const char *fragclearText =
|
static const char *fragclearText =
|
||||||
"uniform " PREC " vec4 Color;\n"
|
"uniform " PREC " vec4 Color;\n"
|
||||||
"void main() {\n"
|
"void main() {\n"
|
||||||
" gl_FragColor = Color;\n"
|
" gl_FragColor = Color;\n"
|
||||||
|
@ -75,7 +75,7 @@ namespace HwRasterizer
|
||||||
" gl_Position = pos;\n"
|
" gl_Position = pos;\n"
|
||||||
" TexCoordOut = TexCoordIn;\n"
|
" TexCoordOut = TexCoordIn;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
static const char *vertclearText =
|
static const char *vertclearText =
|
||||||
"attribute vec4 pos;\n"
|
"attribute vec4 pos;\n"
|
||||||
"void main() {\n"
|
"void main() {\n"
|
||||||
" gl_Position = pos;\n"
|
" gl_Position = pos;\n"
|
||||||
|
@ -92,11 +92,11 @@ namespace HwRasterizer
|
||||||
|
|
||||||
// Color attributes
|
// Color attributes
|
||||||
col_apos = glGetAttribLocation(colProg, "pos");
|
col_apos = glGetAttribLocation(colProg, "pos");
|
||||||
col_atex = glGetAttribLocation(colProg, "TexCoordIn");
|
col_atex = glGetAttribLocation(colProg, "TexCoordIn");
|
||||||
// Texture attributes
|
// Texture attributes
|
||||||
tex_apos = glGetAttribLocation(texProg, "pos");
|
tex_apos = glGetAttribLocation(texProg, "pos");
|
||||||
tex_atex = glGetAttribLocation(texProg, "TexCoordIn");
|
tex_atex = glGetAttribLocation(texProg, "TexCoordIn");
|
||||||
tex_utex = glGetUniformLocation(texProg, "Texture");
|
tex_utex = glGetUniformLocation(texProg, "Texture");
|
||||||
// Clear attributes
|
// Clear attributes
|
||||||
clear_apos = glGetAttribLocation(clearProg, "pos");
|
clear_apos = glGetAttribLocation(clearProg, "pos");
|
||||||
clear_ucol = glGetUniformLocation(clearProg, "Color");
|
clear_ucol = glGetUniformLocation(clearProg, "Color");
|
||||||
|
@ -131,7 +131,7 @@ namespace HwRasterizer
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
glClientActiveTexture(GL_TEXTURE0);
|
glClientActiveTexture(GL_TEXTURE0);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||||
glEnable(GL_TEXTURE_RECTANGLE_ARB);
|
glEnable(GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
@ -179,7 +179,7 @@ namespace HwRasterizer
|
||||||
hasTexture = bpmem.tevorders[0].enable0;
|
hasTexture = bpmem.tevorders[0].enable0;
|
||||||
|
|
||||||
if (hasTexture)
|
if (hasTexture)
|
||||||
LoadTexture();
|
LoadTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndTriangles()
|
void EndTriangles()
|
||||||
|
@ -204,15 +204,15 @@ namespace HwRasterizer
|
||||||
float z2 = v2->screenPosition.z / (float)0x00ffffff;
|
float z2 = v2->screenPosition.z / (float)0x00ffffff;
|
||||||
|
|
||||||
float r0 = v0->color[0][OutputVertexData::RED_C] / 255.0f;
|
float r0 = v0->color[0][OutputVertexData::RED_C] / 255.0f;
|
||||||
float g0 = v0->color[0][OutputVertexData::GRN_C] / 255.0f;
|
float g0 = v0->color[0][OutputVertexData::GRN_C] / 255.0f;
|
||||||
float b0 = v0->color[0][OutputVertexData::BLU_C] / 255.0f;
|
float b0 = v0->color[0][OutputVertexData::BLU_C] / 255.0f;
|
||||||
|
|
||||||
float r1 = v1->color[0][OutputVertexData::RED_C] / 255.0f;
|
float r1 = v1->color[0][OutputVertexData::RED_C] / 255.0f;
|
||||||
float g1 = v1->color[0][OutputVertexData::GRN_C] / 255.0f;
|
float g1 = v1->color[0][OutputVertexData::GRN_C] / 255.0f;
|
||||||
float b1 = v1->color[0][OutputVertexData::BLU_C] / 255.0f;
|
float b1 = v1->color[0][OutputVertexData::BLU_C] / 255.0f;
|
||||||
|
|
||||||
float r2 = v2->color[0][OutputVertexData::RED_C] / 255.0f;
|
float r2 = v2->color[0][OutputVertexData::RED_C] / 255.0f;
|
||||||
float g2 = v2->color[0][OutputVertexData::GRN_C] / 255.0f;
|
float g2 = v2->color[0][OutputVertexData::GRN_C] / 255.0f;
|
||||||
float b2 = v2->color[0][OutputVertexData::BLU_C] / 255.0f;
|
float b2 = v2->color[0][OutputVertexData::BLU_C] / 255.0f;
|
||||||
|
|
||||||
static const GLfloat verts[3][3] = {
|
static const GLfloat verts[3][3] = {
|
||||||
|
@ -339,17 +339,17 @@ namespace HwRasterizer
|
||||||
texImage3.hex = texUnit.texImage3[0].hex;
|
texImage3.hex = texUnit.texImage3[0].hex;
|
||||||
texTlut.hex = texUnit.texTlut[0].hex;
|
texTlut.hex = texUnit.texTlut[0].hex;
|
||||||
|
|
||||||
int width = texImage0.width;
|
int image_width = texImage0.width;
|
||||||
int height = texImage0.height;
|
int image_height = texImage0.height;
|
||||||
|
|
||||||
DebugUtil::GetTextureBGRA(temp, 0, 0, width, height);
|
DebugUtil::GetTextureBGRA(temp, 0, 0, image_width, image_height);
|
||||||
|
|
||||||
glGenTextures(1, (GLuint *)&texture);
|
glGenTextures(1, (GLuint *)&texture);
|
||||||
glBindTexture(TEX2D, texture);
|
glBindTexture(TEX2D, texture);
|
||||||
#ifdef USE_GLES
|
#ifdef USE_GLES
|
||||||
glTexImage2D(TEX2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, temp);
|
glTexImage2D(TEX2D, 0, GL_RGBA, (GLsizei)image_width, (GLsizei)image_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, temp);
|
||||||
#else
|
#else
|
||||||
glTexImage2D(TEX2D, 0, GL_RGBA8, (GLsizei)width, (GLsizei)height, 0, GL_BGRA, GL_UNSIGNED_BYTE, temp);
|
glTexImage2D(TEX2D, 0, GL_RGBA8, (GLsizei)image_width, (GLsizei)image_height, 0, GL_BGRA, GL_UNSIGNED_BYTE, temp);
|
||||||
#endif
|
#endif
|
||||||
GL_REPORT_ERRORD();
|
GL_REPORT_ERRORD();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue