Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9309/src/editor
Modified Files:
gomapedit.cpp mapedit.cpp mapeditfileinput.cpp
mapeditfileinput.h mapeditglobals.cpp mapeditglobals.h
mapeditgui.cpp mapeditgui.h
Log Message:
- now textures are 32x32 pixels instead of 16x16.
- fixed light poly bug
- added New in system menu, as well as rearranged the options. they are now:
New, Save, Load, Import, Preferences
- can hide light circles now
- now supports multiple texture files. changes have been made to modify/poly/texture
Index: mapeditfileinput.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditfileinput.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mapeditfileinput.h 20 Jan 2004 02:48:43 -0000 1.3
--- mapeditfileinput.h 24 Dec 2004 23:13:05 -0000 1.4
***************
*** 16,20 ****
void load_file(char* rfile);
void save_file_detailed(char* rfile);
- void save_file_simple(char* rfile);
--- 16,19 ----
Index: gomapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/gomapedit.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** gomapedit.cpp 8 Nov 2004 14:17:35 -0000 1.14
--- gomapedit.cpp 24 Dec 2004 23:13:04 -0000 1.15
***************
*** 72,77 ****
! if (editingmode == system_save_detailed) gui_system_save(0);
! if (editingmode == system_save_simple) gui_system_save(1);
if (editingmode == system_load) gui_system_load();
--- 72,76 ----
! if (editingmode == system_save) gui_system_save(0);
if (editingmode == system_load) gui_system_load();
Index: mapeditgui.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mapeditgui.cpp 8 Nov 2004 14:17:35 -0000 1.7
--- mapeditgui.cpp 24 Dec 2004 23:13:05 -0000 1.8
***************
*** 136,140 ****
sprintf(rrows, "%s", editbox(gleft + 128, gtop + 2 + 12 * 8, gleft + 133 + 8 * 4, gtop + 11 + 12 * 8, 4, rrows));
! stretch_sprite(offscreen, textures[rettx], gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32);
surroundbox(2, gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31);
if (checkmouse(gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31))
--- 136,142 ----
sprintf(rrows, "%s", editbox(gleft + 128, gtop + 2 + 12 * 8, gleft + 133 + 8 * 4, gtop + 11 + 12 * 8, 4, rrows));
! //stretch_sprite(offscreen, textures[rettx], gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32);
! blit(textures[rettx], offscreen, 0, 0, gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32);
!
surroundbox(2, gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31);
if (checkmouse(gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31))
***************
*** 144,148 ****
{
freeze = timer + .004 * fpsr;
! rettx = gui_select_texture(rettx);
}
}
--- 146,150 ----
{
freeze = timer + .004 * fpsr;
! rettx = gui_select_texture(rettx, 0);
}
}
***************
*** 579,583 ****
{
freeze = timer + .004 * fpsr;
! rettx = gui_select_texture(rettx);
}
}
--- 581,585 ----
{
freeze = timer + .004 * fpsr;
! rettx = gui_select_texture(rettx, 0);
}
}
***************
*** 905,909 ****
! int gui_select_texture(int basetx)
{
--- 907,911 ----
! int gui_select_texture(int basetx, int txset)
{
***************
*** 951,956 ****
for (x = 0; x < 20; x++)
{
! p = y * 20 + x;
! stretch_sprite(offscreen, textures[p], gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32);
}
}
--- 953,959 ----
for (x = 0; x < 20; x++)
{
! p = txset * 300 + y * 20 + x;
! blit (textures[p], offscreen, 0, 0, gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32);
! //stretch_sprite(offscreen, textures[p], gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32);
}
}
***************
*** 959,963 ****
for (x = 0; x < 20; x++)
{
! p = y * 20 + x;
if (basetx == p) surroundbox(2, gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31);
if (checkmouse(gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31))
--- 962,966 ----
for (x = 0; x < 20; x++)
{
! p = txset * 300 + y * 20 + x;
if (basetx == p) surroundbox(2, gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31);
if (checkmouse(gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31))
***************
*** 1160,1165 ****
{
sprintf(curfile, "%s", rfile);
! if (mode == 0) save_file_detailed(rfile);
! if (mode == 1) save_file_simple(rfile);
} else {
allegro_message("Unable to Process Request");
--- 1163,1167 ----
{
sprintf(curfile, "%s", rfile);
! if (mode == 0) save_file_detailed(rfile);
} else {
allegro_message("Unable to Process Request");
Index: mapeditfileinput.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditfileinput.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mapeditfileinput.cpp 8 Nov 2004 14:17:35 -0000 1.7
--- mapeditfileinput.cpp 24 Dec 2004 23:13:05 -0000 1.8
***************
*** 129,133 ****
}
! temppcx = create_system_bitmap((planeinfo[c].lastpoly + 1) * 16, 16);
clear(temppcx);
--- 129,133 ----
}
! temppcx = create_system_bitmap((planeinfo[c].lastpoly + 1) * 32, 32);
clear(temppcx);
***************
*** 149,153 ****
if (planeinfo[c].radiosity_setup[d] > 0)
{
! blit(planeinfo[c].radiosity[d], temppcx, 0, 0, d * 16, 0, 16, 16);
}
--- 149,153 ----
if (planeinfo[c].radiosity_setup[d] > 0)
{
! blit(planeinfo[c].radiosity[d], temppcx, 0, 0, d * 32, 0, 32, 32);
}
***************
*** 174,193 ****
}
- void save_file_simple(char* rfile)
- {
-
- FILE *fp;
- char mapfile[100];
-
- sprintf(mapfile, "data/maps/%s.smp", rfile);
-
- fp = fopen(mapfile, "w");
-
- int version = 1;
-
- fprintf(fp, "%d\n", version);
-
- fclose(fp);
- }
-
-
--- 174,175 ----
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** mapedit.cpp 8 Nov 2004 23:32:54 -0000 1.19
--- mapedit.cpp 24 Dec 2004 23:13:05 -0000 1.20
***************
*** 121,125 ****
//c = getpixel(planeinfo[i].radiosity[j], x, y);
//c = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
! blit (textures[planeinfo[i].polyinfo[j][3]], planeinfo[i].radiosity[j], 0, 0, 0, 0, 16, 16);
}
}
--- 121,125 ----
//c = getpixel(planeinfo[i].radiosity[j], x, y);
//c = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
! blit (textures[planeinfo[i].polyinfo[j][3]], planeinfo[i].radiosity[j], 0, 0, 0, 0, 32, 32);
}
}
***************
*** 129,133 ****
for (j = 0; j <= nselpoly; j++)
{
! if (planeinfo[selplane].polyinfo[selpoly[j]][6] == 0) blit (textures[planeinfo[selplane].polyinfo[selpoly[j]][3]], planeinfo[selplane].radiosity[selpoly[j]], 0, 0, 0, 0, 16, 16);
}
}
--- 129,133 ----
for (j = 0; j <= nselpoly; j++)
{
! if (planeinfo[selplane].polyinfo[selpoly[j]][6] == 0) blit (textures[planeinfo[selplane].polyinfo[selpoly[j]][3]], planeinfo[selplane].radiosity[selpoly[j]], 0, 0, 0, 0, 32, 32);
}
}
***************
*** 135,138 ****
--- 135,144 ----
}
+ if (key[KEY_L] && freeze < timer)
+ {
+ lightcircles = !lightcircles;
+ freeze = timer + .002 * fpsr;
+ }
+
if (key[KEY_TAB] && freeze < timer)
***************
*** 180,184 ****
{
! rectfill(planeinfo[a].radiosity[b], 0, 0, 15, 15, 0);
}
}
--- 186,190 ----
{
! rectfill(planeinfo[a].radiosity[b], 0, 0, 31, 31, 0);
}
}
***************
*** 793,827 ****
if (editingmode >= sys && editingmode < 100)
{
! if (editingmode == sys || editingmode >= system_save && editingmode < system_load)
{
if (editingmode == system_save) win(1, 128, 24 + 12 * 0, 255, 35 + 12 * 0);
if (editingmode != system_save) win(0, 128, 24 + 12 * 0, 255, 35 + 12 * 0);
! sprintf(tmptxt, "1 Save");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 0 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_load && editingmode < 030)
{
if (editingmode == system_load) win(1, 128, 24 + 12 * 1, 255, 35 + 12 * 1);
if (editingmode != system_load) win(0, 128, 24 + 12 * 1, 255, 35 + 12 * 1);
! sprintf(tmptxt, "2 Load");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 1 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_import && editingmode < 040)
{
if (editingmode == system_import) win(1, 128, 24 + 12 * 2, 255, 35 + 12 * 2);
if (editingmode != system_import) win(0, 128, 24 + 12 * 2, 255, 35 + 12 * 2);
! sprintf(tmptxt, "3 Import");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 2 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_preferences && editingmode < 050)
{
if (editingmode == system_preferences) win(1, 128, 24 + 12 * 3, 255, 35 + 12 * 3);
if (editingmode != system_preferences) win(0, 128, 24 + 12 * 3, 255, 35 + 12 * 3);
! sprintf(tmptxt, "4 Preferences");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 3 + 2, whitec);
}
if (editingmode == sys && freeze < timer)
--- 799,842 ----
if (editingmode >= sys && editingmode < 100)
{
! if (editingmode == sys || editingmode >= system_new && editingmode < system_save)
{
if (editingmode == system_save) win(1, 128, 24 + 12 * 0, 255, 35 + 12 * 0);
if (editingmode != system_save) win(0, 128, 24 + 12 * 0, 255, 35 + 12 * 0);
! sprintf(tmptxt, "1 New");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 0 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_save && editingmode < system_load)
{
if (editingmode == system_load) win(1, 128, 24 + 12 * 1, 255, 35 + 12 * 1);
if (editingmode != system_load) win(0, 128, 24 + 12 * 1, 255, 35 + 12 * 1);
! sprintf(tmptxt, "2 Save");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 1 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_load && editingmode < system_import)
{
if (editingmode == system_import) win(1, 128, 24 + 12 * 2, 255, 35 + 12 * 2);
if (editingmode != system_import) win(0, 128, 24 + 12 * 2, 255, 35 + 12 * 2);
! sprintf(tmptxt, "3 Load");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 2 + 2, whitec);
}
! if (editingmode == sys || editingmode >= system_import && editingmode < system_preferences)
{
if (editingmode == system_preferences) win(1, 128, 24 + 12 * 3, 255, 35 + 12 * 3);
if (editingmode != system_preferences) win(0, 128, 24 + 12 * 3, 255, 35 + 12 * 3);
! sprintf(tmptxt, "4 Import");
textout(offscreen, font, tmptxt, 132, 24 + 12 * 3 + 2, whitec);
}
+
+ if (editingmode == sys || editingmode >= system_preferences && editingmode < 060)
+ {
+ if (editingmode == system_import) win(1, 128, 24 + 12 * 4, 255, 35 + 12 * 4);
+ if (editingmode != system_import) win(0, 128, 24 + 12 * 4, 255, 35 + 12 * 4);
+ sprintf(tmptxt, "5 Preferences");
+ textout(offscreen, font, tmptxt, 132, 24 + 12 * 4 + 2, whitec);
+ }
+
if (editingmode == sys && freeze < timer)
***************
*** 829,875 ****
if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 0, 255, 35 + 12 * 0)) || key[KEY_1])
{
! editingmode = system_save;
freeze = timer + .002 * fpsr;
}
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 1, 255, 35 + 12 * 1)) || key[KEY_2]) editingmode = system_load;
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 2, 255, 35 + 12 * 2)) || key[KEY_3])
{
! editingmode = system_import;
freeze = timer + .002 * fpsr;
}
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 3, 255, 35 + 12 * 3)) || key[KEY_4]) editingmode = system_preferences;
! }
!
! if (editingmode == system_save)
! {
! win(0, 256, 24 + 12 * 0, 383, 35 + 12 * 0);
! sprintf(tmptxt, "1 Detailed");
! textout(offscreen, font, tmptxt, 260, 24 + 12 * 0 + 2, whitec);
!
! win(0, 256, 24 + 12 * 1, 383, 35 + 12 * 1);
! sprintf(tmptxt, "2 Simple");
! textout(offscreen, font, tmptxt, 260, 24 + 12 * 1 + 2, whitec);
!
! if (freeze < timer)
{
! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 0, 383, 35 + 12 * 0)) || key[KEY_1]) editingmode = system_save_detailed;
! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 1, 383, 35 + 12 * 1)) || key[KEY_2]) editingmode = system_save_simple;
}
}
! if (editingmode == system_import)
{
- win(0, 256, 24 + 12 * 2, 383, 35 + 12 * 2);
- sprintf(tmptxt, "1 Simple");
- textout(offscreen, font, tmptxt, 260, 24 + 12 * 2 + 2, whitec);
-
win(0, 256, 24 + 12 * 3, 383, 35 + 12 * 3);
sprintf(tmptxt, "2 ASE");
! textout(offscreen, font, tmptxt, 260, 24 + 12 * 3 + 2, whitec);
if (freeze < timer)
{
! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 2, 383, 35 + 12 * 2)) || key[KEY_1]) editingmode = system_save_detailed;
! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 3, 383, 35 + 12 * 3)) || key[KEY_2]) editingmode = system_save_simple;
}
}
--- 844,889 ----
if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 0, 255, 35 + 12 * 0)) || key[KEY_1])
{
! editingmode = 0;
! nlights = 0;
! endplane = 0;
!
! for (a = 0; a <= max_planes; a++)
! {
! planeinfo[a].active = FALSE;
! planeinfo[a].npoints = 0;
! planeinfo[a].npolies = 0;
! planeinfo[a].condensed = FALSE;
! }
! setup_scene();
freeze = timer + .002 * fpsr;
}
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 1, 255, 35 + 12 * 1)) || key[KEY_2])
{
! editingmode = system_save;
freeze = timer + .002 * fpsr;
}
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 2, 255, 35 + 12 * 2)) || key[KEY_3]) editingmode = system_load;
! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 3, 255, 35 + 12 * 3)) || key[KEY_4])
{
! editingmode = system_import;
! freeze = timer + .002 * fpsr;
}
+ if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 4, 255, 35 + 12 * 4)) || key[KEY_5]) editingmode = system_preferences;
}
! if (editingmode == system_import && freeze < timer)
{
win(0, 256, 24 + 12 * 3, 383, 35 + 12 * 3);
+ sprintf(tmptxt, "1 DTL");
+ textout(offscreen, font, tmptxt, 260, 24 + 12 * 3 + 2, whitec);
+
+ win(0, 256, 24 + 12 * 4, 383, 35 + 12 * 4);
sprintf(tmptxt, "2 ASE");
! textout(offscreen, font, tmptxt, 260, 24 + 12 * 4 + 2, whitec);
if (freeze < timer)
{
! //if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 2, 383, 35 + 12 * 2)) || key[KEY_1]) editingmode = system_save_detailed;
! //if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 3, 383, 35 + 12 * 3)) || key[KEY_2]) editingmode = system_save_simple;
}
}
***************
*** 1277,1285 ****
}
! if (editingmode == modify_poly)
{
win(0, 256, 24 + 12 * 10, 383, 35 + 12 * 10);
sprintf(tmptxt, "2 Texture");
textout(offscreen, font, tmptxt, 260, 24 + 12 * 10 + 2, whitec);
}
--- 1291,1326 ----
}
! if (editingmode == modify_poly || editingmode == modify_poly_texture)
{
win(0, 256, 24 + 12 * 10, 383, 35 + 12 * 10);
sprintf(tmptxt, "2 Texture");
textout(offscreen, font, tmptxt, 260, 24 + 12 * 10 + 2, whitec);
+
+ if (editingmode == modify_poly_texture)
+ {
+ win(0, 384, 24 + 12 * 10, 511, 35 + 12 * 10);
+ sprintf(tmptxt, "1 tx0.pcx");
+ textout(offscreen, font, tmptxt, 388, 24 + 12 * 10 + 2, whitec);
+
+ win(0, 384, 24 + 12 * 11, 511, 35 + 12 * 11);
+ sprintf(tmptxt, "2 tx1.pcx");
+ textout(offscreen, font, tmptxt, 388, 24 + 12 * 11 + 2, whitec);
+
+ if (freeze < timer)
+ {
+ if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 10, 511, 35 + 12 * 10)) || key[KEY_1])
+ {
+ hlpoly = FALSE;
+ editingmode = modify_poly_texture_select1;
+ freeze = timer + .002 * fpsr;
+ }
+ if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 11, 511, 35 + 12 * 11)) || key[KEY_2])
+ {
+ hlpoly = FALSE;
+ editingmode = modify_poly_texture_select2;
+ freeze = timer + .002 * fpsr;
+ }
+ }
+ }
}
***************
*** 1403,1408 ****
}
if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 10, 383, 35 + 12 * 10)) || key[KEY_2])
! {
! hlpoly = FALSE;
editingmode = modify_poly_texture;
freeze = timer + .002 * fpsr;
--- 1444,1448 ----
}
if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 10, 383, 35 + 12 * 10)) || key[KEY_2])
! {
editingmode = modify_poly_texture;
freeze = timer + .002 * fpsr;
***************
*** 1448,1451 ****
--- 1488,1492 ----
if (editingmode >= modify_point && editingmode < modify_light && (nselpoint > 0 || nselpointc > 0))
{
+
if (editingmode == modify_point || editingmode >= modify_point_by_input && editingmode < modify_point_rotate)
{
***************
*** 1841,1845 ****
{
p = c + basepoint;
! if (p > 999) p = 999;
spanx = planeinfo[tselplane].basex - planeinfo[selplane].basex;
spany = planeinfo[tselplane].basey - planeinfo[selplane].basey;
--- 1882,1886 ----
{
p = c + basepoint;
! if (p > max_points_per_plane-1) p = max_points_per_plane -1;
spanx = planeinfo[tselplane].basex - planeinfo[selplane].basex;
spany = planeinfo[tselplane].basey - planeinfo[selplane].basey;
***************
*** 1878,1882 ****
{
p = c + basepoly;
! if (p > 999) p = 999;
p1 = planeinfo[tselplane].polyinfo[c][0] + basepoint;
p2 = planeinfo[tselplane].polyinfo[c][1] + basepoint;
--- 1919,1923 ----
{
p = c + basepoly;
! if (p > max_polies_per_plane - 1) p = max_polies_per_plane - 1;
p1 = planeinfo[tselplane].polyinfo[c][0] + basepoint;
p2 = planeinfo[tselplane].polyinfo[c][1] + basepoint;
***************
*** 1902,1905 ****
--- 1943,1953 ----
if (p > planeinfo[selplane].lastpoly) planeinfo[selplane].lastpoly = p;
+
+ if (planeinfo[selplane].radiosity_setup[p] == 0)
+ {
+ planeinfo[selplane].radiosity[p] = create_system_bitmap(32, 32);
+ planeinfo[selplane].radiosity_setup[p] = 1;
+ }
+ blit(planeinfo[tselplane].radiosity[c], planeinfo[selplane].radiosity[p], 0, 0, 0, 0, 32, 32);
}
}
***************
*** 1982,1986 ****
circle (offscreen, pointinfo[p].x, pointinfo[p].y, clearance, orangec);
! circle (offscreen, pointinfo[p].x, pointinfo[p].y, x, makecol(lightinfo[c].lightr, lightinfo[c].lightg, lightinfo[c].lightb));
}
--- 2030,2034 ----
circle (offscreen, pointinfo[p].x, pointinfo[p].y, clearance, orangec);
! if (lightcircles) circle (offscreen, pointinfo[p].x, pointinfo[p].y, x, makecol(lightinfo[c].lightr, lightinfo[c].lightg, lightinfo[c].lightb));
}
***************
*** 2047,2051 ****
planeinfo[newplane].condensed = TRUE;
planeinfo[newplane].lastpoint = 0;
! planeinfo[newplane].lastpoly = 0;
planeinfo[newplane].basex = selpoint[0][0];
planeinfo[newplane].basey = selpoint[0][1];
--- 2095,2099 ----
planeinfo[newplane].condensed = TRUE;
planeinfo[newplane].lastpoint = 0;
! planeinfo[newplane].lastpoly = -1;
planeinfo[newplane].basex = selpoint[0][0];
planeinfo[newplane].basey = selpoint[0][1];
***************
*** 2060,2069 ****
planeinfo[newplane].yrot = 0;
planeinfo[newplane].zrot = 0;
! planeinfo[newplane].pointinfo[0][9] = lastlight + 1;
!
lightinfo[lastlight].strength = 6;
lightinfo[lastlight].lightr = 255;
lightinfo[lastlight].lightg = 255;
! lightinfo[lastlight].lightb = 224;
if (newplane > endplane) endplane = newplane;
--- 2108,2122 ----
planeinfo[newplane].yrot = 0;
planeinfo[newplane].zrot = 0;
!
lightinfo[lastlight].strength = 6;
lightinfo[lastlight].lightr = 255;
lightinfo[lastlight].lightg = 255;
! lightinfo[lastlight].lightb = 224;
!
! for (int pointcc = 0; pointcc < 12; pointcc++)
! {
! planeinfo[newplane].pointinfo[0][pointcc] = 0;
! }
! planeinfo[newplane].pointinfo[0][9] = lastlight + 1;
if (newplane > endplane) endplane = newplane;
***************
*** 2339,2353 ****
! if (editingmode == modify_poly_texture && freeze < timer)
{
short rettx;
freeze = timer + .004 * fpsr;
! rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3]);
for (c = 0; c < nselpoly; c++)
{
planeinfo[selplane].polyinfo[selpoly[c]][3] = rettx;
! blit(textures[rettx], planeinfo[selplane].radiosity[selpoly[c]], 0, 0, 0, 0, 16, 16);
}
--- 2392,2407 ----
! if ((editingmode == modify_poly_texture_select1 || editingmode == modify_poly_texture_select2) && freeze < timer)
{
short rettx;
freeze = timer + .004 * fpsr;
! if (editingmode == modify_poly_texture_select1) rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3], 0);
! if (editingmode == modify_poly_texture_select2) rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3], 1);
for (c = 0; c < nselpoly; c++)
{
planeinfo[selplane].polyinfo[selpoly[c]][3] = rettx;
! blit(textures[rettx], planeinfo[selplane].radiosity[selpoly[c]], 0, 0, 0, 0, 32, 32);
}
***************
*** 2416,2422 ****
stretch_sprite(offscreen, textures[p], bx, by, int(s), int(s));
! line(offscreen, bx + int((float)vtx[b][0] / 16 * s) + g, by + int((float)vtx[b][1] / 16 * s) + g, bx + int((float)vtx[b][2] / 16 * s) + g, by + int((float)vtx[b][3] / 16 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][4] / 16 * s) + g, by + int((float)vtx[b][5] / 16 * s) + g, bx + int((float)vtx[b][2] / 16 * s) + g, by + int((float)vtx[b][3] / 16 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][0] / 16 * s) + g, by + int((float)vtx[b][1] / 16 * s) + g, bx + int((float)vtx[b][4] / 16 * s) + g, by + int((float)vtx[b][5] / 16 * s) + g, whitec);
d = 0;
--- 2470,2476 ----
stretch_sprite(offscreen, textures[p], bx, by, int(s), int(s));
! line(offscreen, bx + int((float)vtx[b][0] / 32 * s) + g, by + int((float)vtx[b][1] / 32 * s) + g, bx + int((float)vtx[b][2] / 32 * s) + g, by + int((float)vtx[b][3] / 32 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][4] / 32 * s) + g, by + int((float)vtx[b][5] / 32 * s) + g, bx + int((float)vtx[b][2] / 32 * s) + g, by + int((float)vtx[b][3] / 32 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][0] / 32 * s) + g, by + int((float)vtx[b][1] / 32 * s) + g, bx + int((float)vtx[b][4] / 32 * s) + g, by + int((float)vtx[b][5] / 32 * s) + g, whitec);
d = 0;
***************
*** 2691,2698 ****
clear_to_color(texturesb, trans);
! blit(planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], texturesb, 0, 0, 0, 0, 16, 16);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2745,2752 ----
clear_to_color(texturesb, trans);
! blit(planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], texturesb, 0, 0, 0, 0, 32, 32);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 2700,2710 ****
}
}
! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, texturesb, &v1, &v2, &v3);
clear_to_color(texturesb, trans);
! blit(texturesc, texturesb, 0, 0, 0, 0, 16, 16);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2754,2764 ----
}
}
! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, texturesb, &v1, &v2, &v3);
clear_to_color(texturesb, trans);
! blit(texturesc, texturesb, 0, 0, 0, 0, 32, 32);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 2716,2722 ****
clear_to_color(texturesb, trans);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2770,2776 ----
clear_to_color(texturesb, trans);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 2744,2749 ****
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 15 - u[0];
! vv1.y = 15 - v[0];
vv2.x = u[2];
vv2.y = v[2];
--- 2798,2803 ----
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 31 - u[0];
! vv1.y = 31 - v[0];
vv2.x = u[2];
vv2.y = v[2];
***************
*** 2754,2760 ****
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2808,2814 ----
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 2777,2782 ****
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 15 - u[0];
! vv1.y = 15 - v[0];
vv2.x = u[2];
vv2.y = v[2];
--- 2831,2836 ----
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 31 - u[0];
! vv1.y = 31 - v[0];
vv2.x = u[2];
vv2.y = v[2];
***************
*** 2786,2792 ****
vv3.c = (short)pointinfo[p2].psy;
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2840,2846 ----
vv3.c = (short)pointinfo[p2].psy;
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 2809,2814 ****
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 15 - u[0];
! vv1.y = 15 - v[0];
vv2.x = u[2];
vv2.y = v[2];
--- 2863,2868 ----
vv3.y = v[2];
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! vv1.x = 31 - u[0];
! vv1.y = 31 - v[0];
vv2.x = u[2];
vv2.y = v[2];
***************
*** 2818,2824 ****
vv3.c = (short)pointinfo[p2].psz;
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
color = getpixel(textures[t], x, y);
--- 2872,2878 ----
vv3.c = (short)pointinfo[p2].psz;
triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3);
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
color = getpixel(textures[t], x, y);
***************
*** 3005,3012 ****
if (planeinfo[a].polyinfo[b][6] == 0)
{
!
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
planeinfo[a].radiosity_index[b][x][y] = FALSE;
--- 3059,3066 ----
if (planeinfo[a].polyinfo[b][6] == 0)
{
!
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
planeinfo[a].radiosity_index[b][x][y] = FALSE;
***************
*** 3095,3100 ****
poly = polyinfo[pl].poly;
! ny = short(po / 16);
! nx = po - short(po / 16) * 16;
if (!planeinfo[plane].radiosity_index[poly][nx][ny])
--- 3149,3154 ----
poly = polyinfo[pl].poly;
! ny = int(po / 32);
! nx = po - int(po / 32) * 32;
if (!planeinfo[plane].radiosity_index[poly][nx][ny])
***************
*** 3121,3131 ****
sx = nx;
sy = ny;
! sx = nx + float(planeinfo[plane].polyvtx[poly][2] - planeinfo[plane].polyvtx[poly][0]) / 15;
! sy = ny + float(planeinfo[plane].polyvtx[poly][3] - planeinfo[plane].polyvtx[poly][1]) / 15;
if (sx < 0) sx = 0;
! if (sx > 15) sx = 15;
if (sy < 0) sy = 0;
! if (sy > 15) sy = 15;
--- 3175,3185 ----
sx = nx;
sy = ny;
! sx = nx + float(planeinfo[plane].polyvtx[poly][2] - planeinfo[plane].polyvtx[poly][0]) / 31;
! sy = ny + float(planeinfo[plane].polyvtx[poly][3] - planeinfo[plane].polyvtx[poly][1]) / 31;
if (sx < 0) sx = 0;
! if (sx > 31) sx = 31;
if (sy < 0) sy = 0;
! if (sy > 31) sy = 31;
***************
*** 3140,3150 ****
sx = nx;
sy = ny;
! sx = nx + float(planeinfo[plane].polyvtx[poly][4] - planeinfo[plane].polyvtx[poly][0]) / 15;
! sy = ny + float(planeinfo[plane].polyvtx[poly][5] - planeinfo[plane].polyvtx[poly][1]) / 15;
if (sx < 0) sx = 0;
! if (sx > 15) sx = 15;
if (sy < 0) sy = 0;
! if (sy > 15) sy = 15;
--- 3194,3204 ----
sx = nx;
sy = ny;
! sx = nx + float(planeinfo[plane].polyvtx[poly][4] - planeinfo[plane].polyvtx[poly][0]) / 31;
! sy = ny + float(planeinfo[plane].polyvtx[poly][5] - planeinfo[plane].polyvtx[poly][1]) / 31;
if (sx < 0) sx = 0;
! if (sx > 31) sx = 31;
if (sy < 0) sy = 0;
! if (sy > 31) sy = 31;
***************
*** 3276,3282 ****
if (planeinfo[i].polyinfo[j][6] == 0)
{
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
short old_r, old_g, old_b;
--- 3330,3336 ----
if (planeinfo[i].polyinfo[j][6] == 0)
{
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
short old_r, old_g, old_b;
***************
*** 3300,3304 ****
sy = y + yy;
! if (sx > -1 && sx < 16 && sy > -1 && sy < 16)
{
p++;
--- 3354,3358 ----
sy = y + yy;
! if (sx > -1 && sx < 32 && sy > -1 && sy < 32)
{
p++;
***************
*** 3347,3353 ****
if (planeinfo[i].polyinfo[j][6] == 0)
{
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
c0 = getpixel(planeinfo[i].radiosity[j], x, y);
--- 3401,3407 ----
if (planeinfo[i].polyinfo[j][6] == 0)
{
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
c0 = getpixel(planeinfo[i].radiosity[j], x, y);
***************
*** 3437,3440 ****
--- 3491,3495 ----
hud = TRUE;
+ lightcircles = TRUE;
ret = install_mouse();
***************
*** 3458,3462 ****
char textemp[100];
! temppcx = create_system_bitmap(320, 240);
sprintf(textemp, "data/textureset/tx0.pcx");
temppcx = load_pcx(textemp, pal);
--- 3513,3517 ----
char textemp[100];
! temppcx = create_system_bitmap(640, 480);
sprintf(textemp, "data/textureset/tx0.pcx");
temppcx = load_pcx(textemp, pal);
***************
*** 3472,3486 ****
{
i = y * 20 + x;
! blit(temppcx, textures[i], x * 16, y * 16, 0, 0, 16, 16);
}
}
xx = 1;
yy = 1;
i = 0;
! sx = 15 / (float)xx;
! sy = 15 / (float)yy;
for (y = 0; y < yy; y++)
--- 3527,3554 ----
{
i = y * 20 + x;
! blit(temppcx, textures[i], x * 32, y * 32, 0, 0, 32, 32);
}
}
+ sprintf(textemp, "data/textureset/tx1.pcx");
+ temppcx = load_pcx(textemp, pal);
+
+ i = 0;
+ for (y = 0; y < 15; y++)
+ {
+ for (x = 0; x < 20; x++)
+ {
+ i = 300 + y * 20 + x;
+ blit(temppcx, textures[i], x * 32, y * 32, 0, 0, 32, 32);
+ }
+ }
+
xx = 1;
yy = 1;
i = 0;
! sx = 31 / (float)xx;
! sy = 31 / (float)yy;
for (y = 0; y < yy; y++)
***************
*** 3548,3552 ****
for (x = 0; x < max_planes; x++)
{
! for (y = 0; y < max_polies; y++)
{
planeinfo[x].radiosity_setup[y] = 0;
--- 3616,3620 ----
for (x = 0; x < max_planes; x++)
{
! for (y = 0; y < max_polies_per_plane; y++)
{
planeinfo[x].radiosity_setup[y] = 0;
***************
*** 3557,3567 ****
! texturesb = create_system_bitmap(16,16);
! texturesc = create_system_bitmap(16,16);
! for (y = 0; y < 16; y++)
{
! for (x = 0; x < 16; x++)
{
! c = y * 16 + x;
putpixel(texturesc, x, y, c);
}
--- 3625,3635 ----
! texturesb = create_system_bitmap(32,32);
! texturesc = create_system_bitmap(32,32);
! for (y = 0; y < 32; y++)
{
! for (x = 0; x < 32; x++)
{
! c = y * 32 + x;
putpixel(texturesc, x, y, c);
}
***************
*** 3816,3820 ****
{
planeinfo[c].radiosity_setup[a] = 1;
! planeinfo[c].radiosity[a] = create_system_bitmap(16,16);
}
--- 3884,3888 ----
{
planeinfo[c].radiosity_setup[a] = 1;
! planeinfo[c].radiosity[a] = create_system_bitmap(32,32);
}
***************
*** 3823,3834 ****
{
planeinfo[c].radiosity_setup[a] = 2;
! for (x = 0; x < 16; x++)
{
! for (y = 0; y < 16; y++)
{
putpixel(planeinfo[c].radiosity[a], x, y, 0);
}
}
! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 16, 16);
}
--- 3891,3902 ----
{
planeinfo[c].radiosity_setup[a] = 2;
! for (x = 0; x < 32; x++)
{
! for (y = 0; y < 32; y++)
{
putpixel(planeinfo[c].radiosity[a], x, y, 0);
}
}
! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 32, 32);
}
Index: mapeditglobals.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** mapeditglobals.h 8 Nov 2004 16:28:27 -0000 1.9
--- mapeditglobals.h 24 Dec 2004 23:13:05 -0000 1.10
***************
*** 18,29 ****
#define sys 001
! #define system_save 010
! #define system_save_detailed 011
! #define system_save_simple 012
! #define system_load 020
! #define system_import 030
! #define system_import_simple 031
! #define system_import_ase 032
! #define system_preferences 040
#define addplane 100
--- 18,28 ----
#define sys 001
! #define system_new 010
! #define system_save 020
! #define system_load 030
! #define system_import 040
! #define system_import_simple 041
! #define system_import_ase 042
! #define system_preferences 050
#define addplane 100
***************
*** 56,59 ****
--- 55,60 ----
#define modify_poly_reset_vertii 821
#define modify_poly_texture 822
+ #define modify_poly_texture_select1 8221
+ #define modify_poly_texture_select2 8222
#define modify_poly_uvmap 823
#define modify_poly_hidden 824
***************
*** 88,96 ****
#define max_points 2000
#define max_lights 200
extern float playerx, playery, playerz, pratio;
extern short pscx, pscy;
! extern short selplane, selpoly[max_polies], tselplane, tselpoint, tselpoly, sellight;
extern float selpoint[max_points][4], selpointc[max_points][4];
extern unsigned short nselpoint, nselpoly, nlights, nselpointc;
--- 89,99 ----
#define max_points 2000
#define max_lights 200
+ #define max_polies_per_plane 400
+ #define max_points_per_plane 400
extern float playerx, playery, playerz, pratio;
extern short pscx, pscy;
! extern short selplane, selpoly[max_polies_per_plane], tselplane, tselpoint, tselpoly, sellight;
extern float selpoint[max_points][4], selpointc[max_points][4];
extern unsigned short nselpoint, nselpoly, nlights, nselpointc;
***************
*** 122,126 ****
extern char curfile[20];
! extern bool hud;
#endif
--- 125,129 ----
extern char curfile[20];
! extern bool hud, lightcircles;
#endif
Index: mapeditgui.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mapeditgui.h 20 Jan 2004 18:19:27 -0000 1.5
--- mapeditgui.h 24 Dec 2004 23:13:05 -0000 1.6
***************
*** 25,29 ****
void gui_modify_point_by_input();
! int gui_select_texture(int basetx);
void gui_system_load();
--- 25,29 ----
void gui_modify_point_by_input();
! int gui_select_texture(int basetx, int txset);
void gui_system_load();
Index: mapeditglobals.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** mapeditglobals.cpp 8 Nov 2004 14:17:35 -0000 1.8
--- mapeditglobals.cpp 24 Dec 2004 23:13:05 -0000 1.9
***************
*** 17,21 ****
short pscx, pscy;
! short selplane, selpoly[max_polies], tselplane, tselpoint, tselpoly, sellight;
float selpoint[max_points][4], selpointc[max_points][4];
unsigned short nselpoint, nselpoly, nlights, nselpointc;
--- 17,21 ----
short pscx, pscy;
! short selplane, selpoly[max_polies_per_plane], tselplane, tselpoint, tselpoly, sellight;
float selpoint[max_points][4], selpointc[max_points][4];
unsigned short nselpoint, nselpoly, nlights, nselpointc;
***************
*** 45,49 ****
bool bk_bfc;
! bool hud;
char curfile[20];
--- 45,49 ----
bool bk_bfc;
! bool hud, lightcircles;
char curfile[20];
|