Merge branch 'osxnetradiant'

Conflicts:
	contrib/bobtoolz/DPatch.cpp
	contrib/bobtoolz/bobToolz-GTK.cpp
	contrib/bobtoolz/funchandlers-GTK.cpp
	install-dylibs.sh
	setup/data/osx/NetRadiant.app/Contents/MacOS/netradiant.sh
This commit is contained in:
Rudolf Polzer 2010-03-28 19:32:53 +02:00
commit d40c79f30c
24 changed files with 569 additions and 194 deletions

View File

@ -192,7 +192,8 @@ ifeq ($(OS),Darwin)
A = a A = a
DLL = dylib DLL = dylib
MWINDOWS = MWINDOWS =
MACVERSION ?= 16
CPPFLAGS_COMMON += -DMACVERSION="$(MACVERSION)"
# workaround for weird prints # workaround for weird prints
ECHO_NOLF = /bin/echo -n ECHO_NOLF = /bin/echo -n
@ -376,6 +377,7 @@ endif
%.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) %.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),)
$(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_ZLIB) $(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_ZLIB)
$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) -Itools/quake3/common -Ilibs -Iinclude $(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) -Itools/quake3/common -Ilibs -Iinclude
$(INSTALLDIR)/q3map2.$(EXE): \ $(INSTALLDIR)/q3map2.$(EXE): \
@ -969,6 +971,8 @@ install-data: binaries
$(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
$(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
$(CP_R) setup/data/tools/* $(INSTALLDIR)/ $(CP_R) setup/data/tools/* $(INSTALLDIR)/
$(MKDIR) $(INSTALLDIR)/docs
$(CP_R) docs/* $(INSTALLDIR)/docs/
$(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
.PHONY: install-dll .PHONY: install-dll

View File

@ -212,6 +212,7 @@ void DBobView::Begin(const char* trigger, const char *target, float multiplier,
globalErrorStream() << "Initialization Failure in DBobView::Begin"; globalErrorStream() << "Initialization Failure in DBobView::Begin";
delete this; delete this;
} }
globalOutputStream() << "Initialization of Path Plotter succeeded.";
} }
bool DBobView::UpdatePath() bool DBobView::UpdatePath()
@ -262,16 +263,19 @@ void DBobView_setEntity(Entity& entity, float multiplier, int points, float varG
} }
g_PathView->Begin(trigger_ep->value, target_ep->value, multiplier, points, varGravity, bNoUpdate, bShowExtra); g_PathView->Begin(trigger_ep->value, target_ep->value, multiplier, points, varGravity, bNoUpdate, bShowExtra);
} }
else
globalErrorStream() << "bobToolz PathPlotter: trigger_push ARGH\n";
} }
else else
DoMessageBox("trigger_push target could not be found.", "Error", eMB_OK); globalErrorStream() << "bobToolz PathPlotter: trigger_push target could not be found..\n";
} }
else else
DoMessageBox("trigger_push has no target.", "Error", eMB_OK); globalErrorStream() << "bobToolz PathPlotter: trigger_push has no target..\n";
} }
else else
DoMessageBox("You must select a 'trigger_push' entity.", "Error", eMB_OK); globalErrorStream() << "bobToolz PathPlotter: You must select a 'trigger_push' entity..\n";
} }
else else
DoMessageBox("Entity must have a targetname", "Error", eMB_OK); globalErrorStream() << "bobToolz PathPlotter: Entity must have a targetname.\n";
return;
} }

View File

@ -308,28 +308,27 @@ DPatch* DPatch::MergePatches(patch_merge_t merge_info, DPatch *p1, DPatch *p2)
merge_info.pos2 += 3; merge_info.pos2 += 3;
} }
// //
/* The Patch will never be reaching max, previous comparissions make sure,
for 2 patches with 3x3 size. Results always in a patch of 3x5. (31 is max currently) int newHeight = p1->height + p2->height - 1;
int newHeight = p1->height + p2->height - 1; anyway = 5
if(newHeight > MAX_PATCH_HEIGHT) if(newHeight > MAX_PATCH_HEIGHT)
return NULL; return false;
int newWidth = p1->width + p2->width - 1; /* int newWidth = p1->width + p2->width - 1;
if(newWidth > MAX_PATCH_WIDTH) if(newWidth > MAX_PATCH_WIDTH)
return NULL; return NULL;
*/ */
DPatch* newPatch = new DPatch(); DPatch* newPatch = new DPatch();
//switched..
newPatch->height = 3; newPatch->height = p1->width;
newPatch->width = 5; newPatch->width = newHeight;
newPatch->SetTexture(p1->texture); newPatch->SetTexture(p1->texture);
for(int y = 0; y < 3; y++) for(int y = 0; y < p1->height; y++)
for(int x = 0; x < 3; x++) for(int x = 0; x < p1->width; x++)
newPatch->points[x][y] = p1->points[x][y]; newPatch->points[x][y] = p1->points[x][y];
for(int y = 1; y < 3; y++) for(int y = 1; y < p2->height; y++)
for(int x = 0; x < 3; x++) for(int x = 0; x < p2->width; x++)
newPatch->points[x][y+2] = p2->points[x][y]; newPatch->points[x][(y + p1->height - 1)] = p2->points[x][y];
// newPatch->Invert(); // newPatch->Invert();
return newPatch; return newPatch;

View File

@ -217,34 +217,32 @@ void DTreePlanter::DropEntsToGround( void ) {
Scene_forEachEntity(TreePlanterDropEntityIfSelected(*this)); Scene_forEachEntity(TreePlanterDropEntityIfSelected(*this));
} }
void DTreePlanter::MakeChain( void ) { void DTreePlanter::MakeChain( int linkNum, const char* linkName ) {
char buffer[256]; char buffer[256];
int i; int i;
for(i = 0; i < linkNum; i++) {
for(i = 0; i < m_linkNum; i++) {
DEntity e("info_train_spline_main"); DEntity e("info_train_spline_main");
sprintf( buffer, "%s_pt%i", m_linkName, i ); sprintf( buffer, "%s_pt%i", linkName, i );
e.AddEPair( "targetname", buffer ); e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", i * 64 ); sprintf( buffer, "0 %i 0", i * 64 );
e.AddEPair( "origin", buffer ); e.AddEPair( "origin", buffer );
if(i != m_linkNum-1) { if(i != m_linkNum-1) {
sprintf( buffer, "%s_pt%i", m_linkName, i+1 ); sprintf( buffer, "%s_pt%i", linkName, i+1 );
e.AddEPair( "target", buffer ); e.AddEPair( "target", buffer );
sprintf( buffer, "%s_ctl%i", m_linkName, i ); sprintf( buffer, "%s_ctl%i", linkName, i );
e.AddEPair( "control", buffer ); e.AddEPair( "control", buffer );
} }
e.BuildInRadiant( false ); e.BuildInRadiant( false );
} }
for(i = 0; i < m_linkNum-1; i++) { for(i = 0; i < linkNum-1; i++) {
DEntity e("info_train_spline_control"); DEntity e("info_train_spline_control");
sprintf( buffer, "%s_ctl%i", m_linkName, i ); sprintf( buffer, "%s_ctl%i", linkName, i );
e.AddEPair( "targetname", buffer ); e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", (i * 64) + 32); sprintf( buffer, "0 %i 0", (i * 64) + 32);

View File

@ -181,7 +181,7 @@ public:
bool FindDropPoint(vec3_t in, vec3_t out); bool FindDropPoint(vec3_t in, vec3_t out);
void DropEntsToGround( void ); void DropEntsToGround( void );
void MakeChain( void ); void MakeChain( int linkNum, const char* linkName );
void SelectChain( void ); void SelectChain( void );
private: private:

View File

@ -118,6 +118,16 @@ extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool
DoPitBuilder(); DoPitBuilder();
} else if( string_equal_nocase(p, "vis viewer") ) { } else if( string_equal_nocase(p, "vis viewer") ) {
DoVisAnalyse(); DoVisAnalyse();
} else if( string_equal_nocase(p, "stair builder...") ) {
DoBuildStairs();
} else if( string_equal_nocase(p, "door builder...") ) {
DoBuildDoors();
} else if( string_equal_nocase(p, "intersect...") ) {
DoIntersect();
} else if( string_equal_nocase(p, "make chain...") ) {
DoMakeChain();
} else if( string_equal_nocase(p, "path plotter...") ) {
DoPathPlotter();
} else if( string_equal_nocase(p, "about...") ) { } else if( string_equal_nocase(p, "about...") ) {
DoMessageBox(PLUGIN_ABOUT, "About", eMB_OK); DoMessageBox(PLUGIN_ABOUT, "About", eMB_OK);
} }
@ -129,7 +139,7 @@ const char* QERPlug_GetCommandTitleList()
} }
#define NUM_TOOLBARBUTTONS 9 #define NUM_TOOLBARBUTTONS 14
std::size_t ToolbarButtonCount( void ) { std::size_t ToolbarButtonCount( void ) {
return NUM_TOOLBARBUTTONS; return NUM_TOOLBARBUTTONS;
@ -144,19 +154,27 @@ public:
case 0: return "bobtoolz_cleanup.bmp"; case 0: return "bobtoolz_cleanup.bmp";
case 1: return "bobtoolz_poly.bmp"; case 1: return "bobtoolz_poly.bmp";
case 2: return "bobtoolz_caulk.bmp"; case 2: return "bobtoolz_caulk.bmp";
case 3: return "bobtoolz_treeplanter.bmp"; case 3: return "";
case 4: return "bobtoolz_trainpathplot.bmp"; case 4: return "bobtoolz_treeplanter.bmp";
case 5: return "bobtoolz_dropent.bmp"; case 5: return "bobtoolz_trainpathplot.bmp";
case 6: return "bobtoolz_merge.bmp"; case 6: return "bobtoolz_dropent.bmp";
case 7: return "bobtoolz_split.bmp"; case 7: return "";
case 8: return "bobtoolz_turnedge.bmp"; case 8: return "bobtoolz_merge.bmp";
case 9: return "bobtoolz_split.bmp";
case 10: return "bobtoolz_splitrow.bmp";
case 11: return "bobtoolz_splitcol.bmp";
case 12: return "";
case 13: return "bobtoolz_turnedge.bmp";
} }
return NULL; return NULL;
} }
virtual EType getType() const virtual EType getType() const
{ {
switch( mIndex ) { switch( mIndex ) {
case 3: return eToggleButton; case 3: return eSpace;
case 4: return eToggleButton;
case 7: return eSpace;
case 12: return eSpace;
default: return eButton; default: return eButton;
} }
} }
@ -166,12 +184,14 @@ public:
case 0: return "Cleanup"; case 0: return "Cleanup";
case 1: return "Polygons"; case 1: return "Polygons";
case 2: return "Caulk"; case 2: return "Caulk";
case 3: return "Tree Planter"; case 4: return "Tree Planter";
case 4: return "Plot Splines"; case 5: return "Plot Splines";
case 5: return "Drop Entity"; case 6: return "Drop Entity";
case 6: return "Merge Patches"; case 8: return "Merge 2 Patches";
case 7: return "Split Patches"; case 9: return "Split Patch";
case 8: return "Flip Terrain"; case 10: return "Split Patch Rows";
case 11: return "Split Patch Columns";
case 13: return "Flip Terrain";
} }
return NULL; return NULL;
} }
@ -181,12 +201,14 @@ public:
case 0: return "Brush Cleanup"; case 0: return "Brush Cleanup";
case 1: return "Polygons"; case 1: return "Polygons";
case 2: return "Caulk selection"; case 2: return "Caulk selection";
case 3: return "Tree Planter"; case 4: return "Tree Planter";
case 4: return "Plot Splines"; case 5: return "Plot Splines";
case 5: return "Drop Entity"; case 6: return "Drop Entity";
case 6: return "Merge Patches"; case 8: return "Merge 2 Patches";
case 7: return "Split Patches"; case 9: return "Split Patch";
case 8: return "Flip Terrain"; case 10: return "Split Patch Rows";
case 11: return "Split Patch Columns";
case 13: return "Flip Terrain (Turn Edge)";
} }
return NULL; return NULL;
} }
@ -199,12 +221,14 @@ public:
case 0: DoFixBrushes(); break; case 0: DoFixBrushes(); break;
case 1: DoPolygonsTB(); break; case 1: DoPolygonsTB(); break;
case 2: DoCaulkSelection(); break; case 2: DoCaulkSelection(); break;
case 3: DoTreePlanter(); break; case 4: DoTreePlanter(); break;
case 4: DoTrainPathPlot(); break; case 5: DoTrainPathPlot(); break;
case 5: DoDropEnts(); break; case 6: DoDropEnts(); break;
case 6: DoMergePatches(); break; case 8: DoMergePatches(); break;
case 7: DoSplitPatch(); break; case 9: DoSplitPatch(); break;
case 8: DoFlipTerrain(); break; case 10: DoSplitPatchRows(); break;
case 11: DoSplitPatchCols(); break;
case 13: DoFlipTerrain(); break;
} }
} }
@ -263,7 +287,7 @@ class BobToolzPluginModule : public TypeSystemRef
_QERPluginTable m_plugin; _QERPluginTable m_plugin;
public: public:
typedef _QERPluginTable Type; typedef _QERPluginTable Type;
STRING_CONSTANT(Name, "bobtoolz"); STRING_CONSTANT(Name, "bobToolz");
BobToolzPluginModule() BobToolzPluginModule()
{ {
@ -295,7 +319,7 @@ class BobToolzToolbarDependencies :
{ {
public: public:
BobToolzToolbarDependencies() : BobToolzToolbarDependencies() :
ModuleRef<_QERPluginTable>("bobtoolz") ModuleRef<_QERPluginTable>("bobToolz")
{ {
} }
}; };
@ -305,7 +329,7 @@ class BobToolzToolbarModule : public TypeSystemRef
_QERPlugToolbarTable m_table; _QERPlugToolbarTable m_table;
public: public:
typedef _QERPlugToolbarTable Type; typedef _QERPlugToolbarTable Type;
STRING_CONSTANT(Name, "bobtoolz"); STRING_CONSTANT(Name, "bobToolz");
BobToolzToolbarModule() BobToolzToolbarModule()
{ {

View File

@ -370,6 +370,7 @@ EMessageBoxReturn DoIntersectBox (IntersectRS* rs)
// ---- vbox ---- // ---- vbox ----
radio1 = gtk_radio_button_new_with_label(NULL, "Use Whole Map"); radio1 = gtk_radio_button_new_with_label(NULL, "Use Whole Map");
gtk_box_pack_start (GTK_BOX (vbox), radio1, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), radio1, FALSE, FALSE, 2);
gtk_widget_show (radio1); gtk_widget_show (radio1);
@ -1902,3 +1903,116 @@ EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs)
return ret; return ret;
} }
// ailmanki
// add a simple input for the MakeChain thing..
EMessageBoxReturn DoMakeChainBox(MakeChainRS* rs)
{
GtkWidget *window, *w, *vbox, *hbox;
GtkWidget *textlinkNum, *textlinkName;
EMessageBoxReturn ret;
int loop = 1;
char *text = "Please set a value in the boxes below and press 'OK' to make a chain";
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" );
gtk_container_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data (G_OBJECT (window), "loop", &loop);
g_object_set_data (G_OBJECT (window), "ret", &ret);
gtk_widget_realize (window);
// new vbox
vbox = gtk_vbox_new( FALSE, 10 );
gtk_container_add( GTK_CONTAINER( window ), vbox );
gtk_widget_show( vbox );
hbox = gtk_hbox_new( FALSE, 10 );
gtk_container_add( GTK_CONTAINER( vbox ), hbox );
gtk_widget_show( hbox );
// dunno if you want this text or not ...
w = gtk_label_new( text );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
w = gtk_hseparator_new();
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_widget_show( w );
// ------------------------- //
// new hbox
hbox = gtk_hbox_new( FALSE, 10 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
textlinkNum = gtk_entry_new_with_max_length( 256 );
gtk_box_pack_start( GTK_BOX( hbox ), textlinkNum, FALSE, FALSE, 1 );
gtk_widget_show( textlinkNum );
w = gtk_label_new( "Number of elements in chain" );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
gtk_widget_show( w );
// -------------------------- //
hbox = gtk_hbox_new( FALSE, 10 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
textlinkName = gtk_entry_new_with_max_length( 256 );
gtk_box_pack_start( GTK_BOX( hbox ), textlinkName, FALSE, FALSE, 0 );
gtk_widget_show( textlinkName );
w = gtk_label_new( "Basename for chain's targetnames." );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
gtk_widget_show( w );
w = gtk_button_new_with_label( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0);
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
gtk_widget_show( w );
w = gtk_button_new_with_label( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
ret = eIDCANCEL;
gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
gtk_widget_show (window);
gtk_grab_add (window);
bool dialogError = TRUE;
while (dialogError)
{
loop = 1;
while (loop)
gtk_main_iteration ();
dialogError = FALSE;
if(ret == eIDOK)
{
strcpy(rs->linkName, gtk_entry_get_text((GtkEntry*)textlinkName));
if(!ValidateTextInt(gtk_entry_get_text((GtkEntry*)textlinkNum), "Elements", &rs->linkNum))
dialogError = TRUE;
}
}
gtk_grab_remove (window);
gtk_widget_destroy (window);
return ret;
}

View File

@ -85,6 +85,11 @@ struct PathPlotterRS{
bool bShowExtra; bool bShowExtra;
}; };
struct MakeChainRS{
char linkName[256];
int linkNum;
};
typedef struct _GtkWidget GtkWidget; typedef struct _GtkWidget GtkWidget;
struct TwinWidget{ struct TwinWidget{
@ -101,7 +106,7 @@ EMessageBoxReturn DoDoorsBox(DoorRS* rs);
EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs); EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs);
EMessageBoxReturn DoCTFColourChangeBox(); EMessageBoxReturn DoCTFColourChangeBox();
EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs); EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs);
EMessageBoxReturn DoMakeChainBox(MakeChainRS* rs);
//GtkWidget* GetProgressWindow(char* title, GtkProgressBar* feedback); //GtkWidget* GetProgressWindow(char* title, GtkProgressBar* feedback);
#endif #endif

View File

@ -102,17 +102,19 @@ void DoIntersect()
{ {
if( GlobalSelectionSystem().countSelected() < 2 ) if( GlobalSelectionSystem().countSelected() < 2 )
{ {
DoMessageBox("Invalid number of brushes selected, choose at least 2", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose at least 2", "Error", eMB_OK);
globalErrorStream() << "bobToolz Intersect: Invalid number of brushes selected, choose at least 2.\n";
return; return;
} }
} }
DEntity world; DEntity world;
switch(rs.nBrushOptions) switch(rs.nBrushOptions)
{ {
case BRUSH_OPT_SELECTED: case BRUSH_OPT_SELECTED:
{ {
world.LoadFromEntity(GlobalRadiant().getMapWorldEntity(), false);
world.LoadSelectedBrushes(); world.LoadSelectedBrushes();
break; break;
} }
@ -122,7 +124,6 @@ void DoIntersect()
break; break;
} }
} }
world.RemoveNonCheckBrushes(&exclusionList, rs.bUseDetail); world.RemoveNonCheckBrushes(&exclusionList, rs.bUseDetail);
bool* pbSelectList; bool* pbSelectList;
@ -132,7 +133,8 @@ void DoIntersect()
pbSelectList = world.BuildIntersectList(); pbSelectList = world.BuildIntersectList();
world.SelectBrushes(pbSelectList); world.SelectBrushes(pbSelectList);
int brushCount = GlobalSelectionSystem().countSelected();
globalOutputStream() << "bobToolz Intersect: " << brushCount << " intersecting brushes found.\n";
delete[] pbSelectList; delete[] pbSelectList;
} }
@ -147,12 +149,18 @@ void DoPolygons()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz Polygons: Invalid number of brushes selected, choose 1 only.\n";
return; return;
} }
PolygonRS rs; PolygonRS rs;
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
if( !Node_isBrush(instance.path().top()) ) {
//DoMessageBox("No brush selected, select ONLY one brush", "Error", eMB_OK);
globalErrorStream() << "bobToolz Polygons: No brush selected, select ONLY one brush.\n";
return;
}
// ask user for type, size, etc.... // ask user for type, size, etc....
if(DoPolygonBox(&rs) == eIDOK) if(DoPolygonBox(&rs) == eIDOK)
{ {
@ -161,7 +169,7 @@ void DoPolygons()
vec3_t vMin, vMax; vec3_t vMin, vMax;
{ {
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin);
VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax);
@ -191,7 +199,7 @@ void DoFixBrushes()
int count = world.FixBrushes(); int count = world.FixBrushes();
globalOutputStream() << count << " invalid/duplicate planes removed\n"; globalOutputStream() << "bobToolz FixBrushes: " << count << " invalid/duplicate planes removed.\n";
} }
void DoResetTextures() void DoResetTextures()
@ -243,7 +251,8 @@ void DoBuildStairs()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz BuildStairs: Invalid number of brushes selected, choose 1 only.\n";
return; return;
} }
@ -265,7 +274,8 @@ void DoBuildStairs()
if(((int)size[2] % rs.stairHeight) != 0) if(((int)size[2] % rs.stairHeight) != 0)
{ {
// stairs must fit evenly into brush // stairs must fit evenly into brush
DoMessageBox("Invalid stair height\nHeight of block must be divisable by stair height", "Error", eMB_OK); //DoMessageBox("Invalid stair height\nHeight of block must be divisable by stair height", "Error", eMB_OK);
globalErrorStream() << "bobToolz BuildStairs: Invalid stair height. Height of block must be divisable by stair height.\n";
} }
else else
{ {
@ -328,7 +338,8 @@ void DoBuildDoors()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz BuildDoors: Invalid number of brushes selected, choose 1 only.\n";
return; return;
} }
@ -369,17 +380,21 @@ void DoPathPlotter()
} }
// ensure we have something selected // ensure we have something selected
/*
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK);
globalOutputStream() << "bobToolz PathPlotter: Invalid number of entities selected, choose 1 trigger_push entity only.\n";
return; return;
} }
*/
Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected().path().top()); Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected().path().top());
if(entity != 0) if(entity != 0)
{ {
DBobView_setEntity(*entity, rs.fMultiplier, rs.nPoints, rs.fGravity, rs.bNoUpdate, rs.bShowExtra); DBobView_setEntity(*entity, rs.fMultiplier, rs.nPoints, rs.fGravity, rs.bNoUpdate, rs.bShowExtra);
} }
else globalErrorStream() << "bobToolz PathPlotter: No trigger_push entitity selected, select 1 only (Use list to select it).\n";
return;
} }
void DoPitBuilder() void DoPitBuilder()
@ -388,13 +403,21 @@ void DoPitBuilder()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz PitBuilder: Invalid number of brushes selected, choose 1 only.\n";
return; return;
} }
vec3_t vMin, vMax; vec3_t vMin, vMax;
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
//seems it does this also with a patch with valid dimensions.. but probably better to enforce a brush.
if( !Node_isBrush(instance.path().top()) ) {
//DoMessageBox("No brush selected, select ONLY one brush", "Error", eMB_OK);
globalErrorStream() << "bobToolz PitBuilder: No brush selected, select ONLY 1 brush.\n";
return;
}
VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin);
VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax);
@ -403,16 +426,18 @@ void DoPitBuilder()
if(pit.BuildPit(vMin, vMax)) if(pit.BuildPit(vMin, vMax))
{ {
pit.Commit(); pit.Commit();
Path_deleteTop(instance.path()); Path_deleteTop(instance.path());
} }
else else
DoMessageBox("Failed To Make Pit\nTry Making The Brush Bigger", "Error", eMB_OK); {
//DoMessageBox("Failed To Make Pit\nTry Making The Brush Bigger", "Error", eMB_OK);
globalErrorStream() << "bobToolz PitBuilder: Failed to make Pit, try making the brush bigger.\n";
}
} }
void DoMergePatches() void DoMergePatches()
{ {
UndoableCommand undo("bobToolz.mergePatch"); UndoableCommand undo("bobToolz.mergePatches");
patch_merge_t merge_info; patch_merge_t merge_info;
DPatch mrgPatches[2]; DPatch mrgPatches[2];
int i; int i;
@ -420,7 +445,8 @@ void DoMergePatches()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 2 ) if( GlobalSelectionSystem().countSelected() != 2 )
{ {
DoMessageBox("Invalid number of patches selected, choose 2 only", "Error", eMB_OK); globalErrorStream() << "bobToolz MergePatches: Invalid number of patches selected, choose 2 only.\n";
//DoMessageBox("Invalid number of patches selected, choose 2 only", "Error", eMB_OK);
return; return;
} }
@ -432,7 +458,8 @@ void DoMergePatches()
{ {
if (!Node_isPatch(patches[i]->path().top())) if (!Node_isPatch(patches[i]->path().top()))
{ {
DoMessageBox("You must select ONLY patches", "Error", eMB_OK); //DoMessageBox("No patches selected, select ONLY patches", "Error", eMB_OK);
globalErrorStream() << "bobToolz MergePatches: Invalid number of patches selected, choose ONLY 2 patches.\n";
return; return;
} }
@ -448,8 +475,8 @@ void DoMergePatches()
if (merge_info.mergable) if (merge_info.mergable)
{ {
globalOutputStream() << merge_info.pos1 << " " << merge_info.pos2; globalOutputStream() << merge_info.pos1 << " " << merge_info.pos2;
//Message removed, No tools give feedback on success.
globalOutputStream() << "Patches Mergable\n"; //globalOutputStream() << "bobToolz MergePatches: Patches Mergable.\n";
DPatch* newPatch = mrgPatches[0].MergePatches(merge_info, &mrgPatches[0], &mrgPatches[1]); DPatch* newPatch = mrgPatches[0].MergePatches(merge_info, &mrgPatches[0], &mrgPatches[1]);
/* mrgPatches[0].RemoveFromRadiant(); /* mrgPatches[0].RemoveFromRadiant();
@ -474,7 +501,8 @@ void DoMergePatches()
} }
else else
{ {
globalOutputStream() << "bobToolz.mergePatch: the selected patches are not mergable\n"; globalErrorStream() << "bobToolz.mergePatch: The selected patches are not mergable.\n";
} }
} }
@ -486,14 +514,16 @@ void DoSplitPatch() {
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of patches selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of patches selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatch: Invalid number of patches selected, choose only 1 patch.\n";
return; return;
} }
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
if( !Node_isPatch(instance.path().top()) ) { if( !Node_isPatch(instance.path().top()) ) {
DoMessageBox("You must select ONLY patches", "Error", eMB_OK); //DoMessageBox("No patch selected, select ONLY one patch", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatch: No patch selected, select ONLY 1 patch.\n";
return; return;
} }
@ -507,6 +537,68 @@ void DoSplitPatch() {
Path_deleteTop(instance.path()); Path_deleteTop(instance.path());
} }
void DoSplitPatchCols() {
UndoableCommand undo("bobToolz.splitPatchCols");
DPatch patch;
// ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 )
{
//DoMessageBox("Invalid number of patches selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatchCols: Invalid number of patches selected, choose 1 only.\n";
return;
}
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
if( !Node_isPatch(instance.path().top()) ) {
//DoMessageBox("No patch selected, select ONLY one patch", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatchCols: No patch selected, select ONLY 1 patch.\n";
return;
}
patch.LoadFromPatch(instance);
std::list<DPatch> patchList = patch.SplitCols();
for(std::list<DPatch>::iterator patches = patchList.begin(); patches != patchList.end(); patches++) {
(*patches).BuildInRadiant();
}
Path_deleteTop(instance.path());
}
void DoSplitPatchRows() {
UndoableCommand undo("bobToolz.splitPatchRows");
DPatch patch;
// ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 )
{
//DoMessageBox("Invalid number of patches selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatchRows: Invalid number of patches selected, choose 1 only.\n";
return;
}
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
if( !Node_isPatch(instance.path().top()) ) {
//DoMessageBox("No patch selected, select ONLY one patch", "Error", eMB_OK);
globalErrorStream() << "bobToolz SplitPatchRows: No patch selected, select ONLY 1 patch.\n";
return;
}
patch.LoadFromPatch(instance);
std::list<DPatch> patchList = patch.SplitRows();
for(std::list<DPatch>::iterator patches = patchList.begin(); patches != patchList.end(); patches++) {
(*patches).BuildInRadiant();
}
Path_deleteTop(instance.path());
}
void DoSplitPatchCols() { void DoSplitPatchCols() {
UndoableCommand undo("bobToolz.splitPatchCols"); UndoableCommand undo("bobToolz.splitPatchCols");
@ -571,6 +663,7 @@ void DoVisAnalyse()
if( GlobalSelectionSystem().countSelected() == 0 ) if( GlobalSelectionSystem().countSelected() == 0 )
{ {
globalErrorStream() << "bobToolz VisAnalyse: Invalid number of objects selected, choose 1 only.\n";
if(g_VisView) if(g_VisView)
{ {
delete g_VisView; delete g_VisView;
@ -581,12 +674,18 @@ void DoVisAnalyse()
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 1 ) if( GlobalSelectionSystem().countSelected() != 1 )
{ {
DoMessageBox("Invalid number of objects selected, choose 1 only", "Error", eMB_OK); //DoMessageBox("Invalid number of objects selected, choose 1 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz VisAnalyse: Invalid number of objects selected, choose 1 only.\n";
return; return;
} }
scene::Instance& brush = GlobalSelectionSystem().ultimateSelected(); scene::Instance& brush = GlobalSelectionSystem().ultimateSelected();
//ensure we have a brush selected
if( !Node_isBrush(brush.path().top()) ) {
//DoMessageBox("No brush selected, select ONLY one brush", "Error", eMB_OK);
globalErrorStream() << "bobToolz VisAnalyse: No brush selected, select ONLY 1 brush.\n";
return;
}
DBrush orgBrush; DBrush orgBrush;
orgBrush.LoadFromBrush(brush, false); orgBrush.LoadFromBrush(brush, false);
@ -600,7 +699,8 @@ void DoVisAnalyse()
const char* rad_filename = GlobalRadiant().getMapName(); const char* rad_filename = GlobalRadiant().getMapName();
if(!rad_filename) if(!rad_filename)
{ {
DoMessageBox("An Error Occurred While Trying\n To Get The Map Filename", "Error", eMB_OK); //DoMessageBox("An ERROR occurred while trying\n to get the map filename", "Error", eMB_OK);
globalErrorStream() << "bobToolz VisAnalyse: An ERROR occurred while trying to get the map filename.\n";
return; return;
} }
@ -662,9 +762,17 @@ void DoDropEnts() {
} }
void DoMakeChain() { void DoMakeChain() {
MakeChainRS rs;
if(DoMakeChainBox(&rs) == eIDOK)
{
if ( rs.linkNum > 1001 ) {
globalErrorStream() << "bobToolz MakeChain: " << rs.linkNum << " to many Elemets, limited to 1000.\n";
return;
}
UndoableCommand undo("bobToolz.makeChain"); UndoableCommand undo("bobToolz.makeChain");
DTreePlanter pl; DTreePlanter pl;
pl.MakeChain(); pl.MakeChain(rs.linkNum,rs.linkName);
}
} }
typedef DPoint* pntTripple[3]; typedef DPoint* pntTripple[3];
@ -679,21 +787,31 @@ void DoFlipTerrain() {
// ensure we have something selected // ensure we have something selected
if( GlobalSelectionSystem().countSelected() != 2 ) if( GlobalSelectionSystem().countSelected() != 2 )
{ {
DoMessageBox("Invalid number of objects selected, choose 2 only", "Error", eMB_OK); //DoMessageBox("Invalid number of objects selected, choose 2 only", "Error", eMB_OK);
globalErrorStream() << "bobToolz FlipTerrain: Invalid number of objects selected, choose 2 only.\n";
return; return;
} }
scene::Instance* brushes[2]; scene::Instance* brushes[2];
brushes[0] = &GlobalSelectionSystem().ultimateSelected(); brushes[0] = &GlobalSelectionSystem().ultimateSelected();
brushes[1] = &GlobalSelectionSystem().penultimateSelected(); brushes[1] = &GlobalSelectionSystem().penultimateSelected();
//ensure we have only Brushes selected.
for (i = 0; i < 2; i++)
{
if( !Node_isBrush(brushes[i]->path().top()) ) {
//DoMessageBox("No brushes selected, select ONLY brushes", "Error", eMB_OK);
globalErrorStream() << "bobToolz FlipTerrain: No brushes selected, select ONLY 2 brushes.\n";
return;
}
}
DBrush Brushes[2]; DBrush Brushes[2];
DPlane* Planes[2]; DPlane* Planes[2];
pntTripple Points[2]; pntTripple Points[2];
for( i = 0; i < 2; i++ ) { for( i = 0; i < 2; i++ ) {
Brushes[i].LoadFromBrush( *brushes[i], false ); Brushes[i].LoadFromBrush( *brushes[i], false );
if(!(Planes[i] = Brushes[i].FindPlaneWithClosestNormal( vUp )) || Brushes[i].FindPointsForPlane( Planes[i], Points[i], 3 ) != 3) { if(!(Planes[i] = Brushes[i].FindPlaneWithClosestNormal( vUp )) || Brushes[i].FindPointsForPlane( Planes[i], Points[i], 3 ) != 3) {
DoMessageBox("Error", "Error", eMB_OK); //DoMessageBox("Error", "Error", eMB_OK);
globalErrorStream() << "bobToolz FlipTerrain: ERROR (FindPlaneWithClosestNormal/FindPointsForPlane).\n";
return; return;
} }
} }
@ -720,7 +838,8 @@ void DoFlipTerrain() {
found = false; found = false;
} }
if(dontmatch[0] == -1) { if(dontmatch[0] == -1) {
DoMessageBox("Error", "Error", eMB_OK); //DoMessageBox("Error", "Error", eMB_OK);
globalErrorStream() << "bobToolz FlipTerrain: ERROR (dontmatch[0]).\n";
return; return;
} }
@ -738,7 +857,8 @@ void DoFlipTerrain() {
found = false; found = false;
} }
if(dontmatch[1] == -1) { if(dontmatch[1] == -1) {
DoMessageBox("Error", "Error", eMB_OK); //DoMessageBox("Error", "Error", eMB_OK);
globalErrorStream() << "bobToolz FlipTerrain: ERROR (dontmatch[1]).\n";
return; return;
} }

View File

@ -577,30 +577,41 @@ void BuildDoorsX2(vec3_t min, vec3_t max,
void MakeBevel(vec3_t vMin, vec3_t vMax) void MakeBevel(vec3_t vMin, vec3_t vMax)
{ {
NodeSmartReference patch(GlobalPatchCreator().createPatch()); NodeSmartReference patch(GlobalPatchCreator().createPatch());
PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch);
GlobalPatchCreator().Patch_setShader(patch, "textures/common/caulk");
GlobalPatchCreator().Patch_resize(patch, 3, 3); GlobalPatchCreator().Patch_resize(patch, 3, 3);
GlobalPatchCreator().Patch_setShader(patch, "textures/common/caulk");
PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch);
vec3_t x_3, y_3, z_3; vec3_t x_3, y_3, z_3;
x_3[0] = vMin[0]; x_3[1] = vMin[0]; x_3[2] = vMax[0]; x_3[0] = vMin[0]; x_3[1] = vMin[0]; x_3[2] = vMax[0];
y_3[0] = vMin[1]; y_3[1] = vMax[1]; y_3[2] = vMax[1]; y_3[0] = vMin[1]; y_3[1] = vMax[1]; y_3[2] = vMax[1];
z_3[0] = vMin[2]; z_3[1] = (vMax[2] + vMin[2])/2; z_3[2] = vMax[2]; z_3[0] = vMin[2]; z_3[1] = (vMax[2] + vMin[2])/2; z_3[2] = vMax[2];
/*
/* x_3[0] = 0; x_3[1] = 0; x_3[2] = 64; x_3[0] = 0; x_3[1] = 0; x_3[2] = 64;
y_3[0] = 0; y_3[1] = 64; y_3[2] = 64; y_3[0] = 0; y_3[1] = 64; y_3[2] = 64;
z_3[0] = 0; z_3[1] = 32; z_3[2] = 64;*/ z_3[0] = 0; z_3[1] = 32; z_3[2] = 64;*/
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
{ {
for(int j = 0; j < 3; j++) for(int j = 0; j < 3; j++)
{ {
matrix(i, j).m_vertex[0] = x_3[i]; PatchControl& p = matrix(i, j);
matrix(i, j).m_vertex[1] = y_3[i]; p.m_vertex[0] = x_3[i];
matrix(i, j).m_vertex[2] = z_3[j]; p.m_vertex[1] = y_3[i];
p.m_vertex[2] = z_3[j];
} }
} }
//does invert the matrix, else the patch face is on wrong side.
for(int i = 0 ; i < 3 ; i++ )
{
for(int j = 0; j < 1; j++)
{
PatchControl& p = matrix(i,2- j);
PatchControl& q = matrix(i, j);
std::swap(p.m_vertex, q.m_vertex);
//std::swap(p.m_texcoord, q.m_texcoord);
}
}
GlobalPatchCreator().Patch_controlPointsChanged(patch);
//TODO - the patch has textures weird, patchmanip.h has all function it needs.. lots of duplicate code..
//NaturalTexture(patch);
Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(patch); Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(patch);
} }
@ -609,7 +620,7 @@ void BuildCornerStairs(vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTex
vec3_t* topPoints = new vec3_t[nSteps+1]; vec3_t* topPoints = new vec3_t[nSteps+1];
vec3_t* botPoints = new vec3_t[nSteps+1]; vec3_t* botPoints = new vec3_t[nSteps+1];
bool bFacesUse[6] = {true, true, false, true, false, false}; //bool bFacesUse[6] = {true, true, false, true, false, false};
vec3_t centre; vec3_t centre;
VectorCopy(vMin, centre); VectorCopy(vMin, centre);
@ -644,7 +655,24 @@ void BuildCornerStairs(vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTex
for(i = 0; i < nSteps; i++) for(i = 0; i < nSteps; i++)
{ {
scene::Node& brush = Build_Get_BoundingCube_Selective(vBot, vTop, "textures/common/caulk", bFacesUse); NodeSmartReference brush(GlobalBrushCreator().createBrush());
vec3_t v1, v2, v3, v5, v6, v7;
VectorCopy(vBot, v1);
VectorCopy(vBot, v2);
VectorCopy(vBot, v3);
VectorCopy(vTop, v5);
VectorCopy(vTop, v6);
VectorCopy(vTop, v7);
v2[0] = vTop[0];
v3[1] = vTop[1];
v6[0] = vBot[0];
v7[1] = vBot[1];
AddFaceWithTexture(brush, v1, v2, v3, "textures/common/caulk", false);
AddFaceWithTexture(brush, v1, v3, v6, "textures/common/caulk", false);
AddFaceWithTexture(brush, v5, v6, v3, "textures/common/caulk", false);
for(int j = 0; j < 3; j++) for(int j = 0; j < 3; j++)
tp[j][2] = vTop[2]; tp[j][2] = vTop[2];

16
docs/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.25">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
</style>
</head>
<body>
<p class="p1">put here links</p>
</body>
</html>

View File

@ -2318,8 +2318,14 @@ struct OpenGLBinding
void (QGL_DLLEXPORT *m_glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); void (QGL_DLLEXPORT *m_glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
void (QGL_DLLEXPORT *m_glTexGeni)(GLenum coord, GLenum pname, GLint param); void (QGL_DLLEXPORT *m_glTexGeni)(GLenum coord, GLenum pname, GLint param);
void (QGL_DLLEXPORT *m_glTexGeniv)(GLenum coord, GLenum pname, const GLint *params); void (QGL_DLLEXPORT *m_glTexGeniv)(GLenum coord, GLenum pname, const GLint *params);
#if defined(MACVERSION) && MACVERSION > 15
//Snow Leopard 16, Leopard 15, Tiger 14, Panther 13, ...
void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
#else
void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
#endif
void (QGL_DLLEXPORT *m_glTexParameterf)(GLenum target, GLenum pname, GLfloat param); void (QGL_DLLEXPORT *m_glTexParameterf)(GLenum target, GLenum pname, GLfloat param);
void (QGL_DLLEXPORT *m_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); void (QGL_DLLEXPORT *m_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
void (QGL_DLLEXPORT *m_glTexParameteri)(GLenum target, GLenum pname, GLint param); void (QGL_DLLEXPORT *m_glTexParameteri)(GLenum target, GLenum pname, GLint param);

View File

@ -7,6 +7,8 @@ set -ex
: ${INSTALLDIR:=.} : ${INSTALLDIR:=.}
: ${EXE:=ppc} : ${EXE:=ppc}
: ${MACLIBDIR:=/sw/lib} : ${MACLIBDIR:=/sw/lib}
: ${CAT:=cat}
finkgetdeps() finkgetdeps()
{ {
@ -18,6 +20,7 @@ finkgetdeps()
done done
} }
finkgetdeps "$INSTALLDIR/radiant.$EXE" finkgetdeps "$INSTALLDIR/radiant.$EXE"
echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed
@ -38,3 +41,31 @@ for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-x.so; do
done done
cp -L "$LAST" "$INSTALLDIR" cp -L "$LAST" "$INSTALLDIR"
finkgetdeps "$LAST" finkgetdeps "$LAST"
cp -L "$MACLIBDIR"/../etc/fonts/fonts.conf "$INSTALLDIR"
cp -L "$MACLIBDIR"/../etc/fonts/fonts.dtd "$INSTALLDIR"
cp -L "$MACLIBDIR"/../etc/gtk-2.0/gdk-pixbuf.loaders "$INSTALLDIR"
cp -L "$MACLIBDIR"/../etc/pango/pangorc "$INSTALLDIR"
$CAT > "$INSTALLDIR/../netradiant.sh" <<EOF
#!/bin/sh
MY_DIRECTORY="\${0%/*}" # cut off the script name
MY_DIRECTORY="\${MY_DIRECTORY%/*}" # cut off MacOS
MY_DIRECTORY="\${MY_DIRECTORY%/*}" # cut off Contents
export DYLD_LIBRARY_PATH="\$MY_DIRECTORY/Contents/MacOS/install"
export PANGO_RC_FILE="\$MY_DIRECTORY/Contents/MacOS/install/pangorc"
export GDK_PIXBUF_MODULE_FILE="\$MY_DIRECTORY/Contents/MacOS/install/gdk-pixbuf.loaders"
export FONTCONFIG_FILE="\$MY_DIRECTORY/Contents/MacOS/install/fonts.conf"
cd "\$MY_DIRECTORY/Contents/MacOS/install"
if [ -x /usr/bin/open-x11 ]; then
env LC_ALL="en_US.UTF-8" /usr/bin/open-x11 ./radiant.$EXE "$@" &
else
env LC_ALL="en_US.UTF-8" ./radiant.$EXE "$@" &
fi
EOF
chmod 755 "$INSTALLDIR/../netradiant.sh"

20
osx-Makefile.conf Normal file
View File

@ -0,0 +1,20 @@
# Makefile.conf template
## OS X:
BUILD=debug
RADIANT_ABOUTMSG=OSX NetRadiant Custom build
EXE=ub
### Snow Leopard 16, Leopard 15, Tiger 14, Panther 13
MACVERSION=16
#
## MacPorts:
CPPFLAGS=-I/opt/local/include/ -I/usr/X11R6/include/
LDFLAGS=-L/opt/local/lib -L/usr/X11R6/lib
MACLIBDIR=/opt/local/lib
## Fink
## (-arch ppc can combined with -arch 386, I read somewhere. However does work fine like this on OSX 10.6)
# LDFLAGS=-arch i386
# CFLAGS=-arch i386
# TARGET_ARCH=-arch i386
# MACLIBDIR=/sw/lib

View File

@ -992,9 +992,9 @@ void OpenUpdateURL()
// open the Q3Rad manual // open the Q3Rad manual
void OpenHelpURL() void OpenHelpURL()
{ {
// at least on win32, AppPath + "Q3Rad_Manual/index.htm" // at least on win32, AppPath + "docs/index.html"
StringOutputStream help(256); StringOutputStream help(256);
help << AppPath_get() << "Q3Rad_Manual/index.htm"; help << AppPath_get() << "docs/index.html";
OpenURL(help.c_str()); OpenURL(help.c_str());
} }

View File

@ -776,6 +776,14 @@ void Patch::InsertPoints(EMatrixMajor mt, bool bFirst)
std::size_t pos = 0; std::size_t pos = 0;
{ {
PatchControl* p1 = m_ctrl.data(); PatchControl* p1 = m_ctrl.data();
/*
if(GlobalSelectionSystem().countSelected() != 0)
{
scene::Instance& instance = GlobalSelectionSystem().ultimateSelected();
PatchInstance* patch = Instance_getPatch(instance);
patch->m_selectable.isSelected();
}
*/
for(std::size_t w = 0; w != width; ++w, p1 += col_stride) for(std::size_t w = 0; w != width; ++w, p1 += col_stride)
{ {
{ {
@ -831,6 +839,14 @@ void Patch::InsertPoints(EMatrixMajor mt, bool bFirst)
ERROR_MESSAGE("neither row-major nor column-major"); ERROR_MESSAGE("neither row-major nor column-major");
return; return;
} }
if(bFirst)
{
pos = height - 1;
}
else
{
pos = 2;
}
if(pos >= height) if(pos >= height)
{ {
@ -978,7 +994,14 @@ void Patch::RemovePoints(EMatrixMajor mt, bool bFirst)
ERROR_MESSAGE("neither row-major nor column-major"); ERROR_MESSAGE("neither row-major nor column-major");
return; return;
} }
if(bFirst)
{
pos=height-3;
}
else
{
pos=2;
}
if(pos >= height) if(pos >= height)
{ {
if(bFirst) if(bFirst)

View File

@ -1,17 +0,0 @@
#!/bin/sh
MY_DIRECTORY="${0%/*}" # cut off the script name
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off MacOS
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off Contents
export DYLD_LIBRARY_PATH="$MY_DIRECTORY/Contents/MacOS/install"
export PANGO_RC_FILE="$MY_DIRECTORY/Contents/MacOS/install/pangorc"
export GDK_PIXBUF_MODULE_FILE="$MY_DIRECTORY/Contents/MacOS/install/gdk-pixbuf.loaders"
export FONTCONFIG_FILE="$MY_DIRECTORY/Contents/MacOS/install/fonts.conf"
cd "$MY_DIRECTORY/Contents/MacOS/install"
if [ -x /usr/bin/open-x11 ]; then
/usr/bin/open-x11 ./radiant.%EXE% "$@" &
else
./radiant.%EXE% "$@" &
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 1.3 KiB