jodi on Sat, 28 Jun 2008 04:21:09 +0200 (CEST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

<nettime-ann> WEBCRA.SH http://webcra.sh/


.
diff -urN orig/ioquake3/code/qcommon/common.c mod/ioquake3/code/ 
qcommon/common.c
--- orig/ioquake3/code/qcommon/common.c	2008-06-10 04:22:58.000000000  
+0200
+++ mod/ioquake3/code/qcommon/common.c	2008-06-10 05:20:32.000000000  
+0200
@@ -2809,6 +2809,9 @@
  	int           timeBeforeEvents;
  	int           timeBeforeClient;
  	int           timeAfter;
+	byte          *buffer = NULL;
+	int           width = 0;
+	int           height = 0;



@@ -2903,6 +2906,16 @@
  	Cbuf_Execute ();


+	if (com_frameNumber % com_maxfps->integer*2 == 0) {
+		R_LoadImage("process.tga", &buffer, &width, &height);
+		if (buffer) {
+			R_ReflectWorld(buffer, width, height, (com_frameNumber/com_maxfps- 
 >integer) % 10);
+			Z_Free(buffer);
+			buffer = 0;
+		}
+	}
+
+
  	//
  	// client side
  	//
diff -urN orig/ioquake3/code/qcommon/files.c mod/ioquake3/code/ 
qcommon/files.c
--- orig/ioquake3/code/qcommon/files.c	2008-06-10 04:22:58.000000000  
+0200
+++ mod/ioquake3/code/qcommon/files.c	2008-06-10 04:26:12.000000000  
+0200
@@ -1122,7 +1122,8 @@
  			//   this test can make the search fail although the file is in  
the directory
  			// I had the problem on https://zerowing.idsoftware.com/bugzilla/ 
show_bug.cgi?id=8
  			// turned out I used FS_FileExists instead
-			if ( fs_numServerPaks ) {
+			// HACK
+			if ( 0 ) {

  				if ( Q_stricmp( filename + l - 4, ".cfg" )		// for config files
  					&& Q_stricmp( filename + l - 5, ".menu" )	// menu files
diff -urN orig/ioquake3/code/renderer/tr_image.c mod/ioquake3/code/ 
renderer/tr_image.c
--- orig/ioquake3/code/renderer/tr_image.c	2008-06-10  
04:22:49.000000000 +0200
+++ mod/ioquake3/code/renderer/tr_image.c	2008-06-10  
04:46:40.000000000 +0200
@@ -740,6 +740,48 @@
  }


+void R_ReplaceTexture(image_t *img, const byte *pic, int width, int  
height)
+{
+	qglDeleteTextures(1, &img->texnum);
+
+	// update properties
+	img->width = width;
+	img->height = height;
+	img->wrapClampMode = GL_REPEAT;
+
+	if (qglActiveTextureARB) {
+		GL_SelectTexture(img->TMU);
+	}
+
+	GL_Bind(img);
+
+	Upload32((unsigned*)pic, img->width, img->height, img->mipmap, img- 
 >allowPicmip, qfalse, &img->internalFormat, &img->uploadWidth, &img- 
 >uploadHeight);
+
+	qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, img- 
 >wrapClampMode);
+	qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, img- 
 >wrapClampMode);
+
+	qglBindTexture(GL_TEXTURE_2D, 0);
+
+	if (img->TMU == 1) {
+		GL_SelectTexture(0);
+	}
+}
+
+
+void R_ReflectWorld(const byte *pic, int width, int height, int cycle)
+{
+	int i;
+
+	R_SyncRenderThread();
+	for (i=cycle; i<tr.numImages; i+=10) {
+		if (!strncmp(tr.images[i]->imgName, "*lightmap", 9))
+			continue;
+		R_ReplaceTexture(tr.images[i], pic, width, height);
+	}
+	R_IssueRenderCommands(qfalse);
+}
+
+
  /*
  ================
  R_CreateImage


_______________________________________________
nettime-ann mailing list
nettime-ann@nettime.org
http://www.nettime.org/cgi-bin/mailman/listinfo/nettime-ann