}
};
+void GetSelectionAABB( AABB& bounds );
+const Matrix4& ssGetPivot2World();
class Scalable
{
Vector3 m_start;
Vector3 m_axis;
Scalable& m_scalable;
+
+AABB m_aabb;
+Vector3 m_transform_origin;
+Vector3 m_choosen_extent;
+
public:
ScaleAxis( Scalable& scalable )
: m_scalable( scalable ){
}
void Construct( const Matrix4& device2manip, const float x, const float y ){
point_on_axis( m_start, m_axis, device2manip, x, y );
+
+ GetSelectionAABB( m_aabb );
+ m_transform_origin = vector4_to_vector3( ssGetPivot2World().t() );
+ m_choosen_extent = Vector3( std::max( m_aabb.origin[0] + m_aabb.extents[0] - m_transform_origin[0], - m_aabb.origin[0] + m_aabb.extents[0] + m_transform_origin[0] ),
+ std::max( m_aabb.origin[1] + m_aabb.extents[1] - m_transform_origin[1], - m_aabb.origin[1] + m_aabb.extents[1] + m_transform_origin[1] ),
+ std::max( m_aabb.origin[2] + m_aabb.extents[2] - m_transform_origin[2], - m_aabb.origin[2] + m_aabb.extents[2] + m_transform_origin[2] )
+ );
+
}
void Transform( const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y ){
+ //globalOutputStream() << "manip2object: " << manip2object << " device2manip: " << device2manip << " x: " << x << " y:" << y <<"\n";
Vector3 current;
point_on_axis( current, m_axis, device2manip, x, y );
Vector3 delta = vector3_subtracted( current, m_start );
vector3_snap( delta, GetSnapGridSize() );
Vector3 start( vector3_snapped( m_start, GetSnapGridSize() ) );
+ //globalOutputStream() << "start: " << start << " delta: " << delta <<"\n";
Vector3 scale(
start[0] == 0 ? 1 : 1 + delta[0] / start[0],
start[1] == 0 ? 1 : 1 + delta[1] / start[1],
start[2] == 0 ? 1 : 1 + delta[2] / start[2]
);
+
+ for( std::size_t i = 0; i < 3; i++ ){
+ if( m_choosen_extent[i] > 0.0625 ){ //epsilon to prevent too high scale for set of models, having really small extent, formed by origins
+ scale[i] = ( m_choosen_extent[i] + delta[i] ) / m_choosen_extent[i];
+ }
+ }
+
m_scalable.scale( scale );
}
private:
Vector3 m_start;
Scalable& m_scalable;
+
+AABB m_aabb;
+Vector3 m_transform_origin;
+Vector3 m_choosen_extent;
+
public:
ScaleFree( Scalable& scalable )
: m_scalable( scalable ){
}
void Construct( const Matrix4& device2manip, const float x, const float y ){
point_on_plane( m_start, device2manip, x, y );
+
+ GetSelectionAABB( m_aabb );
+ m_transform_origin = vector4_to_vector3( ssGetPivot2World().t() );
+ m_choosen_extent = Vector3( std::max( m_aabb.origin[0] + m_aabb.extents[0] - m_transform_origin[0], - m_aabb.origin[0] + m_aabb.extents[0] + m_transform_origin[0] ),
+ std::max( m_aabb.origin[1] + m_aabb.extents[1] - m_transform_origin[1], - m_aabb.origin[1] + m_aabb.extents[1] + m_transform_origin[1] ),
+ std::max( m_aabb.origin[2] + m_aabb.extents[2] - m_transform_origin[2], - m_aabb.origin[2] + m_aabb.extents[2] + m_transform_origin[2] )
+ );
}
void Transform( const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y ){
Vector3 current;
start[1] == 0 ? 1 : 1 + delta[1] / start[1],
start[2] == 0 ? 1 : 1 + delta[2] / start[2]
);
+
+ for( std::size_t i = 0; i < 3; i++ ){
+ if( m_choosen_extent[i] > 0.0625 ){
+ scale[i] = ( m_choosen_extent[i] + delta[i] ) / m_choosen_extent[i];
+ }
+ }
+
m_scalable.scale( scale );
}
};
Manipulator* m_manipulator;
// state
-public:
bool m_undo_begun;
-private:
EMode m_mode;
EComponentMode m_componentmode;
Signal1<const Selectable&> m_selectionChanged_callbacks;
void ConstructPivot() const;
+void setCustomPivotOrigin( Vector3& point ) const;
+public:
+void getSelectionAABB( AABB& bounds ) const;
+private:
mutable bool m_pivotChanged;
bool m_pivot_moving;
+mutable bool m_pivotIsCustom;
void Scene_TestSelect( Selector& selector, SelectionTest& test, const View& view, SelectionSystem::EMode mode, SelectionSystem::EComponentMode componentMode );
m_rotate_manipulator( *this, 8, 64 ),
m_scale_manipulator( *this, 0, 64 ),
m_pivotChanged( false ),
- m_pivot_moving( false ){
+ m_pivot_moving( false ),
+ m_pivotIsCustom( false ){
SetManipulatorMode( eTranslate );
pivotChanged();
addSelectionChangeCallback( PivotChangedSelectionCaller( *this ) );
return m_componentmode;
}
void SetManipulatorMode( EManipulatorMode mode ){
+ m_pivotIsCustom = false;
m_manipulator_mode = mode;
switch ( m_manipulator_mode )
{
break;
case RadiantSelectionSystem::eSelect:
{
- if( !( *selector.begin() ).second->isSelected() ){
- ( *selector.begin() ).second->setSelected( true );
+ SelectionPool::iterator best = selector.begin();
+ if( !( *best ).second->isSelected() ){
+ ( *best ).second->setSelected( true );
+ }
+ SelectionPool::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ if( !( *i ).second->isSelected() ){
+ ( *i ).second->setSelected( true );
+ }
+ }
+ else{
+ break;
+ }
+ ++i;
}
}
break;
case RadiantSelectionSystem::eDeselect:
{
- if( ( *selector.begin() ).second->isSelected() ){
- ( *selector.begin() ).second->setSelected( false );
+ SelectionPool::iterator best = selector.begin();
+ if( ( *best ).second->isSelected() ){
+ ( *best ).second->setSelected( false );
+ }
+ SelectionPool::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ if( ( *i ).second->isSelected() ){
+ ( *i ).second->setSelected( false );
+ }
+ }
+ else{
+ break;
+ }
+ ++i;
}
}
break;
if ( !selector.failed() ) {
SelectableSortedSet::iterator best = selector.begin();
- if ( ( *best ).second->isSelected() ) {
- ( *best ).second->setSelected( false );
- return false;
- }
- else{
- ( *best ).second->setSelected( true );
- return true;
+ const bool wasSelected = ( *best ).second->isSelected();
+ ( *best ).second->setSelected( !wasSelected );
+ SelectableSortedSet::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ ( *i ).second->setSelected( !wasSelected );
+ }
+ else{
+ break;
+ }
+ ++i;
}
+ return !wasSelected;
}
else{
return true;
#endif
void RadiantSelectionSystem::ConstructPivot() const {
- if ( !m_pivotChanged || m_pivot_moving ) {
+ if ( !m_pivotChanged || m_pivot_moving || m_pivotIsCustom ) {
return;
}
m_pivotChanged = false;
}
//vector3_snap( m_object_pivot, GetSnapGridSize() );
+ //globalOutputStream() << m_object_pivot << "\n";
m_pivot2world = matrix4_translation_for_vec3( m_object_pivot );
switch ( m_manipulator_mode )
}
}
+void RadiantSelectionSystem::setCustomPivotOrigin( Vector3& point ) const {
+ /*if ( !m_pivotChanged || m_pivot_moving ) {
+ return;
+ }*/
+ //m_pivotChanged = false;
+
+ if ( !nothingSelected() && ( m_manipulator_mode == eTranslate || m_manipulator_mode == eRotate || m_manipulator_mode == eScale ) ) {
+ AABB bounds;
+ if ( Mode() == eComponent ) {
+ Scene_BoundsSelectedComponent( GlobalSceneGraph(), bounds );
+ }
+ else
+ {
+ Scene_BoundsSelected( GlobalSceneGraph(), bounds );
+ }
+ //globalOutputStream() << point << "\n";
+ const float gridsize = GetSnapGridSize();
+ //const float bbox_epsilon = gridsize / 4.0;
+
+ for( std::size_t i = 0; i < 3; i++ ){
+ if( point[i] < 900000 ){
+ float bestsnapDist = fabs( bounds.origin[i] - point[i] );
+ float bestsnapTo = bounds.origin[i];
+ float othersnapDist = fabs( bounds.origin[i] + bounds.extents[i] - point[i] );
+ if( othersnapDist < bestsnapDist ){
+ bestsnapDist = othersnapDist;
+ bestsnapTo = bounds.origin[i] + bounds.extents[i];
+ }
+ othersnapDist = fabs( bounds.origin[i] - bounds.extents[i] - point[i] );
+ if( othersnapDist < bestsnapDist ){
+ bestsnapDist = othersnapDist;
+ bestsnapTo = bounds.origin[i] - bounds.extents[i];
+ }
+ othersnapDist = fabs( float_snapped( point[i], gridsize ) - point[i] );
+ if( othersnapDist < bestsnapDist ){
+ bestsnapDist = othersnapDist;
+ bestsnapTo = float_snapped( point[i], gridsize );
+ }
+ point[i] = bestsnapTo;
+
+/* if( float_equal_epsilon( point[i], bestsnapTo, bbox_epsilon ) ){
+ point[i] = bestsnapTo;
+ }
+ else{
+ point[i] = float_snapped( point[i], gridsize );
+ }
+ */
+ m_pivot2world[i + 12] = point[i]; //m_pivot2world.tx() .ty() .tz()
+ }
+ }
+
+ switch ( m_manipulator_mode )
+ {
+ case eTranslate:
+ break;
+ case eRotate:
+ if ( Mode() == eComponent ) {
+ matrix4_assign_rotation_for_pivot( m_pivot2world, m_component_selection.back() );
+ }
+ else
+ {
+ matrix4_assign_rotation_for_pivot( m_pivot2world, m_selection.back() );
+ }
+ break;
+ case eScale:
+ if ( Mode() == eComponent ) {
+ matrix4_assign_rotation_for_pivot( m_pivot2world, m_component_selection.back() );
+ }
+ else
+ {
+ matrix4_assign_rotation_for_pivot( m_pivot2world, m_selection.back() );
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ m_pivotIsCustom = true;
+}
+
+void RadiantSelectionSystem::getSelectionAABB( AABB& bounds ) const {
+ if ( !nothingSelected() ) {
+ if ( Mode() == eComponent ) {
+ Scene_BoundsSelectedComponent( GlobalSceneGraph(), bounds );
+ }
+ else
+ {
+ Scene_BoundsSelected( GlobalSceneGraph(), bounds );
+ }
+ }
+}
+
+void GetSelectionAABB( AABB& bounds ){
+ getSelectionSystem().getSelectionAABB( bounds );
+}
+
+const Matrix4& ssGetPivot2World(){
+ return getSelectionSystem().GetPivot2World();
+}
+
void RadiantSelectionSystem::renderSolid( Renderer& renderer, const VolumeTest& volume ) const {
//if(view->TestPoint(m_object_pivot))
if ( !nothingSelected() ) {
void onMouseMotion( const WindowVector& position, ModifierFlags modifiers ){
m_selector.m_mouseMoved = true;
if ( m_mouse_down && !g_mouseMovedCallback.empty() ) {
+ m_selector.m_mouseMovedWhilePressed = true;
g_mouseMovedCallback.get() ( window_to_normalised_device( position, m_width, m_height ) );
}
}
g_mouseUpCallback.get() ( window_to_normalised_device( position, m_width, m_height ) );
}
//L button w/o scene changed = tunnel selection
- if( !getSelectionSystem().m_undo_begun && modifiers == c_modifierNone && button == c_button_select &&
+ if( // !getSelectionSystem().m_undo_begun &&
+ modifiers == c_modifierNone && button == c_button_select &&
//( !m_selector.m_mouseMoved || !m_mouse_down ) &&
- ( GlobalSelectionSystem().Mode() != SelectionSystem::eComponent || GlobalSelectionSystem().ManipulatorMode() != SelectionSystem::eDrag ) ){
+ !m_selector.m_mouseMovedWhilePressed &&
+ ( getSelectionSystem().Mode() != SelectionSystem::eComponent || getSelectionSystem().ManipulatorMode() != SelectionSystem::eDrag ) ){
m_selector.testSelect_simpleM1( device_constrained( window_to_normalised_device( position, m_width, m_height ) ) );
}
- getSelectionSystem().m_undo_begun = false;
+ //getSelectionSystem().m_undo_begun = false;
m_selector.m_mouseMoved = false;
m_selector.m_mouseMovedWhilePressed = false;
}
StripExtension( token );
FixDOSName( token );
for ( i = 0; i < *texnum; i++ ){
- if ( !stricmp( texlist + i*65, token ) ) return;
+ if ( !Q_stricmp( texlist + i*65, token ) ) return;
}
for ( i = 0; i < *EXtexnum; i++ ){
- if ( !stricmp( EXtex + i*65, token ) ) return;
+ if ( !Q_stricmp( EXtex + i*65, token ) ) return;
}
strcpy ( texlist + (*texnum)*65, token );
(*texnum)++;
//StripExtension( token );
char* dot = strrchr( token, '.' );
if ( dot != NULL){
- if ( stricmp( dot, ".tga" ) && stricmp( dot, ".jpg" ) && stricmp( dot, ".png" ) ){
+ if ( Q_stricmp( dot, ".tga" ) && Q_stricmp( dot, ".jpg" ) && Q_stricmp( dot, ".png" ) ){
Sys_Printf( "WARNING4: %s : weird or missing extension in shader\n", token );
}
else{
/* exclude */
for ( i = 0; i < *texnum; i++ ){
- if ( !stricmp( texlist + i*65, texlist + (*texnum)*65 ) ) return;
+ if ( !Q_stricmp( texlist + i*65, texlist + (*texnum)*65 ) ) return;
}
for ( i = 0; i < *EXtexnum; i++ ){
- if ( !stricmp( EXtex + i*65, texlist + (*texnum)*65 ) ) return;
+ if ( !Q_stricmp( EXtex + i*65, texlist + (*texnum)*65 ) ) return;
}
for ( i = 0; i < *rEXtexnum; i++ ){
- if ( !stricmp( rEXtex + i*65, texlist + (*texnum)*65 ) ) return;
+ if ( !Q_stricmp( rEXtex + i*65, texlist + (*texnum)*65 ) ) return;
}
(*texnum)++;
return;
}
if ( *( data + (*num)*65 ) == '\0') return;
for ( i = 0; i < *num; i++ ){
- if ( !stricmp( data + i*65, data + (*num)*65 ) ) return;
+ if ( !Q_stricmp( data + i*65, data + (*num)*65 ) ) return;
}
(*num)++;
return;
epair_t *ep;
for ( ep = entities[0].epairs; ep != NULL; ep = ep->next )
{
- if ( !strnicmp( ep->key, "vertexremapshader", 17 ) ) {
+ if ( !Q_strncasecmp( ep->key, "vertexremapshader", 17 ) ) {
sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders + pk3ShadersN*65 );
res2list( pk3Shaders, &pk3ShadersN );
}
res2list( pk3Sounds, &pk3SoundsN );
}
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_strt.wav");
res2list( pk3Sounds, &pk3SoundsN );
strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_end.wav");
res2list( pk3Sounds, &pk3SoundsN );
}
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
if ( !(IntForKey( &entities[i], "spawnflags") & 1) ){
strcpy( pk3Sounds + pk3SoundsN*65, "sound/misc/windfly.wav");
res2list( pk3Sounds, &pk3SoundsN );
}
/* blocks */
- if ( !stricmp( token, "textures" ) ){
+ if ( !Q_stricmp( token, "textures" ) ){
parseEXblock ( ExTextures, &ExTexturesN, exName );
}
- else if ( !stricmp( token, "shaders" ) ){
+ else if ( !Q_stricmp( token, "shaders" ) ){
parseEXblock ( ExShaders, &ExShadersN, exName );
}
- else if ( !stricmp( token, "shaderfiles" ) ){
+ else if ( !Q_stricmp( token, "shaderfiles" ) ){
parseEXblock ( ExShaderfiles, &ExShaderfilesN, exName );
}
- else if ( !stricmp( token, "sounds" ) ){
+ else if ( !Q_stricmp( token, "sounds" ) ){
parseEXblock ( ExSounds, &ExSoundsN, exName );
}
- else if ( !stricmp( token, "videos" ) ){
+ else if ( !Q_stricmp( token, "videos" ) ){
parseEXblock ( ExVideos, &ExVideosN, exName );
}
else{
for ( i = 0; i < ExTexturesN; i++ ){
for ( j = 0; j < ExShadersN; j++ ){
- if ( !stricmp( ExTextures + i*65, ExShaders + j*65 ) ){
+ if ( !Q_stricmp( ExTextures + i*65, ExShaders + j*65 ) ){
break;
}
}
/* can exclude pure textures right now, shouldn't create shaders for them anyway */
for ( i = 0; i < pk3ShadersN ; i++ ){
for ( j = 0; j < ExPureTexturesN ; j++ ){
- if ( !stricmp( pk3Shaders + i*65, ExPureTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, ExPureTextures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
/* do wanna le shader file? */
for ( j = 0; j < ExShaderfilesN; j++ ){
- if ( !stricmp( ExShaderfiles + j*65, pk3Shaderfiles + i*65 ) ){
+ if ( !Q_stricmp( ExShaderfiles + j*65, pk3Shaderfiles + i*65 ) ){
ShaderFileExcluded = qtrue;
reasonShaderFile = ExShaderfiles + j*65;
break;
/* does it contain restricted shaders/textures? */
for ( j = 0; j < ExShadersN; j++ ){
- if ( !stricmp( ExShaders + j*65, token ) ){
+ if ( !Q_stricmp( ExShaders + j*65, token ) ){
ShaderFileExcluded = qtrue;
reasonShader = ExShaders + j*65;
break;
if ( ShaderFileExcluded )
break;
for ( j = 0; j < ExPureTexturesN; j++ ){
- if ( !stricmp( ExPureTextures + j*65, token ) ){
+ if ( !Q_stricmp( ExPureTextures + j*65, token ) ){
ShaderFileExcluded = qtrue;
reasonShader = ExPureTextures + j*65;
break;
/* do wanna le shader? */
wantShader = qfalse;
for ( j = 0; j < pk3ShadersN; j++ ){
- if ( !stricmp( pk3Shaders + j*65, token) ){
+ if ( !Q_stricmp( pk3Shaders + j*65, token) ){
shader = j;
wantShader = qtrue;
break;
if ( !strcmp( token, "{" ) ) {
Sys_Printf( "WARNING9: %s : line %d : opening brace inside shader stage\n", temp, scriptline );
}
- if ( !stricmp( token, "mapComp" ) || !stricmp( token, "mapNoComp" ) || !stricmp( token, "animmapcomp" ) || !stricmp( token, "animmapnocomp" ) ){
+ if ( !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) || !Q_stricmp( token, "animmapcomp" ) || !Q_stricmp( token, "animmapnocomp" ) ){
Sys_Printf( "WARNING7: %s : line %d : unsupported '%s' map directive\n", temp, scriptline, token );
}
/* skip the shader */
if ( !wantShader ) continue;
/* digest any images */
- if ( !stricmp( token, "map" ) ||
- !stricmp( token, "clampMap" ) ) {
+ if ( !Q_stricmp( token, "map" ) ||
+ !Q_stricmp( token, "clampMap" ) ) {
hasmap = qtrue;
/* get an image */
GetToken( qfalse );
tex2list( pk3Textures, &pk3TexturesN, ExTextures, &ExTexturesN );
}
}
- else if ( !stricmp( token, "animMap" ) ||
- !stricmp( token, "clampAnimMap" ) ) {
+ else if ( !Q_stricmp( token, "animMap" ) ||
+ !Q_stricmp( token, "clampAnimMap" ) ) {
hasmap = qtrue;
GetToken( qfalse );// skip num
while ( TokenAvailable() ){
tex2list( pk3Textures, &pk3TexturesN, ExTextures, &ExTexturesN );
}
}
- else if ( !stricmp( token, "videoMap" ) ){
+ else if ( !Q_stricmp( token, "videoMap" ) ){
hasmap = qtrue;
GetToken( qfalse );
FixDOSName( token );
}
FixDOSName( token );
for ( j = 0; j < pk3VideosN; j++ ){
- if ( !stricmp( pk3Videos + j*65, token ) ){
+ if ( !Q_stricmp( pk3Videos + j*65, token ) ){
goto away;
}
}
for ( j = 0; j < ExVideosN; j++ ){
- if ( !stricmp( ExVideos + j*65, token ) ){
+ if ( !Q_stricmp( ExVideos + j*65, token ) ){
goto away;
}
}
}
}
}
- else if ( !strnicmp( token, "implicit", 8 ) ){
+ else if ( !Q_strncasecmp( token, "implicit", 8 ) ){
Sys_Printf( "WARNING5: %s : line %d : unsupported %s shader\n", temp, scriptline, token );
}
/* skip the shader */
----------------------------------------------------------------- */
/* match surfaceparm */
- else if ( !stricmp( token, "surfaceparm" ) ) {
+ else if ( !Q_stricmp( token, "surfaceparm" ) ) {
GetToken( qfalse );
- if ( !stricmp( token, "nodraw" ) ) {
+ if ( !Q_stricmp( token, "nodraw" ) ) {
wantShader = qfalse;
*( pk3Shaders + shader*65 ) = '\0';
}
}
/* skyparms <outer image> <cloud height> <inner image> */
- else if ( !stricmp( token, "skyParms" ) ) {
+ else if ( !Q_stricmp( token, "skyParms" ) ) {
hasmap = qtrue;
/* get image base */
GetToken( qfalse );
/* ignore bogus paths */
- if ( stricmp( token, "-" ) && stricmp( token, "full" ) ) {
+ if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) {
strcpy ( temp, token );
sprintf( token, "%s_up", temp );
tex2list( pk3Textures, &pk3TexturesN, ExTextures, &ExTexturesN );
GetToken( qfalse );
GetToken( qfalse );
}
- else if ( !stricmp( token, "fogparms" ) ){
+ else if ( !Q_stricmp( token, "fogparms" ) ){
hasmap = qtrue;
}
}
//exclude shader
if ( wantShader ){
for ( j = 0; j < ExShadersN; j++ ){
- if ( !stricmp( ExShaders + j*65, pk3Shaders + shader*65 ) ){
+ if ( !Q_stricmp( ExShaders + j*65, pk3Shaders + shader*65 ) ){
wantShader = qfalse;
*( pk3Shaders + shader*65 ) = '\0';
break;
if ( *( pk3Shaders + i*65 ) != '\0' ){
FixDOSName( pk3Shaders + i*65 );
for ( j = 0; j < pk3TexturesN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
}
if ( *( pk3Shaders + i*65 ) == '\0' ) continue;
for ( j = 0; j < ExTexturesN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, ExTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, ExTextures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
//snds
for ( i = 0; i < pk3SoundsN; i++ ){
for ( j = 0; j < ExSoundsN; j++ ){
- if ( !stricmp( pk3Sounds + i*65, ExSounds + j*65 ) ){
+ if ( !Q_stricmp( pk3Sounds + i*65, ExSounds + j*65 ) ){
*( pk3Sounds + i*65 ) = '\0';
break;
}
Sys_Printf( "\n\t.bsp and stuff\n" );
sprintf( temp, "maps/%s.bsp", nameOFmap );
- if ( vfsPackFile( temp, packname, 10 ) ){
+ //if ( vfsPackFile( temp, packname, 10 ) ){
+ if ( vfsPackFile_Absolute_Path( source, temp, packname, 10 ) ){
Sys_Printf( "++%s\n", temp );
}
else{
}
/* blocks */
- if ( !stricmp( token, "textures" ) ){
+ if ( !Q_stricmp( token, "textures" ) ){
parseEXblock ( ExTextures, &ExTexturesN, exName );
}
- else if ( !stricmp( token, "shaders" ) ){
+ else if ( !Q_stricmp( token, "shaders" ) ){
parseEXblock ( ExShaders, &ExShadersN, exName );
}
- else if ( !stricmp( token, "shaderfiles" ) ){
+ else if ( !Q_stricmp( token, "shaderfiles" ) ){
parseEXblock ( ExShaderfiles, &ExShaderfilesN, exName );
}
- else if ( !stricmp( token, "sounds" ) ){
+ else if ( !Q_stricmp( token, "sounds" ) ){
parseEXblock ( ExSounds, &ExSoundsN, exName );
}
- else if ( !stricmp( token, "videos" ) ){
+ else if ( !Q_stricmp( token, "videos" ) ){
parseEXblock ( ExVideos, &ExVideosN, exName );
}
else{
for ( i = 0; i < ExTexturesN; i++ ){
for ( j = 0; j < ExShadersN; j++ ){
- if ( !stricmp( ExTextures + i*65, ExShaders + j*65 ) ){
+ if ( !Q_stricmp( ExTextures + i*65, ExShaders + j*65 ) ){
break;
}
}
}
/* blocks */
- if ( !stricmp( token, "textures" ) ){
+ if ( !Q_stricmp( token, "textures" ) ){
parseEXblock ( rExTextures, &rExTexturesN, exName );
}
- else if ( !stricmp( token, "shaders" ) ){
+ else if ( !Q_stricmp( token, "shaders" ) ){
parseEXblock ( rExShaders, &rExShadersN, exName );
}
- else if ( !stricmp( token, "shaderfiles" ) ){
+ else if ( !Q_stricmp( token, "shaderfiles" ) ){
parseEXblock ( rExShaderfiles, &rExShaderfilesN, exName );
}
- else if ( !stricmp( token, "sounds" ) ){
+ else if ( !Q_stricmp( token, "sounds" ) ){
parseEXblock ( rExSounds, &rExSoundsN, exName );
}
- else if ( !stricmp( token, "videos" ) ){
+ else if ( !Q_stricmp( token, "videos" ) ){
parseEXblock ( rExVideos, &rExVideosN, exName );
}
else{
/* do some path mangling */
strcpy( source, ExpandArg( argv[ argc - 1 ] ) );
- if ( !stricmp( strrchr( source, '.' ), ".bsp" ) ){
+ if ( !Q_stricmp( strrchr( source, '.' ), ".bsp" ) ){
strcpy( bspList, source );
bspListN++;
}
epair_t *ep;
for ( ep = entities[0].epairs; ep != NULL; ep = ep->next )
{
- if ( !strnicmp( ep->key, "vertexremapshader", 17 ) ) {
+ if ( !Q_strncasecmp( ep->key, "vertexremapshader", 17 ) ) {
sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders + pk3ShadersN*65 );
res2list( pk3Shaders, &pk3ShadersN );
}
res2list( pk3Sounds, &pk3SoundsN );
}
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_strt.wav");
res2list( pk3Sounds, &pk3SoundsN );
strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_end.wav");
res2list( pk3Sounds, &pk3SoundsN );
}
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
if ( !(IntForKey( &entities[i], "spawnflags") & 1) ){
strcpy( pk3Sounds + pk3SoundsN*65, "sound/misc/windfly.wav");
res2list( pk3Sounds, &pk3SoundsN );
/* can exclude pure *base* textures right now, shouldn't create shaders for them anyway */
for ( i = 0; i < pk3ShadersN ; i++ ){
for ( j = 0; j < ExPureTexturesN ; j++ ){
- if ( !stricmp( pk3Shaders + i*65, ExPureTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, ExPureTextures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
/* can exclude repack.exclude shaders, assuming they got all their images */
for ( i = 0; i < pk3ShadersN ; i++ ){
for ( j = 0; j < rExShadersN ; j++ ){
- if ( !stricmp( pk3Shaders + i*65, rExShaders + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, rExShaders + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
/* do wanna le shader? */
wantShader = qfalse;
for ( j = 0; j < pk3ShadersN; j++ ){
- if ( !stricmp( pk3Shaders + j*65, token) ){
+ if ( !Q_stricmp( pk3Shaders + j*65, token) ){
shader = j;
wantShader = qtrue;
break;
}
if ( wantShader ){
for ( j = 0; j < rExTexturesN ; j++ ){
- if ( !stricmp( pk3Shaders + shader*65, rExTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + shader*65, rExTextures + j*65 ) ){
Sys_Printf( "WARNING3: %s : about to include shader for excluded texture\n", pk3Shaders + shader*65 );
break;
}
if ( !wantShader ) continue;
/* digest any images */
- if ( !stricmp( token, "map" ) ||
- !stricmp( token, "clampMap" ) ) {
+ if ( !Q_stricmp( token, "map" ) ||
+ !Q_stricmp( token, "clampMap" ) ) {
strcat( shaderText, "\n\t\t" );
strcat( shaderText, token );
hasmap = qtrue;
strcat( shaderText, " " );
strcat( shaderText, token );
}
- else if ( !stricmp( token, "animMap" ) ||
- !stricmp( token, "clampAnimMap" ) ) {
+ else if ( !Q_stricmp( token, "animMap" ) ||
+ !Q_stricmp( token, "clampAnimMap" ) ) {
strcat( shaderText, "\n\t\t" );
strcat( shaderText, token );
hasmap = qtrue;
}
tokenready = qtrue;
}
- else if ( !stricmp( token, "videoMap" ) ){
+ else if ( !Q_stricmp( token, "videoMap" ) ){
strcat( shaderText, "\n\t\t" );
strcat( shaderText, token );
hasmap = qtrue;
}
FixDOSName( token );
for ( j = 0; j < pk3VideosN; j++ ){
- if ( !stricmp( pk3Videos + j*65, token ) ){
+ if ( !Q_stricmp( pk3Videos + j*65, token ) ){
goto away;
}
}
for ( j = 0; j < ExVideosN; j++ ){
- if ( !stricmp( ExVideos + j*65, token ) ){
+ if ( !Q_stricmp( ExVideos + j*65, token ) ){
goto away;
}
}
for ( j = 0; j < rExVideosN; j++ ){
- if ( !stricmp( rExVideos + j*65, token ) ){
+ if ( !Q_stricmp( rExVideos + j*65, token ) ){
goto away;
}
}
away:
j = 0;
}
- else if ( !stricmp( token, "mapComp" ) || !stricmp( token, "mapNoComp" ) || !stricmp( token, "animmapcomp" ) || !stricmp( token, "animmapnocomp" ) ){
+ else if ( !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) || !Q_stricmp( token, "animmapcomp" ) || !Q_stricmp( token, "animmapnocomp" ) ){
Sys_Printf( "WARNING7: %s : %s shader\n", pk3Shaders + shader*65, token );
hasmap = qtrue;
if ( line == scriptline ){
----------------------------------------------------------------- */
/* match surfaceparm */
- else if ( !stricmp( token, "surfaceparm" ) ) {
+ else if ( !Q_stricmp( token, "surfaceparm" ) ) {
strcat( shaderText, "\n\tsurfaceparm " );
GetToken( qfalse );
strcat( shaderText, token );
- if ( !stricmp( token, "nodraw" ) ) {
+ if ( !Q_stricmp( token, "nodraw" ) ) {
wantShader = qfalse;
*( pk3Shaders + shader*65 ) = '\0';
}
}
/* skyparms <outer image> <cloud height> <inner image> */
- else if ( !stricmp( token, "skyParms" ) ) {
+ else if ( !Q_stricmp( token, "skyParms" ) ) {
strcat( shaderText, "\n\tskyParms " );
hasmap = qtrue;
/* get image base */
strcat( shaderText, token );
/* ignore bogus paths */
- if ( stricmp( token, "-" ) && stricmp( token, "full" ) ) {
+ if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) {
strcpy ( temp, token );
sprintf( token, "%s_up", temp );
tex2list2( pk3Textures, &pk3TexturesN, ExTextures, &ExTexturesN, rExTextures, &rExTexturesN );
strcat( shaderText, " " );
strcat( shaderText, token );
}
- else if ( !strnicmp( token, "implicit", 8 ) ){
+ else if ( !Q_strncasecmp( token, "implicit", 8 ) ){
Sys_Printf( "WARNING5: %s : %s shader\n", pk3Shaders + shader*65, token );
hasmap = qtrue;
if ( line == scriptline ){
strcat( shaderText, token );
}
}
- else if ( !stricmp( token, "fogparms" ) ){
+ else if ( !Q_stricmp( token, "fogparms" ) ){
hasmap = qtrue;
if ( line == scriptline ){
strcat( shaderText, " " );
//exclude shader
if ( wantShader ){
for ( j = 0; j < ExShadersN; j++ ){
- if ( !stricmp( ExShaders + j*65, pk3Shaders + shader*65 ) ){
+ if ( !Q_stricmp( ExShaders + j*65, pk3Shaders + shader*65 ) ){
wantShader = qfalse;
*( pk3Shaders + shader*65 ) = '\0';
break;
FixDOSName( pk3Shaders + i*65 );
//what if theres properly slashed one in the list?
for ( j = 0; j < pk3ShadersN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, pk3Shaders + j*65 ) && (i != j) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, pk3Shaders + j*65 ) && (i != j) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
}
if ( *( pk3Shaders + i*65 ) == '\0' ) continue;
for ( j = 0; j < pk3TexturesN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
}
if ( *( pk3Shaders + i*65 ) == '\0' ) continue;
for ( j = 0; j < ExTexturesN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, ExTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, ExTextures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
}
if ( *( pk3Shaders + i*65 ) == '\0' ) continue;
for ( j = 0; j < rExTexturesN; j++ ){
- if ( !stricmp( pk3Shaders + i*65, rExTextures + j*65 ) ){
+ if ( !Q_stricmp( pk3Shaders + i*65, rExTextures + j*65 ) ){
*( pk3Shaders + i*65 ) = '\0';
break;
}
//snds
for ( i = 0; i < pk3SoundsN; i++ ){
for ( j = 0; j < ExSoundsN; j++ ){
- if ( !stricmp( pk3Sounds + i*65, ExSounds + j*65 ) ){
+ if ( !Q_stricmp( pk3Sounds + i*65, ExSounds + j*65 ) ){
*( pk3Sounds + i*65 ) = '\0';
break;
}
}
if ( *( pk3Sounds + i*65 ) == '\0' ) continue;
for ( j = 0; j < rExSoundsN; j++ ){
- if ( !stricmp( pk3Sounds + i*65, rExSounds + j*65 ) ){
+ if ( !Q_stricmp( pk3Sounds + i*65, rExSounds + j*65 ) ){
*( pk3Sounds + i*65 ) = '\0';
break;
}