Mercurial > hg > forks > yadex
changeset 107:20aa5a515896
Reformat one line /* */ comments to //
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 06 Oct 2014 12:42:55 +0300 |
parents | 093497110727 |
children | c91965fc33b6 |
files | src/checks.cc src/colour1.cc src/dependcy.cc src/drawmap.cc src/editlev.cc src/editloop.cc src/editobj.cc src/editsave.cc src/entry.cc src/entry2.cc src/game.cc src/gcolour1.cc src/gfx.cc src/gotoobj.cc src/help2.cc src/infobar.cc src/input.cc src/l_align.cc src/l_misc.cc src/l_prop.cc src/levels.cc src/lists.cc src/memory.cc src/menubar.cc src/names.cc src/objects.cc src/palview.cc src/pic2img.cc src/r_images.cc src/r_render.cc src/s_door.cc src/s_lift.cc src/s_merge.cc src/s_misc.cc src/s_split.cc src/selbox.cc src/selrect.cc src/t_prop.cc src/textures.cc src/things.cc src/v_merge.cc src/wads2.cc src/x11.cc src/x_hover.cc src/x_mirror.cc src/x_rotate.cc src/yadex.cc src/ytime.cc |
diffstat | 48 files changed, 502 insertions(+), 502 deletions(-) [+] |
line wrap: on
line diff
--- a/src/checks.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/checks.cc Mon Oct 06 12:42:55 2014 +0300 @@ -56,7 +56,7 @@ * check the level consistency * FIXME should be integrated into editloop.cc */ -void CheckLevel(int x0, int y0) /* SWAP! */ +void CheckLevel(int x0, int y0) // SWAP! { const char *line5 = 0; @@ -241,7 +241,7 @@ check if all sectors are closed */ -void CheckSectors() /* SWAP! */ +void CheckSectors() // SWAP! { int s, n, sd; char *ends; @@ -253,11 +253,11 @@ ends = (char *) GetMemory(NumVertices); for (s = 0; s < NumSectors; s++) { - /* clear the "ends" array */ + // clear the "ends" array for (n = 0; n < NumVertices; n++) ends[n] = 0; - /* for each sidedef bound to the Sector, store a "1" in the "ends" */ - /* array for its starting Vertex, and a "2" for its ending Vertex */ + // for each sidedef bound to the Sector, store a "1" in the "ends" + // array for its starting Vertex, and a "2" for its ending Vertex for (n = 0; n < NumLineDefs; n++) { sd = LineDefs[n].sidedef1; @@ -273,7 +273,7 @@ ends[LineDefs[n].start] |= 2; } } - /* every entry in the "ends" array should be "0" or "3" */ + // every entry in the "ends" array should be "0" or "3" for (n = 0; n < NumVertices; n++) { if (ends[n] == 1) @@ -317,7 +317,7 @@ these ideas, don't forget to credit DEU... Just a reminder... :-) */ - /* now check if all SideDefs are facing a sidedef with the same Sector number */ + // now check if all SideDefs are facing a sidedef with the same Sector number for (n = 0; n < NumLineDefs; n++) { sd = LineDefs[n].sidedef1; @@ -381,7 +381,7 @@ /* check cross-references and delete unused objects */ -void CheckCrossReferences() /* SWAP! */ +void CheckCrossReferences() // SWAP! { char msg[80]; int n, m; @@ -392,7 +392,7 @@ LogMessage("\nVerifying cross-references...\n"); for (n = 0; n < NumLineDefs; n++) { - /* Check for missing first sidedefs */ + // Check for missing first sidedefs if (LineDefs[n].sidedef1 < 0) { sprintf(msg, "ERROR: linedef #%d has no first sidedef!", n); @@ -402,8 +402,8 @@ } // FIXME should make this a mere warning -#ifdef OLD /* ifdef'd out AYM 19970725, I do it and it works */ - /* Check for sidedefs used twice in the same linedef */ +#ifdef OLD // ifdef'd out AYM 19970725, I do it and it works + // Check for sidedefs used twice in the same linedef if (LineDefs[n].sidedef1 == LineDefs[n].sidedef2) { sprintf(msg, @@ -415,7 +415,7 @@ } #endif - /* Check for vertices used twice in the same linedef */ + // Check for vertices used twice in the same linedef if (LineDefs[n].start == LineDefs[n].end) { sprintf(msg, @@ -427,9 +427,9 @@ } } -/* check if there aren't two linedefs between the same Vertices */ +// check if there aren't two linedefs between the same Vertices cur = 0; -/* AYM 19980203 FIXME should use new algorithm */ +// AYM 19980203 FIXME should use new algorithm for (n = NumLineDefs - 1; n >= 1; n--) { for (m = n - 1; m >= 0; m--) @@ -452,7 +452,7 @@ ForgetSelection(&cur); CheckingObjects(); -/* check for invalid flags in the linedefs */ +// check for invalid flags in the linedefs for (n = 0; n < NumLineDefs; n++) if ((LineDefs[n].flags & 0x01) == 0 && LineDefs[n].sidedef2 < 0) SelectObject(&cur, n); @@ -512,10 +512,10 @@ ForgetSelection(&cur); CheckingObjects(); -/* select all Vertices */ +// select all Vertices for (n = 0; n < NumVertices; n++) SelectObject(&cur, n); -/* unselect Vertices used in a LineDef */ +// unselect Vertices used in a LineDef for (n = 0; n < NumLineDefs; n++) { m = LineDefs[n].start; @@ -526,7 +526,7 @@ UnSelectObject(&cur, m); continue; } -/* check if there are any Vertices left */ +// check if there are any Vertices left if (cur && (cfg.expert || Confirm(-1, -1, "Some vertices are not bound to any linedef", @@ -538,10 +538,10 @@ ForgetSelection(&cur); CheckingObjects(); -/* select all SideDefs */ +// select all SideDefs for (n = 0; n < NumSideDefs; n++) SelectObject(&cur, n); -/* unselect SideDefs bound to a LineDef */ +// unselect SideDefs bound to a LineDef for (n = 0; n < NumLineDefs; n++) { m = LineDefs[n].sidedef1; @@ -552,7 +552,7 @@ UnSelectObject(&cur, m); continue; } -/* check if there are any SideDefs left */ +// check if there are any SideDefs left if (cur && (cfg.expert || Confirm(-1, -1, "Some sidedefs are not bound to any linedef", @@ -562,10 +562,10 @@ ForgetSelection(&cur); CheckingObjects(); -/* select all Sectors */ +// select all Sectors for (n = 0; n < NumSectors; n++) SelectObject(&cur, n); -/* unselect Sectors bound to a sidedef */ +// unselect Sectors bound to a sidedef for (n = 0; n < NumLineDefs; n++) { m = LineDefs[n].sidedef1; @@ -576,7 +576,7 @@ UnSelectObject(&cur, SideDefs[m].sector); continue; } -/* check if there are any Sectors left */ +// check if there are any Sectors left if (cur && (cfg.expert || Confirm(-1, -1, "Some sectors are not bound to any sidedef", @@ -591,7 +591,7 @@ check for missing textures */ -void CheckTextures() /* SWAP! */ +void CheckTextures() // SWAP! { int n; int sd1, sd2; @@ -627,7 +627,7 @@ GoToObject(Objid(OBJ_SECTORS, n)); return; } -#if 0 /* AYM 2000-08-13 */ +#if 0 // AYM 2000-08-13 if (Sectors[n].ceilh - Sectors[n].floorh > 1023) { sprintf(msg1, "Error: sector #%d has its ceiling too high", n); @@ -781,7 +781,7 @@ check for invalid texture names */ -void CheckTextureNames() /* SWAP! */ +void CheckTextureNames() // SWAP! { int n; char msg1[80], msg2[80]; @@ -867,7 +867,7 @@ check for players starting points */ -bool CheckStartingPos() /* SWAP! */ +bool CheckStartingPos() // SWAP! { char msg1[80], msg2[80]; bool p1 = false;
--- a/src/colour1.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/colour1.cc Mon Oct 06 12:42:55 2014 +0300 @@ -32,7 +32,7 @@ #include "rgb.h" -#define RGB_DIGITS 2 /* R, G and B are 8-bit wide each */ +#define RGB_DIGITS 2 // R, G and B are 8-bit wide each /*
--- a/src/dependcy.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/dependcy.cc Mon Oct 06 12:42:55 2014 +0300 @@ -28,7 +28,7 @@ */ -#include "yadex.h" /* Just to force a recompile when you ./configure again */ +#include "yadex.h" // Just to force a recompile when you ./configure again #include "dependcy.h" #include "serialnum.h"
--- a/src/drawmap.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/drawmap.cc Mon Oct 06 12:42:55 2014 +0300 @@ -36,9 +36,9 @@ #include <X11/Xlib.h> #endif #include "_edit.h" -#include "disppic.h" /* Sprites */ +#include "disppic.h" // Sprites #include "drawmap.h" -#include "game.h" /* Sprites */ +#include "game.h" // Sprites #include "gfx.h" #include "imgscale.h" #include "imgspect.h" @@ -109,7 +109,7 @@ draw the actual game map */ -void draw_map(edit_t * e) /* SWAP! */ +void draw_map(edit_t * e) // SWAP! { int mapx0 = MAPX(0); int mapx9 = MAPX(cfg.ScrMaxX); @@ -368,13 +368,13 @@ static void draw_linedefs(edit_t * e) { - int new_colour, current_colour = INT_MIN; /* Some impossible colour no. */ + int new_colour, current_colour = INT_MIN; // Some impossible colour no. switch (e->obj_type) { case OBJ_THINGS: { - int new_colour, current_colour = INT_MIN; /* Some impossible colour no. */ + int new_colour, current_colour = INT_MIN; // Some impossible colour no. for (int n = 0; n < NumLineDefs; n++) { @@ -415,7 +415,7 @@ if (ld_check(v1, v2)) continue; - if (LineDefs[n].type != 0) /* AYM 19980207: was "> 0" */ + if (LineDefs[n].type != 0) // AYM 19980207: was "> 0" new_colour = (LineDefs[n].tag != 0) ? LIGHTMAGENTA : LIGHTGREEN; else new_colour = (LineDefs[n].flags & 1) ? WHITE : LIGHTGREY; @@ -455,7 +455,7 @@ break; case OBJ_SECTORS: - int current_colour = INT_MIN; /* Some impossible colour no. */ + int current_colour = INT_MIN; // Some impossible colour no. int new_colour; for (int n = 0; n < NumLineDefs; n++)
--- a/src/editlev.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/editlev.cc Mon Oct 06 12:42:55 2014 +0300 @@ -83,7 +83,7 @@ #if 0 if (levelname == 0 || !levelname2levelno(levelname) || !FindMasterDir(cfg.MasterDir, levelname)) - levelname = SelectLevel(atoi(levelname)); /* returns "" on Esc */ + levelname = SelectLevel(atoi(levelname)); // returns "" on Esc if (levelname2levelno(levelname)) { #endif @@ -148,7 +148,7 @@ " if you want to be able to save your changes.\n"); ForgetLevelData(); -/* forget the level pointer */ +// forget the level pointer Level = 0; ForgetWTextureNames(); ForgetFTextureNames(); @@ -170,7 +170,7 @@ al_fana(file, drive, path, base, 0); sprintf(logname, "%s%s%s.yl", drive, path, base); -/* if log file does not already exist, do _not_ create it */ +// if log file does not already exist, do _not_ create it if (al_fnature(logname) == 1) { FILE *logfd;
--- a/src/editloop.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/editloop.cc Mon Oct 06 12:42:55 2014 +0300 @@ -73,10 +73,10 @@ static int zoom_fit(edit_t &); -static int menubar_out_y1; /* FIXME */ +static int menubar_out_y1; // FIXME -/* prototypes of private functions */ +// prototypes of private functions static int SortLevels(const void *item1, const void *item2); /* @@ -98,9 +98,9 @@ const char *SelectLevel(int levelno) { MDirPtr dir; - static char name[WAD_NAME + 1]; /* AYM it was [7] previously */ + static char name[WAD_NAME + 1]; // AYM it was [7] previously char **levels = 0; - int n = 0; /* number of levels in the dir. that match */ + int n = 0; // number of levels in the dir. that match get_levels_that_match: for (dir = cfg.MasterDir; dir; dir = dir->next) @@ -118,9 +118,9 @@ n++; } } - if (n == 0 && levelno != 0) /* In case no level matched levelno */ + if (n == 0 && levelno != 0) // In case no level matched levelno { - levelno = 0; /* List ALL levels instead */ + levelno = 0; // List ALL levels instead goto get_levels_that_match; } /* So that InputNameFromList doesn't fail if you @@ -141,7 +141,7 @@ static int SortLevels(const void *item1, const void *item2) { -/* FIXME should probably use y_stricmp() instead */ +// FIXME should probably use y_stricmp() instead return strcmp(*((const char *const *) item1), *((const char *const *) item2)); } @@ -207,10 +207,10 @@ the editor main loop */ -void EditorLoop(const char *levelname) /* SWAP! */ +void EditorLoop(const char *levelname) // SWAP! { edit_t e; -/* FIXME : all these variables should be moved to edit_t : */ +// FIXME : all these variables should be moved to edit_t : int RedrawMap; bool DragObject = false, DragMapMove = false; int DragMapMoveX = 0, DragMapMoveY = 0; @@ -220,7 +220,7 @@ Objid object; // The object under the pointer const Objid CANVAS(OBJ_NONE, OBJ_NO_CANVAS); - memset(&e, 0, sizeof e); /* Catch-all */ + memset(&e, 0, sizeof e); // Catch-all e.move_speed = 20; e.extra_zoom = 0; // If you change this, don't forget to change @@ -277,7 +277,7 @@ (MapMinY + MapMaxY) / 2); } -/* Create the menu bar */ +// Create the menu bar { e.menubar->compute_menubar_coords(0, 0, cfg.ScrMaxX, cfg.ScrMaxY); @@ -520,7 +520,7 @@ e.spot->unset(); e.edisplay->refresh(); - /* The display is now up to date */ + // The display is now up to date #ifdef Y_BATCH } #endif @@ -609,7 +609,7 @@ } else if (menu_no == e.mb_ino[MBI_OBJECTS]) { - /* code duplicated from 'F9' - I hate to do that */ + // code duplicated from 'F9' - I hate to do that int savednum = NumLineDefs; InsertStandardObject(e.pointer_x, e.pointer_y, r + 1); if (NumLineDefs > savednum) @@ -950,7 +950,7 @@ e.click_time = is.time; ForgetSelection(&e.Selected); SelectObject(&e.Selected, object.num); - /* I don't like having to do that */ + // I don't like having to do that if (object.type == OBJ_THINGS && object()) MoveObjectsToCoords(object.type, 0, Things[object.num].xpos, @@ -966,7 +966,7 @@ RedrawMap = 1; } - /* Second click of a double click on an object */ + // Second click of a double click on an object else if (is.key == YE_BUTL_PRESS && !is.ctrl && e.tool == TOOL_NORMAL && IsSelected(e.Selected, object.num) @@ -991,7 +991,7 @@ e.clicked = object; e.click_ctrl = 0; e.click_time = is.time; - /* I don't like having to do that */ + // I don't like having to do that if (object.type == OBJ_THINGS && object()) MoveObjectsToCoords(object.type, 0, Things[object.num].xpos, @@ -1022,7 +1022,7 @@ RedrawMap = 1; } - /* TOOL_SNAP_VERTEX */ + // TOOL_SNAP_VERTEX else if (is.key == YE_BUTL_PRESS && e.tool == TOOL_SNAP_VERTEX && e.obj_type == OBJ_VERTICES && object() @@ -1037,7 +1037,7 @@ RedrawMap = 1; } - /* Clicking anywhere else closes the pull-down menus. */ + // Clicking anywhere else closes the pull-down menus. else if (is.key == YE_BUTL_PRESS) e.menubar->highlight(-1); // Close any open menu @@ -1054,7 +1054,7 @@ RedrawMap = 1; } - /* Releasing the button while dragging : drop the selection. */ + // Releasing the button while dragging : drop the selection. // FIXME : should call this automatically when switching tool else if (is.key == YE_BUTL_RELEASE && e.tool == TOOL_NORMAL && e.clicked()) @@ -1108,10 +1108,10 @@ RedrawMap = 1; } - /* AYM : added is.in_window */ + // AYM : added is.in_window if (is.in_window && !is.butl && !is.shift) { - /* Check if there is something near the pointer */ + // Check if there is something near the pointer e.highlighted = object; } @@ -1190,7 +1190,7 @@ } // [F1]: pop up "Help" window - else if (is.key == YK_F1) /* 'F1' */ + else if (is.key == YK_F1) // 'F1' { DisplayHelp(); RedrawMap = 1; @@ -1273,7 +1273,7 @@ goto cancel_save_as; if (!levelname || y_stricmp(newlevelname, levelname)) { - /* horrible but it works... */ + // horrible but it works... // Horrible indeed -- AYM 1999-07-30 newLevel = FindMasterDir(cfg.MasterDir, newlevelname); if (!newLevel) @@ -1533,7 +1533,7 @@ new_mode = obj_type_to_mode_no(OBJ_SECTORS); else fatal_error("changing mode with %04X", is.key); - /* unselect all */ + // unselect all ForgetSelection(&e.Selected); } @@ -1544,10 +1544,10 @@ e.menubar->set_menu(e.mb_ino[MBI_MISC], e.mb_menu[modes[new_mode].menu_no]); - /* special cases for the selection list... */ + // special cases for the selection list... if (e.Selected) { - /* select all linedefs bound to the selected sectors */ + // select all linedefs bound to the selected sectors if (PrevMode == OBJ_SECTORS && e.obj_type == OBJ_LINEDEFS) { int l, sd; @@ -1572,7 +1572,7 @@ ForgetSelection(&e.Selected); e.Selected = NewSel; } - /* select all Vertices bound to the selected linedefs */ + // select all Vertices bound to the selected linedefs else if (PrevMode == OBJ_LINEDEFS && e.obj_type == OBJ_VERTICES) { @@ -1593,17 +1593,17 @@ } e.Selected = NewSel; } - /* select all sectors that have their linedefs selected */ + // select all sectors that have their linedefs selected else if (PrevMode == OBJ_LINEDEFS && e.obj_type == OBJ_SECTORS) { int l, sd; NewSel = 0; - /* select all sectors... */ + // select all sectors... for (l = 0; l < NumSectors; l++) SelectObject(&NewSel, l); - /* ... then unselect those that should not be in the list */ + // ... then unselect those that should not be in the list for (l = 0; l < NumLineDefs; l++) if (!IsSelected(e.Selected, l)) { @@ -1619,7 +1619,7 @@ ForgetSelection(&e.Selected); e.Selected = NewSel; } - /* select all linedefs that have both ends selected */ + // select all linedefs that have both ends selected else if (PrevMode == OBJ_VERTICES && e.obj_type == OBJ_LINEDEFS) { @@ -1633,7 +1633,7 @@ ForgetSelection(&e.Selected); e.Selected = NewSel; } - /* unselect all */ + // unselect all else ForgetSelection(&e.Selected); } @@ -1909,13 +1909,13 @@ { int x, y; - /* copy the object(s) */ + // copy the object(s) if (!e.Selected) SelectObject(&e.Selected, e.highlighted.num); CopyObjects(e.obj_type, e.Selected); - /* enter drag mode */ + // enter drag mode //DragObject = true; - /* AYM 19980619 : got to look into this!! */ + // AYM 19980619 : got to look into this!! //e.highlight_obj_no = e.Selected->objnum; // Find the "hotspot" in the object(s) @@ -1965,7 +1965,7 @@ { spin_things(e.Selected, 45); } - RedrawMap = 1; /* FIXME: should redraw only the things */ + RedrawMap = 1; // FIXME: should redraw only the things DragObject = false; StretchSelBox = false; } @@ -2009,7 +2009,7 @@ { spin_things(e.Selected, -45); } - RedrawMap = 1; /* FIXME: should redraw only the things */ + RedrawMap = 1; // FIXME: should redraw only the things DragObject = false; StretchSelBox = false; } @@ -2061,7 +2061,7 @@ } // [Del]: delete the current object - else if (is.key == YK_DEL && (e.Selected || e.highlighted())) /* 'Del' */ + else if (is.key == YK_DEL && (e.Selected || e.highlighted())) // 'Del' { if (e.obj_type == OBJ_THINGS || cfg.expert @@ -2092,7 +2092,7 @@ } // [Ins]: insert a new object - else if (is.key == YK_INS || is.key == YK_INS + YK_SHIFT) /* 'Ins' */ + else if (is.key == YK_INS || is.key == YK_INS + YK_SHIFT) // 'Ins' { SelPtr cur; int prev_obj_type = e.obj_type; @@ -2110,10 +2110,10 @@ else firstv = -1; e.obj_type = OBJ_LINEDEFS; - /* create linedefs between the vertices */ + // create linedefs between the vertices for (cur = e.Selected; cur->next; cur = cur->next) { - /* check if there is already a linedef between the two vertices */ + // check if there is already a linedef between the two vertices for (obj_no = 0; obj_no < NumLineDefs; obj_no++) if ((LineDefs[obj_no].start == cur->next->objnum && LineDefs[obj_no].end == cur->objnum) @@ -2133,7 +2133,7 @@ cur->objnum = e.highlighted.num; // FIXME cur = e.highlighted } } - /* close the polygon if there are more than 2 vertices */ + // close the polygon if there are more than 2 vertices if (firstv >= 0 && is.shift) { e.highlighted.type = OBJ_LINEDEFS; @@ -2227,7 +2227,7 @@ SelectObject(&e.Selected, e.highlighted.num); } } - /* normal case: add a new object of the current type */ + // normal case: add a new object of the current type else { ForgetSelection(&e.Selected); @@ -2420,7 +2420,7 @@ RedrawMap = 1; } - /* user likes music */ + // user likes music else if (is.key) { Beep();
--- a/src/editobj.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/editobj.cc Mon Oct 06 12:42:55 2014 +0300 @@ -288,7 +288,7 @@ edit an object or a group of objects */ -void EditObjectsInfo(int x0, int y0, int objtype, SelPtr obj) /* SWAP! */ +void EditObjectsInfo(int x0, int y0, int objtype, SelPtr obj) // SWAP! { char *menustr[3]; int n, val; @@ -494,18 +494,18 @@ insert a standard object at given position */ -void InsertStandardObject(int xpos, int ypos, int choice) /* SWAP! */ +void InsertStandardObject(int xpos, int ypos, int choice) // SWAP! { int sector; int n; int a, b; -/* are we inside a Sector? */ +// are we inside a Sector? Objid o; GetCurObject(o, OBJ_SECTORS, xpos, ypos); sector = o.num; -/* !!!! Should also check for overlapping objects (sectors) !!!! */ +// !!!! Should also check for overlapping objects (sectors) !!!! switch (choice) { case 1: @@ -672,49 +672,49 @@ " Sidedef 2, As above, but with initial offset.", YK_, 0, NULL)) { - case 1: /* Sidedef 1 with checking for same textures */ + case 1: // Sidedef 1 with checking for same textures opt_sdef = 1; opt_check = true; opt_offset = false; break; - case 2: /* Sidedef 1 as above, but with inital offset */ + case 2: // Sidedef 1 as above, but with inital offset opt_sdef = 1; opt_check = true; opt_offset = true; break; - case 3: /* Sidedef 1 regardless of same textures */ + case 3: // Sidedef 1 regardless of same textures opt_sdef = 1; opt_check = false; opt_offset = false; break; - case 4: /* Sidedef 1 as above, but with inital offset */ + case 4: // Sidedef 1 as above, but with inital offset opt_sdef = 1; opt_check = false; opt_offset = true; break; - case 5: /* Sidedef 2 with checking for same textures */ + case 5: // Sidedef 2 with checking for same textures opt_sdef = 2; opt_check = true; opt_offset = false; break; - case 6: /* Sidedef 2 as above, but with initial offset */ + case 6: // Sidedef 2 as above, but with initial offset opt_sdef = 2; opt_check = true; opt_offset = true; break; - case 7: /* Sidedef 2 regardless of same textures */ + case 7: // Sidedef 2 regardless of same textures opt_sdef = 2; opt_check = false; opt_offset = false; break; - case 8: /* Sidedef 2 as above, but with initial offset */ + case 8: // Sidedef 2 as above, but with initial offset opt_sdef = 2; opt_check = false; opt_offset = true; @@ -724,7 +724,7 @@ return; } - /* Select all sidedefs */ + // Select all sidedefs SelPtr sdlist = NULL, cur; for (cur = *list; cur; cur = cur->next) { @@ -736,10 +736,10 @@ } if (mode == 0) - /* Align the textures along the X axis (width) */ + // Align the textures along the X axis (width) AlignTexturesX(&sdlist, opt_sdef, opt_check, opt_offset, -1); else - /* Align the textures along the Y axis (height) */ + // Align the textures along the Y axis (height) AlignTexturesY(&sdlist, opt_sdef, opt_check); } @@ -747,7 +747,7 @@ /* * Menu of miscellaneous operations */ -void MiscOperations(int objtype, SelPtr * list, int val) /* SWAP! */ +void MiscOperations(int objtype, SelPtr * list, int val) // SWAP! { char msg[80]; int angle, scale; @@ -990,9 +990,9 @@ for (cur = *list; cur; cur = cur->next) { struct LineDef *l = LineDefs + cur->objnum; - l->sidedef2 = -1; /* remove ref. to 2nd SD */ - l->flags &= ~0x04; /* clear "2S" bit */ - l->flags |= 0x01; /* set "Im" bit */ + l->sidedef2 = -1; // remove ref. to 2nd SD + l->flags &= ~0x04; // clear "2S" bit + l->flags |= 0x01; // set "Im" bit if (is_sidedef(l->sidedef1)) {
--- a/src/editsave.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/editsave.cc Mon Oct 06 12:42:55 2014 +0300 @@ -162,7 +162,7 @@ al_scps(Level_file_name_saved, f, sizeof Level_file_name_saved - 1); return true; // Did save } -#else /* OLD_SAVE_METHOD */ +#else // OLD_SAVE_METHOD /* @@ -174,7 +174,7 @@ #define BUFSZ 79 char *outfile = (char *) GetMemory(BUFSZ + 1); - /* get the file name */ + // get the file name // If no name, find a default one if (!levelname) { @@ -200,13 +200,13 @@ do InputFileName(-1, -1, "Name of the new wad file:", BUFSZ, outfile); while (!fncmp(outfile, cfg.MainWad)); - /* escape */ + // escape if (outfile[0] == '\0') { FreeMemory(outfile); return 0; } - /* if the wad file already exists, rename it to "*.bak" */ + // if the wad file already exists, rename it to "*.bak" Wad_file *wf; for (wad_list.rewind(); wad_list.get(wf);) if (fncmp(outfile, wf->filename) == 0) @@ -221,7 +221,7 @@ al_fana(wf->filename, drv, path, base, 0); sprintf(wf->filename, "%s%s%s.bak", drv, path, base); verbmsg("setting wf->filename to %s\n", wf->filename); // DEBUG - /* Need to close, then reopen: problems with SHARE.EXE */ + // Need to close, then reopen: problems with SHARE.EXE verbmsg("closing %p\n", wf->fp); // DEBUG fclose(wf->fp); verbmsg("renaming %s -> %s\n", outfile, wf->filename); // DEBUG
--- a/src/entry.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/entry.cc Mon Oct 06 12:42:55 2014 +0300 @@ -181,7 +181,7 @@ for (l = strlen(filename) + 1; l <= maxlen; l++) filename[l] = '\0'; - /* compute the width of the input box */ + // compute the width of the input box if (maxlen > 20) boxlen = 20; else @@ -199,7 +199,7 @@ - 2 * WIDE_VSPACING - (int) (2.5 * FONTH) - 2 * HOLLOW_BORDER - 2 * NARROW_VSPACING) / 2; - /* draw the dialog box */ + // draw the dialog box entry_out_x0 = x0 + BOX_BORDER + WIDE_HSPACING; entry_text_x0 = entry_out_x0 + HOLLOW_BORDER + NARROW_HSPACING; entry_text_x1 = entry_text_x0 + boxlen * FONTW - 1; @@ -246,10 +246,10 @@ else if (l > 0 && key == YK_BACKSPACE) filename[l - 1] = '\0'; else if (key == YK_RETURN) - break; /* return "filename" */ + break; // return "filename" else if (key == YK_ESC) { - filename[0] = '\0'; /* return an empty string */ + filename[0] = '\0'; // return an empty string break; } else
--- a/src/entry2.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/entry2.cc Mon Oct 06 12:42:55 2014 +0300 @@ -700,4 +700,4 @@ } -/* TEST STUFF FOLLOWS */ +// TEST STUFF FOLLOWS
--- a/src/game.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/game.cc Mon Oct 06 12:42:55 2014 +0300 @@ -61,18 +61,18 @@ */ void LoadGameDefs(const char *game) { - FILE *ygdfile = 0; /* YGD file descriptor */ -#define YGD_BUF 200 /* max. line length + 2 */ - char readbuf[YGD_BUF]; /* buffer the line is read into */ -#define MAX_TOKENS 10 /* tokens per line */ - int lineno; /* current line of file */ + FILE *ygdfile = 0; // YGD file descriptor +#define YGD_BUF 200 // max. line length + 2 + char readbuf[YGD_BUF]; // buffer the line is read into +#define MAX_TOKENS 10 // tokens per line + int lineno; // current line of file char filename[1025]; char basename[256]; al_scps(basename, game, sizeof basename - 1); al_saps(basename, ".ygd", sizeof basename - 1); -/* Locate the game definition file. */ +// Locate the game definition file. { Locate locate(yadex_share_path, basename, false); const char *pathname = locate.get_next(); @@ -113,7 +113,7 @@ const char *const bad_arg_count = "%s(%d): directive \"%s\" takes %d parameters"; - /* duplicate the buffer */ + // duplicate the buffer buf = (char *) malloc(strlen(readbuf) + 1); if (!buf) fatal_error("not enough memory"); @@ -164,7 +164,7 @@ if (quoted) fatal_error("%s(%d): unmatched double quote", filename, lineno); - /* process line */ + // process line if (ntoks == 0) { free(buf); @@ -178,8 +178,8 @@ fatal_error(bad_arg_count, filename, lineno, token[0], 4); buf.number = atoi(token[1]); buf.ldtgroup = *token[2]; - buf.shortdesc = token[3]; /* FIXME: trunc to 16 char. */ - buf.longdesc = token[4]; /* FIXME: trunc reasonably */ + buf.shortdesc = token[3]; // FIXME: trunc to 16 char. + buf.longdesc = token[4]; // FIXME: trunc reasonably if (al_lwrite(ldtdef, &buf)) fatal_error("LGD1 (%s)", al_astrerror(al_aerrno)); } @@ -255,8 +255,8 @@ if (ntoks != 4) fatal_error(bad_arg_count, filename, lineno, token[0], 3); buf.number = atoi(token[1]); - buf.shortdesc = token[2]; /* FIXME: trunc to 14 char. */ - buf.longdesc = token[3]; /* FIXME: trunc reasonably */ + buf.shortdesc = token[2]; // FIXME: trunc to 14 char. + buf.longdesc = token[3]; // FIXME: trunc reasonably if (al_lwrite(stdef, &buf)) fatal_error("LGD3 (%s)", al_astrerror(al_aerrno)); } @@ -334,7 +334,7 @@ fclose(ygdfile); -/* Verify that all the mandatory directives are present. */ +// Verify that all the mandatory directives are present. { bool abort = false; if (yg_level_format == YGLF__) @@ -367,7 +367,7 @@ { ldtgroup_t buf; - buf.ldtgroup = LDT_FREE; /* that is '\0' */ + buf.ldtgroup = LDT_FREE; // that is '\0' buf.desc = "Other (enter number)"; al_lseek(ldtgroup, 0, SEEK_END); if (al_lwrite(ldtgroup, &buf)) @@ -379,7 +379,7 @@ { thinggroup_t buf; - buf.thinggroup = THING_FREE; /* that is '\0' */ + buf.thinggroup = THING_FREE; // that is '\0' buf.desc = "Other (enter number)"; al_lseek(thinggroup, 0, SEEK_END); if (al_lwrite(thinggroup, &buf)) @@ -391,8 +391,8 @@ { stdef_t buf; - buf.number = 0; /* not significant */ - buf.shortdesc = 0; /* not significant */ + buf.number = 0; // not significant + buf.shortdesc = 0; // not significant buf.longdesc = "Other (enter number)"; al_lseek(stdef, 0, SEEK_END); if (al_lwrite(stdef, &buf))
--- a/src/gcolour1.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/gcolour1.cc Mon Oct 06 12:42:55 2014 +0300 @@ -41,7 +41,7 @@ #include "gcolour1.h" #include "gcolour2.h" #include "gfx.h" -#include "img.h" /* IMG_TRANSP */ +#include "img.h" // IMG_TRANSP #include "rgb.h" #include "wadfile.h" #include "wads.h"
--- a/src/gfx.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/gfx.cc Mon Oct 06 12:42:55 2014 +0300 @@ -39,7 +39,7 @@ #include "gcolour2.h" #include "gcolour3.h" #include "gfx.h" -#include "levels.h" /* Level */ +#include "levels.h" // Level #include "x11.h" #ifdef Y_DOS @@ -47,12 +47,12 @@ #endif -/* Parameters set by the command line args and config file */ +// Parameters set by the command line args and config file const char *font_name = NULL; // X: the name of the font to load Win_dim initial_window_width("90%"); // X: the name says it all Win_dim initial_window_height("90%"); // X: the name says it all -/* Global variables */ +// Global variables int GfxMode = 0; // graphics mode number, or 0 for text // 1 = 320x200, 2 = 640x480, 3 = 800x600, 4 = 1kx768 // positive = 16 colors, negative = 256 colors @@ -752,7 +752,7 @@ double r = hypot((double) (scrx1 - scrx2), (double) (scry1 - scry2)); #if 0 - /* AYM 19980216 to avoid getting huge arrowheads when zooming in */ + // AYM 19980216 to avoid getting huge arrowheads when zooming in int scrXoff = (r >= 1.0) ? (int) ((scrx1 - scrx2) * 8.0 / r * (cfg.Scale <
--- a/src/gotoobj.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/gotoobj.cc Mon Oct 06 12:42:55 2014 +0300 @@ -83,7 +83,7 @@ centre the map around the object and zoom in if necessary */ -void GoToObject(const Objid & objid) /* SWAP! */ +void GoToObject(const Objid & objid) // SWAP! { int xpos, ypos; int xpos2, ypos2; @@ -99,7 +99,7 @@ superimposed objects and we're trying to focus on the highest-numbered (and therefore hidden) one. AYM 1999-07-26 */ #if 0 -/* zoom in until the object can be selected */ +// zoom in until the object can be selected while (cfg.Scale < 8.0 && GetCurObject(objid.type, MAPX(is.x), MAPY(is.y)) != objid.num) { @@ -123,7 +123,7 @@ fault). */ if (objid.type == OBJ_SECTORS && sector_under_pointer() != objid.num) { - /* restore the Scale */ + // restore the Scale cfg.Scale = oldscale; for (int n = 0; n < NumLineDefs; n++) {
--- a/src/help2.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/help2.cc Mon Oct 06 12:42:55 2014 +0300 @@ -78,7 +78,7 @@ NULL }; -void DisplayHelp() /* SWAP! */ +void DisplayHelp() // SWAP! { int x0; int y0; @@ -97,7 +97,7 @@ height = lines * FONTH + 2 * BOX_BORDER; x0 = (cfg.ScrMaxX + 1 - width) / 2; y0 = (cfg.ScrMaxY + 1 - height) / 2; - /* put in the instructions */ + // put in the instructions DrawScreenBox3D(x0, y0, x0 + width - 1, y0 + height - 1); set_colour(LIGHTCYAN); DrawScreenText(x0 + BOX_BORDER + (width - 5 * FONTW) / 2,
--- a/src/infobar.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/infobar.cc Mon Oct 06 12:42:55 2014 +0300 @@ -220,7 +220,7 @@ || pointer_x_disp != pointer_x || pointer_y_disp != pointer_y) { set_colour(WINFG); - /* FIXME pointer_x/y are not significant the first time. */ + // FIXME pointer_x/y are not significant the first time. DrawScreenText(x, text_y0, "%5d, %5d", pointer_x, pointer_y); pointer_x_disp = pointer_x; pointer_y_disp = pointer_y;
--- a/src/input.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/input.cc Mon Oct 06 12:42:55 2014 +0300 @@ -78,7 +78,7 @@ static const key_info_t key_info[] = { { XK_BackSpace, YK_BACKSPACE}, -#ifdef XK_ISO_Left_Tab /* OpenServer 5.0 X11R5 doesn't have XK_ISO_Left_Tab */ +#ifdef XK_ISO_Left_Tab // OpenServer 5.0 X11R5 doesn't have XK_ISO_Left_Tab { XK_ISO_Left_Tab, YK_BACKTAB}, #endif { XK_Delete, YK_DEL,}, @@ -99,10 +99,10 @@ { XK_Insert, YK_INS,}, { XK_Left, YK_LEFT,}, { XK_Linefeed, YK_RETURN,}, -#ifdef XK_Page_Down /* HP-UX 10 doesn't have XK_Page_Down */ +#ifdef XK_Page_Down // HP-UX 10 doesn't have XK_Page_Down { XK_Page_Down, YK_PD,}, #endif -#ifdef XK_Page_Up /* HP-UX 10 doesn't have XK_Page_Up */ +#ifdef XK_Page_Up // HP-UX 10 doesn't have XK_Page_Up { XK_Page_Up, YK_PU,}, #endif { XK_Return, YK_RETURN,}, @@ -124,7 +124,7 @@ is.key = 0; - if (!dpy) /* Sanity check */ + if (!dpy) // Sanity check fatal_error("get_input_status() called before XOpenDisplay()"); if (XPending(dpy) == 0) @@ -148,13 +148,13 @@ switch (ev.type) { - /* Exposure */ + // Exposure case Expose: if (ev.xexpose.window == win && ev.xexpose.count == 0) is.key = YE_EXPOSE; break; - /* Resize */ + // Resize case ConfigureNotify: if (is.width < 0 || ev.xconfigure.width != is.width || ev.xconfigure.height != is.height) @@ -165,7 +165,7 @@ } break; - /* Mouse motion */ + // Mouse motion case EnterNotify: is.key = YE_ENTER; is.time = ev.xcrossing.time; @@ -181,7 +181,7 @@ case LeaveNotify: is.key = YE_LEAVE; is.time = ev.xcrossing.time; - is.in_window = 0; /* Should probably "release" buttons */ + is.in_window = 0; // Should probably "release" buttons return; break; case MotionNotify: @@ -240,7 +240,7 @@ // DEBUG break; - /* Mouse buttons */ + // Mouse buttons case ButtonPress: case ButtonRelease: { @@ -304,7 +304,7 @@ if (! !(ev.xkey.state & Mod1Mask) != is.alt) is.alt = ! !(ev.xkey.state & Mod1Mask); - /* It's a modifier ? Remember its state */ + // It's a modifier ? Remember its state switch (ks) { case XK_Shift_L: @@ -323,7 +323,7 @@ break; } - /* Process ordinary keys */ + // Process ordinary keys if (press) { size_t n; @@ -344,10 +344,10 @@ } break; } - } /* switch (ev.type) */ + } // switch (ev.type) } -#endif /* #ifdef Y_X11 */ +#endif // #ifdef Y_X11 /* @@ -373,7 +373,7 @@ */ int have_key() { - return 1; /* FIXME!! */ + return 1; // FIXME!! } @@ -493,6 +493,6 @@ else al_saps(buf, key_string[n].string, sizeof buf - 1); - buf[sizeof buf - 1] = '\0'; /* Paranoia */ + buf[sizeof buf - 1] = '\0'; // Paranoia return buf; }
--- a/src/l_align.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/l_align.cc Mon Oct 06 12:42:55 2014 +0300 @@ -48,7 +48,7 @@ int l, sector; int otherside = OBJ_NO_NONE; - /* find the sidedef on the other side of the LineDef, if any */ + // find the sidedef on the other side of the LineDef, if any for (l = 0; l < NumLineDefs; l++) { if (LineDefs[l].sidedef1 == sidedef) @@ -63,7 +63,7 @@ } } - /* get the Sector number */ + // get the Sector number sector = SideDefs[sidedef].sector; /* if the upper texture is displayed, then the reference @@ -79,11 +79,11 @@ } } - /* return the altitude of the ceiling */ + // return the altitude of the ceiling if (sector >= 0) - return Sectors[sector].ceilh; /* textures are drawn from the ceiling down */ + return Sectors[sector].ceilh; // textures are drawn from the ceiling down else - return 0; /* yuck! */ + return 0; // yuck! } @@ -107,12 +107,12 @@ if (!*sdlist) return; - /* get the reference height from the first sidedef */ + // get the reference height from the first sidedef refh = GetTextureRefHeight((*sdlist)->objnum); SideDefs[(*sdlist)->objnum].yoff = 0; UnSelectObject(sdlist, (*sdlist)->objnum); - /* adjust Y offset in all other SideDefs */ + // adjust Y offset in all other SideDefs while (*sdlist) { h = GetTextureRefHeight((*sdlist)->objnum); @@ -146,20 +146,20 @@ void AlignTexturesX(SelPtr * sdlist, int opt_sdef, bool opt_check, bool opt_offset, int opt_mode) { - /* FIRST texture name used in the highlited objects */ + // FIRST texture name used in the highlited objects char texname[WAD_TEX_NAME + 1]; - char errormessage[128]; /* area to hold the error messages produced */ - int ldef; /* linedef number */ - int sdef; /* current sidedef in *sdlist */ - int vert1, vert2; /* vertex 1 and 2 for the linedef under scrutiny */ - int xoffset; /* xoffset accumulator */ - int useroffset; /* user input offset for first input */ - i16 texlength; /* the length of texture to format to */ - int length; /* length of linedef under scrutiny */ - i16 dummy; /* holds useless data */ + char errormessage[128]; // area to hold the error messages produced + int ldef; // linedef number + int sdef; // current sidedef in *sdlist + int vert1, vert2; // vertex 1 and 2 for the linedef under scrutiny + int xoffset; // xoffset accumulator + int useroffset; // user input offset for first input + i16 texlength; // the length of texture to format to + int length; // length of linedef under scrutiny + i16 dummy; // holds useless data vert1 = -1; - vert2 = -1; /* 1st time round the while loop the -1 value is needed */ + vert2 = -1; // 1st time round the while loop the -1 value is needed texlength = 0; xoffset = 0; useroffset = 0; @@ -202,7 +202,7 @@ } else { - /* Find first sidedef that has desired texture set */ + // Find first sidedef that has desired texture set // FIXME! Not implemented yet ... -ccr } @@ -220,7 +220,7 @@ return; } - /* Get initial offset to use, if requested */ + // Get initial offset to use, if requested if (opt_offset) { int x0, y0, key; @@ -243,13 +243,13 @@ return; } - /* Main processing loop */ + // Main processing loop xoffset = opt_offset ? useroffset : 0; while (*sdlist != NULL) { sdef = (*sdlist)->objnum; - /* Check for contiguous textures, if required */ + // Check for contiguous textures, if required if (opt_check) { SDPtr pdef = &SideDefs[sdef]; @@ -264,7 +264,7 @@ } } - /* Find out which linedef owns this sidedef */ + // Find out which linedef owns this sidedef int n; for (ldef = -1, n = 0; n < NumLineDefs; n++) if ((opt_sdef == 1 && LineDefs[n].sidedef1 == sdef) || @@ -282,7 +282,7 @@ return; } - /* Test for linedef continuity */ + // Test for linedef continuity vert1 = LineDefs[ldef].start; if (vert1 != vert2 && vert2 != -1) { @@ -293,20 +293,20 @@ return; } - /* Set offset */ + // Set offset SideDefs[sdef].xoff = xoffset; - /* Calculate length of linedef */ + // Calculate length of linedef vert2 = LineDefs[ldef].end; length = ComputeDist(Vertices[vert2].x - Vertices[vert1].x, Vertices[vert2].y - Vertices[vert1].y); xoffset += length; - /* Remove multiples of texlength from xoffset */ + // Remove multiples of texlength from xoffset xoffset = xoffset % texlength; - /* move to next object in selected list */ + // move to next object in selected list UnSelectObject(sdlist, (*sdlist)->objnum); }
--- a/src/l_misc.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/l_misc.cc Mon Oct 06 12:42:55 2014 +0300 @@ -43,7 +43,7 @@ flip one or several LineDefs */ -void FlipLineDefs(SelPtr obj, bool swapvertices) /* SWAP! */ +void FlipLineDefs(SelPtr obj, bool swapvertices) // SWAP! { SelPtr cur; int tmp; @@ -52,12 +52,12 @@ { if (swapvertices) { - /* swap starting and ending Vertices */ + // swap starting and ending Vertices tmp = LineDefs[cur->objnum].end; LineDefs[cur->objnum].end = LineDefs[cur->objnum].start; LineDefs[cur->objnum].start = tmp; } - /* swap first and second SideDefs */ + // swap first and second SideDefs tmp = LineDefs[cur->objnum].sidedef1; LineDefs[cur->objnum].sidedef1 = LineDefs[cur->objnum].sidedef2; LineDefs[cur->objnum].sidedef2 = tmp; @@ -71,7 +71,7 @@ split one or more LineDefs in two, adding new Vertices in the middle */ -void SplitLineDefs(SelPtr obj) /* SWAP! */ +void SplitLineDefs(SelPtr obj) // SWAP! { SelPtr cur; int vstart, vend; @@ -104,7 +104,7 @@ * This is true when convex is false. If convex is true, the nook * is actually a bump when viewed from the 1st sidedef. */ -void MakeRectangularNook(SelPtr obj, int width, int depth, int convex) /* SWAP! */ +void MakeRectangularNook(SelPtr obj, int width, int depth, int convex) // SWAP! { SelPtr cur; @@ -126,10 +126,10 @@ dx0 = Vertices[vend].x - x0; dy0 = Vertices[vend].y - y0; - /* First split the line 4 times */ + // First split the line 4 times SliceLinedef(cur->objnum, 4); - /* Then position the vertices */ + // Then position the vertices angle = atan2(dy0, dx0); /* If line to split is not longer than sidelen,
--- a/src/l_prop.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/l_prop.cc Mon Oct 06 12:42:55 2014 +0300 @@ -482,7 +482,7 @@ for (;;) { - /* First let user select a ldtgroup */ + // First let user select a ldtgroup if (DisplayMenuList(x0 + 84, y0, "Select group", ldtgroup, PrintLdtgroup, &ldtgno) < 0) return 1; @@ -529,7 +529,7 @@ again: ; - /* draw_map (OBJ_THINGS, 0, 0); FIXME! */ + // draw_map (OBJ_THINGS, 0, 0); FIXME! } return 0;
--- a/src/levels.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/levels.cc Mon Oct 06 12:42:55 2014 +0300 @@ -47,32 +47,32 @@ All these variables should be turned into members of a "Level" class. */ -MDirPtr Level; /* master dictionary entry for the level */ -int NumThings; /* number of things */ -TPtr Things; /* things data */ -int NumLineDefs; /* number of line defs */ -LDPtr LineDefs; /* line defs data */ -int NumSideDefs; /* number of side defs */ -SDPtr SideDefs; /* side defs data */ -int NumVertices; /* number of vertexes */ -VPtr Vertices; /* vertex data */ -int NumSectors; /* number of sectors */ -SPtr Sectors; /* sectors data */ +MDirPtr Level; // master dictionary entry for the level +int NumThings; // number of things +TPtr Things; // things data +int NumLineDefs; // number of line defs +LDPtr LineDefs; // line defs data +int NumSideDefs; // number of side defs +SDPtr SideDefs; // side defs data +int NumVertices; // number of vertexes +VPtr Vertices; // vertex data +int NumSectors; // number of sectors +SPtr Sectors; // sectors data // FIXME should be somewhere else -int NumWTexture; /* number of wall textures */ -char **WTexture; /* array of wall texture names */ +int NumWTexture; // number of wall textures +char **WTexture; // array of wall texture names // FIXME all the flat list stuff should be put in a separate class -size_t NumFTexture; /* number of floor/ceiling textures */ +size_t NumFTexture; // number of floor/ceiling textures flat_list_entry_t *flat_list; // List of all flats in the directory -int MapMaxX = -32767; /* maximum X value of map */ -int MapMaxY = -32767; /* maximum Y value of map */ -int MapMinX = 32767; /* minimum X value of map */ -int MapMinY = 32767; /* minimum Y value of map */ -bool MadeChanges; /* made changes? */ -bool MadeMapChanges; /* made changes that need rebuilding? */ +int MapMaxX = -32767; // maximum X value of map +int MapMaxY = -32767; // maximum Y value of map +int MapMinX = 32767; // minimum X value of map +int MapMinY = 32767; // minimum Y value of map +bool MadeChanges; // made changes? +bool MadeMapChanges; // made changes that need rebuilding? unsigned long things_angles; // See levels.h for description. unsigned long things_types; // See levels.h for description. char Level_name[WAD_NAME + 1]; /* The name of the level (E.G. @@ -142,19 +142,19 @@ read in the level data */ -int ReadLevelData(const char *levelname) /* SWAP! */ +int ReadLevelData(const char *levelname) // SWAP! { int rc = 0; MDirPtr dir; int OldNumVertices; -/* Find the various level information from the master directory */ +// Find the various level information from the master directory DisplayMessage(-1, -1, "Reading data for level %s...", levelname); Level = FindMasterDir(cfg.MasterDir, levelname); if (!Level) fatal_error("level data not found"); -/* Get the number of vertices */ +// Get the number of vertices i32 v_offset = 42; i32 v_length = 42; { @@ -953,9 +953,9 @@ forget the level data */ -void ForgetLevelData() /* SWAP! */ +void ForgetLevelData() // SWAP! { - /* forget the things */ + // forget the things NumThings = 0; if (Things != 0) FreeMemory(Things); @@ -963,25 +963,25 @@ things_angles++; things_types++; - /* forget the vertices */ + // forget the vertices NumVertices = 0; if (Vertices != 0) FreeMemory(Vertices); Vertices = 0; - /* forget the linedefs */ + // forget the linedefs NumLineDefs = 0; if (LineDefs != 0) FreeMemory(LineDefs); LineDefs = 0; - /* forget the sidedefs */ + // forget the sidedefs NumSideDefs = 0; if (SideDefs != 0) FreeMemory(SideDefs); SideDefs = 0; - /* forget the sectors */ + // forget the sectors NumSectors = 0; if (Sectors != 0) FreeMemory(Sectors); @@ -1014,7 +1014,7 @@ * * Returns 0 on success and non-zero on failure (see errno). */ -int SaveLevelData(const char *outfile, const char *level_name) /* SWAP! */ +int SaveLevelData(const char *outfile, const char *level_name) // SWAP! { FILE *file; MDirPtr dir; @@ -1122,7 +1122,7 @@ lump_offset[WAD_LL_VERTEXES] = ftell(file); if (reuse_nodes) { - /* Copy the vertices */ + // Copy the vertices const Wad_file *wf = dir->wadfile; wf->seek(dir->dir.start); if (wf->error()) @@ -1133,7 +1133,7 @@ } else { - /* Write the vertices */ + // Write the vertices for (n = 0; n < NumVertices; n++) { file_write_i16(file, Vertices[n].x); @@ -1191,7 +1191,7 @@ lump_offset[l] = ftell(file); if (reuse_nodes) { - /* Copy the REJECT data */ + // Copy the REJECT data const Wad_file *wf = dir->wadfile; wf->seek(dir->dir.start); if (wf->error()) @@ -1233,7 +1233,7 @@ file_write_name(file, wad_level_lump[L].name); } - /* Fix up the directory start information */ + // Fix up the directory start information if (fseek(file, 8, SEEK_SET)) { char buf1[81]; @@ -1246,7 +1246,7 @@ } file_write_i32(file, dir_offset); - /* Close the file */ + // Close the file if (fclose(file)) { char buf1[81]; @@ -1257,19 +1257,19 @@ return 1; } - /* The file is now up to date */ + // The file is now up to date if (!Level || MadeMapChanges) cfg.remind_to_build_nodes = 1; MadeChanges = 0; MadeMapChanges = 0; - /* Update pointers in Master Directory */ + // Update pointers in Master Directory OpenPatchWad(outfile); - /* This should free the old "*.bak" file */ + // This should free the old "*.bak" file CloseUnusedWadFiles(); - /* Update MapMinX, MapMinY, MapMaxX, MapMaxY */ + // Update MapMinX, MapMinY, MapMaxX, MapMaxY // Probably not necessary anymore -- AYM 1999-04-05 update_level_bounds(); return 0; @@ -1384,7 +1384,7 @@ goto textures05_done; } NumWTexture = (int) val + 1; - /* read in the offsets for texture1 names */ + // read in the offsets for texture1 names offsets = (i32 *) GetMemory((long) NumWTexture * 4); wf->read_i32(offsets + 1, NumWTexture - 1); if (wf->error()) @@ -1392,7 +1392,7 @@ warn("%s: error reading offsets table\n", lump_name); goto textures05_done; } - /* read in the actual names */ + // read in the actual names WTexture = (char **) GetMemory((long) NumWTexture * sizeof(char *)); WTexture[0] = (char *) GetMemory(WAD_TEX_NAME + 1); @@ -1443,13 +1443,13 @@ // FIXME } NumWTexture = (int) val + 1; - /* read in the offsets for texture1 names */ + // read in the offsets for texture1 names offsets = (i32 *) GetMemory((long) NumWTexture * 4); wf->read_i32(offsets + 1, NumWTexture - 1); { // FIXME } - /* read in the actual names */ + // read in the actual names WTexture = (char **) GetMemory((long) NumWTexture * sizeof(char *)); WTexture[0] = (char *) GetMemory(WAD_TEX_NAME + 1); @@ -1474,7 +1474,7 @@ } { dir = FindMasterDir(cfg.MasterDir, "TEXTURE2"); - if (dir) /* Doom II has no TEXTURE2 */ + if (dir) // Doom II has no TEXTURE2 { const Wad_file *wf = dir->wadfile; wf->seek(dir->dir.start); @@ -1488,14 +1488,14 @@ { // FIXME } - /* read in the offsets for texture2 names */ + // read in the offsets for texture2 names offsets = (i32 *) GetMemory((long) val * 4); wf->read_i32(offsets, val); if (wf->error()) { // FIXME } - /* read in the actual names */ + // read in the actual names WTexture = (char **) ResizeMemory(WTexture, (NumWTexture + val) * sizeof(char *)); @@ -1524,7 +1524,7 @@ else nf_bug("Invalid texture_format/texture_lumps combination."); -/* sort the names */ +// sort the names qsort(WTexture, NumWTexture, sizeof(char *), SortTextures); } @@ -1538,11 +1538,11 @@ { int n; -/* forget all names */ + // forget all names for (n = 0; n < NumWTexture; n++) FreeMemory(WTexture[n]); -/* forget the array */ + // forget the array NumWTexture = 0; FreeMemory(WTexture); } @@ -1565,7 +1565,7 @@ { bool ff_start = !y_strnicmp(dir->dir.name, "FF_START", WAD_NAME); MDirPtr dir0; - /* count the names */ + // count the names dir = dir->next; dir0 = dir; for (n = 0; dir && y_strnicmp(dir->dir.name, "F_END", WAD_NAME) @@ -1610,7 +1610,7 @@ if (dir && !y_strnicmp(dir->dir.name, "FF_END", WAD_NAME)) warn("this wad uses FF_END. That won't work with Doom." " Use F_END instead.\n"); - /* get the actual names from master dir. */ + // get the actual names from master dir. flat_list = (flat_list_entry_t *) ResizeMemory(flat_list, (NumFTexture + n) * @@ -1642,7 +1642,7 @@ verbmsg("\n"); - /* sort the flats by names */ + // sort the flats by names qsort(flat_list, NumFTexture, sizeof *flat_list, flat_list_entry_cmp); /* Eliminate all but the last duplicates of a flat. Suboptimal.
--- a/src/lists.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/lists.cc Mon Oct 06 12:42:55 2014 +0300 @@ -103,11 +103,11 @@ bool lump_loc_drawn = false; #endif bool ok, firstkey; - int entry_out_x0; /* Edge of name entry widget including border */ + int entry_out_x0; // Edge of name entry widget including border int entry_out_y0; int entry_out_x1; int entry_out_y1; - int entry_text_x0; /* Edge of text area of name entry widget */ + int entry_text_x0; // Edge of text area of name entry widget int entry_text_y0; int entry_text_x1; int entry_text_y1; @@ -547,10 +547,10 @@ printf("maxpatches %d\n", maxpatches); } else if (ok && key == YK_RETURN) // [Return] - break; /* return "name" */ + break; // return "name" else if (key == YK_ESC) // [Esc] { - name[0] = '\0'; /* return an empty string */ + name[0] = '\0'; // return an empty string break; } else
--- a/src/memory.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/memory.cc Mon Oct 06 12:42:55 2014 +0300 @@ -45,7 +45,7 @@ */ #define SIZE_THRESHOLD 1024 -#define SIZE_OF_BLOCK 4095 /* actually, this is (size - 1) */ +#define SIZE_OF_BLOCK 4095 // actually, this is (size - 1) /* @@ -55,7 +55,7 @@ { void *ret; - /* Limit fragmentation on large blocks */ + // Limit fragmentation on large blocks if (size >= SIZE_THRESHOLD) size = (size + SIZE_OF_BLOCK) & ~SIZE_OF_BLOCK; @@ -74,7 +74,7 @@ { void *ret; - /* Limit fragmentation on large blocks */ + // Limit fragmentation on large blocks if (size >= SIZE_THRESHOLD) size = (size + SIZE_OF_BLOCK) & ~SIZE_OF_BLOCK;
--- a/src/menubar.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/menubar.cc Mon Oct 06 12:42:55 2014 +0300 @@ -255,14 +255,14 @@ if (stale_x0_x1) compute_x0_x1(); - push_colour(menu_colour[0][0].bg); /* 1 */ + push_colour(menu_colour[0][0].bg); // 1 DrawScreenBox3D(0, 0, cfg.ScrMaxX, menubar_out_y1); set_colour(menu_colour[0][0].fg); for (int n = 0; n < nitems; n++) { if (n == highlighted_no) { - push_colour(menu_colour[0][1].bg); /* 2 */ + push_colour(menu_colour[0][1].bg); // 2 DrawScreenBox(item_x0[n], menubar_in_y0, item_x1[n], menubar_in_y1); set_colour(menu_colour[0][1].fg); @@ -273,9 +273,9 @@ item_shortcut_index[n] * FONTW, menubar_text_y0 + FONTU, "_"); if (n == highlighted_no) - pop_colour(); /* 2 */ + pop_colour(); // 2 } - pop_colour(); /* 1 */ + pop_colour(); // 1 bar_visible_disp = 1; highlighted_no_disp = highlighted_no; }
--- a/src/names.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/names.cc Mon Oct 06 12:42:55 2014 +0300 @@ -136,39 +136,39 @@ #if 0 static char temp[20]; if (flags & 0x0100) - strcpy(temp, "A"); /* Already on the map (Ma) */ + strcpy(temp, "A"); // Already on the map (Ma) else strcpy(temp, "-"); if (flags & 0x80) - strcat(temp, "V"); /* Invisible on the map (In) */ + strcat(temp, "V"); // Invisible on the map (In) else strcat(temp, "-"); if (flags & 0x40) - strcat(temp, "B"); /* Blocks sound (So) */ + strcat(temp, "B"); // Blocks sound (So) else strcat(temp, "-"); if (flags & 0x20) - strcat(temp, "S"); /* Secret (normal on the map) (Se) */ + strcat(temp, "S"); // Secret (normal on the map) (Se) else strcat(temp, "-"); if (flags & 0x10) - strcat(temp, "L"); /* Lower texture offset changed (Lo) */ + strcat(temp, "L"); // Lower texture offset changed (Lo) else strcat(temp, "-"); if (flags & 0x08) - strcat(temp, "U"); /* Upper texture offset changed (Up) */ + strcat(temp, "U"); // Upper texture offset changed (Up) else strcat(temp, "-"); if (flags & 0x04) - strcat(temp, "2"); /* Two-sided (2S) */ + strcat(temp, "2"); // Two-sided (2S) else strcat(temp, "-"); if (flags & 0x02) - strcat(temp, "M"); /* Monsters can't cross this line (Mo) */ + strcat(temp, "M"); // Monsters can't cross this line (Mo) else strcat(temp, "-"); if (flags & 0x01) - strcat(temp, "I"); /* Impassible (Im) */ + strcat(temp, "I"); // Impassible (Im) else strcat(temp, "-"); if (strlen(temp) > 13) @@ -221,7 +221,7 @@ const char *GetSectorTypeName(int type) { -/* KLUDGE: To avoid the last element which is bogus */ +// KLUDGE: To avoid the last element which is bogus if (al_ltell(stdef) == al_lcount(stdef) - 1) al_lrewind(stdef); @@ -243,7 +243,7 @@ const char *GetSectorTypeLongName(int type) { -/* KLUDGE: To avoid the last element which is bogus */ +// KLUDGE: To avoid the last element which is bogus if (al_ltell(stdef) == al_lcount(stdef) - 1) al_lrewind(stdef);
--- a/src/objects.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/objects.cc Mon Oct 06 12:42:55 2014 +0300 @@ -53,7 +53,7 @@ /* highlight the selected objects */ -void HighlightSelection(int objtype, SelPtr list) /* SWAP! */ +void HighlightSelection(int objtype, SelPtr list) // SWAP! { SelPtr cur; @@ -88,11 +88,11 @@ /* highlight the selected object */ -void HighlightObject(int objtype, int objnum, int colour) /* SWAP! */ +void HighlightObject(int objtype, int objnum, int colour) // SWAP! { int n, m; - /* use XOR mode : drawing any line twice erases it */ + // use XOR mode : drawing any line twice erases it SetDrawingMode(1); set_colour(colour); @@ -177,7 +177,7 @@ } break; } -/* restore normal write mode */ +// restore normal write mode SetDrawingMode(0); } @@ -186,7 +186,7 @@ /* delete an object */ -void DeleteObject(const Objid & obj) /* SWAP! */ +void DeleteObject(const Objid & obj) // SWAP! { SelPtr list = 0; SelectObject(&list, obj.num); @@ -198,7 +198,7 @@ /* delete a group of objects (*recursive*) */ -void DeleteObjects(int objtype, SelPtr * list) /* SWAP! */ +void DeleteObjects(int objtype, SelPtr * list) // SWAP! { int n, objnum; SelPtr cur; @@ -346,7 +346,7 @@ nf_bug("attempt to delete non-existent sidedef #%d", objnum); goto next_sidedef; } - /* change the linedefs references */ + // change the linedefs references for (n = 0; n < NumLineDefs; n++) { if (LineDefs[n].sidedef1 == objnum) @@ -361,7 +361,7 @@ if (LineDefs[n].sidedef2 >= objnum) LineDefs[n].sidedef2--; } - /* delete the sidedef */ + // delete the sidedef NumSideDefs--; if (NumSideDefs > 0) { @@ -399,7 +399,7 @@ else if (SideDefs[n].sector >= objnum) SideDefs[n].sector--; - /* delete the sector */ + // delete the sector NumSectors--; if (NumSectors > 0) { @@ -441,7 +441,7 @@ * No snapping to grid is done. */ void InsertObject(obj_type_t objtype, obj_no_t copyfrom, int xpos, int ypos) - /* SWAP! */ + // SWAP! { int last; @@ -589,7 +589,7 @@ /* check if a (part of a) LineDef is inside a given block */ -bool IsLineDefInside(int ldnum, int x0, int y0, int x1, int y1) /* SWAP - needs Vertices & LineDefs */ +bool IsLineDefInside(int ldnum, int x0, int y0, int x1, int y1) // SWAP - needs Vertices & LineDefs { int lx0 = Vertices[LineDefs[ldnum].start].x; int ly0 = Vertices[LineDefs[ldnum].start].y; @@ -597,36 +597,36 @@ int ly1 = Vertices[LineDefs[ldnum].end].y; int i; - /* do you like mathematics? */ + // do you like mathematics? if (lx0 >= x0 && lx0 <= x1 && ly0 >= y0 && ly0 <= y1) - return 1; /* the linedef start is entirely inside the square */ + return 1; // the linedef start is entirely inside the square if (lx1 >= x0 && lx1 <= x1 && ly1 >= y0 && ly1 <= y1) - return 1; /* the linedef end is entirely inside the square */ + return 1; // the linedef end is entirely inside the square if ((ly0 > y0) != (ly1 > y0)) { i = lx0 + (int) ((y0 - ly0) * (lx1 - lx0) / (ly1 - ly0)); if (i >= x0 && i <= x1) - return true; /* the linedef crosses the y0 side (left) */ + return true; // the linedef crosses the y0 side (left) } if ((ly0 > y1) != (ly1 > y1)) { i = lx0 + (int) ((y1 - ly0) * (lx1 - lx0) / (ly1 - ly0)); if (i >= x0 && i <= x1) - return true; /* the linedef crosses the y1 side (right) */ + return true; // the linedef crosses the y1 side (right) } if ((lx0 > x0) != (lx1 > x0)) { i = ly0 + (int) ((x0 - lx0) * (ly1 - ly0) / (lx1 - lx0)); if (i >= y0 && i <= y1) - return true; /* the linedef crosses the x0 side (down) */ + return true; // the linedef crosses the x0 side (down) } if ((lx0 > x1) != (lx1 > x1)) { i = ly0 + (int) ((x1 - lx0) * (ly1 - ly0) / (lx1 - lx0)); if (i >= y0 && i <= y1) - return true; /* the linedef crosses the x1 side (up) */ + return true; // the linedef crosses the x1 side (up) } return false; } @@ -638,7 +638,7 @@ get the sector number of the sidedef opposite to this sidedef (returns -1 if it cannot be found) */ -int GetOppositeSector(int ld1, bool firstside) /* SWAP! */ +int GetOppositeSector(int ld1, bool firstside) // SWAP! { int x0, y0, dx0, dy0; int x1, y1, dx1, dy1; @@ -646,10 +646,10 @@ int ld2, dist; int bestld, bestdist, bestmdist; - /* get the coords for this LineDef */ + // get the coords for this LineDef GetLDCoords(ld1, &x0, &y0, &dx0, &dy0); - /* find the normal vector for this LineDef */ + // find the normal vector for this LineDef x1 = (dx0 + x0 + x0) / 2; y1 = (dy0 + y0 + y0) / 2; if (firstside) @@ -665,12 +665,12 @@ bestld = -1; - /* use a parallel to an axis instead of the normal vector (faster method) */ + // use a parallel to an axis instead of the normal vector (faster method) if (abs(dy1) > abs(dx1)) { if (dy1 > 0) { - /* get the nearest LineDef in that direction (increasing Y's: North) */ + // get the nearest LineDef in that direction (increasing Y's: North) bestdist = 32767; bestmdist = 32767; for (ld2 = 0; ld2 < NumLineDefs; ld2++) @@ -688,7 +688,7 @@ } else { - /* get the nearest LineDef in that direction (decreasing Y's: South) */ + // get the nearest LineDef in that direction (decreasing Y's: South) bestdist = -32767; bestmdist = -32767; for (ld2 = 0; ld2 < NumLineDefs; ld2++) @@ -709,7 +709,7 @@ { if (dx1 > 0) { - /* get the nearest LineDef in that direction (increasing X's: East) */ + // get the nearest LineDef in that direction (increasing X's: East) bestdist = 32767; bestmdist = 32767; for (ld2 = 0; ld2 < NumLineDefs; ld2++) @@ -727,7 +727,7 @@ } else { - /* get the nearest LineDef in that direction (decreasing X's: West) */ + // get the nearest LineDef in that direction (decreasing X's: West) bestdist = -32767; bestmdist = -32767; for (ld2 = 0; ld2 < NumLineDefs; ld2++) @@ -745,11 +745,11 @@ } } -/* no intersection: the LineDef was pointing outwards! */ +// no intersection: the LineDef was pointing outwards! if (bestld < 0) return -1; -/* now look if this LineDef has a SideDef bound to one sector */ +// now look if this LineDef has a SideDef bound to one sector if (abs(dy1) > abs(dx1)) { if ((Vertices[LineDefs[bestld].start].x < Vertices[LineDefs[bestld].end].x) == (dy1 > 0)) @@ -765,11 +765,11 @@ x0 = LineDefs[bestld].sidedef2; } -/* there is no SideDef on this side of the LineDef! */ +// there is no SideDef on this side of the LineDef! if (x0 < 0) return -1; -/* OK, we got it -- return the Sector number */ +// OK, we got it -- return the Sector number return SideDefs[x0].sector; } @@ -778,7 +778,7 @@ /* copy a group of objects to a new position */ -void CopyObjects(int objtype, SelPtr obj) /* SWAP! */ +void CopyObjects(int objtype, SelPtr obj) // SWAP! { int n, m; SelPtr cur; @@ -788,7 +788,7 @@ if (!obj) return; -/* copy the object(s) */ +// copy the object(s) switch (objtype) { case OBJ_THINGS: @@ -901,7 +901,7 @@ } } CopyObjects(OBJ_LINEDEFS, list2); - /* create the sidedefs */ + // create the sidedefs for (ref1 = list1, ref2 = list2; ref1 && ref2; ref1 = ref1->next, ref2 = ref2->next) { @@ -920,7 +920,7 @@ ref1->objnum = n; ref2->objnum = m; } - /* create the Sectors */ + // create the Sectors for (cur = obj; cur; cur = cur->next) { InsertObject(OBJ_SECTORS, cur->objnum, 0, 0); @@ -957,11 +957,11 @@ * * Returns <>0 iff an object was moved. */ -bool MoveObjectsToCoords(int objtype, SelPtr obj, int newx, int newy, int grid) /* SWAP! */ +bool MoveObjectsToCoords(int objtype, SelPtr obj, int newx, int newy, int grid) // SWAP! { int dx, dy; SelPtr cur, vertices; - static int refx, refy; /* previous position */ + static int refx, refy; // previous position if (grid > 0) { @@ -977,14 +977,14 @@ return true; } -/* compute the displacement */ +// compute the displacement dx = newx - refx; dy = newy - refy; -/* nothing to do? */ +// nothing to do? if (dx == 0 && dy == 0) return false; -/* move the object(s) */ +// move the object(s) switch (objtype) { case OBJ_THINGS: @@ -1030,7 +1030,7 @@ /* get the coordinates (approx.) of an object */ -void GetObjectCoords(int objtype, int objnum, int *xpos, int *ypos) /* SWAP! */ +void GetObjectCoords(int objtype, int objnum, int *xpos, int *ypos) // SWAP! { int n, v1, v2, sd1, sd2, accx, accy, num; @@ -1116,7 +1116,7 @@ if ((sd1 >= 0 && SideDefs[sd1].sector == objnum) || (sd2 >= 0 && SideDefs[sd2].sector == objnum)) { - /* if the Sector is closed, all Vertices will be counted twice */ + // if the Sector is closed, all Vertices will be counted twice accx += Vertices[v1].x; accy += Vertices[v1].y; num++; @@ -1149,7 +1149,7 @@ /* find a free tag number */ -int FindFreeTag() /* SWAP! */ +int FindFreeTag() // SWAP! { int tag, n; bool ok;
--- a/src/palview.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/palview.cc Mon Oct 06 12:42:55 2014 +0300 @@ -335,7 +335,7 @@ is_drawn &= ~(YID_TEXT | YID_CURSOR); cursor_phase = 0; } -#if 0 /* Conflicts with "rotate" */ +#if 0 // Conflicts with "rotate" else if (is.key == '-') // [-]: beginning of previous line { draw_cursor(WINBG, false);
--- a/src/pic2img.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/pic2img.cc Mon Oct 06 12:42:55 2014 +0300 @@ -30,7 +30,7 @@ #include "yadex.h" -#include "gcolour2.h" /* colour0 */ +#include "gcolour2.h" // colour0 #include "pic2img.h" #include "wadfile.h" #include "wads.h" @@ -182,7 +182,7 @@ if (pic_y_offset == INT_MIN) pic_y_offset = (img.height() - pic_height_) / 2; -/* AYM 19971202: 17 kB is large enough for 128x128 patches. */ +// AYM 19971202: 17 kB is large enough for 128x128 patches. #define TEX_COLUMNBUFFERSIZE ((long) 17 * 1024) /* Maximum number of bytes per column. The worst case is a 509-high column, with every second pixel transparent. That @@ -191,7 +191,7 @@ #define TEX_COLUMNSIZE 1300 ColumnData = (u8 *) GetMemory(TEX_COLUMNBUFFERSIZE); -/* FIXME DOS and pic_width_ > 16000 */ +// FIXME DOS and pic_width_ > 16000 NeededOffsets = (i32 *) GetMemory((long) pic_width_ * sizeof(i32)); if (long_offsets)
--- a/src/r_images.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/r_images.cc Mon Oct 06 12:42:55 2014 +0300 @@ -32,7 +32,7 @@ #include <X11/Xlib.h> #endif #include "dialog.h" -#include "game.h" /* yg_picture_format */ +#include "game.h" // yg_picture_format #include "gfx.h" #include "levels.h" #include "lists.h" @@ -100,15 +100,15 @@ Img *Tex2Img(const wad_tex_name_t & texname) { - MDirPtr dir = 0; /* main directory pointer to the TEXTURE* entries */ - i32 *offsets; /* array of offsets to texture names */ - int n; /* general counter */ - i16 width, height; /* size of the texture */ - i16 npatches; /* number of wall patches used to build this texture */ - i32 numtex; /* number of texture names in TEXTURE* list */ - i32 texofs; /* offset in the wad file to the texture data */ - char tname[WAD_TEX_NAME + 1]; /* texture name */ - char picname[WAD_PIC_NAME + 1]; /* wall patch name */ + MDirPtr dir = 0; // main directory pointer to the TEXTURE* entries + i32 *offsets; // array of offsets to texture names + int n; // general counter + i16 width, height; // size of the texture + i16 npatches; // number of wall patches used to build this texture + i32 numtex; // number of texture names in TEXTURE* list + i32 texofs; // offset in the wad file to the texture data + char tname[WAD_TEX_NAME + 1]; // texture name + char picname[WAD_PIC_NAME + 1]; // wall patch name bool have_dummy_bytes; int header_size; int item_size; @@ -142,7 +142,7 @@ return 0; } - /* offset for texture we want. */ + // offset for texture we want. texofs = 0; // Doom alpha 0.4 : "TEXTURES", no names if (yg_texture_lumps == YGTL_TEXTURES @@ -182,7 +182,7 @@ { dir->wadfile->seek(dir->dir.start); dir->wadfile->read_i32(&numtex); - /* read in the offsets for texture1 names and info. */ + // read in the offsets for texture1 names and info. offsets = (i32 *) GetMemory((long) numtex * 4); dir->wadfile->read_i32(offsets, numtex); for (n = 0; n < numtex && !texofs; n++) @@ -206,7 +206,7 @@ { dir->wadfile->seek(dir->dir.start); dir->wadfile->read_i32(&numtex); - /* read in the offsets for texture1 names and info. */ + // read in the offsets for texture1 names and info. offsets = (i32 *) GetMemory((long) numtex * 4); dir->wadfile->read_i32(offsets, numtex); for (n = 0; n < numtex && !texofs; n++) @@ -226,7 +226,7 @@ { dir->wadfile->seek(dir->dir.start); dir->wadfile->read_i32(&numtex); - /* read in the offsets for texture2 names */ + // read in the offsets for texture2 names offsets = (i32 *) GetMemory((long) numtex * 4); dir->wadfile->read_i32(offsets, numtex); for (n = 0; n < numtex && !texofs; n++) @@ -243,11 +243,11 @@ else nf_bug("Invalid texture_format/texture_lumps combination."); - /* texture name not found */ + // texture name not found if (texofs == 0) return 0; - /* read the info for this texture */ + // read the info for this texture i32 header_ofs; if (yg_texture_format == YGTF_NAMELESS) header_ofs = texofs; @@ -265,10 +265,10 @@ } dir->wadfile->read_i16(&npatches); - /* Compose the texture */ + // Compose the texture Img *texbuf = new Img(width, height, false); - /* Paste onto the buffer all the patches that the texture is made of. */ + // Paste onto the buffer all the patches that the texture is made of. for (n = 0; n < npatches; n++) { i16 xofs, yofs; // offset in texture space for the patch @@ -321,7 +321,7 @@ } -/* --- ImageCache methods --- */ +// --- ImageCache methods --- Img *ImageCache::GetFlat(const wad_flat_name_t & fname)
--- a/src/r_render.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/r_render.cc Mon Oct 06 12:42:55 2014 +0300 @@ -169,7 +169,7 @@ // heights for the surface (h1 is above h2). Img *img; - img_pixel_t col; /* used if img is zero */ + img_pixel_t col; // used if img is zero enum { @@ -178,7 +178,7 @@ }; int y_clip; - /* CTor */ + // CTor DrawSurf() { @@ -252,7 +252,7 @@ int oy1, oy2; // for sprites, the remembered open space to clip to - /* surfaces */ + // surfaces DrawSurf ceil; DrawSurf upper; @@ -261,7 +261,7 @@ static const double IZ_EPSILON = 0.000001; - /* PREDICATES */ + // PREDICATES struct MidDistCmp { @@ -314,7 +314,7 @@ } }; - /* methods */ + // methods void ComputeWallSurface() { @@ -361,7 +361,7 @@ if (!back) { - /* ONE-sided line */ + // ONE-sided line lower.kind = DrawSurf::K_TEXTURE; lower.h1 = front->ceilh; @@ -377,7 +377,7 @@ } else { - /* TWO-sided line */ + // TWO-sided line if (back->ceilh < front->ceilh && !sky_upper) { @@ -846,13 +846,13 @@ int tw = surf.img->width(); int th = surf.img->height(); - /* compute texture X coord */ + // compute texture X coord int tx = int (dw->t_dist - tan(dw->cur_ang - dw->normal) * dw->dist); tx = (dw->sd->xoff + tx) & (tw - 1); - /* compute texture Y coords */ + // compute texture Y coords float base_h = surf.tex_h + dw->sd->yoff; @@ -905,7 +905,7 @@ if (y1 > y2) return; - /* clip the open region */ + // clip the open region if (surf.y_clip & DrawSurf::SOLID_ABOVE) if (y2 > open_y1) @@ -915,7 +915,7 @@ if (y1 < open_y2) open_y2 = y1; - /* fill pixels */ + // fill pixels if (!surf.img) { @@ -948,7 +948,7 @@ if (y1 > y2) return; - /* fill pixels */ + // fill pixels img_pixel_t *buf = view.screen->wbuf(); img_pixel_t *wbuf = dw->ceil.img->wbuf(); @@ -1169,7 +1169,7 @@ view.SetAngle(player->angle * ONEPI / 180.0); } -/* create image */ +// create image view.sw = 640; view.sh = 400; @@ -1183,11 +1183,11 @@ bool Redraw = true; -/* input loop */ +// input loop for (;;) { - /* render image */ + // render image if (Redraw) { @@ -1203,7 +1203,7 @@ Redraw = false; } - /* handle keypress */ + // handle keypress int key = get_key(); @@ -1276,7 +1276,7 @@ } } -/* all done */ +// all done delete view.screen; view.screen = 0;
--- a/src/s_door.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_door.cc Mon Oct 06 12:42:55 2014 +0300 @@ -39,7 +39,7 @@ turn a sector into a door: change the linedefs and sidedefs */ -void MakeDoorFromSector(int sector) /* SWAP! */ +void MakeDoorFromSector(int sector) // SWAP! { int sd1, sd2; int n, s; @@ -49,7 +49,7 @@ ldflip = NULL; ld1s = NULL; s = 0; -/* build lists of linedefs that border the sector */ +// build lists of linedefs that border the sector for (n = 0; n < NumLineDefs; n++) { sd1 = LineDefs[n].sidedef1; @@ -58,22 +58,22 @@ { if (SideDefs[sd2].sector == sector) { - SelectObject(&ldok, n); /* already ok */ + SelectObject(&ldok, n); // already ok s++; } if (SideDefs[sd1].sector == sector) { - SelectObject(&ldflip, n); /* must be flipped */ + SelectObject(&ldflip, n); // must be flipped s++; } } else if (sd1 >= 0 && sd2 < 0) { if (SideDefs[sd1].sector == sector) - SelectObject(&ld1s, n); /* wall (one-sided) */ + SelectObject(&ld1s, n); // wall (one-sided) } } -/* a normal door has two sides... */ +// a normal door has two sides... if (s < 2) { Beep(); @@ -94,26 +94,26 @@ ForgetSelection(&ld1s); return; } -/* flip the linedefs that have the wrong orientation */ +// flip the linedefs that have the wrong orientation if (ldflip != NULL) FlipLineDefs(ldflip, 1); -/* merge the two selection lists */ +// merge the two selection lists while (ldflip != NULL) { if (!IsSelected(ldok, ldflip->objnum)) SelectObject(&ldok, ldflip->objnum); UnSelectObject(&ldflip, ldflip->objnum); } -/* change the linedefs and sidedefs */ +// change the linedefs and sidedefs while (ldok != NULL) { - /* give the "normal door" type and flags to the linedef */ + // give the "normal door" type and flags to the linedef n = ldok->objnum; LineDefs[n].type = 1; LineDefs[n].flags = 0x04; - sd1 = LineDefs[n].sidedef1; /* outside */ - sd2 = LineDefs[n].sidedef2; /* inside */ - /* adjust the textures for the sidedefs */ + sd1 = LineDefs[n].sidedef1; // outside + sd2 = LineDefs[n].sidedef2; // inside + // adjust the textures for the sidedefs if (strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) { if (!strncmp(SideDefs[sd1].tex1, "-", WAD_TEX_NAME)) @@ -127,17 +127,17 @@ } while (ld1s != NULL) { - /* give the "door side" flags to the linedef */ + // give the "door side" flags to the linedef n = ld1s->objnum; LineDefs[n].flags = 0x11; sd1 = LineDefs[n].sidedef1; - /* adjust the textures for the sidedef */ + // adjust the textures for the sidedef if (!strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd1].tex3, "DOORTRAK", WAD_TEX_NAME); strncpy(SideDefs[sd1].tex1, "-", WAD_TEX_NAME); strncpy(SideDefs[sd1].tex2, "-", WAD_TEX_NAME); UnSelectObject(&ld1s, n); } -/* adjust the ceiling height */ +// adjust the ceiling height Sectors[sector].ceilh = Sectors[sector].floorh; }
--- a/src/s_lift.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_lift.cc Mon Oct 06 12:42:55 2014 +0300 @@ -40,7 +40,7 @@ turn a Sector into a lift: change the linedefs and sidedefs */ -void MakeLiftFromSector(int sector) /* SWAP! */ +void MakeLiftFromSector(int sector) // SWAP! { int sd1, sd2; int n, s, tag; @@ -52,7 +52,7 @@ ldflip = NULL; ld1s = NULL; sect = NULL; -/* build lists of linedefs that border the Sector */ +// build lists of linedefs that border the Sector for (n = 0; n < NumLineDefs; n++) { sd1 = LineDefs[n].sidedef1; @@ -61,14 +61,14 @@ { if (SideDefs[sd2].sector == sector) { - SelectObject(&ldok, n); /* already ok */ + SelectObject(&ldok, n); // already ok s = SideDefs[sd1].sector; if (s != sector && !IsSelected(sect, s)) SelectObject(§, s); } if (SideDefs[sd1].sector == sector) { - SelectObject(&ldflip, n); /* will be flipped */ + SelectObject(&ldflip, n); // will be flipped s = SideDefs[sd2].sector; if (s != sector && !IsSelected(sect, s)) SelectObject(§, s); @@ -77,10 +77,10 @@ else if (sd1 >= 0 && sd2 < 0) { if (SideDefs[sd1].sector == sector) - SelectObject(&ld1s, n); /* wall (one-sided) */ + SelectObject(&ld1s, n); // wall (one-sided) } } -/* there must be a way to go on the lift... */ +// there must be a way to go on the lift... if (sect == NULL) { Beep(); @@ -92,10 +92,10 @@ ForgetSelection(&ld1s); return; } -/* flip the linedefs that have the wrong orientation */ +// flip the linedefs that have the wrong orientation if (ldflip != NULL) FlipLineDefs(ldflip, 1); -/* merge the two selection lists */ +// merge the two selection lists while (ldflip != NULL) { if (!IsSelected(ldok, ldflip->objnum)) @@ -103,10 +103,10 @@ UnSelectObject(&ldflip, ldflip->objnum); } -/* find a free tag number */ +// find a free tag number tag = FindFreeTag(); -/* find the minimum and maximum altitudes */ +// find the minimum and maximum altitudes minh = 32767; maxh = -32767; for (curs = sect; curs; curs = curs->next) @@ -118,28 +118,28 @@ } ForgetSelection(§); -/* change the lift's floor height if necessary */ +// change the lift's floor height if necessary if (Sectors[sector].floorh < maxh) Sectors[sector].floorh = maxh; -/* change the lift's ceiling height if necessary */ +// change the lift's ceiling height if necessary if (Sectors[sector].ceilh < maxh + DOOM_PLAYER_HEIGHT) Sectors[sector].ceilh = maxh + DOOM_PLAYER_HEIGHT; -/* assign the new tag number to the lift */ +// assign the new tag number to the lift Sectors[sector].tag = tag; -/* change the linedefs and sidedefs */ +// change the linedefs and sidedefs while (ldok != NULL) { - /* give the "lower lift" type and flags to the linedef */ + // give the "lower lift" type and flags to the linedef n = ldok->objnum; - LineDefs[n].type = 62; /* lower lift (switch) */ + LineDefs[n].type = 62; // lower lift (switch) LineDefs[n].flags = 0x04; LineDefs[n].tag = tag; - sd1 = LineDefs[n].sidedef1; /* outside */ - sd2 = LineDefs[n].sidedef2; /* inside */ - /* adjust the textures for the sidedef visible from the outside */ + sd1 = LineDefs[n].sidedef1; // outside + sd2 = LineDefs[n].sidedef2; // inside + // adjust the textures for the sidedef visible from the outside if (strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) { if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) @@ -148,7 +148,7 @@ } if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd1].tex2, "SHAWN2", WAD_TEX_NAME); - /* adjust the textures for the sidedef visible from the lift */ + // adjust the textures for the sidedef visible from the lift strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); s = SideDefs[sd1].sector; if (Sectors[s].floorh > minh) @@ -168,34 +168,34 @@ strncpy(SideDefs[sd2].tex2, "-", WAD_TEX_NAME); } strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); - /* if the ceiling of the sector is lower than that of the lift */ + // if the ceiling of the sector is lower than that of the lift if (Sectors[s].ceilh < Sectors[sector].ceilh) { if (strncmp(SideDefs[sd2].tex1, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd2].tex1, cfg.def.upper_texture, WAD_TEX_NAME); } - /* if the floor of the sector is above the lift */ + // if the floor of the sector is above the lift if (Sectors[s].floorh >= Sectors[sector].floorh) { - LineDefs[n].type = 88; /* lower lift (walk through) */ - /* flip it, just for fun */ + LineDefs[n].type = 88; // lower lift (walk through) + // flip it, just for fun curs = NULL; SelectObject(&curs, n); FlipLineDefs(curs, 1); ForgetSelection(&curs); } - /* done with this linedef */ + // done with this linedef UnSelectObject(&ldok, n); } while (ld1s != NULL) { - /* these are the lift walls (one-sided) */ + // these are the lift walls (one-sided) n = ld1s->objnum; LineDefs[n].flags = 0x01; sd1 = LineDefs[n].sidedef1; - /* adjust the textures for the sidedef */ + // adjust the textures for the sidedef if (!strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd1].tex3, cfg.def.middle_texture, WAD_TEX_NAME); strncpy(SideDefs[sd1].tex1, "-", WAD_TEX_NAME);
--- a/src/s_merge.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_merge.cc Mon Oct 06 12:42:55 2014 +0300 @@ -40,16 +40,16 @@ merge two or more Sectors into one */ -void MergeSectors(SelPtr * slist) /* SWAP! */ +void MergeSectors(SelPtr * slist) // SWAP! { SelPtr cur; int n, olds, news; -/* save the first Sector number */ +// save the first Sector number news = (*slist)->objnum; UnSelectObject(slist, news); -/* change all SideDefs references to the other Sectors */ +// change all SideDefs references to the other Sectors for (cur = *slist; cur; cur = cur->next) { olds = cur->objnum; @@ -60,10 +60,10 @@ } } -/* delete the Sectors */ +// delete the Sectors DeleteObjects(OBJ_SECTORS, slist); -/* the returned list contains only the first Sector */ +// the returned list contains only the first Sector SelectObject(slist, news); } @@ -73,14 +73,14 @@ delete one or several two-sided LineDefs and join the two Sectors */ -void DeleteLineDefsJoinSectors(SelPtr * ldlist) /* SWAP! */ +void DeleteLineDefsJoinSectors(SelPtr * ldlist) // SWAP! { SelPtr cur, slist; int sd1, sd2; int s1, s2; char msg[80]; -/* first, do the tests for all LineDefs */ +// first, do the tests for all LineDefs for (cur = *ldlist; cur; cur = cur->next) { sd1 = LineDefs[cur->objnum].sidedef1; @@ -104,7 +104,7 @@ } } -/* then join the Sectors and delete the LineDefs */ +// then join the Sectors and delete the LineDefs for (cur = *ldlist; cur; cur = cur->next) { sd1 = LineDefs[cur->objnum].sidedef1;
--- a/src/s_misc.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_misc.cc Mon Oct 06 12:42:55 2014 +0300 @@ -44,7 +44,7 @@ Distribute sector floor heights */ -void DistributeSectorFloors(SelPtr obj) /* SWAP! */ +void DistributeSectorFloors(SelPtr obj) // SWAP! { SelPtr cur; int n, num, floor1h, floor2h; @@ -71,7 +71,7 @@ Distribute sector ceiling heights */ -void DistributeSectorCeilings(SelPtr obj) /* SWAP! */ +void DistributeSectorCeilings(SelPtr obj) // SWAP! { SelPtr cur; int n, num, ceil1h, ceil2h; @@ -201,7 +201,7 @@ } } - /* now look if this linedef has a sidedef bound to one sector */ + // now look if this linedef has a sidedef bound to one sector if (best_match < 0) return OBJ_NO_NONE; @@ -513,4 +513,4 @@ } } -/* end of file */ +// end of file
--- a/src/s_split.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_split.cc Mon Oct 06 12:42:55 2014 +0300 @@ -43,7 +43,7 @@ split a sector in two, adding a new linedef between the two vertices */ -void SplitSector(int vertex1, int vertex2) /* SWAP! */ +void SplitSector(int vertex1, int vertex2) // SWAP! { SelPtr llist; int curv, s, l, sd; @@ -54,7 +54,7 @@ * he did something about that in DETH. */ - /* Check if there is a sector between the two vertices (in the middle) */ + // Check if there is a sector between the two vertices (in the middle) Objid o; GetCurObject(o, OBJ_SECTORS, (Vertices[vertex1].x + Vertices[vertex2].x) / 2, @@ -142,9 +142,9 @@ delete[]ld_numbers; - /* now, the list of linedefs for the new sector is in llist */ + // now, the list of linedefs for the new sector is in llist - /* add the new sector, linedef and sidedefs */ + // add the new sector, linedef and sidedefs InsertObject(OBJ_SECTORS, s, 0, 0); InsertObject(OBJ_LINEDEFS, -1, 0, 0); LineDefs[NumLineDefs - 1].start = vertex1; @@ -158,7 +158,7 @@ LineDefs[NumLineDefs - 1].sidedef1 = NumSideDefs - 2; LineDefs[NumLineDefs - 1].sidedef2 = NumSideDefs - 1; - /* bind all linedefs in llist to the new sector */ + // bind all linedefs in llist to the new sector while (llist) { sd = LineDefs[llist->objnum].sidedef1; @@ -168,7 +168,7 @@ UnSelectObject(&llist, llist->objnum); } - /* second check... useful for sectors within sectors */ + // second check... useful for sectors within sectors for (l = 0; l < NumLineDefs; l++) { sd = LineDefs[l].sidedef1; @@ -197,12 +197,12 @@ split two linedefs, then split the sector and add a new linedef between the new vertices */ -void SplitLineDefsAndSector(int linedef1, int linedef2) /* SWAP! */ +void SplitLineDefsAndSector(int linedef1, int linedef2) // SWAP! { SelPtr llist; int s1, s2, s3, s4; - /* check if the two linedefs are adjacent to the same sector */ + // check if the two linedefs are adjacent to the same sector s1 = LineDefs[linedef1].sidedef1; s2 = LineDefs[linedef1].sidedef2; s3 = LineDefs[linedef2].sidedef1; @@ -229,13 +229,13 @@ return; } - /* split the two linedefs and create two new vertices */ + // split the two linedefs and create two new vertices llist = NULL; SelectObject(&llist, linedef1); SelectObject(&llist, linedef2); SplitLineDefs(llist); ForgetSelection(&llist); - /* split the sector and create a linedef between the two vertices */ + // split the sector and create a linedef between the two vertices SplitSector(NumVertices - 1, NumVertices - 2); }
--- a/src/selbox.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/selbox.cc Mon Oct 06 12:42:55 2014 +0300 @@ -91,7 +91,7 @@ DrawMapLine(x2, y2, x2, y1); DrawMapLine(x2, y1, x1, y1); SetDrawingMode(0); - /* Those are needed by undraw() */ + // Those are needed by undraw() x1_disp = x1; y1_disp = y1; x2_disp = x2;
--- a/src/selrect.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/selrect.cc Mon Oct 06 12:42:55 2014 +0300 @@ -38,7 +38,7 @@ select all objects inside a given box */ -void SelectObjectsInBox(SelPtr * list, int objtype, int x0, int y0, int x1, int y1) /* SWAP! */ +void SelectObjectsInBox(SelPtr * list, int objtype, int x0, int y0, int x1, int y1) // SWAP! { int n, m; @@ -72,7 +72,7 @@ case OBJ_LINEDEFS: for (n = 0; n < NumLineDefs; n++) { - /* the two ends of the line must be in the box */ + // the two ends of the line must be in the box m = LineDefs[n].start; if (Vertices[m].x < x0 || Vertices[m].x > x1 || Vertices[m].y < y0 || Vertices[m].y > y1)
--- a/src/t_prop.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/t_prop.cc Mon Oct 06 12:42:55 2014 +0300 @@ -259,7 +259,7 @@ for (;;) { - /* First let user select a thinggroup */ + // First let user select a thinggroup if (DisplayMenuList(x0 + 42, y0, "Select group", thinggroup, PrintThinggroup, &tgno) < 0) return 1; @@ -273,7 +273,7 @@ creates it manually. */ if (tg == THING_FREE) { - /* FIXME should be unsigned! should accept hex. */ + // FIXME should be unsigned! should accept hex. *number = InputIntegerValue(x0 + 84, y0 + BOX_BORDER + (3 + tgno) * FONTH, @@ -305,7 +305,7 @@ again: ; - /* DrawMap (OBJ_THINGS, 0, 0); FIXME! */ + // DrawMap (OBJ_THINGS, 0, 0); FIXME! } return 0; } @@ -361,4 +361,4 @@ } -/* end of file */ +// end of file
--- a/src/textures.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/textures.cc Mon Oct 06 12:42:55 2014 +0300 @@ -33,7 +33,7 @@ #include <X11/Xlib.h> #endif #include "dialog.h" -#include "game.h" /* yg_picture_format */ +#include "game.h" // yg_picture_format #include "gfx.h" #include "lists.h" #include "patchdir.h" @@ -52,7 +52,7 @@ return true; else { - /* Check for name that consists only of whitespace */ + // Check for name that consists only of whitespace const char *c = name; while (*c) { @@ -82,8 +82,8 @@ i16 npatches; // Number of patches in the textures i32 numtex; // number of texture names in TEXTURE* list i32 texofs; // Offset in the wad file to the texture data - char tname[WAD_TEX_NAME + 1]; /* texture name */ - char picname[WAD_PIC_NAME + 1]; /* wall patch name */ + char tname[WAD_TEX_NAME + 1]; // texture name + char picname[WAD_PIC_NAME + 1]; // wall patch name bool have_dummy_bytes; int header_size; int item_size;
--- a/src/things.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/things.cc Mon Oct 06 12:42:55 2014 +0300 @@ -94,7 +94,7 @@ for (al_lrewind(thinggroup); !al_leol(thinggroup); al_lstep(thinggroup)) { - if (CUR_THINGGROUP /* don't segfault if zero thinggroup ! */ + if (CUR_THINGGROUP // don't segfault if zero thinggroup ! && CUR_THINGGROUP->thinggroup == CUR_THINGDEF->thinggroup) { things_table[n].colour = CUR_THINGGROUP->acn;
--- a/src/v_merge.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/v_merge.cc Mon Oct 06 12:42:55 2014 +0300 @@ -36,14 +36,14 @@ #include "selectn.h" -typedef struct /* Used only by AutoMergeVertices() and SortLinedefs() */ +typedef struct // Used only by AutoMergeVertices() and SortLinedefs() { int vertexl; int vertexh; int linedefno; } linedef_t; -/* Called only by AutoMergeVertices() */ +// Called only by AutoMergeVertices() static int SortLinedefs(const void *item1, const void *item2); @@ -115,23 +115,23 @@ Notify(-1, -1, "You must select at least two vertices", NULL); return; } -/* change the linedefs starts & ends */ +// change the linedefs starts & ends for (l = 0; l < NumLineDefs; l++) { if (IsSelected(*list, LineDefs[l].start)) { - /* don't change a linedef that has both ends on the same spot */ + // don't change a linedef that has both ends on the same spot if (!IsSelected(*list, LineDefs[l].end) && LineDefs[l].end != v) LineDefs[l].start = v; } else if (IsSelected(*list, LineDefs[l].end)) { - /* idem */ + // idem if (LineDefs[l].start != v) LineDefs[l].end = v; } } -/* delete the vertices (and some linedefs too) */ +// delete the vertices (and some linedefs too) DeleteObjects(OBJ_VERTICES, list); MadeChanges = 1; MadeMapChanges = 1; @@ -177,13 +177,13 @@ else confirm_flag = YC_ASK_ONCE; -/* first, check if two (or more) vertices should be merged */ +// first, check if two (or more) vertices should be merged ref = *list; while (ref) { refv = ref->objnum; ref = ref->next; - /* check if there is a vertex at the same position (same X and Y) */ + // check if there is a vertex at the same position (same X and Y) for (v = 0; v < NumVertices; v++) if (v != refv && Vertices[refv].x == Vertices[v].x @@ -197,21 +197,21 @@ (-1, -1, &confirm_flag, buf, "Do you want to merge them into one?")) { - /* merge the two vertices */ + // merge the two vertices mergedone = true; cur = NULL; SelectObject(&cur, refv); SelectObject(&cur, v); MergeVertices(&cur); - /* update the references in the selection list */ + // update the references in the selection list for (cur = *list; cur; cur = cur->next) if (cur->objnum > refv) cur->objnum = cur->objnum - 1; if (v > refv) v--; - /* the old vertex has been deleted */ + // the old vertex has been deleted UnSelectObject(list, refv); - /* select the new vertex instead */ + // select the new vertex instead if (!IsSelected(*list, v)) SelectObject(list, v); break; @@ -221,7 +221,7 @@ } } -/* Now, check if one or more vertices are on a linedef */ +// Now, check if one or more vertices are on a linedef //DisplayMessage (-1, -1, "Checking vertices on a linedef"); // Distance in map units that is equivalent to 4 pixels @@ -238,12 +238,12 @@ ref = ref->next; oldnumld = NumLineDefs; //printf ("V%d %d\n", refv, NumLineDefs); // DEBUG; - /* check if this vertex is on a linedef */ + // check if this vertex is on a linedef for (ld = 0; ld < oldnumld; ld++) { if (LineDefs[ld].start == refv || LineDefs[ld].end == refv) { - /* one vertex had a linedef bound to it -- check it later */ + // one vertex had a linedef bound to it -- check it later isldend = true; } else if (IsLineDefInside(ld, Vertices[refv].x - tolerance, @@ -257,7 +257,7 @@ if (Confirm2(-1, -1, &confirm_flag, buf, "Do you want to split the linedef there?")) { - /* split the linedef */ + // split the linedef mergedone = true; InsertObject(OBJ_LINEDEFS, ld, 0, 0); LineDefs[ld].end = refv; @@ -283,11 +283,11 @@ } } -/* Don't continue if this isn't necessary */ +// Don't continue if this isn't necessary if (!isldend || !mergedone) return redraw; -/* finally, test if two linedefs are between the same pair of vertices */ +// finally, test if two linedefs are between the same pair of vertices /* AYM 1997-07-17 Here I put a new algorithm. The original one led to a very large number of tests (N*(N-1)/2 where N is number of linedefs). For @@ -310,7 +310,7 @@ { linedef_t *linedefs; -/* Copy the linedefs into array 'linedefs' and sort it */ +// Copy the linedefs into array 'linedefs' and sort it linedefs = (linedef_t *) GetMemory(NumLineDefs * sizeof(linedef_t)); for (ld = 0; ld < NumLineDefs; ld++) { @@ -322,7 +322,7 @@ } qsort(linedefs, NumLineDefs, sizeof(linedef_t), SortLinedefs); -/* Search for superimposed linedefs in the array */ +// Search for superimposed linedefs in the array for (ld = 0; ld + 1 < NumLineDefs; ld++) { if (linedefs[ld + 1].vertexl != linedefs[ld].vertexl @@ -340,12 +340,12 @@ { LDPtr ldo = LineDefs + ld1; LDPtr ldn = LineDefs + ld2; - /* Test if the linedefs have the same orientation */ + // Test if the linedefs have the same orientation if (ldn->start == ldo->end) flipped = true; else flipped = false; - /* Merge linedef ldo (ld) into linedef ldn (ld+1) */ + // Merge linedef ldo (ld) into linedef ldn (ld+1) /* FIXME When is this done ? Most of the time when adding a door/corridor/window between two rooms, right ? So we should handle this in a smarter way by copying middle texture into
--- a/src/wads2.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/wads2.cc Mon Oct 06 12:42:55 2014 +0300 @@ -29,7 +29,7 @@ #include "yadex.h" -#include "game.h" /* yg_picture_format */ +#include "game.h" // yg_picture_format #include "serialnum.h" #include "wadfile.h" #include "wadlist.h" @@ -55,7 +55,7 @@ long n; Wad_file *wf; - /* open the wad file */ + // open the wad file printf("Loading iwad: %s...\n", filename); wf = BasicWadOpen(filename, yg_picture_format); if (wf == 0) @@ -64,7 +64,7 @@ warn("%.128s: is a pwad, not an iwad. Will use it anyway.\n", filename); - /* create the master directory */ + // create the master directory lastp = NULL; for (n = 0; n < wf->dirsize; n++) { @@ -80,7 +80,7 @@ } cfg.master_dir_serial.bump(); - /* check if registered version */ + // check if registered version if (FindMasterDir(cfg.MasterDir, "E2M1") == NULL && FindMasterDir(cfg.MasterDir, "MAP01") == NULL && FindMasterDir(cfg.MasterDir, "MAP33") == NULL @@ -129,7 +129,7 @@ return 1; } -/* open the wad file */ +// open the wad file printf("Loading pwad: %s...\n", real_name); // By default, assume pwads use the normal picture format. wad = BasicWadOpen(real_name, YGPF_NORMAL); @@ -140,7 +140,7 @@ warn("%.128s: is an iwad, not a pwad. Will use it anyway.\n", filename); -/* alter the master directory */ +// alter the master directory /* AYM: now, while the directory is scanned, a state variable is updated. its values are : @@ -209,7 +209,7 @@ { mdir = FindMasterDir(cfg.MasterDir, entryname); replaces = mdir != NULL; - /* if it is a level, do the same thing for the next 10 entries too */ + // if it is a level, do the same thing for the next 10 entries too if (levelname2levelno(entryname)) { state = 11; @@ -306,7 +306,7 @@ nitems++; } - /* if this entry is not in the master directory, then add it */ + // if this entry is not in the master directory, then add it if (!replaces) { mdir = cfg.MasterDir; @@ -316,7 +316,7 @@ mdir = mdir->next; mdir->next = NULL; } - /* else, simply replace it */ + // else, simply replace it mdir->wadfile = wad; memcpy(&(mdir->dir), &(wad->directory[n]), sizeof(struct Directory)); mdir = mdir->next; @@ -599,7 +599,7 @@ long dirstart; long dirnum; -/* open the file and store signatures */ +// open the file and store signatures if (patchonly) printf("Building a compound Patch Wad file \"%s\".\n", filename); else @@ -623,10 +623,10 @@ else WriteBytes(file, "IWAD", 4); - file_write_i32(file, 0xdeadbeef); /* put true value in later */ - file_write_i32(file, 0xdeadbeef); /* put true value in later */ + file_write_i32(file, 0xdeadbeef); // put true value in later + file_write_i32(file, 0xdeadbeef); // put true value in later -/* output the directory data chunks */ +// output the directory data chunks const Wad_file *iwad = 0; // FIXME unreliable way of knowing the iwad wad_list.rewind(); // got to look into this wad_list.get(iwad); @@ -644,7 +644,7 @@ printf("Size: %luK\r", counter / 1024); } -/* output the directory */ +// output the directory dirstart = counter; counter = 12; dirnum = 0; @@ -664,13 +664,13 @@ dirnum++; } -/* fix up the number of entries and directory start information */ +// fix up the number of entries and directory start information if (fseek(file, 4L, 0)) fatal_error("error writing to file"); file_write_i32(file, dirnum); file_write_i32(file, dirstart); -/* close the file */ +// close the file printf(" \r"); fclose(file); } @@ -912,7 +912,7 @@ */ -/* Directories that are searched for PWADs */ +// Directories that are searched for PWADs static const char *standard_directories[] = { "", "~/", // "~" means "the user's home directory" @@ -987,4 +987,4 @@ } -/* end of file */ +// end of file
--- a/src/x11.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/x11.cc Mon Oct 06 12:42:55 2014 +0300 @@ -105,4 +105,4 @@ } -#endif /* DO NOT ADD ANYTHING AFTER THIS LINE */ +#endif // DO NOT ADD ANYTHING AFTER THIS LINE
--- a/src/x_hover.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/x_hover.cc Mon Oct 06 12:42:55 2014 +0300 @@ -219,7 +219,7 @@ // The linedef is rather vertical else { - /* Are we above the high end or below the low end or in between ? */ + // Are we above the high end or below the low end or in between ? if (y < (dy > 0 ? y0 : y1)) dist = hypot(x - (dy > 0 ? x0 : x1), y - (dy > 0 ? y0 : y1)); else @@ -388,7 +388,7 @@ object.nil(); for (int n = 0; n < NumVertices; n++) { - /* Filter out objects that are farther than <radius> units away. */ + // Filter out objects that are farther than <radius> units away. if (Vertices[n].x < xmin || Vertices[n].x > xmax || Vertices[n].y < ymin || Vertices[n].y > ymax)
--- a/src/x_mirror.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/x_mirror.cc Mon Oct 06 12:42:55 2014 +0300 @@ -128,7 +128,7 @@ delete vert; } - /* Things: flip/mirror the things. */ + // Things: flip/mirror the things. else if (obj_type == OBJ_THINGS) { /* Determine the geometric centre
--- a/src/x_rotate.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/x_rotate.cc Mon Oct 06 12:42:55 2014 +0300 @@ -61,7 +61,7 @@ rotate and scale a group of objects around the centre of gravity */ -void RotateAndScaleObjects(int objtype, SelPtr obj, double angle, double scale) /* SWAP! */ +void RotateAndScaleObjects(int objtype, SelPtr obj, double angle, double scale) // SWAP! { int dx, dy; int centerx, centery;
--- a/src/yadex.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/yadex.cc Mon Oct 06 12:42:55 2014 +0300 @@ -33,18 +33,18 @@ #include "acolours.h" #include "bench.h" #include "cfgfile.h" -#include "disppic.h" /* Because of "p" */ +#include "disppic.h" // Because of "p" #include "editlev.h" #include "endian.h" #include "flats.h" #include "game.h" #include "gfx.h" #include "help1.h" -#include "levels.h" /* Because of "viewtex" */ +#include "levels.h" // Because of "viewtex" #include "lists.h" #include "mkpalette.h" #include "palview.h" -#include "patchdir.h" /* Because of "p" */ +#include "patchdir.h" // Because of "p" #include "rgb.h" #include "sanity.h" #include "textures.h" @@ -345,17 +345,17 @@ OpenPatchWad(*pwad_name); } - /* sanity check */ + // sanity check CloseUnusedWadFiles(); - /* BRANCH 1 : benchmarking (-b) */ + // BRANCH 1 : benchmarking (-b) if (cfg.bench != NULL) { benchmark(cfg.bench); return 0; // Exit successfully } - /* BRANCH 2 : normal use ("yadex:" prompt) */ + // BRANCH 2 : normal use ("yadex:" prompt) else { if (cfg.welcome_message) @@ -376,11 +376,11 @@ "etc. are missing or wrong. And be careful, there might be bugs.\n\n"); } - /* all systems go! */ + // all systems go! MainLoop(); } - /* that's all, folks! */ + // that's all, folks! CloseWadFiles(); FreeGameDefs(); LogMessage(": The end!\n\n\n"); @@ -551,7 +551,7 @@ if (cfg.debug && cfg.logfile != NULL) { va_start(args, logstr); - /* if the message begins with ":", output the current date & time first */ + // if the message begins with ":", output the current date & time first if (logstr[0] == ':') { time(&tval); @@ -560,7 +560,7 @@ fprintf(cfg.logfile, "%s", tstr); } vfprintf(cfg.logfile, logstr, args); - fflush(cfg.logfile); /* AYM 19971031 */ + fflush(cfg.logfile); // AYM 19971031 } } @@ -632,7 +632,7 @@ for (;;) { - /* get the input */ + // get the input #ifdef Y_READLINE input = readline("yadex: "); add_history(input); @@ -644,25 +644,25 @@ break; } - /* Strip the trailing '\n' */ + // Strip the trailing '\n' if (strlen(input) > 0 && input[strlen(input) - 1] == '\n') input[strlen(input) - 1] = '\0'; #endif - /* eat the white space and get the first command word */ + // eat the white space and get the first command word com = strtok(input, " "); - /* user just hit return */ + // user just hit return if (com == NULL) printf("Please enter a command or ? for help.\n"); - /* user inputting for help */ + // user inputting for help else if (!strcmp(com, "?") || !strcmp(com, "h") || !strcmp(com, "help")) { PrintHelp(); } - /* user asked for list of open wad files */ + // user asked for list of open wad files else if (!strcmp(com, "wads") || !strcmp(com, "w")) { const Wad_file *wf; @@ -678,7 +678,7 @@ } } - /* user asked to quit */ + // user asked to quit else if (!strcmp(com, "quit") || !strcmp(com, "q")) { if (!cfg.registered) @@ -686,7 +686,7 @@ break; } - /* user asked to edit a level */ + // user asked to edit a level else if (!strcmp(com, "edit") || !strcmp(com, "e") || !strcmp(com, "create") || !strcmp(com, "c")) { @@ -729,7 +729,7 @@ EditLevel(level_name, newlevel); } - /* user asked to build a new main wad file */ + // user asked to build a new main wad file else if (strcmp(com, "build") == 0 || strcmp(com, "b") == 0) { com = strtok(NULL, " "); @@ -746,7 +746,7 @@ BuildNewMainWad(com, 0); } - /* user asked to build a compound patch wad file */ + // user asked to build a compound patch wad file else if (strcmp(com, "group") == 0 || strcmp(com, "g") == 0) { wad_list.rewind(); @@ -771,7 +771,7 @@ BuildNewMainWad(com, 1); } - /* user ask for a listing of a wad file */ + // user ask for a listing of a wad file else if (strcmp(com, "list") == 0 || strcmp(com, "l") == 0) { com = strtok(NULL, " "); @@ -802,7 +802,7 @@ ListFileDirectory(stdout, wf); } - /* user asked for the list of the master directory */ + // user asked for the list of the master directory else if (strcmp(com, "master") == 0 || strcmp(com, "m") == 0) { out = strtok(NULL, " "); @@ -856,13 +856,13 @@ make_palette_ppm_2(0, out); } - /* user asked to list all options and their values */ + // user asked to list all options and their values else if (strcmp(com, "set") == 0) { dump_parameters(stdout); } - /* user asked to read a new patch wad file */ + // user asked to read a new patch wad file else if (strcmp(com, "read") == 0 || strcmp(com, "r") == 0) { com = strtok(NULL, " "); @@ -880,7 +880,7 @@ CloseUnusedWadFiles(); } - /* user asked to dump the contents of a wad file */ + // user asked to dump the contents of a wad file else if (strcmp(com, "dump") == 0 || strcmp(com, "d") == 0) { com = strtok(NULL, " "); @@ -1037,7 +1037,7 @@ viewtex_end:; } - /* user asked to save an object to a separate pwad file */ + // user asked to save an object to a separate pwad file else if (strcmp(com, "save") == 0 || strcmp(com, "s") == 0) { com = strtok(NULL, " "); @@ -1069,7 +1069,7 @@ fclose(file); } - /* user asked to encapsulate a raw file in a pwad file */ + // user asked to encapsulate a raw file in a pwad file else if (strcmp(com, "insert") == 0 || strcmp(com, "i") == 0) { com = strtok(NULL, " "); @@ -1091,7 +1091,7 @@ } if ((raw = fopen(com, "rb")) == NULL) fatal_error("error opening input file \"%s\"", com); - /* kluge */ + // kluge strcpy(input, out); strcat(input, ".wad"); if (wad_already_loaded(input)) @@ -1107,7 +1107,7 @@ fclose(file); } - /* user asked to extract an object to a raw binary file */ + // user asked to extract an object to a raw binary file else if (strcmp(com, "xtract") == 0 || strcmp(com, "extract") == 0 || strcmp(com, "x") == 0) { @@ -1143,7 +1143,7 @@ fclose(file); } - /* unknown command */ + // unknown command else printf("Unknown command \"%s\"!\n", com);
--- a/src/ytime.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/ytime.cc Mon Oct 06 12:42:55 2014 +0300 @@ -49,7 +49,7 @@ return 0; } return tv.tv_sec * 1000 + tv.tv_usec / 1000; -#else /* Sucks ! */ +#else // Sucks ! static const double ms_per_clock = 1000.0 / CLOCKS_PER_SEC; return (unsigned long) (clock() * ms_per_clock); #endif