mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
made renderer (original quake III) work with SDL
This commit is contained in:
parent
306d282639
commit
7b79877516
21 changed files with 334 additions and 344 deletions
|
@ -237,11 +237,13 @@ if (WITH_CLIENT)
|
|||
|
||||
file(GLOB_RECURSE SOURCES_CLIENT "code/client/*.c" "code/client/*.cpp" "code/qcommon/puff.c")
|
||||
file(GLOB_RECURSE SOURCES_UILIB "code/uilib/*.c" "code/uilib/*.cpp")
|
||||
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderer/*.c" "code/renderer/*.cpp")
|
||||
include("code/renderergl2/glsl/shaders.cmake")
|
||||
file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
|
||||
list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_subs.c")
|
||||
list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_model.c")
|
||||
file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderer/*.c" "code/renderer/*.cpp")
|
||||
|
||||
#include("code/renderergl2/glsl/shaders.cmake")
|
||||
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
|
||||
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_subs.c")
|
||||
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_model.c")
|
||||
|
||||
set(SOURCES_CLIENT_APP ${SOURCES_APP} ${SOURCES_SERVER} ${SOURCES_CLIENT} ${SOURCES_UILIB} ${SOURCES_LIBS} ${SOURCES_RENDERER} ${SHADER_SRCS})
|
||||
|
||||
add_executable(openmohaa ${SOURCES_PLATFORM_SPECIFIC} ${SOURCES_CLIENT_APP} ${SOURCES_CLIENT_PLATFORM_SPECIFIC})
|
||||
|
|
|
@ -480,8 +480,8 @@ void CL_ShutdownCGame( void ) {
|
|||
|
||||
Sys_UnloadCGame();
|
||||
|
||||
if( re.newre.FreeModels ) {
|
||||
re.newre.FreeModels();
|
||||
if( re.FreeModels ) {
|
||||
re.FreeModels();
|
||||
}
|
||||
|
||||
Z_FreeTags( TAG_CGAME );
|
||||
|
@ -586,12 +586,12 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->CM_PointLeafnum = CM_PointLeafnum;
|
||||
cgi->CM_LeafInPVS = CM_LeafInPVS;
|
||||
|
||||
cgi->R_MarkFragments = re.newre.MarkFragments;
|
||||
cgi->R_MarkFragmentsForInlineModel = re.newre.MarkFragmentsForInlineModel;
|
||||
cgi->R_GetInlineModelBounds = re.newre.GetInlineModelBounds;
|
||||
cgi->R_GetLightingForDecal = re.newre.GetLightingForDecal;
|
||||
cgi->R_GetLightingForSmoke = re.newre.GetLightingForSmoke;
|
||||
cgi->R_GatherLightSources = re.newre.R_GatherLightSources;
|
||||
cgi->R_MarkFragments = re.MarkFragments;
|
||||
cgi->R_MarkFragmentsForInlineModel = re.MarkFragmentsForInlineModel;
|
||||
cgi->R_GetInlineModelBounds = re.GetInlineModelBounds;
|
||||
cgi->R_GetLightingForDecal = re.GetLightingForDecal;
|
||||
cgi->R_GetLightingForSmoke = re.GetLightingForSmoke;
|
||||
cgi->R_GatherLightSources = re.R_GatherLightSources;
|
||||
|
||||
cgi->S_StartSound = S_StartSound;
|
||||
cgi->S_StartLocalSound = CL_StartLocalSound;
|
||||
|
@ -620,39 +620,39 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->R_RenderScene = re.RenderScene;
|
||||
|
||||
cgi->R_LoadWorldMap = re.LoadWorld;
|
||||
cgi->R_PrintBSPFileSizes = re.newre.PrintBSPFileSizes;
|
||||
cgi->R_MapVersion = re.newre.MapVersion;
|
||||
cgi->R_PrintBSPFileSizes = re.PrintBSPFileSizes;
|
||||
cgi->R_MapVersion = re.MapVersion;
|
||||
cgi->R_RegisterModel = re.RegisterModel;
|
||||
cgi->R_SpawnEffectModel = re.newre.SpawnEffectModel;
|
||||
cgi->R_RegisterServerModel = re.newre.RegisterServerModel;
|
||||
cgi->R_UnregisterServerModel = re.newre.UnregisterServerModel;
|
||||
cgi->R_SpawnEffectModel = re.SpawnEffectModel;
|
||||
cgi->R_RegisterServerModel = re.RegisterServerModel;
|
||||
cgi->R_UnregisterServerModel = re.UnregisterServerModel;
|
||||
cgi->R_RegisterShader = re.RegisterShader;
|
||||
cgi->R_RegisterShaderNoMip = re.RegisterShaderNoMip;
|
||||
|
||||
cgi->R_AddRefEntityToScene = re.newre.AddRefEntityToScene;
|
||||
cgi->R_AddRefSpriteToScene = re.newre.AddRefSpriteToScene;
|
||||
cgi->R_AddRefEntityToScene = re.AddRefEntityToScene;
|
||||
cgi->R_AddRefSpriteToScene = re.AddRefSpriteToScene;
|
||||
|
||||
cgi->R_AddLightToScene = re.newre.AddLightToScene;
|
||||
cgi->R_AddPolyToScene = re.newre.AddPolyToScene;
|
||||
cgi->R_AddTerrainMarkToScene = re.newre.AddTerrainMarkToScene;
|
||||
cgi->R_AddLightToScene = re.AddLightToScene;
|
||||
cgi->R_AddPolyToScene = re.AddPolyToScene;
|
||||
cgi->R_AddTerrainMarkToScene = re.AddTerrainMarkToScene;
|
||||
cgi->R_SetColor = re.SetColor;
|
||||
cgi->R_DrawStretchPic = re.DrawStretchPic;
|
||||
cgi->R_LoadFont = re.newre.LoadFont;
|
||||
cgi->R_DrawString = re.newre.DrawString;
|
||||
cgi->R_ModelBounds = re.newre.ModelBounds;
|
||||
cgi->R_ModelRadius = re.newre.ModelRadius;
|
||||
cgi->R_GetRenderEntity = re.newre.GetRenderEntity;
|
||||
cgi->R_Noise = re.newre.Noise;
|
||||
cgi->R_DebugLine = re.newre.DebugLine;
|
||||
cgi->R_LoadFont = re.LoadFont;
|
||||
cgi->R_DrawString = re.DrawString;
|
||||
cgi->R_ModelBounds = re.ModelBounds;
|
||||
cgi->R_ModelRadius = re.ModelRadius;
|
||||
cgi->R_GetRenderEntity = re.GetRenderEntity;
|
||||
cgi->R_Noise = re.Noise;
|
||||
cgi->R_DebugLine = re.DebugLine;
|
||||
|
||||
cgi->GetShader = CL_GetShaderPointer;
|
||||
cgi->R_GetShaderWidth = re.newre.GetShaderWidth;
|
||||
cgi->R_GetShaderHeight = re.newre.GetShaderHeight;
|
||||
cgi->R_GetShaderWidth = re.GetShaderWidth;
|
||||
cgi->R_GetShaderHeight = re.GetShaderHeight;
|
||||
|
||||
cgi->R_DrawBox = re.newre.DrawBox;
|
||||
cgi->R_SwipeBegin = re.newre.SwipeBegin;
|
||||
cgi->R_SwipePoint = re.newre.SwipePoint;
|
||||
cgi->R_SwipeEnd = re.newre.SwipeEnd;
|
||||
cgi->R_DrawBox = re.DrawBox;
|
||||
cgi->R_SwipeBegin = re.SwipeBegin;
|
||||
cgi->R_SwipePoint = re.SwipePoint;
|
||||
cgi->R_SwipeEnd = re.SwipeEnd;
|
||||
|
||||
cgi->GetGameState = CL_GetGameState;
|
||||
cgi->GetSnapshot = CL_GetSnapshot;
|
||||
|
@ -684,7 +684,7 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->Key_KeynumToBindString = Key_KeynumToBindString;
|
||||
cgi->Key_GetKeysForCommand = Key_GetKeysForCommand;
|
||||
|
||||
cgi->R_Model_GetHandle = re.newre.R_Model_GetHandle;
|
||||
cgi->R_Model_GetHandle = re.R_Model_GetHandle;
|
||||
|
||||
cgi->TIKI_NumAnims = TIKI_NumAnims;
|
||||
cgi->TIKI_CalculateBounds = TIKI_CalculateBounds;
|
||||
|
@ -709,9 +709,9 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->Tag_NumForName = TIKI_Tag_NameToNum;
|
||||
cgi->Tag_NameForNum = TIKI_Tag_NumToName;
|
||||
|
||||
cgi->ForceUpdatePose = re.newre.ForceUpdatePose;
|
||||
cgi->TIKI_Orientation = re.newre.TIKI_Orientation;
|
||||
cgi->TIKI_IsOnGround = re.newre.TIKI_IsOnGround;
|
||||
cgi->ForceUpdatePose = re.ForceUpdatePose;
|
||||
cgi->TIKI_Orientation = re.TIKI_Orientation;
|
||||
cgi->TIKI_IsOnGround = re.TIKI_IsOnGround;
|
||||
|
||||
cgi->UI_ShowScoreBoard = UI_ShowScoreboard_f;
|
||||
cgi->UI_HideScoreBoard = UI_HideScoreboard_f;
|
||||
|
|
|
@ -2329,7 +2329,7 @@ void CL_CheckUserinfo( void ) {
|
|||
}
|
||||
|
||||
void CL_SetFrameNumber(int frameNumber) {
|
||||
re.newre.SetFrameNumber(frameNumber);
|
||||
re.SetFrameNumber(frameNumber);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2738,8 +2738,8 @@ void CL_InitRef( void ) {
|
|||
ri.Milliseconds = CL_ScaledMilliseconds;
|
||||
ri.Malloc = CL_RefMalloc;
|
||||
ri.Free = Z_Free;
|
||||
ri.newri.Clear = CL_RefClear;
|
||||
ri.newri.Hunk_Clear = CL_RefStaticClear;
|
||||
ri.Clear = CL_RefClear;
|
||||
ri.Hunk_Clear = CL_RefStaticClear;
|
||||
#ifdef HUNK_DEBUG
|
||||
ri.Hunk_AllocDebug = CL_RefStaticMallocDebug;
|
||||
#else
|
||||
|
@ -2749,12 +2749,12 @@ void CL_InitRef( void ) {
|
|||
ri.Hunk_FreeTempMemory = Hunk_FreeTempMemory;
|
||||
ri.CM_DrawDebugSurface = CM_DrawDebugSurface;
|
||||
|
||||
ri.newri.FS_OpenFile = FS_FOpenFileRead;
|
||||
ri.newri.FS_CloseFile = FS_FCloseFile;
|
||||
ri.newri.FS_Read = FS_Read;
|
||||
ri.newri.FS_Seek = FS_Seek;
|
||||
ri.FS_OpenFile = FS_FOpenFileRead;
|
||||
ri.FS_CloseFile = FS_FCloseFile;
|
||||
ri.FS_Read = FS_Read;
|
||||
ri.FS_Seek = FS_Seek;
|
||||
ri.FS_ReadFile = FS_ReadFile;
|
||||
ri.newri.FS_ReadFileEx = FS_ReadFileEx;
|
||||
ri.FS_ReadFileEx = FS_ReadFileEx;
|
||||
ri.FS_FreeFile = FS_FreeFile;
|
||||
ri.FS_WriteFile = CL_RefFS_WriteFile;
|
||||
ri.FS_FreeFileList = FS_FreeFileList;
|
||||
|
@ -2763,31 +2763,31 @@ void CL_InitRef( void ) {
|
|||
ri.FS_FileExists = FS_FileExists;
|
||||
ri.Cvar_Get = Cvar_Get;
|
||||
ri.Cvar_Set = Cvar_Set;
|
||||
ri.newri.Cvar_SetDefault = Cvar_SetDefault;
|
||||
ri.Cvar_SetDefault = Cvar_SetDefault;
|
||||
|
||||
ri.newri.CM_EntityString = CM_EntityString;
|
||||
ri.newri.CM_MapTime = CM_MapTime;
|
||||
ri.newri.CM_BoxTrace = CM_BoxTrace;
|
||||
ri.newri.CG_PermanentMark = CL_CG_PermanentMark;
|
||||
ri.newri.CG_PermanentTreadMarkDecal = CL_CG_PermanentTreadMarkDecal;
|
||||
ri.newri.CG_PermanentUpdateTreadMark = CL_CG_PermanentUpdateTreadMark;
|
||||
ri.newri.CM_TerrainSquareType = CM_TerrainSquareType;
|
||||
ri.newri.CG_ProcessInitCommands = CL_CG_ProcessInitCommands;
|
||||
ri.newri.CG_EndTiki = CL_CG_EndTiki;
|
||||
ri.newri.SetPerformanceCounters = CL_RefSetPerformanceCounters;
|
||||
ri.CM_EntityString = CM_EntityString;
|
||||
ri.CM_MapTime = CM_MapTime;
|
||||
ri.CM_BoxTrace = CM_BoxTrace;
|
||||
ri.CG_PermanentMark = CL_CG_PermanentMark;
|
||||
ri.CG_PermanentTreadMarkDecal = CL_CG_PermanentTreadMarkDecal;
|
||||
ri.CG_PermanentUpdateTreadMark = CL_CG_PermanentUpdateTreadMark;
|
||||
ri.CM_TerrainSquareType = CM_TerrainSquareType;
|
||||
ri.CG_ProcessInitCommands = CL_CG_ProcessInitCommands;
|
||||
ri.CG_EndTiki = CL_CG_EndTiki;
|
||||
ri.SetPerformanceCounters = CL_RefSetPerformanceCounters;
|
||||
|
||||
ri.newri.DebugLines = &DebugLines;
|
||||
ri.newri.numDebugLines = &numDebugLines;
|
||||
ri.newri.DebugStrings = &DebugStrings;
|
||||
ri.newri.numDebugStrings = &numDebugStrings;
|
||||
ri.DebugLines = &DebugLines;
|
||||
ri.numDebugLines = &numDebugLines;
|
||||
ri.DebugStrings = &DebugStrings;
|
||||
ri.numDebugStrings = &numDebugStrings;
|
||||
|
||||
ri.newri.TIKI_OrientationInternal = TIKI_OrientationInternal;
|
||||
ri.newri.TIKI_IsOnGroundInternal = TIKI_IsOnGroundInternal;
|
||||
ri.newri.TIKI_SetPoseInternal = TIKI_SetPoseInternal;
|
||||
ri.newri.TIKI_Alloc = TIKI_Alloc;
|
||||
ri.newri.GetRadiusInternal = TIKI_GetRadiusInternal;
|
||||
ri.newri.GetCentroidRadiusInternal = TIKI_GetCentroidRadiusInternal;
|
||||
ri.newri.GetFrameInternal = TIKI_GetFrameInternal;
|
||||
ri.TIKI_OrientationInternal = TIKI_OrientationInternal;
|
||||
ri.TIKI_IsOnGroundInternal = TIKI_IsOnGroundInternal;
|
||||
ri.TIKI_SetPoseInternal = TIKI_SetPoseInternal;
|
||||
ri.TIKI_Alloc = TIKI_Alloc;
|
||||
ri.GetRadiusInternal = TIKI_GetRadiusInternal;
|
||||
ri.GetCentroidRadiusInternal = TIKI_GetCentroidRadiusInternal;
|
||||
ri.GetFrameInternal = TIKI_GetFrameInternal;
|
||||
|
||||
//
|
||||
// ioq3 stuff
|
||||
|
@ -2868,7 +2868,7 @@ void CL_InitRef( void ) {
|
|||
qboolean CL_SetVidMode( int mode ) {
|
||||
qboolean ret;
|
||||
|
||||
ret = re.newre.SetMode( mode, &cls.glconfig );
|
||||
ret = re.SetMode( mode, &cls.glconfig );
|
||||
|
||||
if( cge ) {
|
||||
cge->CG_GetRendererConfig();
|
||||
|
@ -2879,7 +2879,7 @@ qboolean CL_SetVidMode( int mode ) {
|
|||
}
|
||||
|
||||
void CL_SetFullscreen( qboolean fullscreen ) {
|
||||
re.newre.SetFullscreen( fullscreen );
|
||||
re.SetFullscreen( fullscreen );
|
||||
|
||||
if( cge ) {
|
||||
cge->CG_GetRendererConfig();
|
||||
|
@ -2925,7 +2925,7 @@ void CL_TikiInfoCommand_f( void ) {
|
|||
|
||||
COM_DefaultExtension( modelname, sizeof( modelname ), ".tik" );
|
||||
hModel = re.RegisterModel( modelname );
|
||||
tiki = re.newre.R_Model_GetHandle( hModel );
|
||||
tiki = re.R_Model_GetHandle( hModel );
|
||||
|
||||
TIKI_ModelInfo( tiki );
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@ void SCR_DrawScreenField( void ) {
|
|||
if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) {
|
||||
re.SetColor( g_color_table[0] );
|
||||
//re.DrawStretchPic( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, 0, 0, 0, cls.whiteShader );
|
||||
re.newre.DrawBox( 0, 0, cls.glconfig.vidHeight, cls.glconfig.vidWidth );
|
||||
re.DrawBox( 0, 0, cls.glconfig.vidHeight, cls.glconfig.vidWidth );
|
||||
re.SetColor( NULL );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1637,10 +1637,10 @@ UI_ClearBackground
|
|||
====================
|
||||
*/
|
||||
void UI_ClearBackground( void ) {
|
||||
re.newre.Set2DWindow( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, -1, -1 );
|
||||
re.newre.Scissor( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight );
|
||||
re.Set2DWindow( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, -1, -1 );
|
||||
re.Scissor( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight );
|
||||
re.SetColor( g_color_table[ 0 ] );
|
||||
re.newre.DrawBox( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight );
|
||||
re.DrawBox( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight );
|
||||
re.SetColor( NULL );
|
||||
}
|
||||
|
||||
|
@ -1712,7 +1712,7 @@ void UI_Update(void) {
|
|||
Menu* currentMenu;
|
||||
UIRect2D frame;
|
||||
|
||||
re.newre.SetRenderTime(cls.realtime);
|
||||
re.SetRenderTime(cls.realtime);
|
||||
CL_FillUIDef();
|
||||
uWinMan.ServiceEvents();
|
||||
|
||||
|
@ -3704,17 +3704,17 @@ CL_FillUIImports
|
|||
====================
|
||||
*/
|
||||
void CL_FillUIImports( void ) {
|
||||
uii.Rend_DrawBox = re.newre.DrawBox;
|
||||
uii.Rend_DrawBox = re.DrawBox;
|
||||
uii.Rend_DrawPicStretched = re.DrawStretchPic;
|
||||
uii.Rend_DrawPicTiled = re.newre.DrawTilePic;
|
||||
uii.Rend_GetShaderHeight = re.newre.GetShaderHeight;
|
||||
uii.Rend_GetShaderWidth = re.newre.GetShaderWidth;
|
||||
uii.Rend_DrawString = re.newre.DrawString;
|
||||
uii.Rend_LoadFont = re.newre.LoadFont;
|
||||
uii.Rend_DrawPicTiled = re.DrawTilePic;
|
||||
uii.Rend_GetShaderHeight = re.GetShaderHeight;
|
||||
uii.Rend_GetShaderWidth = re.GetShaderWidth;
|
||||
uii.Rend_DrawString = re.DrawString;
|
||||
uii.Rend_LoadFont = re.LoadFont;
|
||||
uii.Rend_RegisterMaterial = re.RegisterShaderNoMip;
|
||||
uii.Rend_RefreshMaterial = re.newre.RefreshShaderNoMip;
|
||||
uii.Rend_Scissor = re.newre.Scissor;
|
||||
uii.Rend_Set2D = re.newre.Set2DWindow;
|
||||
uii.Rend_RefreshMaterial = re.RefreshShaderNoMip;
|
||||
uii.Rend_Scissor = re.Scissor;
|
||||
uii.Rend_Set2D = re.Set2DWindow;
|
||||
uii.Rend_SetColor = re.SetColor;
|
||||
|
||||
uii.Cmd_Stuff = Cbuf_AddText;
|
||||
|
|
|
@ -491,13 +491,13 @@ void UIFakkLabel::DrawStatbar( float frac )
|
|||
float width = frac * m_frame.size.width;
|
||||
|
||||
m_statbar_material->ReregisterMaterial();
|
||||
re.newre.DrawTilePic(0.0, 0.0, width, m_frame.size.height, m_statbar_material->GetMaterial());
|
||||
re.DrawTilePic(0.0, 0.0, width, m_frame.size.height, m_statbar_material->GetMaterial());
|
||||
|
||||
if (alpha != 0.0 && m_statbar_material_flash)
|
||||
{
|
||||
re.SetColor(col);
|
||||
m_statbar_material_flash->ReregisterMaterial();
|
||||
re.newre.DrawTilePic(0.0, 0.0, width, m_frame.size.height, m_statbar_material_flash->GetMaterial());
|
||||
re.DrawTilePic(0.0, 0.0, width, m_frame.size.height, m_statbar_material_flash->GetMaterial());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -509,13 +509,13 @@ void UIFakkLabel::DrawStatbar( float frac )
|
|||
float y = m_frame.size.height * (1.0 - frac);
|
||||
|
||||
m_statbar_material->ReregisterMaterial();
|
||||
re.newre.DrawTilePic(0.0, y, m_frame.size.width, m_frame.size.height, m_statbar_material->GetMaterial());
|
||||
re.DrawTilePic(0.0, y, m_frame.size.width, m_frame.size.height, m_statbar_material->GetMaterial());
|
||||
|
||||
if (alpha != 0.0 && m_statbar_material_flash)
|
||||
{
|
||||
re.SetColor(col);
|
||||
m_statbar_material_flash->ReregisterMaterial();
|
||||
re.newre.DrawTilePic(0.0, y, m_frame.size.width, m_frame.size.height, m_statbar_material_flash->GetMaterial());
|
||||
re.DrawTilePic(0.0, y, m_frame.size.width, m_frame.size.height, m_statbar_material_flash->GetMaterial());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -821,7 +821,7 @@ void UIFakkLabel::DrawStatCompass( float frac )
|
|||
vVerts[2][1] = vCenter[1] - vCompassDir[1] * vCenter[1] - fSinVal * vCenter[0];
|
||||
|
||||
m_statbar_material->ReregisterMaterial();
|
||||
re.newre.DrawTrianglePic(vVerts, vTexCoords, m_statbar_material->GetMaterial());
|
||||
re.DrawTrianglePic(vVerts, vTexCoords, m_statbar_material->GetMaterial());
|
||||
|
||||
vVerts[0][0] = vVerts[2][0];
|
||||
vVerts[0][1] = vVerts[2][1];
|
||||
|
@ -834,7 +834,7 @@ void UIFakkLabel::DrawStatCompass( float frac )
|
|||
vVerts[2][1] = vCenter[1] * fSinVal + vCenter[0] - vCompassDir[1] * vCenter[1];
|
||||
|
||||
m_statbar_material->ReregisterMaterial();
|
||||
re.newre.DrawTrianglePic(vVerts, vTexCoords, m_statbar_material->GetMaterial());
|
||||
re.DrawTrianglePic(vVerts, vTexCoords, m_statbar_material->GetMaterial());
|
||||
}
|
||||
|
||||
void UIFakkLabel::DrawStatSpinner( float frac )
|
||||
|
|
|
@ -55,7 +55,7 @@ void View3D::Draw
|
|||
|
||||
set2D();
|
||||
|
||||
re.newre.SavePerformanceCounters();
|
||||
re.SavePerformanceCounters();
|
||||
|
||||
Draw2D();
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ void View3D::DrawFPS
|
|||
if (fps->integer == 2)
|
||||
{
|
||||
re.SetColor(UBlack);
|
||||
re.newre.DrawBox(
|
||||
re.DrawBox(
|
||||
0.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 4.0,
|
||||
m_frame.pos.x + m_frame.size.width,
|
||||
|
|
|
@ -266,7 +266,7 @@ static void R_LoadLightmaps(gamelump_t* l) {
|
|||
s_worldData.lighting = NULL;
|
||||
}
|
||||
else {
|
||||
s_worldData.lighting = ri.Hunk_Alloc(l->length);
|
||||
s_worldData.lighting = ri.Hunk_Alloc(l->length, h_dontcare);
|
||||
Com_Memcpy(s_worldData.lighting, l->buffer, l->length);
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ static void R_LoadVisibility(gamelump_t* l) {
|
|||
byte *buf;
|
||||
|
||||
len = ( s_worldData.numClusters + 63 ) & ~63;
|
||||
s_worldData.novis = ri.Hunk_Alloc( len );
|
||||
s_worldData.novis = ri.Hunk_Alloc( len, h_dontcare );
|
||||
Com_Memset( s_worldData.novis, 0xff, len );
|
||||
|
||||
len = l->length;
|
||||
|
@ -314,7 +314,7 @@ static void R_LoadVisibility(gamelump_t* l) {
|
|||
} else {
|
||||
byte *dest;
|
||||
|
||||
dest = ri.Hunk_Alloc( len - 8 );
|
||||
dest = ri.Hunk_Alloc( len - 8, h_dontcare );
|
||||
Com_Memcpy( dest, buf + 8, len - 8 );
|
||||
s_worldData.vis = dest;
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ void R_LoadSphereLightVis(gamelump_t* l) {
|
|||
while (entries[j] != -1);
|
||||
}
|
||||
if (j) {
|
||||
node->lights = ri.Hunk_Alloc(j * sizeof(spherel_t*));
|
||||
node->lights = ri.Hunk_Alloc(j * sizeof(spherel_t*), h_dontcare);
|
||||
node->numlights = j;
|
||||
h = 0;
|
||||
if (entries[0] == -2) {
|
||||
|
@ -560,7 +560,7 @@ void R_LoadTerrain(gamelump_t* lump) {
|
|||
}
|
||||
|
||||
s_worldData.numTerraPatches = lump->length / sizeof(cTerraPatch_t);
|
||||
s_worldData.terraPatches = ri.Hunk_Alloc(s_worldData.numTerraPatches * sizeof(cTerraPatchUnpacked_t));
|
||||
s_worldData.terraPatches = ri.Hunk_Alloc(s_worldData.numTerraPatches * sizeof(cTerraPatchUnpacked_t), h_dontcare);
|
||||
|
||||
in = lump->buffer;
|
||||
out = s_worldData.terraPatches;
|
||||
|
@ -591,7 +591,7 @@ void R_LoadTerrainIndexes(gamelump_t* lump) {
|
|||
}
|
||||
|
||||
s_worldData.numVisTerraPatches = lump->length / sizeof(short);
|
||||
s_worldData.visTerraPatches = ri.Hunk_Alloc(s_worldData.numVisTerraPatches * sizeof(cTerraPatchUnpacked_t*));
|
||||
s_worldData.visTerraPatches = ri.Hunk_Alloc(s_worldData.numVisTerraPatches * sizeof(cTerraPatchUnpacked_t*), h_dontcare);
|
||||
|
||||
in = lump->buffer;
|
||||
out = s_worldData.visTerraPatches;
|
||||
|
@ -635,7 +635,7 @@ static void ParseFace( dsurface_t *ds, drawVert_t *verts, msurface_t *surf, int
|
|||
ofsIndexes = sfaceSize;
|
||||
sfaceSize += sizeof( int ) * numIndexes;
|
||||
|
||||
cv = ri.Hunk_Alloc( sfaceSize );
|
||||
cv = ri.Hunk_Alloc( sfaceSize, h_dontcare );
|
||||
cv->surfaceType = SF_FACE;
|
||||
cv->numPoints = numPoints;
|
||||
cv->numIndices = numIndexes;
|
||||
|
@ -809,7 +809,7 @@ static void ParseTriSurf( dsurface_t *ds, drawVert_t *verts, msurface_t *surf, i
|
|||
numIndexes = LittleLong( ds->numIndexes );
|
||||
|
||||
tri = ri.Hunk_Alloc( sizeof( *tri ) + numVerts * sizeof( tri->verts[0] )
|
||||
+ numIndexes * sizeof( tri->indexes[0] ) );
|
||||
+ numIndexes * sizeof( tri->indexes[0] ), h_dontcare );
|
||||
tri->surfaceType = SF_TRIANGLES;
|
||||
tri->numVerts = numVerts;
|
||||
tri->numIndexes = numIndexes;
|
||||
|
@ -863,7 +863,7 @@ static void ParseFlare( dsurface_t *ds, drawVert_t *verts, msurface_t *surf, int
|
|||
surf->shader = tr.defaultShader;
|
||||
}
|
||||
|
||||
flare = ri.Hunk_Alloc( sizeof( *flare ) );
|
||||
flare = ri.Hunk_Alloc( sizeof( *flare ), h_dontcare );
|
||||
flare->surfaceType = SF_FLARE;
|
||||
|
||||
surf->data = (surfaceType_t *)flare;
|
||||
|
@ -1556,13 +1556,13 @@ void R_MovePatchSurfacesToHunk(void) {
|
|||
continue;
|
||||
//
|
||||
size = (grid->width * grid->height - 1) * sizeof( drawVert_t ) + sizeof( *grid );
|
||||
hunkgrid = ri.Hunk_Alloc( size );
|
||||
hunkgrid = ri.Hunk_Alloc( size, h_dontcare );
|
||||
Com_Memcpy(hunkgrid, grid, size);
|
||||
|
||||
hunkgrid->widthLodError = ri.Hunk_Alloc( grid->width * 4 );
|
||||
hunkgrid->widthLodError = ri.Hunk_Alloc( grid->width * 4, h_dontcare );
|
||||
Com_Memcpy( hunkgrid->widthLodError, grid->widthLodError, grid->width * 4 );
|
||||
|
||||
hunkgrid->heightLodError = ri.Hunk_Alloc( grid->height * 4 );
|
||||
hunkgrid->heightLodError = ri.Hunk_Alloc( grid->height * 4, h_dontcare );
|
||||
Com_Memcpy( grid->heightLodError, grid->heightLodError, grid->height * 4 );
|
||||
|
||||
R_FreeSurfaceGridMesh( grid );
|
||||
|
@ -1603,7 +1603,7 @@ static void R_LoadSurfaces(gamelump_t* surfs, gamelump_t* verts, gamelump_t* ind
|
|||
ri.Error(ERR_DROP, "LoadMap: funny lump size in %s", s_worldData.name);
|
||||
|
||||
in = (void*)surfs->buffer;
|
||||
out = ri.Hunk_Alloc ( count * sizeof(*out) );
|
||||
out = ri.Hunk_Alloc ( count * sizeof(*out), h_dontcare );
|
||||
|
||||
s_worldData.surfaces = out;
|
||||
s_worldData.numsurfaces = count;
|
||||
|
@ -1662,7 +1662,7 @@ static void R_LoadSubmodels(gamelump_t* l) {
|
|||
ri.Error(ERR_DROP, "LoadMap: funny lump size in %s", s_worldData.name);
|
||||
count = l->length / sizeof(*in);
|
||||
|
||||
s_worldData.bmodels = out = ri.Hunk_Alloc( count * sizeof(*out) );
|
||||
s_worldData.bmodels = out = ri.Hunk_Alloc( count * sizeof(*out), h_dontcare );
|
||||
|
||||
for ( i=0 ; i<count ; i++, in++, out++ ) {
|
||||
model_t *model;
|
||||
|
@ -1723,7 +1723,7 @@ static void R_LoadNodesAndLeafs(gamelump_t* nodeLump, gamelump_t* leafLump) {
|
|||
numNodes = nodeLump->length / sizeof(dnode_t);
|
||||
numLeafs = leafLump->length / sizeof(dleaf_t);
|
||||
|
||||
out = ri.Hunk_Alloc((numNodes + numLeafs) * sizeof(*out));
|
||||
out = ri.Hunk_Alloc((numNodes + numLeafs) * sizeof(*out), h_dontcare);
|
||||
|
||||
s_worldData.nodes = out;
|
||||
s_worldData.numnodes = numNodes + numLeafs;
|
||||
|
@ -1805,7 +1805,7 @@ static void R_LoadNodesAndLeafsOld(gamelump_t* nodeLump, gamelump_t* leafLump) {
|
|||
numNodes = nodeLump->length / sizeof(dnode_t);
|
||||
numLeafs = leafLump->length / sizeof(dleaf_t);
|
||||
|
||||
out = ri.Hunk_Alloc((numNodes + numLeafs) * sizeof(*out));
|
||||
out = ri.Hunk_Alloc((numNodes + numLeafs) * sizeof(*out), h_dontcare);
|
||||
|
||||
s_worldData.nodes = out;
|
||||
s_worldData.numnodes = numNodes + numLeafs;
|
||||
|
@ -1879,7 +1879,7 @@ static void R_LoadShaders(gamelump_t* l) {
|
|||
if (l->length % sizeof(*in))
|
||||
ri.Error(ERR_DROP, "LoadMap: funny lump size in %s", s_worldData.name);
|
||||
count = l->length / sizeof(*in);
|
||||
out = ri.Hunk_Alloc(count * sizeof(*out));
|
||||
out = ri.Hunk_Alloc(count * sizeof(*out), h_dontcare);
|
||||
|
||||
s_worldData.shaders = out;
|
||||
s_worldData.numShaders = count;
|
||||
|
@ -1908,7 +1908,7 @@ static void R_LoadMarksurfaces(gamelump_t* l)
|
|||
if (l->length % sizeof(*in))
|
||||
ri.Error(ERR_DROP, "LoadMap: funny lump size in %s", s_worldData.name);
|
||||
count = l->length / sizeof(*in);
|
||||
out = (msurface_t**)ri.Hunk_Alloc(count * sizeof(*out));
|
||||
out = (msurface_t**)ri.Hunk_Alloc(count * sizeof(*out), h_dontcare);
|
||||
|
||||
s_worldData.marksurfaces = out;
|
||||
s_worldData.nummarksurfaces = count;
|
||||
|
@ -1937,7 +1937,7 @@ static void R_LoadPlanes(gamelump_t* l) {
|
|||
if (l->length % sizeof(*in))
|
||||
ri.Error(ERR_DROP, "LoadMap: funny lump size in %s", s_worldData.name);
|
||||
count = l->length / sizeof(*in);
|
||||
out = ri.Hunk_Alloc(count * 2 * sizeof(*out));
|
||||
out = ri.Hunk_Alloc(count * 2 * sizeof(*out), h_dontcare);
|
||||
|
||||
s_worldData.planes = out;
|
||||
s_worldData.numplanes = count;
|
||||
|
@ -2011,11 +2011,11 @@ void R_LoadLightGrid(gamelump_t* plPal, gamelump_t* plOffsets, gamelump_t* plDat
|
|||
return;
|
||||
}
|
||||
|
||||
w->lightGridOffsets = ri.Hunk_Alloc(plOffsets->length);
|
||||
w->lightGridOffsets = ri.Hunk_Alloc(plOffsets->length, h_dontcare);
|
||||
Com_Memcpy(w->lightGridOffsets, plOffsets->buffer, plOffsets->length);
|
||||
Com_Memcpy(w->lightGridPalette, plPal->buffer, sizeof(s_worldData.lightGridPalette));
|
||||
|
||||
w->lightGridData = ri.Hunk_Alloc(plData->length);
|
||||
w->lightGridData = ri.Hunk_Alloc(plData->length, h_dontcare);
|
||||
Com_Memcpy(w->lightGridData, plData->buffer, plData->length);
|
||||
}
|
||||
|
||||
|
@ -2041,7 +2041,7 @@ void R_LoadStaticModelData(gamelump_t* lump) {
|
|||
}
|
||||
|
||||
s_worldData.numStaticModelData = lump->length / (sizeof(byte) * 3);
|
||||
s_worldData.staticModelData = (byte*)ri.Hunk_Alloc(s_worldData.numStaticModelData * sizeof(color4ub_t));
|
||||
s_worldData.staticModelData = (byte*)ri.Hunk_Alloc(s_worldData.numStaticModelData * sizeof(color4ub_t), h_dontcare);
|
||||
|
||||
pSrcColors = lump->buffer;
|
||||
pDstColors = s_worldData.staticModelData;
|
||||
|
@ -2097,7 +2097,7 @@ void R_LoadStaticModelDefs(gamelump_t* lump) {
|
|||
}
|
||||
|
||||
s_worldData.numStaticModels = lump->length / sizeof(cStaticModel_t);
|
||||
s_worldData.staticModels = ri.Hunk_Alloc(s_worldData.numStaticModels * sizeof(cStaticModelUnpacked_t));
|
||||
s_worldData.staticModels = ri.Hunk_Alloc(s_worldData.numStaticModels * sizeof(cStaticModelUnpacked_t), h_dontcare);
|
||||
|
||||
in = lump->buffer;
|
||||
out = s_worldData.staticModels;
|
||||
|
@ -2122,7 +2122,7 @@ void R_LoadStaticModelIndexes(gamelump_t* lump) {
|
|||
}
|
||||
|
||||
s_worldData.numVisStaticModels = lump->length / sizeof(short);
|
||||
s_worldData.visStaticModels = ri.Hunk_Alloc(s_worldData.numVisStaticModels * sizeof(cStaticModelUnpacked_t*));
|
||||
s_worldData.visStaticModels = ri.Hunk_Alloc(s_worldData.numVisStaticModels * sizeof(cStaticModelUnpacked_t*), h_dontcare);
|
||||
|
||||
in = lump->buffer;
|
||||
out = s_worldData.visStaticModels;
|
||||
|
|
|
@ -2991,7 +2991,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
|||
return 0;
|
||||
}
|
||||
tr.numSkins++;
|
||||
skin = ri.Hunk_Alloc( sizeof( skin_t ) );
|
||||
skin = ri.Hunk_Alloc( sizeof( skin_t ), h_dontcare );
|
||||
tr.skins[hSkin] = skin;
|
||||
Q_strncpyz( skin->name, name, sizeof( skin->name ) );
|
||||
skin->numSurfaces = 0;
|
||||
|
@ -3002,7 +3002,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
|||
// If not a .skin file, load as a single shader
|
||||
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
||||
skin->numSurfaces = 1;
|
||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof(skin->surfaces[0]) );
|
||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof(skin->surfaces[0]), h_dontcare);
|
||||
skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue, qfalse, qfalse, qfalse );
|
||||
return hSkin;
|
||||
}
|
||||
|
@ -3036,7 +3036,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
|||
// parse the shader name
|
||||
token = CommaParse( &text_p );
|
||||
|
||||
surf = skin->surfaces[ skin->numSurfaces ] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ) );
|
||||
surf = skin->surfaces[ skin->numSurfaces ] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_dontcare );
|
||||
Q_strncpyz( surf->name, surfName, sizeof( surf->name ) );
|
||||
surf->shader = R_FindShader( token, LIGHTMAP_NONE, qtrue, qfalse, qfalse, qfalse );
|
||||
skin->numSurfaces++;
|
||||
|
|
|
@ -308,7 +308,7 @@ static void InitOpenGL( void )
|
|||
{
|
||||
GLint temp;
|
||||
|
||||
GLimp_Init();
|
||||
GLimp_Init(qtrue);
|
||||
|
||||
strcpy( renderer_buffer, glConfig.renderer_string );
|
||||
Q_strlwr( renderer_buffer );
|
||||
|
|
|
@ -20,9 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TR_LOCAL_H
|
||||
#define TR_LOCAL_H
|
||||
#pragma once
|
||||
|
||||
#include "../qcommon/q_shared.h"
|
||||
#include "../qcommon/qfiles.h"
|
||||
|
@ -2336,6 +2334,3 @@ void UI_LoadResource(const char* name);
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif //TR_LOCAL_H
|
||||
|
|
|
@ -602,6 +602,7 @@ void RB_DrawSkeletor( trRefEntity_t *ent ) {
|
|||
tiki = R_Model_GetHandle( ent->e.hModel );
|
||||
skeletor = ( skeletor_c * )TIKI_GetSkeletor( tiki, ENTITYNUM_NONE );
|
||||
|
||||
#if 0
|
||||
if( r_showSkeleton->integer == 1 ) {
|
||||
//vec3_t vForward, vRight, vUp;
|
||||
orientation_t ori;
|
||||
|
@ -699,6 +700,7 @@ void RB_DrawSkeletor( trRefEntity_t *ent ) {
|
|||
qglEnd();
|
||||
qglLineWidth( 1 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1419,6 +1421,8 @@ void R_DebugSkeleton( void ) {
|
|||
trRefEntity_t *ent;
|
||||
model_t *model;
|
||||
|
||||
// FIXME: unimplemented
|
||||
#if 0
|
||||
R_SyncRenderThread();
|
||||
|
||||
GL_Bind( tr.whiteImage );
|
||||
|
@ -1439,6 +1443,7 @@ void R_DebugSkeleton( void ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
static float ProjectRadius(float r, const vec3_t location)
|
||||
{
|
||||
|
|
|
@ -19,8 +19,21 @@ along with Foobar; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#ifndef __TR_PUBLIC_H
|
||||
#define __TR_PUBLIC_H
|
||||
#pragma once
|
||||
|
||||
#include "../renderercommon/tr_public.h"
|
||||
#include "../renderercommon/iqm.h"
|
||||
#include "../renderercommon/qgl.h"
|
||||
|
||||
#define GLE(ret, name, ...) extern name##proc * qgl##name;
|
||||
QGL_1_1_PROCS;
|
||||
QGL_1_1_FIXED_FUNCTION_PROCS;
|
||||
QGL_DESKTOP_1_1_PROCS;
|
||||
QGL_DESKTOP_1_1_FIXED_FUNCTION_PROCS;
|
||||
QGL_3_0_PROCS;
|
||||
#undef GLE
|
||||
|
||||
#if 0
|
||||
|
||||
#include "../cgame/tr_types.h"
|
||||
|
||||
|
@ -244,4 +257,4 @@ qboolean R_ImageExists(const char* name);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // __TR_PUBLIC_H
|
||||
#endif
|
||||
|
|
|
@ -2490,7 +2490,7 @@ static shader_t *GeneratePermanentShader( void ) {
|
|||
return tr.defaultShader;
|
||||
}
|
||||
|
||||
newShader = ri.Hunk_Alloc( sizeof( shader_t ) );
|
||||
newShader = ri.Hunk_Alloc( sizeof( shader_t ), h_dontcare);
|
||||
|
||||
*newShader = shader;
|
||||
newShader->next = currentShader->shader;
|
||||
|
@ -2508,13 +2508,13 @@ static shader_t *GeneratePermanentShader( void ) {
|
|||
if ( !unfoggedStages[i].active ) {
|
||||
break;
|
||||
}
|
||||
newShader->unfoggedStages[i] = ri.Hunk_Alloc( sizeof( unfoggedStages[i] ) );
|
||||
newShader->unfoggedStages[i] = ri.Hunk_Alloc( sizeof( unfoggedStages[i] ), h_dontcare );
|
||||
*newShader->unfoggedStages[i] = unfoggedStages[i];
|
||||
|
||||
for ( b = 0 ; b < NUM_TEXTURE_BUNDLES ; b++ ) {
|
||||
size = newShader->unfoggedStages[i]->bundle[b].numTexMods * sizeof( texModInfo_t );
|
||||
if (size) {
|
||||
newShader->unfoggedStages[i]->bundle[b].texMods = ri.Hunk_Alloc(size);
|
||||
newShader->unfoggedStages[i]->bundle[b].texMods = ri.Hunk_Alloc(size, h_dontcare);
|
||||
Com_Memcpy(newShader->unfoggedStages[i]->bundle[b].texMods, unfoggedStages[i].bundle[b].texMods, size);
|
||||
}
|
||||
}
|
||||
|
@ -3194,7 +3194,7 @@ static void ScanAndLoadShaderFiles( void )
|
|||
|
||||
long sum = 0;
|
||||
// scan for shader files
|
||||
shaderFiles = ri.FS_ListFiles("scripts", ".shader", qfalse, &numShaders);
|
||||
shaderFiles = ri.FS_ListFiles("scripts", ".shader", &numShaders);
|
||||
|
||||
if (!shaderFiles || !numShaders)
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ sprite_t *SPR_RegisterSprite(const char *name)
|
|||
ri.Printf(1, "Could not find image for sprite in shader %s\n", name);
|
||||
return 0;
|
||||
}
|
||||
spr = ri.Hunk_Alloc(sizeof(sprite_t));
|
||||
spr = ri.Hunk_Alloc(sizeof(sprite_t), h_dontcare);
|
||||
spr->height = spriteImage->height;
|
||||
spr->width = spriteImage->width;
|
||||
spr->origin_x = spr->width * 0.5;
|
||||
|
|
|
@ -639,8 +639,8 @@ static void R_PreTessellateTerrain()
|
|||
|
||||
g_nTris = ter_maxtris->integer * 2 + 1;
|
||||
g_nVerts = ter_maxtris->integer + 1;
|
||||
g_pTris = ri.Hunk_Alloc(g_nTris * sizeof(terraTri_t));
|
||||
g_pVert = ri.Hunk_Alloc(g_nVerts * sizeof(terrainVert_t));
|
||||
g_pTris = ri.Hunk_Alloc(g_nTris * sizeof(terraTri_t), h_dontcare);
|
||||
g_pVert = ri.Hunk_Alloc(g_nVerts * sizeof(terrainVert_t), h_dontcare);
|
||||
|
||||
// Init triangles & vertices
|
||||
R_TerrainHeapInit();
|
||||
|
|
|
@ -19,129 +19,3 @@ along with OpenMoHAA source code; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct dtiki_s dtiki_t;
|
||||
typedef struct skelAnimFrame_s skelAnimFrame_t;
|
||||
|
||||
typedef struct {
|
||||
qhandle_t(*SpawnEffectModel)(const char* name, vec3_t pos, vec3_t axis[3]);
|
||||
qhandle_t(*RegisterServerModel)(const char* name);
|
||||
void (*UnregisterServerModel)(qhandle_t model);
|
||||
qhandle_t(*RefreshShaderNoMip)(const char* name);
|
||||
void (*FreeModels)();
|
||||
|
||||
void (*PrintBSPFileSizes)();
|
||||
int (*MapVersion)();
|
||||
|
||||
void (*AddRefEntityToScene)(const refEntity_t* re, int parentEntityNumber);
|
||||
void (*AddRefSpriteToScene)(const refEntity_t* ent);
|
||||
qboolean(*AddPolyToScene)(qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderfx);
|
||||
void (*AddTerrainMarkToScene)(int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderfx);
|
||||
void (*AddLightToScene)(const vec3_t org, float intensity, float r, float g, float b, int type);
|
||||
void (*RenderScene)(const refdef_t* fd);
|
||||
|
||||
refEntity_t* (*GetRenderEntity)(int entityNumber);
|
||||
void (*SavePerformanceCounters)();
|
||||
|
||||
void (*Set2DWindow)(int x, int y, int w, int h, float left, float right, float bottom, float top, float n, float f);
|
||||
void (*DrawStretchPic) ( float x, float y, float w, float h,
|
||||
float s1, float t1, float s2, float t2, qhandle_t hShader ); // 0 = white
|
||||
void (*DrawTilePic)(float x, float y, float w, float h, qhandle_t hShader);
|
||||
void (*DrawTilePicOffset)(float x, float y, float w, float h, qhandle_t hShader, int offsetX, int offsetY);
|
||||
void (*DrawTrianglePic)(vec2_t* points, vec2_t* texCoords, qhandle_t hShader);
|
||||
void (*DrawBackground)(int cols, int rows, int bgr, uint8_t* data);
|
||||
|
||||
// Draw images for cinematic rendering, pass as 32 bit rgba
|
||||
void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, int components, const byte* data);
|
||||
void (*DebugLine)(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha);
|
||||
void (*DrawBox)(float x, float y, float w, float h);
|
||||
void (*AddBox)(float x, float y, float w, float h);
|
||||
|
||||
void (*BeginFrame)(stereoFrame_t stereoFrame);
|
||||
void (*Scissor)(int x, int y, int width, int height);
|
||||
void (*DrawLineLoop)(const vec2_t* points, int count, int stippleFactor, int stippleMask);
|
||||
|
||||
int (*MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection,
|
||||
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared);
|
||||
int (*MarkFragmentsForInlineModel)(clipHandle_t bmodel, const vec3_t angles, const vec3_t origin, int numPoints,
|
||||
const vec3_t* points, const vec3_t projection, int maxPoints, vec3_t pointBuffer,
|
||||
int maxFragments, markFragment_t* fragmentBuffer, float radiusSquared);
|
||||
|
||||
void (*GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
|
||||
void (*GetLightingForDecal)(vec3_t light, vec3_t facing, vec3_t origin);
|
||||
void (*GetLightingForSmoke)(vec3_t light, vec3_t origin);
|
||||
int (*R_GatherLightSources)(const vec3_t pos, vec3_t* lightPos, vec3_t* lightIntensity, int maxLights);
|
||||
|
||||
void (*ModelBounds)(qhandle_t model, vec3_t mins, vec3_t maxs);
|
||||
float (*ModelRadius)(qhandle_t handle);
|
||||
|
||||
dtiki_t* (*R_Model_GetHandle)(qhandle_t handle);
|
||||
void (*DrawString)(fontheader_t* font, const char* text, float x, float y, int maxLen, qboolean virtualScreen);
|
||||
float (*GetFontHeight)(const fontheader_t* font);
|
||||
float (*GetFontStringWidth)(const fontheader_t* font, const char* string);
|
||||
fontheader_t* (*LoadFont)(const char* name);
|
||||
void (*SwipeBegin)(float thisTime, float life, qhandle_t hShader);
|
||||
void (*SwipePoint)(vec3_t point1, vec3_t point2, float time);
|
||||
void (*SwipeEnd)();
|
||||
void (*SetRenderTime)(int t);
|
||||
float (*Noise)(float x, float y, float z, float t);
|
||||
qboolean (*SetMode)(int mode, const glconfig_t* glConfig);
|
||||
void (*SetFullscreen)(qboolean fullScreen);
|
||||
int (*GetShaderWidth)(qhandle_t hShader);
|
||||
int (*GetShaderHeight)(qhandle_t hShader);
|
||||
const char* (*GetGraphicsInfo)();
|
||||
void (*ForceUpdatePose)(refEntity_t* model);
|
||||
orientation_t (*TIKI_Orientation)(refEntity_t* model, int tagNum);
|
||||
qboolean (*TIKI_IsOnGround)(refEntity_t* model, int tagNum, float threshold);
|
||||
void (*SetFrameNumber)(int frameNumber);
|
||||
|
||||
} refexport_new_t;
|
||||
|
||||
typedef struct {
|
||||
char* (*LV_ConvertString)(char* string);
|
||||
void (*Hunk_Clear)();
|
||||
void (*Clear)();
|
||||
void (*Cvar_SetDefault)(cvar_t* var, const char* varValue);
|
||||
byte* (*CM_ClusterPVS)(int cluster);
|
||||
|
||||
|
||||
int (*FS_OpenFile)(const char* qpath, fileHandle_t *file, qboolean uniqueFILE, qboolean quiet);
|
||||
size_t (*FS_Read)(void* buffer, size_t len, fileHandle_t fileHandle);
|
||||
void (*FS_CloseFile)(fileHandle_t fileHandle);
|
||||
int (*FS_Seek)(fileHandle_t fileHandle, long offset, fsOrigin_t origin);
|
||||
long (*FS_ReadFileEx)(const char* qpath, void** buffer, qboolean quiet);
|
||||
|
||||
void (*CM_BoxTrace)(trace_t* results, const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, int model, int brushMask, int cylinder);
|
||||
int (*CM_TerrainSquareType)(int terrainPatch, int i, int j);
|
||||
char* (*CM_EntityString)();
|
||||
const char* (*CM_MapTime)();
|
||||
int (*CG_PermanentMark)(const vec3_t origin, const vec3_t dir, float orientation, float sScale, float tScale, float red, float green, float blue, float alpha, qboolean doLighting, float sCenter, float tCenter, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentTreadMarkDecal)(treadMark_t* treadMark, qboolean startSegment, qboolean doLighting, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentUpdateTreadMark)(treadMark_t* treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale);
|
||||
void (*CG_ProcessInitCommands)(dtiki_t* tiki, refEntity_t* ent);
|
||||
void (*CG_EndTiki)(dtiki_t* tiki);
|
||||
void (*SetPerformanceCounters)(int totalTris, int totalVerts, int totalTexels, int worldTris, int worldVerts, int characterLights);
|
||||
|
||||
debugline_t** DebugLines;
|
||||
int* numDebugLines;
|
||||
debugstring_t** DebugStrings;
|
||||
int* numDebugStrings;
|
||||
|
||||
orientation_t (*TIKI_OrientationInternal)(dtiki_t* tiki, int entNum, int tagNum, float scale);
|
||||
qboolean (*TIKI_IsOnGroundInternal)(dtiki_t* tiki, int entNum, int tagNum, float thresHold);
|
||||
void (*TIKI_SetPoseInternal)(void* skeletor, const frameInfo_t* frameInfo, const int* boneTag, const vec4_t *boneQuat, float actionWeight);
|
||||
void* (*TIKI_Alloc)(size_t size);
|
||||
float (*GetRadiusInternal)(dtiki_t* tiki, int entNum, float scale);
|
||||
float (*GetCentroidRadiusInternal)(dtiki_t* tiki, int entNum, float scale, vec3_t centroid);
|
||||
void (*GetFrameInternal)(dtiki_t* tiki, int entNum, skelAnimFrame_t* newFrame);
|
||||
} refimport_new_t;
|
||||
|
||||
qboolean R_ImageExists(const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define __TR_PUBLIC_H
|
||||
|
||||
#include "tr_types.h"
|
||||
#include "new/tr_public_new.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -31,6 +30,10 @@ extern "C" {
|
|||
|
||||
#define REF_API_VERSION 14
|
||||
|
||||
typedef struct dtiki_s dtiki_t;
|
||||
typedef struct skelAnimFrame_s skelAnimFrame_t;
|
||||
|
||||
|
||||
//
|
||||
// these are the functions exported by the refresh module
|
||||
//
|
||||
|
@ -67,16 +70,14 @@ typedef struct {
|
|||
// a scene is built up by calls to R_ClearScene and the various R_Add functions.
|
||||
// Nothing is drawn until R_RenderScene is called.
|
||||
void (*ClearScene)( void );
|
||||
void (*AddRefEntityToScene)( const refEntity_t *re );
|
||||
void (*AddPolyToScene)( qhandle_t hShader , int numVerts, const polyVert_t *verts, int num );
|
||||
void (*AddRefEntityToScene)( const refEntity_t *re, int parentEntityNumber );
|
||||
qboolean(*AddPolyToScene)( qhandle_t hShader , int numVerts, const polyVert_t *verts, int num );
|
||||
int (*LightForPoint)( vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir );
|
||||
void (*AddLightToScene)( const vec3_t org, float intensity, float r, float g, float b );
|
||||
void (*AddLightToScene)( const vec3_t org, float intensity, float r, float g, float b, int type );
|
||||
void (*AddAdditiveLightToScene)( const vec3_t org, float intensity, float r, float g, float b );
|
||||
void (*RenderScene)( const refdef_t *fd );
|
||||
|
||||
void (*SetColor)( const float *rgba ); // NULL = 1,1,1,1
|
||||
void (*DrawStretchPic) ( float x, float y, float w, float h,
|
||||
float s1, float t1, float s2, float t2, qhandle_t hShader ); // 0 = white
|
||||
|
||||
// Draw images for cinematic rendering, pass as 32 bit rgba
|
||||
void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, const byte *data, int client, qboolean dirty);
|
||||
|
@ -89,7 +90,7 @@ typedef struct {
|
|||
|
||||
|
||||
int (*MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection,
|
||||
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer );
|
||||
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared );
|
||||
|
||||
int (*LerpTag)( orientation_t *tag, qhandle_t model, int startFrame, int endFrame,
|
||||
float frac, const char *tagName );
|
||||
|
@ -105,7 +106,69 @@ typedef struct {
|
|||
|
||||
void (*TakeVideoFrame)( int h, int w, byte* captureBuffer, byte *encodeBuffer, qboolean motionJpeg );
|
||||
|
||||
refexport_new_t newre;
|
||||
//
|
||||
// non-ioq3
|
||||
//
|
||||
qhandle_t(*SpawnEffectModel)(const char* name, vec3_t pos, vec3_t axis[3]);
|
||||
qhandle_t(*RegisterServerModel)(const char* name);
|
||||
void (*UnregisterServerModel)(qhandle_t model);
|
||||
qhandle_t(*RefreshShaderNoMip)(const char* name);
|
||||
void (*FreeModels)();
|
||||
|
||||
void (*PrintBSPFileSizes)();
|
||||
int (*MapVersion)();
|
||||
|
||||
void (*AddRefSpriteToScene)(const refEntity_t* ent);
|
||||
void (*AddTerrainMarkToScene)(int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderfx);
|
||||
|
||||
refEntity_t* (*GetRenderEntity)(int entityNumber);
|
||||
void (*SavePerformanceCounters)();
|
||||
|
||||
void (*Set2DWindow)(int x, int y, int w, int h, float left, float right, float bottom, float top, float n, float f);
|
||||
void (*DrawStretchPic) ( float x, float y, float w, float h,
|
||||
float s1, float t1, float s2, float t2, qhandle_t hShader ); // 0 = white
|
||||
void (*DrawTilePic)(float x, float y, float w, float h, qhandle_t hShader);
|
||||
void (*DrawTilePicOffset)(float x, float y, float w, float h, qhandle_t hShader, int offsetX, int offsetY);
|
||||
void (*DrawTrianglePic)(vec2_t* points, vec2_t* texCoords, qhandle_t hShader);
|
||||
void (*DrawBackground)(int cols, int rows, int bgr, uint8_t* data);
|
||||
|
||||
void (*DebugLine)(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha);
|
||||
void (*DrawBox)(float x, float y, float w, float h);
|
||||
void (*AddBox)(float x, float y, float w, float h);
|
||||
|
||||
void (*Scissor)(int x, int y, int width, int height);
|
||||
void (*DrawLineLoop)(const vec2_t* points, int count, int stippleFactor, int stippleMask);
|
||||
|
||||
int (*MarkFragmentsForInlineModel)(clipHandle_t bmodel, const vec3_t angles, const vec3_t origin, int numPoints,
|
||||
const vec3_t* points, const vec3_t projection, int maxPoints, vec3_t pointBuffer,
|
||||
int maxFragments, markFragment_t* fragmentBuffer, float radiusSquared);
|
||||
|
||||
void (*GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
|
||||
void (*GetLightingForDecal)(vec3_t light, vec3_t facing, vec3_t origin);
|
||||
void (*GetLightingForSmoke)(vec3_t light, vec3_t origin);
|
||||
int (*R_GatherLightSources)(const vec3_t pos, vec3_t* lightPos, vec3_t* lightIntensity, int maxLights);
|
||||
|
||||
float (*ModelRadius)(qhandle_t handle);
|
||||
|
||||
dtiki_t* (*R_Model_GetHandle)(qhandle_t handle);
|
||||
void (*DrawString)(fontheader_t* font, const char* text, float x, float y, int maxLen, qboolean virtualScreen);
|
||||
float (*GetFontHeight)(const fontheader_t* font);
|
||||
float (*GetFontStringWidth)(const fontheader_t* font, const char* string);
|
||||
fontheader_t* (*LoadFont)(const char* name);
|
||||
void (*SwipeBegin)(float thisTime, float life, qhandle_t hShader);
|
||||
void (*SwipePoint)(vec3_t point1, vec3_t point2, float time);
|
||||
void (*SwipeEnd)();
|
||||
void (*SetRenderTime)(int t);
|
||||
float (*Noise)(float x, float y, float z, float t);
|
||||
qboolean (*SetMode)(int mode, const glconfig_t* glConfig);
|
||||
void (*SetFullscreen)(qboolean fullScreen);
|
||||
int (*GetShaderWidth)(qhandle_t hShader);
|
||||
int (*GetShaderHeight)(qhandle_t hShader);
|
||||
const char* (*GetGraphicsInfo)();
|
||||
void (*ForceUpdatePose)(refEntity_t* model);
|
||||
orientation_t (*TIKI_Orientation)(refEntity_t* model, int tagNum);
|
||||
qboolean (*TIKI_IsOnGround)(refEntity_t* model, int tagNum, float threshold);
|
||||
void (*SetFrameNumber)(int frameNumber);
|
||||
} refexport_t;
|
||||
|
||||
//
|
||||
|
@ -188,7 +251,43 @@ typedef struct {
|
|||
void (*Sys_GLimpInit)( void );
|
||||
qboolean (*Sys_LowPhysicalMemory)( void );
|
||||
|
||||
refimport_new_t newri;
|
||||
//
|
||||
// non-ioq3
|
||||
//
|
||||
char* (*LV_ConvertString)(char* string);
|
||||
void (*Hunk_Clear)();
|
||||
void (*Clear)();
|
||||
void (*Cvar_SetDefault)(cvar_t* var, const char* varValue);
|
||||
|
||||
int (*FS_OpenFile)(const char* qpath, fileHandle_t *file, qboolean uniqueFILE, qboolean quiet);
|
||||
size_t (*FS_Read)(void* buffer, size_t len, fileHandle_t fileHandle);
|
||||
void (*FS_CloseFile)(fileHandle_t fileHandle);
|
||||
int (*FS_Seek)(fileHandle_t fileHandle, long offset, fsOrigin_t origin);
|
||||
long (*FS_ReadFileEx)(const char* qpath, void** buffer, qboolean quiet);
|
||||
|
||||
void (*CM_BoxTrace)(trace_t* results, const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, int model, int brushMask, int cylinder);
|
||||
int (*CM_TerrainSquareType)(int terrainPatch, int i, int j);
|
||||
char* (*CM_EntityString)();
|
||||
const char* (*CM_MapTime)();
|
||||
int (*CG_PermanentMark)(const vec3_t origin, const vec3_t dir, float orientation, float sScale, float tScale, float red, float green, float blue, float alpha, qboolean doLighting, float sCenter, float tCenter, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentTreadMarkDecal)(treadMark_t* treadMark, qboolean startSegment, qboolean doLighting, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentUpdateTreadMark)(treadMark_t* treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale);
|
||||
void (*CG_ProcessInitCommands)(dtiki_t* tiki, refEntity_t* ent);
|
||||
void (*CG_EndTiki)(dtiki_t* tiki);
|
||||
void (*SetPerformanceCounters)(int totalTris, int totalVerts, int totalTexels, int worldTris, int worldVerts, int characterLights);
|
||||
|
||||
debugline_t** DebugLines;
|
||||
int* numDebugLines;
|
||||
debugstring_t** DebugStrings;
|
||||
int* numDebugStrings;
|
||||
|
||||
orientation_t (*TIKI_OrientationInternal)(dtiki_t* tiki, int entNum, int tagNum, float scale);
|
||||
qboolean (*TIKI_IsOnGroundInternal)(dtiki_t* tiki, int entNum, int tagNum, float thresHold);
|
||||
void (*TIKI_SetPoseInternal)(void* skeletor, const frameInfo_t* frameInfo, const int* boneTag, const vec4_t *boneQuat, float actionWeight);
|
||||
void* (*TIKI_Alloc)(size_t size);
|
||||
float (*GetRadiusInternal)(dtiki_t* tiki, int entNum, float scale);
|
||||
float (*GetCentroidRadiusInternal)(dtiki_t* tiki, int entNum, float scale, vec3_t centroid);
|
||||
void (*GetFrameInternal)(dtiki_t* tiki, int entNum, skelAnimFrame_t* newFrame);
|
||||
} refimport_t;
|
||||
|
||||
|
||||
|
@ -201,6 +300,8 @@ typedef refexport_t* (QDECL *GetRefAPI_t) (int apiVersion, refimport_t * rimp);
|
|||
refexport_t*GetRefAPI( int apiVersion, refimport_t *rimp );
|
||||
#endif
|
||||
|
||||
qboolean R_ImageExists(const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -112,64 +112,64 @@ void RE_SetRenderTime(int t) {
|
|||
|
||||
void GetRefAPI_new(refimport_t* ri, refexport_t* re)
|
||||
{
|
||||
re->newre.FreeModels = RE_FreeModels;
|
||||
re->newre.SpawnEffectModel = RE_SpawnEffectModel;
|
||||
re->newre.RegisterServerModel = RE_RegisterServerModel;
|
||||
re->newre.UnregisterServerModel = RE_UnregisterServerModel;
|
||||
re->newre.RefreshShaderNoMip = RE_RefreshShaderNoMip;
|
||||
re->newre.PrintBSPFileSizes = RE_PrintBSPFileSizes;
|
||||
re->newre.MapVersion = RE_MapVersion;
|
||||
re->newre.LoadFont = R_LoadFont;
|
||||
re->FreeModels = RE_FreeModels;
|
||||
re->SpawnEffectModel = RE_SpawnEffectModel;
|
||||
re->RegisterServerModel = RE_RegisterServerModel;
|
||||
re->UnregisterServerModel = RE_UnregisterServerModel;
|
||||
re->RefreshShaderNoMip = RE_RefreshShaderNoMip;
|
||||
re->PrintBSPFileSizes = RE_PrintBSPFileSizes;
|
||||
re->MapVersion = RE_MapVersion;
|
||||
re->LoadFont = R_LoadFont;
|
||||
|
||||
re->newre.BeginFrame = RE_BeginFrame;
|
||||
re->BeginFrame = RE_BeginFrame;
|
||||
|
||||
re->newre.MarkFragments = R_MarkFragments_New;
|
||||
re->newre.MarkFragmentsForInlineModel = R_MarkFragmentsForInlineModel;
|
||||
re->newre.GetInlineModelBounds = R_GetInlineModelBounds;
|
||||
re->newre.GetLightingForDecal = R_GetLightingForDecal;
|
||||
re->newre.GetLightingForSmoke = R_GetLightingForSmoke;
|
||||
re->newre.R_GatherLightSources = R_GatherLightSources;
|
||||
re->newre.ModelBounds = R_ModelBounds;
|
||||
re->newre.ModelRadius = R_ModelRadius;
|
||||
re->MarkFragments = R_MarkFragments_New;
|
||||
re->MarkFragmentsForInlineModel = R_MarkFragmentsForInlineModel;
|
||||
re->GetInlineModelBounds = R_GetInlineModelBounds;
|
||||
re->GetLightingForDecal = R_GetLightingForDecal;
|
||||
re->GetLightingForSmoke = R_GetLightingForSmoke;
|
||||
re->R_GatherLightSources = R_GatherLightSources;
|
||||
re->ModelBounds = R_ModelBounds;
|
||||
re->ModelRadius = R_ModelRadius;
|
||||
|
||||
re->newre.AddRefEntityToScene = RE_AddRefEntityToScene;
|
||||
re->newre.AddRefSpriteToScene = RE_AddRefSpriteToScene;
|
||||
re->newre.AddPolyToScene = RE_AddPolyToScene;
|
||||
re->newre.AddTerrainMarkToScene = RE_AddTerrainMarkToScene;
|
||||
re->newre.AddLightToScene = RE_AddLightToScene;
|
||||
re->newre.RenderScene = RE_RenderScene;
|
||||
re->newre.GetRenderEntity = RE_GetRenderEntity;
|
||||
re->AddRefEntityToScene = RE_AddRefEntityToScene;
|
||||
re->AddRefSpriteToScene = RE_AddRefSpriteToScene;
|
||||
re->AddPolyToScene = RE_AddPolyToScene;
|
||||
re->AddTerrainMarkToScene = RE_AddTerrainMarkToScene;
|
||||
re->AddLightToScene = RE_AddLightToScene;
|
||||
re->RenderScene = RE_RenderScene;
|
||||
re->GetRenderEntity = RE_GetRenderEntity;
|
||||
|
||||
re->newre.SavePerformanceCounters = R_SavePerformanceCounters;
|
||||
re->SavePerformanceCounters = R_SavePerformanceCounters;
|
||||
|
||||
re->newre.R_Model_GetHandle = R_Model_GetHandle;
|
||||
re->newre.DrawStretchRaw = RE_StretchRaw;
|
||||
re->newre.DebugLine = R_DebugLine;
|
||||
re->newre.DrawStretchPic = Draw_StretchPic;
|
||||
re->newre.DrawTilePic = Draw_TilePic;
|
||||
re->newre.DrawTilePicOffset = Draw_TilePicOffset;
|
||||
re->newre.DrawTrianglePic = Draw_TrianglePic;
|
||||
re->newre.DrawBox = DrawBox;
|
||||
re->newre.AddBox = AddBox;
|
||||
re->newre.Set2DWindow = Set2DWindow;
|
||||
re->newre.Scissor = RE_Scissor;
|
||||
re->newre.DrawLineLoop = DrawLineLoop;
|
||||
re->newre.DrawString = R_DrawString;
|
||||
re->newre.GetFontHeight = R_GetFontHeight;
|
||||
re->newre.GetFontStringWidth = R_GetFontStringWidth;
|
||||
re->newre.SwipeBegin = RE_SwipeBegin;
|
||||
re->newre.SwipeEnd = RE_SwipeEnd;
|
||||
re->newre.SetRenderTime = RE_SetRenderTime;
|
||||
re->newre.Noise = R_NoiseGet4f;
|
||||
re->R_Model_GetHandle = R_Model_GetHandle;
|
||||
re->DrawStretchRaw = RE_StretchRaw;
|
||||
re->DebugLine = R_DebugLine;
|
||||
re->DrawStretchPic = Draw_StretchPic;
|
||||
re->DrawTilePic = Draw_TilePic;
|
||||
re->DrawTilePicOffset = Draw_TilePicOffset;
|
||||
re->DrawTrianglePic = Draw_TrianglePic;
|
||||
re->DrawBox = DrawBox;
|
||||
re->AddBox = AddBox;
|
||||
re->Set2DWindow = Set2DWindow;
|
||||
re->Scissor = RE_Scissor;
|
||||
re->DrawLineLoop = DrawLineLoop;
|
||||
re->DrawString = R_DrawString;
|
||||
re->GetFontHeight = R_GetFontHeight;
|
||||
re->GetFontStringWidth = R_GetFontStringWidth;
|
||||
re->SwipeBegin = RE_SwipeBegin;
|
||||
re->SwipeEnd = RE_SwipeEnd;
|
||||
re->SetRenderTime = RE_SetRenderTime;
|
||||
re->Noise = R_NoiseGet4f;
|
||||
|
||||
re->newre.SetMode = R_SetMode;
|
||||
re->newre.SetFullscreen = R_SetFullscreen;
|
||||
re->SetMode = R_SetMode;
|
||||
re->SetFullscreen = R_SetFullscreen;
|
||||
|
||||
re->newre.GetShaderHeight = RE_GetShaderHeight;
|
||||
re->newre.GetShaderWidth = RE_GetShaderWidth;
|
||||
re->newre.GetGraphicsInfo = RE_GetGraphicsInfo;
|
||||
re->newre.ForceUpdatePose = RE_ForceUpdatePose;
|
||||
re->newre.TIKI_Orientation = RE_TIKI_Orientation;
|
||||
re->newre.TIKI_IsOnGround = RE_TIKI_IsOnGround;
|
||||
re->newre.SetFrameNumber = RE_SetFrameNumber;
|
||||
re->GetShaderHeight = RE_GetShaderHeight;
|
||||
re->GetShaderWidth = RE_GetShaderWidth;
|
||||
re->GetGraphicsInfo = RE_GetGraphicsInfo;
|
||||
re->ForceUpdatePose = RE_ForceUpdatePose;
|
||||
re->TIKI_Orientation = RE_TIKI_Orientation;
|
||||
re->TIKI_IsOnGround = RE_TIKI_IsOnGround;
|
||||
re->SetFrameNumber = RE_SetFrameNumber;
|
||||
}
|
|
@ -36,7 +36,7 @@ void R_DebugCircle(const vec3_t org, float radius, float r, float g, float b, fl
|
|||
vec3_t forward, right;
|
||||
vec3_t pos, lastpos;
|
||||
|
||||
if (!ri.newri.DebugLines || !ri.newri.numDebugLines) {
|
||||
if (!ri.DebugLines || !ri.numDebugLines) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -67,13 +67,13 @@ void R_DebugCircle(const vec3_t org, float radius, float r, float g, float b, fl
|
|||
|
||||
if (i > 0)
|
||||
{
|
||||
if (*ri.newri.numDebugLines >= r_numdebuglines->integer) {
|
||||
if (*ri.numDebugLines >= r_numdebuglines->integer) {
|
||||
ri.Printf(PRINT_ALL, "R_DebugCircle: Exceeded MAX_DEBUG_LINES\n");
|
||||
return;
|
||||
}
|
||||
|
||||
line = &(*ri.newri.DebugLines)[*ri.newri.numDebugLines];
|
||||
(*ri.newri.numDebugLines)++;
|
||||
line = &(*ri.DebugLines)[*ri.numDebugLines];
|
||||
(*ri.numDebugLines)++;
|
||||
VectorCopy(lastpos, line->start);
|
||||
VectorCopy(pos, line->end);
|
||||
VectorSet(line->color, r, g, b);
|
||||
|
@ -93,16 +93,16 @@ R_DebugLine
|
|||
void R_DebugLine(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha) {
|
||||
debugline_t* line;
|
||||
|
||||
if (!ri.newri.DebugLines || !ri.newri.numDebugLines) {
|
||||
if (!ri.DebugLines || !ri.numDebugLines) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (*ri.newri.numDebugLines >= r_numdebuglines->integer) {
|
||||
if (*ri.numDebugLines >= r_numdebuglines->integer) {
|
||||
ri.Printf(PRINT_ALL, "R_DebugLine: Exceeded MAX_DEBUG_LINES\n");
|
||||
}
|
||||
|
||||
line = &(*ri.newri.DebugLines)[*ri.newri.numDebugLines];
|
||||
(*ri.newri.numDebugLines)++;
|
||||
line = &(*ri.DebugLines)[*ri.numDebugLines];
|
||||
(*ri.numDebugLines)++;
|
||||
VectorCopy(start, line->start);
|
||||
VectorCopy(end, line->end);
|
||||
VectorSet(line->color, r, g, b);
|
||||
|
|
|
@ -66,7 +66,7 @@ dtiki_t *R_Model_GetHandle( qhandle_t handle ) {
|
|||
*/
|
||||
void R_FreeModel( model_t *mod ) {
|
||||
if( mod->type == MOD_TIKI ) {
|
||||
ri.newri.CG_EndTiki( mod->d.tiki );
|
||||
ri.CG_EndTiki( mod->d.tiki );
|
||||
}
|
||||
|
||||
ri.Free(mod);
|
||||
|
@ -227,7 +227,7 @@ static qhandle_t R_RegisterModelInternal( const char *name, qboolean bBeginTiki,
|
|||
R_RegisterShaders( mod );
|
||||
|
||||
if( bBeginTiki ) {
|
||||
ri.newri.CG_ProcessInitCommands( mod->d.tiki, NULL );
|
||||
ri.CG_ProcessInitCommands( mod->d.tiki, NULL );
|
||||
}
|
||||
|
||||
return mod->index;
|
||||
|
@ -269,7 +269,7 @@ qhandle_t RE_SpawnEffectModel( const char *szModel, vec3_t vPos, vec3_t *axis )
|
|||
if( new_entity.hModel )
|
||||
{
|
||||
tr.models[ new_entity.hModel ]->serveronly = qfalse;
|
||||
ri.newri.CG_ProcessInitCommands( tr.models[ new_entity.hModel ]->d.tiki, &new_entity );
|
||||
ri.CG_ProcessInitCommands( tr.models[ new_entity.hModel ]->d.tiki, &new_entity );
|
||||
}
|
||||
|
||||
return new_entity.hModel;
|
||||
|
@ -1349,7 +1349,7 @@ void R_UpdatePoseInternal( refEntity_t *model ) {
|
|||
tr.skel_index[ model->entityNumber ] = tr.frame_skel_index;
|
||||
}
|
||||
|
||||
ri.newri.TIKI_SetPoseInternal( TIKI_GetSkeletor( model->tiki, model->entityNumber ), model->frameInfo, model->bone_tag, model->bone_quat, model->actionWeight );
|
||||
ri.TIKI_SetPoseInternal( TIKI_GetSkeletor( model->tiki, model->entityNumber ), model->frameInfo, model->bone_tag, model->bone_quat, model->actionWeight );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1362,7 +1362,7 @@ void RE_ForceUpdatePose( refEntity_t *model ) {
|
|||
tr.skel_index[ model->entityNumber ] = tr.frame_skel_index;
|
||||
}
|
||||
|
||||
ri.newri.TIKI_SetPoseInternal( TIKI_GetSkeletor( model->tiki, model->entityNumber ), model->frameInfo, model->bone_tag, model->bone_quat, model->actionWeight );
|
||||
ri.TIKI_SetPoseInternal( TIKI_GetSkeletor( model->tiki, model->entityNumber ), model->frameInfo, model->bone_tag, model->bone_quat, model->actionWeight );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1372,7 +1372,7 @@ RE_TIKI_Orientation
|
|||
*/
|
||||
orientation_t RE_TIKI_Orientation( refEntity_t *model, int tagnum ) {
|
||||
R_UpdatePoseInternal( model );
|
||||
return ri.newri.TIKI_OrientationInternal( model->tiki, model->entityNumber, tagnum, model->scale );
|
||||
return ri.TIKI_OrientationInternal( model->tiki, model->entityNumber, tagnum, model->scale );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1382,7 +1382,7 @@ RE_TIKI_IsOnGround
|
|||
*/
|
||||
qboolean RE_TIKI_IsOnGround( refEntity_t *model, int tagnum, float threshold ) {
|
||||
R_UpdatePoseInternal( model );
|
||||
return ri.newri.TIKI_IsOnGroundInternal( model->tiki, model->entityNumber, tagnum, threshold );
|
||||
return ri.TIKI_IsOnGroundInternal( model->tiki, model->entityNumber, tagnum, threshold );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1392,7 +1392,7 @@ R_GetRadius
|
|||
*/
|
||||
float R_GetRadius( refEntity_t *model ) {
|
||||
R_UpdatePoseInternal( model );
|
||||
return ri.newri.GetRadiusInternal( model->tiki, model->entityNumber, model->scale );
|
||||
return ri.GetRadiusInternal( model->tiki, model->entityNumber, model->scale );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1402,7 +1402,7 @@ R_GetFrame
|
|||
*/
|
||||
void R_GetFrame( refEntity_t *model, struct skelAnimFrame_s *newFrame ) {
|
||||
R_UpdatePoseInternal( model );
|
||||
ri.newri.GetFrameInternal( model->tiki, model->entityNumber, newFrame );
|
||||
ri.GetFrameInternal( model->tiki, model->entityNumber, newFrame );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue