From d158e10c40c96bbfdc9aa5f9e576259f227cb3ab Mon Sep 17 00:00:00 2001 From: maride Date: Sat, 2 Apr 2016 15:12:08 +0200 Subject: [PATCH] Remove registration checks This is not complete; TODO: * Remove "demoAvailable" variable from car struct * Remove "UNREGISTERED" string from main menu * etc. --- source/carphysics.cpp | 3 --- source/carselection.cpp | 53 ++++++++++++++++------------------------- source/collision.cpp | 15 +----------- source/controls.cpp | 2 -- 4 files changed, 22 insertions(+), 51 deletions(-) diff --git a/source/carphysics.cpp b/source/carphysics.cpp index 9ec9e22..66e615d 100755 --- a/source/carphysics.cpp +++ b/source/carphysics.cpp @@ -736,9 +736,6 @@ void CarPhysicsEntitySimulation(tGameEntity *carEntity) tCarPhysics *phys=(tCarPhysics*)carEntity->physics; tCarDefinition *car=&(phys->car); tWheelCalcData wheels[kMaxWheels]; - - if(carEntity==gViewedEntity) - phys->regCode=RT3_GetLicenseCode(); //Wheels position and velocity CalcWheelPositions(carEntity,car,phys,wheels); diff --git a/source/carselection.cpp b/source/carselection.cpp index 16fadbb..eb6fca6 100644 --- a/source/carselection.cpp +++ b/source/carselection.cpp @@ -27,18 +27,13 @@ #include "gamesound.h" #include "random.h" -#define REGISTERED (RT3_IsRegistered()) - char *StripName(char *aName); int CompareCars(const void *a,const void *b) { tCarDefinition *cara=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)a,kParserTypeCarDesc,sizeof(tCarDefinition)); tCarDefinition *carb=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)b,kParserTypeCarDesc,sizeof(tCarDefinition)); - if(!REGISTERED) - if(cara->demoAvailable!=carb->demoAvailable) - return carb->demoAvailable-cara->demoAvailable; - return _stricmp(StripName(cara->carName),StripName(carb->carName)); + return _stricmp(StripName(cara->carName),StripName(carb->carName)); } void GetAvailableCars(tFileRef *availableCars,int *carCount,int onlyBuiltIn,int onlyAvailable) @@ -223,13 +218,10 @@ void CarSelectionDrawSpecs(tFileRef *availableCars,int numAvailable,int selected TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-4*kSpecsOffset),kSpecsSize,kSpecsAlign,"Torque: \255#a\255%3.0f lb-ft @ %4.0f RPM",car->torque/1.35628105,car->torqueRPM); } } - if(!car->demoAvailable&&!REGISTERED&&mode!=kCarSelectionEnemyMode) - TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"DEMO"); -// TextPrintfToBufferFormatedColored(Vector(0.2,0.2),0.25,kTextAlignMiddle,1,1,1,0.8,"\255demo_car.png\255"); - else if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode) + if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode) TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"LOCKED"); if(available) - *available=((car->demoAvailable||REGISTERED)&&HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))||mode==kCarSelectionEnemyMode; + *available=(HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))||mode==kCarSelectionEnemyMode; gTextOpacity=1; } @@ -512,15 +504,14 @@ void SelectNextCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo) selection=i; tCarDefinition *c; - do{ - selection=(selection+1)%carCount; - c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); - if(color) - if(c->numColors) - *color=RandomInt(0,c->numColors); - else - *color=0; - }while(!c->demoAvailable&&!REGISTERED&&onlyDemo); + selection=(selection+1)%carCount; + c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); + if(color) + if(c->numColors) + *color=RandomInt(0,c->numColors); + else + *color=0; + *car=availableCars[selection]; // gConfig->lastCar=*car; @@ -538,18 +529,16 @@ void SelectPrevCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo) selection=i; tCarDefinition *c; - do{ - selection--; - if(selection<0) - selection+=carCount; - c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); - if(color) - if(c->numColors) - *color=RandomInt(0,c->numColors); - else - *color=0; - }while(!c->demoAvailable&&!REGISTERED&&onlyDemo); - + selection--; + if(selection<0) + selection+=carCount; + c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); + if(color) + if(c->numColors) + *color=RandomInt(0,c->numColors); + else + *color=0; + *car=availableCars[selection]; // gConfig->lastCar=*car; } diff --git a/source/collision.cpp b/source/collision.cpp index cd8ba96..8448f9b 100755 --- a/source/collision.cpp +++ b/source/collision.cpp @@ -55,14 +55,7 @@ void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,flo tCarPhysics *phys=(tCarPhysics*)entity->physics; tCarDefinition *car=&(phys->car); - int isValid; - #ifndef __TARGET_TOOLAPP - if(entity->regData) - qRT3_LicenseTestApp1(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid); - #else - isValid=true; - #endif - + //how mcuh force is required to accelerate the object? tVector3 force=veloDiff*car->mass*kFPS*rotationFactor; @@ -94,8 +87,6 @@ void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,flo impact*=0.2; if(impact>1)impact=1; FFBJolt(impact,impact,0.3); - if(!isValid&&(gMapInfo->demoAvailable+gMapInfo->numObjs)) - veloDiff=veloDiff*200; } //change velocity of object @@ -777,10 +768,6 @@ tRegData rd; //check for any object collisions void CollisionFrame() { - #ifndef __TARGET_TOOLAPP - rd.name=RT3_GetLicenseName(); - rd.numCopies=RT3_GetLicenseCopies(); - #endif tGameEntity *entity=(tGameEntity*)gFirstEntity->next; while(entity!=gFirstEntity) { diff --git a/source/controls.cpp b/source/controls.cpp index 365e303..7dc030b 100755 --- a/source/controls.cpp +++ b/source/controls.cpp @@ -12,8 +12,6 @@ #include "gametime.h" #include "network.h" #include "random.h" -#include "reg_tool_3.h" -#include "rt3_redline.h" #include "initexit.h" #include "text.h"