Changeset 533
- Timestamp:
- 07/03/12 21:18:53 (11 months ago)
- Location:
- branches/workbranch/trunk
- Files:
-
- 21 modified
-
3dc/RimLoader.cpp (modified) (2 diffs)
-
3dc/RingBuffer.cpp (modified) (2 diffs)
-
3dc/avp/BH_ALIEN.cpp (modified) (1 diff)
-
3dc/avp/CDTrackSelection.cpp (modified) (1 diff)
-
3dc/avp/Hud.cpp (modified) (2 diffs)
-
3dc/avp/win95/Projload.cpp (modified) (3 diffs)
-
3dc/avp/win95/USR_IO.cpp (modified) (21 diffs)
-
3dc/avp/win95/winmain.cpp (modified) (9 diffs)
-
3dc/d3d_render.cpp (modified) (9 diffs)
-
3dc/logString.cpp (modified) (2 diffs)
-
3dc/logstring.h (modified) (1 diff)
-
3dc/utilities.cpp (modified) (2 diffs)
-
3dc/win95/CD_player.cpp (modified) (30 diffs)
-
3dc/win95/CD_player.h (modified) (7 diffs)
-
3dc/win95/VideoModes.cpp (modified) (2 diffs)
-
3dc/win95/chnkload.cpp (modified) (1 diff)
-
3dc/win95/huffman.cpp (modified) (19 diffs)
-
tools/installer/avpx.iss (modified) (2 diffs)
-
win32/Di_func.cpp (modified) (7 diffs)
-
win32/VS2010/AvP.vcxproj (modified) (2 diffs)
-
win32/d3_func.cpp (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/workbranch/trunk/3dc/RimLoader.cpp
r527 r533 56 56 bool RimLoader::Decode(uint8_t *dest, uint32_t destPitch) 57 57 { 58 if (!dest) 58 if (!dest) { 59 59 return false; 60 } 60 61 61 62 this->dest = dest; … … 261 262 262 263 /* 263 after parsing and uncompacting if necessary, you will have N planes of pixel data. Color register used for 264 each pixel is specified by looking at each pixel thru the planes. I.e., if you have 5 planes, and the bit for 265 a particular pixel is set in planes 264 after parsing and uncompacting if necessary, you will have N planes of pixel data. Color register used for 265 each pixel is specified by looking at each pixel thru the planes. I.e., if you have 5 planes, and the bit for 266 a particular pixel is set in planes 266 267 0 and 3: 267 268 -
branches/workbranch/trunk/3dc/RingBuffer.cpp
r416 r533 106 106 // standard logic - buffers have a gap, work out readable space between them 107 107 readableSpace = writePos - readPos; 108 if (readableSpace < 0) 108 if (readableSpace < 0) { 109 109 readableSpace += bufferCapacity; 110 } 110 111 } 111 112 … … 185 186 186 187 // is first size big enough to hold all our data? 187 if (firstSize > srcDataSize) 188 if (firstSize > srcDataSize) { 188 189 firstSize = srcDataSize; 190 } 189 191 190 192 // first part. from write cursor to end of buffer -
branches/workbranch/trunk/3dc/avp/BH_ALIEN.cpp
r435 r533 1948 1948 { 1949 1949 /* More complex. Affected by alien type and health. */ 1950 NPC_DATA *NpcData ;1950 NPC_DATA *NpcData = 0; 1951 1951 int prefactor; 1952 1952 -
branches/workbranch/trunk/3dc/avp/CDTrackSelection.cpp
r531 r533 87 87 88 88 // skip to the next non numerical character 89 while (*buffer >='0' && *buffer<='9') {89 while (*buffer >= '0' && *buffer <= '9') { 90 90 buffer++; 91 91 } -
branches/workbranch/trunk/3dc/avp/Hud.cpp
r502 r533 47 47 #include "language.h" 48 48 #include "tables.h" 49 #include "assert.h" 49 50 50 51 #define DO_PREDATOR_OVERLAY FALSE … … 2052 2053 while (CameraZoomScale<=ZoomLevels[++i]); 2053 2054 2055 assert(i < 4); 2056 2054 2057 deltaZoom = (ZoomLevels[i-1] - ZoomLevels[i])*(float)NormalFrameTime/32768.0f; 2055 2058 // textprint("deltaZoom %f, zone %d\n",deltaZoom,i); -
branches/workbranch/trunk/3dc/avp/win95/Projload.cpp
r527 r533 78 78 79 79 // these are to link with chnkimag.cpp 80 const char * ToolsTex_Directory = "//Kate/Kate Share/avp/ToolsTex/";81 const char * GenTex_Directory = "//Kate/Kate Share/avp/GenG-Tex/";82 const char * SubShps_Directory = "SubShps/All/";80 const char *ToolsTex_Directory = "//Kate/Kate Share/avp/ToolsTex/"; 81 const char *GenTex_Directory = "//Kate/Kate Share/avp/GenG-Tex/"; 82 const char *SubShps_Directory = "SubShps/All/"; 83 83 // const char * GenTex_Directory = 0; 84 const char * FixTex_Directory = "//Kate/Kate Share/avp/Fix-Tex/";85 const char * GameTex_Directory = "//Kate/Kate Share/avp/game-tex/";84 const char *FixTex_Directory = "//Kate/Kate Share/avp/Fix-Tex/"; 85 const char *GameTex_Directory = "//Kate/Kate Share/avp/game-tex/"; 86 86 // new directories for new-style graphics - to be determined properly 87 char const * FirstTex_Directory = "Graphics"; // currently relative to cwd88 char const * SecondTex_Directory = 0; // will be the src safe shadow for development builds87 char const *FirstTex_Directory = "Graphics"; // currently relative to cwd 88 char const *SecondTex_Directory = 0; // will be the src safe shadow for development builds 89 89 //used for cd graphics directory in final version 90 90 91 char *Rif_Sound_Directory = 0;//set for the main level rif92 93 static char * light_set_name = "NORMALLT";94 95 static Object_Chunk * *o_chunk_array;96 static int * aimodule_indeces; //array parallel to o_chunk_array97 98 99 void setup_preplaced_decals(File_Chunk * fc,Environment_Data_Chunk*edc);91 char *Rif_Sound_Directory = 0;//set for the main level rif 92 93 static char *light_set_name = "NORMALLT"; 94 95 static Object_Chunk **o_chunk_array; 96 static int *aimodule_indeces; //array parallel to o_chunk_array 97 98 99 void setup_preplaced_decals(File_Chunk *fc, Environment_Data_Chunk *edc); 100 100 ///////////////////////////////////////// 101 101 // Functions which operate on RIFFHANDLEs … … 104 104 void setup_start_position(RIFFHANDLE h) 105 105 { 106 Chunk * pChunk = h->envd->lookup_single_child("SPECLOBJ");107 AVP_Player_Start_Chunk * start_chunk=0;106 Chunk *pChunk = h->envd->lookup_single_child("SPECLOBJ"); 107 AVP_Player_Start_Chunk *start_chunk = 0; 108 108 if (pChunk) 109 109 { … … 276 276 } 277 277 int aimodule_index=aimodule_indeces[module_index]; 278 279 278 280 279 PATHHEADER* path=&PathArray[path_index]; -
branches/workbranch/trunk/3dc/avp/win95/USR_IO.cpp
r527 r533 35 35 void MaintainZoomingLevel(void); 36 36 37 // Extern for global keyboard buffer 38 extern unsigned char KeyboardInput[]; 39 extern unsigned char DebouncedKeyboardInput[]; 40 extern int GotJoystick; 41 extern bool GotMouse; 42 extern BOOL GotXPad; 43 44 // XInput value externs 45 extern int xPadLookX; 46 extern int xPadLookY; 47 extern int xPadMoveX; 48 extern int xPadMoveY; 49 50 extern int CameraZoomLevel; 51 extern int MouseVelX; 52 extern int MouseVelY; 53 extern JOYINFOEX JoystickData; 54 extern JOYCAPS JoystickCaps; 55 56 extern void save_preplaced_decals(); 57 37 58 FIXED_INPUT_CONFIGURATION FixedInputConfig = 38 59 { … … 48 69 KEY_0, // Weapon10; 49 70 KEY_ESCAPE, // PauseGame; 50 51 71 }; 52 72 … … 1016 1036 }; 1017 1037 1018 /* Extern for global keyboard buffer */1019 extern unsigned char KeyboardInput[];1020 extern unsigned char DebouncedKeyboardInput[];1021 extern int GotJoystick;1022 extern int GotMouse;1023 extern BOOL GotXPad;1024 1025 /* XInput value externs */1026 extern int xPadLookX;1027 extern int xPadLookY;1028 extern int xPadMoveX;1029 extern int xPadMoveY;1030 1031 1038 /* initialise the player input structure(s) in the player_status block */ 1032 1039 void InitPlayerGameInput(STRATEGYBLOCK* sbPtr) … … 1034 1041 PLAYER_STATUS *playerStatusPtr; 1035 1042 1036 /* get the player status block ... */ 1037 playerStatusPtr = (PLAYER_STATUS *) (sbPtr->SBdataptr); 1038 LOCALASSERT(playerStatusPtr); 1039 1043 /* get the player status block ... */ 1044 playerStatusPtr = (PLAYER_STATUS *) (sbPtr->SBdataptr); 1045 LOCALASSERT(playerStatusPtr); 1040 1046 1041 1047 /* analogue type inputs */ … … 1053 1059 /* KJL 14:23:54 8/7/97 - default to run */ 1054 1060 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Faster = 1; 1055 1056 1061 } 1057 1062 … … 1066 1071 PLAYER_STATUS *playerStatusPtr; 1067 1072 1068 /* get the player status block ... */1069 playerStatusPtr = (PLAYER_STATUS *) (sbPtr->SBdataptr);1070 LOCALASSERT(playerStatusPtr);1073 /* get the player status block ... */ 1074 playerStatusPtr = (PLAYER_STATUS *) (sbPtr->SBdataptr); 1075 LOCALASSERT(playerStatusPtr); 1071 1076 1072 1077 /* start off by initialising the inputs */ … … 1097 1102 if (IOFOCUS_AcceptControls() && !InGameMenusAreRunning() && (!(IOFOCUS_Get() & IOFOCUS_NEWCONSOLE))) 1098 1103 { 1099 /* now do forward,backward,left,right,up and down 1100 IMPORTANT: The request flag and the movement 1104 /* now do forward,backward,left,right,up and down 1105 IMPORTANT: The request flag and the movement 1101 1106 increment must BOTH be set! 1102 1107 */ … … 1105 1110 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Forward = 1; 1106 1111 playerStatusPtr->Mvt_MotionIncrement = ONE_FIXED; 1107 } 1112 } 1108 1113 if (KeyboardInput[primaryInput->Backward] || KeyboardInput[secondaryInput->Backward]) 1109 1114 { … … 1127 1132 } 1128 1133 if (KeyboardInput[primaryInput->StrafeRight] || KeyboardInput[secondaryInput->StrafeRight]) 1129 { 1134 { 1130 1135 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_SideStepRight = 1; 1131 1136 playerStatusPtr->Mvt_SideStepIncrement = ONE_FIXED; … … 1133 1138 if (KeyboardInput[primaryInput->Walk] || KeyboardInput[secondaryInput->Walk]) 1134 1139 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Faster = 0; 1135 1140 1136 1141 if (KeyboardInput[primaryInput->Strafe] || KeyboardInput[secondaryInput->Strafe]) 1137 1142 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Strafe = 1; … … 1139 1144 if (KeyboardInput[primaryInput->Crouch] || KeyboardInput[secondaryInput->Crouch]) 1140 1145 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Crouch = 1; 1141 1146 1142 1147 if (KeyboardInput[primaryInput->Jump] || KeyboardInput[secondaryInput->Jump]) 1143 1148 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Jump = 1; … … 1152 1157 case I_Marine: 1153 1158 { 1154 if (KeyboardInput[primaryInput->ImageIntensifier]1159 if (KeyboardInput[primaryInput->ImageIntensifier] 1155 1160 ||KeyboardInput[secondaryInput->ImageIntensifier]) 1156 1161 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_ChangeVision = 1; 1157 1162 1158 if (DebouncedKeyboardInput[primaryInput->ThrowFlare]1163 if (DebouncedKeyboardInput[primaryInput->ThrowFlare] 1159 1164 ||DebouncedKeyboardInput[secondaryInput->ThrowFlare]) 1160 1165 ThrowAFlare(); 1161 1166 1162 1167 #if !(MARINE_DEMO||DEATHMATCH_DEMO) 1163 if (KeyboardInput[primaryInput->Jetpack]1168 if (KeyboardInput[primaryInput->Jetpack] 1164 1169 ||KeyboardInput[secondaryInput->Jetpack]) 1165 1170 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_Jetpack = 1; 1166 1171 #endif 1167 1172 1168 if (KeyboardInput[primaryInput->MarineTaunt]1173 if (KeyboardInput[primaryInput->MarineTaunt] 1169 1174 ||KeyboardInput[secondaryInput->MarineTaunt]) 1170 1175 StartPlayerTaunt(); 1171 1176 1172 if (DebouncedKeyboardInput[primaryInput->Marine_MessageHistory]1177 if (DebouncedKeyboardInput[primaryInput->Marine_MessageHistory] 1173 1178 ||DebouncedKeyboardInput[secondaryInput->Marine_MessageHistory]) 1174 1179 MessageHistory_DisplayPrevious(); 1175 1180 1176 if (DebouncedKeyboardInput[primaryInput->Marine_Say]1181 if (DebouncedKeyboardInput[primaryInput->Marine_Say] 1177 1182 ||DebouncedKeyboardInput[secondaryInput->Marine_Say]) 1178 1183 BringDownConsoleWithSayTypedIn(); 1179 1184 1180 if (DebouncedKeyboardInput[primaryInput->Marine_SpeciesSay]1185 if (DebouncedKeyboardInput[primaryInput->Marine_SpeciesSay] 1181 1186 ||DebouncedKeyboardInput[secondaryInput->Marine_SpeciesSay]) 1182 1187 BringDownConsoleWithSaySpeciesTypedIn(); 1183 1188 1184 if (KeyboardInput[primaryInput->Marine_ShowScores]1189 if (KeyboardInput[primaryInput->Marine_ShowScores] 1185 1190 ||KeyboardInput[secondaryInput->Marine_ShowScores]) 1186 1191 ShowMultiplayerScores(); … … 1188 1193 } 1189 1194 case I_Predator: 1190 { 1191 extern int CameraZoomLevel; 1192 1193 if(KeyboardInput[primaryInput->Cloak] 1195 { 1196 if (KeyboardInput[primaryInput->Cloak] 1194 1197 ||KeyboardInput[secondaryInput->Cloak]) 1195 1198 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_ChangeVision = 1; 1196 1199 1197 if (DebouncedKeyboardInput[primaryInput->CycleVisionMode]1200 if (DebouncedKeyboardInput[primaryInput->CycleVisionMode] 1198 1201 ||DebouncedKeyboardInput[secondaryInput->CycleVisionMode]) 1199 1202 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_CycleVisionMode = 1; 1200 1203 1201 1204 #if !(PREDATOR_DEMO||DEATHMATCH_DEMO) 1202 if (DebouncedKeyboardInput[primaryInput->GrapplingHook]1205 if (DebouncedKeyboardInput[primaryInput->GrapplingHook] 1203 1206 ||DebouncedKeyboardInput[secondaryInput->GrapplingHook]) 1204 1207 playerStatusPtr->Mvt_InputRequests.Flags.Rqst_GrapplingHook = 1; 1205 1208 #endif 1206 1209 1207 if (DebouncedKeyboardInput[primaryInput->ZoomIn]1210 if (DebouncedKeyboardInput[primaryInput->ZoomIn] 1208 1211 ||DebouncedKeyboardInput[secondaryInput->ZoomIn]) 1209 1212 { 1210 1213 if (CameraZoomLevel<3) CameraZoomLevel++; 1211 1214 } 1212 if (DebouncedKeyboardInput[primaryInput->ZoomOut]1215 if (DebouncedKeyboardInput[primaryInput->ZoomOut] 1213 1216 ||DebouncedKeyboardInput[secondaryInput->ZoomOut]) 1214 1217 { … … 1218 1221 MaintainZoomingLevel(); 1219 1222 1220 if (KeyboardInput[primaryInput->PredatorTaunt]1223 if (KeyboardInput[primaryInput->PredatorTaunt] 1221 1224 ||KeyboardInput[secondaryInput->PredatorTaunt]) 1222 1225 StartPlayerTaunt(); 1223 1226 1224 if (KeyboardInput[primaryInput->RecallDisc]1227 if (KeyboardInput[primaryInput->RecallDisc] 1225 1228 ||KeyboardInput[secondaryInput->RecallDisc]) 1226 1229 Recall_Disc(); 1227 1230 1228 if (DebouncedKeyboardInput[primaryInput->Predator_MessageHistory]1231 if (DebouncedKeyboardInput[primaryInput->Predator_MessageHistory] 1229 1232 ||DebouncedKeyboardInput[secondaryInput->Predator_MessageHistory]) 1230 1233 MessageHistory_DisplayPrevious(); 1231 1234 1232 if (DebouncedKeyboardInput[primaryInput->Predator_Say]1235 if (DebouncedKeyboardInput[primaryInput->Predator_Say] 1233 1236 ||DebouncedKeyboardInput[secondaryInput->Predator_Say]) 1234 1237 BringDownConsoleWithSayTypedIn(); 1235 1238 1236 if (DebouncedKeyboardInput[primaryInput->Predator_SpeciesSay]1239 if (DebouncedKeyboardInput[primaryInput->Predator_SpeciesSay] 1237 1240 ||DebouncedKeyboardInput[secondaryInput->Predator_SpeciesSay]) 1238 1241 BringDownConsoleWithSaySpeciesTypedIn(); 1239 1242 1240 if (KeyboardInput[primaryInput->Predator_ShowScores]1243 if (KeyboardInput[primaryInput->Predator_ShowScores] 1241 1244 ||KeyboardInput[secondaryInput->Predator_ShowScores]) 1242 1245 ShowMultiplayerScores(); … … 1254 1257 ||KeyboardInput[secondaryInput->Taunt]) 1255 1258 StartPlayerTaunt(); 1256 1259 1257 1260 if(DebouncedKeyboardInput[primaryInput->Alien_MessageHistory] 1258 1261 ||DebouncedKeyboardInput[secondaryInput->Alien_MessageHistory]) … … 1430 1433 if(DebouncedKeyboardInput[FixedInputConfig.Weapon10]) 1431 1434 { 1432 extern void save_preplaced_decals();1433 1435 save_preplaced_decals(); 1434 1436 } … … 1454 1456 if (GotMouse) 1455 1457 { 1456 extern int MouseVelX;1457 extern int MouseVelY;1458 1459 1458 if (ControlMethods.HAxisIsTurning) 1460 1459 { … … 1541 1540 } 1542 1541 1543 / * handle xbox controllers seperate from joysticks */1542 // handle xbox controllers seperate from joysticks 1544 1543 if (GotXPad) 1545 1544 { 1546 // char buf[100];1547 1545 #define JOYSTICK_DEAD_ZONE 12000 1548 1546 int yAxis = xPadMoveY * 2; … … 1616 1614 { 1617 1615 #define JOYSTICK_DEAD_ZONE 12000 1618 extern JOYINFOEX JoystickData;1619 extern JOYCAPS JoystickCaps;1620 1616 1621 1617 int yAxis = (32768-JoystickData.dwYpos)*2; … … 1894 1890 #endif 1895 1891 1896 if (DebouncedKeyboardInput[KEY_GRAVE]) 1892 if (DebouncedKeyboardInput[KEY_GRAVE]) { 1897 1893 IOFOCUS_Toggle(); 1894 } 1898 1895 } 1899 1896 … … 1905 1902 LoadAKeyConfiguration("avpkey.cfg"); 1906 1903 #endif 1907 1908 1904 } 1909 1905 -
branches/workbranch/trunk/3dc/avp/win95/winmain.cpp
r527 r533 212 212 } 213 213 214 if (strstr(command_line, "-intro")) 214 if (strstr(command_line, "-intro")) { 215 215 WeWantAnIntro(); 216 } 216 217 217 218 if (strstr(command_line, "-qm")) … … 298 299 299 300 #if PLAY_INTRO//(MARINE_DEMO||ALIEN_DEMO||PREDATOR_DEMO) 300 if (!LobbiedGame) // Edmond301 if (!LobbiedGame) { // Edmond 301 302 WeWantAnIntro(); 303 } 302 304 #endif 303 305 GetPathFromRegistry(); … … 324 326 #if debug && 1//!PREDATOR_DEMO 325 327 326 if (instr = strstr(command_line, "-s")) 328 if (instr = strstr(command_line, "-s")) { 327 329 sscanf(instr, "-s%d", &level_to_load); 330 } 328 331 329 332 #endif … … 467 470 case I_GM_Playing: 468 471 { 469 if ((!menusActive || (AvP.Network !=I_No_Network && !netGameData.skirmishMode)) && !AvP.LevelCompleted)472 if ((!menusActive || (AvP.Network != I_No_Network && !netGameData.skirmishMode)) && !AvP.LevelCompleted) 470 473 { 471 474 //#if MainTextPrint /* debugging stuff */ … … 507 510 // check to see if we're pausing the game; 508 511 // if so kill off any sound effects 509 if (InGameMenusAreRunning() && ((AvP.Network != I_No_Network && netGameData.skirmishMode) || (AvP.Network == I_No_Network))) 512 if (InGameMenusAreRunning() && ((AvP.Network != I_No_Network && netGameData.skirmishMode) || (AvP.Network == I_No_Network))) { 510 513 SoundSys_StopAll(); 514 } 511 515 } 512 516 else … … 566 570 RestartLevel(); 567 571 } 568 } // end of main game loop572 } // end of main game loop 569 573 570 574 AvP.LevelCompleted = thisLevelHasBeenCompleted; … … 578 582 ReleaseAllFMVTextures(); 579 583 580 /* DHM 8/4/98 */581 584 CONSBIND_WriteKeyBindingsToConfigFile(); 582 585 583 /* CDF 2/10/97 */584 586 DeInitialisePlayer(); 585 587 … … 595 597 596 598 #endif 597 /* Patrick 26/6/97 598 Stop and remove all game sounds here, since we are returning to the menus */ 599 // SoundSys_StopAll(); 599 600 600 ResetEaxEnvironment(); 601 //make sure the volume gets reset for the menus 601 602 // make sure the volume gets reset for the menus 602 603 SoundSys_ResetFadeLevel(); 603 604 … … 617 618 618 619 #if 0 //bjd - FIXME 619 if (LobbiedGame)620 if (LobbiedGame) 620 621 { 621 622 /* -
branches/workbranch/trunk/3dc/d3d_render.cpp
r523 r533 355 355 // mainList->Sort(); 356 356 357 // Melanikus 18/11/11 - Nvidia 3D Vision fix 358 // Setting the projection matrix to 359 // the rhw shader so we can have a non 357 // Melanikus 18/11/11 - Nvidia 3D Vision fix. Setting the projection matrix to the rhw shader so we can have a non 360 358 // ortho projection 361 359 R_MATRIX projection; 362 D3DXMatrixPerspectiveFovRH(&projection, D3DXToRadian(90.0f),4.0f/3.0f,0.0f,1.0f);360 D3DXMatrixPerspectiveFovRH(&projection, D3DXToRadian(90.0f), 4.0f/3.0f ,0.0f, 1.0f); 363 361 d3d.rhwDecl->Set(); 364 362 d3d.effectSystem->SetActive(d3d.rhwEffect); … … 612 610 { 613 611 alpha = (alpha / 256); 614 if (alpha > 255) 612 if (alpha > 255) { 615 613 alpha = 255; 614 } 616 615 617 616 RCOLOR colour = RCOLOR_ARGB(alpha, 255, 255, 255); … … 759 758 assert(ftPtr); 760 759 761 if (!ftPtr) 760 if (!ftPtr) { 762 761 return; 763 764 if (!NextFMVTextureFrame(ftPtr)) 765 {762 } 763 764 if (!NextFMVTextureFrame(ftPtr)) { 766 765 return; 767 766 } … … 801 800 { 802 801 alpha = alpha / 256; 803 if (alpha > 255) 802 if (alpha > 255) { 804 803 alpha = 255; 804 } 805 805 806 806 RCOLOR colour = RCOLOR_ARGB(alpha,0,0,0); … … 958 958 OutputDebugString("DrawPrimitiveUP failed\n"); 959 959 } 960 961 960 } 962 961 … … 1019 1018 1020 1019 alpha = (alpha / 256); 1021 if (alpha > 255) 1020 if (alpha > 255) { 1022 1021 alpha = 255; 1022 } 1023 1023 1024 1024 DrawQuad(topX, topY, textureWidth, textureHeight, textureID, RCOLOR_ARGB(alpha, 255, 255, 255), TRANSLUCENCY_GLOWING); … … 1030 1030 uint32_t textureHeight = 0; 1031 1031 1032 if (alpha > ONE_FIXED) // ONE_FIXED = 655361032 if (alpha > ONE_FIXED) { // ONE_FIXED = 65536 1033 1033 alpha = ONE_FIXED; 1034 } 1034 1035 1035 1036 alpha = (alpha / 256); 1036 if (alpha > 255) 1037 if (alpha > 255) { 1037 1038 alpha = 255; 1039 } 1038 1040 1039 1041 // textures original resolution (if it's a non power of 2, these will be the non power of 2 values) … … 1236 1238 void DrawCoronas() 1237 1239 { 1238 if (coronaArray.size() == 0) 1240 if (coronaArray.size() == 0) { 1239 1241 return; 1242 } 1240 1243 1241 1244 uint32_t numVertsBackup = RenderPolygon.NumberOfVertices; … … 1365 1368 void DrawParticles() 1366 1369 { 1367 if (!particleBucket.size()) 1370 if (!particleBucket.size()) { 1368 1371 return; 1372 } 1369 1373 1370 1374 // loop particles and add them to vertex buffer -
branches/workbranch/trunk/3dc/logString.cpp
r516 r533 104 104 } 105 105 106 void LogDebugString(const std::string &debugString, int LINE, const char* FILE) 107 { 108 std::string temp = "Debug message: " + debugString + " Line: " + Util::IntToString(LINE) + " File: " + FILE + "\n"; 109 WriteToLog("\t" + temp); 110 } 111 112 void LogDebugString(const std::string &debugString) 113 { 114 // TODO - can specify a flag on cmd args to print these or not? 115 std::string temp = debugString + "\n"; 116 WriteToLog(temp); 117 } 118 106 119 void LogString(const std::string &logString) 107 120 { … … 109 122 WriteToLog(temp); 110 123 } 111 112 void LogDebugValue(int value)113 {114 std::ostringstream stream;115 stream << "\n value was: " << value;116 OutputDebugString(stream.str().c_str());117 } -
branches/workbranch/trunk/3dc/logstring.h
r516 r533 36 36 void LogErrorString(const std::string &errorString, int LINE, const char* FILE); 37 37 void LogErrorString(const std::string &errorString); 38 void LogDebugString(const std::string &debugString, int LINE, const char* FILE); 39 void LogDebugString(const std::string &debugString); 38 40 const std::string& GetLastErrorMessage(); 39 41 void LogString(const std::string &logString); 40 void LogDebugValue(int value);41 42 42 43 #endif // include guard -
branches/workbranch/trunk/3dc/utilities.cpp
r527 r533 66 66 } 67 67 68 if (c == '\\') 68 if (c == '\\') { 69 69 return '/'; 70 } 70 71 71 72 return c; … … 102 103 { 103 104 // check if we've got the path previously and use it again 104 if (*saveFolder) 105 if (*saveFolder) { 105 106 return saveFolder; 107 } 106 108 107 109 #ifdef _XBOX -
branches/workbranch/trunk/3dc/win95/CD_player.cpp
r530 r533 7 7 #define UseLocalAssert TRUE 8 8 #include "ourasert.h" 9 #include "ConfigFile.h" 9 10 10 11 /* KJL 12:40:35 07/05/98 - This is code derived from Patrick's original stuff & moved into it's own file. */ … … 39 40 40 41 extern int SetStreamingMusicVolume(int volume); 41 static void PlatGetCDDAVolumeControl(void); 42 43 void CDDA_Start(void) 44 { 45 return; // bjd - revert 46 47 /* function should complete successfully even if no disc in drive */ 42 static void PlatGetCDDAVolumeControl(); 43 44 bool useCD = true; 45 46 void CDDA_Start() 47 { 48 return; 49 useCD = Config_GetBool("[Music]", "UseCDaudio", true); 50 51 // function should complete successfully even if no disc in drive 48 52 CDDAVolume = CDDA_VOLUME_DEFAULT; 49 53 CDPlayerVolume = CDDAVolume; … … 51 55 CDDAIsInitialised = false; 52 56 53 if (PlatStartCDDA() != SOUND_PLATFORMERROR)57 if (PlatStartCDDA()) 54 58 { 55 59 CDDAIsInitialised = true; 56 60 CDDA_SwitchOn(); 57 CDDA_ChangeVolume(CDDAVolume); / * init the volume */61 CDDA_ChangeVolume(CDDAVolume); // init the volume 58 62 CDDA_CheckNumberOfTracks(); 59 63 } … … 61 65 } 62 66 63 void CDDA_End( void)67 void CDDA_End() 64 68 { 65 69 if (!CDDAIsInitialised) { … … 76 80 } 77 81 78 void CDDA_Management( void)82 void CDDA_Management() 79 83 { 80 84 if (!CDDASwitchedOn) { … … 89 93 { 90 94 if (!CDDASwitchedOn) 91 return; / * CDDA is off */95 return; // CDDA is off 92 96 93 97 if (CDDAState == CDOp_Playing) 94 return; /* already playing */ 95 96 if ((CDDATrack <= 0)||(CDDATrack >= CDTrackMax)) 97 return; /* no such track */ 98 99 int ok = PlatPlayCDDA((int)CDDATrack); 100 if (ok != SOUND_PLATFORMERROR) 98 return; // already playing 99 100 if ((CDDATrack <= 0) || (CDDATrack >= CDTrackMax)) 101 return; // no such track 102 103 if (PlatPlayCDDA(CDDATrack) != SOUND_PLATFORMERROR) 101 104 { 102 105 CDDAState = CDOp_Playing; … … 118 121 } 119 122 120 int ok = PlatPlayCDDA((int)CDDATrack); 121 if (ok != SOUND_PLATFORMERROR) 123 if (PlatPlayCDDA(CDDATrack) != SOUND_PLATFORMERROR) 122 124 { 123 125 CDDAState=CDOp_Playing; … … 127 129 } 128 130 129 extern void CheckCDVolume( void)131 extern void CheckCDVolume() 130 132 { 131 133 if (CDDAVolume != CDPlayerVolume) { … … 139 141 if (SetStreamingMusicVolume(volume) == 0) // ok 140 142 { 141 CDDAVolume =volume;143 CDDAVolume = volume; 142 144 CDPlayerVolume = volume; 143 145 } … … 162 164 } 163 165 164 int CDDA_GetCurrentVolumeSetting( void)166 int CDDA_GetCurrentVolumeSetting() 165 167 { 166 168 return CDDAVolume; … … 172 174 return; // CDDA is off 173 175 } 176 174 177 if (CDDAState != CDOp_Playing) { 175 178 return; // nothing playing 176 179 } 177 int ok = PlatStopCDDA(); 180 181 PlatStopCDDA(); 178 182 CDDAState = CDOp_Idle; 179 183 LastCommandGiven = CDCOMMANDID_Stop; … … 193 197 return; // CDDA is off already 194 198 } 199 195 200 if (CDDA_IsPlaying()) { 196 201 CDDA_Stop(); … … 216 221 int CDDA_CheckNumberOfTracks() 217 222 { 218 int numTracks = 0;223 uint32_t numTracks = 0; 219 224 220 225 if (CDDA_IsOn()) 221 226 { 222 PlatGetNumberOfCDTracks( &numTracks);227 PlatGetNumberOfCDTracks(numTracks); 223 228 224 229 // if there is only one track , then it probably can't be used anyway … … 229 234 230 235 // store the maximum allowed track number 231 CDTrackMax =numTracks;236 CDTrackMax = numTracks; 232 237 } 233 238 return numTracks; 234 239 } 235 240 236 237 238 241 // win32 specific 239 242 240 int PlatStartCDDA(void)243 bool PlatStartCDDA() 241 244 { 242 245 DWORD dwReturn; … … 254 257 { 255 258 cdDeviceID = kNoDevice; 256 return SOUND_PLATFORMERROR;259 return false; 257 260 } 258 261 cdDeviceID = mciOpenParms.wDeviceID; … … 260 263 // now try to get the cd volume control, by obtaining the auxiliary device id for the cd-audio player 261 264 PlatGetCDDAVolumeControl(); 262 return 0;263 } 264 265 static void PlatGetCDDAVolumeControl( void)265 return true; 266 } 267 268 static void PlatGetCDDAVolumeControl() 266 269 { 267 270 uint32_t numDev = mixerGetNumDevs(); … … 312 315 PreGameCDVolume = detailValue.dwValue; 313 316 mixerClose(handle); 314 315 317 return; //success 316 318 } … … 322 324 } 323 325 324 void PlatEndCDDA( void)326 void PlatEndCDDA() 325 327 { 326 328 return; … … 345 347 346 348 // check the cdDeviceId 347 if (cdDeviceID==kNoDevice) 348 return SOUND_PLATFORMERROR; 349 if (cdDeviceID == kNoDevice) { 350 return SOUND_PLATFORMERROR; 351 } 349 352 350 353 // set the time format 351 354 mciSetParms.dwTimeFormat = MCI_FORMAT_MSF; 352 355 dwReturn = mciSendCommand(cdDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR) &mciSetParms); 353 if (dwReturn) 354 { 356 if (dwReturn) { 355 357 // NewOnScreenMessage("CD ERROR - TIME FORMAT"); 356 358 return SOUND_PLATFORMERROR; … … 361 363 mciStatusParms.dwTrack = track; 362 364 dwReturn = mciSendCommand(cdDeviceID, MCI_STATUS, MCI_STATUS_ITEM|MCI_TRACK, (DWORD_PTR) &mciStatusParms); 363 if (dwReturn) 364 { 365 if (dwReturn) { 365 366 // NewOnScreenMessage("CD ERROR - GET LENGTH"); 366 367 return SOUND_PLATFORMERROR; … … 370 371 mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF; 371 372 dwReturn = mciSendCommand(cdDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR) &mciSetParms); 372 if (dwReturn) 373 { 373 if (dwReturn) { 374 374 // NewOnScreenMessage("CD ERROR - TIME FORMAT"); 375 375 return SOUND_PLATFORMERROR; … … 381 381 mciPlayParms.dwCallback = (DWORD_PTR)hWndMain; 382 382 dwReturn = mciSendCommand(cdDeviceID, MCI_PLAY, MCI_FROM | MCI_TO | MCI_NOTIFY, (DWORD_PTR) &mciPlayParms); 383 if (dwReturn) 384 { 383 if (dwReturn) { 385 384 // NewOnScreenMessage("CD ERROR - PLAY"); 386 385 return SOUND_PLATFORMERROR; … … 389 388 } 390 389 391 int PlatGetNumberOfCDTracks(int* numTracks) 392 { 393 DWORD dwReturn; 390 int PlatGetNumberOfCDTracks(uint32_t &numTracks) 391 { 394 392 MCI_STATUS_PARMS mciStatusParms = {0,0,0,0}; 395 393 396 394 // check the cdDeviceId 397 if (cdDeviceID == kNoDevice) 398 return SOUND_PLATFORMERROR; 399 400 if (!numTracks) 401 return SOUND_PLATFORMERROR; 395 if (cdDeviceID == kNoDevice) { 396 return SOUND_PLATFORMERROR; 397 } 398 399 if (!numTracks) { 400 return SOUND_PLATFORMERROR; 401 } 402 402 403 403 // find the number tracks 404 404 mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS ; 405 dwReturn = mciSendCommand(cdDeviceID, MCI_STATUS, MCI_STATUS_ITEM , (DWORD_PTR)&mciStatusParms);405 DWORD dwReturn = mciSendCommand(cdDeviceID, MCI_STATUS, MCI_STATUS_ITEM , (DWORD_PTR)&mciStatusParms); 406 406 if (dwReturn) 407 407 { … … 410 410 411 411 // number of tracks is in the dwReturn member 412 *numTracks = (int)mciStatusParms.dwReturn;412 numTracks = (uint32_t)mciStatusParms.dwReturn; 413 413 414 414 return 0; 415 415 } 416 416 417 int PlatStopCDDA( void)417 int PlatStopCDDA() 418 418 { 419 419 // check the cdDeviceId 420 if (cdDeviceID == kNoDevice) 421 { 420 if (cdDeviceID == kNoDevice) { 422 421 return SOUND_PLATFORMERROR; 423 422 } … … 425 424 // stop the cd player 426 425 DWORD dwReturn = mciSendCommand(cdDeviceID, MCI_STOP, MCI_WAIT, 0); 427 if (dwReturn) 428 { 426 if (dwReturn) { 429 427 return SOUND_PLATFORMERROR; 430 428 } … … 441 439 442 440 // check the cdDeviceId 443 if (cdDeviceID == kNoDevice) 444 return SOUND_PLATFORMERROR; 441 if (cdDeviceID == kNoDevice) { 442 return SOUND_PLATFORMERROR; 443 } 445 444 446 445 // go through the mixer devices searching for one that can deal with the cd volume … … 469 468 control.cbStruct = sizeof(MIXERCONTROL); 470 469 471 // try to get the volume control470 // try to get the volume control 472 471 if (mixerGetLineControls((HMIXEROBJ)handle, &lineControls, MIXER_GETLINECONTROLSF_ONEBYTYPE) == MMSYSERR_NOERROR) 473 472 { 474 475 473 MIXERCONTROLDETAILS details; 476 474 MIXERCONTROLDETAILS_UNSIGNED detailValue; … … 532 530 CDDAState = CDOp_Idle; 533 531 //NewOnScreenMessage("CD COMMAND RETURNED WITH SUCCESSFUL"); 534 / * Play it again, sam */532 // Play it again, sam 535 533 if (LastCommandGiven == CDCOMMANDID_PlayLoop) 536 534 { … … 540 538 else if (flags & MCI_NOTIFY_FAILURE) 541 539 { 542 / * error while playing: abnormal termination */540 // error while playing: abnormal termination 543 541 //NewOnScreenMessage("CD COMMAND FAILED"); 544 542 CDDAState = CDOp_Idle; … … 550 548 else if (flags & MCI_NOTIFY_ABORTED) 551 549 { 552 / * aborted or superceeded: try and stop the device */550 // aborted or superceeded: try and stop the device 553 551 //NewOnScreenMessage("CD COMMAND ABORTED(?)"); 554 552 // CDDA_Stop(); -
branches/workbranch/trunk/3dc/win95/CD_player.h
r530 r533 31 31 FALSE CDDA operations have any effect until the system has been initialised. 32 32 -----------------------------------------------------------------------------*/ 33 extern void CDDA_Start( void);34 extern void CDDA_End( void);33 extern void CDDA_Start(); 34 extern void CDDA_End(); 35 35 /* Patrick 10/6/97 -------------------------------------------------------------- 36 36 This is provided to allow platform specific polling/management of the CD device 37 37 whilst playing. It should be called during the main game loop. 38 38 -----------------------------------------------------------------------------*/ 39 extern void CDDA_Management( void);39 extern void CDDA_Management(); 40 40 /* Patrick 10/6/97 -------------------------------------------------------------- 41 41 Play , change volume, and stop are the basic CDDA operations provided. An … … 45 45 extern void CDDA_PlayLoop(int CDDATrack); 46 46 extern void CDDA_ChangeVolume(int volume); 47 extern void CDDA_Stop( void);48 extern int CDDA_CheckNumberOfTracks( void);47 extern void CDDA_Stop(); 48 extern int CDDA_CheckNumberOfTracks(); 49 49 /* Patrick 23/6/97 -------------------------------------------------------------- 50 50 Returns the current CDDA volume setting. NB if the cd player has not been … … 52 52 though it may not be changed using CDDA_ChangeVolume(). 53 53 -----------------------------------------------------------------------------*/ 54 extern int CDDA_GetCurrentVolumeSetting( void);54 extern int CDDA_GetCurrentVolumeSetting(); 55 55 /* Patrick 10/6/97 -------------------------------------------------------------- 56 56 Switch on and switch off may be used to stop and start the CDDA system after … … 58 58 during a game. 59 59 -----------------------------------------------------------------------------*/ 60 extern void CDDA_SwitchOn( void);61 extern void CDDA_SwitchOff( void);60 extern void CDDA_SwitchOn(); 61 extern void CDDA_SwitchOff(); 62 62 /* Patrick 10/6/97 -------------------------------------------------------------- 63 63 These are provided to interrogate the state of the CDDA system. … … 86 86 or zero otherwise. 87 87 ----------------------------------------------------------------------------*/ 88 extern int PlatStartCDDA(void);89 extern void PlatEndCDDA( void);88 extern bool PlatStartCDDA(); 89 extern void PlatEndCDDA(); 90 90 /* Patrick 10/6/97 ------------------------------------------------------------- 91 91 Platform specific play, stop, and change volume functions. NB the volume … … 94 94 ----------------------------------------------------------------------------*/ 95 95 extern int PlatPlayCDDA(int track); 96 extern int PlatStopCDDA( void);96 extern int PlatStopCDDA(); 97 97 extern int PlatChangeCDDAVolume(int volume); 98 int PlatGetNumberOfCDTracks( int*numTracks);98 int PlatGetNumberOfCDTracks(uint32_t &numTracks); 99 99 /* Patrick 10/6/97 ------------------------------------------------------------- 100 100 Management functions are provided for platform specific detection of changes … … 105 105 extern void PlatCDDAManagementCallBack(WPARAM flags, LONG deviceId); 106 106 extern int CDPlayerVolume; 107 extern void CheckCDVolume( void);107 extern void CheckCDVolume(); 108 108 109 109 #endif -
branches/workbranch/trunk/3dc/win95/VideoModes.cpp
r479 r533 20 20 char *GetVideoModeDescription3() 21 21 { 22 /* 22 23 const uint32_t kBufferSize = 32; 23 24 … … 37 38 38 39 return buf; 40 */ 41 return (char*)R_GetVideoModeDescription().c_str(); 39 42 } 40 43 -
branches/workbranch/trunk/3dc/win95/chnkload.cpp
r522 r533 32 32 double local_scale; 33 33 34 File_Chunk * Env_Chunk = 0;34 File_Chunk *Env_Chunk = 0; 35 35 36 36 RIFFHANDLE current_rif_handle; 37 37 38 unsigned char const * PaletteMapTable;38 unsigned char const *PaletteMapTable; 39 39 40 40 ////////////////////////////////////////////////////////// 41 extern LOADED_SOUND const * GetSoundForMainRif(const char*wav_name);42 extern char * extsounddir;43 extern char * sounddir;41 extern LOADED_SOUND const *GetSoundForMainRif(const char *wav_name); 42 extern char *extsounddir; 43 extern char *sounddir; 44 44 45 45 struct Shape_Fragment_Type -
branches/workbranch/trunk/3dc/win95/huffman.cpp
r421 r533 16 16 { 17 17 union 18 { // the FIRST four bytes18 { // the FIRST four bytes 19 19 struct HuffNode *zero; // points to the "zero" branch or... 20 20 unsigned int value; // holds the value of an end node … … 37 37 typedef struct 38 38 { 39 long wid;40 long bits;39 long wid; 40 long bits; 41 41 42 42 } HuffEncode; … … 82 82 strncpy(outpackage->Identifier,COMPRESSED_RIF_IDENTIFIER,8); 83 83 outpackage->CompressedDataSize = HuffEncodeBytes((int*)(outpackage+1), sourcePtr, length, EncodingTable); 84 outpackage->UncompressedDataSize = length; 85 for (int n = 0; n < MAX_DEPTH; n++) 86 { 87 outpackage->CodelengthCount[n] = Depths[n + 1]; 88 } 89 for (int n = 0; n < 256; n++) 90 { 91 outpackage->ByteAssignment[n] = SymbolCensus[n + 1].Symbol; 84 outpackage->UncompressedDataSize = length; 85 86 for (int n = 0; n < MAX_DEPTH; n++) 87 { 88 outpackage->CodelengthCount[n] = Depths[n + 1]; 89 } 90 for (int n = 0; n < 256; n++) 91 { 92 outpackage->ByteAssignment[n] = SymbolCensus[n + 1].Symbol; 92 93 } 93 94 return outpackage; 94 95 } 95 96 96 97 static void PerformSymbolCensus(unsigned char *sourcePtr, int length) 97 98 { … … 109 110 } 110 111 while (--length); 111 } 112 } 112 113 113 114 static int __cdecl HuffItemsSortSub(const void *cmp1, const void *cmp2) 114 115 { 115 if (((HuffItem *)cmp1)->Count > ((HuffItem *)cmp2)->Count) 116 if (((HuffItem *)cmp1)->Count > ((HuffItem *)cmp2)->Count) { 116 117 return 1; 117 if (((HuffItem *)cmp1)->Count < ((HuffItem *)cmp2)->Count) 118 } 119 if (((HuffItem *)cmp1)->Count < ((HuffItem *)cmp2)->Count) { 118 120 return -1; 121 } 119 122 return 0; 120 123 } … … 135 138 unsigned int sum; 136 139 137 if (!count) return; 140 if (!count) { 141 return; 142 } 138 143 139 144 movdest = base + 1; … … 142 147 for (n = 0; n < count; n++) 143 148 { 144 temp[n].bits = source[n].Count;149 temp[n].bits = source[n].Count; 145 150 } 146 151 while ((upperlim = --count)) 147 152 { 148 if (temp[0].zero) 153 if (temp[0].zero) { 149 154 temp[0].zero->parent = temp[0].one->parent = movdest; 150 if (temp[1].zero) 155 } 156 if (temp[1].zero) { 151 157 temp[1].zero->parent = temp[1].one->parent = movdest + 1; 158 } 152 159 movdest[0] = *temp++; 153 160 movdest[1] = *temp; … … 175 182 } 176 183 base[0] = temp[0]; 177 if (base[0].zero) 184 185 if (base[0].zero) { 178 186 base[0].zero->parent = base[0].one->parent = base; 187 } 179 188 } 180 189 … … 184 193 HuffNode *back; 185 194 186 for (n = 0; n < maxdepth + 1; n++) 195 for (n = 0; n < maxdepth + 1; n++) { 187 196 dest[n] = 0; 197 } 198 188 199 depth = 0; 200 189 201 while (1) 190 202 { … … 195 207 } 196 208 197 if (depth > maxdepth) dest[maxdepth]++; 198 else dest[depth]++; 209 if (depth > maxdepth) { 210 dest[maxdepth]++; 211 } 212 else { 213 dest[depth]++; 214 } 199 215 200 216 do … … 202 218 back = source; 203 219 source = source->parent; 204 if (!depth--) 220 if (!depth--) { 205 221 return; 222 } 206 223 } 207 224 while (back == source->zero); 208 225 209 226 source = source->zero; 210 depth++;227 depth++; 211 228 } 212 229 } … … 218 235 219 236 goal = 1 << maxdepth; 237 220 238 for (n = 0, sum = 0, items = 0; n <= (unsigned int)maxdepth; n++) 221 239 { … … 223 241 sum += (goal >> n) * depth[n]; 224 242 } 225 if (items > goal) 243 244 if (items > goal) { 226 245 return -1; // failure 246 } 247 227 248 for (n = maxdepth - 1; sum > goal; n--) 228 249 { … … 244 265 { 245 266 gain = hi - (1 << (maxdepth - m)); 246 if (excess < gain) 267 268 if (excess < gain) { 247 269 break; 270 } 271 248 272 if (depth[m]) 249 273 { … … 256 280 } 257 281 } 258 return 0; // success282 return 0; // success 259 283 } 260 284 … … 285 309 { 286 310 cur ^= bt; // do an add modulo 1 287 if ((cur & bt) || !bt) // break if now a 1311 if ((cur & bt) || !bt) { // break if now a 1 288 312 break; // or out of bits 313 } 289 314 bt >>= 1; // do next bit position 290 315 } … … 301 326 unsigned char *sourcelim, *sourceend; 302 327 303 if (!count) return 0; 328 if (!count) { 329 return 0; 330 } 304 331 305 332 accum = 0; … … 330 357 331 358 wid += available; 332 if (wid) accum = (accum >> wid) | (bits << (32 - wid)); 359 if (wid) { 360 accum = (accum >> wid) | (bits << (32 - wid)); 361 } 333 362 *dest++ = accum; 334 363 wid -= available; … … 357 386 { 358 387 wid += available; 359 if (wid) 388 if (wid) { 360 389 accum = (accum >> wid) | (bits << (32 - wid)); 390 } 361 391 *dest++ = accum; 362 392 wid -= available; … … 368 398 accum = (accum >> wid) | (bits << (32 - wid)); 369 399 } 370 } 400 } 371 401 *dest++ = accum >> available; 372 402 return (int)((dest - start) * 4); -
branches/workbranch/trunk/tools/installer/avpx.iss
r525 r533 3 3 4 4 #define MyAppName "AvPx" 5 #define MyAppVersion " 1.0"5 #define MyAppVersion "0.1" 6 6 #define MyAppPublisher "SirLemonhead" 7 7 #define MyAppURL "http://homepage.eircom.net/~duncandsl/avp/" … … 20 20 AppSupportURL={#MyAppURL} 21 21 AppUpdatesURL={#MyAppURL} 22 DefaultDirName={pf} \Fox\Aliens versus Predator22 DefaultDirName={pf} 23 23 DefaultGroupName={#MyAppName} 24 24 OutputBaseFilename=setup 25 25 Compression=lzma 26 26 SolidCompression=yes 27 UsePreviousAppDir=no 27 28 28 29 [Languages] -
branches/workbranch/trunk/win32/Di_func.cpp
r527 r533 59 59 //extern HWND hWndMain; 60 60 61 intGotMouse;61 bool GotMouse; 62 62 int MouseVelX; 63 63 int MouseVelY; … … 870 870 if (Osk_IsActive()) 871 871 { 872 if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_15]) 872 if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_15]) { 873 873 Osk_MoveLeft(); 874 875 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_16]) 874 } 875 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_16]) { 876 876 Osk_MoveRight(); 877 878 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_13]) 877 } 878 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_13]) { 879 879 Osk_MoveUp(); 880 881 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_14]) 880 } 881 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_14]) { 882 882 Osk_MoveDown(); 883 883 } 884 884 else if (DebouncedKeyboardInput[KEY_JOYSTICK_BUTTON_2]) 885 885 { … … 1016 1016 int OldMouseX, OldMouseY; 1017 1017 1018 GotMouse = FALSE;1019 1020 if (mouseMoved == false) 1018 GotMouse = false; 1019 1020 if (mouseMoved == false) { 1021 1021 return; 1022 } 1022 1023 1023 1024 MouseVelX = 0; … … 1031 1032 OldMouseY = MouseY; 1032 1033 1033 GotMouse = TRUE;1034 GotMouse = true; 1034 1035 1035 1036 MouseX += xPosRelative * 4; … … 1051 1052 int OldMouseX, OldMouseY, OldMouseZ; 1052 1053 1053 GotMouse = FALSE;1054 GotMouse = false; 1054 1055 MouseVelX = 0; 1055 1056 MouseVelY = 0; … … 1070 1071 1071 1072 // Check for any data being picked up 1072 GotMouse = TRUE;1073 GotMouse = true; 1073 1074 if (dwElements == 0) return; 1074 1075 … … 1152 1153 #if 0 1153 1154 textprint("MouseNormalFrameTime %d\n",MouseNormalFrameTime); 1154 textprint("Got Mouse %d\n", GotMouse);1155 // textprint("Got Mouse %d\n", GotMouse); 1155 1156 textprint("Vel X %d\n", MouseVelX); 1156 1157 textprint("Vel Y %d\n", MouseVelY); -
branches/workbranch/trunk/win32/VS2010/AvP.vcxproj
r527 r533 375 375 <ClCompile Include="..\..\3dc\MSLHAND.cpp" /> 376 376 <ClCompile Include="..\..\3dc\MurmurHash3.cpp" /> 377 <ClCompile Include="..\..\3dc\MusicPlayer.cpp" /> 377 378 <ClCompile Include="..\..\3dc\networking.cpp" /> 378 379 <ClCompile Include="..\..\3dc\OBJECT.cpp" /> … … 615 616 <ClInclude Include="..\..\3dc\MSLHAND.H" /> 616 617 <ClInclude Include="..\..\3dc\MurmurHash3.h" /> 618 <ClInclude Include="..\..\3dc\MusicPlayer.h" /> 617 619 <ClInclude Include="..\..\3dc\networking.h" /> 618 620 <ClInclude Include="..\..\3dc\OnScreenKeyboard.h" /> -
branches/workbranch/trunk/win32/d3_func.cpp
r529 r533 280 280 if (D3DERR_DEVICENOTRESET == LastError) 281 281 { 282 OutputDebugString("Releasing resources for a device reset..\n");282 LogDebugString("Releasing resources for a device reset..."); 283 283 284 284 if (FAILED(d3d.lpD3DDevice->Reset(&d3d.d3dpp))) 285 285 { 286 OutputDebugString("Couldn't reset device\n");286 LogDebugString("Couldn't reset device"); 287 287 } 288 288 else 289 289 { 290 OutputDebugString("We have reset the device. recreating resources..\n");290 LogDebugString("We have reset the device. recreating resources..."); 291 291 CreateVolatileResources(); 292 292 … … 300 300 else if (D3DERR_DEVICELOST == LastError) 301 301 { 302 OutputDebugString("D3D device lost\n");302 LogDebugString("D3D device lost"); 303 303 } 304 304 else if (D3DERR_DRIVERINTERNALERROR == LastError) … … 887 887 { 888 888 LogDxError(LastError, __LINE__, __FILE__); 889 OutputDebugString("Couldn't create screenshot surface\n");889 LogErrorString("Couldn't create screenshot surface"); 890 890 return; 891 891 } … … 895 895 { 896 896 LogDxError(LastError, __LINE__, __FILE__); 897 OutputDebugString("Couldn't get a copy of the front buffer\n");897 LogErrorString("Couldn't get a copy of the front buffer"); 898 898 SAFE_RELEASE(frontBuffer); 899 899 return; … … 904 904 { 905 905 LogDxError(LastError, __LINE__, __FILE__); 906 OutputDebugString("Save Surface to file failed\n");906 LogErrorString("Save Surface to file failed"); 907 907 } 908 908 … … 1239 1239 if (FAILED(LastError)) 1240 1240 { 1241 OutputDebugString(DXGetErrorString(LastError));1242 OutputDebugString(DXGetErrorDescription(LastError));1243 1244 1241 LogErrorString("D3DXCompileShaderFromFile failed for '" + actualPath + "'", __LINE__, __FILE__); 1242 LogErrorString("DX Error- " + std::string(DXGetErrorString(LastError)) + " " + std::string(DXGetErrorDescription(LastError))); 1245 1243 1246 1244 if (pErrors) … … 1248 1246 // shader didn't compile for some reason 1249 1247 LogErrorString("Shader compile errors found for '" + actualPath + "'", __LINE__, __FILE__); 1250 LogErrorString( "\n" +std::string((const char*)pErrors->GetBufferPointer()));1248 LogErrorString(std::string((const char*)pErrors->GetBufferPointer())); 1251 1249 1252 1250 pErrors->Release(); … … 1280 1278 std::stringstream message; 1281 1279 message << "Processing constants for vertex shader '" << fileName << "' which has " << constantTableDesc.Constants << " constant(s)\n"; 1282 OutputDebugString(message.str().c_str());1280 LogDebugString(message.str()); 1283 1281 1284 1282 D3DXCONSTANT_DESC constantDesc; … … 1297 1295 std::stringstream constantInfo; 1298 1296 constantInfo << "\t Name: " << constantDesc.Name << ", Register Index: " << constantDesc.RegisterIndex << /*", Register Index: " << constantDesc.RegisterIndex <<*/ "\n"; 1299 OutputDebugString(constantInfo.str().c_str());1297 LogDebugString(constantInfo.str()); 1300 1298 } 1301 1299 … … 1332 1330 if (FAILED(LastError)) 1333 1331 { 1334 OutputDebugString(DXGetErrorString(LastError));1335 OutputDebugString(DXGetErrorDescription(LastError));1336 1337 1332 LogErrorString("D3DXCompileShaderFromFile failed for '" + actualPath + "'", __LINE__, __FILE__); 1333 LogErrorString("DX Error- " + std::string(DXGetErrorString(LastError)) + " " + std::string(DXGetErrorDescription(LastError))); 1338 1334 1339 1335 if (pErrors) 1340 1336 { 1341 1337 // shader didn't compile for some reason 1342 OutputDebugString((const char*)pErrors->GetBufferPointer());1343 1344 1338 LogErrorString("Shader compile errors found for '" + actualPath + "'", __LINE__, __FILE__); 1345 LogErrorString( "\n" +std::string((const char*)pErrors->GetBufferPointer()));1339 LogErrorString(std::string((const char*)pErrors->GetBufferPointer())); 1346 1340 1347 1341 pErrors->Release(); … … 1375 1369 std::stringstream message; 1376 1370 message << "Processing constants for pixel shader '" << fileName << "' which has " << constantTableDesc.Constants << " constant(s)\n"; 1377 OutputDebugString(message.str().c_str());1371 LogDebugString(message.str()); 1378 1372 1379 1373 D3DXCONSTANT_DESC constantDesc; … … 1392 1386 std::stringstream constantInfo; 1393 1387 constantInfo << "\t Name: " << constantDesc.Name << ", Register Index: " << constantDesc.RegisterIndex << /*", Register Index: " << constantDesc.RegisterIndex <<*/ "\n"; 1394 OutputDebugString(constantInfo.str().c_str());1388 LogDebugString(constantInfo.str()); 1395 1389 } 1396 1390 … … 1884 1878 Con_PrintError(sstream.str()); 1885 1879 1886 OutputDebugString(DXGetErrorString(LastError));1887 OutputDebugString(DXGetErrorDescription(LastError));1888 OutputDebugString("\n");1889 1890 1880 // this'll occur if the resolution width and height passed aren't usable on this device 1891 1881 if (D3DERR_INVALIDCALL == LastError) … … 1973 1963 D3DFORMAT SelectedBackbufferFormat = D3DFMT_X8R8G8B8; // back buffer format 1974 1964 1975 if (WindowMode == WindowModeSubWindow) 1965 if (WindowMode == WindowModeSubWindow) { 1976 1966 windowed = true; 1967 } 1977 1968 1978 1969 // Zero d3d structure … … 2081 2072 for (; f < numFomats; f++ ) 2082 2073 { 2083 if (DisplayMode.Format == d3d.Driver[thisDevice].Formats[f]) 2074 if (DisplayMode.Format == d3d.Driver[thisDevice].Formats[f]) { 2084 2075 break; 2076 } 2085 2077 } 2086 2078 2087 2079 // If the format is new, add it to the list 2088 if (f == numFomats) 2080 if (f == numFomats) { 2089 2081 d3d.Driver[thisDevice].Formats[numFomats++] = DisplayMode.Format; 2082 } 2090 2083 } 2091 2084 } … … 2801 2794 if (FAILED(LastError)) 2802 2795 { 2803 OutputDebugString("D3DRS_ZWRITEENABLE D3DZB_TRUE failed\n");2796 LogDebugString("D3DRS_ZWRITEENABLE D3DZB_TRUE failed\n"); 2804 2797 } 2805 2798 } … … 2809 2802 if (FAILED(LastError)) 2810 2803 { 2811 OutputDebugString("D3DRS_ZWRITEENABLE D3DZB_FALSE failed\n");2812 OutputDebugString("DISABLING Z WRITES\n");2804 LogDebugString("D3DRS_ZWRITEENABLE D3DZB_FALSE failed\n"); 2805 LogDebugString("DISABLING Z WRITES\n"); 2813 2806 } 2814 2807 } … … 2835 2828 if (FAILED(LastError)) 2836 2829 { 2837 OutputDebugString("D3DSAMP_ADDRESSU Wrap fail\n");2830 LogDebugString("D3DSAMP_ADDRESSU Wrap fail\n"); 2838 2831 } 2839 2832 … … 2841 2834 if (FAILED(LastError)) 2842 2835 { 2843 OutputDebugString("D3DSAMP_ADDRESSV Wrap fail\n");2836 LogDebugString("D3DSAMP_ADDRESSV Wrap fail\n"); 2844 2837 } 2845 2838 … … 2847 2840 if (FAILED(LastError)) 2848 2841 { 2849 OutputDebugString("D3DSAMP_ADDRESSW Wrap fail\n");2842 LogDebugString("D3DSAMP_ADDRESSW Wrap fail\n"); 2850 2843 } 2851 2844 } … … 2856 2849 if (FAILED(LastError)) 2857 2850 { 2858 OutputDebugString("D3DSAMP_ADDRESSU Clamp fail\n");2851 LogDebugString("D3DSAMP_ADDRESSU Clamp fail\n"); 2859 2852 } 2860 2853 … … 2862 2855 if (FAILED(LastError)) 2863 2856 { 2864 OutputDebugString("D3DSAMP_ADDRESSV Clamp fail\n");2857 LogDebugString("D3DSAMP_ADDRESSV Clamp fail\n"); 2865 2858 } 2866 2859 … … 2868 2861 if (FAILED(LastError)) 2869 2862 { 2870 OutputDebugString("D3DSAMP_ADDRESSW Clamp fail\n");2863 LogDebugString("D3DSAMP_ADDRESSW Clamp fail\n"); 2871 2864 } 2872 2865 } … … 2897 2890 default: 2898 2891 { 2899 LOCALASSERT("Unrecognized filtering mode"==0); 2900 OutputDebugString("Unrecognized filtering mode\n"); 2892 LogDebugString("Unrecognized filtering mode\n"); 2901 2893 break; 2902 2894 }