mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
checks size of surface table when adding a surface entry
This commit is contained in:
parent
78363391a1
commit
2e8c0c17cc
@ -78,6 +78,12 @@ init_surface_table(PN_uint8 num_surfaces)
|
|||||||
void OdeWorld::
|
void OdeWorld::
|
||||||
set_surface(int pos1, int pos2, sSurfaceParams& entry)
|
set_surface(int pos1, int pos2, sSurfaceParams& entry)
|
||||||
{
|
{
|
||||||
|
odeworld_cat.debug() << " pos1 " << pos1 << " pos2 " << pos2 << " num surfaces " << (int)_num_surfaces << " endline\n";
|
||||||
|
if((_num_surfaces <= pos1) || (_num_surfaces <= pos2))
|
||||||
|
{
|
||||||
|
odeworld_cat.error() << "surface position exceeds size of surface table, set num_surface in initSurfaceTable higher." << "\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
int true_pos = (pos1 * _num_surfaces) + pos2;
|
int true_pos = (pos1 * _num_surfaces) + pos2;
|
||||||
_surface_table[true_pos].colparams.mode = entry.colparams.mode;
|
_surface_table[true_pos].colparams.mode = entry.colparams.mode;
|
||||||
_surface_table[true_pos].colparams.mu = entry.colparams.mu;
|
_surface_table[true_pos].colparams.mu = entry.colparams.mu;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user