mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
pass arguments by reference-to-const rather than by value, it's usually more efficient...
svn-id: r15477
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@ const int ActionMap::getExitScene(int exitNum) {
|
||||
}
|
||||
|
||||
|
||||
int ActionMap::hitTest(Point imouse) {
|
||||
int ActionMap::hitTest(const Point& imouse) {
|
||||
R_ACTIONMAP_ENTRY *exmap_entry;
|
||||
R_CLICKAREA *clickarea;
|
||||
Point *points;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class ActionMap {
|
||||
~ActionMap(void);
|
||||
|
||||
const int getExitScene(int exitNum);
|
||||
int hitTest(Point imousePt);
|
||||
int hitTest(const Point& imousePt);
|
||||
int draw(R_SURFACE *ds, int color);
|
||||
|
||||
void info(void);
|
||||
|
||||
+3
-3
@@ -729,7 +729,7 @@ int Actor::deleteActor(int index) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Actor::walkTo(int id, Point *walk_pt, uint16 flags, R_SEMAPHORE *sem) {
|
||||
int Actor::walkTo(int id, const Point *walk_pt, uint16 flags, R_SEMAPHORE *sem) {
|
||||
R_ACTORINTENT actor_intent;
|
||||
R_WALKINTENT *walk_intent;
|
||||
R_WALKINTENT zero_intent;
|
||||
@@ -953,7 +953,7 @@ int Actor::handleWalkIntent(R_ACTOR *actor, R_WALKINTENT *a_walkint, int *comple
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Actor::move(int index, Point *move_pt) {
|
||||
int Actor::move(int index, const Point *move_pt) {
|
||||
YS_DL_NODE *node;
|
||||
R_ACTOR *actor;
|
||||
|
||||
@@ -985,7 +985,7 @@ int Actor::move(int index, Point *move_pt) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Actor::moveRelative(int index, Point *move_pt) {
|
||||
int Actor::moveRelative(int index, const Point *move_pt) {
|
||||
YS_DL_NODE *node;
|
||||
R_ACTOR *actor;
|
||||
|
||||
|
||||
+3
-3
@@ -199,10 +199,10 @@ class Actor {
|
||||
int AtoS(Point *logical, const Point *actor);
|
||||
int StoA(Point *actor, const Point screen);
|
||||
|
||||
int move(int index, Point *move_pt);
|
||||
int moveRelative(int index, Point *move_pt);
|
||||
int move(int index, const Point *move_pt);
|
||||
int moveRelative(int index, const Point *move_pt);
|
||||
|
||||
int walkTo(int index, Point *walk_pt, uint16 flags, R_SEMAPHORE *sem);
|
||||
int walkTo(int index, const Point *walk_pt, uint16 flags, R_SEMAPHORE *sem);
|
||||
|
||||
int getActorIndex(uint16 actor_id);
|
||||
|
||||
|
||||
+7
-7
@@ -415,7 +415,7 @@ int Gfx::drawRect(R_SURFACE *ds, Rect *dst_rect, int color) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Gfx::drawFrame(R_SURFACE *ds, Point *p1, Point *p2, int color) {
|
||||
int Gfx::drawFrame(R_SURFACE *ds, const Point *p1, const Point *p2, int color) {
|
||||
int left, top, right, bottom;
|
||||
|
||||
int min_x;
|
||||
@@ -457,8 +457,8 @@ int Gfx::drawFrame(R_SURFACE *ds, Point *p1, Point *p2, int color) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Gfx::drawPolyLine(R_SURFACE *ds, Point *pts, int pt_ct, int draw_color) {
|
||||
Point *first_pt = pts;
|
||||
int Gfx::drawPolyLine(R_SURFACE *ds, const Point *pts, int pt_ct, int draw_color) {
|
||||
const Point *first_pt = pts;
|
||||
int last_i = 1;
|
||||
int i;
|
||||
|
||||
@@ -634,7 +634,7 @@ int Gfx::clipLine(R_SURFACE *ds, const Point *src_p1, const Point *src_p2,
|
||||
// Coriolis Group Books, 1997
|
||||
//
|
||||
// Performs no clipping
|
||||
void Gfx::drawLine(R_SURFACE *ds, Point *p1, Point *p2, int color) {
|
||||
void Gfx::drawLine(R_SURFACE *ds, const Point *p1, const Point *p2, int color) {
|
||||
byte *write_p;
|
||||
int clip_result;
|
||||
int temp;
|
||||
@@ -1076,14 +1076,14 @@ void Gfx::setCursor(int best_white) {
|
||||
_system->setMouseCursor(cursor_img, R_CURSOR_W, R_CURSOR_H, 4, 4, keycolor);
|
||||
}
|
||||
|
||||
bool Gfx::hitTestPoly(Point *points, unsigned int npoints, Point test_point) {
|
||||
bool Gfx::hitTestPoly(const Point *points, unsigned int npoints, const Point& test_point) {
|
||||
int yflag0;
|
||||
int yflag1;
|
||||
bool inside_flag = false;
|
||||
unsigned int pt;
|
||||
|
||||
Point *vtx0 = &points[npoints - 1];
|
||||
Point *vtx1 = &points[0];
|
||||
const Point *vtx0 = &points[npoints - 1];
|
||||
const Point *vtx1 = &points[0];
|
||||
|
||||
yflag0 = (vtx0->y >= test_point.y);
|
||||
for (pt = 0; pt < npoints; pt++, vtx1++) {
|
||||
|
||||
+4
-4
@@ -92,11 +92,11 @@ public:
|
||||
int bufToBuffer(byte * dst_buf, int dst_w, int dst_h, const byte *src,
|
||||
int src_w, int src_h, Rect *src_rect, Point *dst_pt);
|
||||
int drawRect(R_SURFACE *ds, Rect *dst_rect, int color);
|
||||
int drawFrame(R_SURFACE *ds, Point *p1, Point *p2, int color);
|
||||
int drawPolyLine(R_SURFACE *ds, Point *pts, int pt_ct, int draw_color);
|
||||
int drawFrame(R_SURFACE *ds, const Point *p1, const Point *p2, int color);
|
||||
int drawPolyLine(R_SURFACE *ds, const Point *pts, int pt_ct, int draw_color);
|
||||
int getClipInfo(R_CLIPINFO *clipinfo);
|
||||
int clipLine(R_SURFACE *ds, const Point *src_p1, const Point *src_p2, Point *dst_p1, Point *dst_p2);
|
||||
void drawLine(R_SURFACE * ds, Point *p1, Point *p2, int color);
|
||||
void drawLine(R_SURFACE * ds, const Point *p1, const Point *p2, int color);
|
||||
|
||||
Gfx(OSystem *system, int width, int height);
|
||||
R_SURFACE *getBackBuffer();
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
int getCurrentPal(PALENTRY *src_pal);
|
||||
int palToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent);
|
||||
int blackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent);
|
||||
bool hitTestPoly(Point *points, unsigned int npoints, Point test_point);
|
||||
bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_point);
|
||||
|
||||
private:
|
||||
void setCursor(int best_white);
|
||||
|
||||
+6
-6
@@ -303,7 +303,7 @@ int Interface::draw() {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::update(Point imousePt, int update_flag) {
|
||||
int Interface::update(const Point& imousePt, int update_flag) {
|
||||
R_GAME_DISPLAYINFO g_di;
|
||||
|
||||
R_SURFACE *back_buf;
|
||||
@@ -369,7 +369,7 @@ int Interface::drawStatusBar(R_SURFACE *ds) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::handleCommandClick(R_SURFACE *ds, Point imousePt) {
|
||||
int Interface::handleCommandClick(R_SURFACE *ds, const Point& imousePt) {
|
||||
int hit_button;
|
||||
int ibutton_num;
|
||||
|
||||
@@ -420,7 +420,7 @@ int Interface::handleCommandClick(R_SURFACE *ds, Point imousePt) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::handleCommandUpdate(R_SURFACE *ds, Point imousePt) {
|
||||
int Interface::handleCommandUpdate(R_SURFACE *ds, const Point& imousePt) {
|
||||
int hit_button;
|
||||
int ibutton_num;
|
||||
|
||||
@@ -474,7 +474,7 @@ int Interface::handleCommandUpdate(R_SURFACE *ds, Point imousePt) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::handlePlayfieldClick(R_SURFACE *ds, Point imousePt) {
|
||||
int Interface::handlePlayfieldClick(R_SURFACE *ds, const Point& imousePt) {
|
||||
int objectNum;
|
||||
uint16 object_flags = 0;
|
||||
|
||||
@@ -511,7 +511,7 @@ int Interface::handlePlayfieldClick(R_SURFACE *ds, Point imousePt) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::handlePlayfieldUpdate(R_SURFACE *ds, Point imousePt) {
|
||||
int Interface::handlePlayfieldUpdate(R_SURFACE *ds, const Point& imousePt) {
|
||||
const char *object_name;
|
||||
int objectNum;
|
||||
uint16 object_flags = 0;
|
||||
@@ -546,7 +546,7 @@ int Interface::handlePlayfieldUpdate(R_SURFACE *ds, Point imousePt) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int Interface::hitTest(Point imousePt, int *ibutton) {
|
||||
int Interface::hitTest(const Point& imousePt, int *ibutton) {
|
||||
R_INTERFACE_BUTTON *buttons;
|
||||
|
||||
int nbuttons;
|
||||
|
||||
+6
-6
@@ -160,16 +160,16 @@ class Interface {
|
||||
int deactivate();
|
||||
int setStatusText(const char *new_txt);
|
||||
int draw();
|
||||
int update(Point imousePt, int update_flag);
|
||||
int update(const Point& imousePt, int update_flag);
|
||||
|
||||
|
||||
private:
|
||||
int hitTest(Point imousePt, int *ibutton);
|
||||
int hitTest(const Point& imousePt, int *ibutton);
|
||||
int drawStatusBar(R_SURFACE *ds);
|
||||
int handleCommandUpdate(R_SURFACE *ds, Point imousePt);
|
||||
int handleCommandClick(R_SURFACE *ds, Point imousePt);
|
||||
int handlePlayfieldUpdate(R_SURFACE *ds, Point imousePt);
|
||||
int handlePlayfieldClick(R_SURFACE *ds, Point imousePt);
|
||||
int handleCommandUpdate(R_SURFACE *ds, const Point& imousePt);
|
||||
int handleCommandClick(R_SURFACE *ds, const Point& imousePt);
|
||||
int handlePlayfieldUpdate(R_SURFACE *ds, const Point& imousePt);
|
||||
int handlePlayfieldClick(R_SURFACE *ds, const Point& imousePt);
|
||||
|
||||
private:
|
||||
SagaEngine *_vm;
|
||||
|
||||
+2
-2
@@ -246,7 +246,7 @@ const int ObjectMap::getEPNum(int object) {
|
||||
|
||||
// Uses Gfx::drawLine to display all clickareas for each object in the
|
||||
// currently loaded object map resource.
|
||||
int ObjectMap::draw(R_SURFACE *ds, Point imousePt, int color, int color2) {
|
||||
int ObjectMap::draw(R_SURFACE *ds, const Point& imousePt, int color, int color2) {
|
||||
R_OBJECTMAP_ENTRY *object_map;
|
||||
R_CLICKAREA *clickarea;
|
||||
|
||||
@@ -301,7 +301,7 @@ int ObjectMap::draw(R_SURFACE *ds, Point imousePt, int color, int color2) {
|
||||
return R_SUCCESS;
|
||||
}
|
||||
|
||||
int ObjectMap::hitTest(Point imousePt) {
|
||||
int ObjectMap::hitTest(const Point& imousePt) {
|
||||
Point imouse;
|
||||
R_OBJECTMAP_ENTRY *object_map;
|
||||
R_CLICKAREA *clickarea;
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ public:
|
||||
const char *getName(int object);
|
||||
const uint16 getFlags(int object);
|
||||
const int getEPNum(int object);
|
||||
int draw(R_SURFACE *draw_surface, Point imousePt, int color, int color2);
|
||||
int hitTest(Point imousePt);
|
||||
int draw(R_SURFACE *draw_surface, const Point& imousePt, int color, int color2);
|
||||
int hitTest(const Point& imousePt);
|
||||
void info(void);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user