0
所以我與移植PRBoom武裝,我可以在一個問題玩耍困惑......通過函數簽名
有下面的代碼....
R_DrawColumn_f R_GetDrawColumnFunc(enum column_pipeline_e type,
enum draw_filter_type_e filter,
enum draw_filter_type_e filterz) {
R_DrawColumn_f result = drawcolumnfuncs[V_GetMode()][filterz][filter][type];
if (result == NULL)
I_Error("R_GetDrawColumnFunc: undefined function (%d, %d, %d)",
type, filter, filterz);
return result;
}
將會產生
04-12 12:58:45.970: E/DJNI(16943): Sys Error: R_GetDrawColumnFunc: undefined function (2, 1, 0)
因此,我的理解是,drawcolumnfuncs方法會失靈。但這裏是我奮鬥,我不知道這是什麼功能的簽名是做...
static R_DrawColumn_f drawcolumnfuncs[VID_MODEMAX][RDRAW_FILTER_MAXFILTERS][RDRAW_FILTER_MAXFILTERS][RDC_PIPELINE_MAXPIPELINES] = {
{
{
{NULL, NULL, NULL, NULL,},
{R_DrawColumn8_PointUV,
R_DrawTLColumn8_PointUV,
R_DrawTranslatedColumn8_PointUV,
R_DrawFuzzColumn8_PointUV,},
{R_DrawColumn8_LinearUV,
R_DrawTLColumn8_LinearUV,
R_DrawTranslatedColumn8_LinearUV,
R_DrawFuzzColumn8_LinearUV,},
{R_DrawColumn8_RoundedUV,
R_DrawTLColumn8_RoundedUV,
R_DrawTranslatedColumn8_RoundedUV,
R_DrawFuzzColumn8_RoundedUV,},
},
...
這只是看起來像它正在一個HashMap的C版,但爲什麼會返回null呢?
啊,我明白了,謝謝! – Jackie