From 7adf0ff1fcd4e22c957455bb4ab7e24dc7a07e72 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 8 Oct 2003 06:58:34 +0000 Subject: Some more cosmetic changes while I'm considering the next move. (Or maybe I'm just hoping that if I stall long enough, someone else will make the move for me. :-) svn-id: r10676 --- sword2/build_display.cpp | 62 +++++++++++++++++----------------------------- sword2/build_display.h | 2 +- sword2/console.cpp | 4 +-- sword2/driver/_console.cpp | 10 ++++---- sword2/driver/_mouse.cpp | 2 +- sword2/driver/d_sound.cpp | 2 +- sword2/driver/menu.cpp | 2 +- sword2/mouse.cpp | 4 +-- sword2/save_rest.cpp | 2 +- sword2/walker.cpp | 2 +- 10 files changed, 38 insertions(+), 54 deletions(-) (limited to 'sword2') diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp index a0c3abfabc..60f122e641 100644 --- a/sword2/build_display.cpp +++ b/sword2/build_display.cpp @@ -244,7 +244,7 @@ void Build_display(void) { // walkgrid, mouse & player markers & mouse area // rectangle - Draw_debug_graphics(); // JAMES (08apr97) + Draw_debug_graphics(); // --------------------------------------------------- // text blocks @@ -408,31 +408,25 @@ void RemoveMsg(void) { } void Send_back_par0_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_bgp0; j++) { + for (uint i = 0; i < cur_bgp0; i++) { // frame attached to 1st background parallax - Process_image(&bgp0_list[j]); + Process_image(&bgp0_list[i]); } } void Send_back_par1_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_bgp1; j++) { - // frame attached to 1nd background parallax - Process_image(&bgp1_list[j]); + for (uint i = 0; i < cur_bgp1; i++) { + // frame attached to 2nd background parallax + Process_image(&bgp1_list[i]); } } void Send_back_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_back; j++) { - Process_image(&back_list[j]); + for (uint i = 0; i < cur_back; i++) { + Process_image(&back_list[i]); } } @@ -440,48 +434,40 @@ void Send_sort_frames(void) { // send the sort frames for printing - layers, shrinkers & normal flat // sprites - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_sort; j++) { - if (sort_list[sort_order[j]].layer_number) { + for (uint i = 0; i < cur_sort; i++) { + if (sort_list[sort_order[i]].layer_number) { // its a layer - minus 1 for true layer number // we need to know from the buildit because the layers // will have been sorted in random order - Process_layer(sort_list[sort_order[j]].layer_number - 1); + Process_layer(sort_list[sort_order[i]].layer_number - 1); } else { // sprite - Process_image(&sort_list[sort_order[j]]); + Process_image(&sort_list[sort_order[i]]); } } } void Send_fore_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_fore; j++) { - Process_image(&fore_list[j]); + for (uint i = 0; i < cur_fore; i++) { + Process_image(&fore_list[i]); } } void Send_fore_par0_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_fgp0; j++) { + for (uint i = 0; i < cur_fgp0; i++) { // frame attached to 1st foreground parallax - Process_image(&fgp0_list[j]); + Process_image(&fgp0_list[i]); } } void Send_fore_par1_frames(void) { - uint32 j; - // could be none at all - theoretically at least - for (j = 0; j < cur_fgp1; j++) { + for (uint i = 0; i < cur_fgp1; i++) { // frame attached to 2nd foreground parallax - Process_image(&fgp1_list[j]); + Process_image(&fgp1_list[i]); } } @@ -633,7 +619,6 @@ void Process_image(buildit *build_unit) { } #endif - #ifdef _SWORD2_DEBUG if (SYSTEM_TESTING_ANIMS) { // see anims.cpp // bring the anim into the visible screen @@ -691,8 +676,8 @@ void Reset_render_lists(void) { if (cur_sort) { // there are some layers - so rebuild the sort order // positioning - for (uint j = 0; j < cur_sort; j++) - sort_order[j] = j; //rebuild the order list + for (uint i = 0; i < cur_sort; i++) + sort_order[i] = i; //rebuild the order list } } @@ -705,7 +690,6 @@ void Sort_the_sort_list(void) { for (uint i = 0; i < cur_sort - 1; i++) { for (uint j = 0; j < cur_sort - 1; j++) { - //this > next then swap if (sort_list[sort_order[j]].sort_y > sort_list[sort_order[j + 1]].sort_y) { SWAP(sort_order[j], sort_order[j + 1]); } @@ -819,7 +803,7 @@ void Register_frame(int32 *params, buildit *build_unit) { // passed a mouse structure, so add to the mouse_list ob_mouse = (Object_mouse *) params[0]; - // only if 'pointer' isn't NULL (James13feb97) + // only if 'pointer' isn't NULL if (ob_mouse->pointer) { #ifdef _SWORD2_DEBUG if (cur_mouse == TOTAL_mouse_list) @@ -866,7 +850,7 @@ int32 FN_register_frame(int32 *params) { // 1 pointer to graphic structure // 2 pointer to mega structure or NULL if not a mega - Object_graphic *ob_graph = (Object_graphic *) params[1]; + Object_graphic *ob_graph = (Object_graphic *) params[1]; // check low word for sprite type switch (ob_graph->type & 0x0000ffff) { @@ -1080,7 +1064,7 @@ void SetFullPalette(int32 palRes) { Con_fatal_error("FN_set_palette() called with invalid resource!"); #endif - file = (uint8*) (head + 1); + file = (uint8 *) (head + 1); // always set colour 0 to black because most background screen // palettes have a bright colour 0 although it should come out diff --git a/sword2/build_display.h b/sword2/build_display.h index c60539cb71..f318fcd110 100644 --- a/sword2/build_display.h +++ b/sword2/build_display.h @@ -83,7 +83,7 @@ extern char largest_sprite_info[128]; // the only build list needed externally - by layers.cpp - for adding layers // to sort list -extern buildit sort_list[]; +extern buildit sort_list[]; // function prototypes needed externally diff --git a/sword2/console.cpp b/sword2/console.cpp index 62b221c0b9..5f125ff117 100644 --- a/sword2/console.cpp +++ b/sword2/console.cpp @@ -393,7 +393,7 @@ uint32 Parse_user_input(void) { // quick check for numbers here if (!isalpha(console_buffer[0])) { Print_to_console("Eh?"); - return(0); + return 0; } j = 0; @@ -599,7 +599,7 @@ uint32 Parse_user_input(void) { return 0; case 35: // VERSION Con_display_version(); - return(0); + return 0; case 36: // SOFT case 37: // HARD // ScummVM doesn't distinguish between diff --git a/sword2/driver/_console.cpp b/sword2/driver/_console.cpp index 34c9db0c18..bf711febe1 100644 --- a/sword2/driver/_console.cpp +++ b/sword2/driver/_console.cpp @@ -109,7 +109,7 @@ int32 OpenConsole(void) warning("stub OpenConsole"); /* if (consoleStatus) - return(RDERR_ALREADYOPEN); + return RDERR_ALREADYOPEN; if (consoleSprite == NULL) { @@ -119,13 +119,13 @@ int32 OpenConsole(void) } if (consoleSprite == NULL) - return(RDERR_OUTOFMEMORY); + return RDERR_OUTOFMEMORY; memset(consoleSprite, 0, consoleSize); */ consoleStatus = 1; - return(RD_OK); + return RD_OK; } @@ -137,14 +137,14 @@ int32 CloseConsole(void) { if (!consoleStatus) - return(RDERR_ALREADYCLOSED); + return RDERR_ALREADYCLOSED; free(consoleSprite); consoleSprite = NULL; consoleStatus = 0; - return(RD_OK); + return RD_OK; } diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp index dbd0632e68..abf1137186 100644 --- a/sword2/driver/_mouse.cpp +++ b/sword2/driver/_mouse.cpp @@ -296,7 +296,7 @@ int32 SetLuggageAnim(uint8 *ma, int32 size) { if (ma) { luggageAnim = (_mouseAnim *) malloc(size); if (!luggageAnim) - return(RDERR_OUTOFMEMORY); + return RDERR_OUTOFMEMORY; memcpy((uint8 *) luggageAnim, ma, size); luggageOffset = (int32 *) ((uint8 *) luggageAnim + sizeof(_mouseAnim)); diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index 856cddf8c6..acb3c01d18 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -1053,7 +1053,7 @@ int32 Sound::dipMusic() { } } - return (hr); + return hr; */ } diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index 4f03aa3e9b..983113d54b 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -240,7 +240,7 @@ int32 ShowMenu(uint8 menu) { int32 HideMenu(uint8 menu) { // Check for invalid menu parameter if (menu > RDMENU_BOTTOM) - return(RDERR_INVALIDMENU); + return RDERR_INVALIDMENU; // Check that the menu is not currently hidden, or in the process of // being hidden. diff --git a/sword2/mouse.cpp b/sword2/mouse.cpp index b066122582..49b0d63384 100644 --- a/sword2/mouse.cpp +++ b/sword2/mouse.cpp @@ -853,7 +853,7 @@ uint32 Check_mouse_list(void) { CreatePointerText(mouse_list[j].pointer_text, mouse_list[j].pointer); // return pointer type - return(mouse_list[j].pointer); + return mouse_list[j].pointer; } j++; @@ -1329,7 +1329,7 @@ int32 FN_set_object_held(int32 *params) { int32 FN_remove_chooser(int32 *params) { HideMenu(RDMENU_BOTTOM); - return(IR_CONT); + return IR_CONT; } int32 FN_disable_menu(int32 *params) { diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp index 5047a6c481..9a2756ace8 100644 --- a/sword2/save_rest.cpp +++ b/sword2/save_rest.cpp @@ -163,7 +163,7 @@ uint32 SaveGame(uint16 slotNo, uint8 *desc) { uint32 FindBufferSize(void) { // size of savegame header + size of global variables - return (sizeof(g_header) + res_man.fetchLen(1)); + return sizeof(g_header) + res_man.fetchLen(1); } void FillSaveBuffer(mem *buffer, uint32 size, uint8 *desc) { diff --git a/sword2/walker.cpp b/sword2/walker.cpp index 311cee2b54..0f1d2bdde2 100644 --- a/sword2/walker.cpp +++ b/sword2/walker.cpp @@ -170,7 +170,7 @@ int32 FN_walk(int32 *params) { RESULT = 0; // 0 means ok // continue the script so that RESULT can be checked! - return(IR_CONT); + return IR_CONT; } // get pointer to walkanim & current frame position -- cgit v1.2.3